From bd513a94853849dedad597cf5ef14d2bcfbd47ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 26 Jan 2023 17:44:26 +0100 Subject: [PATCH 01/39] Remove old client, remove v1 API, generate new V2 client, add docs --- client/.gitignore | 24 + client/.openapi-generator-ignore | 25 + client/.openapi-generator/FILES | 170 + client/.openapi-generator/VERSION | 1 + client/.travis.yml | 8 + client/README.md | 261 + client/accessnodes.go | 19 - client/activatechain.go | 18 - client/api/openapi.yaml | 4475 +++++++++++++++++ client/api_chains.go | 1294 +++++ client/api_corecontracts.go | 2984 +++++++++++ client/api_metrics.go | 520 ++ client/api_node.go | 1460 ++++++ client/api_requests.go | 437 ++ client/api_users.go | 760 +++ client/authentication.go | 34 - client/callview.go | 29 - client/chain_info.go | 21 - client/chain_record.go | 44 - client/chainclient/callview.go | 11 - client/chainclient/chainrecord.go | 8 - client/chainclient/checkrequest.go | 33 - client/chainclient/evm.go | 11 - client/chainclient/stateget.go | 6 - client/chainclient/uploadblob.go | 29 - client/client.go | 136 - client/configuration.go | 234 + client/dkshares.go | 29 - client/docs/AccountListResponse.md | 56 + client/docs/AccountNFTsResponse.md | 56 + client/docs/AccountNonceResponse.md | 56 + client/docs/AddUserRequest.md | 108 + client/docs/AliasOutputMetricItem.md | 108 + client/docs/Allowance.md | 82 + client/docs/AssetsResponse.md | 82 + client/docs/BaseToken.md | 186 + client/docs/Blob.md | 82 + client/docs/BlobInfoResponse.md | 56 + client/docs/BlobListResponse.md | 56 + client/docs/BlobValueResponse.md | 56 + client/docs/BlockInfoResponse.md | 368 ++ client/docs/BlockReceiptError.md | 82 + client/docs/BlockReceiptsResponse.md | 56 + client/docs/BurnLog.md | 56 + client/docs/BurnRecord.md | 82 + client/docs/CallTarget.md | 82 + client/docs/ChainInfoResponse.md | 264 + client/docs/ChainMetrics.md | 264 + client/docs/ChainsApi.md | 760 +++ client/docs/CommitteeInfoResponse.md | 186 + client/docs/CommitteeNode.md | 82 + client/docs/ConsensusPipeMetrics.md | 160 + client/docs/ConsensusWorkflowMetrics.md | 498 ++ client/docs/ContractCallViewRequest.md | 186 + client/docs/ContractInfoResponse.md | 134 + client/docs/ControlAddressesResponse.md | 108 + client/docs/CorecontractsApi.md | 1858 +++++++ client/docs/DKSharesInfo.md | 186 + client/docs/DKSharesPostRequest.md | 108 + client/docs/ErrorMessageFormatResponse.md | 56 + client/docs/EventsResponse.md | 56 + client/docs/FoundryOutputResponse.md | 82 + client/docs/FungibleTokens.md | 82 + client/docs/GasFeePolicy.md | 108 + client/docs/GovChainInfoResponse.md | 212 + client/docs/InOutput.md | 82 + client/docs/InOutputMetricItem.md | 108 + client/docs/InStateOutput.md | 82 + client/docs/InStateOutputMetricItem.md | 108 + client/docs/InfoResponse.md | 134 + client/docs/InterfaceMetricItem.md | 108 + client/docs/Item.md | 82 + client/docs/JSONDict.md | 56 + client/docs/L1Params.md | 108 + client/docs/MetricsApi.md | 275 + client/docs/NFTDataResponse.md | 134 + client/docs/NativeToken.md | 82 + client/docs/NativeTokenIDRegistryResponse.md | 56 + client/docs/NodeApi.md | 749 +++ client/docs/NodeOwnerCertificateRequest.md | 82 + client/docs/OffLedgerRequest.md | 82 + client/docs/OnLedgerRequest.md | 134 + client/docs/OnLedgerRequestMetricItem.md | 108 + client/docs/Output.md | 82 + client/docs/OutputID.md | 56 + client/docs/PeeringNodeIdentityResponse.md | 108 + client/docs/PeeringNodeStatusResponse.md | 160 + client/docs/PeeringTrustRequest.md | 82 + client/docs/ProtocolParameters.md | 212 + client/docs/ReceiptError.md | 186 + client/docs/ReceiptResponse.md | 238 + client/docs/RentStructure.md | 108 + client/docs/RequestDetail.md | 316 ++ client/docs/RequestIDsResponse.md | 56 + client/docs/RequestProcessedResponse.md | 108 + client/docs/RequestReceiptResponse.md | 238 + client/docs/RequestsApi.md | 282 ++ client/docs/Transaction.md | 56 + client/docs/TransactionIDMetricItem.md | 108 + client/docs/TransactionMetricItem.md | 108 + client/docs/TxInclusionStateMsg.md | 82 + client/docs/TxInclusionStateMsgMetricItem.md | 108 + client/docs/UTXOInputMetricItem.md | 108 + client/docs/UpdateUserPasswordRequest.md | 56 + client/docs/UpdateUserPermissionsRequest.md | 56 + client/docs/User.md | 82 + client/docs/UsersApi.md | 405 ++ client/docs/ValidationError.md | 82 + client/evm.go | 19 - client/gas.go | 15 - client/git_push.sh | 57 + client/go.mod | 7 + client/go.sum | 13 + client/info.go | 17 - client/metrics.go | 44 - client/model_account_list_response.go | 115 + client/model_account_nfts_response.go | 115 + client/model_account_nonce_response.go | 115 + client/model_add_user_request.go | 187 + client/model_alias_output_metric_item.go | 188 + client/model_allowance.go | 151 + client/model_assets_response.go | 151 + client/model_base_token.go | 301 ++ client/model_blob.go | 151 + client/model_blob_info_response.go | 115 + client/model_blob_list_response.go | 115 + client/model_blob_value_response.go | 115 + client/model_block_info_response.go | 548 ++ client/model_block_receipt_error.go | 151 + client/model_block_receipts_response.go | 115 + client/model_burn_log.go | 115 + client/model_burn_record.go | 151 + client/model_call_target.go | 151 + client/model_chain_info_response.go | 411 ++ client/model_chain_metrics.go | 403 ++ client/model_committee_info_response.go | 300 ++ client/model_committee_node.go | 151 + client/model_consensus_pipe_metrics.go | 259 + client/model_consensus_workflow_metrics.go | 746 +++ client/model_contract_call_view_request.go | 300 ++ client/model_contract_info_response.go | 227 + client/model_control_addresses_response.go | 187 + client/model_dk_shares_info.go | 299 ++ client/model_dk_shares_post_request.go | 189 + client/model_error_message_format_response.go | 115 + client/model_events_response.go | 115 + client/model_foundry_output_response.go | 151 + client/model_fungible_tokens.go | 151 + client/model_gas_fee_policy.go | 190 + client/model_gov_chain_info_response.go | 337 ++ client/model_in_output.go | 152 + client/model_in_output_metric_item.go | 188 + client/model_in_state_output.go | 152 + client/model_in_state_output_metric_item.go | 188 + client/model_info_response.go | 226 + client/model_interface_metric_item.go | 188 + client/model_item.go | 153 + client/model_json_dict.go | 115 + client/model_l1_params.go | 188 + client/model_native_token.go | 151 + ...model_native_token_id_registry_response.go | 115 + client/model_nft_data_response.go | 223 + .../model_node_owner_certificate_request.go | 153 + client/model_off_ledger_request.go | 153 + client/model_on_ledger_request.go | 226 + client/model_on_ledger_request_metric_item.go | 188 + client/model_output.go | 153 + client/model_output_id.go | 116 + .../model_peering_node_identity_response.go | 189 + client/model_peering_node_status_response.go | 263 + client/model_peering_trust_request.go | 153 + client/model_protocol_parameters.go | 337 ++ client/model_receipt_error.go | 295 ++ client/model_receipt_response.go | 367 ++ client/model_rent_structure.go | 190 + client/model_request_detail.go | 475 ++ client/model_request_ids_response.go | 115 + client/model_request_processed_response.go | 187 + client/model_request_receipt_response.go | 367 ++ client/model_transaction.go | 116 + client/model_transaction_id_metric_item.go | 188 + client/model_transaction_metric_item.go | 188 + client/model_tx_inclusion_state_msg.go | 153 + ...odel_tx_inclusion_state_msg_metric_item.go | 188 + client/model_update_user_password_request.go | 115 + .../model_update_user_permissions_request.go | 115 + client/model_user.go | 151 + client/model_utxo_input_metric_item.go | 188 + client/model_validation_error.go | 151 + client/multiclient/activate.go | 20 - client/multiclient/chain_record.go | 13 - client/multiclient/dkshares.go | 18 - client/multiclient/multiclient.go | 67 - client/multiclient/reqstatus.go | 70 - client/node_ownership.go | 26 - client/offledger.go | 16 - client/peering.go | 54 - client/reqstatus.go | 85 - client/response.go | 47 + client/scclient/callview.go | 9 - client/scclient/postrequest.go | 19 - client/scclient/scclient.go | 23 - client/scclient/stateget.go | 6 - client/shutdown.go | 12 - client/stateget.go | 18 - client/test/api_chains_test.go | 181 + client/test/api_corecontracts_test.go | 407 ++ client/test/api_metrics_test.go | 79 + client/test/api_node_test.go | 171 + client/test/api_requests_test.go | 79 + client/test/api_users_test.go | 105 + client/utils.go | 343 ++ .../{v2 => }/CLIENT_LIBRARY_CODE_GEN.md | 0 packages/webapi/{v2 => }/api.go | 40 +- .../webapi/{v2 => }/apierrors/errorhandler.go | 0 packages/webapi/{v2 => }/apierrors/errors.go | 0 .../webapi/{v2 => }/apierrors/httperror.go | 0 .../webapi/compatibility_error_handler.go | 10 +- .../controllers/chain/access_nodes.go | 6 +- .../{v2 => }/controllers/chain/chain.go | 6 +- .../{v2 => }/controllers/chain/contracts.go | 4 +- .../{v2 => }/controllers/chain/controller.go | 4 +- .../webapi/{v2 => }/controllers/chain/evm.go | 4 +- .../{v2 => }/controllers/chain/management.go | 2 +- .../{v2 => }/controllers/chain/websocket.go | 2 +- .../controllers/corecontracts/accounts.go | 6 +- .../controllers/corecontracts/blob.go | 4 +- .../controllers/corecontracts/blocklog.go | 8 +- .../controllers/corecontracts/controller.go | 6 +- .../controllers/corecontracts/errors.go | 4 +- .../controllers/corecontracts/governance.go | 4 +- .../{v2 => }/controllers/metrics/chain.go | 4 +- .../controllers/metrics/controller.go | 4 +- .../{v2 => }/controllers/node/controller.go | 24 +- .../webapi/{v2 => }/controllers/node/dkg.go | 4 +- .../webapi/{v2 => }/controllers/node/info.go | 2 +- .../{v2 => }/controllers/node/management.go | 4 +- .../{v2 => }/controllers/node/peering.go | 4 +- .../{v2 => }/controllers/requests/callview.go | 4 +- .../controllers/requests/controller.go | 10 +- .../controllers/requests/offledger.go | 4 +- .../{v2 => }/controllers/requests/receipt.go | 6 +- .../controllers/requests/waitforrequest.go | 4 +- .../{v2 => }/controllers/users/controller.go | 4 +- .../webapi/{v2 => }/controllers/users/user.go | 4 +- .../webapi/{v2 => }/corecontracts/README.md | 0 .../webapi/{v2 => }/corecontracts/accounts.go | 2 +- .../webapi/{v2 => }/corecontracts/blob.go | 2 +- .../webapi/{v2 => }/corecontracts/blocklog.go | 2 +- .../webapi/{v2 => }/corecontracts/errors.go | 2 +- .../{v2 => }/corecontracts/governance.go | 2 +- packages/webapi/{v2 => }/dto/chain.go | 0 packages/webapi/{v2 => }/dto/metrics.go | 0 packages/webapi/{v2 => }/dto/node.go | 0 packages/webapi/{v2 => }/dto/peering.go | 0 .../webapi/{v2 => }/interfaces/interfaces.go | 32 +- packages/webapi/{v2 => }/mocker.go | 2 +- packages/webapi/{v2 => }/models/L1.go | 0 packages/webapi/{v2 => }/models/chain.go | 8 +- .../webapi/{v2 => }/models/core_accounts.go | 0 .../webapi/{v2 => }/models/core_blocklog.go | 0 packages/webapi/{v2 => }/models/dks.go | 0 packages/webapi/{v2 => }/models/metrics.go | 3 +- .../models/mock/ChainInfoResponse.json | 0 .../models/mock/ChainInfoResponse[].json | 0 .../models/mock/CommitteeInfoResponse.json | 0 .../models/mock/ContractInfoResponse[].json | 0 .../{v2 => }/models/mock/InfoResponse.json | 0 .../mock/PeeringNodeIdentityResponse.json | 0 .../mock/PeeringNodeIdentityResponse[].json | 0 .../mock/PeeringNodeStatusResponse.json | 0 .../mock/PeeringNodeStatusResponse[].json | 0 .../models/mock/PeeringTrustRequest.json | 0 packages/webapi/{v2 => }/models/node.go | 0 packages/webapi/{v2 => }/models/peering.go | 0 packages/webapi/{v2 => }/models/requests.go | 0 packages/webapi/{v2 => }/models/user.go | 0 packages/webapi/{v2 => }/models/vm.go | 0 packages/webapi/{v2 => }/params/decoder.go | 2 +- packages/webapi/{v2 => }/services/chain.go | 6 +- .../webapi/{v2 => }/services/committee.go | 26 +- packages/webapi/{v2 => }/services/dkg.go | 2 +- packages/webapi/{v2 => }/services/evm.go | 2 +- packages/webapi/{v2 => }/services/metrics.go | 6 +- packages/webapi/{v2 => }/services/node.go | 2 +- .../webapi/{v2 => }/services/offledger.go | 2 +- packages/webapi/{v2 => }/services/peering.go | 2 +- packages/webapi/{v2 => }/services/registry.go | 2 +- packages/webapi/{v2 => }/services/user.go | 4 +- packages/webapi/{v2 => }/services/vm.go | 4 +- packages/webapi/{v2 => }/test/mock_test.go | 14 +- packages/webapi/v1/admapi/accessnodes.go | 92 - packages/webapi/v1/admapi/activatechain.go | 254 - packages/webapi/v1/admapi/chainmetrics.go | 244 - packages/webapi/v1/admapi/chainrecord.go | 124 - packages/webapi/v1/admapi/dkshares.go | 161 - packages/webapi/v1/admapi/endpoints.go | 56 - packages/webapi/v1/admapi/node_owner.go | 93 - packages/webapi/v1/admapi/peering.go | 214 - packages/webapi/v1/admapi/shutdown.go | 32 - packages/webapi/v1/endpoints.go | 79 - packages/webapi/v1/evm/jsonrpc.go | 126 - packages/webapi/v1/httperrors/errorhandler.go | 23 - packages/webapi/v1/httperrors/errors.go | 37 - packages/webapi/v1/info/info.go | 39 - packages/webapi/v1/model/address.go | 42 - packages/webapi/v1/model/blob.go | 20 - packages/webapi/v1/model/bytes.go | 45 - packages/webapi/v1/model/chain_info.go | 20 - packages/webapi/v1/model/chain_record.go | 42 - packages/webapi/v1/model/chainid.go | 41 - packages/webapi/v1/model/consensus_metrics.go | 36 - packages/webapi/v1/model/dkshares.go | 21 - packages/webapi/v1/model/hash.go | 41 - packages/webapi/v1/model/httperror.go | 34 - packages/webapi/v1/model/info.go | 7 - .../v1/model/node_connection_metrics.go | 71 - .../webapi/v1/model/node_owner_certificate.go | 13 - packages/webapi/v1/model/offledger_request.go | 5 - packages/webapi/v1/model/peering.go | 28 - packages/webapi/v1/model/reqstatus.go | 15 - packages/webapi/v1/model/requestid.go | 36 - packages/webapi/v1/reqstatus/reqstatus.go | 155 - .../webapi/v1/reqstatus/reqstatus_test.go | 89 - packages/webapi/v1/request/request.go | 138 - packages/webapi/v1/request/request_test.go | 74 - packages/webapi/v1/routes/routes.go | 128 - packages/webapi/v1/state/callview.go | 152 - packages/webapi/v1/testutil/httptest.go | 119 - packages/webapi/v1/testutil/mockchain.go | 100 - packages/webapi/v1/websocket.go | 36 - plugins/webapi/component.go | 30 +- 332 files changed, 42552 insertions(+), 4255 deletions(-) create mode 100644 client/.gitignore create mode 100644 client/.openapi-generator-ignore create mode 100644 client/.openapi-generator/FILES create mode 100644 client/.openapi-generator/VERSION create mode 100644 client/.travis.yml create mode 100644 client/README.md delete mode 100644 client/accessnodes.go delete mode 100644 client/activatechain.go create mode 100644 client/api/openapi.yaml create mode 100644 client/api_chains.go create mode 100644 client/api_corecontracts.go create mode 100644 client/api_metrics.go create mode 100644 client/api_node.go create mode 100644 client/api_requests.go create mode 100644 client/api_users.go delete mode 100644 client/authentication.go delete mode 100644 client/callview.go delete mode 100644 client/chain_info.go delete mode 100644 client/chain_record.go delete mode 100644 client/chainclient/callview.go delete mode 100644 client/chainclient/chainrecord.go delete mode 100644 client/chainclient/checkrequest.go delete mode 100644 client/chainclient/evm.go delete mode 100644 client/chainclient/stateget.go delete mode 100644 client/chainclient/uploadblob.go delete mode 100644 client/client.go create mode 100644 client/configuration.go delete mode 100644 client/dkshares.go create mode 100644 client/docs/AccountListResponse.md create mode 100644 client/docs/AccountNFTsResponse.md create mode 100644 client/docs/AccountNonceResponse.md create mode 100644 client/docs/AddUserRequest.md create mode 100644 client/docs/AliasOutputMetricItem.md create mode 100644 client/docs/Allowance.md create mode 100644 client/docs/AssetsResponse.md create mode 100644 client/docs/BaseToken.md create mode 100644 client/docs/Blob.md create mode 100644 client/docs/BlobInfoResponse.md create mode 100644 client/docs/BlobListResponse.md create mode 100644 client/docs/BlobValueResponse.md create mode 100644 client/docs/BlockInfoResponse.md create mode 100644 client/docs/BlockReceiptError.md create mode 100644 client/docs/BlockReceiptsResponse.md create mode 100644 client/docs/BurnLog.md create mode 100644 client/docs/BurnRecord.md create mode 100644 client/docs/CallTarget.md create mode 100644 client/docs/ChainInfoResponse.md create mode 100644 client/docs/ChainMetrics.md create mode 100644 client/docs/ChainsApi.md create mode 100644 client/docs/CommitteeInfoResponse.md create mode 100644 client/docs/CommitteeNode.md create mode 100644 client/docs/ConsensusPipeMetrics.md create mode 100644 client/docs/ConsensusWorkflowMetrics.md create mode 100644 client/docs/ContractCallViewRequest.md create mode 100644 client/docs/ContractInfoResponse.md create mode 100644 client/docs/ControlAddressesResponse.md create mode 100644 client/docs/CorecontractsApi.md create mode 100644 client/docs/DKSharesInfo.md create mode 100644 client/docs/DKSharesPostRequest.md create mode 100644 client/docs/ErrorMessageFormatResponse.md create mode 100644 client/docs/EventsResponse.md create mode 100644 client/docs/FoundryOutputResponse.md create mode 100644 client/docs/FungibleTokens.md create mode 100644 client/docs/GasFeePolicy.md create mode 100644 client/docs/GovChainInfoResponse.md create mode 100644 client/docs/InOutput.md create mode 100644 client/docs/InOutputMetricItem.md create mode 100644 client/docs/InStateOutput.md create mode 100644 client/docs/InStateOutputMetricItem.md create mode 100644 client/docs/InfoResponse.md create mode 100644 client/docs/InterfaceMetricItem.md create mode 100644 client/docs/Item.md create mode 100644 client/docs/JSONDict.md create mode 100644 client/docs/L1Params.md create mode 100644 client/docs/MetricsApi.md create mode 100644 client/docs/NFTDataResponse.md create mode 100644 client/docs/NativeToken.md create mode 100644 client/docs/NativeTokenIDRegistryResponse.md create mode 100644 client/docs/NodeApi.md create mode 100644 client/docs/NodeOwnerCertificateRequest.md create mode 100644 client/docs/OffLedgerRequest.md create mode 100644 client/docs/OnLedgerRequest.md create mode 100644 client/docs/OnLedgerRequestMetricItem.md create mode 100644 client/docs/Output.md create mode 100644 client/docs/OutputID.md create mode 100644 client/docs/PeeringNodeIdentityResponse.md create mode 100644 client/docs/PeeringNodeStatusResponse.md create mode 100644 client/docs/PeeringTrustRequest.md create mode 100644 client/docs/ProtocolParameters.md create mode 100644 client/docs/ReceiptError.md create mode 100644 client/docs/ReceiptResponse.md create mode 100644 client/docs/RentStructure.md create mode 100644 client/docs/RequestDetail.md create mode 100644 client/docs/RequestIDsResponse.md create mode 100644 client/docs/RequestProcessedResponse.md create mode 100644 client/docs/RequestReceiptResponse.md create mode 100644 client/docs/RequestsApi.md create mode 100644 client/docs/Transaction.md create mode 100644 client/docs/TransactionIDMetricItem.md create mode 100644 client/docs/TransactionMetricItem.md create mode 100644 client/docs/TxInclusionStateMsg.md create mode 100644 client/docs/TxInclusionStateMsgMetricItem.md create mode 100644 client/docs/UTXOInputMetricItem.md create mode 100644 client/docs/UpdateUserPasswordRequest.md create mode 100644 client/docs/UpdateUserPermissionsRequest.md create mode 100644 client/docs/User.md create mode 100644 client/docs/UsersApi.md create mode 100644 client/docs/ValidationError.md delete mode 100644 client/evm.go delete mode 100644 client/gas.go create mode 100644 client/git_push.sh create mode 100644 client/go.mod create mode 100644 client/go.sum delete mode 100644 client/info.go delete mode 100644 client/metrics.go create mode 100644 client/model_account_list_response.go create mode 100644 client/model_account_nfts_response.go create mode 100644 client/model_account_nonce_response.go create mode 100644 client/model_add_user_request.go create mode 100644 client/model_alias_output_metric_item.go create mode 100644 client/model_allowance.go create mode 100644 client/model_assets_response.go create mode 100644 client/model_base_token.go create mode 100644 client/model_blob.go create mode 100644 client/model_blob_info_response.go create mode 100644 client/model_blob_list_response.go create mode 100644 client/model_blob_value_response.go create mode 100644 client/model_block_info_response.go create mode 100644 client/model_block_receipt_error.go create mode 100644 client/model_block_receipts_response.go create mode 100644 client/model_burn_log.go create mode 100644 client/model_burn_record.go create mode 100644 client/model_call_target.go create mode 100644 client/model_chain_info_response.go create mode 100644 client/model_chain_metrics.go create mode 100644 client/model_committee_info_response.go create mode 100644 client/model_committee_node.go create mode 100644 client/model_consensus_pipe_metrics.go create mode 100644 client/model_consensus_workflow_metrics.go create mode 100644 client/model_contract_call_view_request.go create mode 100644 client/model_contract_info_response.go create mode 100644 client/model_control_addresses_response.go create mode 100644 client/model_dk_shares_info.go create mode 100644 client/model_dk_shares_post_request.go create mode 100644 client/model_error_message_format_response.go create mode 100644 client/model_events_response.go create mode 100644 client/model_foundry_output_response.go create mode 100644 client/model_fungible_tokens.go create mode 100644 client/model_gas_fee_policy.go create mode 100644 client/model_gov_chain_info_response.go create mode 100644 client/model_in_output.go create mode 100644 client/model_in_output_metric_item.go create mode 100644 client/model_in_state_output.go create mode 100644 client/model_in_state_output_metric_item.go create mode 100644 client/model_info_response.go create mode 100644 client/model_interface_metric_item.go create mode 100644 client/model_item.go create mode 100644 client/model_json_dict.go create mode 100644 client/model_l1_params.go create mode 100644 client/model_native_token.go create mode 100644 client/model_native_token_id_registry_response.go create mode 100644 client/model_nft_data_response.go create mode 100644 client/model_node_owner_certificate_request.go create mode 100644 client/model_off_ledger_request.go create mode 100644 client/model_on_ledger_request.go create mode 100644 client/model_on_ledger_request_metric_item.go create mode 100644 client/model_output.go create mode 100644 client/model_output_id.go create mode 100644 client/model_peering_node_identity_response.go create mode 100644 client/model_peering_node_status_response.go create mode 100644 client/model_peering_trust_request.go create mode 100644 client/model_protocol_parameters.go create mode 100644 client/model_receipt_error.go create mode 100644 client/model_receipt_response.go create mode 100644 client/model_rent_structure.go create mode 100644 client/model_request_detail.go create mode 100644 client/model_request_ids_response.go create mode 100644 client/model_request_processed_response.go create mode 100644 client/model_request_receipt_response.go create mode 100644 client/model_transaction.go create mode 100644 client/model_transaction_id_metric_item.go create mode 100644 client/model_transaction_metric_item.go create mode 100644 client/model_tx_inclusion_state_msg.go create mode 100644 client/model_tx_inclusion_state_msg_metric_item.go create mode 100644 client/model_update_user_password_request.go create mode 100644 client/model_update_user_permissions_request.go create mode 100644 client/model_user.go create mode 100644 client/model_utxo_input_metric_item.go create mode 100644 client/model_validation_error.go delete mode 100644 client/multiclient/activate.go delete mode 100644 client/multiclient/chain_record.go delete mode 100644 client/multiclient/dkshares.go delete mode 100644 client/multiclient/multiclient.go delete mode 100644 client/multiclient/reqstatus.go delete mode 100644 client/node_ownership.go delete mode 100644 client/offledger.go delete mode 100644 client/peering.go delete mode 100644 client/reqstatus.go create mode 100644 client/response.go delete mode 100644 client/scclient/callview.go delete mode 100644 client/scclient/postrequest.go delete mode 100644 client/scclient/scclient.go delete mode 100644 client/scclient/stateget.go delete mode 100644 client/shutdown.go delete mode 100644 client/stateget.go create mode 100644 client/test/api_chains_test.go create mode 100644 client/test/api_corecontracts_test.go create mode 100644 client/test/api_metrics_test.go create mode 100644 client/test/api_node_test.go create mode 100644 client/test/api_requests_test.go create mode 100644 client/test/api_users_test.go create mode 100644 client/utils.go rename packages/webapi/{v2 => }/CLIENT_LIBRARY_CODE_GEN.md (100%) rename packages/webapi/{v2 => }/api.go (64%) rename packages/webapi/{v2 => }/apierrors/errorhandler.go (100%) rename packages/webapi/{v2 => }/apierrors/errors.go (100%) rename packages/webapi/{v2 => }/apierrors/httperror.go (100%) rename packages/webapi/{v2 => }/controllers/chain/access_nodes.go (86%) rename packages/webapi/{v2 => }/controllers/chain/chain.go (93%) rename packages/webapi/{v2 => }/controllers/chain/contracts.go (86%) rename packages/webapi/{v2 => }/controllers/chain/controller.go (98%) rename packages/webapi/{v2 => }/controllers/chain/evm.go (84%) rename packages/webapi/{v2 => }/controllers/chain/management.go (91%) rename packages/webapi/{v2 => }/controllers/chain/websocket.go (82%) rename packages/webapi/{v2 => }/controllers/corecontracts/accounts.go (96%) rename packages/webapi/{v2 => }/controllers/corecontracts/blob.go (94%) rename packages/webapi/{v2 => }/controllers/corecontracts/blocklog.go (97%) rename packages/webapi/{v2 => }/controllers/corecontracts/controller.go (98%) rename packages/webapi/{v2 => }/controllers/corecontracts/errors.go (87%) rename packages/webapi/{v2 => }/controllers/corecontracts/governance.go (95%) rename packages/webapi/{v2 => }/controllers/metrics/chain.go (90%) rename packages/webapi/{v2 => }/controllers/metrics/controller.go (95%) rename packages/webapi/{v2 => }/controllers/node/controller.go (88%) rename packages/webapi/{v2 => }/controllers/node/dkg.go (94%) rename packages/webapi/{v2 => }/controllers/node/info.go (93%) rename packages/webapi/{v2 => }/controllers/node/management.go (91%) rename packages/webapi/{v2 => }/controllers/node/peering.go (95%) rename packages/webapi/{v2 => }/controllers/requests/callview.go (92%) rename packages/webapi/{v2 => }/controllers/requests/controller.go (91%) rename packages/webapi/{v2 => }/controllers/requests/offledger.go (87%) rename packages/webapi/{v2 => }/controllers/requests/receipt.go (75%) rename packages/webapi/{v2 => }/controllers/requests/waitforrequest.go (83%) rename packages/webapi/{v2 => }/controllers/users/controller.go (97%) rename packages/webapi/{v2 => }/controllers/users/user.go (96%) rename packages/webapi/{v2 => }/corecontracts/README.md (100%) rename packages/webapi/{v2 => }/corecontracts/accounts.go (98%) rename packages/webapi/{v2 => }/corecontracts/blob.go (96%) rename packages/webapi/{v2 => }/corecontracts/blocklog.go (99%) rename packages/webapi/{v2 => }/corecontracts/errors.go (94%) rename packages/webapi/{v2 => }/corecontracts/governance.go (97%) rename packages/webapi/{v2 => }/dto/chain.go (100%) rename packages/webapi/{v2 => }/dto/metrics.go (100%) rename packages/webapi/{v2 => }/dto/node.go (100%) rename packages/webapi/{v2 => }/dto/peering.go (100%) rename packages/webapi/{v2 => }/interfaces/interfaces.go (76%) rename packages/webapi/{v2 => }/mocker.go (99%) rename packages/webapi/{v2 => }/models/L1.go (100%) rename packages/webapi/{v2 => }/models/chain.go (93%) rename packages/webapi/{v2 => }/models/core_accounts.go (100%) rename packages/webapi/{v2 => }/models/core_blocklog.go (100%) rename packages/webapi/{v2 => }/models/dks.go (100%) rename packages/webapi/{v2 => }/models/metrics.go (99%) rename packages/webapi/{v2 => }/models/mock/ChainInfoResponse.json (100%) rename packages/webapi/{v2 => }/models/mock/ChainInfoResponse[].json (100%) rename packages/webapi/{v2 => }/models/mock/CommitteeInfoResponse.json (100%) rename packages/webapi/{v2 => }/models/mock/ContractInfoResponse[].json (100%) rename packages/webapi/{v2 => }/models/mock/InfoResponse.json (100%) rename packages/webapi/{v2 => }/models/mock/PeeringNodeIdentityResponse.json (100%) rename packages/webapi/{v2 => }/models/mock/PeeringNodeIdentityResponse[].json (100%) rename packages/webapi/{v2 => }/models/mock/PeeringNodeStatusResponse.json (100%) rename packages/webapi/{v2 => }/models/mock/PeeringNodeStatusResponse[].json (100%) rename packages/webapi/{v2 => }/models/mock/PeeringTrustRequest.json (100%) rename packages/webapi/{v2 => }/models/node.go (100%) rename packages/webapi/{v2 => }/models/peering.go (100%) rename packages/webapi/{v2 => }/models/requests.go (100%) rename packages/webapi/{v2 => }/models/user.go (100%) rename packages/webapi/{v2 => }/models/vm.go (100%) rename packages/webapi/{v2 => }/params/decoder.go (97%) rename packages/webapi/{v2 => }/services/chain.go (96%) rename packages/webapi/{v2 => }/services/committee.go (91%) rename packages/webapi/{v2 => }/services/dkg.go (97%) rename packages/webapi/{v2 => }/services/evm.go (97%) rename packages/webapi/{v2 => }/services/metrics.go (95%) rename packages/webapi/{v2 => }/services/node.go (98%) rename packages/webapi/{v2 => }/services/offledger.go (98%) rename packages/webapi/{v2 => }/services/peering.go (98%) rename packages/webapi/{v2 => }/services/registry.go (92%) rename packages/webapi/{v2 => }/services/user.go (95%) rename packages/webapi/{v2 => }/services/vm.go (94%) rename packages/webapi/{v2 => }/test/mock_test.go (68%) delete mode 100644 packages/webapi/v1/admapi/accessnodes.go delete mode 100644 packages/webapi/v1/admapi/activatechain.go delete mode 100644 packages/webapi/v1/admapi/chainmetrics.go delete mode 100644 packages/webapi/v1/admapi/chainrecord.go delete mode 100644 packages/webapi/v1/admapi/dkshares.go delete mode 100644 packages/webapi/v1/admapi/endpoints.go delete mode 100644 packages/webapi/v1/admapi/node_owner.go delete mode 100644 packages/webapi/v1/admapi/peering.go delete mode 100644 packages/webapi/v1/admapi/shutdown.go delete mode 100644 packages/webapi/v1/endpoints.go delete mode 100644 packages/webapi/v1/evm/jsonrpc.go delete mode 100644 packages/webapi/v1/httperrors/errorhandler.go delete mode 100644 packages/webapi/v1/httperrors/errors.go delete mode 100644 packages/webapi/v1/info/info.go delete mode 100644 packages/webapi/v1/model/address.go delete mode 100644 packages/webapi/v1/model/blob.go delete mode 100644 packages/webapi/v1/model/bytes.go delete mode 100644 packages/webapi/v1/model/chain_info.go delete mode 100644 packages/webapi/v1/model/chain_record.go delete mode 100644 packages/webapi/v1/model/chainid.go delete mode 100644 packages/webapi/v1/model/consensus_metrics.go delete mode 100644 packages/webapi/v1/model/dkshares.go delete mode 100644 packages/webapi/v1/model/hash.go delete mode 100644 packages/webapi/v1/model/httperror.go delete mode 100644 packages/webapi/v1/model/info.go delete mode 100644 packages/webapi/v1/model/node_connection_metrics.go delete mode 100644 packages/webapi/v1/model/node_owner_certificate.go delete mode 100644 packages/webapi/v1/model/offledger_request.go delete mode 100644 packages/webapi/v1/model/peering.go delete mode 100644 packages/webapi/v1/model/reqstatus.go delete mode 100644 packages/webapi/v1/model/requestid.go delete mode 100644 packages/webapi/v1/reqstatus/reqstatus.go delete mode 100644 packages/webapi/v1/reqstatus/reqstatus_test.go delete mode 100644 packages/webapi/v1/request/request.go delete mode 100644 packages/webapi/v1/request/request_test.go delete mode 100644 packages/webapi/v1/routes/routes.go delete mode 100644 packages/webapi/v1/state/callview.go delete mode 100644 packages/webapi/v1/testutil/httptest.go delete mode 100644 packages/webapi/v1/testutil/mockchain.go delete mode 100644 packages/webapi/v1/websocket.go diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/client/.openapi-generator-ignore b/client/.openapi-generator-ignore new file mode 100644 index 0000000000..52e532f2f9 --- /dev/null +++ b/client/.openapi-generator-ignore @@ -0,0 +1,25 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md + +README.md \ No newline at end of file diff --git a/client/.openapi-generator/FILES b/client/.openapi-generator/FILES new file mode 100644 index 0000000000..f3406924ff --- /dev/null +++ b/client/.openapi-generator/FILES @@ -0,0 +1,170 @@ +.gitignore +.travis.yml +api/openapi.yaml +api_chains.go +api_corecontracts.go +api_metrics.go +api_node.go +api_requests.go +api_users.go +client.go +configuration.go +docs/AccountListResponse.md +docs/AccountNFTsResponse.md +docs/AccountNonceResponse.md +docs/AddUserRequest.md +docs/AliasOutputMetricItem.md +docs/Allowance.md +docs/AssetsResponse.md +docs/BaseToken.md +docs/Blob.md +docs/BlobInfoResponse.md +docs/BlobListResponse.md +docs/BlobValueResponse.md +docs/BlockInfoResponse.md +docs/BlockReceiptError.md +docs/BlockReceiptsResponse.md +docs/BurnLog.md +docs/BurnRecord.md +docs/CallTarget.md +docs/ChainInfoResponse.md +docs/ChainMetrics.md +docs/ChainsApi.md +docs/CommitteeInfoResponse.md +docs/CommitteeNode.md +docs/ConsensusPipeMetrics.md +docs/ConsensusWorkflowMetrics.md +docs/ContractCallViewRequest.md +docs/ContractInfoResponse.md +docs/ControlAddressesResponse.md +docs/CorecontractsApi.md +docs/DKSharesInfo.md +docs/DKSharesPostRequest.md +docs/ErrorMessageFormatResponse.md +docs/EventsResponse.md +docs/FoundryOutputResponse.md +docs/FungibleTokens.md +docs/GasFeePolicy.md +docs/GovChainInfoResponse.md +docs/InOutput.md +docs/InOutputMetricItem.md +docs/InStateOutput.md +docs/InStateOutputMetricItem.md +docs/InfoResponse.md +docs/InterfaceMetricItem.md +docs/Item.md +docs/JSONDict.md +docs/L1Params.md +docs/MetricsApi.md +docs/NFTDataResponse.md +docs/NativeToken.md +docs/NativeTokenIDRegistryResponse.md +docs/NodeApi.md +docs/NodeOwnerCertificateRequest.md +docs/OffLedgerRequest.md +docs/OnLedgerRequest.md +docs/OnLedgerRequestMetricItem.md +docs/Output.md +docs/OutputID.md +docs/PeeringNodeIdentityResponse.md +docs/PeeringNodeStatusResponse.md +docs/PeeringTrustRequest.md +docs/ProtocolParameters.md +docs/ReceiptError.md +docs/ReceiptResponse.md +docs/RentStructure.md +docs/RequestDetail.md +docs/RequestIDsResponse.md +docs/RequestProcessedResponse.md +docs/RequestReceiptResponse.md +docs/RequestsApi.md +docs/Transaction.md +docs/TransactionIDMetricItem.md +docs/TransactionMetricItem.md +docs/TxInclusionStateMsg.md +docs/TxInclusionStateMsgMetricItem.md +docs/UTXOInputMetricItem.md +docs/UpdateUserPasswordRequest.md +docs/UpdateUserPermissionsRequest.md +docs/User.md +docs/UsersApi.md +docs/ValidationError.md +git_push.sh +go.mod +go.sum +model_account_list_response.go +model_account_nfts_response.go +model_account_nonce_response.go +model_add_user_request.go +model_alias_output_metric_item.go +model_allowance.go +model_assets_response.go +model_base_token.go +model_blob.go +model_blob_info_response.go +model_blob_list_response.go +model_blob_value_response.go +model_block_info_response.go +model_block_receipt_error.go +model_block_receipts_response.go +model_burn_log.go +model_burn_record.go +model_call_target.go +model_chain_info_response.go +model_chain_metrics.go +model_committee_info_response.go +model_committee_node.go +model_consensus_pipe_metrics.go +model_consensus_workflow_metrics.go +model_contract_call_view_request.go +model_contract_info_response.go +model_control_addresses_response.go +model_dk_shares_info.go +model_dk_shares_post_request.go +model_error_message_format_response.go +model_events_response.go +model_foundry_output_response.go +model_fungible_tokens.go +model_gas_fee_policy.go +model_gov_chain_info_response.go +model_in_output.go +model_in_output_metric_item.go +model_in_state_output.go +model_in_state_output_metric_item.go +model_info_response.go +model_interface_metric_item.go +model_item.go +model_json_dict.go +model_l1_params.go +model_native_token.go +model_native_token_id_registry_response.go +model_nft_data_response.go +model_node_owner_certificate_request.go +model_off_ledger_request.go +model_on_ledger_request.go +model_on_ledger_request_metric_item.go +model_output.go +model_output_id.go +model_peering_node_identity_response.go +model_peering_node_status_response.go +model_peering_trust_request.go +model_protocol_parameters.go +model_receipt_error.go +model_receipt_response.go +model_rent_structure.go +model_request_detail.go +model_request_ids_response.go +model_request_processed_response.go +model_request_receipt_response.go +model_transaction.go +model_transaction_id_metric_item.go +model_transaction_metric_item.go +model_tx_inclusion_state_msg.go +model_tx_inclusion_state_msg_metric_item.go +model_update_user_password_request.go +model_update_user_permissions_request.go +model_user.go +model_utxo_input_metric_item.go +model_validation_error.go +response.go +utils.go diff --git a/client/.openapi-generator/VERSION b/client/.openapi-generator/VERSION new file mode 100644 index 0000000000..0df17dd0f6 --- /dev/null +++ b/client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.2.1 \ No newline at end of file diff --git a/client/.travis.yml b/client/.travis.yml new file mode 100644 index 0000000000..f5cb2ce9a5 --- /dev/null +++ b/client/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000000..e08d37c56c --- /dev/null +++ b/client/README.md @@ -0,0 +1,261 @@ +# Go API client for client + +REST API for the Wasp node + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 0.4.0-alpha.2-402-g2adcf666b +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Generation +- Install newest OpenAPI Generator binary +- Run an up to date Wasp node +- Execute `openapi-generator-cli generate -i http://localhost:9090/doc/swagger.json -g go --package-name=client` + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import client "github.com/GIT_USER_ID/GIT_REPO_ID" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), client.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), client.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:9090* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ChainsApi* | [**ActivateChain**](docs/ChainsApi.md#activatechain) | **Post** /chains/{chainID}/activate | Activate a chain +*ChainsApi* | [**AddAccessNode**](docs/ChainsApi.md#addaccessnode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. +*ChainsApi* | [**AttachToWebsocket**](docs/ChainsApi.md#attachtowebsocket) | **Get** /v2/chains/{chainID}/ws | +*ChainsApi* | [**DeactivateChain**](docs/ChainsApi.md#deactivatechain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain +*ChainsApi* | [**GetChainInfo**](docs/ChainsApi.md#getchaininfo) | **Get** /chains/{chainID} | Get information about a specific chain +*ChainsApi* | [**GetChains**](docs/ChainsApi.md#getchains) | **Get** /chains | Get a list of all chains +*ChainsApi* | [**GetCommitteeInfo**](docs/ChainsApi.md#getcommitteeinfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee +*ChainsApi* | [**GetContracts**](docs/ChainsApi.md#getcontracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts +*ChainsApi* | [**GetRequestIDFromEVMTransactionID**](docs/ChainsApi.md#getrequestidfromevmtransactionid) | **Get** /v2/chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +*ChainsApi* | [**GetStateValue**](docs/ChainsApi.md#getstatevalue) | **Get** /v2/chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +*ChainsApi* | [**RemoveAccessNode**](docs/ChainsApi.md#removeaccessnode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. +*CorecontractsApi* | [**AccountsGetAccountBalance**](docs/CorecontractsApi.md#accountsgetaccountbalance) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +*CorecontractsApi* | [**AccountsGetAccountNFTIDs**](docs/CorecontractsApi.md#accountsgetaccountnftids) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +*CorecontractsApi* | [**AccountsGetAccountNonce**](docs/CorecontractsApi.md#accountsgetaccountnonce) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +*CorecontractsApi* | [**AccountsGetAccounts**](docs/CorecontractsApi.md#accountsgetaccounts) | **Get** /v2/chains/{chainID}/core/accounts | Get a list of all accounts +*CorecontractsApi* | [**AccountsGetFoundryOutput**](docs/CorecontractsApi.md#accountsgetfoundryoutput) | **Get** /v2/chains/{chainID}/core/accounts/foundry_output | Get the foundry output +*CorecontractsApi* | [**AccountsGetNFTData**](docs/CorecontractsApi.md#accountsgetnftdata) | **Get** /v2/chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +*CorecontractsApi* | [**AccountsGetNativeTokenIDRegistry**](docs/CorecontractsApi.md#accountsgetnativetokenidregistry) | **Get** /v2/chains/{chainID}/core/accounts/token_registry | Get a list of all registries +*CorecontractsApi* | [**AccountsGetTotalAssets**](docs/CorecontractsApi.md#accountsgettotalassets) | **Get** /v2/chains/{chainID}/core/accounts/total_assets | Get all stored assets +*CorecontractsApi* | [**BlobsGetAllBlobs**](docs/CorecontractsApi.md#blobsgetallblobs) | **Get** /v2/chains/{chainID}/core/blobs | Get all stored blobs +*CorecontractsApi* | [**BlobsGetBlobInfo**](docs/CorecontractsApi.md#blobsgetblobinfo) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +*CorecontractsApi* | [**BlobsGetBlobValue**](docs/CorecontractsApi.md#blobsgetblobvalue) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +*CorecontractsApi* | [**BlocklogGetBlockInfo**](docs/CorecontractsApi.md#blockloggetblockinfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +*CorecontractsApi* | [**BlocklogGetControlAddresses**](docs/CorecontractsApi.md#blockloggetcontroladdresses) | **Get** /v2/chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +*CorecontractsApi* | [**BlocklogGetEventsOfBlock**](docs/CorecontractsApi.md#blockloggeteventsofblock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +*CorecontractsApi* | [**BlocklogGetEventsOfContract**](docs/CorecontractsApi.md#blockloggeteventsofcontract) | **Get** /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +*CorecontractsApi* | [**BlocklogGetEventsOfLatestBlock**](docs/CorecontractsApi.md#blockloggeteventsoflatestblock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +*CorecontractsApi* | [**BlocklogGetEventsOfRequest**](docs/CorecontractsApi.md#blockloggeteventsofrequest) | **Get** /v2/chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +*CorecontractsApi* | [**BlocklogGetLatestBlockInfo**](docs/CorecontractsApi.md#blockloggetlatestblockinfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +*CorecontractsApi* | [**BlocklogGetRequestIDsForBlock**](docs/CorecontractsApi.md#blockloggetrequestidsforblock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +*CorecontractsApi* | [**BlocklogGetRequestIDsForLatestBlock**](docs/CorecontractsApi.md#blockloggetrequestidsforlatestblock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +*CorecontractsApi* | [**BlocklogGetRequestIsProcessed**](docs/CorecontractsApi.md#blockloggetrequestisprocessed) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +*CorecontractsApi* | [**BlocklogGetRequestReceipt**](docs/CorecontractsApi.md#blockloggetrequestreceipt) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +*CorecontractsApi* | [**BlocklogGetRequestReceiptsOfBlock**](docs/CorecontractsApi.md#blockloggetrequestreceiptsofblock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +*CorecontractsApi* | [**BlocklogGetRequestReceiptsOfLatestBlock**](docs/CorecontractsApi.md#blockloggetrequestreceiptsoflatestblock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +*CorecontractsApi* | [**ErrorsGetErrorMessageFormat**](docs/CorecontractsApi.md#errorsgeterrormessageformat) | **Get** /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +*CorecontractsApi* | [**GovernanceGetChainInfo**](docs/CorecontractsApi.md#governancegetchaininfo) | **Get** /v2/chains/{chainID}/core/governance/chaininfo | Get the chain info +*MetricsApi* | [**GetChainMetrics**](docs/MetricsApi.md#getchainmetrics) | **Get** /metrics/chain/{chainID} | Get chain specific metrics. +*MetricsApi* | [**GetChainPipeMetrics**](docs/MetricsApi.md#getchainpipemetrics) | **Get** /metrics/chain/{chainID}/pipe | Get chain pipe event metrics. +*MetricsApi* | [**GetChainWorkflowMetrics**](docs/MetricsApi.md#getchainworkflowmetrics) | **Get** /metrics/chain/{chainID}/workflow | Get chain workflow metrics. +*MetricsApi* | [**GetL1Metrics**](docs/MetricsApi.md#getl1metrics) | **Get** /metrics/l1 | Get accumulated metrics. +*NodeApi* | [**DistrustPeer**](docs/NodeApi.md#distrustpeer) | **Delete** /node/peers/trusted | Distrust a peering node +*NodeApi* | [**GenerateDKS**](docs/NodeApi.md#generatedks) | **Post** /node/dks | Generate a new distributed key +*NodeApi* | [**GetAllPeers**](docs/NodeApi.md#getallpeers) | **Get** /node/peers | Get basic information about all configured peers +*NodeApi* | [**GetConfiguration**](docs/NodeApi.md#getconfiguration) | **Get** /node/config | Return the Wasp configuration +*NodeApi* | [**GetDKSInfo**](docs/NodeApi.md#getdksinfo) | **Get** /node/dks/{sharedAddress} | Get information about the shared address DKS configuration +*NodeApi* | [**GetInfo**](docs/NodeApi.md#getinfo) | **Get** /node/info | Returns private information about this node. +*NodeApi* | [**GetPeeringIdentity**](docs/NodeApi.md#getpeeringidentity) | **Get** /node/peers/identity | Get basic peer info of the current node +*NodeApi* | [**GetTrustedPeers**](docs/NodeApi.md#gettrustedpeers) | **Get** /node/peers/trusted | Get trusted peers +*NodeApi* | [**GetVersion**](docs/NodeApi.md#getversion) | **Get** /v2/node/version | Returns the node version. +*NodeApi* | [**SetNodeOwner**](docs/NodeApi.md#setnodeowner) | **Post** /node/owner/certificate | Sets the node owner +*NodeApi* | [**ShutdownNode**](docs/NodeApi.md#shutdownnode) | **Post** /node/shutdown | Shut down the node +*NodeApi* | [**TrustPeer**](docs/NodeApi.md#trustpeer) | **Post** /node/peers/trusted | Trust a peering node +*RequestsApi* | [**CallView**](docs/RequestsApi.md#callview) | **Post** /v2/requests/callview | Call a view function on a contract by Hname +*RequestsApi* | [**GetReceipt**](docs/RequestsApi.md#getreceipt) | **Get** /v2/chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +*RequestsApi* | [**OffLedger**](docs/RequestsApi.md#offledger) | **Post** /v2/requests/offledger | Post an off-ledger request +*RequestsApi* | [**WaitForTransaction**](docs/RequestsApi.md#waitfortransaction) | **Get** /v2/chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +*UsersApi* | [**AddUser**](docs/UsersApi.md#adduser) | **Post** /users | Add a user +*UsersApi* | [**ChangeUserPassword**](docs/UsersApi.md#changeuserpassword) | **Put** /users/{username}/password | Change user password +*UsersApi* | [**ChangeUserPermissions**](docs/UsersApi.md#changeuserpermissions) | **Put** /users/{username}/permissions | Change user permissions +*UsersApi* | [**DeleteUser**](docs/UsersApi.md#deleteuser) | **Delete** /users/{username} | Deletes a user +*UsersApi* | [**GetUser**](docs/UsersApi.md#getuser) | **Get** /users/{username} | Get a user +*UsersApi* | [**GetUsers**](docs/UsersApi.md#getusers) | **Get** /users | Get a list of all users + + +## Documentation For Models + + - [AccountListResponse](docs/AccountListResponse.md) + - [AccountNFTsResponse](docs/AccountNFTsResponse.md) + - [AccountNonceResponse](docs/AccountNonceResponse.md) + - [AddUserRequest](docs/AddUserRequest.md) + - [AliasOutputMetricItem](docs/AliasOutputMetricItem.md) + - [Allowance](docs/Allowance.md) + - [AssetsResponse](docs/AssetsResponse.md) + - [BaseToken](docs/BaseToken.md) + - [Blob](docs/Blob.md) + - [BlobInfoResponse](docs/BlobInfoResponse.md) + - [BlobListResponse](docs/BlobListResponse.md) + - [BlobValueResponse](docs/BlobValueResponse.md) + - [BlockInfoResponse](docs/BlockInfoResponse.md) + - [BlockReceiptError](docs/BlockReceiptError.md) + - [BlockReceiptsResponse](docs/BlockReceiptsResponse.md) + - [BurnLog](docs/BurnLog.md) + - [BurnRecord](docs/BurnRecord.md) + - [CallTarget](docs/CallTarget.md) + - [ChainInfoResponse](docs/ChainInfoResponse.md) + - [ChainMetrics](docs/ChainMetrics.md) + - [CommitteeInfoResponse](docs/CommitteeInfoResponse.md) + - [CommitteeNode](docs/CommitteeNode.md) + - [ConsensusPipeMetrics](docs/ConsensusPipeMetrics.md) + - [ConsensusWorkflowMetrics](docs/ConsensusWorkflowMetrics.md) + - [ContractCallViewRequest](docs/ContractCallViewRequest.md) + - [ContractInfoResponse](docs/ContractInfoResponse.md) + - [ControlAddressesResponse](docs/ControlAddressesResponse.md) + - [DKSharesInfo](docs/DKSharesInfo.md) + - [DKSharesPostRequest](docs/DKSharesPostRequest.md) + - [ErrorMessageFormatResponse](docs/ErrorMessageFormatResponse.md) + - [EventsResponse](docs/EventsResponse.md) + - [FoundryOutputResponse](docs/FoundryOutputResponse.md) + - [FungibleTokens](docs/FungibleTokens.md) + - [GasFeePolicy](docs/GasFeePolicy.md) + - [GovChainInfoResponse](docs/GovChainInfoResponse.md) + - [InOutput](docs/InOutput.md) + - [InOutputMetricItem](docs/InOutputMetricItem.md) + - [InStateOutput](docs/InStateOutput.md) + - [InStateOutputMetricItem](docs/InStateOutputMetricItem.md) + - [InfoResponse](docs/InfoResponse.md) + - [InterfaceMetricItem](docs/InterfaceMetricItem.md) + - [Item](docs/Item.md) + - [JSONDict](docs/JSONDict.md) + - [L1Params](docs/L1Params.md) + - [NFTDataResponse](docs/NFTDataResponse.md) + - [NativeToken](docs/NativeToken.md) + - [NativeTokenIDRegistryResponse](docs/NativeTokenIDRegistryResponse.md) + - [NodeOwnerCertificateRequest](docs/NodeOwnerCertificateRequest.md) + - [OffLedgerRequest](docs/OffLedgerRequest.md) + - [OnLedgerRequest](docs/OnLedgerRequest.md) + - [OnLedgerRequestMetricItem](docs/OnLedgerRequestMetricItem.md) + - [Output](docs/Output.md) + - [OutputID](docs/OutputID.md) + - [PeeringNodeIdentityResponse](docs/PeeringNodeIdentityResponse.md) + - [PeeringNodeStatusResponse](docs/PeeringNodeStatusResponse.md) + - [PeeringTrustRequest](docs/PeeringTrustRequest.md) + - [ProtocolParameters](docs/ProtocolParameters.md) + - [ReceiptError](docs/ReceiptError.md) + - [ReceiptResponse](docs/ReceiptResponse.md) + - [RentStructure](docs/RentStructure.md) + - [RequestDetail](docs/RequestDetail.md) + - [RequestIDsResponse](docs/RequestIDsResponse.md) + - [RequestProcessedResponse](docs/RequestProcessedResponse.md) + - [RequestReceiptResponse](docs/RequestReceiptResponse.md) + - [Transaction](docs/Transaction.md) + - [TransactionIDMetricItem](docs/TransactionIDMetricItem.md) + - [TransactionMetricItem](docs/TransactionMetricItem.md) + - [TxInclusionStateMsg](docs/TxInclusionStateMsg.md) + - [TxInclusionStateMsgMetricItem](docs/TxInclusionStateMsgMetricItem.md) + - [UTXOInputMetricItem](docs/UTXOInputMetricItem.md) + - [UpdateUserPasswordRequest](docs/UpdateUserPasswordRequest.md) + - [UpdateUserPermissionsRequest](docs/UpdateUserPermissionsRequest.md) + - [User](docs/User.md) + - [ValidationError](docs/ValidationError.md) + + +## Documentation For Authorization + + + +### Authorization + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/client/accessnodes.go b/client/accessnodes.go deleted file mode 100644 index e195878a7a..0000000000 --- a/client/accessnodes.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func (c *WaspClient) AddAccessNode(chainID isc.ChainID, pubKey string) error { - return c.do(http.MethodPut, routes.AdmAccessNode(chainID.String(), pubKey), nil, nil) -} - -func (c *WaspClient) RemoveAccessNode(chainID isc.ChainID, pubKey string) error { - return c.do(http.MethodDelete, routes.AdmAccessNode(chainID.String(), pubKey), nil, nil) -} diff --git a/client/activatechain.go b/client/activatechain.go deleted file mode 100644 index a093dd8a46..0000000000 --- a/client/activatechain.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// ActivateChain sends a request to activate a chain in the wasp node -func (c *WaspClient) ActivateChain(chainID isc.ChainID) error { - return c.do(http.MethodPost, routes.ActivateChain(chainID.String()), nil, nil) -} - -// DeactivateChain sends a request to deactivate a chain in the wasp node -func (c *WaspClient) DeactivateChain(chainID isc.ChainID) error { - return c.do(http.MethodPost, routes.DeactivateChain(chainID.String()), nil, nil) -} diff --git a/client/api/openapi.yaml b/client/api/openapi.yaml new file mode 100644 index 0000000000..7828926c41 --- /dev/null +++ b/client/api/openapi.yaml @@ -0,0 +1,4475 @@ +openapi: 3.0.1 +info: + description: REST API for the Wasp node + title: Wasp API + version: 0.4.0-alpha.2-402-g2adcf666b +externalDocs: + description: Find out more about Wasp + url: https://wiki.iota.org/smart-contracts/overview +servers: +- url: http://localhost:9090/ +- url: https://localhost:9090/ +tags: +- name: chains +- name: chains +- name: metrics +- name: metrics +- name: node +- name: node +- name: requests +- name: requests +- name: users +- name: users +- name: corecontracts +- name: corecontracts +paths: + /chains: + get: + operationId: getChains + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ChainInfoResponse' + type: array + description: A list of all available chains + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get a list of all chains + tags: + - chains + /chains/{chainID}: + get: + operationId: getChainInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ChainInfoResponse' + description: Information about a specific chain + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get information about a specific chain + tags: + - chains + /chains/{chainID}/access-node/{publicKey}: + delete: + operationId: removeAccessNode + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Nodes public key (Hex) + in: path + name: publicKey + required: true + schema: + format: string + type: string + responses: + "200": + content: {} + description: Access node was successfully removed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Remove an access node. + tags: + - chains + put: + operationId: addAccessNode + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Nodes public key (Hex) + in: path + name: publicKey + required: true + schema: + format: string + type: string + responses: + "201": + content: {} + description: Access node was successfully added + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Configure a trusted node to be an access node. + tags: + - chains + /chains/{chainID}/activate: + post: + operationId: activateChain + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: {} + description: Chain was successfully activated + "304": + content: {} + description: Chain was not activated + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Activate a chain + tags: + - chains + /chains/{chainID}/committee: + get: + operationId: getCommitteeInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CommitteeInfoResponse' + description: A list of all nodes tied to the chain + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get information about the deployed committee + tags: + - chains + /chains/{chainID}/contracts: + get: + operationId: getContracts + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ContractInfoResponse' + type: array + description: A list of all available contracts + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get all available chain contracts + tags: + - chains + /chains/{chainID}/deactivate: + post: + operationId: deactivateChain + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: {} + description: Chain was successfully deactivated + "304": + content: {} + description: Chain was not deactivated + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Deactivate a chain + tags: + - chains + /metrics/chain/{chainID}: + get: + operationId: getChainMetrics + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ChainMetrics' + description: A list of all available metrics. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get chain specific metrics. + tags: + - metrics + /metrics/chain/{chainID}/pipe: + get: + operationId: getChainPipeMetrics + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConsensusPipeMetrics' + description: A list of all available metrics. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get chain pipe event metrics. + tags: + - metrics + /metrics/chain/{chainID}/workflow: + get: + operationId: getChainWorkflowMetrics + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConsensusWorkflowMetrics' + description: A list of all available metrics. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get chain workflow metrics. + tags: + - metrics + /metrics/l1: + get: + operationId: getL1Metrics + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ChainMetrics' + description: A list of all available metrics. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get accumulated metrics. + tags: + - metrics + /node/config: + get: + operationId: getConfiguration + responses: + "200": + content: + application/json: + schema: + additionalProperties: + example: "true" + format: string + type: string + type: object + description: Dumped configuration + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Return the Wasp configuration + tags: + - node + /node/dks: + post: + operationId: generateDKS + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesPostRequest' + description: Request parameters + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesPostRequest' + description: DK shares info + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Generate a new distributed key + tags: + - node + x-codegen-request-body-name: DKSharesPostRequest + /node/dks/{sharedAddress}: + get: + operationId: getDKSInfo + parameters: + - description: SharedAddress (Bech32) + in: path + name: sharedAddress + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesInfo' + description: DK shares info + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get information about the shared address DKS configuration + tags: + - node + /node/info: + get: + operationId: getInfo + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InfoResponse' + description: Returns information about this node. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Returns private information about this node. + tags: + - node + /node/owner/certificate: + post: + operationId: setNodeOwner + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NodeOwnerCertificateRequest' + description: The node owner certificate + required: true + responses: + "200": + content: {} + description: Node owner was successfully changed + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Sets the node owner + tags: + - node + x-codegen-request-body-name: "" + /node/peers: + get: + operationId: getAllPeers + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PeeringNodeStatusResponse_' + type: array + description: A list of all peers + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get basic information about all configured peers + tags: + - node + /node/peers/identity: + get: + operationId: getPeeringIdentity + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringNodeIdentityResponse' + description: This node peering identity + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get basic peer info of the current node + tags: + - node + /node/peers/trusted: + delete: + operationId: distrustPeer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustRequest' + description: Info of the peer to distrust + required: true + responses: + "200": + content: {} + description: Peer was successfully distrusted + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Distrust a peering node + tags: + - node + x-codegen-request-body-name: "" + get: + operationId: getTrustedPeers + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PeeringNodeIdentityResponse' + type: array + description: A list of trusted peers + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get trusted peers + tags: + - node + post: + operationId: trustPeer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustRequest' + description: Info of the peer to trust + required: true + responses: + "200": + content: {} + description: Peer was successfully trusted + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Trust a peering node + tags: + - node + x-codegen-request-body-name: "" + /node/shutdown: + post: + operationId: shutdownNode + responses: + "200": + content: {} + description: The node has been shut down + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Shut down the node + tags: + - node + /users: + get: + operationId: getUsers + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: A list of all users + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get a list of all users + tags: + - users + post: + operationId: addUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddUserRequest' + description: The user data + required: true + responses: + "201": + content: {} + description: User successfully added + "400": + content: {} + description: Invalid request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Add a user + tags: + - users + x-codegen-request-body-name: "" + /users/{username}: + delete: + operationId: deleteUser + parameters: + - description: The username + in: path + name: username + required: true + schema: + format: string + type: string + responses: + "200": + content: {} + description: Deletes a specific user + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + "404": + content: {} + description: User not found + security: + - Authorization: [] + summary: Deletes a user + tags: + - users + get: + operationId: getUser + parameters: + - description: The username + in: path + name: username + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Returns a specific user + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + "404": + content: {} + description: User not found + security: + - Authorization: [] + summary: Get a user + tags: + - users + /users/{username}/password: + put: + operationId: changeUserPassword + parameters: + - description: The username. + in: path + name: username + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserPasswordRequest' + description: The users new password + required: true + responses: + "200": + content: {} + description: User successfully updated + "400": + content: {} + description: Invalid request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Change user password + tags: + - users + x-codegen-request-body-name: "" + /users/{username}/permissions: + put: + operationId: changeUserPermissions + parameters: + - description: The username. + in: path + name: username + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserPermissionsRequest' + description: The users new permissions + required: true + responses: + "200": + content: {} + description: User successfully updated + "400": + content: {} + description: Invalid request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Change user permissions + tags: + - users + x-codegen-request-body-name: "" + /v2/chains/{chainID}/core/accounts: + get: + operationId: accountsGetAccounts + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AccountListResponse' + description: A list of all accounts + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get a list of all accounts + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/account/{agentID}/balance: + get: + operationId: accountsGetAccountBalance + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: AgentID (Bech32 for WasmVM | Hex for EVM) + in: path + name: agentID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AssetsResponse' + description: All assets belonging to an account + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all assets belonging to an account + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts: + get: + operationId: accountsGetAccountNFTIDs + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: AgentID (Bech32 for WasmVM | Hex for EVM) + in: path + name: agentID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AccountNFTsResponse' + description: All NFT ids belonging to an account + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all NFT ids belonging to an account + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce: + get: + operationId: accountsGetAccountNonce + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: AgentID (Bech32 for WasmVM | Hex for EVM | '000000@Bech32' Addresses + require urlencode) + in: path + name: agentID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AccountNonceResponse' + description: The current nonce of an account + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the current nonce of an account + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/foundry_output: + get: + operationId: accountsGetFoundryOutput + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Serial Number (uint32) + in: path + name: chainID_ + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/FoundryOutputResponse' + description: The foundry output + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the foundry output + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/nftdata: + get: + operationId: accountsGetNFTData + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: NFT ID (Hex) + in: path + name: nftID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NFTDataResponse' + description: The NFT data + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the NFT data by an ID + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/token_registry: + get: + operationId: accountsGetNativeTokenIDRegistry + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NativeTokenIDRegistryResponse' + description: A list of all registries + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get a list of all registries + tags: + - corecontracts + /v2/chains/{chainID}/core/accounts/total_assets: + get: + operationId: accountsGetTotalAssets + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AssetsResponse' + description: All stored assets + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all stored assets + tags: + - corecontracts + /v2/chains/{chainID}/core/blobs: + get: + operationId: blobsGetAllBlobs + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlobListResponse' + description: All stored blobs + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all stored blobs + tags: + - corecontracts + /v2/chains/{chainID}/core/blobs/{blobHash}: + get: + operationId: blobsGetBlobInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: BlobHash (Hex) + in: path + name: blobHash + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlobInfoResponse' + description: All blob fields and their values + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all fields of a blob + tags: + - corecontracts + /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: + get: + operationId: blobsGetBlobValue + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: BlobHash (Hex) + in: path + name: blobHash + required: true + schema: + format: string + type: string + - description: FieldKey (String) + in: path + name: fieldKey + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlobValueResponse' + description: The value of the supplied field (key) + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the value of the supplied field (key) + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/blocks/latest: + get: + operationId: blocklogGetLatestBlockInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlockInfoResponse' + description: The block info + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the block info of the latest block + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts: + get: + operationId: blocklogGetRequestReceiptsOfLatestBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlockReceiptsResponse' + description: The receipts + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all receipts of the latest block + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids: + get: + operationId: blocklogGetRequestIDsForLatestBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RequestIDsResponse' + description: "A list of request ids (ISCRequestID[])" + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the request ids for the latest block + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}: + get: + operationId: blocklogGetBlockInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlockInfoResponse' + description: The block info + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the block info of a certain block index + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + get: + operationId: blocklogGetRequestReceiptsOfBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BlockReceiptsResponse' + description: The receipts + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get all receipts of a certain block + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: + get: + operationId: blocklogGetRequestIDsForBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RequestIDsResponse' + description: "A list of request ids (ISCRequestID[])" + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the request ids for a certain block index + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/controladdresses: + get: + operationId: blocklogGetControlAddresses + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ControlAddressesResponse' + description: The chain info + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the control addresses + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/events/block/latest: + get: + operationId: blocklogGetEventsOfLatestBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventsResponse' + description: The receipts + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get events of the latest block + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}: + get: + operationId: blocklogGetEventsOfBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventsResponse' + description: The events + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get events of a block + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}: + get: + operationId: blocklogGetEventsOfContract + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Contract (Hname) + in: path + name: contractHname + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventsResponse' + description: The events + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get events of a contract + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/events/request/{requestID}: + get: + operationId: blocklogGetEventsOfRequest + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Request ID (ISCRequestID) + in: path + name: requestID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventsResponse' + description: The events + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get events of a request + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/requests/{requestID}: + get: + operationId: blocklogGetRequestReceipt + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Request ID (ISCRequestID) + in: path + name: requestID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RequestReceiptResponse' + description: The receipt + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the receipt of a certain request id + tags: + - corecontracts + /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: + get: + operationId: blocklogGetRequestIsProcessed + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Request ID (ISCRequestID) + in: path + name: requestID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RequestProcessedResponse' + description: The processing result + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the request processing status + tags: + - corecontracts + /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}: + get: + operationId: errorsGetErrorMessageFormat + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Contract (Hname as Hex) + in: path + name: contractHname + required: true + schema: + format: string + type: string + - description: Error Id (uint16) + in: path + name: errorID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessageFormatResponse' + description: The error message format + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the error message format of a specific error id + tags: + - corecontracts + /v2/chains/{chainID}/core/governance/chaininfo: + get: + description: "If you are using the common API functions, you most likely rather\ + \ want to use '/chains/:chainID' to get information about a chain." + operationId: governanceGetChainInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GovChainInfoResponse' + description: The chain info + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + summary: Get the chain info + tags: + - corecontracts + /v2/chains/{chainID}/evm/tx/{txHash}: + get: + operationId: getRequestIDFromEVMTransactionID + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Transaction hash (Hex-encoded) + in: path + name: txHash + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + format: string + type: string + description: Request ID + "404": + content: + application/json: + schema: + format: string + type: string + description: Request ID not found + summary: Get the ISC request ID for the given Ethereum transaction hash + tags: + - chains + /v2/chains/{chainID}/receipts/{requestID}: + get: + operationId: getReceipt + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: RequestID (Hex) + in: path + name: requestID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ReceiptResponse' + description: ReceiptResponse + summary: Get a receipt from a request ID + tags: + - requests + /v2/chains/{chainID}/requests/{requestID}/wait: + get: + operationId: waitForTransaction + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: RequestID (Hex) + in: path + name: requestID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ReceiptResponse' + description: The request receipt + "404": + content: {} + description: The chain or request id is invalid + "408": + content: {} + description: The waiting time has reached the defined limit + summary: Wait until the given request has been processed by the node + tags: + - requests + /v2/chains/{chainID}/state/{stateKey}: + get: + operationId: getStateValue + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Key (Hex-encoded) + in: path + name: stateKey + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + items: + example: 118 + format: int32 + type: integer + type: array + description: Result + summary: Fetch the raw value associated with the given key in the chain state + tags: + - chains + /v2/chains/{chainID}/ws: + get: + operationId: attachToWebsocket + parameters: + - description: ChainID (Bech32-encoded) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + tags: + - chains + /v2/node/version: + get: + operationId: getVersion + responses: + "200": + content: + application/json: + schema: + format: string + type: string + description: Returns the version of the node. + summary: Returns the node version. + tags: + - node + /v2/requests/callview: + post: + description: "Execute a view call. Either use HName or Name properties. If both\ + \ are supplied, HName are used." + operationId: callView + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ContractCallViewRequest' + description: Parameters + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict_' + description: Result + summary: Call a view function on a contract by Hname + tags: + - requests + x-codegen-request-body-name: "" + /v2/requests/offledger: + post: + operationId: offLedger + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OffLedgerRequest' + description: Offledger request as JSON. Request encoded in Hex + required: false + responses: + "202": + content: {} + description: Request submitted + summary: Post an off-ledger request + tags: + - requests + x-codegen-request-body-name: "" +components: + schemas: + AccountListResponse: + example: + accounts: + - accounts + - accounts + properties: + accounts: + items: + format: string + type: string + type: array + xml: + name: Accounts + wrapped: true + type: object + xml: + name: AccountListResponse + AccountNFTsResponse: + example: + nftIds: + - nftIds + - nftIds + properties: + nftIds: + items: + format: string + type: string + type: array + xml: + name: NFTIDs + wrapped: true + type: object + xml: + name: AccountNFTsResponse + AccountNonceResponse: + example: + nonce: 0 + properties: + nonce: + format: int64 + type: integer + xml: + name: Nonce + type: object + xml: + name: AccountNonceResponse + AddUserRequest: + example: + password: password + permissions: + - permissions + - permissions + username: username + properties: + password: + format: string + type: string + xml: + name: Password + permissions: + items: + format: string + type: string + type: array + xml: + name: Permissions + wrapped: true + username: + format: string + type: string + xml: + name: Username + type: object + xml: + name: AddUserRequest + AliasOutputMetricItem: + example: + lastMessage: + outputType: 0 + raw: raw + messages: 6 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/Output' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: AliasOutputMetricItem + Allowance: + example: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + nfts: + - nfts + - nfts + properties: + fungibleTokens: + $ref: '#/components/schemas/FungibleTokens' + nfts: + items: + format: string + type: string + type: array + xml: + name: NFTs + wrapped: true + type: object + xml: + name: Allowance + AssetsResponse: + example: + baseTokens: 0 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + properties: + baseTokens: + format: int64 + type: integer + xml: + name: BaseTokens + nativeTokens: + items: + $ref: '#/components/schemas/NativeToken' + type: array + xml: + name: NativeTokens + wrapped: true + type: object + xml: + name: AssetsResponse + BaseToken: + example: + unit: TEST + decimals: 6 + name: TestCoin + tickerSymbol: TEST + subunit: testies + useMetricPrefix: true + properties: + decimals: + description: The token decimals + example: 6 + format: int32 + type: integer + xml: + name: Decimals + name: + description: The base token name + example: TestCoin + format: string + type: string + xml: + name: Name + subunit: + description: The token subunit + example: testies + format: string + type: string + xml: + name: Subunit + tickerSymbol: + description: The ticker symbol + example: TEST + format: string + type: string + xml: + name: TickerSymbol + unit: + description: The token unit + example: TEST + format: string + type: string + xml: + name: Unit + useMetricPrefix: + description: Whether or not the token uses a metric prefix + format: boolean + type: boolean + xml: + name: UseMetricPrefix + type: object + xml: + name: BaseToken + Blob: + example: + Size: 0 + Hash: Hash + properties: + Hash: + format: string + type: string + xml: + name: Hash + Size: + format: int32 + type: integer + xml: + name: Size + type: object + xml: + name: Blob + BlobInfoResponse: + example: + Fields: + key: 0 + properties: + Fields: + additionalProperties: + format: int32 + type: integer + type: object + xml: + name: Fields + type: object + xml: + name: BlobInfoResponse + BlobListResponse: + example: + Blobs: + - Size: 0 + Hash: Hash + - Size: 0 + Hash: Hash + properties: + Blobs: + items: + $ref: '#/components/schemas/Blob' + type: array + xml: + name: Blobs + wrapped: true + type: object + xml: + name: BlobListResponse + BlobValueResponse: + example: + ValueData: ValueData + properties: + ValueData: + format: string + type: string + xml: + name: ValueData + type: object + xml: + name: BlobValueResponse + BlockInfoResponse: + example: + anchorTransactionId: anchorTransactionId + gasBurned: 6 + totalRequests: 7 + l1CommitmentHash: l1CommitmentHash + blockIndex: 0 + numSuccessfulRequests: 5 + gasFeeCharged: 1 + totalStorageDeposit: 9 + transactionSubEssenceHash: transactionSubEssenceHash + numOffLedgerRequests: 5 + previousL1CommitmentHash: previousL1CommitmentHash + timestamp: 2000-01-23T04:56:07.000+00:00 + totalBaseTokensInL2Accounts: 2 + properties: + anchorTransactionId: + format: string + type: string + xml: + name: AnchorTransactionID + blockIndex: + format: int32 + type: integer + xml: + name: BlockIndex + gasBurned: + format: int64 + type: integer + xml: + name: GasBurned + gasFeeCharged: + format: int64 + type: integer + xml: + name: GasFeeCharged + l1CommitmentHash: + format: string + type: string + xml: + name: L1CommitmentHash + numOffLedgerRequests: + format: int32 + type: integer + xml: + name: NumOffLedgerRequests + numSuccessfulRequests: + format: int32 + type: integer + xml: + name: NumSuccessfulRequests + previousL1CommitmentHash: + format: string + type: string + xml: + name: PreviousL1CommitmentHash + timestamp: + format: date-time + type: string + xml: + name: Timestamp + totalBaseTokensInL2Accounts: + format: int64 + type: integer + xml: + name: TotalBaseTokensInL2Accounts + totalRequests: + format: int32 + type: integer + xml: + name: TotalRequests + totalStorageDeposit: + format: int64 + type: integer + xml: + name: TotalStorageDeposit + transactionSubEssenceHash: + format: string + type: string + xml: + name: TransactionSubEssenceHash + type: object + xml: + name: BlockInfoResponse + BlockReceiptError: + example: + errorMessage: errorMessage + hash: hash + properties: + errorMessage: + format: string + type: string + xml: + name: ErrorMessage + hash: + format: string + type: string + xml: + name: Hash + type: object + xml: + name: BlockReceiptError + BlockReceiptsResponse: + example: + receipts: + - gasBurnLog: + Records: + - GasBurned: 5 + Code: 1 + - GasBurned: 5 + Code: 1 + request: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + senderAccount: senderAccount + isOffLedger: true + gasGudget: 2 + requestId: requestId + callTarget: + EntryPoint: 3 + Contract: 9 + targetAddress: targetAddress + allowance: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + nfts: + - nfts + - nfts + params: + Items: + - value: value + key: key + - value: value + key: key + nft: + owner: owner + metadata: metadata + id: id + issuer: issuer + isEVM: true + blockIndex: 0 + requestIndex: 4 + gasFeeCharged: 2 + gasBudget: 6 + gasBurned: 5 + error: + errorMessage: errorMessage + hash: hash + - gasBurnLog: + Records: + - GasBurned: 5 + Code: 1 + - GasBurned: 5 + Code: 1 + request: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + senderAccount: senderAccount + isOffLedger: true + gasGudget: 2 + requestId: requestId + callTarget: + EntryPoint: 3 + Contract: 9 + targetAddress: targetAddress + allowance: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + nfts: + - nfts + - nfts + params: + Items: + - value: value + key: key + - value: value + key: key + nft: + owner: owner + metadata: metadata + id: id + issuer: issuer + isEVM: true + blockIndex: 0 + requestIndex: 4 + gasFeeCharged: 2 + gasBudget: 6 + gasBurned: 5 + error: + errorMessage: errorMessage + hash: hash + properties: + receipts: + items: + $ref: '#/components/schemas/RequestReceiptResponse' + type: array + xml: + name: Receipts + wrapped: true + type: object + xml: + name: BlockReceiptsResponse + BurnLog: + example: + Records: + - GasBurned: 5 + Code: 1 + - GasBurned: 5 + Code: 1 + properties: + Records: + items: + $ref: '#/components/schemas/BurnRecord' + type: array + xml: + name: Records + wrapped: true + type: object + xml: + name: BurnLog + BurnRecord: + example: + GasBurned: 5 + Code: 1 + properties: + Code: + format: int32 + type: integer + xml: + name: Code + GasBurned: + format: int64 + type: integer + xml: + name: GasBurned + type: object + xml: + name: BurnRecord + CallTarget: + example: + EntryPoint: 3 + Contract: 9 + properties: + Contract: + format: int32 + type: integer + xml: + name: Contract + EntryPoint: + format: int32 + type: integer + xml: + name: EntryPoint + type: object + xml: + name: CallTarget + ChainInfoResponse: + example: + chainOwnerId: tst1qzjsxstc0k850jevpqu08tj0suql9u7hvh3vq3eaaem3gkx7r646zqpdn6e + maxEventsPerReq: 50 + chainID: tst1prcw42l5u4g24tqg628d7qzh7n6m4k4ktvgayh44dyt68y930qzy2lr054v + evmChainId: 1074 + description: description + gasFeePolicy: + gasFeeTokenId: gasFeeTokenId + gasPerToken: 100 + validatorFeeShare: 0 + isActive: true + maxBlobSize: 2000000 + maxEventSize: 2000 + properties: + chainID: + description: ChainID (Bech32-encoded). + example: tst1prcw42l5u4g24tqg628d7qzh7n6m4k4ktvgayh44dyt68y930qzy2lr054v + format: string + type: string + xml: + name: ChainID + chainOwnerId: + description: The chain owner address (Bech32-encoded). + example: tst1qzjsxstc0k850jevpqu08tj0suql9u7hvh3vq3eaaem3gkx7r646zqpdn6e + format: string + type: string + xml: + name: ChainOwnerID + description: + description: The description of the chain. + format: string + type: string + xml: + name: Description + evmChainId: + description: The EVM chain ID + example: 1074 + format: int32 + type: integer + xml: + name: EVMChainID + gasFeePolicy: + $ref: '#/components/schemas/gasFeePolicy' + isActive: + description: Whether or not the chain is active. + format: boolean + type: boolean + xml: + name: IsActive + maxBlobSize: + description: The maximum contract blob size. + example: 2000000 + format: int32 + type: integer + xml: + name: MaxBlobSize + maxEventSize: + description: The maximum event size. + example: 2000 + format: int32 + type: integer + xml: + name: MaxEventSize + maxEventsPerReq: + description: The maximum amount of events per request. + example: 50 + format: int32 + type: integer + xml: + name: MaxEventsPerReq + type: object + xml: + name: ChainInfoResponse + ChainMetrics: + example: + outPublishGovernanceTransaction: + lastMessage: + txId: txId + messages: 7 + timestamp: 2000-01-23T04:56:07.000+00:00 + inTxInclusionState: + lastMessage: + txId: txId + state: state + messages: 2 + timestamp: 2000-01-23T04:56:07.000+00:00 + inOnLedgerRequest: + lastMessage: + output: + outputType: 0 + raw: raw + outputId: outputId + raw: raw + id: id + messages: 1 + timestamp: 2000-01-23T04:56:07.000+00:00 + inOutput: + lastMessage: + output: + outputType: 0 + raw: raw + outputId: outputId + messages: 5 + timestamp: 2000-01-23T04:56:07.000+00:00 + inAliasOutput: + lastMessage: + outputType: 0 + raw: raw + messages: 6 + timestamp: 2000-01-23T04:56:07.000+00:00 + inStateOutput: + lastMessage: + output: + outputType: 0 + raw: raw + outputId: outputId + messages: 5 + timestamp: 2000-01-23T04:56:07.000+00:00 + outPullTxInclusionState: + lastMessage: + txId: txId + messages: 2 + timestamp: 2000-01-23T04:56:07.000+00:00 + outPullLatestOutput: + lastMessage: lastMessage + messages: 9 + timestamp: 2000-01-23T04:56:07.000+00:00 + outPullOutputByID: + lastMessage: + outputId: outputId + messages: 3 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + inAliasOutput: + $ref: '#/components/schemas/AliasOutputMetricItem' + inOnLedgerRequest: + $ref: '#/components/schemas/OnLedgerRequestMetricItem' + inOutput: + $ref: '#/components/schemas/InOutputMetricItem' + inStateOutput: + $ref: '#/components/schemas/InStateOutputMetricItem' + inTxInclusionState: + $ref: '#/components/schemas/TxInclusionStateMsgMetricItem' + outPublishGovernanceTransaction: + $ref: '#/components/schemas/TransactionMetricItem' + outPullLatestOutput: + $ref: '#/components/schemas/InterfaceMetricItem' + outPullOutputByID: + $ref: '#/components/schemas/UTXOInputMetricItem' + outPullTxInclusionState: + $ref: '#/components/schemas/TransactionIDMetricItem' + type: object + xml: + name: ChainMetrics + CommitteeInfoResponse: + example: + candidateNodes: + - node: + isAlive: true + netId: netId + publicKey: publicKey + numUsers: 0 + isTrusted: true + accessAPI: accessAPI + - node: + isAlive: true + netId: netId + publicKey: publicKey + numUsers: 0 + isTrusted: true + accessAPI: accessAPI + committeeNodes: + - node: + isAlive: true + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 + isTrusted: true + accessAPI: accessAPI + - node: + isAlive: true + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 + isTrusted: true + accessAPI: accessAPI + chainId: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e + accessNodes: + - node: + isAlive: true + netId: netId + publicKey: publicKey + numUsers: 0 + isTrusted: true + accessAPI: accessAPI + - node: + isAlive: true + netId: netId + publicKey: publicKey + numUsers: 0 + isTrusted: true + accessAPI: accessAPI + stateAddress: 0xff97a3eb5c56f6a3bc4fb729dedff9bffe37583d81d6c72ac12f2438cc94fb43 + active: true + properties: + accessNodes: + description: A list of all access nodes and their peering info. + items: + $ref: '#/components/schemas/CommitteeNode' + type: array + xml: + name: AccessNodes + wrapped: true + active: + description: Whether or not the chain is active. + example: true + format: boolean + type: boolean + xml: + name: Active + candidateNodes: + description: A list of all candidate nodes and their peering info. + items: + $ref: '#/components/schemas/CommitteeNode' + type: array + xml: + name: CandidateNodes + wrapped: true + chainId: + description: ChainID (Bech32-encoded). + example: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e + format: string + type: string + xml: + name: ChainID + committeeNodes: + description: A list of all committee nodes and their peering info. + items: + $ref: '#/components/schemas/CommitteeNode_' + type: array + xml: + name: CommitteeNodes + wrapped: true + stateAddress: + example: 0xff97a3eb5c56f6a3bc4fb729dedff9bffe37583d81d6c72ac12f2438cc94fb43 + format: string + type: string + xml: + name: StateAddress + type: object + xml: + name: CommitteeInfoResponse + CommitteeNode: + example: + node: + isAlive: true + netId: netId + publicKey: publicKey + numUsers: 0 + isTrusted: true + accessAPI: accessAPI + properties: + accessAPI: + format: string + type: string + xml: + name: AccessAPI + node: + $ref: '#/components/schemas/PeeringNodeStatusResponse' + type: object + xml: + name: CommitteeNode + CommitteeNode_: + example: + node: + isAlive: true + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 + isTrusted: true + accessAPI: accessAPI + properties: + accessAPI: + format: string + type: string + xml: + name: AccessAPI + node: + $ref: '#/components/schemas/PeeringNodeStatusResponse_' + type: object + xml: + name: CommitteeNode + ConsensusPipeMetrics: + example: + eventACSMsgPipeSize: 0 + eventPeerLogIndexMsgPipeSize: 6 + eventVMResultMsgPipeSize: 5 + eventStateTransitionMsgPipeSize: 1 + eventTimerMsgPipeSize: 5 + properties: + eventACSMsgPipeSize: + format: int32 + type: integer + xml: + name: EventACSMsgPipeSize + eventPeerLogIndexMsgPipeSize: + format: int32 + type: integer + xml: + name: EventPeerLogIndexMsgPipeSize + eventStateTransitionMsgPipeSize: + format: int32 + type: integer + xml: + name: EventStateTransitionMsgPipeSize + eventTimerMsgPipeSize: + format: int32 + type: integer + xml: + name: EventTimerMsgPipeSize + eventVMResultMsgPipeSize: + format: int32 + type: integer + xml: + name: EventVMResultMsgPipeSize + type: object + xml: + name: ConsensusPipeMetrics + ConsensusWorkflowMetrics: + example: + flagStateReceived: true + flagTransactionPosted: true + flagVMStarted: true + timeTransactionSeen: 2000-01-23T04:56:07.000+00:00 + flagConsensusBatchKnown: true + timeTransactionFinalized: 2000-01-23T04:56:07.000+00:00 + timeVMStarted: 2000-01-23T04:56:07.000+00:00 + flagVMResultSigned: true + timeBatchProposalSent: 2000-01-23T04:56:07.000+00:00 + timeVMResultSigned: 2000-01-23T04:56:07.000+00:00 + timeCompleted: 2000-01-23T04:56:07.000+00:00 + timeTransactionPosted: 2000-01-23T04:56:07.000+00:00 + flagTransactionSeen: true + timeConsensusBatchKnown: 2000-01-23T04:56:07.000+00:00 + currentStateIndex: 0 + flagInProgress: true + flagBatchProposalSent: true + flagTransactionFinalized: true + properties: + currentStateIndex: + description: Shows current state index of the consensus + format: int32 + type: integer + xml: + name: CurrentStateIndex + flagBatchProposalSent: + description: Shows if batch proposal is sent out in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagBatchProposalSent + flagConsensusBatchKnown: + description: Shows if consensus on batch is reached and known in current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagConsensusBatchKnown + flagInProgress: + description: Shows if consensus algorithm is still not completed in current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagInProgress + flagStateReceived: + description: Shows if state output is received in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagStateReceived + flagTransactionFinalized: + description: Shows if consensus on transaction is reached in current consensus + iteration + format: boolean + type: boolean + xml: + name: FlagTransactionFinalized + flagTransactionPosted: + description: Shows if transaction is posted to L1 in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagTransactionPosted + flagTransactionSeen: + description: Shows if L1 reported that it has seen the transaction of current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagTransactionSeen + flagVMResultSigned: + description: Shows if virtual machine has returned its results in current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagVMResultSigned + flagVMStarted: + description: Shows if virtual machine is started in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagVMStarted + timeBatchProposalSent: + description: Shows when batch proposal was last sent out in current consensus + iteration + format: date-time + type: string + xml: + name: TimeBatchProposalSent + timeCompleted: + description: Shows when algorithm was last completed in current consensus + iteration + format: date-time + type: string + xml: + name: TimeCompleted + timeConsensusBatchKnown: + description: Shows when ACS results of consensus on batch was last received + in current consensus iteration + format: date-time + type: string + xml: + name: TimeConsensusBatchKnown + timeTransactionFinalized: + description: Shows when algorithm last noted that all the data for consensus + on transaction had been received in current consensus iteration + format: date-time + type: string + xml: + name: TimeTransactionFinalized + timeTransactionPosted: + description: Shows when transaction was last posted to L1 in current consensus + iteration + format: date-time + type: string + xml: + name: TimeTransactionPosted + timeTransactionSeen: + description: Shows when algorithm last noted that transaction had been seen + by L1 in current consensus iteration + format: date-time + type: string + xml: + name: TimeTransactionSeen + timeVMResultSigned: + description: Shows when virtual machine results were last received and signed + in current consensus iteration + format: date-time + type: string + xml: + name: TimeVMResultSigned + timeVMStarted: + description: Shows when virtual machine was last started in current consensus + iteration + format: date-time + type: string + xml: + name: TimeVMStarted + type: object + xml: + name: ConsensusWorkflowMetrics + ContractCallViewRequest: + example: + contractHName: contractHName + chainId: chainId + functionName: functionName + functionHName: functionHName + arguments: + Items: + - value: value + key: key + - value: value + key: key + contractName: contractName + properties: + arguments: + $ref: '#/components/schemas/JSONDict' + chainId: + description: The chain id + format: string + type: string + xml: + name: ChainID + contractHName: + description: The contract name as HName (Hex) + format: string + type: string + xml: + name: ContractHName + contractName: + description: The contract name + format: string + type: string + xml: + name: ContractName + functionHName: + description: The function name as HName (Hex) + format: string + type: string + xml: + name: FunctionHName + functionName: + description: The function name + format: string + type: string + xml: + name: FunctionName + type: object + xml: + name: ContractCallViewRequest + ContractInfoResponse: + example: + programHash: + - 193 + - 193 + name: evm + description: EVM contract + hName: 07cb02c1 + properties: + description: + description: The description of the contract. + example: EVM contract + format: string + type: string + xml: + name: Description + hName: + description: The id (HName as Hex)) of the contract. + example: 07cb02c1 + format: string + type: string + xml: + name: HName + name: + description: The name of the contract. + example: evm + format: string + type: string + xml: + name: Name + programHash: + description: The hash of the contract. + items: + example: 193 + format: int32 + type: integer + type: array + xml: + name: ProgramHash + wrapped: true + type: object + xml: + name: ContractInfoResponse + ControlAddressesResponse: + example: + governingAddress: governingAddress + sinceBlockIndex: 0 + stateAddress: stateAddress + properties: + governingAddress: + format: string + type: string + xml: + name: GoverningAddress + sinceBlockIndex: + format: int32 + type: integer + xml: + name: SinceBlockIndex + stateAddress: + format: string + type: string + xml: + name: StateAddress + type: object + xml: + name: ControlAddressesResponse + DKSharesInfo: + example: + publicKeyShares: + - publicKeyShares + - publicKeyShares + address: address + peerIdentities: + - peerIdentities + - peerIdentities + threshold: 6 + publicKey: publicKey + peerIndex: 0 + properties: + address: + description: New generated shared address. + format: string + type: string + xml: + name: Address + peerIdentities: + description: Identities of the nodes sharing the key. (Hex) + items: + format: string + type: string + type: array + xml: + name: PeerIdentities + wrapped: true + peerIndex: + format: int32 + type: integer + xml: + name: PeerIndex + publicKey: + description: Used public key. (Hex) + format: string + type: string + xml: + name: PublicKey + publicKeyShares: + description: Public key shares for all the peers. (Hex) + items: + format: string + type: string + type: array + xml: + name: PublicKeyShares + wrapped: true + threshold: + format: int32 + type: integer + xml: + name: Threshold + type: object + xml: + name: DKSharesInfo + DKSharesPostRequest: + example: + peerIdentities: + - peerIdentities + - peerIdentities + timeoutMS: 6 + threshold: 0 + properties: + peerIdentities: + items: + format: string + type: string + type: array + xml: + name: PeerIdentities + wrapped: true + threshold: + description: Should be =< len(PeerPublicIdentities) + format: int32 + type: integer + xml: + name: Threshold + timeoutMS: + description: Timeout in milliseconds. + format: int32 + type: integer + xml: + name: TimeoutMS + type: object + xml: + name: DKSharesPostRequest + ErrorMessageFormatResponse: + example: + MessageFormat: MessageFormat + properties: + MessageFormat: + format: string + type: string + xml: + name: MessageFormat + type: object + xml: + name: ErrorMessageFormatResponse + EventsResponse: + example: + events: + - events + - events + properties: + events: + items: + format: string + type: string + type: array + xml: + name: Events + wrapped: true + type: object + xml: + name: EventsResponse + FoundryOutputResponse: + example: + assets: + baseTokens: 0 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + foundryId: foundryId + properties: + assets: + $ref: '#/components/schemas/AssetsResponse' + foundryId: + format: string + type: string + xml: + name: FoundryID + type: object + xml: + name: FoundryOutputResponse + FungibleTokens: + example: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + properties: + baseTokens: + format: int64 + type: integer + xml: + name: BaseTokens + nativeTokens: + items: + $ref: '#/components/schemas/NativeToken' + type: array + xml: + name: NativeTokens + wrapped: true + type: object + xml: + name: FungibleTokens + GovChainInfoResponse: + example: + chainOwnerId: chainOwnerId + maxEventsPerReq: 5 + chainID: chainID + description: description + gasFeePolicy: + gasFeeTokenId: gasFeeTokenId + gasPerToken: 0 + validatorFeeShare: 6 + maxBlobSize: 1 + maxEventSize: 5 + properties: + chainID: + description: ChainID (Bech32-encoded). + format: string + type: string + xml: + name: ChainID + chainOwnerId: + description: The chain owner address (Bech32-encoded). + format: string + type: string + xml: + name: ChainOwnerID + description: + description: The description of the chain. + format: string + type: string + xml: + name: Description + gasFeePolicy: + $ref: '#/components/schemas/gasFeePolicy_' + maxBlobSize: + description: The maximum contract blob size. + format: int32 + type: integer + xml: + name: MaxBlobSize + maxEventSize: + description: The maximum event size. + format: int32 + type: integer + xml: + name: MaxEventSize + maxEventsPerReq: + description: The maximum amount of events per request. + format: int32 + type: integer + xml: + name: MaxEventsPerReq + type: object + xml: + name: GovChainInfoResponse + InOutput: + example: + output: + outputType: 0 + raw: raw + outputId: outputId + properties: + output: + $ref: '#/components/schemas/Output' + outputId: + description: The output ID + format: string + type: string + xml: + name: OutputID + type: object + xml: + name: InOutput + InOutputMetricItem: + example: + lastMessage: + output: + outputType: 0 + raw: raw + outputId: outputId + messages: 5 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/InOutput' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: InOutputMetricItem + InStateOutput: + example: + output: + outputType: 0 + raw: raw + outputId: outputId + properties: + output: + $ref: '#/components/schemas/Output' + outputId: + description: The output ID + format: string + type: string + xml: + name: OutputID + type: object + xml: + name: InStateOutput + InStateOutputMetricItem: + example: + lastMessage: + output: + outputType: 0 + raw: raw + outputId: outputId + messages: 5 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/InStateOutput' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: InStateOutputMetricItem + InfoResponse: + example: + netID: 0.0.0.0:4000 + l1Params: + protocol: + rentStructure: + vByteFactorData: 1 + vByteCost: 500 + vByteFactorKey: 10 + minPowScore: 0 + tokenSupply: "2779530283277761" + networkName: private_tangle1 + belowMaxDepth: 15 + version: 2 + bech32Hrp: tst + maxPayloadSize: 32498 + baseToken: + unit: TEST + decimals: 6 + name: TestCoin + tickerSymbol: TEST + subunit: testies + useMetricPrefix: true + publicKey: 0x8fb9555a17393f0e01aadd90f8b6bc8a64b1c5c37c99915942e40b2af99e72d6 + version: 0.4.0-alpha.2-390-g5470f1925 + properties: + l1Params: + $ref: '#/components/schemas/L1Params' + netID: + description: The net id of the node + example: 0.0.0.0:4000 + format: string + type: string + xml: + name: NetID + publicKey: + description: The public key of the node (Hex) + example: 0x8fb9555a17393f0e01aadd90f8b6bc8a64b1c5c37c99915942e40b2af99e72d6 + format: string + type: string + xml: + name: PublicKey + version: + description: The version of the node + example: 0.4.0-alpha.2-390-g5470f1925 + format: string + type: string + xml: + name: Version + type: object + xml: + name: InfoResponse + InterfaceMetricItem: + example: + lastMessage: lastMessage + messages: 9 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + format: string + type: string + xml: + name: LastMessage + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: InterfaceMetricItem + Item: + example: + value: value + key: key + properties: + key: + description: key (hex-encoded) + format: string + type: string + xml: + name: Key + value: + description: value (hex-encoded) + format: string + type: string + xml: + name: Value + type: object + xml: + name: Item + Item_: + example: + value: 0x76616c756531 + key: 0x6b657931 + properties: + key: + description: key (hex-encoded) + example: 0x6b657931 + format: string + type: string + xml: + name: Key + value: + description: value (hex-encoded) + example: 0x76616c756531 + format: string + type: string + xml: + name: Value + type: object + xml: + name: Item + JSONDict: + example: + Items: + - value: value + key: key + - value: value + key: key + properties: + Items: + items: + $ref: '#/components/schemas/Item' + type: array + xml: + name: Items + wrapped: true + type: object + xml: + name: JSONDict + JSONDict_: + example: + Items: + - value: 0x76616c756531 + key: 0x6b657931 + - value: 0x76616c756531 + key: 0x6b657931 + properties: + Items: + items: + $ref: '#/components/schemas/Item_' + type: array + xml: + name: Items + wrapped: true + type: object + xml: + name: JSONDict + L1Params: + example: + protocol: + rentStructure: + vByteFactorData: 1 + vByteCost: 500 + vByteFactorKey: 10 + minPowScore: 0 + tokenSupply: "2779530283277761" + networkName: private_tangle1 + belowMaxDepth: 15 + version: 2 + bech32Hrp: tst + maxPayloadSize: 32498 + baseToken: + unit: TEST + decimals: 6 + name: TestCoin + tickerSymbol: TEST + subunit: testies + useMetricPrefix: true + properties: + baseToken: + $ref: '#/components/schemas/BaseToken' + maxPayloadSize: + description: The max payload size + example: 32498 + format: int32 + type: integer + xml: + name: MaxPayloadSize + protocol: + $ref: '#/components/schemas/ProtocolParameters' + type: object + xml: + name: L1Params + NFTDataResponse: + example: + owner: owner + metadata: metadata + id: id + issuer: issuer + properties: + id: + format: string + type: string + xml: + name: ID + issuer: + format: string + type: string + xml: + name: Issuer + metadata: + format: string + type: string + xml: + name: Metadata + owner: + format: string + type: string + xml: + name: Owner + type: object + xml: + name: NFTDataResponse + NativeToken: + example: + amount: amount + id: id + properties: + amount: + format: string + type: string + xml: + name: Amount + id: + format: string + type: string + xml: + name: ID + type: object + xml: + name: NativeToken + NativeTokenIDRegistryResponse: + example: + nativeTokenRegistryIds: + - nativeTokenRegistryIds + - nativeTokenRegistryIds + properties: + nativeTokenRegistryIds: + items: + format: string + type: string + type: array + xml: + name: NativeTokenRegistryIDs + wrapped: true + type: object + xml: + name: NativeTokenIDRegistryResponse + NodeOwnerCertificateRequest: + example: + ownerAddress: ownerAddress + publicKey: publicKey + properties: + ownerAddress: + description: Node owner address. (Bech32) + format: string + type: string + xml: + name: OwnerAddress + publicKey: + description: The public key of the node (Hex) + format: string + type: string + xml: + name: PublicKey + type: object + xml: + name: NodeOwnerCertificateRequest + OffLedgerRequest: + example: + request: Hex string + chainId: chainId + properties: + chainId: + description: The chain id + format: string + type: string + xml: + name: ChainID + request: + description: Offledger Request (Hex) + example: Hex string + format: string + type: string + xml: + name: Request + type: object + xml: + name: OffLedgerRequest + OnLedgerRequest: + example: + output: + outputType: 0 + raw: raw + outputId: outputId + raw: raw + id: id + properties: + id: + description: The request ID + format: string + type: string + xml: + name: ID + output: + $ref: '#/components/schemas/Output' + outputId: + description: The output ID + format: string + type: string + xml: + name: OutputID + raw: + description: The raw data of the request (Hex) + format: string + type: string + xml: + name: Raw + type: object + xml: + name: OnLedgerRequest + OnLedgerRequestMetricItem: + example: + lastMessage: + output: + outputType: 0 + raw: raw + outputId: outputId + raw: raw + id: id + messages: 1 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/OnLedgerRequest' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: OnLedgerRequestMetricItem + Output: + example: + outputType: 0 + raw: raw + properties: + outputType: + description: The output type + format: int32 + type: integer + xml: + name: OutputType + raw: + description: The raw data of the output (Hex) + format: string + type: string + xml: + name: Raw + type: object + xml: + name: Output + OutputID: + example: + outputId: outputId + properties: + outputId: + description: The output ID + format: string + type: string + xml: + name: OutputID + type: object + xml: + name: OutputID + PeeringNodeIdentityResponse: + example: + netId: localhost:4000 + publicKey: 0x0000 + isTrusted: true + properties: + isTrusted: + example: true + format: boolean + type: boolean + xml: + name: IsTrusted + netId: + description: The NetID of the peer + example: localhost:4000 + format: string + type: string + xml: + name: NetID + publicKey: + description: The peers public key encoded in Hex + example: 0x0000 + format: string + type: string + xml: + name: PublicKey + type: object + xml: + name: PeeringNodeIdentityResponse + PeeringNodeStatusResponse: + example: + isAlive: true + netId: netId + publicKey: publicKey + numUsers: 0 + isTrusted: true + properties: + isAlive: + description: Whether or not the peer is activated + format: boolean + type: boolean + xml: + name: IsAlive + isTrusted: + format: boolean + type: boolean + xml: + name: IsTrusted + netId: + description: The NetID of the peer + format: string + type: string + xml: + name: NetID + numUsers: + description: The amount of users attached to the peer + format: int32 + type: integer + xml: + name: NumUsers + publicKey: + description: The peers public key encoded in Hex + format: string + type: string + xml: + name: PublicKey + type: object + xml: + name: PeeringNodeStatusResponse + PeeringNodeStatusResponse_: + example: + isAlive: true + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 + isTrusted: true + properties: + isAlive: + description: Whether or not the peer is activated + example: true + format: boolean + type: boolean + xml: + name: IsAlive + isTrusted: + example: true + format: boolean + type: boolean + xml: + name: IsTrusted + netId: + description: The NetID of the peer + example: localhost:4000 + format: string + type: string + xml: + name: NetID + numUsers: + description: The amount of users attached to the peer + example: 1 + format: int32 + type: integer + xml: + name: NumUsers + publicKey: + description: The peers public key encoded in Hex + example: 0x0000 + format: string + type: string + xml: + name: PublicKey + type: object + xml: + name: PeeringNodeStatusResponse + PeeringTrustRequest: + example: + netId: localhost:4000 + publicKey: 0x0000 + properties: + netId: + description: The NetID of the peer + example: localhost:4000 + format: string + type: string + xml: + name: NetID + publicKey: + description: The peers public key encoded in Hex + example: 0x0000 + format: string + type: string + xml: + name: PublicKey + type: object + xml: + name: PeeringTrustRequest + ProtocolParameters: + example: + rentStructure: + vByteFactorData: 1 + vByteCost: 500 + vByteFactorKey: 10 + minPowScore: 0 + tokenSupply: "2779530283277761" + networkName: private_tangle1 + belowMaxDepth: 15 + version: 2 + bech32Hrp: tst + properties: + bech32Hrp: + description: The human readable network prefix + example: tst + format: string + type: string + xml: + name: Bech32HRP + belowMaxDepth: + description: The networks max depth + example: 15 + format: int32 + type: integer + xml: + name: BelowMaxDepth + minPowScore: + description: The minimal PoW score + format: int32 + type: integer + xml: + name: MinPoWScore + networkName: + description: The network name + example: private_tangle1 + format: string + type: string + xml: + name: NetworkName + rentStructure: + $ref: '#/components/schemas/RentStructure' + tokenSupply: + description: The token supply + example: "2779530283277761" + format: string + type: string + xml: + name: TokenSupply + version: + description: The protocol version + example: 2 + format: int32 + type: integer + xml: + name: Version + type: object + xml: + name: ProtocolParameters + ReceiptError: + example: + messageFormat: messageFormat + contractId: 6 + errorCode: errorCode + errorId: 1 + message: message + parameters: + - parameters + - parameters + properties: + contractId: + format: int32 + type: integer + xml: + name: ContractID + errorCode: + format: string + type: string + xml: + name: ErrorCode + errorId: + format: int32 + type: integer + xml: + name: ErrorID + message: + format: string + type: string + xml: + name: Message + messageFormat: + format: string + type: string + xml: + name: MessageFormat + parameters: + items: + format: string + type: string + type: array + xml: + name: Parameters + wrapped: true + type: object + xml: + name: ReceiptError + ReceiptResponse: + example: + gasBurnLog: + - GasBurned: 5 + Code: 1 + - GasBurned: 5 + Code: 1 + request: request + blockIndex: 0 + requestIndex: 7 + gasFeeCharged: 2 + gasBudget: 5 + gasBurned: 5 + error: + messageFormat: messageFormat + contractId: 6 + errorCode: errorCode + errorId: 1 + message: message + parameters: + - parameters + - parameters + properties: + blockIndex: + format: int32 + type: integer + xml: + name: BlockIndex + error: + $ref: '#/components/schemas/ReceiptError' + gasBudget: + format: int64 + type: integer + xml: + name: GasBudget + gasBurnLog: + items: + $ref: '#/components/schemas/BurnRecord' + type: array + xml: + name: GasBurnLog + wrapped: true + gasBurned: + format: int64 + type: integer + xml: + name: GasBurned + gasFeeCharged: + format: int64 + type: integer + xml: + name: GasFeeCharged + request: + format: string + type: string + xml: + name: Request + requestIndex: + format: int32 + type: integer + xml: + name: RequestIndex + type: object + xml: + name: ReceiptResponse + RentStructure: + example: + vByteFactorData: 1 + vByteCost: 500 + vByteFactorKey: 10 + properties: + vByteCost: + description: The virtual byte cost + example: 500 + format: int32 + type: integer + xml: + name: VByteCost + vByteFactorData: + description: The virtual byte factor for data fields + example: 1 + format: int32 + type: integer + xml: + name: VBFactorData + vByteFactorKey: + description: The virtual byte factor for key/lookup generating fields + example: 10 + format: int32 + type: integer + xml: + name: VBFactorKey + type: object + xml: + name: RentStructure + RequestDetail: + example: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + senderAccount: senderAccount + isOffLedger: true + gasGudget: 2 + requestId: requestId + callTarget: + EntryPoint: 3 + Contract: 9 + targetAddress: targetAddress + allowance: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + nfts: + - nfts + - nfts + params: + Items: + - value: value + key: key + - value: value + key: key + nft: + owner: owner + metadata: metadata + id: id + issuer: issuer + isEVM: true + properties: + allowance: + $ref: '#/components/schemas/Allowance' + callTarget: + $ref: '#/components/schemas/CallTarget' + fungibleTokens: + $ref: '#/components/schemas/FungibleTokens' + gasGudget: + format: int64 + type: integer + xml: + name: GasGudget + isEVM: + format: boolean + type: boolean + xml: + name: IsEVM + isOffLedger: + format: boolean + type: boolean + xml: + name: IsOffLedger + nft: + $ref: '#/components/schemas/NFTDataResponse' + params: + $ref: '#/components/schemas/JSONDict' + requestId: + format: string + type: string + xml: + name: RequestID + senderAccount: + format: string + type: string + xml: + name: SenderAccount + targetAddress: + format: string + type: string + xml: + name: TargetAddress + type: object + xml: + name: RequestDetail + RequestIDsResponse: + example: + requestIds: + - requestIds + - requestIds + properties: + requestIds: + items: + format: string + type: string + type: array + xml: + name: RequestIDs + wrapped: true + type: object + xml: + name: RequestIDsResponse + RequestProcessedResponse: + example: + chainId: chainId + requestId: requestId + isProcessed: true + properties: + chainId: + format: string + type: string + xml: + name: ChainID + isProcessed: + format: boolean + type: boolean + xml: + name: IsProcessed + requestId: + format: string + type: string + xml: + name: RequestID + type: object + xml: + name: RequestProcessedResponse + RequestReceiptResponse: + example: + gasBurnLog: + Records: + - GasBurned: 5 + Code: 1 + - GasBurned: 5 + Code: 1 + request: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + senderAccount: senderAccount + isOffLedger: true + gasGudget: 2 + requestId: requestId + callTarget: + EntryPoint: 3 + Contract: 9 + targetAddress: targetAddress + allowance: + fungibleTokens: + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id + nfts: + - nfts + - nfts + params: + Items: + - value: value + key: key + - value: value + key: key + nft: + owner: owner + metadata: metadata + id: id + issuer: issuer + isEVM: true + blockIndex: 0 + requestIndex: 4 + gasFeeCharged: 2 + gasBudget: 6 + gasBurned: 5 + error: + errorMessage: errorMessage + hash: hash + properties: + blockIndex: + format: int32 + type: integer + xml: + name: BlockIndex + error: + $ref: '#/components/schemas/BlockReceiptError' + gasBudget: + format: int64 + type: integer + xml: + name: GasBudget + gasBurnLog: + $ref: '#/components/schemas/BurnLog' + gasBurned: + format: int64 + type: integer + xml: + name: GasBurned + gasFeeCharged: + format: int64 + type: integer + xml: + name: GasFeeCharged + request: + $ref: '#/components/schemas/RequestDetail' + requestIndex: + format: int32 + type: integer + xml: + name: RequestIndex + type: object + xml: + name: RequestReceiptResponse + Transaction: + example: + txId: txId + properties: + txId: + description: The transaction ID + format: string + type: string + xml: + name: TransactionID + type: object + xml: + name: Transaction + TransactionIDMetricItem: + example: + lastMessage: + txId: txId + messages: 2 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/Transaction' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: TransactionIDMetricItem + TransactionMetricItem: + example: + lastMessage: + txId: txId + messages: 7 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/Transaction' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: TransactionMetricItem + TxInclusionStateMsg: + example: + txId: txId + state: state + properties: + state: + description: The inclusion state + format: string + type: string + xml: + name: State + txId: + description: The transaction ID + format: string + type: string + xml: + name: TransactionID + type: object + xml: + name: TxInclusionStateMsg + TxInclusionStateMsgMetricItem: + example: + lastMessage: + txId: txId + state: state + messages: 2 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/TxInclusionStateMsg' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: TxInclusionStateMsgMetricItem + UTXOInputMetricItem: + example: + lastMessage: + outputId: outputId + messages: 3 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/OutputID' + messages: + format: int32 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + type: object + xml: + name: UTXOInputMetricItem + UpdateUserPasswordRequest: + example: + password: password + properties: + password: + format: string + type: string + xml: + name: Password + type: object + xml: + name: UpdateUserPasswordRequest + UpdateUserPermissionsRequest: + example: + permissions: + - permissions + - permissions + properties: + permissions: + items: + format: string + type: string + type: array + xml: + name: Permissions + wrapped: true + type: object + xml: + name: UpdateUserPermissionsRequest + User: + example: + permissions: + - permissions + - permissions + username: username + properties: + permissions: + items: + format: string + type: string + type: array + xml: + name: Permissions + wrapped: true + username: + format: string + type: string + xml: + name: Username + type: object + xml: + name: User + ValidationError: + properties: + Error: + format: string + type: string + xml: + name: Error + MissingPermission: + format: string + type: string + xml: + name: MissingPermission + type: object + xml: + name: ValidationError + gasFeePolicy: + example: + gasFeeTokenId: gasFeeTokenId + gasPerToken: 100 + validatorFeeShare: 0 + properties: + gasFeeTokenId: + description: The gas fee token id. Empty if base token. + format: string + type: string + xml: + name: GasFeeTokenID + gasPerToken: + description: The amount of gas per token. + example: 100 + format: int64 + type: integer + xml: + name: GasPerToken + validatorFeeShare: + description: The validator fee share. + format: int32 + type: integer + xml: + name: ValidatorFeeShare + type: object + xml: + name: gasFeePolicy + gasFeePolicy_: + example: + gasFeeTokenId: gasFeeTokenId + gasPerToken: 0 + validatorFeeShare: 6 + properties: + gasFeeTokenId: + description: The gas fee token id. Empty if base token. + format: string + type: string + xml: + name: GasFeeTokenID + gasPerToken: + description: The amount of gas per token. + format: int64 + type: integer + xml: + name: GasPerToken + validatorFeeShare: + description: The validator fee share. + format: int32 + type: integer + xml: + name: ValidatorFeeShare + type: object + xml: + name: gasFeePolicy + securitySchemes: + Authorization: + description: JWT Token + in: header + name: Authorization + type: apiKey +x-original-swagger-version: "2.0" diff --git a/client/api_chains.go b/client/api_chains.go new file mode 100644 index 0000000000..d8b4a15f95 --- /dev/null +++ b/client/api_chains.go @@ -0,0 +1,1294 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// ChainsApiService ChainsApi service +type ChainsApiService service + +type ApiActivateChainRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiActivateChainRequest) Execute() (*http.Response, error) { + return r.ApiService.ActivateChainExecute(r) +} + +/* +ActivateChain Activate a chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiActivateChainRequest +*/ +func (a *ChainsApiService) ActivateChain(ctx context.Context, chainID string) ApiActivateChainRequest { + return ApiActivateChainRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.ActivateChain") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/activate" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAddAccessNodeRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string + publicKey string +} + +func (r ApiAddAccessNodeRequest) Execute() (*http.Response, error) { + return r.ApiService.AddAccessNodeExecute(r) +} + +/* +AddAccessNode Configure a trusted node to be an access node. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param publicKey Nodes public key (Hex) + @return ApiAddAccessNodeRequest +*/ +func (a *ChainsApiService) AddAccessNode(ctx context.Context, chainID string, publicKey string) ApiAddAccessNodeRequest { + return ApiAddAccessNodeRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + publicKey: publicKey, + } +} + +// Execute executes the request +func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.AddAccessNode") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterToString(r.publicKey, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAttachToWebsocketRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiAttachToWebsocketRequest) Execute() (*http.Response, error) { + return r.ApiService.AttachToWebsocketExecute(r) +} + +/* +AttachToWebsocket Method for AttachToWebsocket + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32-encoded) + @return ApiAttachToWebsocketRequest +*/ +func (a *ChainsApiService) AttachToWebsocket(ctx context.Context, chainID string) ApiAttachToWebsocketRequest { + return ApiAttachToWebsocketRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.AttachToWebsocket") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/ws" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeactivateChainRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiDeactivateChainRequest) Execute() (*http.Response, error) { + return r.ApiService.DeactivateChainExecute(r) +} + +/* +DeactivateChain Deactivate a chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiDeactivateChainRequest +*/ +func (a *ChainsApiService) DeactivateChain(ctx context.Context, chainID string) ApiDeactivateChainRequest { + return ApiDeactivateChainRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.DeactivateChain") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/deactivate" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetChainInfoRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiGetChainInfoRequest) Execute() (*ChainInfoResponse, *http.Response, error) { + return r.ApiService.GetChainInfoExecute(r) +} + +/* +GetChainInfo Get information about a specific chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGetChainInfoRequest +*/ +func (a *ChainsApiService) GetChainInfo(ctx context.Context, chainID string) ApiGetChainInfoRequest { + return ApiGetChainInfoRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ChainInfoResponse +func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*ChainInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ChainInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetChainInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetChainsRequest struct { + ctx context.Context + ApiService *ChainsApiService +} + +func (r ApiGetChainsRequest) Execute() ([]ChainInfoResponse, *http.Response, error) { + return r.ApiService.GetChainsExecute(r) +} + +/* +GetChains Get a list of all chains + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetChainsRequest +*/ +func (a *ChainsApiService) GetChains(ctx context.Context) ApiGetChainsRequest { + return ApiGetChainsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []ChainInfoResponse +func (a *ChainsApiService) GetChainsExecute(r ApiGetChainsRequest) ([]ChainInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ChainInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetChains") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetCommitteeInfoRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiGetCommitteeInfoRequest) Execute() (*CommitteeInfoResponse, *http.Response, error) { + return r.ApiService.GetCommitteeInfoExecute(r) +} + +/* +GetCommitteeInfo Get information about the deployed committee + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGetCommitteeInfoRequest +*/ +func (a *ChainsApiService) GetCommitteeInfo(ctx context.Context, chainID string) ApiGetCommitteeInfoRequest { + return ApiGetCommitteeInfoRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return CommitteeInfoResponse +func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) (*CommitteeInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CommitteeInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetCommitteeInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/committee" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetContractsRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiGetContractsRequest) Execute() ([]ContractInfoResponse, *http.Response, error) { + return r.ApiService.GetContractsExecute(r) +} + +/* +GetContracts Get all available chain contracts + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGetContractsRequest +*/ +func (a *ChainsApiService) GetContracts(ctx context.Context, chainID string) ApiGetContractsRequest { + return ApiGetContractsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return []ContractInfoResponse +func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]ContractInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ContractInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetContracts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/contracts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRequestIDFromEVMTransactionIDRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string + txHash string +} + +func (r ApiGetRequestIDFromEVMTransactionIDRequest) Execute() (string, *http.Response, error) { + return r.ApiService.GetRequestIDFromEVMTransactionIDExecute(r) +} + +/* +GetRequestIDFromEVMTransactionID Get the ISC request ID for the given Ethereum transaction hash + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param txHash Transaction hash (Hex-encoded) + @return ApiGetRequestIDFromEVMTransactionIDRequest +*/ +func (a *ChainsApiService) GetRequestIDFromEVMTransactionID(ctx context.Context, chainID string, txHash string) ApiGetRequestIDFromEVMTransactionIDRequest { + return ApiGetRequestIDFromEVMTransactionIDRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + txHash: txHash, + } +} + +// Execute executes the request +// @return string +func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetRequestIDFromEVMTransactionIDRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetRequestIDFromEVMTransactionID") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/evm/tx/{txHash}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterToString(r.txHash, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetStateValueRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string + stateKey string +} + +func (r ApiGetStateValueRequest) Execute() ([]int32, *http.Response, error) { + return r.ApiService.GetStateValueExecute(r) +} + +/* +GetStateValue Fetch the raw value associated with the given key in the chain state + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param stateKey Key (Hex-encoded) + @return ApiGetStateValueRequest +*/ +func (a *ChainsApiService) GetStateValue(ctx context.Context, chainID string, stateKey string) ApiGetStateValueRequest { + return ApiGetStateValueRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + stateKey: stateKey, + } +} + +// Execute executes the request +// @return []int32 +func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) ([]int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetStateValue") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/state/{stateKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterToString(r.stateKey, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRemoveAccessNodeRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string + publicKey string +} + +func (r ApiRemoveAccessNodeRequest) Execute() (*http.Response, error) { + return r.ApiService.RemoveAccessNodeExecute(r) +} + +/* +RemoveAccessNode Remove an access node. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param publicKey Nodes public key (Hex) + @return ApiRemoveAccessNodeRequest +*/ +func (a *ChainsApiService) RemoveAccessNode(ctx context.Context, chainID string, publicKey string) ApiRemoveAccessNodeRequest { + return ApiRemoveAccessNodeRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + publicKey: publicKey, + } +} + +// Execute executes the request +func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.RemoveAccessNode") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterToString(r.publicKey, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/client/api_corecontracts.go b/client/api_corecontracts.go new file mode 100644 index 0000000000..fa6d2ce916 --- /dev/null +++ b/client/api_corecontracts.go @@ -0,0 +1,2984 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// CorecontractsApiService CorecontractsApi service +type CorecontractsApiService service + +type ApiAccountsGetAccountBalanceRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + agentID string +} + +func (r ApiAccountsGetAccountBalanceRequest) Execute() (*AssetsResponse, *http.Response, error) { + return r.ApiService.AccountsGetAccountBalanceExecute(r) +} + +/* +AccountsGetAccountBalance Get all assets belonging to an account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param agentID AgentID (Bech32 for WasmVM | Hex for EVM) + @return ApiAccountsGetAccountBalanceRequest +*/ +func (a *CorecontractsApiService) AccountsGetAccountBalance(ctx context.Context, chainID string, agentID string) ApiAccountsGetAccountBalanceRequest { + return ApiAccountsGetAccountBalanceRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + agentID: agentID, + } +} + +// Execute executes the request +// @return AssetsResponse +func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccountsGetAccountBalanceRequest) (*AssetsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AssetsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetAccountBalance") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/balance" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterToString(r.agentID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetAccountNFTIDsRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + agentID string +} + +func (r ApiAccountsGetAccountNFTIDsRequest) Execute() (*AccountNFTsResponse, *http.Response, error) { + return r.ApiService.AccountsGetAccountNFTIDsExecute(r) +} + +/* +AccountsGetAccountNFTIDs Get all NFT ids belonging to an account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param agentID AgentID (Bech32 for WasmVM | Hex for EVM) + @return ApiAccountsGetAccountNFTIDsRequest +*/ +func (a *CorecontractsApiService) AccountsGetAccountNFTIDs(ctx context.Context, chainID string, agentID string) ApiAccountsGetAccountNFTIDsRequest { + return ApiAccountsGetAccountNFTIDsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + agentID: agentID, + } +} + +// Execute executes the request +// @return AccountNFTsResponse +func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsGetAccountNFTIDsRequest) (*AccountNFTsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccountNFTsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetAccountNFTIDs") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nfts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterToString(r.agentID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetAccountNonceRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + agentID string +} + +func (r ApiAccountsGetAccountNonceRequest) Execute() (*AccountNonceResponse, *http.Response, error) { + return r.ApiService.AccountsGetAccountNonceExecute(r) +} + +/* +AccountsGetAccountNonce Get the current nonce of an account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param agentID AgentID (Bech32 for WasmVM | Hex for EVM | '000000@Bech32' Addresses require urlencode) + @return ApiAccountsGetAccountNonceRequest +*/ +func (a *CorecontractsApiService) AccountsGetAccountNonce(ctx context.Context, chainID string, agentID string) ApiAccountsGetAccountNonceRequest { + return ApiAccountsGetAccountNonceRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + agentID: agentID, + } +} + +// Execute executes the request +// @return AccountNonceResponse +func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGetAccountNonceRequest) (*AccountNonceResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccountNonceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetAccountNonce") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nonce" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterToString(r.agentID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetAccountsRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiAccountsGetAccountsRequest) Execute() (*AccountListResponse, *http.Response, error) { + return r.ApiService.AccountsGetAccountsExecute(r) +} + +/* +AccountsGetAccounts Get a list of all accounts + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiAccountsGetAccountsRequest +*/ +func (a *CorecontractsApiService) AccountsGetAccounts(ctx context.Context, chainID string) ApiAccountsGetAccountsRequest { + return ApiAccountsGetAccountsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return AccountListResponse +func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAccountsRequest) (*AccountListResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AccountListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetAccounts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetFoundryOutputRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + chainID2 string +} + +func (r ApiAccountsGetFoundryOutputRequest) Execute() (*FoundryOutputResponse, *http.Response, error) { + return r.ApiService.AccountsGetFoundryOutputExecute(r) +} + +/* +AccountsGetFoundryOutput Get the foundry output + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param chainID2 Serial Number (uint32) + @return ApiAccountsGetFoundryOutputRequest +*/ +func (a *CorecontractsApiService) AccountsGetFoundryOutput(ctx context.Context, chainID string, chainID2 string) ApiAccountsGetFoundryOutputRequest { + return ApiAccountsGetFoundryOutputRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + chainID2: chainID2, + } +} + +// Execute executes the request +// @return FoundryOutputResponse +func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsGetFoundryOutputRequest) (*FoundryOutputResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FoundryOutputResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetFoundryOutput") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/foundry_output" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID_"+"}", url.PathEscape(parameterToString(r.chainID2, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetNFTDataRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + nftID string +} + +func (r ApiAccountsGetNFTDataRequest) Execute() (*NFTDataResponse, *http.Response, error) { + return r.ApiService.AccountsGetNFTDataExecute(r) +} + +/* +AccountsGetNFTData Get the NFT data by an ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param nftID NFT ID (Hex) + @return ApiAccountsGetNFTDataRequest +*/ +func (a *CorecontractsApiService) AccountsGetNFTData(ctx context.Context, chainID string, nftID string) ApiAccountsGetNFTDataRequest { + return ApiAccountsGetNFTDataRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + nftID: nftID, + } +} + +// Execute executes the request +// @return NFTDataResponse +func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTDataRequest) (*NFTDataResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NFTDataResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetNFTData") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/nftdata" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterToString(r.nftID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetNativeTokenIDRegistryRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiAccountsGetNativeTokenIDRegistryRequest) Execute() (*NativeTokenIDRegistryResponse, *http.Response, error) { + return r.ApiService.AccountsGetNativeTokenIDRegistryExecute(r) +} + +/* +AccountsGetNativeTokenIDRegistry Get a list of all registries + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiAccountsGetNativeTokenIDRegistryRequest +*/ +func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistry(ctx context.Context, chainID string) ApiAccountsGetNativeTokenIDRegistryRequest { + return ApiAccountsGetNativeTokenIDRegistryRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return NativeTokenIDRegistryResponse +func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiAccountsGetNativeTokenIDRegistryRequest) (*NativeTokenIDRegistryResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NativeTokenIDRegistryResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetNativeTokenIDRegistry") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/token_registry" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAccountsGetTotalAssetsRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiAccountsGetTotalAssetsRequest) Execute() (*AssetsResponse, *http.Response, error) { + return r.ApiService.AccountsGetTotalAssetsExecute(r) +} + +/* +AccountsGetTotalAssets Get all stored assets + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiAccountsGetTotalAssetsRequest +*/ +func (a *CorecontractsApiService) AccountsGetTotalAssets(ctx context.Context, chainID string) ApiAccountsGetTotalAssetsRequest { + return ApiAccountsGetTotalAssetsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return AssetsResponse +func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGetTotalAssetsRequest) (*AssetsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AssetsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.AccountsGetTotalAssets") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/total_assets" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlobsGetAllBlobsRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiBlobsGetAllBlobsRequest) Execute() (*BlobListResponse, *http.Response, error) { + return r.ApiService.BlobsGetAllBlobsExecute(r) +} + +/* +BlobsGetAllBlobs Get all stored blobs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiBlobsGetAllBlobsRequest +*/ +func (a *CorecontractsApiService) BlobsGetAllBlobs(ctx context.Context, chainID string) ApiBlobsGetAllBlobsRequest { + return ApiBlobsGetAllBlobsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return BlobListResponse +func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsRequest) (*BlobListResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlobListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlobsGetAllBlobs") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlobsGetBlobInfoRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + blobHash string +} + +func (r ApiBlobsGetBlobInfoRequest) Execute() (*BlobInfoResponse, *http.Response, error) { + return r.ApiService.BlobsGetBlobInfoExecute(r) +} + +/* +BlobsGetBlobInfo Get all fields of a blob + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param blobHash BlobHash (Hex) + @return ApiBlobsGetBlobInfoRequest +*/ +func (a *CorecontractsApiService) BlobsGetBlobInfo(ctx context.Context, chainID string, blobHash string) ApiBlobsGetBlobInfoRequest { + return ApiBlobsGetBlobInfoRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + blobHash: blobHash, + } +} + +// Execute executes the request +// @return BlobInfoResponse +func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoRequest) (*BlobInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlobInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlobsGetBlobInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterToString(r.blobHash, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlobsGetBlobValueRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + blobHash string + fieldKey string +} + +func (r ApiBlobsGetBlobValueRequest) Execute() (*BlobValueResponse, *http.Response, error) { + return r.ApiService.BlobsGetBlobValueExecute(r) +} + +/* +BlobsGetBlobValue Get the value of the supplied field (key) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param blobHash BlobHash (Hex) + @param fieldKey FieldKey (String) + @return ApiBlobsGetBlobValueRequest +*/ +func (a *CorecontractsApiService) BlobsGetBlobValue(ctx context.Context, chainID string, blobHash string, fieldKey string) ApiBlobsGetBlobValueRequest { + return ApiBlobsGetBlobValueRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + blobHash: blobHash, + fieldKey: fieldKey, + } +} + +// Execute executes the request +// @return BlobValueResponse +func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValueRequest) (*BlobValueResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlobValueResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlobsGetBlobValue") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterToString(r.blobHash, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterToString(r.fieldKey, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetBlockInfoRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + blockIndex int32 +} + +func (r ApiBlocklogGetBlockInfoRequest) Execute() (*BlockInfoResponse, *http.Response, error) { + return r.ApiService.BlocklogGetBlockInfoExecute(r) +} + +/* +BlocklogGetBlockInfo Get the block info of a certain block index + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param blockIndex Block Index (uint32) + @return ApiBlocklogGetBlockInfoRequest +*/ +func (a *CorecontractsApiService) BlocklogGetBlockInfo(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetBlockInfoRequest { + return ApiBlocklogGetBlockInfoRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + blockIndex: blockIndex, + } +} + +// Execute executes the request +// @return BlockInfoResponse +func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBlockInfoRequest) (*BlockInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlockInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetBlockInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetControlAddressesRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiBlocklogGetControlAddressesRequest) Execute() (*ControlAddressesResponse, *http.Response, error) { + return r.ApiService.BlocklogGetControlAddressesExecute(r) +} + +/* +BlocklogGetControlAddresses Get the control addresses + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiBlocklogGetControlAddressesRequest +*/ +func (a *CorecontractsApiService) BlocklogGetControlAddresses(ctx context.Context, chainID string) ApiBlocklogGetControlAddressesRequest { + return ApiBlocklogGetControlAddressesRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ControlAddressesResponse +func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlocklogGetControlAddressesRequest) (*ControlAddressesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ControlAddressesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetControlAddresses") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/controladdresses" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetEventsOfBlockRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + blockIndex int32 +} + +func (r ApiBlocklogGetEventsOfBlockRequest) Execute() (*EventsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetEventsOfBlockExecute(r) +} + +/* +BlocklogGetEventsOfBlock Get events of a block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param blockIndex Block Index (uint32) + @return ApiBlocklogGetEventsOfBlockRequest +*/ +func (a *CorecontractsApiService) BlocklogGetEventsOfBlock(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetEventsOfBlockRequest { + return ApiBlocklogGetEventsOfBlockRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + blockIndex: blockIndex, + } +} + +// Execute executes the request +// @return EventsResponse +func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogGetEventsOfBlockRequest) (*EventsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetEventsOfBlock") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetEventsOfContractRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + contractHname string +} + +func (r ApiBlocklogGetEventsOfContractRequest) Execute() (*EventsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetEventsOfContractExecute(r) +} + +/* +BlocklogGetEventsOfContract Get events of a contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param contractHname Contract (Hname) + @return ApiBlocklogGetEventsOfContractRequest +*/ +func (a *CorecontractsApiService) BlocklogGetEventsOfContract(ctx context.Context, chainID string, contractHname string) ApiBlocklogGetEventsOfContractRequest { + return ApiBlocklogGetEventsOfContractRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + contractHname: contractHname, + } +} + +// Execute executes the request +// @return EventsResponse +func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlocklogGetEventsOfContractRequest) (*EventsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetEventsOfContract") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterToString(r.contractHname, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetEventsOfLatestBlockRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiBlocklogGetEventsOfLatestBlockRequest) Execute() (*EventsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetEventsOfLatestBlockExecute(r) +} + +/* +BlocklogGetEventsOfLatestBlock Get events of the latest block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiBlocklogGetEventsOfLatestBlockRequest +*/ +func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlock(ctx context.Context, chainID string) ApiBlocklogGetEventsOfLatestBlockRequest { + return ApiBlocklogGetEventsOfLatestBlockRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return EventsResponse +func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlocklogGetEventsOfLatestBlockRequest) (*EventsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetEventsOfLatestBlock") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/latest" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetEventsOfRequestRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + requestID string +} + +func (r ApiBlocklogGetEventsOfRequestRequest) Execute() (*EventsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetEventsOfRequestExecute(r) +} + +/* +BlocklogGetEventsOfRequest Get events of a request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param requestID Request ID (ISCRequestID) + @return ApiBlocklogGetEventsOfRequestRequest +*/ +func (a *CorecontractsApiService) BlocklogGetEventsOfRequest(ctx context.Context, chainID string, requestID string) ApiBlocklogGetEventsOfRequestRequest { + return ApiBlocklogGetEventsOfRequestRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + requestID: requestID, + } +} + +// Execute executes the request +// @return EventsResponse +func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklogGetEventsOfRequestRequest) (*EventsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetEventsOfRequest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/request/{requestID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetLatestBlockInfoRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiBlocklogGetLatestBlockInfoRequest) Execute() (*BlockInfoResponse, *http.Response, error) { + return r.ApiService.BlocklogGetLatestBlockInfoExecute(r) +} + +/* +BlocklogGetLatestBlockInfo Get the block info of the latest block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiBlocklogGetLatestBlockInfoRequest +*/ +func (a *CorecontractsApiService) BlocklogGetLatestBlockInfo(ctx context.Context, chainID string) ApiBlocklogGetLatestBlockInfoRequest { + return ApiBlocklogGetLatestBlockInfoRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return BlockInfoResponse +func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklogGetLatestBlockInfoRequest) (*BlockInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlockInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetLatestBlockInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetRequestIDsForBlockRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + blockIndex int32 +} + +func (r ApiBlocklogGetRequestIDsForBlockRequest) Execute() (*RequestIDsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetRequestIDsForBlockExecute(r) +} + +/* +BlocklogGetRequestIDsForBlock Get the request ids for a certain block index + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param blockIndex Block Index (uint32) + @return ApiBlocklogGetRequestIDsForBlockRequest +*/ +func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlock(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetRequestIDsForBlockRequest { + return ApiBlocklogGetRequestIDsForBlockRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + blockIndex: blockIndex, + } +} + +// Execute executes the request +// @return RequestIDsResponse +func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBlocklogGetRequestIDsForBlockRequest) (*RequestIDsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestIDsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetRequestIDsForBlock") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetRequestIDsForLatestBlockRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiBlocklogGetRequestIDsForLatestBlockRequest) Execute() (*RequestIDsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetRequestIDsForLatestBlockExecute(r) +} + +/* +BlocklogGetRequestIDsForLatestBlock Get the request ids for the latest block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiBlocklogGetRequestIDsForLatestBlockRequest +*/ +func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlock(ctx context.Context, chainID string) ApiBlocklogGetRequestIDsForLatestBlockRequest { + return ApiBlocklogGetRequestIDsForLatestBlockRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return RequestIDsResponse +func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r ApiBlocklogGetRequestIDsForLatestBlockRequest) (*RequestIDsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestIDsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetRequestIDsForLatestBlock") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/requestids" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetRequestIsProcessedRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + requestID string +} + +func (r ApiBlocklogGetRequestIsProcessedRequest) Execute() (*RequestProcessedResponse, *http.Response, error) { + return r.ApiService.BlocklogGetRequestIsProcessedExecute(r) +} + +/* +BlocklogGetRequestIsProcessed Get the request processing status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param requestID Request ID (ISCRequestID) + @return ApiBlocklogGetRequestIsProcessedRequest +*/ +func (a *CorecontractsApiService) BlocklogGetRequestIsProcessed(ctx context.Context, chainID string, requestID string) ApiBlocklogGetRequestIsProcessedRequest { + return ApiBlocklogGetRequestIsProcessedRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + requestID: requestID, + } +} + +// Execute executes the request +// @return RequestProcessedResponse +func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBlocklogGetRequestIsProcessedRequest) (*RequestProcessedResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestProcessedResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetRequestIsProcessed") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetRequestReceiptRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + requestID string +} + +func (r ApiBlocklogGetRequestReceiptRequest) Execute() (*RequestReceiptResponse, *http.Response, error) { + return r.ApiService.BlocklogGetRequestReceiptExecute(r) +} + +/* +BlocklogGetRequestReceipt Get the receipt of a certain request id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param requestID Request ID (ISCRequestID) + @return ApiBlocklogGetRequestReceiptRequest +*/ +func (a *CorecontractsApiService) BlocklogGetRequestReceipt(ctx context.Context, chainID string, requestID string) ApiBlocklogGetRequestReceiptRequest { + return ApiBlocklogGetRequestReceiptRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + requestID: requestID, + } +} + +// Execute executes the request +// @return RequestReceiptResponse +func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklogGetRequestReceiptRequest) (*RequestReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetRequestReceipt") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetRequestReceiptsOfBlockRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + blockIndex int32 +} + +func (r ApiBlocklogGetRequestReceiptsOfBlockRequest) Execute() (*BlockReceiptsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetRequestReceiptsOfBlockExecute(r) +} + +/* +BlocklogGetRequestReceiptsOfBlock Get all receipts of a certain block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param blockIndex Block Index (uint32) + @return ApiBlocklogGetRequestReceiptsOfBlockRequest +*/ +func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlock(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetRequestReceiptsOfBlockRequest { + return ApiBlocklogGetRequestReceiptsOfBlockRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + blockIndex: blockIndex, + } +} + +// Execute executes the request +// @return BlockReceiptsResponse +func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r ApiBlocklogGetRequestReceiptsOfBlockRequest) (*BlockReceiptsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlockReceiptsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetRequestReceiptsOfBlock") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBlocklogGetRequestReceiptsOfLatestBlockRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiBlocklogGetRequestReceiptsOfLatestBlockRequest) Execute() (*BlockReceiptsResponse, *http.Response, error) { + return r.ApiService.BlocklogGetRequestReceiptsOfLatestBlockExecute(r) +} + +/* +BlocklogGetRequestReceiptsOfLatestBlock Get all receipts of the latest block + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiBlocklogGetRequestReceiptsOfLatestBlockRequest +*/ +func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlock(ctx context.Context, chainID string) ApiBlocklogGetRequestReceiptsOfLatestBlockRequest { + return ApiBlocklogGetRequestReceiptsOfLatestBlockRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return BlockReceiptsResponse +func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute(r ApiBlocklogGetRequestReceiptsOfLatestBlockRequest) (*BlockReceiptsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlockReceiptsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.BlocklogGetRequestReceiptsOfLatestBlock") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/receipts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiErrorsGetErrorMessageFormatRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string + contractHname string + errorID string +} + +func (r ApiErrorsGetErrorMessageFormatRequest) Execute() (*ErrorMessageFormatResponse, *http.Response, error) { + return r.ApiService.ErrorsGetErrorMessageFormatExecute(r) +} + +/* +ErrorsGetErrorMessageFormat Get the error message format of a specific error id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param contractHname Contract (Hname as Hex) + @param errorID Error Id (uint16) + @return ApiErrorsGetErrorMessageFormatRequest +*/ +func (a *CorecontractsApiService) ErrorsGetErrorMessageFormat(ctx context.Context, chainID string, contractHname string, errorID string) ApiErrorsGetErrorMessageFormatRequest { + return ApiErrorsGetErrorMessageFormatRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + contractHname: contractHname, + errorID: errorID, + } +} + +// Execute executes the request +// @return ErrorMessageFormatResponse +func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrorsGetErrorMessageFormatRequest) (*ErrorMessageFormatResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ErrorMessageFormatResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.ErrorsGetErrorMessageFormat") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterToString(r.contractHname, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterToString(r.errorID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGovernanceGetChainInfoRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiGovernanceGetChainInfoRequest) Execute() (*GovChainInfoResponse, *http.Response, error) { + return r.ApiService.GovernanceGetChainInfoExecute(r) +} + +/* +GovernanceGetChainInfo Get the chain info + +If you are using the common API functions, you most likely rather want to use '/chains/:chainID' to get information about a chain. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGovernanceGetChainInfoRequest +*/ +func (a *CorecontractsApiService) GovernanceGetChainInfo(ctx context.Context, chainID string) ApiGovernanceGetChainInfoRequest { + return ApiGovernanceGetChainInfoRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return GovChainInfoResponse +func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceGetChainInfoRequest) (*GovChainInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GovChainInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.GovernanceGetChainInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/chaininfo" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/client/api_metrics.go b/client/api_metrics.go new file mode 100644 index 0000000000..e6bba4fc99 --- /dev/null +++ b/client/api_metrics.go @@ -0,0 +1,520 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// MetricsApiService MetricsApi service +type MetricsApiService service + +type ApiGetChainMetricsRequest struct { + ctx context.Context + ApiService *MetricsApiService + chainID string +} + +func (r ApiGetChainMetricsRequest) Execute() (*ChainMetrics, *http.Response, error) { + return r.ApiService.GetChainMetricsExecute(r) +} + +/* +GetChainMetrics Get chain specific metrics. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGetChainMetricsRequest +*/ +func (a *MetricsApiService) GetChainMetrics(ctx context.Context, chainID string) ApiGetChainMetricsRequest { + return ApiGetChainMetricsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ChainMetrics +func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) (*ChainMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ChainMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetricsApiService.GetChainMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metrics/chain/{chainID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetChainPipeMetricsRequest struct { + ctx context.Context + ApiService *MetricsApiService + chainID string +} + +func (r ApiGetChainPipeMetricsRequest) Execute() (*ConsensusPipeMetrics, *http.Response, error) { + return r.ApiService.GetChainPipeMetricsExecute(r) +} + +/* +GetChainPipeMetrics Get chain pipe event metrics. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGetChainPipeMetricsRequest +*/ +func (a *MetricsApiService) GetChainPipeMetrics(ctx context.Context, chainID string) ApiGetChainPipeMetricsRequest { + return ApiGetChainPipeMetricsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ConsensusPipeMetrics +func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsRequest) (*ConsensusPipeMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsensusPipeMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetricsApiService.GetChainPipeMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metrics/chain/{chainID}/pipe" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetChainWorkflowMetricsRequest struct { + ctx context.Context + ApiService *MetricsApiService + chainID string +} + +func (r ApiGetChainWorkflowMetricsRequest) Execute() (*ConsensusWorkflowMetrics, *http.Response, error) { + return r.ApiService.GetChainWorkflowMetricsExecute(r) +} + +/* +GetChainWorkflowMetrics Get chain workflow metrics. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGetChainWorkflowMetricsRequest +*/ +func (a *MetricsApiService) GetChainWorkflowMetrics(ctx context.Context, chainID string) ApiGetChainWorkflowMetricsRequest { + return ApiGetChainWorkflowMetricsRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ConsensusWorkflowMetrics +func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflowMetricsRequest) (*ConsensusWorkflowMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsensusWorkflowMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetricsApiService.GetChainWorkflowMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metrics/chain/{chainID}/workflow" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetL1MetricsRequest struct { + ctx context.Context + ApiService *MetricsApiService +} + +func (r ApiGetL1MetricsRequest) Execute() (*ChainMetrics, *http.Response, error) { + return r.ApiService.GetL1MetricsExecute(r) +} + +/* +GetL1Metrics Get accumulated metrics. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetL1MetricsRequest +*/ +func (a *MetricsApiService) GetL1Metrics(ctx context.Context) ApiGetL1MetricsRequest { + return ApiGetL1MetricsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ChainMetrics +func (a *MetricsApiService) GetL1MetricsExecute(r ApiGetL1MetricsRequest) (*ChainMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ChainMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetricsApiService.GetL1Metrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metrics/l1" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/client/api_node.go b/client/api_node.go new file mode 100644 index 0000000000..e1ff44f296 --- /dev/null +++ b/client/api_node.go @@ -0,0 +1,1460 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// NodeApiService NodeApi service +type NodeApiService service + +type ApiDistrustPeerRequest struct { + ctx context.Context + ApiService *NodeApiService + peeringTrustRequest *PeeringTrustRequest +} + +// Info of the peer to distrust +func (r ApiDistrustPeerRequest) PeeringTrustRequest(peeringTrustRequest PeeringTrustRequest) ApiDistrustPeerRequest { + r.peeringTrustRequest = &peeringTrustRequest + return r +} + +func (r ApiDistrustPeerRequest) Execute() (*http.Response, error) { + return r.ApiService.DistrustPeerExecute(r) +} + +/* +DistrustPeer Distrust a peering node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDistrustPeerRequest +*/ +func (a *NodeApiService) DistrustPeer(ctx context.Context) ApiDistrustPeerRequest { + return ApiDistrustPeerRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NodeApiService) DistrustPeerExecute(r ApiDistrustPeerRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.DistrustPeer") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/peers/trusted" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.peeringTrustRequest == nil { + return nil, reportError("peeringTrustRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.peeringTrustRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGenerateDKSRequest struct { + ctx context.Context + ApiService *NodeApiService + dKSharesPostRequest *DKSharesPostRequest +} + +// Request parameters +func (r ApiGenerateDKSRequest) DKSharesPostRequest(dKSharesPostRequest DKSharesPostRequest) ApiGenerateDKSRequest { + r.dKSharesPostRequest = &dKSharesPostRequest + return r +} + +func (r ApiGenerateDKSRequest) Execute() (*DKSharesPostRequest, *http.Response, error) { + return r.ApiService.GenerateDKSExecute(r) +} + +/* +GenerateDKS Generate a new distributed key + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGenerateDKSRequest +*/ +func (a *NodeApiService) GenerateDKS(ctx context.Context) ApiGenerateDKSRequest { + return ApiGenerateDKSRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DKSharesPostRequest +func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesPostRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DKSharesPostRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GenerateDKS") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/dks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dKSharesPostRequest == nil { + return localVarReturnValue, nil, reportError("dKSharesPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.dKSharesPostRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAllPeersRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiGetAllPeersRequest) Execute() ([]PeeringNodeStatusResponse, *http.Response, error) { + return r.ApiService.GetAllPeersExecute(r) +} + +/* +GetAllPeers Get basic information about all configured peers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPeersRequest +*/ +func (a *NodeApiService) GetAllPeers(ctx context.Context) ApiGetAllPeersRequest { + return ApiGetAllPeersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []PeeringNodeStatusResponse +func (a *NodeApiService) GetAllPeersExecute(r ApiGetAllPeersRequest) ([]PeeringNodeStatusResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PeeringNodeStatusResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetAllPeers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/peers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetConfigurationRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiGetConfigurationRequest) Execute() (map[string]string, *http.Response, error) { + return r.ApiService.GetConfigurationExecute(r) +} + +/* +GetConfiguration Return the Wasp configuration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConfigurationRequest +*/ +func (a *NodeApiService) GetConfiguration(ctx context.Context) ApiGetConfigurationRequest { + return ApiGetConfigurationRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return map[string]string +func (a *NodeApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) (map[string]string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetConfiguration") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/config" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDKSInfoRequest struct { + ctx context.Context + ApiService *NodeApiService + sharedAddress string +} + +func (r ApiGetDKSInfoRequest) Execute() (*DKSharesInfo, *http.Response, error) { + return r.ApiService.GetDKSInfoExecute(r) +} + +/* +GetDKSInfo Get information about the shared address DKS configuration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param sharedAddress SharedAddress (Bech32) + @return ApiGetDKSInfoRequest +*/ +func (a *NodeApiService) GetDKSInfo(ctx context.Context, sharedAddress string) ApiGetDKSInfoRequest { + return ApiGetDKSInfoRequest{ + ApiService: a, + ctx: ctx, + sharedAddress: sharedAddress, + } +} + +// Execute executes the request +// @return DKSharesInfo +func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DKSharesInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetDKSInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/dks/{sharedAddress}" + localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterToString(r.sharedAddress, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInfoRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiGetInfoRequest) Execute() (*InfoResponse, *http.Response, error) { + return r.ApiService.GetInfoExecute(r) +} + +/* +GetInfo Returns private information about this node. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInfoRequest +*/ +func (a *NodeApiService) GetInfo(ctx context.Context) ApiGetInfoRequest { + return ApiGetInfoRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InfoResponse +func (a *NodeApiService) GetInfoExecute(r ApiGetInfoRequest) (*InfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPeeringIdentityRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiGetPeeringIdentityRequest) Execute() (*PeeringNodeIdentityResponse, *http.Response, error) { + return r.ApiService.GetPeeringIdentityExecute(r) +} + +/* +GetPeeringIdentity Get basic peer info of the current node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPeeringIdentityRequest +*/ +func (a *NodeApiService) GetPeeringIdentity(ctx context.Context) ApiGetPeeringIdentityRequest { + return ApiGetPeeringIdentityRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PeeringNodeIdentityResponse +func (a *NodeApiService) GetPeeringIdentityExecute(r ApiGetPeeringIdentityRequest) (*PeeringNodeIdentityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PeeringNodeIdentityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetPeeringIdentity") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/peers/identity" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTrustedPeersRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiGetTrustedPeersRequest) Execute() ([]PeeringNodeIdentityResponse, *http.Response, error) { + return r.ApiService.GetTrustedPeersExecute(r) +} + +/* +GetTrustedPeers Get trusted peers + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTrustedPeersRequest +*/ +func (a *NodeApiService) GetTrustedPeers(ctx context.Context) ApiGetTrustedPeersRequest { + return ApiGetTrustedPeersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []PeeringNodeIdentityResponse +func (a *NodeApiService) GetTrustedPeersExecute(r ApiGetTrustedPeersRequest) ([]PeeringNodeIdentityResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PeeringNodeIdentityResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetTrustedPeers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/peers/trusted" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVersionRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiGetVersionRequest) Execute() (string, *http.Response, error) { + return r.ApiService.GetVersionExecute(r) +} + +/* +GetVersion Returns the node version. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetVersionRequest +*/ +func (a *NodeApiService) GetVersion(ctx context.Context) ApiGetVersionRequest { + return ApiGetVersionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetVersion") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/node/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetNodeOwnerRequest struct { + ctx context.Context + ApiService *NodeApiService + nodeOwnerCertificateRequest *NodeOwnerCertificateRequest +} + +// The node owner certificate +func (r ApiSetNodeOwnerRequest) NodeOwnerCertificateRequest(nodeOwnerCertificateRequest NodeOwnerCertificateRequest) ApiSetNodeOwnerRequest { + r.nodeOwnerCertificateRequest = &nodeOwnerCertificateRequest + return r +} + +func (r ApiSetNodeOwnerRequest) Execute() (*http.Response, error) { + return r.ApiService.SetNodeOwnerExecute(r) +} + +/* +SetNodeOwner Sets the node owner + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSetNodeOwnerRequest +*/ +func (a *NodeApiService) SetNodeOwner(ctx context.Context) ApiSetNodeOwnerRequest { + return ApiSetNodeOwnerRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.SetNodeOwner") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/owner/certificate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.nodeOwnerCertificateRequest == nil { + return nil, reportError("nodeOwnerCertificateRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.nodeOwnerCertificateRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiShutdownNodeRequest struct { + ctx context.Context + ApiService *NodeApiService +} + +func (r ApiShutdownNodeRequest) Execute() (*http.Response, error) { + return r.ApiService.ShutdownNodeExecute(r) +} + +/* +ShutdownNode Shut down the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiShutdownNodeRequest +*/ +func (a *NodeApiService) ShutdownNode(ctx context.Context) ApiShutdownNodeRequest { + return ApiShutdownNodeRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NodeApiService) ShutdownNodeExecute(r ApiShutdownNodeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.ShutdownNode") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/shutdown" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTrustPeerRequest struct { + ctx context.Context + ApiService *NodeApiService + peeringTrustRequest *PeeringTrustRequest +} + +// Info of the peer to trust +func (r ApiTrustPeerRequest) PeeringTrustRequest(peeringTrustRequest PeeringTrustRequest) ApiTrustPeerRequest { + r.peeringTrustRequest = &peeringTrustRequest + return r +} + +func (r ApiTrustPeerRequest) Execute() (*http.Response, error) { + return r.ApiService.TrustPeerExecute(r) +} + +/* +TrustPeer Trust a peering node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTrustPeerRequest +*/ +func (a *NodeApiService) TrustPeer(ctx context.Context) ApiTrustPeerRequest { + return ApiTrustPeerRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NodeApiService) TrustPeerExecute(r ApiTrustPeerRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.TrustPeer") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node/peers/trusted" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.peeringTrustRequest == nil { + return nil, reportError("peeringTrustRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.peeringTrustRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/client/api_requests.go b/client/api_requests.go new file mode 100644 index 0000000000..47767d55fa --- /dev/null +++ b/client/api_requests.go @@ -0,0 +1,437 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// RequestsApiService RequestsApi service +type RequestsApiService service + +type ApiCallViewRequest struct { + ctx context.Context + ApiService *RequestsApiService + contractCallViewRequest *ContractCallViewRequest +} + +// Parameters +func (r ApiCallViewRequest) ContractCallViewRequest(contractCallViewRequest ContractCallViewRequest) ApiCallViewRequest { + r.contractCallViewRequest = &contractCallViewRequest + return r +} + +func (r ApiCallViewRequest) Execute() (*JSONDict, *http.Response, error) { + return r.ApiService.CallViewExecute(r) +} + +/* +CallView Call a view function on a contract by Hname + +Execute a view call. Either use HName or Name properties. If both are supplied, HName are used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCallViewRequest +*/ +func (a *RequestsApiService) CallView(ctx context.Context) ApiCallViewRequest { + return ApiCallViewRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return JSONDict +func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JSONDict + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.CallView") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/requests/callview" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.contractCallViewRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetReceiptRequest struct { + ctx context.Context + ApiService *RequestsApiService + chainID string + requestID string +} + +func (r ApiGetReceiptRequest) Execute() (*ReceiptResponse, *http.Response, error) { + return r.ApiService.GetReceiptExecute(r) +} + +/* +GetReceipt Get a receipt from a request ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param requestID RequestID (Hex) + @return ApiGetReceiptRequest +*/ +func (a *RequestsApiService) GetReceipt(ctx context.Context, chainID string, requestID string) ApiGetReceiptRequest { + return ApiGetReceiptRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + requestID: requestID, + } +} + +// Execute executes the request +// @return ReceiptResponse +func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*ReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.GetReceipt") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/receipts/{requestID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOffLedgerRequest struct { + ctx context.Context + ApiService *RequestsApiService + offLedgerRequest *OffLedgerRequest +} + +// Offledger request as JSON. Request encoded in Hex +func (r ApiOffLedgerRequest) OffLedgerRequest(offLedgerRequest OffLedgerRequest) ApiOffLedgerRequest { + r.offLedgerRequest = &offLedgerRequest + return r +} + +func (r ApiOffLedgerRequest) Execute() (*http.Response, error) { + return r.ApiService.OffLedgerExecute(r) +} + +/* +OffLedger Post an off-ledger request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOffLedgerRequest +*/ +func (a *RequestsApiService) OffLedger(ctx context.Context) ApiOffLedgerRequest { + return ApiOffLedgerRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.OffLedger") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/requests/offledger" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.offLedgerRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiWaitForTransactionRequest struct { + ctx context.Context + ApiService *RequestsApiService + chainID string + requestID string +} + +func (r ApiWaitForTransactionRequest) Execute() (*ReceiptResponse, *http.Response, error) { + return r.ApiService.WaitForTransactionExecute(r) +} + +/* +WaitForTransaction Wait until the given request has been processed by the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @param requestID RequestID (Hex) + @return ApiWaitForTransactionRequest +*/ +func (a *RequestsApiService) WaitForTransaction(ctx context.Context, chainID string, requestID string) ApiWaitForTransactionRequest { + return ApiWaitForTransactionRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + requestID: requestID, + } +} + +// Execute executes the request +// @return ReceiptResponse +func (a *RequestsApiService) WaitForTransactionExecute(r ApiWaitForTransactionRequest) (*ReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.WaitForTransaction") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/requests/{requestID}/wait" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/client/api_users.go b/client/api_users.go new file mode 100644 index 0000000000..2e08fefdee --- /dev/null +++ b/client/api_users.go @@ -0,0 +1,760 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// UsersApiService UsersApi service +type UsersApiService service + +type ApiAddUserRequest struct { + ctx context.Context + ApiService *UsersApiService + addUserRequest *AddUserRequest +} + +// The user data +func (r ApiAddUserRequest) AddUserRequest(addUserRequest AddUserRequest) ApiAddUserRequest { + r.addUserRequest = &addUserRequest + return r +} + +func (r ApiAddUserRequest) Execute() (*http.Response, error) { + return r.ApiService.AddUserExecute(r) +} + +/* +AddUser Add a user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAddUserRequest +*/ +func (a *UsersApiService) AddUser(ctx context.Context) ApiAddUserRequest { + return ApiAddUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UsersApiService) AddUserExecute(r ApiAddUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.AddUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.addUserRequest == nil { + return nil, reportError("addUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.addUserRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiChangeUserPasswordRequest struct { + ctx context.Context + ApiService *UsersApiService + username string + updateUserPasswordRequest *UpdateUserPasswordRequest +} + +// The users new password +func (r ApiChangeUserPasswordRequest) UpdateUserPasswordRequest(updateUserPasswordRequest UpdateUserPasswordRequest) ApiChangeUserPasswordRequest { + r.updateUserPasswordRequest = &updateUserPasswordRequest + return r +} + +func (r ApiChangeUserPasswordRequest) Execute() (*http.Response, error) { + return r.ApiService.ChangeUserPasswordExecute(r) +} + +/* +ChangeUserPassword Change user password + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username. + @return ApiChangeUserPasswordRequest +*/ +func (a *UsersApiService) ChangeUserPassword(ctx context.Context, username string) ApiChangeUserPasswordRequest { + return ApiChangeUserPasswordRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ChangeUserPassword") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}/password" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateUserPasswordRequest == nil { + return nil, reportError("updateUserPasswordRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.updateUserPasswordRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiChangeUserPermissionsRequest struct { + ctx context.Context + ApiService *UsersApiService + username string + updateUserPermissionsRequest *UpdateUserPermissionsRequest +} + +// The users new permissions +func (r ApiChangeUserPermissionsRequest) UpdateUserPermissionsRequest(updateUserPermissionsRequest UpdateUserPermissionsRequest) ApiChangeUserPermissionsRequest { + r.updateUserPermissionsRequest = &updateUserPermissionsRequest + return r +} + +func (r ApiChangeUserPermissionsRequest) Execute() (*http.Response, error) { + return r.ApiService.ChangeUserPermissionsExecute(r) +} + +/* +ChangeUserPermissions Change user permissions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username. + @return ApiChangeUserPermissionsRequest +*/ +func (a *UsersApiService) ChangeUserPermissions(ctx context.Context, username string) ApiChangeUserPermissionsRequest { + return ApiChangeUserPermissionsRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermissionsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ChangeUserPermissions") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}/permissions" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateUserPermissionsRequest == nil { + return nil, reportError("updateUserPermissionsRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.updateUserPermissionsRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService *UsersApiService + username string +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Deletes a user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username + @return ApiDeleteUserRequest +*/ +func (a *UsersApiService) DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.DeleteUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService *UsersApiService + username string +} + +func (r ApiGetUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Get a user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username + @return ApiGetUserRequest +*/ +func (a *UsersApiService) GetUser(ctx context.Context, username string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +// @return User +func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.GetUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUsersRequest struct { + ctx context.Context + ApiService *UsersApiService +} + +func (r ApiGetUsersRequest) Execute() ([]User, *http.Response, error) { + return r.ApiService.GetUsersExecute(r) +} + +/* +GetUsers Get a list of all users + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetUsersRequest +*/ +func (a *UsersApiService) GetUsers(ctx context.Context) ApiGetUsersRequest { + return ApiGetUsersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []User +func (a *UsersApiService) GetUsersExecute(r ApiGetUsersRequest) ([]User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.GetUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/client/authentication.go b/client/authentication.go deleted file mode 100644 index d9cf650b54..0000000000 --- a/client/authentication.go +++ /dev/null @@ -1,34 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/authentication/shared" -) - -func (c *WaspClient) Login(username, password string) (string, error) { - loginRequest := shared.LoginRequest{ - Username: username, - Password: password, - } - - loginResponse := shared.LoginResponse{} - - err := c.do(http.MethodPost, shared.AuthRoute(), &loginRequest, &loginResponse) - if err != nil { - return "", err - } - - return loginResponse.JWT, nil -} - -func (c *WaspClient) AuthInfo() (*shared.AuthInfoModel, error) { - authInfoResponse := shared.AuthInfoModel{} - - err := c.do(http.MethodGet, shared.AuthInfoRoute(), nil, &authInfoResponse) - if err != nil { - return nil, err - } - - return &authInfoResponse, nil -} diff --git a/client/callview.go b/client/callview.go deleted file mode 100644 index 853b747d6c..0000000000 --- a/client/callview.go +++ /dev/null @@ -1,29 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func (c *WaspClient) CallView(chainID isc.ChainID, hContract isc.Hname, functionName string, args dict.Dict) (dict.Dict, error) { - arguments := args - if arguments == nil { - arguments = dict.Dict(nil) - } - var res dict.Dict - err := c.do(http.MethodPost, routes.CallViewByName(chainID.String(), hContract.String(), functionName), arguments, &res) - return res, err -} - -func (c *WaspClient) CallViewByHname(chainID isc.ChainID, hContract, hFunction isc.Hname, args dict.Dict) (dict.Dict, error) { - arguments := args - if arguments == nil { - arguments = dict.Dict(nil) - } - var res dict.Dict - err := c.do(http.MethodPost, routes.CallViewByHname(chainID.String(), hContract.String(), hFunction.String()), arguments, &res) - return res, err -} diff --git a/client/chain_info.go b/client/chain_info.go deleted file mode 100644 index 6e45f57e37..0000000000 --- a/client/chain_info.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// GetChainRecord fetches ChainInfo by address -func (c *WaspClient) GetChainInfo(chainID isc.ChainID) (*model.ChainInfo, error) { - res := &model.ChainInfo{} - if err := c.do(http.MethodGet, routes.GetChainInfo(chainID.String()), nil, res); err != nil { - return nil, err - } - return res, nil -} diff --git a/client/chain_record.go b/client/chain_record.go deleted file mode 100644 index b26b667113..0000000000 --- a/client/chain_record.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// PutChainRecord sends a request to write a Record -func (c *WaspClient) PutChainRecord(rec *registry.ChainRecord) error { - return c.do(http.MethodPost, routes.PutChainRecord(), model.NewChainRecord(rec), nil) -} - -// GetChainRecord fetches a Record by address -func (c *WaspClient) GetChainRecord(chainID isc.ChainID) (*registry.ChainRecord, error) { - res := &model.ChainRecord{} - if err := c.do(http.MethodGet, routes.GetChainRecord(chainID.String()), nil, res); err != nil { - return nil, err - } - return res.Record() -} - -// GetChainRecordList fetches the list of all chains in the node -func (c *WaspClient) GetChainRecordList() ([]*registry.ChainRecord, error) { - var res []*model.ChainRecord - if err := c.do(http.MethodGet, routes.ListChainRecords(), nil, &res); err != nil { - return nil, err - } - list := make([]*registry.ChainRecord, len(res)) - for i, bd := range res { - rec, err := bd.Record() - if err != nil { - return nil, err - } - list[i] = rec - } - return list, nil -} diff --git a/client/chainclient/callview.go b/client/chainclient/callview.go deleted file mode 100644 index a6bdb1ee17..0000000000 --- a/client/chainclient/callview.go +++ /dev/null @@ -1,11 +0,0 @@ -package chainclient - -import ( - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/dict" -) - -// CallView sends a request to call a view function of a given contract, and returns the result of the call -func (c *Client) CallView(hContract isc.Hname, functionName string, args dict.Dict) (dict.Dict, error) { - return c.WaspClient.CallView(c.ChainID, hContract, functionName, args) -} diff --git a/client/chainclient/chainrecord.go b/client/chainclient/chainrecord.go deleted file mode 100644 index e2617144ca..0000000000 --- a/client/chainclient/chainrecord.go +++ /dev/null @@ -1,8 +0,0 @@ -package chainclient - -import "github.com/iotaledger/wasp/packages/registry" - -// GetChainRecord fetches the chain's Record -func (c *Client) GetChainRecord() (*registry.ChainRecord, error) { - return c.WaspClient.GetChainRecord(c.ChainID) -} diff --git a/client/chainclient/checkrequest.go b/client/chainclient/checkrequest.go deleted file mode 100644 index 71f279278b..0000000000 --- a/client/chainclient/checkrequest.go +++ /dev/null @@ -1,33 +0,0 @@ -package chainclient - -import ( - "errors" - "fmt" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" -) - -// CheckRequestResult fetches the receipt for the given request ID, and returns -// an error indicating whether the request was processed successfully. -func (c *Client) CheckRequestResult(reqID isc.RequestID) error { - ret, err := c.CallView(blocklog.Contract.Hname(), blocklog.ViewGetRequestReceipt.Name, dict.Dict{ - blocklog.ParamRequestID: codec.EncodeRequestID(reqID), - }) - if err != nil { - return fmt.Errorf("could not fetch receipt for request: %w", err) - } - if !ret.MustHas(blocklog.ParamRequestRecord) { - return errors.New("could not fetch receipt for request: not found in blocklog") - } - req, err := blocklog.RequestReceiptFromBytes(ret.MustGet(blocklog.ParamRequestRecord)) - if err != nil { - return fmt.Errorf("could not decode receipt for request: %w", err) - } - if req.Error != nil { - return fmt.Errorf("the request was rejected: %v", req.Error) - } - return nil -} diff --git a/client/chainclient/evm.go b/client/chainclient/evm.go deleted file mode 100644 index 3af043876a..0000000000 --- a/client/chainclient/evm.go +++ /dev/null @@ -1,11 +0,0 @@ -package chainclient - -import ( - "github.com/ethereum/go-ethereum/common" - - "github.com/iotaledger/wasp/packages/isc" -) - -func (c *Client) RequestIDByEVMTransactionHash(txHash common.Hash) (isc.RequestID, error) { - return c.WaspClient.RequestIDByEVMTransactionHash(c.ChainID, txHash) -} diff --git a/client/chainclient/stateget.go b/client/chainclient/stateget.go deleted file mode 100644 index 1efb985885..0000000000 --- a/client/chainclient/stateget.go +++ /dev/null @@ -1,6 +0,0 @@ -package chainclient - -// StateGet fetches the raw value associated with the given key in the chain state -func (c *Client) StateGet(key string) ([]byte, error) { - return c.WaspClient.StateGet(c.ChainID, key) -} diff --git a/client/chainclient/uploadblob.go b/client/chainclient/uploadblob.go deleted file mode 100644 index cfd29021a7..0000000000 --- a/client/chainclient/uploadblob.go +++ /dev/null @@ -1,29 +0,0 @@ -package chainclient - -import ( - "time" - - "github.com/iotaledger/wasp/packages/hashing" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blob" -) - -// UploadBlob sends an off-ledger request to call 'store' in the blob contract. -func (c *Client) UploadBlob(fields dict.Dict) (hashing.HashValue, isc.OffLedgerRequest, *isc.Receipt, error) { - blobHash := blob.MustGetBlobHash(fields) - - req, err := c.PostOffLedgerRequest( - blob.Contract.Hname(), - blob.FuncStoreBlob.Hname(), - PostRequestParams{ - Args: fields, - }, - ) - if err != nil { - return hashing.NilHash, nil, nil, err - } - - receipt, err := c.WaspClient.WaitUntilRequestProcessed(c.ChainID, req.ID(), 2*time.Minute) - return blobHash, req, receipt, err -} diff --git a/client/client.go b/client/client.go deleted file mode 100644 index 03ed6c03fa..0000000000 --- a/client/client.go +++ /dev/null @@ -1,136 +0,0 @@ -package client - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "strings" - - "github.com/iotaledger/wasp/packages/webapi/v1/model" -) - -var ErrNotAuthorized = errors.New("unauthorized request rejected") - -// WaspClient allows to make requests to the Wasp web API. -type WaspClient struct { - httpClient http.Client - baseURL string - token string - logFunc func(msg string, args ...interface{}) -} - -// NewWaspClient returns a new *WaspClient with the given baseURL and httpClient. -func NewWaspClient(baseURL string, httpClient ...http.Client) *WaspClient { - if !strings.HasPrefix(baseURL, "http") { - baseURL = "http://" + baseURL - } - if len(httpClient) > 0 { - return &WaspClient{baseURL: baseURL, httpClient: httpClient[0]} - } - return &WaspClient{baseURL: baseURL} -} - -func (c *WaspClient) WithLogFunc(logFunc func(msg string, args ...interface{})) *WaspClient { - c.logFunc = logFunc - return c -} - -func (c *WaspClient) WithToken(token string) *WaspClient { - if len(token) > 0 { - c.token = token - } - - return c -} - -func (c *WaspClient) log(msg string, args ...interface{}) { - if c.logFunc == nil { - return - } - c.logFunc(msg, args...) -} - -func processResponse(res *http.Response, decodeTo interface{}) error { - if res == nil || res.Body == nil { - return errors.New("unable to read response body") - } - defer res.Body.Close() - - if res.StatusCode == http.StatusUnauthorized { - return ErrNotAuthorized - } - - resBody, err := io.ReadAll(res.Body) - if err != nil { - return fmt.Errorf("unable to read response body: %w", err) - } - - if res.StatusCode >= 200 && res.StatusCode < 300 { - if decodeTo != nil { - return json.Unmarshal(resBody, decodeTo) - } - return nil - } - - errRes := &model.HTTPError{} - if err := json.Unmarshal(resBody, errRes); err != nil { - errRes.Message = http.StatusText(res.StatusCode) - } - errRes.StatusCode = res.StatusCode - errRes.Message = string(resBody) - return errRes -} - -func (c *WaspClient) do(method, route string, reqObj, resObj interface{}) error { - // marshal request object - var data []byte - if reqObj != nil { - var err error - data, err = json.Marshal(reqObj) - if err != nil { - return fmt.Errorf("json.Marshal: %w", err) - } - } - - // construct request - url := fmt.Sprintf("%s/%s", strings.TrimRight(c.baseURL, "/"), strings.TrimLeft(route, "/")) - req, err := http.NewRequestWithContext(context.Background(), method, url, func() io.Reader { - if data == nil { - return nil - } - return bytes.NewReader(data) - }()) - if err != nil { - return fmt.Errorf("http.NewRequest [%s %s]: %w", method, url, err) - } - - if data != nil { - req.Header.Set("Content-Type", "application/json") - } - - if c.token != "" { - req.Header.Set("Authorization", fmt.Sprintf("Bearer %v", c.token)) - } - - // make the request - res, err := c.httpClient.Do(req) - if err != nil { - return fmt.Errorf("%s %s: %w", method, url, err) - } - - // write response into response object - err = processResponse(res, resObj) - if err != nil { - return fmt.Errorf("%s %s: %w", method, url, err) - } - return nil -} - -// BaseURL returns the baseURL of the client. -func (c *WaspClient) BaseURL() string { - return c.baseURL -} diff --git a/client/configuration.go b/client/configuration.go new file mode 100644 index 0000000000..8d3da82167 --- /dev/null +++ b/client/configuration.go @@ -0,0 +1,234 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "http://localhost:9090", + Description: "No description provided", + }, + { + URL: "https://localhost:9090", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/client/dkshares.go b/client/dkshares.go deleted file mode 100644 index 8de51364fd..0000000000 --- a/client/dkshares.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package client - -// This API is used to maintain the distributed key shares. -// The Golang API in this file tries to follow the REST conventions. - -import ( - "net/http" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// DKSharesPost creates a new DKShare and returns its state. -func (c *WaspClient) DKSharesPost(request *model.DKSharesPostRequest) (*model.DKSharesInfo, error) { - var response model.DKSharesInfo - err := c.do(http.MethodPost, routes.DKSharesPost(), request, &response) - return &response, err -} - -// DKSharesGet retrieves the representation of an existing DKShare. -func (c *WaspClient) DKSharesGet(addr iotago.Address) (*model.DKSharesInfo, error) { - var response model.DKSharesInfo - err := c.do(http.MethodGet, routes.DKSharesGet(addr.String()), nil, &response) - return &response, err -} diff --git a/client/docs/AccountListResponse.md b/client/docs/AccountListResponse.md new file mode 100644 index 0000000000..d6590e916a --- /dev/null +++ b/client/docs/AccountListResponse.md @@ -0,0 +1,56 @@ +# AccountListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Accounts** | Pointer to **[]string** | | [optional] + +## Methods + +### NewAccountListResponse + +`func NewAccountListResponse() *AccountListResponse` + +NewAccountListResponse instantiates a new AccountListResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountListResponseWithDefaults + +`func NewAccountListResponseWithDefaults() *AccountListResponse` + +NewAccountListResponseWithDefaults instantiates a new AccountListResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccounts + +`func (o *AccountListResponse) GetAccounts() []string` + +GetAccounts returns the Accounts field if non-nil, zero value otherwise. + +### GetAccountsOk + +`func (o *AccountListResponse) GetAccountsOk() (*[]string, bool)` + +GetAccountsOk returns a tuple with the Accounts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccounts + +`func (o *AccountListResponse) SetAccounts(v []string)` + +SetAccounts sets Accounts field to given value. + +### HasAccounts + +`func (o *AccountListResponse) HasAccounts() bool` + +HasAccounts returns a boolean if a field has been set. + + +[[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/client/docs/AccountNFTsResponse.md b/client/docs/AccountNFTsResponse.md new file mode 100644 index 0000000000..beb8d43119 --- /dev/null +++ b/client/docs/AccountNFTsResponse.md @@ -0,0 +1,56 @@ +# AccountNFTsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NftIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewAccountNFTsResponse + +`func NewAccountNFTsResponse() *AccountNFTsResponse` + +NewAccountNFTsResponse instantiates a new AccountNFTsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountNFTsResponseWithDefaults + +`func NewAccountNFTsResponseWithDefaults() *AccountNFTsResponse` + +NewAccountNFTsResponseWithDefaults instantiates a new AccountNFTsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNftIds + +`func (o *AccountNFTsResponse) GetNftIds() []string` + +GetNftIds returns the NftIds field if non-nil, zero value otherwise. + +### GetNftIdsOk + +`func (o *AccountNFTsResponse) GetNftIdsOk() (*[]string, bool)` + +GetNftIdsOk returns a tuple with the NftIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNftIds + +`func (o *AccountNFTsResponse) SetNftIds(v []string)` + +SetNftIds sets NftIds field to given value. + +### HasNftIds + +`func (o *AccountNFTsResponse) HasNftIds() bool` + +HasNftIds returns a boolean if a field has been set. + + +[[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/client/docs/AccountNonceResponse.md b/client/docs/AccountNonceResponse.md new file mode 100644 index 0000000000..1d45c3c5c0 --- /dev/null +++ b/client/docs/AccountNonceResponse.md @@ -0,0 +1,56 @@ +# AccountNonceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nonce** | Pointer to **int64** | | [optional] + +## Methods + +### NewAccountNonceResponse + +`func NewAccountNonceResponse() *AccountNonceResponse` + +NewAccountNonceResponse instantiates a new AccountNonceResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAccountNonceResponseWithDefaults + +`func NewAccountNonceResponseWithDefaults() *AccountNonceResponse` + +NewAccountNonceResponseWithDefaults instantiates a new AccountNonceResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNonce + +`func (o *AccountNonceResponse) GetNonce() int64` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *AccountNonceResponse) GetNonceOk() (*int64, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *AccountNonceResponse) SetNonce(v int64)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *AccountNonceResponse) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + + +[[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/client/docs/AddUserRequest.md b/client/docs/AddUserRequest.md new file mode 100644 index 0000000000..9d8c8ce6b5 --- /dev/null +++ b/client/docs/AddUserRequest.md @@ -0,0 +1,108 @@ +# AddUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Password** | Pointer to **string** | | [optional] +**Permissions** | Pointer to **[]string** | | [optional] +**Username** | Pointer to **string** | | [optional] + +## Methods + +### NewAddUserRequest + +`func NewAddUserRequest() *AddUserRequest` + +NewAddUserRequest instantiates a new AddUserRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddUserRequestWithDefaults + +`func NewAddUserRequestWithDefaults() *AddUserRequest` + +NewAddUserRequestWithDefaults instantiates a new AddUserRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPassword + +`func (o *AddUserRequest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *AddUserRequest) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *AddUserRequest) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *AddUserRequest) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetPermissions + +`func (o *AddUserRequest) GetPermissions() []string` + +GetPermissions returns the Permissions field if non-nil, zero value otherwise. + +### GetPermissionsOk + +`func (o *AddUserRequest) GetPermissionsOk() (*[]string, bool)` + +GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermissions + +`func (o *AddUserRequest) SetPermissions(v []string)` + +SetPermissions sets Permissions field to given value. + +### HasPermissions + +`func (o *AddUserRequest) HasPermissions() bool` + +HasPermissions returns a boolean if a field has been set. + +### GetUsername + +`func (o *AddUserRequest) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *AddUserRequest) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *AddUserRequest) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *AddUserRequest) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + + +[[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/client/docs/AliasOutputMetricItem.md b/client/docs/AliasOutputMetricItem.md new file mode 100644 index 0000000000..4044254ee3 --- /dev/null +++ b/client/docs/AliasOutputMetricItem.md @@ -0,0 +1,108 @@ +# AliasOutputMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**Output**](Output.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewAliasOutputMetricItem + +`func NewAliasOutputMetricItem() *AliasOutputMetricItem` + +NewAliasOutputMetricItem instantiates a new AliasOutputMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAliasOutputMetricItemWithDefaults + +`func NewAliasOutputMetricItemWithDefaults() *AliasOutputMetricItem` + +NewAliasOutputMetricItemWithDefaults instantiates a new AliasOutputMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *AliasOutputMetricItem) GetLastMessage() Output` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *AliasOutputMetricItem) GetLastMessageOk() (*Output, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *AliasOutputMetricItem) SetLastMessage(v Output)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *AliasOutputMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *AliasOutputMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *AliasOutputMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *AliasOutputMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *AliasOutputMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *AliasOutputMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *AliasOutputMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *AliasOutputMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *AliasOutputMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/Allowance.md b/client/docs/Allowance.md new file mode 100644 index 0000000000..0cbb0b934a --- /dev/null +++ b/client/docs/Allowance.md @@ -0,0 +1,82 @@ +# Allowance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FungibleTokens** | Pointer to [**FungibleTokens**](FungibleTokens.md) | | [optional] +**Nfts** | Pointer to **[]string** | | [optional] + +## Methods + +### NewAllowance + +`func NewAllowance() *Allowance` + +NewAllowance instantiates a new Allowance object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAllowanceWithDefaults + +`func NewAllowanceWithDefaults() *Allowance` + +NewAllowanceWithDefaults instantiates a new Allowance object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFungibleTokens + +`func (o *Allowance) GetFungibleTokens() FungibleTokens` + +GetFungibleTokens returns the FungibleTokens field if non-nil, zero value otherwise. + +### GetFungibleTokensOk + +`func (o *Allowance) GetFungibleTokensOk() (*FungibleTokens, bool)` + +GetFungibleTokensOk returns a tuple with the FungibleTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFungibleTokens + +`func (o *Allowance) SetFungibleTokens(v FungibleTokens)` + +SetFungibleTokens sets FungibleTokens field to given value. + +### HasFungibleTokens + +`func (o *Allowance) HasFungibleTokens() bool` + +HasFungibleTokens returns a boolean if a field has been set. + +### GetNfts + +`func (o *Allowance) GetNfts() []string` + +GetNfts returns the Nfts field if non-nil, zero value otherwise. + +### GetNftsOk + +`func (o *Allowance) GetNftsOk() (*[]string, bool)` + +GetNftsOk returns a tuple with the Nfts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNfts + +`func (o *Allowance) SetNfts(v []string)` + +SetNfts sets Nfts field to given value. + +### HasNfts + +`func (o *Allowance) HasNfts() bool` + +HasNfts returns a boolean if a field has been set. + + +[[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/client/docs/AssetsResponse.md b/client/docs/AssetsResponse.md new file mode 100644 index 0000000000..943a2bcbd0 --- /dev/null +++ b/client/docs/AssetsResponse.md @@ -0,0 +1,82 @@ +# AssetsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BaseTokens** | Pointer to **int64** | | [optional] +**NativeTokens** | Pointer to [**[]NativeToken**](NativeToken.md) | | [optional] + +## Methods + +### NewAssetsResponse + +`func NewAssetsResponse() *AssetsResponse` + +NewAssetsResponse instantiates a new AssetsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAssetsResponseWithDefaults + +`func NewAssetsResponseWithDefaults() *AssetsResponse` + +NewAssetsResponseWithDefaults instantiates a new AssetsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBaseTokens + +`func (o *AssetsResponse) GetBaseTokens() int64` + +GetBaseTokens returns the BaseTokens field if non-nil, zero value otherwise. + +### GetBaseTokensOk + +`func (o *AssetsResponse) GetBaseTokensOk() (*int64, bool)` + +GetBaseTokensOk returns a tuple with the BaseTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseTokens + +`func (o *AssetsResponse) SetBaseTokens(v int64)` + +SetBaseTokens sets BaseTokens field to given value. + +### HasBaseTokens + +`func (o *AssetsResponse) HasBaseTokens() bool` + +HasBaseTokens returns a boolean if a field has been set. + +### GetNativeTokens + +`func (o *AssetsResponse) GetNativeTokens() []NativeToken` + +GetNativeTokens returns the NativeTokens field if non-nil, zero value otherwise. + +### GetNativeTokensOk + +`func (o *AssetsResponse) GetNativeTokensOk() (*[]NativeToken, bool)` + +GetNativeTokensOk returns a tuple with the NativeTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNativeTokens + +`func (o *AssetsResponse) SetNativeTokens(v []NativeToken)` + +SetNativeTokens sets NativeTokens field to given value. + +### HasNativeTokens + +`func (o *AssetsResponse) HasNativeTokens() bool` + +HasNativeTokens returns a boolean if a field has been set. + + +[[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/client/docs/BaseToken.md b/client/docs/BaseToken.md new file mode 100644 index 0000000000..97abbbbd95 --- /dev/null +++ b/client/docs/BaseToken.md @@ -0,0 +1,186 @@ +# BaseToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Decimals** | Pointer to **int32** | The token decimals | [optional] +**Name** | Pointer to **string** | The base token name | [optional] +**Subunit** | Pointer to **string** | The token subunit | [optional] +**TickerSymbol** | Pointer to **string** | The ticker symbol | [optional] +**Unit** | Pointer to **string** | The token unit | [optional] +**UseMetricPrefix** | Pointer to **bool** | Whether or not the token uses a metric prefix | [optional] + +## Methods + +### NewBaseToken + +`func NewBaseToken() *BaseToken` + +NewBaseToken instantiates a new BaseToken object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBaseTokenWithDefaults + +`func NewBaseTokenWithDefaults() *BaseToken` + +NewBaseTokenWithDefaults instantiates a new BaseToken object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDecimals + +`func (o *BaseToken) GetDecimals() int32` + +GetDecimals returns the Decimals field if non-nil, zero value otherwise. + +### GetDecimalsOk + +`func (o *BaseToken) GetDecimalsOk() (*int32, bool)` + +GetDecimalsOk returns a tuple with the Decimals field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDecimals + +`func (o *BaseToken) SetDecimals(v int32)` + +SetDecimals sets Decimals field to given value. + +### HasDecimals + +`func (o *BaseToken) HasDecimals() bool` + +HasDecimals returns a boolean if a field has been set. + +### GetName + +`func (o *BaseToken) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *BaseToken) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *BaseToken) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *BaseToken) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetSubunit + +`func (o *BaseToken) GetSubunit() string` + +GetSubunit returns the Subunit field if non-nil, zero value otherwise. + +### GetSubunitOk + +`func (o *BaseToken) GetSubunitOk() (*string, bool)` + +GetSubunitOk returns a tuple with the Subunit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubunit + +`func (o *BaseToken) SetSubunit(v string)` + +SetSubunit sets Subunit field to given value. + +### HasSubunit + +`func (o *BaseToken) HasSubunit() bool` + +HasSubunit returns a boolean if a field has been set. + +### GetTickerSymbol + +`func (o *BaseToken) GetTickerSymbol() string` + +GetTickerSymbol returns the TickerSymbol field if non-nil, zero value otherwise. + +### GetTickerSymbolOk + +`func (o *BaseToken) GetTickerSymbolOk() (*string, bool)` + +GetTickerSymbolOk returns a tuple with the TickerSymbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTickerSymbol + +`func (o *BaseToken) SetTickerSymbol(v string)` + +SetTickerSymbol sets TickerSymbol field to given value. + +### HasTickerSymbol + +`func (o *BaseToken) HasTickerSymbol() bool` + +HasTickerSymbol returns a boolean if a field has been set. + +### GetUnit + +`func (o *BaseToken) GetUnit() string` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *BaseToken) GetUnitOk() (*string, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *BaseToken) SetUnit(v string)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *BaseToken) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + +### GetUseMetricPrefix + +`func (o *BaseToken) GetUseMetricPrefix() bool` + +GetUseMetricPrefix returns the UseMetricPrefix field if non-nil, zero value otherwise. + +### GetUseMetricPrefixOk + +`func (o *BaseToken) GetUseMetricPrefixOk() (*bool, bool)` + +GetUseMetricPrefixOk returns a tuple with the UseMetricPrefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseMetricPrefix + +`func (o *BaseToken) SetUseMetricPrefix(v bool)` + +SetUseMetricPrefix sets UseMetricPrefix field to given value. + +### HasUseMetricPrefix + +`func (o *BaseToken) HasUseMetricPrefix() bool` + +HasUseMetricPrefix returns a boolean if a field has been set. + + +[[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/client/docs/Blob.md b/client/docs/Blob.md new file mode 100644 index 0000000000..1fb2ad7ceb --- /dev/null +++ b/client/docs/Blob.md @@ -0,0 +1,82 @@ +# Blob + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Hash** | Pointer to **string** | | [optional] +**Size** | Pointer to **int32** | | [optional] + +## Methods + +### NewBlob + +`func NewBlob() *Blob` + +NewBlob instantiates a new Blob object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlobWithDefaults + +`func NewBlobWithDefaults() *Blob` + +NewBlobWithDefaults instantiates a new Blob object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHash + +`func (o *Blob) GetHash() string` + +GetHash returns the Hash field if non-nil, zero value otherwise. + +### GetHashOk + +`func (o *Blob) GetHashOk() (*string, bool)` + +GetHashOk returns a tuple with the Hash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHash + +`func (o *Blob) SetHash(v string)` + +SetHash sets Hash field to given value. + +### HasHash + +`func (o *Blob) HasHash() bool` + +HasHash returns a boolean if a field has been set. + +### GetSize + +`func (o *Blob) GetSize() int32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *Blob) GetSizeOk() (*int32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *Blob) SetSize(v int32)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *Blob) HasSize() bool` + +HasSize returns a boolean if a field has been set. + + +[[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/client/docs/BlobInfoResponse.md b/client/docs/BlobInfoResponse.md new file mode 100644 index 0000000000..d48bea3d06 --- /dev/null +++ b/client/docs/BlobInfoResponse.md @@ -0,0 +1,56 @@ +# BlobInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Fields** | Pointer to **map[string]int32** | | [optional] + +## Methods + +### NewBlobInfoResponse + +`func NewBlobInfoResponse() *BlobInfoResponse` + +NewBlobInfoResponse instantiates a new BlobInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlobInfoResponseWithDefaults + +`func NewBlobInfoResponseWithDefaults() *BlobInfoResponse` + +NewBlobInfoResponseWithDefaults instantiates a new BlobInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFields + +`func (o *BlobInfoResponse) GetFields() map[string]int32` + +GetFields returns the Fields field if non-nil, zero value otherwise. + +### GetFieldsOk + +`func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool)` + +GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFields + +`func (o *BlobInfoResponse) SetFields(v map[string]int32)` + +SetFields sets Fields field to given value. + +### HasFields + +`func (o *BlobInfoResponse) HasFields() bool` + +HasFields returns a boolean if a field has been set. + + +[[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/client/docs/BlobListResponse.md b/client/docs/BlobListResponse.md new file mode 100644 index 0000000000..2069af6e33 --- /dev/null +++ b/client/docs/BlobListResponse.md @@ -0,0 +1,56 @@ +# BlobListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blobs** | Pointer to [**[]Blob**](Blob.md) | | [optional] + +## Methods + +### NewBlobListResponse + +`func NewBlobListResponse() *BlobListResponse` + +NewBlobListResponse instantiates a new BlobListResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlobListResponseWithDefaults + +`func NewBlobListResponseWithDefaults() *BlobListResponse` + +NewBlobListResponseWithDefaults instantiates a new BlobListResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBlobs + +`func (o *BlobListResponse) GetBlobs() []Blob` + +GetBlobs returns the Blobs field if non-nil, zero value otherwise. + +### GetBlobsOk + +`func (o *BlobListResponse) GetBlobsOk() (*[]Blob, bool)` + +GetBlobsOk returns a tuple with the Blobs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlobs + +`func (o *BlobListResponse) SetBlobs(v []Blob)` + +SetBlobs sets Blobs field to given value. + +### HasBlobs + +`func (o *BlobListResponse) HasBlobs() bool` + +HasBlobs returns a boolean if a field has been set. + + +[[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/client/docs/BlobValueResponse.md b/client/docs/BlobValueResponse.md new file mode 100644 index 0000000000..97dfde8c79 --- /dev/null +++ b/client/docs/BlobValueResponse.md @@ -0,0 +1,56 @@ +# BlobValueResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ValueData** | Pointer to **string** | | [optional] + +## Methods + +### NewBlobValueResponse + +`func NewBlobValueResponse() *BlobValueResponse` + +NewBlobValueResponse instantiates a new BlobValueResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlobValueResponseWithDefaults + +`func NewBlobValueResponseWithDefaults() *BlobValueResponse` + +NewBlobValueResponseWithDefaults instantiates a new BlobValueResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetValueData + +`func (o *BlobValueResponse) GetValueData() string` + +GetValueData returns the ValueData field if non-nil, zero value otherwise. + +### GetValueDataOk + +`func (o *BlobValueResponse) GetValueDataOk() (*string, bool)` + +GetValueDataOk returns a tuple with the ValueData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValueData + +`func (o *BlobValueResponse) SetValueData(v string)` + +SetValueData sets ValueData field to given value. + +### HasValueData + +`func (o *BlobValueResponse) HasValueData() bool` + +HasValueData returns a boolean if a field has been set. + + +[[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/client/docs/BlockInfoResponse.md b/client/docs/BlockInfoResponse.md new file mode 100644 index 0000000000..f64ece5be9 --- /dev/null +++ b/client/docs/BlockInfoResponse.md @@ -0,0 +1,368 @@ +# BlockInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnchorTransactionId** | Pointer to **string** | | [optional] +**BlockIndex** | Pointer to **int32** | | [optional] +**GasBurned** | Pointer to **int64** | | [optional] +**GasFeeCharged** | Pointer to **int64** | | [optional] +**L1CommitmentHash** | Pointer to **string** | | [optional] +**NumOffLedgerRequests** | Pointer to **int32** | | [optional] +**NumSuccessfulRequests** | Pointer to **int32** | | [optional] +**PreviousL1CommitmentHash** | Pointer to **string** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] +**TotalBaseTokensInL2Accounts** | Pointer to **int64** | | [optional] +**TotalRequests** | Pointer to **int32** | | [optional] +**TotalStorageDeposit** | Pointer to **int64** | | [optional] +**TransactionSubEssenceHash** | Pointer to **string** | | [optional] + +## Methods + +### NewBlockInfoResponse + +`func NewBlockInfoResponse() *BlockInfoResponse` + +NewBlockInfoResponse instantiates a new BlockInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlockInfoResponseWithDefaults + +`func NewBlockInfoResponseWithDefaults() *BlockInfoResponse` + +NewBlockInfoResponseWithDefaults instantiates a new BlockInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAnchorTransactionId + +`func (o *BlockInfoResponse) GetAnchorTransactionId() string` + +GetAnchorTransactionId returns the AnchorTransactionId field if non-nil, zero value otherwise. + +### GetAnchorTransactionIdOk + +`func (o *BlockInfoResponse) GetAnchorTransactionIdOk() (*string, bool)` + +GetAnchorTransactionIdOk returns a tuple with the AnchorTransactionId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAnchorTransactionId + +`func (o *BlockInfoResponse) SetAnchorTransactionId(v string)` + +SetAnchorTransactionId sets AnchorTransactionId field to given value. + +### HasAnchorTransactionId + +`func (o *BlockInfoResponse) HasAnchorTransactionId() bool` + +HasAnchorTransactionId returns a boolean if a field has been set. + +### GetBlockIndex + +`func (o *BlockInfoResponse) GetBlockIndex() int32` + +GetBlockIndex returns the BlockIndex field if non-nil, zero value otherwise. + +### GetBlockIndexOk + +`func (o *BlockInfoResponse) GetBlockIndexOk() (*int32, bool)` + +GetBlockIndexOk returns a tuple with the BlockIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockIndex + +`func (o *BlockInfoResponse) SetBlockIndex(v int32)` + +SetBlockIndex sets BlockIndex field to given value. + +### HasBlockIndex + +`func (o *BlockInfoResponse) HasBlockIndex() bool` + +HasBlockIndex returns a boolean if a field has been set. + +### GetGasBurned + +`func (o *BlockInfoResponse) GetGasBurned() int64` + +GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. + +### GetGasBurnedOk + +`func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool)` + +GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBurned + +`func (o *BlockInfoResponse) SetGasBurned(v int64)` + +SetGasBurned sets GasBurned field to given value. + +### HasGasBurned + +`func (o *BlockInfoResponse) HasGasBurned() bool` + +HasGasBurned returns a boolean if a field has been set. + +### GetGasFeeCharged + +`func (o *BlockInfoResponse) GetGasFeeCharged() int64` + +GetGasFeeCharged returns the GasFeeCharged field if non-nil, zero value otherwise. + +### GetGasFeeChargedOk + +`func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool)` + +GetGasFeeChargedOk returns a tuple with the GasFeeCharged field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasFeeCharged + +`func (o *BlockInfoResponse) SetGasFeeCharged(v int64)` + +SetGasFeeCharged sets GasFeeCharged field to given value. + +### HasGasFeeCharged + +`func (o *BlockInfoResponse) HasGasFeeCharged() bool` + +HasGasFeeCharged returns a boolean if a field has been set. + +### GetL1CommitmentHash + +`func (o *BlockInfoResponse) GetL1CommitmentHash() string` + +GetL1CommitmentHash returns the L1CommitmentHash field if non-nil, zero value otherwise. + +### GetL1CommitmentHashOk + +`func (o *BlockInfoResponse) GetL1CommitmentHashOk() (*string, bool)` + +GetL1CommitmentHashOk returns a tuple with the L1CommitmentHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetL1CommitmentHash + +`func (o *BlockInfoResponse) SetL1CommitmentHash(v string)` + +SetL1CommitmentHash sets L1CommitmentHash field to given value. + +### HasL1CommitmentHash + +`func (o *BlockInfoResponse) HasL1CommitmentHash() bool` + +HasL1CommitmentHash returns a boolean if a field has been set. + +### GetNumOffLedgerRequests + +`func (o *BlockInfoResponse) GetNumOffLedgerRequests() int32` + +GetNumOffLedgerRequests returns the NumOffLedgerRequests field if non-nil, zero value otherwise. + +### GetNumOffLedgerRequestsOk + +`func (o *BlockInfoResponse) GetNumOffLedgerRequestsOk() (*int32, bool)` + +GetNumOffLedgerRequestsOk returns a tuple with the NumOffLedgerRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumOffLedgerRequests + +`func (o *BlockInfoResponse) SetNumOffLedgerRequests(v int32)` + +SetNumOffLedgerRequests sets NumOffLedgerRequests field to given value. + +### HasNumOffLedgerRequests + +`func (o *BlockInfoResponse) HasNumOffLedgerRequests() bool` + +HasNumOffLedgerRequests returns a boolean if a field has been set. + +### GetNumSuccessfulRequests + +`func (o *BlockInfoResponse) GetNumSuccessfulRequests() int32` + +GetNumSuccessfulRequests returns the NumSuccessfulRequests field if non-nil, zero value otherwise. + +### GetNumSuccessfulRequestsOk + +`func (o *BlockInfoResponse) GetNumSuccessfulRequestsOk() (*int32, bool)` + +GetNumSuccessfulRequestsOk returns a tuple with the NumSuccessfulRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumSuccessfulRequests + +`func (o *BlockInfoResponse) SetNumSuccessfulRequests(v int32)` + +SetNumSuccessfulRequests sets NumSuccessfulRequests field to given value. + +### HasNumSuccessfulRequests + +`func (o *BlockInfoResponse) HasNumSuccessfulRequests() bool` + +HasNumSuccessfulRequests returns a boolean if a field has been set. + +### GetPreviousL1CommitmentHash + +`func (o *BlockInfoResponse) GetPreviousL1CommitmentHash() string` + +GetPreviousL1CommitmentHash returns the PreviousL1CommitmentHash field if non-nil, zero value otherwise. + +### GetPreviousL1CommitmentHashOk + +`func (o *BlockInfoResponse) GetPreviousL1CommitmentHashOk() (*string, bool)` + +GetPreviousL1CommitmentHashOk returns a tuple with the PreviousL1CommitmentHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreviousL1CommitmentHash + +`func (o *BlockInfoResponse) SetPreviousL1CommitmentHash(v string)` + +SetPreviousL1CommitmentHash sets PreviousL1CommitmentHash field to given value. + +### HasPreviousL1CommitmentHash + +`func (o *BlockInfoResponse) HasPreviousL1CommitmentHash() bool` + +HasPreviousL1CommitmentHash returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *BlockInfoResponse) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *BlockInfoResponse) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *BlockInfoResponse) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *BlockInfoResponse) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + +### GetTotalBaseTokensInL2Accounts + +`func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64` + +GetTotalBaseTokensInL2Accounts returns the TotalBaseTokensInL2Accounts field if non-nil, zero value otherwise. + +### GetTotalBaseTokensInL2AccountsOk + +`func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool)` + +GetTotalBaseTokensInL2AccountsOk returns a tuple with the TotalBaseTokensInL2Accounts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalBaseTokensInL2Accounts + +`func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v int64)` + +SetTotalBaseTokensInL2Accounts sets TotalBaseTokensInL2Accounts field to given value. + +### HasTotalBaseTokensInL2Accounts + +`func (o *BlockInfoResponse) HasTotalBaseTokensInL2Accounts() bool` + +HasTotalBaseTokensInL2Accounts returns a boolean if a field has been set. + +### GetTotalRequests + +`func (o *BlockInfoResponse) GetTotalRequests() int32` + +GetTotalRequests returns the TotalRequests field if non-nil, zero value otherwise. + +### GetTotalRequestsOk + +`func (o *BlockInfoResponse) GetTotalRequestsOk() (*int32, bool)` + +GetTotalRequestsOk returns a tuple with the TotalRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalRequests + +`func (o *BlockInfoResponse) SetTotalRequests(v int32)` + +SetTotalRequests sets TotalRequests field to given value. + +### HasTotalRequests + +`func (o *BlockInfoResponse) HasTotalRequests() bool` + +HasTotalRequests returns a boolean if a field has been set. + +### GetTotalStorageDeposit + +`func (o *BlockInfoResponse) GetTotalStorageDeposit() int64` + +GetTotalStorageDeposit returns the TotalStorageDeposit field if non-nil, zero value otherwise. + +### GetTotalStorageDepositOk + +`func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool)` + +GetTotalStorageDepositOk returns a tuple with the TotalStorageDeposit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalStorageDeposit + +`func (o *BlockInfoResponse) SetTotalStorageDeposit(v int64)` + +SetTotalStorageDeposit sets TotalStorageDeposit field to given value. + +### HasTotalStorageDeposit + +`func (o *BlockInfoResponse) HasTotalStorageDeposit() bool` + +HasTotalStorageDeposit returns a boolean if a field has been set. + +### GetTransactionSubEssenceHash + +`func (o *BlockInfoResponse) GetTransactionSubEssenceHash() string` + +GetTransactionSubEssenceHash returns the TransactionSubEssenceHash field if non-nil, zero value otherwise. + +### GetTransactionSubEssenceHashOk + +`func (o *BlockInfoResponse) GetTransactionSubEssenceHashOk() (*string, bool)` + +GetTransactionSubEssenceHashOk returns a tuple with the TransactionSubEssenceHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransactionSubEssenceHash + +`func (o *BlockInfoResponse) SetTransactionSubEssenceHash(v string)` + +SetTransactionSubEssenceHash sets TransactionSubEssenceHash field to given value. + +### HasTransactionSubEssenceHash + +`func (o *BlockInfoResponse) HasTransactionSubEssenceHash() bool` + +HasTransactionSubEssenceHash returns a boolean if a field has been set. + + +[[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/client/docs/BlockReceiptError.md b/client/docs/BlockReceiptError.md new file mode 100644 index 0000000000..90f64c331a --- /dev/null +++ b/client/docs/BlockReceiptError.md @@ -0,0 +1,82 @@ +# BlockReceiptError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ErrorMessage** | Pointer to **string** | | [optional] +**Hash** | Pointer to **string** | | [optional] + +## Methods + +### NewBlockReceiptError + +`func NewBlockReceiptError() *BlockReceiptError` + +NewBlockReceiptError instantiates a new BlockReceiptError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlockReceiptErrorWithDefaults + +`func NewBlockReceiptErrorWithDefaults() *BlockReceiptError` + +NewBlockReceiptErrorWithDefaults instantiates a new BlockReceiptError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorMessage + +`func (o *BlockReceiptError) GetErrorMessage() string` + +GetErrorMessage returns the ErrorMessage field if non-nil, zero value otherwise. + +### GetErrorMessageOk + +`func (o *BlockReceiptError) GetErrorMessageOk() (*string, bool)` + +GetErrorMessageOk returns a tuple with the ErrorMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorMessage + +`func (o *BlockReceiptError) SetErrorMessage(v string)` + +SetErrorMessage sets ErrorMessage field to given value. + +### HasErrorMessage + +`func (o *BlockReceiptError) HasErrorMessage() bool` + +HasErrorMessage returns a boolean if a field has been set. + +### GetHash + +`func (o *BlockReceiptError) GetHash() string` + +GetHash returns the Hash field if non-nil, zero value otherwise. + +### GetHashOk + +`func (o *BlockReceiptError) GetHashOk() (*string, bool)` + +GetHashOk returns a tuple with the Hash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHash + +`func (o *BlockReceiptError) SetHash(v string)` + +SetHash sets Hash field to given value. + +### HasHash + +`func (o *BlockReceiptError) HasHash() bool` + +HasHash returns a boolean if a field has been set. + + +[[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/client/docs/BlockReceiptsResponse.md b/client/docs/BlockReceiptsResponse.md new file mode 100644 index 0000000000..8594b36bcf --- /dev/null +++ b/client/docs/BlockReceiptsResponse.md @@ -0,0 +1,56 @@ +# BlockReceiptsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Receipts** | Pointer to [**[]RequestReceiptResponse**](RequestReceiptResponse.md) | | [optional] + +## Methods + +### NewBlockReceiptsResponse + +`func NewBlockReceiptsResponse() *BlockReceiptsResponse` + +NewBlockReceiptsResponse instantiates a new BlockReceiptsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBlockReceiptsResponseWithDefaults + +`func NewBlockReceiptsResponseWithDefaults() *BlockReceiptsResponse` + +NewBlockReceiptsResponseWithDefaults instantiates a new BlockReceiptsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReceipts + +`func (o *BlockReceiptsResponse) GetReceipts() []RequestReceiptResponse` + +GetReceipts returns the Receipts field if non-nil, zero value otherwise. + +### GetReceiptsOk + +`func (o *BlockReceiptsResponse) GetReceiptsOk() (*[]RequestReceiptResponse, bool)` + +GetReceiptsOk returns a tuple with the Receipts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceipts + +`func (o *BlockReceiptsResponse) SetReceipts(v []RequestReceiptResponse)` + +SetReceipts sets Receipts field to given value. + +### HasReceipts + +`func (o *BlockReceiptsResponse) HasReceipts() bool` + +HasReceipts returns a boolean if a field has been set. + + +[[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/client/docs/BurnLog.md b/client/docs/BurnLog.md new file mode 100644 index 0000000000..269b5fd5f2 --- /dev/null +++ b/client/docs/BurnLog.md @@ -0,0 +1,56 @@ +# BurnLog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | Pointer to [**[]BurnRecord**](BurnRecord.md) | | [optional] + +## Methods + +### NewBurnLog + +`func NewBurnLog() *BurnLog` + +NewBurnLog instantiates a new BurnLog object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBurnLogWithDefaults + +`func NewBurnLogWithDefaults() *BurnLog` + +NewBurnLogWithDefaults instantiates a new BurnLog object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRecords + +`func (o *BurnLog) GetRecords() []BurnRecord` + +GetRecords returns the Records field if non-nil, zero value otherwise. + +### GetRecordsOk + +`func (o *BurnLog) GetRecordsOk() (*[]BurnRecord, bool)` + +GetRecordsOk returns a tuple with the Records field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecords + +`func (o *BurnLog) SetRecords(v []BurnRecord)` + +SetRecords sets Records field to given value. + +### HasRecords + +`func (o *BurnLog) HasRecords() bool` + +HasRecords returns a boolean if a field has been set. + + +[[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/client/docs/BurnRecord.md b/client/docs/BurnRecord.md new file mode 100644 index 0000000000..c4e2b5941b --- /dev/null +++ b/client/docs/BurnRecord.md @@ -0,0 +1,82 @@ +# BurnRecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**GasBurned** | Pointer to **int64** | | [optional] + +## Methods + +### NewBurnRecord + +`func NewBurnRecord() *BurnRecord` + +NewBurnRecord instantiates a new BurnRecord object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBurnRecordWithDefaults + +`func NewBurnRecordWithDefaults() *BurnRecord` + +NewBurnRecordWithDefaults instantiates a new BurnRecord object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *BurnRecord) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *BurnRecord) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *BurnRecord) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *BurnRecord) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetGasBurned + +`func (o *BurnRecord) GetGasBurned() int64` + +GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. + +### GetGasBurnedOk + +`func (o *BurnRecord) GetGasBurnedOk() (*int64, bool)` + +GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBurned + +`func (o *BurnRecord) SetGasBurned(v int64)` + +SetGasBurned sets GasBurned field to given value. + +### HasGasBurned + +`func (o *BurnRecord) HasGasBurned() bool` + +HasGasBurned returns a boolean if a field has been set. + + +[[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/client/docs/CallTarget.md b/client/docs/CallTarget.md new file mode 100644 index 0000000000..1217c31165 --- /dev/null +++ b/client/docs/CallTarget.md @@ -0,0 +1,82 @@ +# CallTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Contract** | Pointer to **int32** | | [optional] +**EntryPoint** | Pointer to **int32** | | [optional] + +## Methods + +### NewCallTarget + +`func NewCallTarget() *CallTarget` + +NewCallTarget instantiates a new CallTarget object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCallTargetWithDefaults + +`func NewCallTargetWithDefaults() *CallTarget` + +NewCallTargetWithDefaults instantiates a new CallTarget object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContract + +`func (o *CallTarget) GetContract() int32` + +GetContract returns the Contract field if non-nil, zero value otherwise. + +### GetContractOk + +`func (o *CallTarget) GetContractOk() (*int32, bool)` + +GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContract + +`func (o *CallTarget) SetContract(v int32)` + +SetContract sets Contract field to given value. + +### HasContract + +`func (o *CallTarget) HasContract() bool` + +HasContract returns a boolean if a field has been set. + +### GetEntryPoint + +`func (o *CallTarget) GetEntryPoint() int32` + +GetEntryPoint returns the EntryPoint field if non-nil, zero value otherwise. + +### GetEntryPointOk + +`func (o *CallTarget) GetEntryPointOk() (*int32, bool)` + +GetEntryPointOk returns a tuple with the EntryPoint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntryPoint + +`func (o *CallTarget) SetEntryPoint(v int32)` + +SetEntryPoint sets EntryPoint field to given value. + +### HasEntryPoint + +`func (o *CallTarget) HasEntryPoint() bool` + +HasEntryPoint returns a boolean if a field has been set. + + +[[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/client/docs/ChainInfoResponse.md b/client/docs/ChainInfoResponse.md new file mode 100644 index 0000000000..c43ad3fcbb --- /dev/null +++ b/client/docs/ChainInfoResponse.md @@ -0,0 +1,264 @@ +# ChainInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ChainID** | Pointer to **string** | ChainID (Bech32-encoded). | [optional] +**ChainOwnerId** | Pointer to **string** | The chain owner address (Bech32-encoded). | [optional] +**Description** | Pointer to **string** | The description of the chain. | [optional] +**EvmChainId** | Pointer to **int32** | The EVM chain ID | [optional] +**GasFeePolicy** | Pointer to [**GasFeePolicy**](GasFeePolicy.md) | | [optional] +**IsActive** | Pointer to **bool** | Whether or not the chain is active. | [optional] +**MaxBlobSize** | Pointer to **int32** | The maximum contract blob size. | [optional] +**MaxEventSize** | Pointer to **int32** | The maximum event size. | [optional] +**MaxEventsPerReq** | Pointer to **int32** | The maximum amount of events per request. | [optional] + +## Methods + +### NewChainInfoResponse + +`func NewChainInfoResponse() *ChainInfoResponse` + +NewChainInfoResponse instantiates a new ChainInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChainInfoResponseWithDefaults + +`func NewChainInfoResponseWithDefaults() *ChainInfoResponse` + +NewChainInfoResponseWithDefaults instantiates a new ChainInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChainID + +`func (o *ChainInfoResponse) GetChainID() string` + +GetChainID returns the ChainID field if non-nil, zero value otherwise. + +### GetChainIDOk + +`func (o *ChainInfoResponse) GetChainIDOk() (*string, bool)` + +GetChainIDOk returns a tuple with the ChainID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainID + +`func (o *ChainInfoResponse) SetChainID(v string)` + +SetChainID sets ChainID field to given value. + +### HasChainID + +`func (o *ChainInfoResponse) HasChainID() bool` + +HasChainID returns a boolean if a field has been set. + +### GetChainOwnerId + +`func (o *ChainInfoResponse) GetChainOwnerId() string` + +GetChainOwnerId returns the ChainOwnerId field if non-nil, zero value otherwise. + +### GetChainOwnerIdOk + +`func (o *ChainInfoResponse) GetChainOwnerIdOk() (*string, bool)` + +GetChainOwnerIdOk returns a tuple with the ChainOwnerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainOwnerId + +`func (o *ChainInfoResponse) SetChainOwnerId(v string)` + +SetChainOwnerId sets ChainOwnerId field to given value. + +### HasChainOwnerId + +`func (o *ChainInfoResponse) HasChainOwnerId() bool` + +HasChainOwnerId returns a boolean if a field has been set. + +### GetDescription + +`func (o *ChainInfoResponse) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *ChainInfoResponse) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *ChainInfoResponse) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *ChainInfoResponse) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetEvmChainId + +`func (o *ChainInfoResponse) GetEvmChainId() int32` + +GetEvmChainId returns the EvmChainId field if non-nil, zero value otherwise. + +### GetEvmChainIdOk + +`func (o *ChainInfoResponse) GetEvmChainIdOk() (*int32, bool)` + +GetEvmChainIdOk returns a tuple with the EvmChainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvmChainId + +`func (o *ChainInfoResponse) SetEvmChainId(v int32)` + +SetEvmChainId sets EvmChainId field to given value. + +### HasEvmChainId + +`func (o *ChainInfoResponse) HasEvmChainId() bool` + +HasEvmChainId returns a boolean if a field has been set. + +### GetGasFeePolicy + +`func (o *ChainInfoResponse) GetGasFeePolicy() GasFeePolicy` + +GetGasFeePolicy returns the GasFeePolicy field if non-nil, zero value otherwise. + +### GetGasFeePolicyOk + +`func (o *ChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool)` + +GetGasFeePolicyOk returns a tuple with the GasFeePolicy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasFeePolicy + +`func (o *ChainInfoResponse) SetGasFeePolicy(v GasFeePolicy)` + +SetGasFeePolicy sets GasFeePolicy field to given value. + +### HasGasFeePolicy + +`func (o *ChainInfoResponse) HasGasFeePolicy() bool` + +HasGasFeePolicy returns a boolean if a field has been set. + +### GetIsActive + +`func (o *ChainInfoResponse) GetIsActive() bool` + +GetIsActive returns the IsActive field if non-nil, zero value otherwise. + +### GetIsActiveOk + +`func (o *ChainInfoResponse) GetIsActiveOk() (*bool, bool)` + +GetIsActiveOk returns a tuple with the IsActive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsActive + +`func (o *ChainInfoResponse) SetIsActive(v bool)` + +SetIsActive sets IsActive field to given value. + +### HasIsActive + +`func (o *ChainInfoResponse) HasIsActive() bool` + +HasIsActive returns a boolean if a field has been set. + +### GetMaxBlobSize + +`func (o *ChainInfoResponse) GetMaxBlobSize() int32` + +GetMaxBlobSize returns the MaxBlobSize field if non-nil, zero value otherwise. + +### GetMaxBlobSizeOk + +`func (o *ChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool)` + +GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxBlobSize + +`func (o *ChainInfoResponse) SetMaxBlobSize(v int32)` + +SetMaxBlobSize sets MaxBlobSize field to given value. + +### HasMaxBlobSize + +`func (o *ChainInfoResponse) HasMaxBlobSize() bool` + +HasMaxBlobSize returns a boolean if a field has been set. + +### GetMaxEventSize + +`func (o *ChainInfoResponse) GetMaxEventSize() int32` + +GetMaxEventSize returns the MaxEventSize field if non-nil, zero value otherwise. + +### GetMaxEventSizeOk + +`func (o *ChainInfoResponse) GetMaxEventSizeOk() (*int32, bool)` + +GetMaxEventSizeOk returns a tuple with the MaxEventSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxEventSize + +`func (o *ChainInfoResponse) SetMaxEventSize(v int32)` + +SetMaxEventSize sets MaxEventSize field to given value. + +### HasMaxEventSize + +`func (o *ChainInfoResponse) HasMaxEventSize() bool` + +HasMaxEventSize returns a boolean if a field has been set. + +### GetMaxEventsPerReq + +`func (o *ChainInfoResponse) GetMaxEventsPerReq() int32` + +GetMaxEventsPerReq returns the MaxEventsPerReq field if non-nil, zero value otherwise. + +### GetMaxEventsPerReqOk + +`func (o *ChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool)` + +GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxEventsPerReq + +`func (o *ChainInfoResponse) SetMaxEventsPerReq(v int32)` + +SetMaxEventsPerReq sets MaxEventsPerReq field to given value. + +### HasMaxEventsPerReq + +`func (o *ChainInfoResponse) HasMaxEventsPerReq() bool` + +HasMaxEventsPerReq returns a boolean if a field has been set. + + +[[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/client/docs/ChainMetrics.md b/client/docs/ChainMetrics.md new file mode 100644 index 0000000000..a624de47a4 --- /dev/null +++ b/client/docs/ChainMetrics.md @@ -0,0 +1,264 @@ +# ChainMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InAliasOutput** | Pointer to [**AliasOutputMetricItem**](AliasOutputMetricItem.md) | | [optional] +**InOnLedgerRequest** | Pointer to [**OnLedgerRequestMetricItem**](OnLedgerRequestMetricItem.md) | | [optional] +**InOutput** | Pointer to [**InOutputMetricItem**](InOutputMetricItem.md) | | [optional] +**InStateOutput** | Pointer to [**InStateOutputMetricItem**](InStateOutputMetricItem.md) | | [optional] +**InTxInclusionState** | Pointer to [**TxInclusionStateMsgMetricItem**](TxInclusionStateMsgMetricItem.md) | | [optional] +**OutPublishGovernanceTransaction** | Pointer to [**TransactionMetricItem**](TransactionMetricItem.md) | | [optional] +**OutPullLatestOutput** | Pointer to [**InterfaceMetricItem**](InterfaceMetricItem.md) | | [optional] +**OutPullOutputByID** | Pointer to [**UTXOInputMetricItem**](UTXOInputMetricItem.md) | | [optional] +**OutPullTxInclusionState** | Pointer to [**TransactionIDMetricItem**](TransactionIDMetricItem.md) | | [optional] + +## Methods + +### NewChainMetrics + +`func NewChainMetrics() *ChainMetrics` + +NewChainMetrics instantiates a new ChainMetrics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChainMetricsWithDefaults + +`func NewChainMetricsWithDefaults() *ChainMetrics` + +NewChainMetricsWithDefaults instantiates a new ChainMetrics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInAliasOutput + +`func (o *ChainMetrics) GetInAliasOutput() AliasOutputMetricItem` + +GetInAliasOutput returns the InAliasOutput field if non-nil, zero value otherwise. + +### GetInAliasOutputOk + +`func (o *ChainMetrics) GetInAliasOutputOk() (*AliasOutputMetricItem, bool)` + +GetInAliasOutputOk returns a tuple with the InAliasOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInAliasOutput + +`func (o *ChainMetrics) SetInAliasOutput(v AliasOutputMetricItem)` + +SetInAliasOutput sets InAliasOutput field to given value. + +### HasInAliasOutput + +`func (o *ChainMetrics) HasInAliasOutput() bool` + +HasInAliasOutput returns a boolean if a field has been set. + +### GetInOnLedgerRequest + +`func (o *ChainMetrics) GetInOnLedgerRequest() OnLedgerRequestMetricItem` + +GetInOnLedgerRequest returns the InOnLedgerRequest field if non-nil, zero value otherwise. + +### GetInOnLedgerRequestOk + +`func (o *ChainMetrics) GetInOnLedgerRequestOk() (*OnLedgerRequestMetricItem, bool)` + +GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInOnLedgerRequest + +`func (o *ChainMetrics) SetInOnLedgerRequest(v OnLedgerRequestMetricItem)` + +SetInOnLedgerRequest sets InOnLedgerRequest field to given value. + +### HasInOnLedgerRequest + +`func (o *ChainMetrics) HasInOnLedgerRequest() bool` + +HasInOnLedgerRequest returns a boolean if a field has been set. + +### GetInOutput + +`func (o *ChainMetrics) GetInOutput() InOutputMetricItem` + +GetInOutput returns the InOutput field if non-nil, zero value otherwise. + +### GetInOutputOk + +`func (o *ChainMetrics) GetInOutputOk() (*InOutputMetricItem, bool)` + +GetInOutputOk returns a tuple with the InOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInOutput + +`func (o *ChainMetrics) SetInOutput(v InOutputMetricItem)` + +SetInOutput sets InOutput field to given value. + +### HasInOutput + +`func (o *ChainMetrics) HasInOutput() bool` + +HasInOutput returns a boolean if a field has been set. + +### GetInStateOutput + +`func (o *ChainMetrics) GetInStateOutput() InStateOutputMetricItem` + +GetInStateOutput returns the InStateOutput field if non-nil, zero value otherwise. + +### GetInStateOutputOk + +`func (o *ChainMetrics) GetInStateOutputOk() (*InStateOutputMetricItem, bool)` + +GetInStateOutputOk returns a tuple with the InStateOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInStateOutput + +`func (o *ChainMetrics) SetInStateOutput(v InStateOutputMetricItem)` + +SetInStateOutput sets InStateOutput field to given value. + +### HasInStateOutput + +`func (o *ChainMetrics) HasInStateOutput() bool` + +HasInStateOutput returns a boolean if a field has been set. + +### GetInTxInclusionState + +`func (o *ChainMetrics) GetInTxInclusionState() TxInclusionStateMsgMetricItem` + +GetInTxInclusionState returns the InTxInclusionState field if non-nil, zero value otherwise. + +### GetInTxInclusionStateOk + +`func (o *ChainMetrics) GetInTxInclusionStateOk() (*TxInclusionStateMsgMetricItem, bool)` + +GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInTxInclusionState + +`func (o *ChainMetrics) SetInTxInclusionState(v TxInclusionStateMsgMetricItem)` + +SetInTxInclusionState sets InTxInclusionState field to given value. + +### HasInTxInclusionState + +`func (o *ChainMetrics) HasInTxInclusionState() bool` + +HasInTxInclusionState returns a boolean if a field has been set. + +### GetOutPublishGovernanceTransaction + +`func (o *ChainMetrics) GetOutPublishGovernanceTransaction() TransactionMetricItem` + +GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field if non-nil, zero value otherwise. + +### GetOutPublishGovernanceTransactionOk + +`func (o *ChainMetrics) GetOutPublishGovernanceTransactionOk() (*TransactionMetricItem, bool)` + +GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPublishGovernanceTransaction + +`func (o *ChainMetrics) SetOutPublishGovernanceTransaction(v TransactionMetricItem)` + +SetOutPublishGovernanceTransaction sets OutPublishGovernanceTransaction field to given value. + +### HasOutPublishGovernanceTransaction + +`func (o *ChainMetrics) HasOutPublishGovernanceTransaction() bool` + +HasOutPublishGovernanceTransaction returns a boolean if a field has been set. + +### GetOutPullLatestOutput + +`func (o *ChainMetrics) GetOutPullLatestOutput() InterfaceMetricItem` + +GetOutPullLatestOutput returns the OutPullLatestOutput field if non-nil, zero value otherwise. + +### GetOutPullLatestOutputOk + +`func (o *ChainMetrics) GetOutPullLatestOutputOk() (*InterfaceMetricItem, bool)` + +GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPullLatestOutput + +`func (o *ChainMetrics) SetOutPullLatestOutput(v InterfaceMetricItem)` + +SetOutPullLatestOutput sets OutPullLatestOutput field to given value. + +### HasOutPullLatestOutput + +`func (o *ChainMetrics) HasOutPullLatestOutput() bool` + +HasOutPullLatestOutput returns a boolean if a field has been set. + +### GetOutPullOutputByID + +`func (o *ChainMetrics) GetOutPullOutputByID() UTXOInputMetricItem` + +GetOutPullOutputByID returns the OutPullOutputByID field if non-nil, zero value otherwise. + +### GetOutPullOutputByIDOk + +`func (o *ChainMetrics) GetOutPullOutputByIDOk() (*UTXOInputMetricItem, bool)` + +GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPullOutputByID + +`func (o *ChainMetrics) SetOutPullOutputByID(v UTXOInputMetricItem)` + +SetOutPullOutputByID sets OutPullOutputByID field to given value. + +### HasOutPullOutputByID + +`func (o *ChainMetrics) HasOutPullOutputByID() bool` + +HasOutPullOutputByID returns a boolean if a field has been set. + +### GetOutPullTxInclusionState + +`func (o *ChainMetrics) GetOutPullTxInclusionState() TransactionIDMetricItem` + +GetOutPullTxInclusionState returns the OutPullTxInclusionState field if non-nil, zero value otherwise. + +### GetOutPullTxInclusionStateOk + +`func (o *ChainMetrics) GetOutPullTxInclusionStateOk() (*TransactionIDMetricItem, bool)` + +GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPullTxInclusionState + +`func (o *ChainMetrics) SetOutPullTxInclusionState(v TransactionIDMetricItem)` + +SetOutPullTxInclusionState sets OutPullTxInclusionState field to given value. + +### HasOutPullTxInclusionState + +`func (o *ChainMetrics) HasOutPullTxInclusionState() bool` + +HasOutPullTxInclusionState returns a boolean if a field has been set. + + +[[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/client/docs/ChainsApi.md b/client/docs/ChainsApi.md new file mode 100644 index 0000000000..05f05260dd --- /dev/null +++ b/client/docs/ChainsApi.md @@ -0,0 +1,760 @@ +# \ChainsApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /chains/{chainID}/activate | Activate a chain +[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. +[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /v2/chains/{chainID}/ws | +[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain +[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /chains/{chainID} | Get information about a specific chain +[**GetChains**](ChainsApi.md#GetChains) | **Get** /chains | Get a list of all chains +[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee +[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts +[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /v2/chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2/chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. + + + +## ActivateChain + +> ActivateChain(ctx, chainID).Execute() + +Activate a chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.ActivateChain(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.ActivateChain``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActivateChainRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## AddAccessNode + +> AddAccessNode(ctx, chainID, publicKey).Execute() + +Configure a trusted node to be an access node. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + publicKey := "publicKey_example" // string | Nodes public key (Hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.AddAccessNode(context.Background(), chainID, publicKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.AddAccessNode``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**publicKey** | **string** | Nodes public key (Hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddAccessNodeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## AttachToWebsocket + +> AttachToWebsocket(ctx, chainID).Execute() + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32-encoded) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.AttachToWebsocket(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.AttachToWebsocket``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32-encoded) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAttachToWebsocketRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## DeactivateChain + +> DeactivateChain(ctx, chainID).Execute() + +Deactivate a chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.DeactivateChain(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.DeactivateChain``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeactivateChainRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetChainInfo + +> ChainInfoResponse GetChainInfo(ctx, chainID).Execute() + +Get information about a specific chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.GetChainInfo(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetChainInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetChainInfo`: ChainInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetChainInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetChainInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ChainInfoResponse**](ChainInfoResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetChains + +> []ChainInfoResponse GetChains(ctx).Execute() + +Get a list of all chains + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.GetChains(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetChains``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetChains`: []ChainInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetChains`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetChainsRequest struct via the builder pattern + + +### Return type + +[**[]ChainInfoResponse**](ChainInfoResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetCommitteeInfo + +> CommitteeInfoResponse GetCommitteeInfo(ctx, chainID).Execute() + +Get information about the deployed committee + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.GetCommitteeInfo(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetCommitteeInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetCommitteeInfo`: CommitteeInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetCommitteeInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetCommitteeInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**CommitteeInfoResponse**](CommitteeInfoResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetContracts + +> []ContractInfoResponse GetContracts(ctx, chainID).Execute() + +Get all available chain contracts + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.GetContracts(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetContracts``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetContracts`: []ContractInfoResponse + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetContracts`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetContractsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**[]ContractInfoResponse**](ContractInfoResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetRequestIDFromEVMTransactionID + +> string GetRequestIDFromEVMTransactionID(ctx, chainID, txHash).Execute() + +Get the ISC request ID for the given Ethereum transaction hash + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + txHash := "txHash_example" // string | Transaction hash (Hex-encoded) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.GetRequestIDFromEVMTransactionID(context.Background(), chainID, txHash).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetRequestIDFromEVMTransactionID``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRequestIDFromEVMTransactionID`: string + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetRequestIDFromEVMTransactionID`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**txHash** | **string** | Transaction hash (Hex-encoded) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRequestIDFromEVMTransactionIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**string** + +### 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) + + +## GetStateValue + +> []int32 GetStateValue(ctx, chainID, stateKey).Execute() + +Fetch the raw value associated with the given key in the chain state + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + stateKey := "stateKey_example" // string | Key (Hex-encoded) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.GetStateValue(context.Background(), chainID, stateKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetStateValue``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetStateValue`: []int32 + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetStateValue`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**stateKey** | **string** | Key (Hex-encoded) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetStateValueRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**[]int32** + +### 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) + + +## RemoveAccessNode + +> RemoveAccessNode(ctx, chainID, publicKey).Execute() + +Remove an access node. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + publicKey := "publicKey_example" // string | Nodes public key (Hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.RemoveAccessNode(context.Background(), chainID, publicKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.RemoveAccessNode``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**publicKey** | **string** | Nodes public key (Hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRemoveAccessNodeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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/client/docs/CommitteeInfoResponse.md b/client/docs/CommitteeInfoResponse.md new file mode 100644 index 0000000000..8a698a8160 --- /dev/null +++ b/client/docs/CommitteeInfoResponse.md @@ -0,0 +1,186 @@ +# CommitteeInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessNodes** | Pointer to [**[]CommitteeNode**](CommitteeNode.md) | A list of all access nodes and their peering info. | [optional] +**Active** | Pointer to **bool** | Whether or not the chain is active. | [optional] +**CandidateNodes** | Pointer to [**[]CommitteeNode**](CommitteeNode.md) | A list of all candidate nodes and their peering info. | [optional] +**ChainId** | Pointer to **string** | ChainID (Bech32-encoded). | [optional] +**CommitteeNodes** | Pointer to [**[]CommitteeNode**](CommitteeNode.md) | A list of all committee nodes and their peering info. | [optional] +**StateAddress** | Pointer to **string** | | [optional] + +## Methods + +### NewCommitteeInfoResponse + +`func NewCommitteeInfoResponse() *CommitteeInfoResponse` + +NewCommitteeInfoResponse instantiates a new CommitteeInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCommitteeInfoResponseWithDefaults + +`func NewCommitteeInfoResponseWithDefaults() *CommitteeInfoResponse` + +NewCommitteeInfoResponseWithDefaults instantiates a new CommitteeInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessNodes + +`func (o *CommitteeInfoResponse) GetAccessNodes() []CommitteeNode` + +GetAccessNodes returns the AccessNodes field if non-nil, zero value otherwise. + +### GetAccessNodesOk + +`func (o *CommitteeInfoResponse) GetAccessNodesOk() (*[]CommitteeNode, bool)` + +GetAccessNodesOk returns a tuple with the AccessNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessNodes + +`func (o *CommitteeInfoResponse) SetAccessNodes(v []CommitteeNode)` + +SetAccessNodes sets AccessNodes field to given value. + +### HasAccessNodes + +`func (o *CommitteeInfoResponse) HasAccessNodes() bool` + +HasAccessNodes returns a boolean if a field has been set. + +### GetActive + +`func (o *CommitteeInfoResponse) GetActive() bool` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *CommitteeInfoResponse) GetActiveOk() (*bool, bool)` + +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActive + +`func (o *CommitteeInfoResponse) SetActive(v bool)` + +SetActive sets Active field to given value. + +### HasActive + +`func (o *CommitteeInfoResponse) HasActive() bool` + +HasActive returns a boolean if a field has been set. + +### GetCandidateNodes + +`func (o *CommitteeInfoResponse) GetCandidateNodes() []CommitteeNode` + +GetCandidateNodes returns the CandidateNodes field if non-nil, zero value otherwise. + +### GetCandidateNodesOk + +`func (o *CommitteeInfoResponse) GetCandidateNodesOk() (*[]CommitteeNode, bool)` + +GetCandidateNodesOk returns a tuple with the CandidateNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCandidateNodes + +`func (o *CommitteeInfoResponse) SetCandidateNodes(v []CommitteeNode)` + +SetCandidateNodes sets CandidateNodes field to given value. + +### HasCandidateNodes + +`func (o *CommitteeInfoResponse) HasCandidateNodes() bool` + +HasCandidateNodes returns a boolean if a field has been set. + +### GetChainId + +`func (o *CommitteeInfoResponse) GetChainId() string` + +GetChainId returns the ChainId field if non-nil, zero value otherwise. + +### GetChainIdOk + +`func (o *CommitteeInfoResponse) GetChainIdOk() (*string, bool)` + +GetChainIdOk returns a tuple with the ChainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainId + +`func (o *CommitteeInfoResponse) SetChainId(v string)` + +SetChainId sets ChainId field to given value. + +### HasChainId + +`func (o *CommitteeInfoResponse) HasChainId() bool` + +HasChainId returns a boolean if a field has been set. + +### GetCommitteeNodes + +`func (o *CommitteeInfoResponse) GetCommitteeNodes() []CommitteeNode` + +GetCommitteeNodes returns the CommitteeNodes field if non-nil, zero value otherwise. + +### GetCommitteeNodesOk + +`func (o *CommitteeInfoResponse) GetCommitteeNodesOk() (*[]CommitteeNode, bool)` + +GetCommitteeNodesOk returns a tuple with the CommitteeNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCommitteeNodes + +`func (o *CommitteeInfoResponse) SetCommitteeNodes(v []CommitteeNode)` + +SetCommitteeNodes sets CommitteeNodes field to given value. + +### HasCommitteeNodes + +`func (o *CommitteeInfoResponse) HasCommitteeNodes() bool` + +HasCommitteeNodes returns a boolean if a field has been set. + +### GetStateAddress + +`func (o *CommitteeInfoResponse) GetStateAddress() string` + +GetStateAddress returns the StateAddress field if non-nil, zero value otherwise. + +### GetStateAddressOk + +`func (o *CommitteeInfoResponse) GetStateAddressOk() (*string, bool)` + +GetStateAddressOk returns a tuple with the StateAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateAddress + +`func (o *CommitteeInfoResponse) SetStateAddress(v string)` + +SetStateAddress sets StateAddress field to given value. + +### HasStateAddress + +`func (o *CommitteeInfoResponse) HasStateAddress() bool` + +HasStateAddress returns a boolean if a field has been set. + + +[[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/client/docs/CommitteeNode.md b/client/docs/CommitteeNode.md new file mode 100644 index 0000000000..45fc14b823 --- /dev/null +++ b/client/docs/CommitteeNode.md @@ -0,0 +1,82 @@ +# CommitteeNode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessAPI** | Pointer to **string** | | [optional] +**Node** | Pointer to [**PeeringNodeStatusResponse**](PeeringNodeStatusResponse.md) | | [optional] + +## Methods + +### NewCommitteeNode + +`func NewCommitteeNode() *CommitteeNode` + +NewCommitteeNode instantiates a new CommitteeNode object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCommitteeNodeWithDefaults + +`func NewCommitteeNodeWithDefaults() *CommitteeNode` + +NewCommitteeNodeWithDefaults instantiates a new CommitteeNode object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessAPI + +`func (o *CommitteeNode) GetAccessAPI() string` + +GetAccessAPI returns the AccessAPI field if non-nil, zero value otherwise. + +### GetAccessAPIOk + +`func (o *CommitteeNode) GetAccessAPIOk() (*string, bool)` + +GetAccessAPIOk returns a tuple with the AccessAPI field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessAPI + +`func (o *CommitteeNode) SetAccessAPI(v string)` + +SetAccessAPI sets AccessAPI field to given value. + +### HasAccessAPI + +`func (o *CommitteeNode) HasAccessAPI() bool` + +HasAccessAPI returns a boolean if a field has been set. + +### GetNode + +`func (o *CommitteeNode) GetNode() PeeringNodeStatusResponse` + +GetNode returns the Node field if non-nil, zero value otherwise. + +### GetNodeOk + +`func (o *CommitteeNode) GetNodeOk() (*PeeringNodeStatusResponse, bool)` + +GetNodeOk returns a tuple with the Node field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNode + +`func (o *CommitteeNode) SetNode(v PeeringNodeStatusResponse)` + +SetNode sets Node field to given value. + +### HasNode + +`func (o *CommitteeNode) HasNode() bool` + +HasNode returns a boolean if a field has been set. + + +[[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/client/docs/ConsensusPipeMetrics.md b/client/docs/ConsensusPipeMetrics.md new file mode 100644 index 0000000000..388d1273ee --- /dev/null +++ b/client/docs/ConsensusPipeMetrics.md @@ -0,0 +1,160 @@ +# ConsensusPipeMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventACSMsgPipeSize** | Pointer to **int32** | | [optional] +**EventPeerLogIndexMsgPipeSize** | Pointer to **int32** | | [optional] +**EventStateTransitionMsgPipeSize** | Pointer to **int32** | | [optional] +**EventTimerMsgPipeSize** | Pointer to **int32** | | [optional] +**EventVMResultMsgPipeSize** | Pointer to **int32** | | [optional] + +## Methods + +### NewConsensusPipeMetrics + +`func NewConsensusPipeMetrics() *ConsensusPipeMetrics` + +NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConsensusPipeMetricsWithDefaults + +`func NewConsensusPipeMetricsWithDefaults() *ConsensusPipeMetrics` + +NewConsensusPipeMetricsWithDefaults instantiates a new ConsensusPipeMetrics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEventACSMsgPipeSize + +`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32` + +GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field if non-nil, zero value otherwise. + +### GetEventACSMsgPipeSizeOk + +`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool)` + +GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventACSMsgPipeSize + +`func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32)` + +SetEventACSMsgPipeSize sets EventACSMsgPipeSize field to given value. + +### HasEventACSMsgPipeSize + +`func (o *ConsensusPipeMetrics) HasEventACSMsgPipeSize() bool` + +HasEventACSMsgPipeSize returns a boolean if a field has been set. + +### GetEventPeerLogIndexMsgPipeSize + +`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32` + +GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field if non-nil, zero value otherwise. + +### GetEventPeerLogIndexMsgPipeSizeOk + +`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool)` + +GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventPeerLogIndexMsgPipeSize + +`func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32)` + +SetEventPeerLogIndexMsgPipeSize sets EventPeerLogIndexMsgPipeSize field to given value. + +### HasEventPeerLogIndexMsgPipeSize + +`func (o *ConsensusPipeMetrics) HasEventPeerLogIndexMsgPipeSize() bool` + +HasEventPeerLogIndexMsgPipeSize returns a boolean if a field has been set. + +### GetEventStateTransitionMsgPipeSize + +`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32` + +GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field if non-nil, zero value otherwise. + +### GetEventStateTransitionMsgPipeSizeOk + +`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool)` + +GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventStateTransitionMsgPipeSize + +`func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32)` + +SetEventStateTransitionMsgPipeSize sets EventStateTransitionMsgPipeSize field to given value. + +### HasEventStateTransitionMsgPipeSize + +`func (o *ConsensusPipeMetrics) HasEventStateTransitionMsgPipeSize() bool` + +HasEventStateTransitionMsgPipeSize returns a boolean if a field has been set. + +### GetEventTimerMsgPipeSize + +`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32` + +GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field if non-nil, zero value otherwise. + +### GetEventTimerMsgPipeSizeOk + +`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool)` + +GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventTimerMsgPipeSize + +`func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32)` + +SetEventTimerMsgPipeSize sets EventTimerMsgPipeSize field to given value. + +### HasEventTimerMsgPipeSize + +`func (o *ConsensusPipeMetrics) HasEventTimerMsgPipeSize() bool` + +HasEventTimerMsgPipeSize returns a boolean if a field has been set. + +### GetEventVMResultMsgPipeSize + +`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32` + +GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field if non-nil, zero value otherwise. + +### GetEventVMResultMsgPipeSizeOk + +`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool)` + +GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventVMResultMsgPipeSize + +`func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32)` + +SetEventVMResultMsgPipeSize sets EventVMResultMsgPipeSize field to given value. + +### HasEventVMResultMsgPipeSize + +`func (o *ConsensusPipeMetrics) HasEventVMResultMsgPipeSize() bool` + +HasEventVMResultMsgPipeSize returns a boolean if a field has been set. + + +[[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/client/docs/ConsensusWorkflowMetrics.md b/client/docs/ConsensusWorkflowMetrics.md new file mode 100644 index 0000000000..c34912faa6 --- /dev/null +++ b/client/docs/ConsensusWorkflowMetrics.md @@ -0,0 +1,498 @@ +# ConsensusWorkflowMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CurrentStateIndex** | Pointer to **int32** | Shows current state index of the consensus | [optional] +**FlagBatchProposalSent** | Pointer to **bool** | Shows if batch proposal is sent out in current consensus iteration | [optional] +**FlagConsensusBatchKnown** | Pointer to **bool** | Shows if consensus on batch is reached and known in current consensus iteration | [optional] +**FlagInProgress** | Pointer to **bool** | Shows if consensus algorithm is still not completed in current consensus iteration | [optional] +**FlagStateReceived** | Pointer to **bool** | Shows if state output is received in current consensus iteration | [optional] +**FlagTransactionFinalized** | Pointer to **bool** | Shows if consensus on transaction is reached in current consensus iteration | [optional] +**FlagTransactionPosted** | Pointer to **bool** | Shows if transaction is posted to L1 in current consensus iteration | [optional] +**FlagTransactionSeen** | Pointer to **bool** | Shows if L1 reported that it has seen the transaction of current consensus iteration | [optional] +**FlagVMResultSigned** | Pointer to **bool** | Shows if virtual machine has returned its results in current consensus iteration | [optional] +**FlagVMStarted** | Pointer to **bool** | Shows if virtual machine is started in current consensus iteration | [optional] +**TimeBatchProposalSent** | Pointer to **time.Time** | Shows when batch proposal was last sent out in current consensus iteration | [optional] +**TimeCompleted** | Pointer to **time.Time** | Shows when algorithm was last completed in current consensus iteration | [optional] +**TimeConsensusBatchKnown** | Pointer to **time.Time** | Shows when ACS results of consensus on batch was last received in current consensus iteration | [optional] +**TimeTransactionFinalized** | Pointer to **time.Time** | Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration | [optional] +**TimeTransactionPosted** | Pointer to **time.Time** | Shows when transaction was last posted to L1 in current consensus iteration | [optional] +**TimeTransactionSeen** | Pointer to **time.Time** | Shows when algorithm last noted that transaction had been seen by L1 in current consensus iteration | [optional] +**TimeVMResultSigned** | Pointer to **time.Time** | Shows when virtual machine results were last received and signed in current consensus iteration | [optional] +**TimeVMStarted** | Pointer to **time.Time** | Shows when virtual machine was last started in current consensus iteration | [optional] + +## Methods + +### NewConsensusWorkflowMetrics + +`func NewConsensusWorkflowMetrics() *ConsensusWorkflowMetrics` + +NewConsensusWorkflowMetrics instantiates a new ConsensusWorkflowMetrics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConsensusWorkflowMetricsWithDefaults + +`func NewConsensusWorkflowMetricsWithDefaults() *ConsensusWorkflowMetrics` + +NewConsensusWorkflowMetricsWithDefaults instantiates a new ConsensusWorkflowMetrics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrentStateIndex + +`func (o *ConsensusWorkflowMetrics) GetCurrentStateIndex() int32` + +GetCurrentStateIndex returns the CurrentStateIndex field if non-nil, zero value otherwise. + +### GetCurrentStateIndexOk + +`func (o *ConsensusWorkflowMetrics) GetCurrentStateIndexOk() (*int32, bool)` + +GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrentStateIndex + +`func (o *ConsensusWorkflowMetrics) SetCurrentStateIndex(v int32)` + +SetCurrentStateIndex sets CurrentStateIndex field to given value. + +### HasCurrentStateIndex + +`func (o *ConsensusWorkflowMetrics) HasCurrentStateIndex() bool` + +HasCurrentStateIndex returns a boolean if a field has been set. + +### GetFlagBatchProposalSent + +`func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSent() bool` + +GetFlagBatchProposalSent returns the FlagBatchProposalSent field if non-nil, zero value otherwise. + +### GetFlagBatchProposalSentOk + +`func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSentOk() (*bool, bool)` + +GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagBatchProposalSent + +`func (o *ConsensusWorkflowMetrics) SetFlagBatchProposalSent(v bool)` + +SetFlagBatchProposalSent sets FlagBatchProposalSent field to given value. + +### HasFlagBatchProposalSent + +`func (o *ConsensusWorkflowMetrics) HasFlagBatchProposalSent() bool` + +HasFlagBatchProposalSent returns a boolean if a field has been set. + +### GetFlagConsensusBatchKnown + +`func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnown() bool` + +GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field if non-nil, zero value otherwise. + +### GetFlagConsensusBatchKnownOk + +`func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnownOk() (*bool, bool)` + +GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagConsensusBatchKnown + +`func (o *ConsensusWorkflowMetrics) SetFlagConsensusBatchKnown(v bool)` + +SetFlagConsensusBatchKnown sets FlagConsensusBatchKnown field to given value. + +### HasFlagConsensusBatchKnown + +`func (o *ConsensusWorkflowMetrics) HasFlagConsensusBatchKnown() bool` + +HasFlagConsensusBatchKnown returns a boolean if a field has been set. + +### GetFlagInProgress + +`func (o *ConsensusWorkflowMetrics) GetFlagInProgress() bool` + +GetFlagInProgress returns the FlagInProgress field if non-nil, zero value otherwise. + +### GetFlagInProgressOk + +`func (o *ConsensusWorkflowMetrics) GetFlagInProgressOk() (*bool, bool)` + +GetFlagInProgressOk returns a tuple with the FlagInProgress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagInProgress + +`func (o *ConsensusWorkflowMetrics) SetFlagInProgress(v bool)` + +SetFlagInProgress sets FlagInProgress field to given value. + +### HasFlagInProgress + +`func (o *ConsensusWorkflowMetrics) HasFlagInProgress() bool` + +HasFlagInProgress returns a boolean if a field has been set. + +### GetFlagStateReceived + +`func (o *ConsensusWorkflowMetrics) GetFlagStateReceived() bool` + +GetFlagStateReceived returns the FlagStateReceived field if non-nil, zero value otherwise. + +### GetFlagStateReceivedOk + +`func (o *ConsensusWorkflowMetrics) GetFlagStateReceivedOk() (*bool, bool)` + +GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagStateReceived + +`func (o *ConsensusWorkflowMetrics) SetFlagStateReceived(v bool)` + +SetFlagStateReceived sets FlagStateReceived field to given value. + +### HasFlagStateReceived + +`func (o *ConsensusWorkflowMetrics) HasFlagStateReceived() bool` + +HasFlagStateReceived returns a boolean if a field has been set. + +### GetFlagTransactionFinalized + +`func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalized() bool` + +GetFlagTransactionFinalized returns the FlagTransactionFinalized field if non-nil, zero value otherwise. + +### GetFlagTransactionFinalizedOk + +`func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalizedOk() (*bool, bool)` + +GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagTransactionFinalized + +`func (o *ConsensusWorkflowMetrics) SetFlagTransactionFinalized(v bool)` + +SetFlagTransactionFinalized sets FlagTransactionFinalized field to given value. + +### HasFlagTransactionFinalized + +`func (o *ConsensusWorkflowMetrics) HasFlagTransactionFinalized() bool` + +HasFlagTransactionFinalized returns a boolean if a field has been set. + +### GetFlagTransactionPosted + +`func (o *ConsensusWorkflowMetrics) GetFlagTransactionPosted() bool` + +GetFlagTransactionPosted returns the FlagTransactionPosted field if non-nil, zero value otherwise. + +### GetFlagTransactionPostedOk + +`func (o *ConsensusWorkflowMetrics) GetFlagTransactionPostedOk() (*bool, bool)` + +GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagTransactionPosted + +`func (o *ConsensusWorkflowMetrics) SetFlagTransactionPosted(v bool)` + +SetFlagTransactionPosted sets FlagTransactionPosted field to given value. + +### HasFlagTransactionPosted + +`func (o *ConsensusWorkflowMetrics) HasFlagTransactionPosted() bool` + +HasFlagTransactionPosted returns a boolean if a field has been set. + +### GetFlagTransactionSeen + +`func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeen() bool` + +GetFlagTransactionSeen returns the FlagTransactionSeen field if non-nil, zero value otherwise. + +### GetFlagTransactionSeenOk + +`func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeenOk() (*bool, bool)` + +GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagTransactionSeen + +`func (o *ConsensusWorkflowMetrics) SetFlagTransactionSeen(v bool)` + +SetFlagTransactionSeen sets FlagTransactionSeen field to given value. + +### HasFlagTransactionSeen + +`func (o *ConsensusWorkflowMetrics) HasFlagTransactionSeen() bool` + +HasFlagTransactionSeen returns a boolean if a field has been set. + +### GetFlagVMResultSigned + +`func (o *ConsensusWorkflowMetrics) GetFlagVMResultSigned() bool` + +GetFlagVMResultSigned returns the FlagVMResultSigned field if non-nil, zero value otherwise. + +### GetFlagVMResultSignedOk + +`func (o *ConsensusWorkflowMetrics) GetFlagVMResultSignedOk() (*bool, bool)` + +GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagVMResultSigned + +`func (o *ConsensusWorkflowMetrics) SetFlagVMResultSigned(v bool)` + +SetFlagVMResultSigned sets FlagVMResultSigned field to given value. + +### HasFlagVMResultSigned + +`func (o *ConsensusWorkflowMetrics) HasFlagVMResultSigned() bool` + +HasFlagVMResultSigned returns a boolean if a field has been set. + +### GetFlagVMStarted + +`func (o *ConsensusWorkflowMetrics) GetFlagVMStarted() bool` + +GetFlagVMStarted returns the FlagVMStarted field if non-nil, zero value otherwise. + +### GetFlagVMStartedOk + +`func (o *ConsensusWorkflowMetrics) GetFlagVMStartedOk() (*bool, bool)` + +GetFlagVMStartedOk returns a tuple with the FlagVMStarted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagVMStarted + +`func (o *ConsensusWorkflowMetrics) SetFlagVMStarted(v bool)` + +SetFlagVMStarted sets FlagVMStarted field to given value. + +### HasFlagVMStarted + +`func (o *ConsensusWorkflowMetrics) HasFlagVMStarted() bool` + +HasFlagVMStarted returns a boolean if a field has been set. + +### GetTimeBatchProposalSent + +`func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSent() time.Time` + +GetTimeBatchProposalSent returns the TimeBatchProposalSent field if non-nil, zero value otherwise. + +### GetTimeBatchProposalSentOk + +`func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSentOk() (*time.Time, bool)` + +GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeBatchProposalSent + +`func (o *ConsensusWorkflowMetrics) SetTimeBatchProposalSent(v time.Time)` + +SetTimeBatchProposalSent sets TimeBatchProposalSent field to given value. + +### HasTimeBatchProposalSent + +`func (o *ConsensusWorkflowMetrics) HasTimeBatchProposalSent() bool` + +HasTimeBatchProposalSent returns a boolean if a field has been set. + +### GetTimeCompleted + +`func (o *ConsensusWorkflowMetrics) GetTimeCompleted() time.Time` + +GetTimeCompleted returns the TimeCompleted field if non-nil, zero value otherwise. + +### GetTimeCompletedOk + +`func (o *ConsensusWorkflowMetrics) GetTimeCompletedOk() (*time.Time, bool)` + +GetTimeCompletedOk returns a tuple with the TimeCompleted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeCompleted + +`func (o *ConsensusWorkflowMetrics) SetTimeCompleted(v time.Time)` + +SetTimeCompleted sets TimeCompleted field to given value. + +### HasTimeCompleted + +`func (o *ConsensusWorkflowMetrics) HasTimeCompleted() bool` + +HasTimeCompleted returns a boolean if a field has been set. + +### GetTimeConsensusBatchKnown + +`func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnown() time.Time` + +GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field if non-nil, zero value otherwise. + +### GetTimeConsensusBatchKnownOk + +`func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnownOk() (*time.Time, bool)` + +GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeConsensusBatchKnown + +`func (o *ConsensusWorkflowMetrics) SetTimeConsensusBatchKnown(v time.Time)` + +SetTimeConsensusBatchKnown sets TimeConsensusBatchKnown field to given value. + +### HasTimeConsensusBatchKnown + +`func (o *ConsensusWorkflowMetrics) HasTimeConsensusBatchKnown() bool` + +HasTimeConsensusBatchKnown returns a boolean if a field has been set. + +### GetTimeTransactionFinalized + +`func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalized() time.Time` + +GetTimeTransactionFinalized returns the TimeTransactionFinalized field if non-nil, zero value otherwise. + +### GetTimeTransactionFinalizedOk + +`func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalizedOk() (*time.Time, bool)` + +GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeTransactionFinalized + +`func (o *ConsensusWorkflowMetrics) SetTimeTransactionFinalized(v time.Time)` + +SetTimeTransactionFinalized sets TimeTransactionFinalized field to given value. + +### HasTimeTransactionFinalized + +`func (o *ConsensusWorkflowMetrics) HasTimeTransactionFinalized() bool` + +HasTimeTransactionFinalized returns a boolean if a field has been set. + +### GetTimeTransactionPosted + +`func (o *ConsensusWorkflowMetrics) GetTimeTransactionPosted() time.Time` + +GetTimeTransactionPosted returns the TimeTransactionPosted field if non-nil, zero value otherwise. + +### GetTimeTransactionPostedOk + +`func (o *ConsensusWorkflowMetrics) GetTimeTransactionPostedOk() (*time.Time, bool)` + +GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeTransactionPosted + +`func (o *ConsensusWorkflowMetrics) SetTimeTransactionPosted(v time.Time)` + +SetTimeTransactionPosted sets TimeTransactionPosted field to given value. + +### HasTimeTransactionPosted + +`func (o *ConsensusWorkflowMetrics) HasTimeTransactionPosted() bool` + +HasTimeTransactionPosted returns a boolean if a field has been set. + +### GetTimeTransactionSeen + +`func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeen() time.Time` + +GetTimeTransactionSeen returns the TimeTransactionSeen field if non-nil, zero value otherwise. + +### GetTimeTransactionSeenOk + +`func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeenOk() (*time.Time, bool)` + +GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeTransactionSeen + +`func (o *ConsensusWorkflowMetrics) SetTimeTransactionSeen(v time.Time)` + +SetTimeTransactionSeen sets TimeTransactionSeen field to given value. + +### HasTimeTransactionSeen + +`func (o *ConsensusWorkflowMetrics) HasTimeTransactionSeen() bool` + +HasTimeTransactionSeen returns a boolean if a field has been set. + +### GetTimeVMResultSigned + +`func (o *ConsensusWorkflowMetrics) GetTimeVMResultSigned() time.Time` + +GetTimeVMResultSigned returns the TimeVMResultSigned field if non-nil, zero value otherwise. + +### GetTimeVMResultSignedOk + +`func (o *ConsensusWorkflowMetrics) GetTimeVMResultSignedOk() (*time.Time, bool)` + +GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeVMResultSigned + +`func (o *ConsensusWorkflowMetrics) SetTimeVMResultSigned(v time.Time)` + +SetTimeVMResultSigned sets TimeVMResultSigned field to given value. + +### HasTimeVMResultSigned + +`func (o *ConsensusWorkflowMetrics) HasTimeVMResultSigned() bool` + +HasTimeVMResultSigned returns a boolean if a field has been set. + +### GetTimeVMStarted + +`func (o *ConsensusWorkflowMetrics) GetTimeVMStarted() time.Time` + +GetTimeVMStarted returns the TimeVMStarted field if non-nil, zero value otherwise. + +### GetTimeVMStartedOk + +`func (o *ConsensusWorkflowMetrics) GetTimeVMStartedOk() (*time.Time, bool)` + +GetTimeVMStartedOk returns a tuple with the TimeVMStarted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeVMStarted + +`func (o *ConsensusWorkflowMetrics) SetTimeVMStarted(v time.Time)` + +SetTimeVMStarted sets TimeVMStarted field to given value. + +### HasTimeVMStarted + +`func (o *ConsensusWorkflowMetrics) HasTimeVMStarted() bool` + +HasTimeVMStarted returns a boolean if a field has been set. + + +[[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/client/docs/ContractCallViewRequest.md b/client/docs/ContractCallViewRequest.md new file mode 100644 index 0000000000..b53217bd4f --- /dev/null +++ b/client/docs/ContractCallViewRequest.md @@ -0,0 +1,186 @@ +# ContractCallViewRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Arguments** | Pointer to [**JSONDict**](JSONDict.md) | | [optional] +**ChainId** | Pointer to **string** | The chain id | [optional] +**ContractHName** | Pointer to **string** | The contract name as HName (Hex) | [optional] +**ContractName** | Pointer to **string** | The contract name | [optional] +**FunctionHName** | Pointer to **string** | The function name as HName (Hex) | [optional] +**FunctionName** | Pointer to **string** | The function name | [optional] + +## Methods + +### NewContractCallViewRequest + +`func NewContractCallViewRequest() *ContractCallViewRequest` + +NewContractCallViewRequest instantiates a new ContractCallViewRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewContractCallViewRequestWithDefaults + +`func NewContractCallViewRequestWithDefaults() *ContractCallViewRequest` + +NewContractCallViewRequestWithDefaults instantiates a new ContractCallViewRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArguments + +`func (o *ContractCallViewRequest) GetArguments() JSONDict` + +GetArguments returns the Arguments field if non-nil, zero value otherwise. + +### GetArgumentsOk + +`func (o *ContractCallViewRequest) GetArgumentsOk() (*JSONDict, bool)` + +GetArgumentsOk returns a tuple with the Arguments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArguments + +`func (o *ContractCallViewRequest) SetArguments(v JSONDict)` + +SetArguments sets Arguments field to given value. + +### HasArguments + +`func (o *ContractCallViewRequest) HasArguments() bool` + +HasArguments returns a boolean if a field has been set. + +### GetChainId + +`func (o *ContractCallViewRequest) GetChainId() string` + +GetChainId returns the ChainId field if non-nil, zero value otherwise. + +### GetChainIdOk + +`func (o *ContractCallViewRequest) GetChainIdOk() (*string, bool)` + +GetChainIdOk returns a tuple with the ChainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainId + +`func (o *ContractCallViewRequest) SetChainId(v string)` + +SetChainId sets ChainId field to given value. + +### HasChainId + +`func (o *ContractCallViewRequest) HasChainId() bool` + +HasChainId returns a boolean if a field has been set. + +### GetContractHName + +`func (o *ContractCallViewRequest) GetContractHName() string` + +GetContractHName returns the ContractHName field if non-nil, zero value otherwise. + +### GetContractHNameOk + +`func (o *ContractCallViewRequest) GetContractHNameOk() (*string, bool)` + +GetContractHNameOk returns a tuple with the ContractHName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractHName + +`func (o *ContractCallViewRequest) SetContractHName(v string)` + +SetContractHName sets ContractHName field to given value. + +### HasContractHName + +`func (o *ContractCallViewRequest) HasContractHName() bool` + +HasContractHName returns a boolean if a field has been set. + +### GetContractName + +`func (o *ContractCallViewRequest) GetContractName() string` + +GetContractName returns the ContractName field if non-nil, zero value otherwise. + +### GetContractNameOk + +`func (o *ContractCallViewRequest) GetContractNameOk() (*string, bool)` + +GetContractNameOk returns a tuple with the ContractName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractName + +`func (o *ContractCallViewRequest) SetContractName(v string)` + +SetContractName sets ContractName field to given value. + +### HasContractName + +`func (o *ContractCallViewRequest) HasContractName() bool` + +HasContractName returns a boolean if a field has been set. + +### GetFunctionHName + +`func (o *ContractCallViewRequest) GetFunctionHName() string` + +GetFunctionHName returns the FunctionHName field if non-nil, zero value otherwise. + +### GetFunctionHNameOk + +`func (o *ContractCallViewRequest) GetFunctionHNameOk() (*string, bool)` + +GetFunctionHNameOk returns a tuple with the FunctionHName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFunctionHName + +`func (o *ContractCallViewRequest) SetFunctionHName(v string)` + +SetFunctionHName sets FunctionHName field to given value. + +### HasFunctionHName + +`func (o *ContractCallViewRequest) HasFunctionHName() bool` + +HasFunctionHName returns a boolean if a field has been set. + +### GetFunctionName + +`func (o *ContractCallViewRequest) GetFunctionName() string` + +GetFunctionName returns the FunctionName field if non-nil, zero value otherwise. + +### GetFunctionNameOk + +`func (o *ContractCallViewRequest) GetFunctionNameOk() (*string, bool)` + +GetFunctionNameOk returns a tuple with the FunctionName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFunctionName + +`func (o *ContractCallViewRequest) SetFunctionName(v string)` + +SetFunctionName sets FunctionName field to given value. + +### HasFunctionName + +`func (o *ContractCallViewRequest) HasFunctionName() bool` + +HasFunctionName returns a boolean if a field has been set. + + +[[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/client/docs/ContractInfoResponse.md b/client/docs/ContractInfoResponse.md new file mode 100644 index 0000000000..5198c20239 --- /dev/null +++ b/client/docs/ContractInfoResponse.md @@ -0,0 +1,134 @@ +# ContractInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | The description of the contract. | [optional] +**HName** | Pointer to **string** | The id (HName as Hex)) of the contract. | [optional] +**Name** | Pointer to **string** | The name of the contract. | [optional] +**ProgramHash** | Pointer to **[]int32** | The hash of the contract. | [optional] + +## Methods + +### NewContractInfoResponse + +`func NewContractInfoResponse() *ContractInfoResponse` + +NewContractInfoResponse instantiates a new ContractInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewContractInfoResponseWithDefaults + +`func NewContractInfoResponseWithDefaults() *ContractInfoResponse` + +NewContractInfoResponseWithDefaults instantiates a new ContractInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *ContractInfoResponse) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *ContractInfoResponse) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *ContractInfoResponse) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *ContractInfoResponse) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetHName + +`func (o *ContractInfoResponse) GetHName() string` + +GetHName returns the HName field if non-nil, zero value otherwise. + +### GetHNameOk + +`func (o *ContractInfoResponse) GetHNameOk() (*string, bool)` + +GetHNameOk returns a tuple with the HName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHName + +`func (o *ContractInfoResponse) SetHName(v string)` + +SetHName sets HName field to given value. + +### HasHName + +`func (o *ContractInfoResponse) HasHName() bool` + +HasHName returns a boolean if a field has been set. + +### GetName + +`func (o *ContractInfoResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ContractInfoResponse) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ContractInfoResponse) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ContractInfoResponse) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetProgramHash + +`func (o *ContractInfoResponse) GetProgramHash() []int32` + +GetProgramHash returns the ProgramHash field if non-nil, zero value otherwise. + +### GetProgramHashOk + +`func (o *ContractInfoResponse) GetProgramHashOk() (*[]int32, bool)` + +GetProgramHashOk returns a tuple with the ProgramHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProgramHash + +`func (o *ContractInfoResponse) SetProgramHash(v []int32)` + +SetProgramHash sets ProgramHash field to given value. + +### HasProgramHash + +`func (o *ContractInfoResponse) HasProgramHash() bool` + +HasProgramHash returns a boolean if a field has been set. + + +[[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/client/docs/ControlAddressesResponse.md b/client/docs/ControlAddressesResponse.md new file mode 100644 index 0000000000..cc5c78e2ee --- /dev/null +++ b/client/docs/ControlAddressesResponse.md @@ -0,0 +1,108 @@ +# ControlAddressesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GoverningAddress** | Pointer to **string** | | [optional] +**SinceBlockIndex** | Pointer to **int32** | | [optional] +**StateAddress** | Pointer to **string** | | [optional] + +## Methods + +### NewControlAddressesResponse + +`func NewControlAddressesResponse() *ControlAddressesResponse` + +NewControlAddressesResponse instantiates a new ControlAddressesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewControlAddressesResponseWithDefaults + +`func NewControlAddressesResponseWithDefaults() *ControlAddressesResponse` + +NewControlAddressesResponseWithDefaults instantiates a new ControlAddressesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGoverningAddress + +`func (o *ControlAddressesResponse) GetGoverningAddress() string` + +GetGoverningAddress returns the GoverningAddress field if non-nil, zero value otherwise. + +### GetGoverningAddressOk + +`func (o *ControlAddressesResponse) GetGoverningAddressOk() (*string, bool)` + +GetGoverningAddressOk returns a tuple with the GoverningAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGoverningAddress + +`func (o *ControlAddressesResponse) SetGoverningAddress(v string)` + +SetGoverningAddress sets GoverningAddress field to given value. + +### HasGoverningAddress + +`func (o *ControlAddressesResponse) HasGoverningAddress() bool` + +HasGoverningAddress returns a boolean if a field has been set. + +### GetSinceBlockIndex + +`func (o *ControlAddressesResponse) GetSinceBlockIndex() int32` + +GetSinceBlockIndex returns the SinceBlockIndex field if non-nil, zero value otherwise. + +### GetSinceBlockIndexOk + +`func (o *ControlAddressesResponse) GetSinceBlockIndexOk() (*int32, bool)` + +GetSinceBlockIndexOk returns a tuple with the SinceBlockIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSinceBlockIndex + +`func (o *ControlAddressesResponse) SetSinceBlockIndex(v int32)` + +SetSinceBlockIndex sets SinceBlockIndex field to given value. + +### HasSinceBlockIndex + +`func (o *ControlAddressesResponse) HasSinceBlockIndex() bool` + +HasSinceBlockIndex returns a boolean if a field has been set. + +### GetStateAddress + +`func (o *ControlAddressesResponse) GetStateAddress() string` + +GetStateAddress returns the StateAddress field if non-nil, zero value otherwise. + +### GetStateAddressOk + +`func (o *ControlAddressesResponse) GetStateAddressOk() (*string, bool)` + +GetStateAddressOk returns a tuple with the StateAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateAddress + +`func (o *ControlAddressesResponse) SetStateAddress(v string)` + +SetStateAddress sets StateAddress field to given value. + +### HasStateAddress + +`func (o *ControlAddressesResponse) HasStateAddress() bool` + +HasStateAddress returns a boolean if a field has been set. + + +[[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/client/docs/CorecontractsApi.md b/client/docs/CorecontractsApi.md new file mode 100644 index 0000000000..d8d7bdfee7 --- /dev/null +++ b/client/docs/CorecontractsApi.md @@ -0,0 +1,1858 @@ +# \CorecontractsApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /v2/chains/{chainID}/core/accounts | Get a list of all accounts +[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /v2/chains/{chainID}/core/accounts/foundry_output | Get the foundry output +[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /v2/chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /v2/chains/{chainID}/core/accounts/token_registry | Get a list of all registries +[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /v2/chains/{chainID}/core/accounts/total_assets | Get all stored assets +[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /v2/chains/{chainID}/core/blobs | Get all stored blobs +[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /v2/chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /v2/chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2/chains/{chainID}/core/governance/chaininfo | Get the chain info + + + +## AccountsGetAccountBalance + +> AssetsResponse AccountsGetAccountBalance(ctx, chainID, agentID).Execute() + +Get all assets belonging to an account + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + agentID := "agentID_example" // string | AgentID (Bech32 for WasmVM | Hex for EVM) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID, agentID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetAccountBalance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetAccountBalance`: AssetsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetAccountBalance`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**agentID** | **string** | AgentID (Bech32 for WasmVM | Hex for EVM) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetAccountBalanceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**AssetsResponse**](AssetsResponse.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) + + +## AccountsGetAccountNFTIDs + +> AccountNFTsResponse AccountsGetAccountNFTIDs(ctx, chainID, agentID).Execute() + +Get all NFT ids belonging to an account + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + agentID := "agentID_example" // string | AgentID (Bech32 for WasmVM | Hex for EVM) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetAccountNFTIDs(context.Background(), chainID, agentID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetAccountNFTIDs``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetAccountNFTIDs`: AccountNFTsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetAccountNFTIDs`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**agentID** | **string** | AgentID (Bech32 for WasmVM | Hex for EVM) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetAccountNFTIDsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**AccountNFTsResponse**](AccountNFTsResponse.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) + + +## AccountsGetAccountNonce + +> AccountNonceResponse AccountsGetAccountNonce(ctx, chainID, agentID).Execute() + +Get the current nonce of an account + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + agentID := "agentID_example" // string | AgentID (Bech32 for WasmVM | Hex for EVM | '000000@Bech32' Addresses require urlencode) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetAccountNonce(context.Background(), chainID, agentID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetAccountNonce``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetAccountNonce`: AccountNonceResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetAccountNonce`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**agentID** | **string** | AgentID (Bech32 for WasmVM | Hex for EVM | '000000@Bech32' Addresses require urlencode) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetAccountNonceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**AccountNonceResponse**](AccountNonceResponse.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) + + +## AccountsGetAccounts + +> AccountListResponse AccountsGetAccounts(ctx, chainID).Execute() + +Get a list of all accounts + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetAccounts``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetAccounts`: AccountListResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetAccounts`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetAccountsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**AccountListResponse**](AccountListResponse.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) + + +## AccountsGetFoundryOutput + +> FoundryOutputResponse AccountsGetFoundryOutput(ctx, chainID, chainID2).Execute() + +Get the foundry output + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + chainID2 := "chainID_example" // string | Serial Number (uint32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, chainID2).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetFoundryOutput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetFoundryOutput`: FoundryOutputResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetFoundryOutput`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**chainID2** | **string** | Serial Number (uint32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetFoundryOutputRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**FoundryOutputResponse**](FoundryOutputResponse.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) + + +## AccountsGetNFTData + +> NFTDataResponse AccountsGetNFTData(ctx, chainID, nftID).Execute() + +Get the NFT data by an ID + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + nftID := "nftID_example" // string | NFT ID (Hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetNFTData(context.Background(), chainID, nftID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetNFTData``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetNFTData`: NFTDataResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetNFTData`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**nftID** | **string** | NFT ID (Hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetNFTDataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**NFTDataResponse**](NFTDataResponse.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) + + +## AccountsGetNativeTokenIDRegistry + +> NativeTokenIDRegistryResponse AccountsGetNativeTokenIDRegistry(ctx, chainID).Execute() + +Get a list of all registries + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetNativeTokenIDRegistry(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetNativeTokenIDRegistry``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetNativeTokenIDRegistry`: NativeTokenIDRegistryResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetNativeTokenIDRegistry`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetNativeTokenIDRegistryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**NativeTokenIDRegistryResponse**](NativeTokenIDRegistryResponse.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) + + +## AccountsGetTotalAssets + +> AssetsResponse AccountsGetTotalAssets(ctx, chainID).Execute() + +Get all stored assets + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.AccountsGetTotalAssets(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetTotalAssets``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AccountsGetTotalAssets`: AssetsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.AccountsGetTotalAssets`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAccountsGetTotalAssetsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**AssetsResponse**](AssetsResponse.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) + + +## BlobsGetAllBlobs + +> BlobListResponse BlobsGetAllBlobs(ctx, chainID).Execute() + +Get all stored blobs + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlobsGetAllBlobs(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlobsGetAllBlobs``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlobsGetAllBlobs`: BlobListResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlobsGetAllBlobs`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlobsGetAllBlobsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**BlobListResponse**](BlobListResponse.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) + + +## BlobsGetBlobInfo + +> BlobInfoResponse BlobsGetBlobInfo(ctx, chainID, blobHash).Execute() + +Get all fields of a blob + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + blobHash := "blobHash_example" // string | BlobHash (Hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlobsGetBlobInfo(context.Background(), chainID, blobHash).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlobsGetBlobInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlobsGetBlobInfo`: BlobInfoResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlobsGetBlobInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**blobHash** | **string** | BlobHash (Hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlobsGetBlobInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**BlobInfoResponse**](BlobInfoResponse.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) + + +## BlobsGetBlobValue + +> BlobValueResponse BlobsGetBlobValue(ctx, chainID, blobHash, fieldKey).Execute() + +Get the value of the supplied field (key) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + blobHash := "blobHash_example" // string | BlobHash (Hex) + fieldKey := "fieldKey_example" // string | FieldKey (String) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlobsGetBlobValue(context.Background(), chainID, blobHash, fieldKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlobsGetBlobValue``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlobsGetBlobValue`: BlobValueResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlobsGetBlobValue`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**blobHash** | **string** | BlobHash (Hex) | +**fieldKey** | **string** | FieldKey (String) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlobsGetBlobValueRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**BlobValueResponse**](BlobValueResponse.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) + + +## BlocklogGetBlockInfo + +> BlockInfoResponse BlocklogGetBlockInfo(ctx, chainID, blockIndex).Execute() + +Get the block info of a certain block index + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + blockIndex := int32(56) // int32 | Block Index (uint32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetBlockInfo(context.Background(), chainID, blockIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetBlockInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetBlockInfo`: BlockInfoResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetBlockInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**blockIndex** | **int32** | Block Index (uint32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetBlockInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**BlockInfoResponse**](BlockInfoResponse.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) + + +## BlocklogGetControlAddresses + +> ControlAddressesResponse BlocklogGetControlAddresses(ctx, chainID).Execute() + +Get the control addresses + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetControlAddresses(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetControlAddresses``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetControlAddresses`: ControlAddressesResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetControlAddresses`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetControlAddressesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ControlAddressesResponse**](ControlAddressesResponse.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) + + +## BlocklogGetEventsOfBlock + +> EventsResponse BlocklogGetEventsOfBlock(ctx, chainID, blockIndex).Execute() + +Get events of a block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + blockIndex := int32(56) // int32 | Block Index (uint32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetEventsOfBlock(context.Background(), chainID, blockIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetEventsOfBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetEventsOfBlock`: EventsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetEventsOfBlock`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**blockIndex** | **int32** | Block Index (uint32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetEventsOfBlockRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**EventsResponse**](EventsResponse.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) + + +## BlocklogGetEventsOfContract + +> EventsResponse BlocklogGetEventsOfContract(ctx, chainID, contractHname).Execute() + +Get events of a contract + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + contractHname := "contractHname_example" // string | Contract (Hname) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetEventsOfContract(context.Background(), chainID, contractHname).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetEventsOfContract``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetEventsOfContract`: EventsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetEventsOfContract`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**contractHname** | **string** | Contract (Hname) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetEventsOfContractRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**EventsResponse**](EventsResponse.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) + + +## BlocklogGetEventsOfLatestBlock + +> EventsResponse BlocklogGetEventsOfLatestBlock(ctx, chainID).Execute() + +Get events of the latest block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetEventsOfLatestBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetEventsOfLatestBlock`: EventsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetEventsOfLatestBlock`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetEventsOfLatestBlockRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**EventsResponse**](EventsResponse.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) + + +## BlocklogGetEventsOfRequest + +> EventsResponse BlocklogGetEventsOfRequest(ctx, chainID, requestID).Execute() + +Get events of a request + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + requestID := "requestID_example" // string | Request ID (ISCRequestID) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetEventsOfRequest(context.Background(), chainID, requestID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetEventsOfRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetEventsOfRequest`: EventsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetEventsOfRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**requestID** | **string** | Request ID (ISCRequestID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetEventsOfRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**EventsResponse**](EventsResponse.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) + + +## BlocklogGetLatestBlockInfo + +> BlockInfoResponse BlocklogGetLatestBlockInfo(ctx, chainID).Execute() + +Get the block info of the latest block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetLatestBlockInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetLatestBlockInfo`: BlockInfoResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetLatestBlockInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetLatestBlockInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**BlockInfoResponse**](BlockInfoResponse.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) + + +## BlocklogGetRequestIDsForBlock + +> RequestIDsResponse BlocklogGetRequestIDsForBlock(ctx, chainID, blockIndex).Execute() + +Get the request ids for a certain block index + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + blockIndex := int32(56) // int32 | Block Index (uint32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForBlock(context.Background(), chainID, blockIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetRequestIDsForBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetRequestIDsForBlock`: RequestIDsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetRequestIDsForBlock`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**blockIndex** | **int32** | Block Index (uint32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetRequestIDsForBlockRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**RequestIDsResponse**](RequestIDsResponse.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) + + +## BlocklogGetRequestIDsForLatestBlock + +> RequestIDsResponse BlocklogGetRequestIDsForLatestBlock(ctx, chainID).Execute() + +Get the request ids for the latest block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForLatestBlock(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetRequestIDsForLatestBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetRequestIDsForLatestBlock`: RequestIDsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetRequestIDsForLatestBlock`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetRequestIDsForLatestBlockRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**RequestIDsResponse**](RequestIDsResponse.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) + + +## BlocklogGetRequestIsProcessed + +> RequestProcessedResponse BlocklogGetRequestIsProcessed(ctx, chainID, requestID).Execute() + +Get the request processing status + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + requestID := "requestID_example" // string | Request ID (ISCRequestID) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetRequestIsProcessed(context.Background(), chainID, requestID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetRequestIsProcessed``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetRequestIsProcessed`: RequestProcessedResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetRequestIsProcessed`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**requestID** | **string** | Request ID (ISCRequestID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetRequestIsProcessedRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**RequestProcessedResponse**](RequestProcessedResponse.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) + + +## BlocklogGetRequestReceipt + +> RequestReceiptResponse BlocklogGetRequestReceipt(ctx, chainID, requestID).Execute() + +Get the receipt of a certain request id + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + requestID := "requestID_example" // string | Request ID (ISCRequestID) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetRequestReceipt(context.Background(), chainID, requestID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetRequestReceipt``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetRequestReceipt`: RequestReceiptResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetRequestReceipt`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**requestID** | **string** | Request ID (ISCRequestID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetRequestReceiptRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**RequestReceiptResponse**](RequestReceiptResponse.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) + + +## BlocklogGetRequestReceiptsOfBlock + +> BlockReceiptsResponse BlocklogGetRequestReceiptsOfBlock(ctx, chainID, blockIndex).Execute() + +Get all receipts of a certain block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + blockIndex := int32(56) // int32 | Block Index (uint32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), chainID, blockIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetRequestReceiptsOfBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetRequestReceiptsOfBlock`: BlockReceiptsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetRequestReceiptsOfBlock`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**blockIndex** | **int32** | Block Index (uint32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetRequestReceiptsOfBlockRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**BlockReceiptsResponse**](BlockReceiptsResponse.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) + + +## BlocklogGetRequestReceiptsOfLatestBlock + +> BlockReceiptsResponse BlocklogGetRequestReceiptsOfLatestBlock(ctx, chainID).Execute() + +Get all receipts of the latest block + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BlocklogGetRequestReceiptsOfLatestBlock`: BlockReceiptsResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBlocklogGetRequestReceiptsOfLatestBlockRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**BlockReceiptsResponse**](BlockReceiptsResponse.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) + + +## ErrorsGetErrorMessageFormat + +> ErrorMessageFormatResponse ErrorsGetErrorMessageFormat(ctx, chainID, contractHname, errorID).Execute() + +Get the error message format of a specific error id + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + contractHname := "contractHname_example" // string | Contract (Hname as Hex) + errorID := "errorID_example" // string | Error Id (uint16) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.ErrorsGetErrorMessageFormat(context.Background(), chainID, contractHname, errorID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.ErrorsGetErrorMessageFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ErrorsGetErrorMessageFormat`: ErrorMessageFormatResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.ErrorsGetErrorMessageFormat`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**contractHname** | **string** | Contract (Hname as Hex) | +**errorID** | **string** | Error Id (uint16) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiErrorsGetErrorMessageFormatRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**ErrorMessageFormatResponse**](ErrorMessageFormatResponse.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) + + +## GovernanceGetChainInfo + +> GovChainInfoResponse GovernanceGetChainInfo(ctx, chainID).Execute() + +Get the chain info + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.GovernanceGetChainInfo(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.GovernanceGetChainInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GovernanceGetChainInfo`: GovChainInfoResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.GovernanceGetChainInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGovernanceGetChainInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**GovChainInfoResponse**](GovChainInfoResponse.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/client/docs/DKSharesInfo.md b/client/docs/DKSharesInfo.md new file mode 100644 index 0000000000..e3835ee767 --- /dev/null +++ b/client/docs/DKSharesInfo.md @@ -0,0 +1,186 @@ +# DKSharesInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to **string** | New generated shared address. | [optional] +**PeerIdentities** | Pointer to **[]string** | Identities of the nodes sharing the key. (Hex) | [optional] +**PeerIndex** | Pointer to **int32** | | [optional] +**PublicKey** | Pointer to **string** | Used public key. (Hex) | [optional] +**PublicKeyShares** | Pointer to **[]string** | Public key shares for all the peers. (Hex) | [optional] +**Threshold** | Pointer to **int32** | | [optional] + +## Methods + +### NewDKSharesInfo + +`func NewDKSharesInfo() *DKSharesInfo` + +NewDKSharesInfo instantiates a new DKSharesInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDKSharesInfoWithDefaults + +`func NewDKSharesInfoWithDefaults() *DKSharesInfo` + +NewDKSharesInfoWithDefaults instantiates a new DKSharesInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *DKSharesInfo) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *DKSharesInfo) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *DKSharesInfo) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *DKSharesInfo) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetPeerIdentities + +`func (o *DKSharesInfo) GetPeerIdentities() []string` + +GetPeerIdentities returns the PeerIdentities field if non-nil, zero value otherwise. + +### GetPeerIdentitiesOk + +`func (o *DKSharesInfo) GetPeerIdentitiesOk() (*[]string, bool)` + +GetPeerIdentitiesOk returns a tuple with the PeerIdentities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerIdentities + +`func (o *DKSharesInfo) SetPeerIdentities(v []string)` + +SetPeerIdentities sets PeerIdentities field to given value. + +### HasPeerIdentities + +`func (o *DKSharesInfo) HasPeerIdentities() bool` + +HasPeerIdentities returns a boolean if a field has been set. + +### GetPeerIndex + +`func (o *DKSharesInfo) GetPeerIndex() int32` + +GetPeerIndex returns the PeerIndex field if non-nil, zero value otherwise. + +### GetPeerIndexOk + +`func (o *DKSharesInfo) GetPeerIndexOk() (*int32, bool)` + +GetPeerIndexOk returns a tuple with the PeerIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerIndex + +`func (o *DKSharesInfo) SetPeerIndex(v int32)` + +SetPeerIndex sets PeerIndex field to given value. + +### HasPeerIndex + +`func (o *DKSharesInfo) HasPeerIndex() bool` + +HasPeerIndex returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *DKSharesInfo) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *DKSharesInfo) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *DKSharesInfo) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *DKSharesInfo) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + +### GetPublicKeyShares + +`func (o *DKSharesInfo) GetPublicKeyShares() []string` + +GetPublicKeyShares returns the PublicKeyShares field if non-nil, zero value otherwise. + +### GetPublicKeySharesOk + +`func (o *DKSharesInfo) GetPublicKeySharesOk() (*[]string, bool)` + +GetPublicKeySharesOk returns a tuple with the PublicKeyShares field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKeyShares + +`func (o *DKSharesInfo) SetPublicKeyShares(v []string)` + +SetPublicKeyShares sets PublicKeyShares field to given value. + +### HasPublicKeyShares + +`func (o *DKSharesInfo) HasPublicKeyShares() bool` + +HasPublicKeyShares returns a boolean if a field has been set. + +### GetThreshold + +`func (o *DKSharesInfo) GetThreshold() int32` + +GetThreshold returns the Threshold field if non-nil, zero value otherwise. + +### GetThresholdOk + +`func (o *DKSharesInfo) GetThresholdOk() (*int32, bool)` + +GetThresholdOk returns a tuple with the Threshold field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreshold + +`func (o *DKSharesInfo) SetThreshold(v int32)` + +SetThreshold sets Threshold field to given value. + +### HasThreshold + +`func (o *DKSharesInfo) HasThreshold() bool` + +HasThreshold returns a boolean if a field has been set. + + +[[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/client/docs/DKSharesPostRequest.md b/client/docs/DKSharesPostRequest.md new file mode 100644 index 0000000000..cea858afff --- /dev/null +++ b/client/docs/DKSharesPostRequest.md @@ -0,0 +1,108 @@ +# DKSharesPostRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PeerIdentities** | Pointer to **[]string** | | [optional] +**Threshold** | Pointer to **int32** | Should be =< len(PeerPublicIdentities) | [optional] +**TimeoutMS** | Pointer to **int32** | Timeout in milliseconds. | [optional] + +## Methods + +### NewDKSharesPostRequest + +`func NewDKSharesPostRequest() *DKSharesPostRequest` + +NewDKSharesPostRequest instantiates a new DKSharesPostRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDKSharesPostRequestWithDefaults + +`func NewDKSharesPostRequestWithDefaults() *DKSharesPostRequest` + +NewDKSharesPostRequestWithDefaults instantiates a new DKSharesPostRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPeerIdentities + +`func (o *DKSharesPostRequest) GetPeerIdentities() []string` + +GetPeerIdentities returns the PeerIdentities field if non-nil, zero value otherwise. + +### GetPeerIdentitiesOk + +`func (o *DKSharesPostRequest) GetPeerIdentitiesOk() (*[]string, bool)` + +GetPeerIdentitiesOk returns a tuple with the PeerIdentities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerIdentities + +`func (o *DKSharesPostRequest) SetPeerIdentities(v []string)` + +SetPeerIdentities sets PeerIdentities field to given value. + +### HasPeerIdentities + +`func (o *DKSharesPostRequest) HasPeerIdentities() bool` + +HasPeerIdentities returns a boolean if a field has been set. + +### GetThreshold + +`func (o *DKSharesPostRequest) GetThreshold() int32` + +GetThreshold returns the Threshold field if non-nil, zero value otherwise. + +### GetThresholdOk + +`func (o *DKSharesPostRequest) GetThresholdOk() (*int32, bool)` + +GetThresholdOk returns a tuple with the Threshold field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreshold + +`func (o *DKSharesPostRequest) SetThreshold(v int32)` + +SetThreshold sets Threshold field to given value. + +### HasThreshold + +`func (o *DKSharesPostRequest) HasThreshold() bool` + +HasThreshold returns a boolean if a field has been set. + +### GetTimeoutMS + +`func (o *DKSharesPostRequest) GetTimeoutMS() int32` + +GetTimeoutMS returns the TimeoutMS field if non-nil, zero value otherwise. + +### GetTimeoutMSOk + +`func (o *DKSharesPostRequest) GetTimeoutMSOk() (*int32, bool)` + +GetTimeoutMSOk returns a tuple with the TimeoutMS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeoutMS + +`func (o *DKSharesPostRequest) SetTimeoutMS(v int32)` + +SetTimeoutMS sets TimeoutMS field to given value. + +### HasTimeoutMS + +`func (o *DKSharesPostRequest) HasTimeoutMS() bool` + +HasTimeoutMS returns a boolean if a field has been set. + + +[[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/client/docs/ErrorMessageFormatResponse.md b/client/docs/ErrorMessageFormatResponse.md new file mode 100644 index 0000000000..20e81b815b --- /dev/null +++ b/client/docs/ErrorMessageFormatResponse.md @@ -0,0 +1,56 @@ +# ErrorMessageFormatResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MessageFormat** | Pointer to **string** | | [optional] + +## Methods + +### NewErrorMessageFormatResponse + +`func NewErrorMessageFormatResponse() *ErrorMessageFormatResponse` + +NewErrorMessageFormatResponse instantiates a new ErrorMessageFormatResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorMessageFormatResponseWithDefaults + +`func NewErrorMessageFormatResponseWithDefaults() *ErrorMessageFormatResponse` + +NewErrorMessageFormatResponseWithDefaults instantiates a new ErrorMessageFormatResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMessageFormat + +`func (o *ErrorMessageFormatResponse) GetMessageFormat() string` + +GetMessageFormat returns the MessageFormat field if non-nil, zero value otherwise. + +### GetMessageFormatOk + +`func (o *ErrorMessageFormatResponse) GetMessageFormatOk() (*string, bool)` + +GetMessageFormatOk returns a tuple with the MessageFormat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessageFormat + +`func (o *ErrorMessageFormatResponse) SetMessageFormat(v string)` + +SetMessageFormat sets MessageFormat field to given value. + +### HasMessageFormat + +`func (o *ErrorMessageFormatResponse) HasMessageFormat() bool` + +HasMessageFormat returns a boolean if a field has been set. + + +[[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/client/docs/EventsResponse.md b/client/docs/EventsResponse.md new file mode 100644 index 0000000000..66ab8b0962 --- /dev/null +++ b/client/docs/EventsResponse.md @@ -0,0 +1,56 @@ +# EventsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Events** | Pointer to **[]string** | | [optional] + +## Methods + +### NewEventsResponse + +`func NewEventsResponse() *EventsResponse` + +NewEventsResponse instantiates a new EventsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEventsResponseWithDefaults + +`func NewEventsResponseWithDefaults() *EventsResponse` + +NewEventsResponseWithDefaults instantiates a new EventsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEvents + +`func (o *EventsResponse) GetEvents() []string` + +GetEvents returns the Events field if non-nil, zero value otherwise. + +### GetEventsOk + +`func (o *EventsResponse) GetEventsOk() (*[]string, bool)` + +GetEventsOk returns a tuple with the Events field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvents + +`func (o *EventsResponse) SetEvents(v []string)` + +SetEvents sets Events field to given value. + +### HasEvents + +`func (o *EventsResponse) HasEvents() bool` + +HasEvents returns a boolean if a field has been set. + + +[[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/client/docs/FoundryOutputResponse.md b/client/docs/FoundryOutputResponse.md new file mode 100644 index 0000000000..2660450f5a --- /dev/null +++ b/client/docs/FoundryOutputResponse.md @@ -0,0 +1,82 @@ +# FoundryOutputResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Assets** | Pointer to [**AssetsResponse**](AssetsResponse.md) | | [optional] +**FoundryId** | Pointer to **string** | | [optional] + +## Methods + +### NewFoundryOutputResponse + +`func NewFoundryOutputResponse() *FoundryOutputResponse` + +NewFoundryOutputResponse instantiates a new FoundryOutputResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFoundryOutputResponseWithDefaults + +`func NewFoundryOutputResponseWithDefaults() *FoundryOutputResponse` + +NewFoundryOutputResponseWithDefaults instantiates a new FoundryOutputResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAssets + +`func (o *FoundryOutputResponse) GetAssets() AssetsResponse` + +GetAssets returns the Assets field if non-nil, zero value otherwise. + +### GetAssetsOk + +`func (o *FoundryOutputResponse) GetAssetsOk() (*AssetsResponse, bool)` + +GetAssetsOk returns a tuple with the Assets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssets + +`func (o *FoundryOutputResponse) SetAssets(v AssetsResponse)` + +SetAssets sets Assets field to given value. + +### HasAssets + +`func (o *FoundryOutputResponse) HasAssets() bool` + +HasAssets returns a boolean if a field has been set. + +### GetFoundryId + +`func (o *FoundryOutputResponse) GetFoundryId() string` + +GetFoundryId returns the FoundryId field if non-nil, zero value otherwise. + +### GetFoundryIdOk + +`func (o *FoundryOutputResponse) GetFoundryIdOk() (*string, bool)` + +GetFoundryIdOk returns a tuple with the FoundryId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFoundryId + +`func (o *FoundryOutputResponse) SetFoundryId(v string)` + +SetFoundryId sets FoundryId field to given value. + +### HasFoundryId + +`func (o *FoundryOutputResponse) HasFoundryId() bool` + +HasFoundryId returns a boolean if a field has been set. + + +[[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/client/docs/FungibleTokens.md b/client/docs/FungibleTokens.md new file mode 100644 index 0000000000..2f585b3385 --- /dev/null +++ b/client/docs/FungibleTokens.md @@ -0,0 +1,82 @@ +# FungibleTokens + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BaseTokens** | Pointer to **int64** | | [optional] +**NativeTokens** | Pointer to [**[]NativeToken**](NativeToken.md) | | [optional] + +## Methods + +### NewFungibleTokens + +`func NewFungibleTokens() *FungibleTokens` + +NewFungibleTokens instantiates a new FungibleTokens object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFungibleTokensWithDefaults + +`func NewFungibleTokensWithDefaults() *FungibleTokens` + +NewFungibleTokensWithDefaults instantiates a new FungibleTokens object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBaseTokens + +`func (o *FungibleTokens) GetBaseTokens() int64` + +GetBaseTokens returns the BaseTokens field if non-nil, zero value otherwise. + +### GetBaseTokensOk + +`func (o *FungibleTokens) GetBaseTokensOk() (*int64, bool)` + +GetBaseTokensOk returns a tuple with the BaseTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseTokens + +`func (o *FungibleTokens) SetBaseTokens(v int64)` + +SetBaseTokens sets BaseTokens field to given value. + +### HasBaseTokens + +`func (o *FungibleTokens) HasBaseTokens() bool` + +HasBaseTokens returns a boolean if a field has been set. + +### GetNativeTokens + +`func (o *FungibleTokens) GetNativeTokens() []NativeToken` + +GetNativeTokens returns the NativeTokens field if non-nil, zero value otherwise. + +### GetNativeTokensOk + +`func (o *FungibleTokens) GetNativeTokensOk() (*[]NativeToken, bool)` + +GetNativeTokensOk returns a tuple with the NativeTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNativeTokens + +`func (o *FungibleTokens) SetNativeTokens(v []NativeToken)` + +SetNativeTokens sets NativeTokens field to given value. + +### HasNativeTokens + +`func (o *FungibleTokens) HasNativeTokens() bool` + +HasNativeTokens returns a boolean if a field has been set. + + +[[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/client/docs/GasFeePolicy.md b/client/docs/GasFeePolicy.md new file mode 100644 index 0000000000..67bc77b9fc --- /dev/null +++ b/client/docs/GasFeePolicy.md @@ -0,0 +1,108 @@ +# GasFeePolicy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GasFeeTokenId** | Pointer to **string** | The gas fee token id. Empty if base token. | [optional] +**GasPerToken** | Pointer to **int64** | The amount of gas per token. | [optional] +**ValidatorFeeShare** | Pointer to **int32** | The validator fee share. | [optional] + +## Methods + +### NewGasFeePolicy + +`func NewGasFeePolicy() *GasFeePolicy` + +NewGasFeePolicy instantiates a new GasFeePolicy object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGasFeePolicyWithDefaults + +`func NewGasFeePolicyWithDefaults() *GasFeePolicy` + +NewGasFeePolicyWithDefaults instantiates a new GasFeePolicy object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGasFeeTokenId + +`func (o *GasFeePolicy) GetGasFeeTokenId() string` + +GetGasFeeTokenId returns the GasFeeTokenId field if non-nil, zero value otherwise. + +### GetGasFeeTokenIdOk + +`func (o *GasFeePolicy) GetGasFeeTokenIdOk() (*string, bool)` + +GetGasFeeTokenIdOk returns a tuple with the GasFeeTokenId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasFeeTokenId + +`func (o *GasFeePolicy) SetGasFeeTokenId(v string)` + +SetGasFeeTokenId sets GasFeeTokenId field to given value. + +### HasGasFeeTokenId + +`func (o *GasFeePolicy) HasGasFeeTokenId() bool` + +HasGasFeeTokenId returns a boolean if a field has been set. + +### GetGasPerToken + +`func (o *GasFeePolicy) GetGasPerToken() int64` + +GetGasPerToken returns the GasPerToken field if non-nil, zero value otherwise. + +### GetGasPerTokenOk + +`func (o *GasFeePolicy) GetGasPerTokenOk() (*int64, bool)` + +GetGasPerTokenOk returns a tuple with the GasPerToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasPerToken + +`func (o *GasFeePolicy) SetGasPerToken(v int64)` + +SetGasPerToken sets GasPerToken field to given value. + +### HasGasPerToken + +`func (o *GasFeePolicy) HasGasPerToken() bool` + +HasGasPerToken returns a boolean if a field has been set. + +### GetValidatorFeeShare + +`func (o *GasFeePolicy) GetValidatorFeeShare() int32` + +GetValidatorFeeShare returns the ValidatorFeeShare field if non-nil, zero value otherwise. + +### GetValidatorFeeShareOk + +`func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool)` + +GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValidatorFeeShare + +`func (o *GasFeePolicy) SetValidatorFeeShare(v int32)` + +SetValidatorFeeShare sets ValidatorFeeShare field to given value. + +### HasValidatorFeeShare + +`func (o *GasFeePolicy) HasValidatorFeeShare() bool` + +HasValidatorFeeShare returns a boolean if a field has been set. + + +[[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/client/docs/GovChainInfoResponse.md b/client/docs/GovChainInfoResponse.md new file mode 100644 index 0000000000..08ba74347f --- /dev/null +++ b/client/docs/GovChainInfoResponse.md @@ -0,0 +1,212 @@ +# GovChainInfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ChainID** | Pointer to **string** | ChainID (Bech32-encoded). | [optional] +**ChainOwnerId** | Pointer to **string** | The chain owner address (Bech32-encoded). | [optional] +**Description** | Pointer to **string** | The description of the chain. | [optional] +**GasFeePolicy** | Pointer to [**GasFeePolicy**](GasFeePolicy.md) | | [optional] +**MaxBlobSize** | Pointer to **int32** | The maximum contract blob size. | [optional] +**MaxEventSize** | Pointer to **int32** | The maximum event size. | [optional] +**MaxEventsPerReq** | Pointer to **int32** | The maximum amount of events per request. | [optional] + +## Methods + +### NewGovChainInfoResponse + +`func NewGovChainInfoResponse() *GovChainInfoResponse` + +NewGovChainInfoResponse instantiates a new GovChainInfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGovChainInfoResponseWithDefaults + +`func NewGovChainInfoResponseWithDefaults() *GovChainInfoResponse` + +NewGovChainInfoResponseWithDefaults instantiates a new GovChainInfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChainID + +`func (o *GovChainInfoResponse) GetChainID() string` + +GetChainID returns the ChainID field if non-nil, zero value otherwise. + +### GetChainIDOk + +`func (o *GovChainInfoResponse) GetChainIDOk() (*string, bool)` + +GetChainIDOk returns a tuple with the ChainID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainID + +`func (o *GovChainInfoResponse) SetChainID(v string)` + +SetChainID sets ChainID field to given value. + +### HasChainID + +`func (o *GovChainInfoResponse) HasChainID() bool` + +HasChainID returns a boolean if a field has been set. + +### GetChainOwnerId + +`func (o *GovChainInfoResponse) GetChainOwnerId() string` + +GetChainOwnerId returns the ChainOwnerId field if non-nil, zero value otherwise. + +### GetChainOwnerIdOk + +`func (o *GovChainInfoResponse) GetChainOwnerIdOk() (*string, bool)` + +GetChainOwnerIdOk returns a tuple with the ChainOwnerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainOwnerId + +`func (o *GovChainInfoResponse) SetChainOwnerId(v string)` + +SetChainOwnerId sets ChainOwnerId field to given value. + +### HasChainOwnerId + +`func (o *GovChainInfoResponse) HasChainOwnerId() bool` + +HasChainOwnerId returns a boolean if a field has been set. + +### GetDescription + +`func (o *GovChainInfoResponse) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GovChainInfoResponse) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GovChainInfoResponse) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GovChainInfoResponse) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetGasFeePolicy + +`func (o *GovChainInfoResponse) GetGasFeePolicy() GasFeePolicy` + +GetGasFeePolicy returns the GasFeePolicy field if non-nil, zero value otherwise. + +### GetGasFeePolicyOk + +`func (o *GovChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool)` + +GetGasFeePolicyOk returns a tuple with the GasFeePolicy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasFeePolicy + +`func (o *GovChainInfoResponse) SetGasFeePolicy(v GasFeePolicy)` + +SetGasFeePolicy sets GasFeePolicy field to given value. + +### HasGasFeePolicy + +`func (o *GovChainInfoResponse) HasGasFeePolicy() bool` + +HasGasFeePolicy returns a boolean if a field has been set. + +### GetMaxBlobSize + +`func (o *GovChainInfoResponse) GetMaxBlobSize() int32` + +GetMaxBlobSize returns the MaxBlobSize field if non-nil, zero value otherwise. + +### GetMaxBlobSizeOk + +`func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool)` + +GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxBlobSize + +`func (o *GovChainInfoResponse) SetMaxBlobSize(v int32)` + +SetMaxBlobSize sets MaxBlobSize field to given value. + +### HasMaxBlobSize + +`func (o *GovChainInfoResponse) HasMaxBlobSize() bool` + +HasMaxBlobSize returns a boolean if a field has been set. + +### GetMaxEventSize + +`func (o *GovChainInfoResponse) GetMaxEventSize() int32` + +GetMaxEventSize returns the MaxEventSize field if non-nil, zero value otherwise. + +### GetMaxEventSizeOk + +`func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool)` + +GetMaxEventSizeOk returns a tuple with the MaxEventSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxEventSize + +`func (o *GovChainInfoResponse) SetMaxEventSize(v int32)` + +SetMaxEventSize sets MaxEventSize field to given value. + +### HasMaxEventSize + +`func (o *GovChainInfoResponse) HasMaxEventSize() bool` + +HasMaxEventSize returns a boolean if a field has been set. + +### GetMaxEventsPerReq + +`func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32` + +GetMaxEventsPerReq returns the MaxEventsPerReq field if non-nil, zero value otherwise. + +### GetMaxEventsPerReqOk + +`func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool)` + +GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxEventsPerReq + +`func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32)` + +SetMaxEventsPerReq sets MaxEventsPerReq field to given value. + +### HasMaxEventsPerReq + +`func (o *GovChainInfoResponse) HasMaxEventsPerReq() bool` + +HasMaxEventsPerReq returns a boolean if a field has been set. + + +[[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/client/docs/InOutput.md b/client/docs/InOutput.md new file mode 100644 index 0000000000..ad85fb3f5a --- /dev/null +++ b/client/docs/InOutput.md @@ -0,0 +1,82 @@ +# InOutput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Output** | Pointer to [**Output**](Output.md) | | [optional] +**OutputId** | Pointer to **string** | The output ID | [optional] + +## Methods + +### NewInOutput + +`func NewInOutput() *InOutput` + +NewInOutput instantiates a new InOutput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInOutputWithDefaults + +`func NewInOutputWithDefaults() *InOutput` + +NewInOutputWithDefaults instantiates a new InOutput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOutput + +`func (o *InOutput) GetOutput() Output` + +GetOutput returns the Output field if non-nil, zero value otherwise. + +### GetOutputOk + +`func (o *InOutput) GetOutputOk() (*Output, bool)` + +GetOutputOk returns a tuple with the Output field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutput + +`func (o *InOutput) SetOutput(v Output)` + +SetOutput sets Output field to given value. + +### HasOutput + +`func (o *InOutput) HasOutput() bool` + +HasOutput returns a boolean if a field has been set. + +### GetOutputId + +`func (o *InOutput) GetOutputId() string` + +GetOutputId returns the OutputId field if non-nil, zero value otherwise. + +### GetOutputIdOk + +`func (o *InOutput) GetOutputIdOk() (*string, bool)` + +GetOutputIdOk returns a tuple with the OutputId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutputId + +`func (o *InOutput) SetOutputId(v string)` + +SetOutputId sets OutputId field to given value. + +### HasOutputId + +`func (o *InOutput) HasOutputId() bool` + +HasOutputId returns a boolean if a field has been set. + + +[[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/client/docs/InOutputMetricItem.md b/client/docs/InOutputMetricItem.md new file mode 100644 index 0000000000..8f20f099cb --- /dev/null +++ b/client/docs/InOutputMetricItem.md @@ -0,0 +1,108 @@ +# InOutputMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**InOutput**](InOutput.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewInOutputMetricItem + +`func NewInOutputMetricItem() *InOutputMetricItem` + +NewInOutputMetricItem instantiates a new InOutputMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInOutputMetricItemWithDefaults + +`func NewInOutputMetricItemWithDefaults() *InOutputMetricItem` + +NewInOutputMetricItemWithDefaults instantiates a new InOutputMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *InOutputMetricItem) GetLastMessage() InOutput` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *InOutputMetricItem) GetLastMessageOk() (*InOutput, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *InOutputMetricItem) SetLastMessage(v InOutput)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *InOutputMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *InOutputMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *InOutputMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *InOutputMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *InOutputMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *InOutputMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *InOutputMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *InOutputMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *InOutputMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/InStateOutput.md b/client/docs/InStateOutput.md new file mode 100644 index 0000000000..f03fe3924b --- /dev/null +++ b/client/docs/InStateOutput.md @@ -0,0 +1,82 @@ +# InStateOutput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Output** | Pointer to [**Output**](Output.md) | | [optional] +**OutputId** | Pointer to **string** | The output ID | [optional] + +## Methods + +### NewInStateOutput + +`func NewInStateOutput() *InStateOutput` + +NewInStateOutput instantiates a new InStateOutput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInStateOutputWithDefaults + +`func NewInStateOutputWithDefaults() *InStateOutput` + +NewInStateOutputWithDefaults instantiates a new InStateOutput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOutput + +`func (o *InStateOutput) GetOutput() Output` + +GetOutput returns the Output field if non-nil, zero value otherwise. + +### GetOutputOk + +`func (o *InStateOutput) GetOutputOk() (*Output, bool)` + +GetOutputOk returns a tuple with the Output field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutput + +`func (o *InStateOutput) SetOutput(v Output)` + +SetOutput sets Output field to given value. + +### HasOutput + +`func (o *InStateOutput) HasOutput() bool` + +HasOutput returns a boolean if a field has been set. + +### GetOutputId + +`func (o *InStateOutput) GetOutputId() string` + +GetOutputId returns the OutputId field if non-nil, zero value otherwise. + +### GetOutputIdOk + +`func (o *InStateOutput) GetOutputIdOk() (*string, bool)` + +GetOutputIdOk returns a tuple with the OutputId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutputId + +`func (o *InStateOutput) SetOutputId(v string)` + +SetOutputId sets OutputId field to given value. + +### HasOutputId + +`func (o *InStateOutput) HasOutputId() bool` + +HasOutputId returns a boolean if a field has been set. + + +[[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/client/docs/InStateOutputMetricItem.md b/client/docs/InStateOutputMetricItem.md new file mode 100644 index 0000000000..3686b02a56 --- /dev/null +++ b/client/docs/InStateOutputMetricItem.md @@ -0,0 +1,108 @@ +# InStateOutputMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**InStateOutput**](InStateOutput.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewInStateOutputMetricItem + +`func NewInStateOutputMetricItem() *InStateOutputMetricItem` + +NewInStateOutputMetricItem instantiates a new InStateOutputMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInStateOutputMetricItemWithDefaults + +`func NewInStateOutputMetricItemWithDefaults() *InStateOutputMetricItem` + +NewInStateOutputMetricItemWithDefaults instantiates a new InStateOutputMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *InStateOutputMetricItem) GetLastMessage() InStateOutput` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *InStateOutputMetricItem) GetLastMessageOk() (*InStateOutput, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *InStateOutputMetricItem) SetLastMessage(v InStateOutput)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *InStateOutputMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *InStateOutputMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *InStateOutputMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *InStateOutputMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *InStateOutputMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *InStateOutputMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *InStateOutputMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *InStateOutputMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *InStateOutputMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/InfoResponse.md b/client/docs/InfoResponse.md new file mode 100644 index 0000000000..dcdc906a11 --- /dev/null +++ b/client/docs/InfoResponse.md @@ -0,0 +1,134 @@ +# InfoResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**L1Params** | Pointer to [**L1Params**](L1Params.md) | | [optional] +**NetID** | Pointer to **string** | The net id of the node | [optional] +**PublicKey** | Pointer to **string** | The public key of the node (Hex) | [optional] +**Version** | Pointer to **string** | The version of the node | [optional] + +## Methods + +### NewInfoResponse + +`func NewInfoResponse() *InfoResponse` + +NewInfoResponse instantiates a new InfoResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInfoResponseWithDefaults + +`func NewInfoResponseWithDefaults() *InfoResponse` + +NewInfoResponseWithDefaults instantiates a new InfoResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetL1Params + +`func (o *InfoResponse) GetL1Params() L1Params` + +GetL1Params returns the L1Params field if non-nil, zero value otherwise. + +### GetL1ParamsOk + +`func (o *InfoResponse) GetL1ParamsOk() (*L1Params, bool)` + +GetL1ParamsOk returns a tuple with the L1Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetL1Params + +`func (o *InfoResponse) SetL1Params(v L1Params)` + +SetL1Params sets L1Params field to given value. + +### HasL1Params + +`func (o *InfoResponse) HasL1Params() bool` + +HasL1Params returns a boolean if a field has been set. + +### GetNetID + +`func (o *InfoResponse) GetNetID() string` + +GetNetID returns the NetID field if non-nil, zero value otherwise. + +### GetNetIDOk + +`func (o *InfoResponse) GetNetIDOk() (*string, bool)` + +GetNetIDOk returns a tuple with the NetID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetID + +`func (o *InfoResponse) SetNetID(v string)` + +SetNetID sets NetID field to given value. + +### HasNetID + +`func (o *InfoResponse) HasNetID() bool` + +HasNetID returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *InfoResponse) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *InfoResponse) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *InfoResponse) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *InfoResponse) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + +### GetVersion + +`func (o *InfoResponse) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *InfoResponse) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *InfoResponse) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *InfoResponse) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + + +[[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/client/docs/InterfaceMetricItem.md b/client/docs/InterfaceMetricItem.md new file mode 100644 index 0000000000..f9bff7fe8b --- /dev/null +++ b/client/docs/InterfaceMetricItem.md @@ -0,0 +1,108 @@ +# InterfaceMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to **string** | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewInterfaceMetricItem + +`func NewInterfaceMetricItem() *InterfaceMetricItem` + +NewInterfaceMetricItem instantiates a new InterfaceMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInterfaceMetricItemWithDefaults + +`func NewInterfaceMetricItemWithDefaults() *InterfaceMetricItem` + +NewInterfaceMetricItemWithDefaults instantiates a new InterfaceMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *InterfaceMetricItem) GetLastMessage() string` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *InterfaceMetricItem) GetLastMessageOk() (*string, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *InterfaceMetricItem) SetLastMessage(v string)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *InterfaceMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *InterfaceMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *InterfaceMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *InterfaceMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *InterfaceMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *InterfaceMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *InterfaceMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *InterfaceMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *InterfaceMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/Item.md b/client/docs/Item.md new file mode 100644 index 0000000000..d0f1e27795 --- /dev/null +++ b/client/docs/Item.md @@ -0,0 +1,82 @@ +# Item + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | Pointer to **string** | key (hex-encoded) | [optional] +**Value** | Pointer to **string** | value (hex-encoded) | [optional] + +## Methods + +### NewItem + +`func NewItem() *Item` + +NewItem instantiates a new Item object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewItemWithDefaults + +`func NewItemWithDefaults() *Item` + +NewItemWithDefaults instantiates a new Item object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKey + +`func (o *Item) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *Item) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *Item) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *Item) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetValue + +`func (o *Item) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *Item) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *Item) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *Item) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[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/client/docs/JSONDict.md b/client/docs/JSONDict.md new file mode 100644 index 0000000000..2c8b476fb3 --- /dev/null +++ b/client/docs/JSONDict.md @@ -0,0 +1,56 @@ +# JSONDict + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Items** | Pointer to [**[]Item**](Item.md) | | [optional] + +## Methods + +### NewJSONDict + +`func NewJSONDict() *JSONDict` + +NewJSONDict instantiates a new JSONDict object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewJSONDictWithDefaults + +`func NewJSONDictWithDefaults() *JSONDict` + +NewJSONDictWithDefaults instantiates a new JSONDict object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItems + +`func (o *JSONDict) GetItems() []Item` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *JSONDict) GetItemsOk() (*[]Item, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *JSONDict) SetItems(v []Item)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *JSONDict) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + +[[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/client/docs/L1Params.md b/client/docs/L1Params.md new file mode 100644 index 0000000000..d6e9fe84ae --- /dev/null +++ b/client/docs/L1Params.md @@ -0,0 +1,108 @@ +# L1Params + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BaseToken** | Pointer to [**BaseToken**](BaseToken.md) | | [optional] +**MaxPayloadSize** | Pointer to **int32** | The max payload size | [optional] +**Protocol** | Pointer to [**ProtocolParameters**](ProtocolParameters.md) | | [optional] + +## Methods + +### NewL1Params + +`func NewL1Params() *L1Params` + +NewL1Params instantiates a new L1Params object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewL1ParamsWithDefaults + +`func NewL1ParamsWithDefaults() *L1Params` + +NewL1ParamsWithDefaults instantiates a new L1Params object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBaseToken + +`func (o *L1Params) GetBaseToken() BaseToken` + +GetBaseToken returns the BaseToken field if non-nil, zero value otherwise. + +### GetBaseTokenOk + +`func (o *L1Params) GetBaseTokenOk() (*BaseToken, bool)` + +GetBaseTokenOk returns a tuple with the BaseToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseToken + +`func (o *L1Params) SetBaseToken(v BaseToken)` + +SetBaseToken sets BaseToken field to given value. + +### HasBaseToken + +`func (o *L1Params) HasBaseToken() bool` + +HasBaseToken returns a boolean if a field has been set. + +### GetMaxPayloadSize + +`func (o *L1Params) GetMaxPayloadSize() int32` + +GetMaxPayloadSize returns the MaxPayloadSize field if non-nil, zero value otherwise. + +### GetMaxPayloadSizeOk + +`func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool)` + +GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxPayloadSize + +`func (o *L1Params) SetMaxPayloadSize(v int32)` + +SetMaxPayloadSize sets MaxPayloadSize field to given value. + +### HasMaxPayloadSize + +`func (o *L1Params) HasMaxPayloadSize() bool` + +HasMaxPayloadSize returns a boolean if a field has been set. + +### GetProtocol + +`func (o *L1Params) GetProtocol() ProtocolParameters` + +GetProtocol returns the Protocol field if non-nil, zero value otherwise. + +### GetProtocolOk + +`func (o *L1Params) GetProtocolOk() (*ProtocolParameters, bool)` + +GetProtocolOk returns a tuple with the Protocol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProtocol + +`func (o *L1Params) SetProtocol(v ProtocolParameters)` + +SetProtocol sets Protocol field to given value. + +### HasProtocol + +`func (o *L1Params) HasProtocol() bool` + +HasProtocol returns a boolean if a field has been set. + + +[[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/client/docs/MetricsApi.md b/client/docs/MetricsApi.md new file mode 100644 index 0000000000..83f5ab2f3b --- /dev/null +++ b/client/docs/MetricsApi.md @@ -0,0 +1,275 @@ +# \MetricsApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /metrics/chain/{chainID} | Get chain specific metrics. +[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /metrics/chain/{chainID}/pipe | Get chain pipe event metrics. +[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /metrics/chain/{chainID}/workflow | Get chain workflow metrics. +[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /metrics/l1 | Get accumulated metrics. + + + +## GetChainMetrics + +> ChainMetrics GetChainMetrics(ctx, chainID).Execute() + +Get chain specific metrics. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetricsApi.GetChainMetrics(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.GetChainMetrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetChainMetrics`: ChainMetrics + fmt.Fprintf(os.Stdout, "Response from `MetricsApi.GetChainMetrics`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetChainMetricsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ChainMetrics**](ChainMetrics.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetChainPipeMetrics + +> ConsensusPipeMetrics GetChainPipeMetrics(ctx, chainID).Execute() + +Get chain pipe event metrics. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetricsApi.GetChainPipeMetrics(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.GetChainPipeMetrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetChainPipeMetrics`: ConsensusPipeMetrics + fmt.Fprintf(os.Stdout, "Response from `MetricsApi.GetChainPipeMetrics`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetChainPipeMetricsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ConsensusPipeMetrics**](ConsensusPipeMetrics.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetChainWorkflowMetrics + +> ConsensusWorkflowMetrics GetChainWorkflowMetrics(ctx, chainID).Execute() + +Get chain workflow metrics. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetricsApi.GetChainWorkflowMetrics(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.GetChainWorkflowMetrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetChainWorkflowMetrics`: ConsensusWorkflowMetrics + fmt.Fprintf(os.Stdout, "Response from `MetricsApi.GetChainWorkflowMetrics`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetChainWorkflowMetricsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ConsensusWorkflowMetrics**](ConsensusWorkflowMetrics.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetL1Metrics + +> ChainMetrics GetL1Metrics(ctx).Execute() + +Get accumulated metrics. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetricsApi.GetL1Metrics(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.GetL1Metrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetL1Metrics`: ChainMetrics + fmt.Fprintf(os.Stdout, "Response from `MetricsApi.GetL1Metrics`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetL1MetricsRequest struct via the builder pattern + + +### Return type + +[**ChainMetrics**](ChainMetrics.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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/client/docs/NFTDataResponse.md b/client/docs/NFTDataResponse.md new file mode 100644 index 0000000000..955a30e330 --- /dev/null +++ b/client/docs/NFTDataResponse.md @@ -0,0 +1,134 @@ +# NFTDataResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Issuer** | Pointer to **string** | | [optional] +**Metadata** | Pointer to **string** | | [optional] +**Owner** | Pointer to **string** | | [optional] + +## Methods + +### NewNFTDataResponse + +`func NewNFTDataResponse() *NFTDataResponse` + +NewNFTDataResponse instantiates a new NFTDataResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNFTDataResponseWithDefaults + +`func NewNFTDataResponseWithDefaults() *NFTDataResponse` + +NewNFTDataResponseWithDefaults instantiates a new NFTDataResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *NFTDataResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *NFTDataResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *NFTDataResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *NFTDataResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIssuer + +`func (o *NFTDataResponse) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *NFTDataResponse) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *NFTDataResponse) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + +### HasIssuer + +`func (o *NFTDataResponse) HasIssuer() bool` + +HasIssuer returns a boolean if a field has been set. + +### GetMetadata + +`func (o *NFTDataResponse) GetMetadata() string` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *NFTDataResponse) GetMetadataOk() (*string, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *NFTDataResponse) SetMetadata(v string)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *NFTDataResponse) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetOwner + +`func (o *NFTDataResponse) GetOwner() string` + +GetOwner returns the Owner field if non-nil, zero value otherwise. + +### GetOwnerOk + +`func (o *NFTDataResponse) GetOwnerOk() (*string, bool)` + +GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOwner + +`func (o *NFTDataResponse) SetOwner(v string)` + +SetOwner sets Owner field to given value. + +### HasOwner + +`func (o *NFTDataResponse) HasOwner() bool` + +HasOwner returns a boolean if a field has been set. + + +[[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/client/docs/NativeToken.md b/client/docs/NativeToken.md new file mode 100644 index 0000000000..4f59f05156 --- /dev/null +++ b/client/docs/NativeToken.md @@ -0,0 +1,82 @@ +# NativeToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] + +## Methods + +### NewNativeToken + +`func NewNativeToken() *NativeToken` + +NewNativeToken instantiates a new NativeToken object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNativeTokenWithDefaults + +`func NewNativeTokenWithDefaults() *NativeToken` + +NewNativeTokenWithDefaults instantiates a new NativeToken object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *NativeToken) GetAmount() string` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *NativeToken) GetAmountOk() (*string, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *NativeToken) SetAmount(v string)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *NativeToken) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetId + +`func (o *NativeToken) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *NativeToken) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *NativeToken) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *NativeToken) HasId() bool` + +HasId returns a boolean if a field has been set. + + +[[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/client/docs/NativeTokenIDRegistryResponse.md b/client/docs/NativeTokenIDRegistryResponse.md new file mode 100644 index 0000000000..1892b72bc7 --- /dev/null +++ b/client/docs/NativeTokenIDRegistryResponse.md @@ -0,0 +1,56 @@ +# NativeTokenIDRegistryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NativeTokenRegistryIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewNativeTokenIDRegistryResponse + +`func NewNativeTokenIDRegistryResponse() *NativeTokenIDRegistryResponse` + +NewNativeTokenIDRegistryResponse instantiates a new NativeTokenIDRegistryResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNativeTokenIDRegistryResponseWithDefaults + +`func NewNativeTokenIDRegistryResponseWithDefaults() *NativeTokenIDRegistryResponse` + +NewNativeTokenIDRegistryResponseWithDefaults instantiates a new NativeTokenIDRegistryResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNativeTokenRegistryIds + +`func (o *NativeTokenIDRegistryResponse) GetNativeTokenRegistryIds() []string` + +GetNativeTokenRegistryIds returns the NativeTokenRegistryIds field if non-nil, zero value otherwise. + +### GetNativeTokenRegistryIdsOk + +`func (o *NativeTokenIDRegistryResponse) GetNativeTokenRegistryIdsOk() (*[]string, bool)` + +GetNativeTokenRegistryIdsOk returns a tuple with the NativeTokenRegistryIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNativeTokenRegistryIds + +`func (o *NativeTokenIDRegistryResponse) SetNativeTokenRegistryIds(v []string)` + +SetNativeTokenRegistryIds sets NativeTokenRegistryIds field to given value. + +### HasNativeTokenRegistryIds + +`func (o *NativeTokenIDRegistryResponse) HasNativeTokenRegistryIds() bool` + +HasNativeTokenRegistryIds returns a boolean if a field has been set. + + +[[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/client/docs/NodeApi.md b/client/docs/NodeApi.md new file mode 100644 index 0000000000..5120b95e99 --- /dev/null +++ b/client/docs/NodeApi.md @@ -0,0 +1,749 @@ +# \NodeApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /node/peers/trusted | Distrust a peering node +[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /node/dks | Generate a new distributed key +[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /node/peers | Get basic information about all configured peers +[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /node/config | Return the Wasp configuration +[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /node/dks/{sharedAddress} | Get information about the shared address DKS configuration +[**GetInfo**](NodeApi.md#GetInfo) | **Get** /node/info | Returns private information about this node. +[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /node/peers/identity | Get basic peer info of the current node +[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /node/peers/trusted | Get trusted peers +[**GetVersion**](NodeApi.md#GetVersion) | **Get** /v2/node/version | Returns the node version. +[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /node/owner/certificate | Sets the node owner +[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /node/shutdown | Shut down the node +[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /node/peers/trusted | Trust a peering node + + + +## DistrustPeer + +> DistrustPeer(ctx).PeeringTrustRequest(peeringTrustRequest).Execute() + +Distrust a peering node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + peeringTrustRequest := *openapiclient.NewPeeringTrustRequest() // PeeringTrustRequest | Info of the peer to distrust + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.DistrustPeer(context.Background()).PeeringTrustRequest(peeringTrustRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.DistrustPeer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDistrustPeerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **peeringTrustRequest** | [**PeeringTrustRequest**](PeeringTrustRequest.md) | Info of the peer to distrust | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## GenerateDKS + +> DKSharesPostRequest GenerateDKS(ctx).DKSharesPostRequest(dKSharesPostRequest).Execute() + +Generate a new distributed key + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + dKSharesPostRequest := *openapiclient.NewDKSharesPostRequest() // DKSharesPostRequest | Request parameters + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GenerateDKS(context.Background()).DKSharesPostRequest(dKSharesPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GenerateDKS``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GenerateDKS`: DKSharesPostRequest + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GenerateDKS`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGenerateDKSRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dKSharesPostRequest** | [**DKSharesPostRequest**](DKSharesPostRequest.md) | Request parameters | + +### Return type + +[**DKSharesPostRequest**](DKSharesPostRequest.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## GetAllPeers + +> []PeeringNodeStatusResponse GetAllPeers(ctx).Execute() + +Get basic information about all configured peers + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetAllPeers(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetAllPeers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAllPeers`: []PeeringNodeStatusResponse + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetAllPeers`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAllPeersRequest struct via the builder pattern + + +### Return type + +[**[]PeeringNodeStatusResponse**](PeeringNodeStatusResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetConfiguration + +> map[string]string GetConfiguration(ctx).Execute() + +Return the Wasp configuration + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetConfiguration(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetConfiguration``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConfiguration`: map[string]string + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetConfiguration`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetConfigurationRequest struct via the builder pattern + + +### Return type + +**map[string]string** + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetDKSInfo + +> DKSharesInfo GetDKSInfo(ctx, sharedAddress).Execute() + +Get information about the shared address DKS configuration + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + sharedAddress := "sharedAddress_example" // string | SharedAddress (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetDKSInfo(context.Background(), sharedAddress).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetDKSInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDKSInfo`: DKSharesInfo + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetDKSInfo`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**sharedAddress** | **string** | SharedAddress (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDKSInfoRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DKSharesInfo**](DKSharesInfo.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetInfo + +> InfoResponse GetInfo(ctx).Execute() + +Returns private information about this node. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetInfo(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInfo`: InfoResponse + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetInfo`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInfoRequest struct via the builder pattern + + +### Return type + +[**InfoResponse**](InfoResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetPeeringIdentity + +> PeeringNodeIdentityResponse GetPeeringIdentity(ctx).Execute() + +Get basic peer info of the current node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetPeeringIdentity``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPeeringIdentity`: PeeringNodeIdentityResponse + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetPeeringIdentity`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPeeringIdentityRequest struct via the builder pattern + + +### Return type + +[**PeeringNodeIdentityResponse**](PeeringNodeIdentityResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetTrustedPeers + +> []PeeringNodeIdentityResponse GetTrustedPeers(ctx).Execute() + +Get trusted peers + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetTrustedPeers(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetTrustedPeers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTrustedPeers`: []PeeringNodeIdentityResponse + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetTrustedPeers`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTrustedPeersRequest struct via the builder pattern + + +### Return type + +[**[]PeeringNodeIdentityResponse**](PeeringNodeIdentityResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetVersion + +> string GetVersion(ctx).Execute() + +Returns the node version. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.GetVersion(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetVersion``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVersion`: string + fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetVersion`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVersionRequest struct via the builder pattern + + +### Return type + +**string** + +### 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) + + +## SetNodeOwner + +> SetNodeOwner(ctx).NodeOwnerCertificateRequest(nodeOwnerCertificateRequest).Execute() + +Sets the node owner + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + nodeOwnerCertificateRequest := *openapiclient.NewNodeOwnerCertificateRequest() // NodeOwnerCertificateRequest | The node owner certificate + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.SetNodeOwner(context.Background()).NodeOwnerCertificateRequest(nodeOwnerCertificateRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.SetNodeOwner``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSetNodeOwnerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **nodeOwnerCertificateRequest** | [**NodeOwnerCertificateRequest**](NodeOwnerCertificateRequest.md) | The node owner certificate | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ShutdownNode + +> ShutdownNode(ctx).Execute() + +Shut down the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.ShutdownNode(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.ShutdownNode``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiShutdownNodeRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## TrustPeer + +> TrustPeer(ctx).PeeringTrustRequest(peeringTrustRequest).Execute() + +Trust a peering node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + peeringTrustRequest := *openapiclient.NewPeeringTrustRequest() // PeeringTrustRequest | Info of the peer to trust + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(peeringTrustRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.TrustPeer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTrustPeerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **peeringTrustRequest** | [**PeeringTrustRequest**](PeeringTrustRequest.md) | Info of the peer to trust | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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/client/docs/NodeOwnerCertificateRequest.md b/client/docs/NodeOwnerCertificateRequest.md new file mode 100644 index 0000000000..5a492cffe4 --- /dev/null +++ b/client/docs/NodeOwnerCertificateRequest.md @@ -0,0 +1,82 @@ +# NodeOwnerCertificateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OwnerAddress** | Pointer to **string** | Node owner address. (Bech32) | [optional] +**PublicKey** | Pointer to **string** | The public key of the node (Hex) | [optional] + +## Methods + +### NewNodeOwnerCertificateRequest + +`func NewNodeOwnerCertificateRequest() *NodeOwnerCertificateRequest` + +NewNodeOwnerCertificateRequest instantiates a new NodeOwnerCertificateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNodeOwnerCertificateRequestWithDefaults + +`func NewNodeOwnerCertificateRequestWithDefaults() *NodeOwnerCertificateRequest` + +NewNodeOwnerCertificateRequestWithDefaults instantiates a new NodeOwnerCertificateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOwnerAddress + +`func (o *NodeOwnerCertificateRequest) GetOwnerAddress() string` + +GetOwnerAddress returns the OwnerAddress field if non-nil, zero value otherwise. + +### GetOwnerAddressOk + +`func (o *NodeOwnerCertificateRequest) GetOwnerAddressOk() (*string, bool)` + +GetOwnerAddressOk returns a tuple with the OwnerAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOwnerAddress + +`func (o *NodeOwnerCertificateRequest) SetOwnerAddress(v string)` + +SetOwnerAddress sets OwnerAddress field to given value. + +### HasOwnerAddress + +`func (o *NodeOwnerCertificateRequest) HasOwnerAddress() bool` + +HasOwnerAddress returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *NodeOwnerCertificateRequest) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *NodeOwnerCertificateRequest) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *NodeOwnerCertificateRequest) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *NodeOwnerCertificateRequest) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + + +[[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/client/docs/OffLedgerRequest.md b/client/docs/OffLedgerRequest.md new file mode 100644 index 0000000000..2201b4f84b --- /dev/null +++ b/client/docs/OffLedgerRequest.md @@ -0,0 +1,82 @@ +# OffLedgerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ChainId** | Pointer to **string** | The chain id | [optional] +**Request** | Pointer to **string** | Offledger Request (Hex) | [optional] + +## Methods + +### NewOffLedgerRequest + +`func NewOffLedgerRequest() *OffLedgerRequest` + +NewOffLedgerRequest instantiates a new OffLedgerRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOffLedgerRequestWithDefaults + +`func NewOffLedgerRequestWithDefaults() *OffLedgerRequest` + +NewOffLedgerRequestWithDefaults instantiates a new OffLedgerRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChainId + +`func (o *OffLedgerRequest) GetChainId() string` + +GetChainId returns the ChainId field if non-nil, zero value otherwise. + +### GetChainIdOk + +`func (o *OffLedgerRequest) GetChainIdOk() (*string, bool)` + +GetChainIdOk returns a tuple with the ChainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainId + +`func (o *OffLedgerRequest) SetChainId(v string)` + +SetChainId sets ChainId field to given value. + +### HasChainId + +`func (o *OffLedgerRequest) HasChainId() bool` + +HasChainId returns a boolean if a field has been set. + +### GetRequest + +`func (o *OffLedgerRequest) GetRequest() string` + +GetRequest returns the Request field if non-nil, zero value otherwise. + +### GetRequestOk + +`func (o *OffLedgerRequest) GetRequestOk() (*string, bool)` + +GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequest + +`func (o *OffLedgerRequest) SetRequest(v string)` + +SetRequest sets Request field to given value. + +### HasRequest + +`func (o *OffLedgerRequest) HasRequest() bool` + +HasRequest returns a boolean if a field has been set. + + +[[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/client/docs/OnLedgerRequest.md b/client/docs/OnLedgerRequest.md new file mode 100644 index 0000000000..c72a990c37 --- /dev/null +++ b/client/docs/OnLedgerRequest.md @@ -0,0 +1,134 @@ +# OnLedgerRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The request ID | [optional] +**Output** | Pointer to [**Output**](Output.md) | | [optional] +**OutputId** | Pointer to **string** | The output ID | [optional] +**Raw** | Pointer to **string** | The raw data of the request (Hex) | [optional] + +## Methods + +### NewOnLedgerRequest + +`func NewOnLedgerRequest() *OnLedgerRequest` + +NewOnLedgerRequest instantiates a new OnLedgerRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOnLedgerRequestWithDefaults + +`func NewOnLedgerRequestWithDefaults() *OnLedgerRequest` + +NewOnLedgerRequestWithDefaults instantiates a new OnLedgerRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *OnLedgerRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OnLedgerRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OnLedgerRequest) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OnLedgerRequest) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetOutput + +`func (o *OnLedgerRequest) GetOutput() Output` + +GetOutput returns the Output field if non-nil, zero value otherwise. + +### GetOutputOk + +`func (o *OnLedgerRequest) GetOutputOk() (*Output, bool)` + +GetOutputOk returns a tuple with the Output field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutput + +`func (o *OnLedgerRequest) SetOutput(v Output)` + +SetOutput sets Output field to given value. + +### HasOutput + +`func (o *OnLedgerRequest) HasOutput() bool` + +HasOutput returns a boolean if a field has been set. + +### GetOutputId + +`func (o *OnLedgerRequest) GetOutputId() string` + +GetOutputId returns the OutputId field if non-nil, zero value otherwise. + +### GetOutputIdOk + +`func (o *OnLedgerRequest) GetOutputIdOk() (*string, bool)` + +GetOutputIdOk returns a tuple with the OutputId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutputId + +`func (o *OnLedgerRequest) SetOutputId(v string)` + +SetOutputId sets OutputId field to given value. + +### HasOutputId + +`func (o *OnLedgerRequest) HasOutputId() bool` + +HasOutputId returns a boolean if a field has been set. + +### GetRaw + +`func (o *OnLedgerRequest) GetRaw() string` + +GetRaw returns the Raw field if non-nil, zero value otherwise. + +### GetRawOk + +`func (o *OnLedgerRequest) GetRawOk() (*string, bool)` + +GetRawOk returns a tuple with the Raw field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRaw + +`func (o *OnLedgerRequest) SetRaw(v string)` + +SetRaw sets Raw field to given value. + +### HasRaw + +`func (o *OnLedgerRequest) HasRaw() bool` + +HasRaw returns a boolean if a field has been set. + + +[[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/client/docs/OnLedgerRequestMetricItem.md b/client/docs/OnLedgerRequestMetricItem.md new file mode 100644 index 0000000000..e892b23699 --- /dev/null +++ b/client/docs/OnLedgerRequestMetricItem.md @@ -0,0 +1,108 @@ +# OnLedgerRequestMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**OnLedgerRequest**](OnLedgerRequest.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewOnLedgerRequestMetricItem + +`func NewOnLedgerRequestMetricItem() *OnLedgerRequestMetricItem` + +NewOnLedgerRequestMetricItem instantiates a new OnLedgerRequestMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOnLedgerRequestMetricItemWithDefaults + +`func NewOnLedgerRequestMetricItemWithDefaults() *OnLedgerRequestMetricItem` + +NewOnLedgerRequestMetricItemWithDefaults instantiates a new OnLedgerRequestMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *OnLedgerRequestMetricItem) GetLastMessage() OnLedgerRequest` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *OnLedgerRequestMetricItem) GetLastMessageOk() (*OnLedgerRequest, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *OnLedgerRequestMetricItem) SetLastMessage(v OnLedgerRequest)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *OnLedgerRequestMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *OnLedgerRequestMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *OnLedgerRequestMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *OnLedgerRequestMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *OnLedgerRequestMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *OnLedgerRequestMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *OnLedgerRequestMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *OnLedgerRequestMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *OnLedgerRequestMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/Output.md b/client/docs/Output.md new file mode 100644 index 0000000000..0af603c808 --- /dev/null +++ b/client/docs/Output.md @@ -0,0 +1,82 @@ +# Output + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OutputType** | Pointer to **int32** | The output type | [optional] +**Raw** | Pointer to **string** | The raw data of the output (Hex) | [optional] + +## Methods + +### NewOutput + +`func NewOutput() *Output` + +NewOutput instantiates a new Output object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOutputWithDefaults + +`func NewOutputWithDefaults() *Output` + +NewOutputWithDefaults instantiates a new Output object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOutputType + +`func (o *Output) GetOutputType() int32` + +GetOutputType returns the OutputType field if non-nil, zero value otherwise. + +### GetOutputTypeOk + +`func (o *Output) GetOutputTypeOk() (*int32, bool)` + +GetOutputTypeOk returns a tuple with the OutputType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutputType + +`func (o *Output) SetOutputType(v int32)` + +SetOutputType sets OutputType field to given value. + +### HasOutputType + +`func (o *Output) HasOutputType() bool` + +HasOutputType returns a boolean if a field has been set. + +### GetRaw + +`func (o *Output) GetRaw() string` + +GetRaw returns the Raw field if non-nil, zero value otherwise. + +### GetRawOk + +`func (o *Output) GetRawOk() (*string, bool)` + +GetRawOk returns a tuple with the Raw field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRaw + +`func (o *Output) SetRaw(v string)` + +SetRaw sets Raw field to given value. + +### HasRaw + +`func (o *Output) HasRaw() bool` + +HasRaw returns a boolean if a field has been set. + + +[[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/client/docs/OutputID.md b/client/docs/OutputID.md new file mode 100644 index 0000000000..b40bbd1b3b --- /dev/null +++ b/client/docs/OutputID.md @@ -0,0 +1,56 @@ +# OutputID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OutputId** | Pointer to **string** | The output ID | [optional] + +## Methods + +### NewOutputID + +`func NewOutputID() *OutputID` + +NewOutputID instantiates a new OutputID object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOutputIDWithDefaults + +`func NewOutputIDWithDefaults() *OutputID` + +NewOutputIDWithDefaults instantiates a new OutputID object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOutputId + +`func (o *OutputID) GetOutputId() string` + +GetOutputId returns the OutputId field if non-nil, zero value otherwise. + +### GetOutputIdOk + +`func (o *OutputID) GetOutputIdOk() (*string, bool)` + +GetOutputIdOk returns a tuple with the OutputId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutputId + +`func (o *OutputID) SetOutputId(v string)` + +SetOutputId sets OutputId field to given value. + +### HasOutputId + +`func (o *OutputID) HasOutputId() bool` + +HasOutputId returns a boolean if a field has been set. + + +[[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/client/docs/PeeringNodeIdentityResponse.md b/client/docs/PeeringNodeIdentityResponse.md new file mode 100644 index 0000000000..09f83128ab --- /dev/null +++ b/client/docs/PeeringNodeIdentityResponse.md @@ -0,0 +1,108 @@ +# PeeringNodeIdentityResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsTrusted** | Pointer to **bool** | | [optional] +**NetId** | Pointer to **string** | The NetID of the peer | [optional] +**PublicKey** | Pointer to **string** | The peers public key encoded in Hex | [optional] + +## Methods + +### NewPeeringNodeIdentityResponse + +`func NewPeeringNodeIdentityResponse() *PeeringNodeIdentityResponse` + +NewPeeringNodeIdentityResponse instantiates a new PeeringNodeIdentityResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPeeringNodeIdentityResponseWithDefaults + +`func NewPeeringNodeIdentityResponseWithDefaults() *PeeringNodeIdentityResponse` + +NewPeeringNodeIdentityResponseWithDefaults instantiates a new PeeringNodeIdentityResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsTrusted + +`func (o *PeeringNodeIdentityResponse) GetIsTrusted() bool` + +GetIsTrusted returns the IsTrusted field if non-nil, zero value otherwise. + +### GetIsTrustedOk + +`func (o *PeeringNodeIdentityResponse) GetIsTrustedOk() (*bool, bool)` + +GetIsTrustedOk returns a tuple with the IsTrusted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsTrusted + +`func (o *PeeringNodeIdentityResponse) SetIsTrusted(v bool)` + +SetIsTrusted sets IsTrusted field to given value. + +### HasIsTrusted + +`func (o *PeeringNodeIdentityResponse) HasIsTrusted() bool` + +HasIsTrusted returns a boolean if a field has been set. + +### GetNetId + +`func (o *PeeringNodeIdentityResponse) GetNetId() string` + +GetNetId returns the NetId field if non-nil, zero value otherwise. + +### GetNetIdOk + +`func (o *PeeringNodeIdentityResponse) GetNetIdOk() (*string, bool)` + +GetNetIdOk returns a tuple with the NetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetId + +`func (o *PeeringNodeIdentityResponse) SetNetId(v string)` + +SetNetId sets NetId field to given value. + +### HasNetId + +`func (o *PeeringNodeIdentityResponse) HasNetId() bool` + +HasNetId returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *PeeringNodeIdentityResponse) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *PeeringNodeIdentityResponse) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *PeeringNodeIdentityResponse) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *PeeringNodeIdentityResponse) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + + +[[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/client/docs/PeeringNodeStatusResponse.md b/client/docs/PeeringNodeStatusResponse.md new file mode 100644 index 0000000000..a82d5c3109 --- /dev/null +++ b/client/docs/PeeringNodeStatusResponse.md @@ -0,0 +1,160 @@ +# PeeringNodeStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsAlive** | Pointer to **bool** | Whether or not the peer is activated | [optional] +**IsTrusted** | Pointer to **bool** | | [optional] +**NetId** | Pointer to **string** | The NetID of the peer | [optional] +**NumUsers** | Pointer to **int32** | The amount of users attached to the peer | [optional] +**PublicKey** | Pointer to **string** | The peers public key encoded in Hex | [optional] + +## Methods + +### NewPeeringNodeStatusResponse + +`func NewPeeringNodeStatusResponse() *PeeringNodeStatusResponse` + +NewPeeringNodeStatusResponse instantiates a new PeeringNodeStatusResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPeeringNodeStatusResponseWithDefaults + +`func NewPeeringNodeStatusResponseWithDefaults() *PeeringNodeStatusResponse` + +NewPeeringNodeStatusResponseWithDefaults instantiates a new PeeringNodeStatusResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsAlive + +`func (o *PeeringNodeStatusResponse) GetIsAlive() bool` + +GetIsAlive returns the IsAlive field if non-nil, zero value otherwise. + +### GetIsAliveOk + +`func (o *PeeringNodeStatusResponse) GetIsAliveOk() (*bool, bool)` + +GetIsAliveOk returns a tuple with the IsAlive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAlive + +`func (o *PeeringNodeStatusResponse) SetIsAlive(v bool)` + +SetIsAlive sets IsAlive field to given value. + +### HasIsAlive + +`func (o *PeeringNodeStatusResponse) HasIsAlive() bool` + +HasIsAlive returns a boolean if a field has been set. + +### GetIsTrusted + +`func (o *PeeringNodeStatusResponse) GetIsTrusted() bool` + +GetIsTrusted returns the IsTrusted field if non-nil, zero value otherwise. + +### GetIsTrustedOk + +`func (o *PeeringNodeStatusResponse) GetIsTrustedOk() (*bool, bool)` + +GetIsTrustedOk returns a tuple with the IsTrusted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsTrusted + +`func (o *PeeringNodeStatusResponse) SetIsTrusted(v bool)` + +SetIsTrusted sets IsTrusted field to given value. + +### HasIsTrusted + +`func (o *PeeringNodeStatusResponse) HasIsTrusted() bool` + +HasIsTrusted returns a boolean if a field has been set. + +### GetNetId + +`func (o *PeeringNodeStatusResponse) GetNetId() string` + +GetNetId returns the NetId field if non-nil, zero value otherwise. + +### GetNetIdOk + +`func (o *PeeringNodeStatusResponse) GetNetIdOk() (*string, bool)` + +GetNetIdOk returns a tuple with the NetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetId + +`func (o *PeeringNodeStatusResponse) SetNetId(v string)` + +SetNetId sets NetId field to given value. + +### HasNetId + +`func (o *PeeringNodeStatusResponse) HasNetId() bool` + +HasNetId returns a boolean if a field has been set. + +### GetNumUsers + +`func (o *PeeringNodeStatusResponse) GetNumUsers() int32` + +GetNumUsers returns the NumUsers field if non-nil, zero value otherwise. + +### GetNumUsersOk + +`func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool)` + +GetNumUsersOk returns a tuple with the NumUsers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumUsers + +`func (o *PeeringNodeStatusResponse) SetNumUsers(v int32)` + +SetNumUsers sets NumUsers field to given value. + +### HasNumUsers + +`func (o *PeeringNodeStatusResponse) HasNumUsers() bool` + +HasNumUsers returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *PeeringNodeStatusResponse) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *PeeringNodeStatusResponse) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *PeeringNodeStatusResponse) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *PeeringNodeStatusResponse) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + + +[[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/client/docs/PeeringTrustRequest.md b/client/docs/PeeringTrustRequest.md new file mode 100644 index 0000000000..a3a3d93311 --- /dev/null +++ b/client/docs/PeeringTrustRequest.md @@ -0,0 +1,82 @@ +# PeeringTrustRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NetId** | Pointer to **string** | The NetID of the peer | [optional] +**PublicKey** | Pointer to **string** | The peers public key encoded in Hex | [optional] + +## Methods + +### NewPeeringTrustRequest + +`func NewPeeringTrustRequest() *PeeringTrustRequest` + +NewPeeringTrustRequest instantiates a new PeeringTrustRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPeeringTrustRequestWithDefaults + +`func NewPeeringTrustRequestWithDefaults() *PeeringTrustRequest` + +NewPeeringTrustRequestWithDefaults instantiates a new PeeringTrustRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNetId + +`func (o *PeeringTrustRequest) GetNetId() string` + +GetNetId returns the NetId field if non-nil, zero value otherwise. + +### GetNetIdOk + +`func (o *PeeringTrustRequest) GetNetIdOk() (*string, bool)` + +GetNetIdOk returns a tuple with the NetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetId + +`func (o *PeeringTrustRequest) SetNetId(v string)` + +SetNetId sets NetId field to given value. + +### HasNetId + +`func (o *PeeringTrustRequest) HasNetId() bool` + +HasNetId returns a boolean if a field has been set. + +### GetPublicKey + +`func (o *PeeringTrustRequest) GetPublicKey() string` + +GetPublicKey returns the PublicKey field if non-nil, zero value otherwise. + +### GetPublicKeyOk + +`func (o *PeeringTrustRequest) GetPublicKeyOk() (*string, bool)` + +GetPublicKeyOk returns a tuple with the PublicKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicKey + +`func (o *PeeringTrustRequest) SetPublicKey(v string)` + +SetPublicKey sets PublicKey field to given value. + +### HasPublicKey + +`func (o *PeeringTrustRequest) HasPublicKey() bool` + +HasPublicKey returns a boolean if a field has been set. + + +[[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/client/docs/ProtocolParameters.md b/client/docs/ProtocolParameters.md new file mode 100644 index 0000000000..6bbe1a11c1 --- /dev/null +++ b/client/docs/ProtocolParameters.md @@ -0,0 +1,212 @@ +# ProtocolParameters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bech32Hrp** | Pointer to **string** | The human readable network prefix | [optional] +**BelowMaxDepth** | Pointer to **int32** | The networks max depth | [optional] +**MinPowScore** | Pointer to **int32** | The minimal PoW score | [optional] +**NetworkName** | Pointer to **string** | The network name | [optional] +**RentStructure** | Pointer to [**RentStructure**](RentStructure.md) | | [optional] +**TokenSupply** | Pointer to **string** | The token supply | [optional] +**Version** | Pointer to **int32** | The protocol version | [optional] + +## Methods + +### NewProtocolParameters + +`func NewProtocolParameters() *ProtocolParameters` + +NewProtocolParameters instantiates a new ProtocolParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProtocolParametersWithDefaults + +`func NewProtocolParametersWithDefaults() *ProtocolParameters` + +NewProtocolParametersWithDefaults instantiates a new ProtocolParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBech32Hrp + +`func (o *ProtocolParameters) GetBech32Hrp() string` + +GetBech32Hrp returns the Bech32Hrp field if non-nil, zero value otherwise. + +### GetBech32HrpOk + +`func (o *ProtocolParameters) GetBech32HrpOk() (*string, bool)` + +GetBech32HrpOk returns a tuple with the Bech32Hrp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBech32Hrp + +`func (o *ProtocolParameters) SetBech32Hrp(v string)` + +SetBech32Hrp sets Bech32Hrp field to given value. + +### HasBech32Hrp + +`func (o *ProtocolParameters) HasBech32Hrp() bool` + +HasBech32Hrp returns a boolean if a field has been set. + +### GetBelowMaxDepth + +`func (o *ProtocolParameters) GetBelowMaxDepth() int32` + +GetBelowMaxDepth returns the BelowMaxDepth field if non-nil, zero value otherwise. + +### GetBelowMaxDepthOk + +`func (o *ProtocolParameters) GetBelowMaxDepthOk() (*int32, bool)` + +GetBelowMaxDepthOk returns a tuple with the BelowMaxDepth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBelowMaxDepth + +`func (o *ProtocolParameters) SetBelowMaxDepth(v int32)` + +SetBelowMaxDepth sets BelowMaxDepth field to given value. + +### HasBelowMaxDepth + +`func (o *ProtocolParameters) HasBelowMaxDepth() bool` + +HasBelowMaxDepth returns a boolean if a field has been set. + +### GetMinPowScore + +`func (o *ProtocolParameters) GetMinPowScore() int32` + +GetMinPowScore returns the MinPowScore field if non-nil, zero value otherwise. + +### GetMinPowScoreOk + +`func (o *ProtocolParameters) GetMinPowScoreOk() (*int32, bool)` + +GetMinPowScoreOk returns a tuple with the MinPowScore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinPowScore + +`func (o *ProtocolParameters) SetMinPowScore(v int32)` + +SetMinPowScore sets MinPowScore field to given value. + +### HasMinPowScore + +`func (o *ProtocolParameters) HasMinPowScore() bool` + +HasMinPowScore returns a boolean if a field has been set. + +### GetNetworkName + +`func (o *ProtocolParameters) GetNetworkName() string` + +GetNetworkName returns the NetworkName field if non-nil, zero value otherwise. + +### GetNetworkNameOk + +`func (o *ProtocolParameters) GetNetworkNameOk() (*string, bool)` + +GetNetworkNameOk returns a tuple with the NetworkName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkName + +`func (o *ProtocolParameters) SetNetworkName(v string)` + +SetNetworkName sets NetworkName field to given value. + +### HasNetworkName + +`func (o *ProtocolParameters) HasNetworkName() bool` + +HasNetworkName returns a boolean if a field has been set. + +### GetRentStructure + +`func (o *ProtocolParameters) GetRentStructure() RentStructure` + +GetRentStructure returns the RentStructure field if non-nil, zero value otherwise. + +### GetRentStructureOk + +`func (o *ProtocolParameters) GetRentStructureOk() (*RentStructure, bool)` + +GetRentStructureOk returns a tuple with the RentStructure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRentStructure + +`func (o *ProtocolParameters) SetRentStructure(v RentStructure)` + +SetRentStructure sets RentStructure field to given value. + +### HasRentStructure + +`func (o *ProtocolParameters) HasRentStructure() bool` + +HasRentStructure returns a boolean if a field has been set. + +### GetTokenSupply + +`func (o *ProtocolParameters) GetTokenSupply() string` + +GetTokenSupply returns the TokenSupply field if non-nil, zero value otherwise. + +### GetTokenSupplyOk + +`func (o *ProtocolParameters) GetTokenSupplyOk() (*string, bool)` + +GetTokenSupplyOk returns a tuple with the TokenSupply field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenSupply + +`func (o *ProtocolParameters) SetTokenSupply(v string)` + +SetTokenSupply sets TokenSupply field to given value. + +### HasTokenSupply + +`func (o *ProtocolParameters) HasTokenSupply() bool` + +HasTokenSupply returns a boolean if a field has been set. + +### GetVersion + +`func (o *ProtocolParameters) GetVersion() int32` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *ProtocolParameters) GetVersionOk() (*int32, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *ProtocolParameters) SetVersion(v int32)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *ProtocolParameters) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + + +[[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/client/docs/ReceiptError.md b/client/docs/ReceiptError.md new file mode 100644 index 0000000000..2b0f3cbad3 --- /dev/null +++ b/client/docs/ReceiptError.md @@ -0,0 +1,186 @@ +# ReceiptError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContractId** | Pointer to **int32** | | [optional] +**ErrorCode** | Pointer to **string** | | [optional] +**ErrorId** | Pointer to **int32** | | [optional] +**Message** | Pointer to **string** | | [optional] +**MessageFormat** | Pointer to **string** | | [optional] +**Parameters** | Pointer to **[]string** | | [optional] + +## Methods + +### NewReceiptError + +`func NewReceiptError() *ReceiptError` + +NewReceiptError instantiates a new ReceiptError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReceiptErrorWithDefaults + +`func NewReceiptErrorWithDefaults() *ReceiptError` + +NewReceiptErrorWithDefaults instantiates a new ReceiptError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContractId + +`func (o *ReceiptError) GetContractId() int32` + +GetContractId returns the ContractId field if non-nil, zero value otherwise. + +### GetContractIdOk + +`func (o *ReceiptError) GetContractIdOk() (*int32, bool)` + +GetContractIdOk returns a tuple with the ContractId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContractId + +`func (o *ReceiptError) SetContractId(v int32)` + +SetContractId sets ContractId field to given value. + +### HasContractId + +`func (o *ReceiptError) HasContractId() bool` + +HasContractId returns a boolean if a field has been set. + +### GetErrorCode + +`func (o *ReceiptError) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *ReceiptError) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *ReceiptError) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *ReceiptError) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetErrorId + +`func (o *ReceiptError) GetErrorId() int32` + +GetErrorId returns the ErrorId field if non-nil, zero value otherwise. + +### GetErrorIdOk + +`func (o *ReceiptError) GetErrorIdOk() (*int32, bool)` + +GetErrorIdOk returns a tuple with the ErrorId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorId + +`func (o *ReceiptError) SetErrorId(v int32)` + +SetErrorId sets ErrorId field to given value. + +### HasErrorId + +`func (o *ReceiptError) HasErrorId() bool` + +HasErrorId returns a boolean if a field has been set. + +### GetMessage + +`func (o *ReceiptError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ReceiptError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ReceiptError) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ReceiptError) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMessageFormat + +`func (o *ReceiptError) GetMessageFormat() string` + +GetMessageFormat returns the MessageFormat field if non-nil, zero value otherwise. + +### GetMessageFormatOk + +`func (o *ReceiptError) GetMessageFormatOk() (*string, bool)` + +GetMessageFormatOk returns a tuple with the MessageFormat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessageFormat + +`func (o *ReceiptError) SetMessageFormat(v string)` + +SetMessageFormat sets MessageFormat field to given value. + +### HasMessageFormat + +`func (o *ReceiptError) HasMessageFormat() bool` + +HasMessageFormat returns a boolean if a field has been set. + +### GetParameters + +`func (o *ReceiptError) GetParameters() []string` + +GetParameters returns the Parameters field if non-nil, zero value otherwise. + +### GetParametersOk + +`func (o *ReceiptError) GetParametersOk() (*[]string, bool)` + +GetParametersOk returns a tuple with the Parameters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParameters + +`func (o *ReceiptError) SetParameters(v []string)` + +SetParameters sets Parameters field to given value. + +### HasParameters + +`func (o *ReceiptError) HasParameters() bool` + +HasParameters returns a boolean if a field has been set. + + +[[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/client/docs/ReceiptResponse.md b/client/docs/ReceiptResponse.md new file mode 100644 index 0000000000..8987ab13fa --- /dev/null +++ b/client/docs/ReceiptResponse.md @@ -0,0 +1,238 @@ +# ReceiptResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BlockIndex** | Pointer to **int32** | | [optional] +**Error** | Pointer to [**ReceiptError**](ReceiptError.md) | | [optional] +**GasBudget** | Pointer to **int64** | | [optional] +**GasBurnLog** | Pointer to [**[]BurnRecord**](BurnRecord.md) | | [optional] +**GasBurned** | Pointer to **int64** | | [optional] +**GasFeeCharged** | Pointer to **int64** | | [optional] +**Request** | Pointer to **string** | | [optional] +**RequestIndex** | Pointer to **int32** | | [optional] + +## Methods + +### NewReceiptResponse + +`func NewReceiptResponse() *ReceiptResponse` + +NewReceiptResponse instantiates a new ReceiptResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReceiptResponseWithDefaults + +`func NewReceiptResponseWithDefaults() *ReceiptResponse` + +NewReceiptResponseWithDefaults instantiates a new ReceiptResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBlockIndex + +`func (o *ReceiptResponse) GetBlockIndex() int32` + +GetBlockIndex returns the BlockIndex field if non-nil, zero value otherwise. + +### GetBlockIndexOk + +`func (o *ReceiptResponse) GetBlockIndexOk() (*int32, bool)` + +GetBlockIndexOk returns a tuple with the BlockIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockIndex + +`func (o *ReceiptResponse) SetBlockIndex(v int32)` + +SetBlockIndex sets BlockIndex field to given value. + +### HasBlockIndex + +`func (o *ReceiptResponse) HasBlockIndex() bool` + +HasBlockIndex returns a boolean if a field has been set. + +### GetError + +`func (o *ReceiptResponse) GetError() ReceiptError` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ReceiptResponse) GetErrorOk() (*ReceiptError, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ReceiptResponse) SetError(v ReceiptError)` + +SetError sets Error field to given value. + +### HasError + +`func (o *ReceiptResponse) HasError() bool` + +HasError returns a boolean if a field has been set. + +### GetGasBudget + +`func (o *ReceiptResponse) GetGasBudget() int64` + +GetGasBudget returns the GasBudget field if non-nil, zero value otherwise. + +### GetGasBudgetOk + +`func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool)` + +GetGasBudgetOk returns a tuple with the GasBudget field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBudget + +`func (o *ReceiptResponse) SetGasBudget(v int64)` + +SetGasBudget sets GasBudget field to given value. + +### HasGasBudget + +`func (o *ReceiptResponse) HasGasBudget() bool` + +HasGasBudget returns a boolean if a field has been set. + +### GetGasBurnLog + +`func (o *ReceiptResponse) GetGasBurnLog() []BurnRecord` + +GetGasBurnLog returns the GasBurnLog field if non-nil, zero value otherwise. + +### GetGasBurnLogOk + +`func (o *ReceiptResponse) GetGasBurnLogOk() (*[]BurnRecord, bool)` + +GetGasBurnLogOk returns a tuple with the GasBurnLog field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBurnLog + +`func (o *ReceiptResponse) SetGasBurnLog(v []BurnRecord)` + +SetGasBurnLog sets GasBurnLog field to given value. + +### HasGasBurnLog + +`func (o *ReceiptResponse) HasGasBurnLog() bool` + +HasGasBurnLog returns a boolean if a field has been set. + +### GetGasBurned + +`func (o *ReceiptResponse) GetGasBurned() int64` + +GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. + +### GetGasBurnedOk + +`func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool)` + +GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBurned + +`func (o *ReceiptResponse) SetGasBurned(v int64)` + +SetGasBurned sets GasBurned field to given value. + +### HasGasBurned + +`func (o *ReceiptResponse) HasGasBurned() bool` + +HasGasBurned returns a boolean if a field has been set. + +### GetGasFeeCharged + +`func (o *ReceiptResponse) GetGasFeeCharged() int64` + +GetGasFeeCharged returns the GasFeeCharged field if non-nil, zero value otherwise. + +### GetGasFeeChargedOk + +`func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool)` + +GetGasFeeChargedOk returns a tuple with the GasFeeCharged field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasFeeCharged + +`func (o *ReceiptResponse) SetGasFeeCharged(v int64)` + +SetGasFeeCharged sets GasFeeCharged field to given value. + +### HasGasFeeCharged + +`func (o *ReceiptResponse) HasGasFeeCharged() bool` + +HasGasFeeCharged returns a boolean if a field has been set. + +### GetRequest + +`func (o *ReceiptResponse) GetRequest() string` + +GetRequest returns the Request field if non-nil, zero value otherwise. + +### GetRequestOk + +`func (o *ReceiptResponse) GetRequestOk() (*string, bool)` + +GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequest + +`func (o *ReceiptResponse) SetRequest(v string)` + +SetRequest sets Request field to given value. + +### HasRequest + +`func (o *ReceiptResponse) HasRequest() bool` + +HasRequest returns a boolean if a field has been set. + +### GetRequestIndex + +`func (o *ReceiptResponse) GetRequestIndex() int32` + +GetRequestIndex returns the RequestIndex field if non-nil, zero value otherwise. + +### GetRequestIndexOk + +`func (o *ReceiptResponse) GetRequestIndexOk() (*int32, bool)` + +GetRequestIndexOk returns a tuple with the RequestIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestIndex + +`func (o *ReceiptResponse) SetRequestIndex(v int32)` + +SetRequestIndex sets RequestIndex field to given value. + +### HasRequestIndex + +`func (o *ReceiptResponse) HasRequestIndex() bool` + +HasRequestIndex returns a boolean if a field has been set. + + +[[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/client/docs/RentStructure.md b/client/docs/RentStructure.md new file mode 100644 index 0000000000..6e418f9e08 --- /dev/null +++ b/client/docs/RentStructure.md @@ -0,0 +1,108 @@ +# RentStructure + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VByteCost** | Pointer to **int32** | The virtual byte cost | [optional] +**VByteFactorData** | Pointer to **int32** | The virtual byte factor for data fields | [optional] +**VByteFactorKey** | Pointer to **int32** | The virtual byte factor for key/lookup generating fields | [optional] + +## Methods + +### NewRentStructure + +`func NewRentStructure() *RentStructure` + +NewRentStructure instantiates a new RentStructure object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRentStructureWithDefaults + +`func NewRentStructureWithDefaults() *RentStructure` + +NewRentStructureWithDefaults instantiates a new RentStructure object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVByteCost + +`func (o *RentStructure) GetVByteCost() int32` + +GetVByteCost returns the VByteCost field if non-nil, zero value otherwise. + +### GetVByteCostOk + +`func (o *RentStructure) GetVByteCostOk() (*int32, bool)` + +GetVByteCostOk returns a tuple with the VByteCost field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVByteCost + +`func (o *RentStructure) SetVByteCost(v int32)` + +SetVByteCost sets VByteCost field to given value. + +### HasVByteCost + +`func (o *RentStructure) HasVByteCost() bool` + +HasVByteCost returns a boolean if a field has been set. + +### GetVByteFactorData + +`func (o *RentStructure) GetVByteFactorData() int32` + +GetVByteFactorData returns the VByteFactorData field if non-nil, zero value otherwise. + +### GetVByteFactorDataOk + +`func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool)` + +GetVByteFactorDataOk returns a tuple with the VByteFactorData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVByteFactorData + +`func (o *RentStructure) SetVByteFactorData(v int32)` + +SetVByteFactorData sets VByteFactorData field to given value. + +### HasVByteFactorData + +`func (o *RentStructure) HasVByteFactorData() bool` + +HasVByteFactorData returns a boolean if a field has been set. + +### GetVByteFactorKey + +`func (o *RentStructure) GetVByteFactorKey() int32` + +GetVByteFactorKey returns the VByteFactorKey field if non-nil, zero value otherwise. + +### GetVByteFactorKeyOk + +`func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool)` + +GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVByteFactorKey + +`func (o *RentStructure) SetVByteFactorKey(v int32)` + +SetVByteFactorKey sets VByteFactorKey field to given value. + +### HasVByteFactorKey + +`func (o *RentStructure) HasVByteFactorKey() bool` + +HasVByteFactorKey returns a boolean if a field has been set. + + +[[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/client/docs/RequestDetail.md b/client/docs/RequestDetail.md new file mode 100644 index 0000000000..95f3fd5b18 --- /dev/null +++ b/client/docs/RequestDetail.md @@ -0,0 +1,316 @@ +# RequestDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Allowance** | Pointer to [**Allowance**](Allowance.md) | | [optional] +**CallTarget** | Pointer to [**CallTarget**](CallTarget.md) | | [optional] +**FungibleTokens** | Pointer to [**FungibleTokens**](FungibleTokens.md) | | [optional] +**GasGudget** | Pointer to **int64** | | [optional] +**IsEVM** | Pointer to **bool** | | [optional] +**IsOffLedger** | Pointer to **bool** | | [optional] +**Nft** | Pointer to [**NFTDataResponse**](NFTDataResponse.md) | | [optional] +**Params** | Pointer to [**JSONDict**](JSONDict.md) | | [optional] +**RequestId** | Pointer to **string** | | [optional] +**SenderAccount** | Pointer to **string** | | [optional] +**TargetAddress** | Pointer to **string** | | [optional] + +## Methods + +### NewRequestDetail + +`func NewRequestDetail() *RequestDetail` + +NewRequestDetail instantiates a new RequestDetail object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestDetailWithDefaults + +`func NewRequestDetailWithDefaults() *RequestDetail` + +NewRequestDetailWithDefaults instantiates a new RequestDetail object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAllowance + +`func (o *RequestDetail) GetAllowance() Allowance` + +GetAllowance returns the Allowance field if non-nil, zero value otherwise. + +### GetAllowanceOk + +`func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool)` + +GetAllowanceOk returns a tuple with the Allowance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllowance + +`func (o *RequestDetail) SetAllowance(v Allowance)` + +SetAllowance sets Allowance field to given value. + +### HasAllowance + +`func (o *RequestDetail) HasAllowance() bool` + +HasAllowance returns a boolean if a field has been set. + +### GetCallTarget + +`func (o *RequestDetail) GetCallTarget() CallTarget` + +GetCallTarget returns the CallTarget field if non-nil, zero value otherwise. + +### GetCallTargetOk + +`func (o *RequestDetail) GetCallTargetOk() (*CallTarget, bool)` + +GetCallTargetOk returns a tuple with the CallTarget field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCallTarget + +`func (o *RequestDetail) SetCallTarget(v CallTarget)` + +SetCallTarget sets CallTarget field to given value. + +### HasCallTarget + +`func (o *RequestDetail) HasCallTarget() bool` + +HasCallTarget returns a boolean if a field has been set. + +### GetFungibleTokens + +`func (o *RequestDetail) GetFungibleTokens() FungibleTokens` + +GetFungibleTokens returns the FungibleTokens field if non-nil, zero value otherwise. + +### GetFungibleTokensOk + +`func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool)` + +GetFungibleTokensOk returns a tuple with the FungibleTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFungibleTokens + +`func (o *RequestDetail) SetFungibleTokens(v FungibleTokens)` + +SetFungibleTokens sets FungibleTokens field to given value. + +### HasFungibleTokens + +`func (o *RequestDetail) HasFungibleTokens() bool` + +HasFungibleTokens returns a boolean if a field has been set. + +### GetGasGudget + +`func (o *RequestDetail) GetGasGudget() int64` + +GetGasGudget returns the GasGudget field if non-nil, zero value otherwise. + +### GetGasGudgetOk + +`func (o *RequestDetail) GetGasGudgetOk() (*int64, bool)` + +GetGasGudgetOk returns a tuple with the GasGudget field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasGudget + +`func (o *RequestDetail) SetGasGudget(v int64)` + +SetGasGudget sets GasGudget field to given value. + +### HasGasGudget + +`func (o *RequestDetail) HasGasGudget() bool` + +HasGasGudget returns a boolean if a field has been set. + +### GetIsEVM + +`func (o *RequestDetail) GetIsEVM() bool` + +GetIsEVM returns the IsEVM field if non-nil, zero value otherwise. + +### GetIsEVMOk + +`func (o *RequestDetail) GetIsEVMOk() (*bool, bool)` + +GetIsEVMOk returns a tuple with the IsEVM field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsEVM + +`func (o *RequestDetail) SetIsEVM(v bool)` + +SetIsEVM sets IsEVM field to given value. + +### HasIsEVM + +`func (o *RequestDetail) HasIsEVM() bool` + +HasIsEVM returns a boolean if a field has been set. + +### GetIsOffLedger + +`func (o *RequestDetail) GetIsOffLedger() bool` + +GetIsOffLedger returns the IsOffLedger field if non-nil, zero value otherwise. + +### GetIsOffLedgerOk + +`func (o *RequestDetail) GetIsOffLedgerOk() (*bool, bool)` + +GetIsOffLedgerOk returns a tuple with the IsOffLedger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsOffLedger + +`func (o *RequestDetail) SetIsOffLedger(v bool)` + +SetIsOffLedger sets IsOffLedger field to given value. + +### HasIsOffLedger + +`func (o *RequestDetail) HasIsOffLedger() bool` + +HasIsOffLedger returns a boolean if a field has been set. + +### GetNft + +`func (o *RequestDetail) GetNft() NFTDataResponse` + +GetNft returns the Nft field if non-nil, zero value otherwise. + +### GetNftOk + +`func (o *RequestDetail) GetNftOk() (*NFTDataResponse, bool)` + +GetNftOk returns a tuple with the Nft field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNft + +`func (o *RequestDetail) SetNft(v NFTDataResponse)` + +SetNft sets Nft field to given value. + +### HasNft + +`func (o *RequestDetail) HasNft() bool` + +HasNft returns a boolean if a field has been set. + +### GetParams + +`func (o *RequestDetail) GetParams() JSONDict` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *RequestDetail) GetParamsOk() (*JSONDict, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *RequestDetail) SetParams(v JSONDict)` + +SetParams sets Params field to given value. + +### HasParams + +`func (o *RequestDetail) HasParams() bool` + +HasParams returns a boolean if a field has been set. + +### GetRequestId + +`func (o *RequestDetail) GetRequestId() string` + +GetRequestId returns the RequestId field if non-nil, zero value otherwise. + +### GetRequestIdOk + +`func (o *RequestDetail) GetRequestIdOk() (*string, bool)` + +GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestId + +`func (o *RequestDetail) SetRequestId(v string)` + +SetRequestId sets RequestId field to given value. + +### HasRequestId + +`func (o *RequestDetail) HasRequestId() bool` + +HasRequestId returns a boolean if a field has been set. + +### GetSenderAccount + +`func (o *RequestDetail) GetSenderAccount() string` + +GetSenderAccount returns the SenderAccount field if non-nil, zero value otherwise. + +### GetSenderAccountOk + +`func (o *RequestDetail) GetSenderAccountOk() (*string, bool)` + +GetSenderAccountOk returns a tuple with the SenderAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSenderAccount + +`func (o *RequestDetail) SetSenderAccount(v string)` + +SetSenderAccount sets SenderAccount field to given value. + +### HasSenderAccount + +`func (o *RequestDetail) HasSenderAccount() bool` + +HasSenderAccount returns a boolean if a field has been set. + +### GetTargetAddress + +`func (o *RequestDetail) GetTargetAddress() string` + +GetTargetAddress returns the TargetAddress field if non-nil, zero value otherwise. + +### GetTargetAddressOk + +`func (o *RequestDetail) GetTargetAddressOk() (*string, bool)` + +GetTargetAddressOk returns a tuple with the TargetAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetAddress + +`func (o *RequestDetail) SetTargetAddress(v string)` + +SetTargetAddress sets TargetAddress field to given value. + +### HasTargetAddress + +`func (o *RequestDetail) HasTargetAddress() bool` + +HasTargetAddress returns a boolean if a field has been set. + + +[[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/client/docs/RequestIDsResponse.md b/client/docs/RequestIDsResponse.md new file mode 100644 index 0000000000..b4eb209f58 --- /dev/null +++ b/client/docs/RequestIDsResponse.md @@ -0,0 +1,56 @@ +# RequestIDsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewRequestIDsResponse + +`func NewRequestIDsResponse() *RequestIDsResponse` + +NewRequestIDsResponse instantiates a new RequestIDsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestIDsResponseWithDefaults + +`func NewRequestIDsResponseWithDefaults() *RequestIDsResponse` + +NewRequestIDsResponseWithDefaults instantiates a new RequestIDsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestIds + +`func (o *RequestIDsResponse) GetRequestIds() []string` + +GetRequestIds returns the RequestIds field if non-nil, zero value otherwise. + +### GetRequestIdsOk + +`func (o *RequestIDsResponse) GetRequestIdsOk() (*[]string, bool)` + +GetRequestIdsOk returns a tuple with the RequestIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestIds + +`func (o *RequestIDsResponse) SetRequestIds(v []string)` + +SetRequestIds sets RequestIds field to given value. + +### HasRequestIds + +`func (o *RequestIDsResponse) HasRequestIds() bool` + +HasRequestIds returns a boolean if a field has been set. + + +[[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/client/docs/RequestProcessedResponse.md b/client/docs/RequestProcessedResponse.md new file mode 100644 index 0000000000..8359a6140e --- /dev/null +++ b/client/docs/RequestProcessedResponse.md @@ -0,0 +1,108 @@ +# RequestProcessedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ChainId** | Pointer to **string** | | [optional] +**IsProcessed** | Pointer to **bool** | | [optional] +**RequestId** | Pointer to **string** | | [optional] + +## Methods + +### NewRequestProcessedResponse + +`func NewRequestProcessedResponse() *RequestProcessedResponse` + +NewRequestProcessedResponse instantiates a new RequestProcessedResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestProcessedResponseWithDefaults + +`func NewRequestProcessedResponseWithDefaults() *RequestProcessedResponse` + +NewRequestProcessedResponseWithDefaults instantiates a new RequestProcessedResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChainId + +`func (o *RequestProcessedResponse) GetChainId() string` + +GetChainId returns the ChainId field if non-nil, zero value otherwise. + +### GetChainIdOk + +`func (o *RequestProcessedResponse) GetChainIdOk() (*string, bool)` + +GetChainIdOk returns a tuple with the ChainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainId + +`func (o *RequestProcessedResponse) SetChainId(v string)` + +SetChainId sets ChainId field to given value. + +### HasChainId + +`func (o *RequestProcessedResponse) HasChainId() bool` + +HasChainId returns a boolean if a field has been set. + +### GetIsProcessed + +`func (o *RequestProcessedResponse) GetIsProcessed() bool` + +GetIsProcessed returns the IsProcessed field if non-nil, zero value otherwise. + +### GetIsProcessedOk + +`func (o *RequestProcessedResponse) GetIsProcessedOk() (*bool, bool)` + +GetIsProcessedOk returns a tuple with the IsProcessed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsProcessed + +`func (o *RequestProcessedResponse) SetIsProcessed(v bool)` + +SetIsProcessed sets IsProcessed field to given value. + +### HasIsProcessed + +`func (o *RequestProcessedResponse) HasIsProcessed() bool` + +HasIsProcessed returns a boolean if a field has been set. + +### GetRequestId + +`func (o *RequestProcessedResponse) GetRequestId() string` + +GetRequestId returns the RequestId field if non-nil, zero value otherwise. + +### GetRequestIdOk + +`func (o *RequestProcessedResponse) GetRequestIdOk() (*string, bool)` + +GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestId + +`func (o *RequestProcessedResponse) SetRequestId(v string)` + +SetRequestId sets RequestId field to given value. + +### HasRequestId + +`func (o *RequestProcessedResponse) HasRequestId() bool` + +HasRequestId returns a boolean if a field has been set. + + +[[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/client/docs/RequestReceiptResponse.md b/client/docs/RequestReceiptResponse.md new file mode 100644 index 0000000000..9861909e7f --- /dev/null +++ b/client/docs/RequestReceiptResponse.md @@ -0,0 +1,238 @@ +# RequestReceiptResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BlockIndex** | Pointer to **int32** | | [optional] +**Error** | Pointer to [**BlockReceiptError**](BlockReceiptError.md) | | [optional] +**GasBudget** | Pointer to **int64** | | [optional] +**GasBurnLog** | Pointer to [**BurnLog**](BurnLog.md) | | [optional] +**GasBurned** | Pointer to **int64** | | [optional] +**GasFeeCharged** | Pointer to **int64** | | [optional] +**Request** | Pointer to [**RequestDetail**](RequestDetail.md) | | [optional] +**RequestIndex** | Pointer to **int32** | | [optional] + +## Methods + +### NewRequestReceiptResponse + +`func NewRequestReceiptResponse() *RequestReceiptResponse` + +NewRequestReceiptResponse instantiates a new RequestReceiptResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestReceiptResponseWithDefaults + +`func NewRequestReceiptResponseWithDefaults() *RequestReceiptResponse` + +NewRequestReceiptResponseWithDefaults instantiates a new RequestReceiptResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBlockIndex + +`func (o *RequestReceiptResponse) GetBlockIndex() int32` + +GetBlockIndex returns the BlockIndex field if non-nil, zero value otherwise. + +### GetBlockIndexOk + +`func (o *RequestReceiptResponse) GetBlockIndexOk() (*int32, bool)` + +GetBlockIndexOk returns a tuple with the BlockIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBlockIndex + +`func (o *RequestReceiptResponse) SetBlockIndex(v int32)` + +SetBlockIndex sets BlockIndex field to given value. + +### HasBlockIndex + +`func (o *RequestReceiptResponse) HasBlockIndex() bool` + +HasBlockIndex returns a boolean if a field has been set. + +### GetError + +`func (o *RequestReceiptResponse) GetError() BlockReceiptError` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *RequestReceiptResponse) GetErrorOk() (*BlockReceiptError, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *RequestReceiptResponse) SetError(v BlockReceiptError)` + +SetError sets Error field to given value. + +### HasError + +`func (o *RequestReceiptResponse) HasError() bool` + +HasError returns a boolean if a field has been set. + +### GetGasBudget + +`func (o *RequestReceiptResponse) GetGasBudget() int64` + +GetGasBudget returns the GasBudget field if non-nil, zero value otherwise. + +### GetGasBudgetOk + +`func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool)` + +GetGasBudgetOk returns a tuple with the GasBudget field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBudget + +`func (o *RequestReceiptResponse) SetGasBudget(v int64)` + +SetGasBudget sets GasBudget field to given value. + +### HasGasBudget + +`func (o *RequestReceiptResponse) HasGasBudget() bool` + +HasGasBudget returns a boolean if a field has been set. + +### GetGasBurnLog + +`func (o *RequestReceiptResponse) GetGasBurnLog() BurnLog` + +GetGasBurnLog returns the GasBurnLog field if non-nil, zero value otherwise. + +### GetGasBurnLogOk + +`func (o *RequestReceiptResponse) GetGasBurnLogOk() (*BurnLog, bool)` + +GetGasBurnLogOk returns a tuple with the GasBurnLog field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBurnLog + +`func (o *RequestReceiptResponse) SetGasBurnLog(v BurnLog)` + +SetGasBurnLog sets GasBurnLog field to given value. + +### HasGasBurnLog + +`func (o *RequestReceiptResponse) HasGasBurnLog() bool` + +HasGasBurnLog returns a boolean if a field has been set. + +### GetGasBurned + +`func (o *RequestReceiptResponse) GetGasBurned() int64` + +GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. + +### GetGasBurnedOk + +`func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool)` + +GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasBurned + +`func (o *RequestReceiptResponse) SetGasBurned(v int64)` + +SetGasBurned sets GasBurned field to given value. + +### HasGasBurned + +`func (o *RequestReceiptResponse) HasGasBurned() bool` + +HasGasBurned returns a boolean if a field has been set. + +### GetGasFeeCharged + +`func (o *RequestReceiptResponse) GetGasFeeCharged() int64` + +GetGasFeeCharged returns the GasFeeCharged field if non-nil, zero value otherwise. + +### GetGasFeeChargedOk + +`func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool)` + +GetGasFeeChargedOk returns a tuple with the GasFeeCharged field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGasFeeCharged + +`func (o *RequestReceiptResponse) SetGasFeeCharged(v int64)` + +SetGasFeeCharged sets GasFeeCharged field to given value. + +### HasGasFeeCharged + +`func (o *RequestReceiptResponse) HasGasFeeCharged() bool` + +HasGasFeeCharged returns a boolean if a field has been set. + +### GetRequest + +`func (o *RequestReceiptResponse) GetRequest() RequestDetail` + +GetRequest returns the Request field if non-nil, zero value otherwise. + +### GetRequestOk + +`func (o *RequestReceiptResponse) GetRequestOk() (*RequestDetail, bool)` + +GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequest + +`func (o *RequestReceiptResponse) SetRequest(v RequestDetail)` + +SetRequest sets Request field to given value. + +### HasRequest + +`func (o *RequestReceiptResponse) HasRequest() bool` + +HasRequest returns a boolean if a field has been set. + +### GetRequestIndex + +`func (o *RequestReceiptResponse) GetRequestIndex() int32` + +GetRequestIndex returns the RequestIndex field if non-nil, zero value otherwise. + +### GetRequestIndexOk + +`func (o *RequestReceiptResponse) GetRequestIndexOk() (*int32, bool)` + +GetRequestIndexOk returns a tuple with the RequestIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestIndex + +`func (o *RequestReceiptResponse) SetRequestIndex(v int32)` + +SetRequestIndex sets RequestIndex field to given value. + +### HasRequestIndex + +`func (o *RequestReceiptResponse) HasRequestIndex() bool` + +HasRequestIndex returns a boolean if a field has been set. + + +[[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/client/docs/RequestsApi.md b/client/docs/RequestsApi.md new file mode 100644 index 0000000000..b59ece6efc --- /dev/null +++ b/client/docs/RequestsApi.md @@ -0,0 +1,282 @@ +# \RequestsApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CallView**](RequestsApi.md#CallView) | **Post** /v2/requests/callview | Call a view function on a contract by Hname +[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2/chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2/requests/offledger | Post an off-ledger request +[**WaitForTransaction**](RequestsApi.md#WaitForTransaction) | **Get** /v2/chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node + + + +## CallView + +> JSONDict CallView(ctx).ContractCallViewRequest(contractCallViewRequest).Execute() + +Call a view function on a contract by Hname + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + contractCallViewRequest := *openapiclient.NewContractCallViewRequest() // ContractCallViewRequest | Parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RequestsApi.CallView(context.Background()).ContractCallViewRequest(contractCallViewRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.CallView``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CallView`: JSONDict + fmt.Fprintf(os.Stdout, "Response from `RequestsApi.CallView`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCallViewRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contractCallViewRequest** | [**ContractCallViewRequest**](ContractCallViewRequest.md) | Parameters | + +### Return type + +[**JSONDict**](JSONDict.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## GetReceipt + +> ReceiptResponse GetReceipt(ctx, chainID, requestID).Execute() + +Get a receipt from a request ID + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + requestID := "requestID_example" // string | RequestID (Hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RequestsApi.GetReceipt(context.Background(), chainID, requestID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.GetReceipt``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetReceipt`: ReceiptResponse + fmt.Fprintf(os.Stdout, "Response from `RequestsApi.GetReceipt`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**requestID** | **string** | RequestID (Hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetReceiptRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**ReceiptResponse**](ReceiptResponse.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) + + +## OffLedger + +> OffLedger(ctx).OffLedgerRequest(offLedgerRequest).Execute() + +Post an off-ledger request + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + offLedgerRequest := *openapiclient.NewOffLedgerRequest() // OffLedgerRequest | Offledger request as JSON. Request encoded in Hex (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RequestsApi.OffLedger(context.Background()).OffLedgerRequest(offLedgerRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.OffLedger``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiOffLedgerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offLedgerRequest** | [**OffLedgerRequest**](OffLedgerRequest.md) | Offledger request as JSON. Request encoded in Hex | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + +## WaitForTransaction + +> ReceiptResponse WaitForTransaction(ctx, chainID, requestID).Execute() + +Wait until the given request has been processed by the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + requestID := "requestID_example" // string | RequestID (Hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RequestsApi.WaitForTransaction(context.Background(), chainID, requestID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.WaitForTransaction``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `WaitForTransaction`: ReceiptResponse + fmt.Fprintf(os.Stdout, "Response from `RequestsApi.WaitForTransaction`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | +**requestID** | **string** | RequestID (Hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiWaitForTransactionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**ReceiptResponse**](ReceiptResponse.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/client/docs/Transaction.md b/client/docs/Transaction.md new file mode 100644 index 0000000000..af52a8a260 --- /dev/null +++ b/client/docs/Transaction.md @@ -0,0 +1,56 @@ +# Transaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TxId** | Pointer to **string** | The transaction ID | [optional] + +## Methods + +### NewTransaction + +`func NewTransaction() *Transaction` + +NewTransaction instantiates a new Transaction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransactionWithDefaults + +`func NewTransactionWithDefaults() *Transaction` + +NewTransactionWithDefaults instantiates a new Transaction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTxId + +`func (o *Transaction) GetTxId() string` + +GetTxId returns the TxId field if non-nil, zero value otherwise. + +### GetTxIdOk + +`func (o *Transaction) GetTxIdOk() (*string, bool)` + +GetTxIdOk returns a tuple with the TxId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTxId + +`func (o *Transaction) SetTxId(v string)` + +SetTxId sets TxId field to given value. + +### HasTxId + +`func (o *Transaction) HasTxId() bool` + +HasTxId returns a boolean if a field has been set. + + +[[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/client/docs/TransactionIDMetricItem.md b/client/docs/TransactionIDMetricItem.md new file mode 100644 index 0000000000..7ab38d163e --- /dev/null +++ b/client/docs/TransactionIDMetricItem.md @@ -0,0 +1,108 @@ +# TransactionIDMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**Transaction**](Transaction.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewTransactionIDMetricItem + +`func NewTransactionIDMetricItem() *TransactionIDMetricItem` + +NewTransactionIDMetricItem instantiates a new TransactionIDMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransactionIDMetricItemWithDefaults + +`func NewTransactionIDMetricItemWithDefaults() *TransactionIDMetricItem` + +NewTransactionIDMetricItemWithDefaults instantiates a new TransactionIDMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *TransactionIDMetricItem) GetLastMessage() Transaction` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *TransactionIDMetricItem) GetLastMessageOk() (*Transaction, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *TransactionIDMetricItem) SetLastMessage(v Transaction)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *TransactionIDMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *TransactionIDMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *TransactionIDMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *TransactionIDMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *TransactionIDMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *TransactionIDMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *TransactionIDMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *TransactionIDMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *TransactionIDMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/TransactionMetricItem.md b/client/docs/TransactionMetricItem.md new file mode 100644 index 0000000000..0a092291f3 --- /dev/null +++ b/client/docs/TransactionMetricItem.md @@ -0,0 +1,108 @@ +# TransactionMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**Transaction**](Transaction.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewTransactionMetricItem + +`func NewTransactionMetricItem() *TransactionMetricItem` + +NewTransactionMetricItem instantiates a new TransactionMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransactionMetricItemWithDefaults + +`func NewTransactionMetricItemWithDefaults() *TransactionMetricItem` + +NewTransactionMetricItemWithDefaults instantiates a new TransactionMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *TransactionMetricItem) GetLastMessage() Transaction` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *TransactionMetricItem) GetLastMessageOk() (*Transaction, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *TransactionMetricItem) SetLastMessage(v Transaction)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *TransactionMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *TransactionMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *TransactionMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *TransactionMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *TransactionMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *TransactionMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *TransactionMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *TransactionMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *TransactionMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/TxInclusionStateMsg.md b/client/docs/TxInclusionStateMsg.md new file mode 100644 index 0000000000..da958e7bb9 --- /dev/null +++ b/client/docs/TxInclusionStateMsg.md @@ -0,0 +1,82 @@ +# TxInclusionStateMsg + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**State** | Pointer to **string** | The inclusion state | [optional] +**TxId** | Pointer to **string** | The transaction ID | [optional] + +## Methods + +### NewTxInclusionStateMsg + +`func NewTxInclusionStateMsg() *TxInclusionStateMsg` + +NewTxInclusionStateMsg instantiates a new TxInclusionStateMsg object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTxInclusionStateMsgWithDefaults + +`func NewTxInclusionStateMsgWithDefaults() *TxInclusionStateMsg` + +NewTxInclusionStateMsgWithDefaults instantiates a new TxInclusionStateMsg object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetState + +`func (o *TxInclusionStateMsg) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *TxInclusionStateMsg) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *TxInclusionStateMsg) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *TxInclusionStateMsg) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTxId + +`func (o *TxInclusionStateMsg) GetTxId() string` + +GetTxId returns the TxId field if non-nil, zero value otherwise. + +### GetTxIdOk + +`func (o *TxInclusionStateMsg) GetTxIdOk() (*string, bool)` + +GetTxIdOk returns a tuple with the TxId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTxId + +`func (o *TxInclusionStateMsg) SetTxId(v string)` + +SetTxId sets TxId field to given value. + +### HasTxId + +`func (o *TxInclusionStateMsg) HasTxId() bool` + +HasTxId returns a boolean if a field has been set. + + +[[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/client/docs/TxInclusionStateMsgMetricItem.md b/client/docs/TxInclusionStateMsgMetricItem.md new file mode 100644 index 0000000000..694a68c6e6 --- /dev/null +++ b/client/docs/TxInclusionStateMsgMetricItem.md @@ -0,0 +1,108 @@ +# TxInclusionStateMsgMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**TxInclusionStateMsg**](TxInclusionStateMsg.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewTxInclusionStateMsgMetricItem + +`func NewTxInclusionStateMsgMetricItem() *TxInclusionStateMsgMetricItem` + +NewTxInclusionStateMsgMetricItem instantiates a new TxInclusionStateMsgMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTxInclusionStateMsgMetricItemWithDefaults + +`func NewTxInclusionStateMsgMetricItemWithDefaults() *TxInclusionStateMsgMetricItem` + +NewTxInclusionStateMsgMetricItemWithDefaults instantiates a new TxInclusionStateMsgMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *TxInclusionStateMsgMetricItem) GetLastMessage() TxInclusionStateMsg` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *TxInclusionStateMsgMetricItem) GetLastMessageOk() (*TxInclusionStateMsg, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *TxInclusionStateMsgMetricItem) SetLastMessage(v TxInclusionStateMsg)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *TxInclusionStateMsgMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *TxInclusionStateMsgMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *TxInclusionStateMsgMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *TxInclusionStateMsgMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *TxInclusionStateMsgMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *TxInclusionStateMsgMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *TxInclusionStateMsgMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *TxInclusionStateMsgMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *TxInclusionStateMsgMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/UTXOInputMetricItem.md b/client/docs/UTXOInputMetricItem.md new file mode 100644 index 0000000000..415ead931e --- /dev/null +++ b/client/docs/UTXOInputMetricItem.md @@ -0,0 +1,108 @@ +# UTXOInputMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | Pointer to [**OutputID**](OutputID.md) | | [optional] +**Messages** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewUTXOInputMetricItem + +`func NewUTXOInputMetricItem() *UTXOInputMetricItem` + +NewUTXOInputMetricItem instantiates a new UTXOInputMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUTXOInputMetricItemWithDefaults + +`func NewUTXOInputMetricItemWithDefaults() *UTXOInputMetricItem` + +NewUTXOInputMetricItemWithDefaults instantiates a new UTXOInputMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *UTXOInputMetricItem) GetLastMessage() OutputID` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *UTXOInputMetricItem) GetLastMessageOk() (*OutputID, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *UTXOInputMetricItem) SetLastMessage(v OutputID)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *UTXOInputMetricItem) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetMessages + +`func (o *UTXOInputMetricItem) GetMessages() int32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *UTXOInputMetricItem) GetMessagesOk() (*int32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *UTXOInputMetricItem) SetMessages(v int32)` + +SetMessages sets Messages field to given value. + +### HasMessages + +`func (o *UTXOInputMetricItem) HasMessages() bool` + +HasMessages returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *UTXOInputMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *UTXOInputMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *UTXOInputMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *UTXOInputMetricItem) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/client/docs/UpdateUserPasswordRequest.md b/client/docs/UpdateUserPasswordRequest.md new file mode 100644 index 0000000000..1dc9099a0e --- /dev/null +++ b/client/docs/UpdateUserPasswordRequest.md @@ -0,0 +1,56 @@ +# UpdateUserPasswordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Password** | Pointer to **string** | | [optional] + +## Methods + +### NewUpdateUserPasswordRequest + +`func NewUpdateUserPasswordRequest() *UpdateUserPasswordRequest` + +NewUpdateUserPasswordRequest instantiates a new UpdateUserPasswordRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateUserPasswordRequestWithDefaults + +`func NewUpdateUserPasswordRequestWithDefaults() *UpdateUserPasswordRequest` + +NewUpdateUserPasswordRequestWithDefaults instantiates a new UpdateUserPasswordRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPassword + +`func (o *UpdateUserPasswordRequest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *UpdateUserPasswordRequest) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *UpdateUserPasswordRequest) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *UpdateUserPasswordRequest) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + + +[[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/client/docs/UpdateUserPermissionsRequest.md b/client/docs/UpdateUserPermissionsRequest.md new file mode 100644 index 0000000000..de9b96c65e --- /dev/null +++ b/client/docs/UpdateUserPermissionsRequest.md @@ -0,0 +1,56 @@ +# UpdateUserPermissionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Permissions** | Pointer to **[]string** | | [optional] + +## Methods + +### NewUpdateUserPermissionsRequest + +`func NewUpdateUserPermissionsRequest() *UpdateUserPermissionsRequest` + +NewUpdateUserPermissionsRequest instantiates a new UpdateUserPermissionsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateUserPermissionsRequestWithDefaults + +`func NewUpdateUserPermissionsRequestWithDefaults() *UpdateUserPermissionsRequest` + +NewUpdateUserPermissionsRequestWithDefaults instantiates a new UpdateUserPermissionsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPermissions + +`func (o *UpdateUserPermissionsRequest) GetPermissions() []string` + +GetPermissions returns the Permissions field if non-nil, zero value otherwise. + +### GetPermissionsOk + +`func (o *UpdateUserPermissionsRequest) GetPermissionsOk() (*[]string, bool)` + +GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermissions + +`func (o *UpdateUserPermissionsRequest) SetPermissions(v []string)` + +SetPermissions sets Permissions field to given value. + +### HasPermissions + +`func (o *UpdateUserPermissionsRequest) HasPermissions() bool` + +HasPermissions returns a boolean if a field has been set. + + +[[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/client/docs/User.md b/client/docs/User.md new file mode 100644 index 0000000000..a22f160795 --- /dev/null +++ b/client/docs/User.md @@ -0,0 +1,82 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Permissions** | Pointer to **[]string** | | [optional] +**Username** | Pointer to **string** | | [optional] + +## Methods + +### NewUser + +`func NewUser() *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPermissions + +`func (o *User) GetPermissions() []string` + +GetPermissions returns the Permissions field if non-nil, zero value otherwise. + +### GetPermissionsOk + +`func (o *User) GetPermissionsOk() (*[]string, bool)` + +GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermissions + +`func (o *User) SetPermissions(v []string)` + +SetPermissions sets Permissions field to given value. + +### HasPermissions + +`func (o *User) HasPermissions() bool` + +HasPermissions returns a boolean if a field has been set. + +### GetUsername + +`func (o *User) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *User) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *User) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *User) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + + +[[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/client/docs/UsersApi.md b/client/docs/UsersApi.md new file mode 100644 index 0000000000..8a0eb8c6de --- /dev/null +++ b/client/docs/UsersApi.md @@ -0,0 +1,405 @@ +# \UsersApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddUser**](UsersApi.md#AddUser) | **Post** /users | Add a user +[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /users/{username}/password | Change user password +[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /users/{username}/permissions | Change user permissions +[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /users/{username} | Deletes a user +[**GetUser**](UsersApi.md#GetUser) | **Get** /users/{username} | Get a user +[**GetUsers**](UsersApi.md#GetUsers) | **Get** /users | Get a list of all users + + + +## AddUser + +> AddUser(ctx).AddUserRequest(addUserRequest).Execute() + +Add a user + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + addUserRequest := *openapiclient.NewAddUserRequest() // AddUserRequest | The user data + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.AddUser(context.Background()).AddUserRequest(addUserRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.AddUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addUserRequest** | [**AddUserRequest**](AddUserRequest.md) | The user data | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChangeUserPassword + +> ChangeUserPassword(ctx, username).UpdateUserPasswordRequest(updateUserPasswordRequest).Execute() + +Change user password + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The username. + updateUserPasswordRequest := *openapiclient.NewUpdateUserPasswordRequest() // UpdateUserPasswordRequest | The users new password + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.ChangeUserPassword(context.Background(), username).UpdateUserPasswordRequest(updateUserPasswordRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ChangeUserPassword``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChangeUserPasswordRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateUserPasswordRequest** | [**UpdateUserPasswordRequest**](UpdateUserPasswordRequest.md) | The users new password | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChangeUserPermissions + +> ChangeUserPermissions(ctx, username).UpdateUserPermissionsRequest(updateUserPermissionsRequest).Execute() + +Change user permissions + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The username. + updateUserPermissionsRequest := *openapiclient.NewUpdateUserPermissionsRequest() // UpdateUserPermissionsRequest | The users new permissions + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.ChangeUserPermissions(context.Background(), username).UpdateUserPermissionsRequest(updateUserPermissionsRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ChangeUserPermissions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChangeUserPermissionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateUserPermissionsRequest** | [**UpdateUserPermissionsRequest**](UpdateUserPermissionsRequest.md) | The users new permissions | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## DeleteUser + +> DeleteUser(ctx, username).Execute() + +Deletes a user + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The username + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetUser + +> User GetUser(ctx, username).Execute() + +Get a user + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The username + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.GetUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.GetUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUser`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.GetUser`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**User**](User.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + +## GetUsers + +> []User GetUsers(ctx).Execute() + +Get a list of all users + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.GetUsers(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.GetUsers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUsers`: []User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.GetUsers`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUsersRequest struct via the builder pattern + + +### Return type + +[**[]User**](User.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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/client/docs/ValidationError.md b/client/docs/ValidationError.md new file mode 100644 index 0000000000..5077844fdb --- /dev/null +++ b/client/docs/ValidationError.md @@ -0,0 +1,82 @@ +# ValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | Pointer to **string** | | [optional] +**MissingPermission** | Pointer to **string** | | [optional] + +## Methods + +### NewValidationError + +`func NewValidationError() *ValidationError` + +NewValidationError instantiates a new ValidationError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewValidationErrorWithDefaults + +`func NewValidationErrorWithDefaults() *ValidationError` + +NewValidationErrorWithDefaults instantiates a new ValidationError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *ValidationError) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ValidationError) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ValidationError) SetError(v string)` + +SetError sets Error field to given value. + +### HasError + +`func (o *ValidationError) HasError() bool` + +HasError returns a boolean if a field has been set. + +### GetMissingPermission + +`func (o *ValidationError) GetMissingPermission() string` + +GetMissingPermission returns the MissingPermission field if non-nil, zero value otherwise. + +### GetMissingPermissionOk + +`func (o *ValidationError) GetMissingPermissionOk() (*string, bool)` + +GetMissingPermissionOk returns a tuple with the MissingPermission field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMissingPermission + +`func (o *ValidationError) SetMissingPermission(v string)` + +SetMissingPermission sets MissingPermission field to given value. + +### HasMissingPermission + +`func (o *ValidationError) HasMissingPermission() bool` + +HasMissingPermission returns a boolean if a field has been set. + + +[[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/client/evm.go b/client/evm.go deleted file mode 100644 index a545af583b..0000000000 --- a/client/evm.go +++ /dev/null @@ -1,19 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/ethereum/go-ethereum/common" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func (c *WaspClient) RequestIDByEVMTransactionHash(chainID isc.ChainID, txHash common.Hash) (isc.RequestID, error) { - var res model.RequestID - if err := c.do(http.MethodGet, routes.RequestIDByEVMTransactionHash(chainID.String(), txHash.String()), nil, &res); err != nil { - return isc.RequestID{}, err - } - return res.RequestID(), nil -} diff --git a/client/gas.go b/client/gas.go deleted file mode 100644 index f5a9c9f1a9..0000000000 --- a/client/gas.go +++ /dev/null @@ -1,15 +0,0 @@ -package client - -import ( - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/vm/gas" -) - -func (c *WaspClient) GetGasFeePolicy(chainID isc.ChainID) (*gas.GasFeePolicy, error) { - res, err := c.CallViewByHname(chainID, governance.Contract.Hname(), governance.ViewGetFeePolicy.Hname(), nil) - if err != nil { - return nil, err - } - return gas.FeePolicyFromBytes(res.MustGet(governance.ParamFeePolicyBytes)) -} diff --git a/client/git_push.sh b/client/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/client/go.mod b/client/go.mod new file mode 100644 index 0000000000..ead32606c7 --- /dev/null +++ b/client/go.mod @@ -0,0 +1,7 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +go 1.13 + +require ( + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 +) diff --git a/client/go.sum b/client/go.sum new file mode 100644 index 0000000000..734252e681 --- /dev/null +++ b/client/go.sum @@ -0,0 +1,13 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/client/info.go b/client/info.go deleted file mode 100644 index 98f4a89d74..0000000000 --- a/client/info.go +++ /dev/null @@ -1,17 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// Info fetches general information about the node. -func (c *WaspClient) Info() (*model.InfoResponse, error) { - res := &model.InfoResponse{} - if err := c.do(http.MethodGet, routes.Info(), nil, res); err != nil { - return nil, err - } - return res, nil -} diff --git a/client/metrics.go b/client/metrics.go deleted file mode 100644 index 79098cbe7b..0000000000 --- a/client/metrics.go +++ /dev/null @@ -1,44 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// GetNodeConnectionMetrics fetches a connection to L1 metrics for all addresses -func (c *WaspClient) GetNodeConnectionMetrics() (*model.NodeConnectionMetrics, error) { - ncm := &model.NodeConnectionMetrics{} - if err := c.do(http.MethodGet, routes.GetChainsNodeConnectionMetrics(), nil, ncm); err != nil { - return nil, err - } - return ncm, nil -} - -// GetNodeConnectionMetrics fetches a connection to L1 metrics by address -func (c *WaspClient) GetChainNodeConnectionMetrics(chainID isc.ChainID) (*model.NodeConnectionMessagesMetrics, error) { - ncmm := &model.NodeConnectionMessagesMetrics{} - if err := c.do(http.MethodGet, routes.GetChainNodeConnectionMetrics(chainID.String()), nil, ncmm); err != nil { - return nil, err - } - return ncmm, nil -} - -// GetNodeConnectionMetrics fetches a consensus workflow status by address -func (c *WaspClient) GetChainConsensusWorkflowStatus(chainID isc.ChainID) (*model.ConsensusWorkflowStatus, error) { - ncmm := &model.ConsensusWorkflowStatus{} - if err := c.do(http.MethodGet, routes.GetChainConsensusWorkflowStatus(chainID.String()), nil, ncmm); err != nil { - return nil, err - } - return ncmm, nil -} - -func (c *WaspClient) GetChainConsensusPipeMetrics(chainID isc.ChainID) (*model.ConsensusPipeMetrics, error) { - ncmm := &model.ConsensusPipeMetrics{} - if err := c.do(http.MethodGet, routes.GetChainConsensusPipeMetrics(chainID.String()), nil, ncmm); err != nil { - return nil, err - } - return ncmm, nil -} diff --git a/client/model_account_list_response.go b/client/model_account_list_response.go new file mode 100644 index 0000000000..ffc18cb075 --- /dev/null +++ b/client/model_account_list_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// AccountListResponse struct for AccountListResponse +type AccountListResponse struct { + Accounts []string `json:"accounts,omitempty"` +} + +// NewAccountListResponse instantiates a new AccountListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountListResponse() *AccountListResponse { + this := AccountListResponse{} + return &this +} + +// NewAccountListResponseWithDefaults instantiates a new AccountListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountListResponseWithDefaults() *AccountListResponse { + this := AccountListResponse{} + return &this +} + +// GetAccounts returns the Accounts field value if set, zero value otherwise. +func (o *AccountListResponse) GetAccounts() []string { + if o == nil || isNil(o.Accounts) { + var ret []string + return ret + } + return o.Accounts +} + +// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountListResponse) GetAccountsOk() ([]string, bool) { + if o == nil || isNil(o.Accounts) { + return nil, false + } + return o.Accounts, true +} + +// HasAccounts returns a boolean if a field has been set. +func (o *AccountListResponse) HasAccounts() bool { + if o != nil && !isNil(o.Accounts) { + return true + } + + return false +} + +// SetAccounts gets a reference to the given []string and assigns it to the Accounts field. +func (o *AccountListResponse) SetAccounts(v []string) { + o.Accounts = v +} + +func (o AccountListResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Accounts) { + toSerialize["accounts"] = o.Accounts + } + return json.Marshal(toSerialize) +} + +type NullableAccountListResponse struct { + value *AccountListResponse + isSet bool +} + +func (v NullableAccountListResponse) Get() *AccountListResponse { + return v.value +} + +func (v *NullableAccountListResponse) Set(val *AccountListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAccountListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountListResponse(val *AccountListResponse) *NullableAccountListResponse { + return &NullableAccountListResponse{value: val, isSet: true} +} + +func (v NullableAccountListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_account_nfts_response.go b/client/model_account_nfts_response.go new file mode 100644 index 0000000000..ae3d339726 --- /dev/null +++ b/client/model_account_nfts_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// AccountNFTsResponse struct for AccountNFTsResponse +type AccountNFTsResponse struct { + NftIds []string `json:"nftIds,omitempty"` +} + +// NewAccountNFTsResponse instantiates a new AccountNFTsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountNFTsResponse() *AccountNFTsResponse { + this := AccountNFTsResponse{} + return &this +} + +// NewAccountNFTsResponseWithDefaults instantiates a new AccountNFTsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountNFTsResponseWithDefaults() *AccountNFTsResponse { + this := AccountNFTsResponse{} + return &this +} + +// GetNftIds returns the NftIds field value if set, zero value otherwise. +func (o *AccountNFTsResponse) GetNftIds() []string { + if o == nil || isNil(o.NftIds) { + var ret []string + return ret + } + return o.NftIds +} + +// GetNftIdsOk returns a tuple with the NftIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountNFTsResponse) GetNftIdsOk() ([]string, bool) { + if o == nil || isNil(o.NftIds) { + return nil, false + } + return o.NftIds, true +} + +// HasNftIds returns a boolean if a field has been set. +func (o *AccountNFTsResponse) HasNftIds() bool { + if o != nil && !isNil(o.NftIds) { + return true + } + + return false +} + +// SetNftIds gets a reference to the given []string and assigns it to the NftIds field. +func (o *AccountNFTsResponse) SetNftIds(v []string) { + o.NftIds = v +} + +func (o AccountNFTsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.NftIds) { + toSerialize["nftIds"] = o.NftIds + } + return json.Marshal(toSerialize) +} + +type NullableAccountNFTsResponse struct { + value *AccountNFTsResponse + isSet bool +} + +func (v NullableAccountNFTsResponse) Get() *AccountNFTsResponse { + return v.value +} + +func (v *NullableAccountNFTsResponse) Set(val *AccountNFTsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAccountNFTsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountNFTsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountNFTsResponse(val *AccountNFTsResponse) *NullableAccountNFTsResponse { + return &NullableAccountNFTsResponse{value: val, isSet: true} +} + +func (v NullableAccountNFTsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountNFTsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_account_nonce_response.go b/client/model_account_nonce_response.go new file mode 100644 index 0000000000..9168ba0cc4 --- /dev/null +++ b/client/model_account_nonce_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// AccountNonceResponse struct for AccountNonceResponse +type AccountNonceResponse struct { + Nonce *int64 `json:"nonce,omitempty"` +} + +// NewAccountNonceResponse instantiates a new AccountNonceResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccountNonceResponse() *AccountNonceResponse { + this := AccountNonceResponse{} + return &this +} + +// NewAccountNonceResponseWithDefaults instantiates a new AccountNonceResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccountNonceResponseWithDefaults() *AccountNonceResponse { + this := AccountNonceResponse{} + return &this +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *AccountNonceResponse) GetNonce() int64 { + if o == nil || isNil(o.Nonce) { + var ret int64 + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccountNonceResponse) GetNonceOk() (*int64, bool) { + if o == nil || isNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *AccountNonceResponse) HasNonce() bool { + if o != nil && !isNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given int64 and assigns it to the Nonce field. +func (o *AccountNonceResponse) SetNonce(v int64) { + o.Nonce = &v +} + +func (o AccountNonceResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + return json.Marshal(toSerialize) +} + +type NullableAccountNonceResponse struct { + value *AccountNonceResponse + isSet bool +} + +func (v NullableAccountNonceResponse) Get() *AccountNonceResponse { + return v.value +} + +func (v *NullableAccountNonceResponse) Set(val *AccountNonceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAccountNonceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAccountNonceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccountNonceResponse(val *AccountNonceResponse) *NullableAccountNonceResponse { + return &NullableAccountNonceResponse{value: val, isSet: true} +} + +func (v NullableAccountNonceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccountNonceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_add_user_request.go b/client/model_add_user_request.go new file mode 100644 index 0000000000..0794964b64 --- /dev/null +++ b/client/model_add_user_request.go @@ -0,0 +1,187 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// AddUserRequest struct for AddUserRequest +type AddUserRequest struct { + Password *string `json:"password,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewAddUserRequest instantiates a new AddUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddUserRequest() *AddUserRequest { + this := AddUserRequest{} + return &this +} + +// NewAddUserRequestWithDefaults instantiates a new AddUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddUserRequestWithDefaults() *AddUserRequest { + this := AddUserRequest{} + return &this +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *AddUserRequest) GetPassword() string { + if o == nil || isNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddUserRequest) GetPasswordOk() (*string, bool) { + if o == nil || isNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *AddUserRequest) HasPassword() bool { + if o != nil && !isNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *AddUserRequest) SetPassword(v string) { + o.Password = &v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *AddUserRequest) GetPermissions() []string { + if o == nil || isNil(o.Permissions) { + var ret []string + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddUserRequest) GetPermissionsOk() ([]string, bool) { + if o == nil || isNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *AddUserRequest) HasPermissions() bool { + if o != nil && !isNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +func (o *AddUserRequest) SetPermissions(v []string) { + o.Permissions = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *AddUserRequest) GetUsername() string { + if o == nil || isNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddUserRequest) GetUsernameOk() (*string, bool) { + if o == nil || isNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *AddUserRequest) HasUsername() bool { + if o != nil && !isNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *AddUserRequest) SetUsername(v string) { + o.Username = &v +} + +func (o AddUserRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Password) { + toSerialize["password"] = o.Password + } + if !isNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + if !isNil(o.Username) { + toSerialize["username"] = o.Username + } + return json.Marshal(toSerialize) +} + +type NullableAddUserRequest struct { + value *AddUserRequest + isSet bool +} + +func (v NullableAddUserRequest) Get() *AddUserRequest { + return v.value +} + +func (v *NullableAddUserRequest) Set(val *AddUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAddUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAddUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddUserRequest(val *AddUserRequest) *NullableAddUserRequest { + return &NullableAddUserRequest{value: val, isSet: true} +} + +func (v NullableAddUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_alias_output_metric_item.go b/client/model_alias_output_metric_item.go new file mode 100644 index 0000000000..2de3747fa9 --- /dev/null +++ b/client/model_alias_output_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// AliasOutputMetricItem struct for AliasOutputMetricItem +type AliasOutputMetricItem struct { + LastMessage *Output `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewAliasOutputMetricItem instantiates a new AliasOutputMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAliasOutputMetricItem() *AliasOutputMetricItem { + this := AliasOutputMetricItem{} + return &this +} + +// NewAliasOutputMetricItemWithDefaults instantiates a new AliasOutputMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAliasOutputMetricItemWithDefaults() *AliasOutputMetricItem { + this := AliasOutputMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *AliasOutputMetricItem) GetLastMessage() Output { + if o == nil || isNil(o.LastMessage) { + var ret Output + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AliasOutputMetricItem) GetLastMessageOk() (*Output, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *AliasOutputMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given Output and assigns it to the LastMessage field. +func (o *AliasOutputMetricItem) SetLastMessage(v Output) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *AliasOutputMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AliasOutputMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *AliasOutputMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *AliasOutputMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *AliasOutputMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AliasOutputMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *AliasOutputMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *AliasOutputMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o AliasOutputMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableAliasOutputMetricItem struct { + value *AliasOutputMetricItem + isSet bool +} + +func (v NullableAliasOutputMetricItem) Get() *AliasOutputMetricItem { + return v.value +} + +func (v *NullableAliasOutputMetricItem) Set(val *AliasOutputMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableAliasOutputMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableAliasOutputMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAliasOutputMetricItem(val *AliasOutputMetricItem) *NullableAliasOutputMetricItem { + return &NullableAliasOutputMetricItem{value: val, isSet: true} +} + +func (v NullableAliasOutputMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAliasOutputMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_allowance.go b/client/model_allowance.go new file mode 100644 index 0000000000..73ab685adb --- /dev/null +++ b/client/model_allowance.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// Allowance struct for Allowance +type Allowance struct { + FungibleTokens *FungibleTokens `json:"fungibleTokens,omitempty"` + Nfts []string `json:"nfts,omitempty"` +} + +// NewAllowance instantiates a new Allowance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAllowance() *Allowance { + this := Allowance{} + return &this +} + +// NewAllowanceWithDefaults instantiates a new Allowance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAllowanceWithDefaults() *Allowance { + this := Allowance{} + return &this +} + +// GetFungibleTokens returns the FungibleTokens field value if set, zero value otherwise. +func (o *Allowance) GetFungibleTokens() FungibleTokens { + if o == nil || isNil(o.FungibleTokens) { + var ret FungibleTokens + return ret + } + return *o.FungibleTokens +} + +// GetFungibleTokensOk returns a tuple with the FungibleTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Allowance) GetFungibleTokensOk() (*FungibleTokens, bool) { + if o == nil || isNil(o.FungibleTokens) { + return nil, false + } + return o.FungibleTokens, true +} + +// HasFungibleTokens returns a boolean if a field has been set. +func (o *Allowance) HasFungibleTokens() bool { + if o != nil && !isNil(o.FungibleTokens) { + return true + } + + return false +} + +// SetFungibleTokens gets a reference to the given FungibleTokens and assigns it to the FungibleTokens field. +func (o *Allowance) SetFungibleTokens(v FungibleTokens) { + o.FungibleTokens = &v +} + +// GetNfts returns the Nfts field value if set, zero value otherwise. +func (o *Allowance) GetNfts() []string { + if o == nil || isNil(o.Nfts) { + var ret []string + return ret + } + return o.Nfts +} + +// GetNftsOk returns a tuple with the Nfts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Allowance) GetNftsOk() ([]string, bool) { + if o == nil || isNil(o.Nfts) { + return nil, false + } + return o.Nfts, true +} + +// HasNfts returns a boolean if a field has been set. +func (o *Allowance) HasNfts() bool { + if o != nil && !isNil(o.Nfts) { + return true + } + + return false +} + +// SetNfts gets a reference to the given []string and assigns it to the Nfts field. +func (o *Allowance) SetNfts(v []string) { + o.Nfts = v +} + +func (o Allowance) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.FungibleTokens) { + toSerialize["fungibleTokens"] = o.FungibleTokens + } + if !isNil(o.Nfts) { + toSerialize["nfts"] = o.Nfts + } + return json.Marshal(toSerialize) +} + +type NullableAllowance struct { + value *Allowance + isSet bool +} + +func (v NullableAllowance) Get() *Allowance { + return v.value +} + +func (v *NullableAllowance) Set(val *Allowance) { + v.value = val + v.isSet = true +} + +func (v NullableAllowance) IsSet() bool { + return v.isSet +} + +func (v *NullableAllowance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAllowance(val *Allowance) *NullableAllowance { + return &NullableAllowance{value: val, isSet: true} +} + +func (v NullableAllowance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAllowance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_assets_response.go b/client/model_assets_response.go new file mode 100644 index 0000000000..43dd7faa00 --- /dev/null +++ b/client/model_assets_response.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// AssetsResponse struct for AssetsResponse +type AssetsResponse struct { + BaseTokens *int64 `json:"baseTokens,omitempty"` + NativeTokens []NativeToken `json:"nativeTokens,omitempty"` +} + +// NewAssetsResponse instantiates a new AssetsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAssetsResponse() *AssetsResponse { + this := AssetsResponse{} + return &this +} + +// NewAssetsResponseWithDefaults instantiates a new AssetsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAssetsResponseWithDefaults() *AssetsResponse { + this := AssetsResponse{} + return &this +} + +// GetBaseTokens returns the BaseTokens field value if set, zero value otherwise. +func (o *AssetsResponse) GetBaseTokens() int64 { + if o == nil || isNil(o.BaseTokens) { + var ret int64 + return ret + } + return *o.BaseTokens +} + +// GetBaseTokensOk returns a tuple with the BaseTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetsResponse) GetBaseTokensOk() (*int64, bool) { + if o == nil || isNil(o.BaseTokens) { + return nil, false + } + return o.BaseTokens, true +} + +// HasBaseTokens returns a boolean if a field has been set. +func (o *AssetsResponse) HasBaseTokens() bool { + if o != nil && !isNil(o.BaseTokens) { + return true + } + + return false +} + +// SetBaseTokens gets a reference to the given int64 and assigns it to the BaseTokens field. +func (o *AssetsResponse) SetBaseTokens(v int64) { + o.BaseTokens = &v +} + +// GetNativeTokens returns the NativeTokens field value if set, zero value otherwise. +func (o *AssetsResponse) GetNativeTokens() []NativeToken { + if o == nil || isNil(o.NativeTokens) { + var ret []NativeToken + return ret + } + return o.NativeTokens +} + +// GetNativeTokensOk returns a tuple with the NativeTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AssetsResponse) GetNativeTokensOk() ([]NativeToken, bool) { + if o == nil || isNil(o.NativeTokens) { + return nil, false + } + return o.NativeTokens, true +} + +// HasNativeTokens returns a boolean if a field has been set. +func (o *AssetsResponse) HasNativeTokens() bool { + if o != nil && !isNil(o.NativeTokens) { + return true + } + + return false +} + +// SetNativeTokens gets a reference to the given []NativeToken and assigns it to the NativeTokens field. +func (o *AssetsResponse) SetNativeTokens(v []NativeToken) { + o.NativeTokens = v +} + +func (o AssetsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BaseTokens) { + toSerialize["baseTokens"] = o.BaseTokens + } + if !isNil(o.NativeTokens) { + toSerialize["nativeTokens"] = o.NativeTokens + } + return json.Marshal(toSerialize) +} + +type NullableAssetsResponse struct { + value *AssetsResponse + isSet bool +} + +func (v NullableAssetsResponse) Get() *AssetsResponse { + return v.value +} + +func (v *NullableAssetsResponse) Set(val *AssetsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAssetsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAssetsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAssetsResponse(val *AssetsResponse) *NullableAssetsResponse { + return &NullableAssetsResponse{value: val, isSet: true} +} + +func (v NullableAssetsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAssetsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_base_token.go b/client/model_base_token.go new file mode 100644 index 0000000000..82223b1b92 --- /dev/null +++ b/client/model_base_token.go @@ -0,0 +1,301 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BaseToken struct for BaseToken +type BaseToken struct { + // The token decimals + Decimals *int32 `json:"decimals,omitempty"` + // The base token name + Name *string `json:"name,omitempty"` + // The token subunit + Subunit *string `json:"subunit,omitempty"` + // The ticker symbol + TickerSymbol *string `json:"tickerSymbol,omitempty"` + // The token unit + Unit *string `json:"unit,omitempty"` + // Whether or not the token uses a metric prefix + UseMetricPrefix *bool `json:"useMetricPrefix,omitempty"` +} + +// NewBaseToken instantiates a new BaseToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBaseToken() *BaseToken { + this := BaseToken{} + return &this +} + +// NewBaseTokenWithDefaults instantiates a new BaseToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBaseTokenWithDefaults() *BaseToken { + this := BaseToken{} + return &this +} + +// GetDecimals returns the Decimals field value if set, zero value otherwise. +func (o *BaseToken) GetDecimals() int32 { + if o == nil || isNil(o.Decimals) { + var ret int32 + return ret + } + return *o.Decimals +} + +// GetDecimalsOk returns a tuple with the Decimals field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseToken) GetDecimalsOk() (*int32, bool) { + if o == nil || isNil(o.Decimals) { + return nil, false + } + return o.Decimals, true +} + +// HasDecimals returns a boolean if a field has been set. +func (o *BaseToken) HasDecimals() bool { + if o != nil && !isNil(o.Decimals) { + return true + } + + return false +} + +// SetDecimals gets a reference to the given int32 and assigns it to the Decimals field. +func (o *BaseToken) SetDecimals(v int32) { + o.Decimals = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BaseToken) GetName() string { + if o == nil || isNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseToken) GetNameOk() (*string, bool) { + if o == nil || isNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BaseToken) HasName() bool { + if o != nil && !isNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BaseToken) SetName(v string) { + o.Name = &v +} + +// GetSubunit returns the Subunit field value if set, zero value otherwise. +func (o *BaseToken) GetSubunit() string { + if o == nil || isNil(o.Subunit) { + var ret string + return ret + } + return *o.Subunit +} + +// GetSubunitOk returns a tuple with the Subunit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseToken) GetSubunitOk() (*string, bool) { + if o == nil || isNil(o.Subunit) { + return nil, false + } + return o.Subunit, true +} + +// HasSubunit returns a boolean if a field has been set. +func (o *BaseToken) HasSubunit() bool { + if o != nil && !isNil(o.Subunit) { + return true + } + + return false +} + +// SetSubunit gets a reference to the given string and assigns it to the Subunit field. +func (o *BaseToken) SetSubunit(v string) { + o.Subunit = &v +} + +// GetTickerSymbol returns the TickerSymbol field value if set, zero value otherwise. +func (o *BaseToken) GetTickerSymbol() string { + if o == nil || isNil(o.TickerSymbol) { + var ret string + return ret + } + return *o.TickerSymbol +} + +// GetTickerSymbolOk returns a tuple with the TickerSymbol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseToken) GetTickerSymbolOk() (*string, bool) { + if o == nil || isNil(o.TickerSymbol) { + return nil, false + } + return o.TickerSymbol, true +} + +// HasTickerSymbol returns a boolean if a field has been set. +func (o *BaseToken) HasTickerSymbol() bool { + if o != nil && !isNil(o.TickerSymbol) { + return true + } + + return false +} + +// SetTickerSymbol gets a reference to the given string and assigns it to the TickerSymbol field. +func (o *BaseToken) SetTickerSymbol(v string) { + o.TickerSymbol = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *BaseToken) GetUnit() string { + if o == nil || isNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseToken) GetUnitOk() (*string, bool) { + if o == nil || isNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *BaseToken) HasUnit() bool { + if o != nil && !isNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *BaseToken) SetUnit(v string) { + o.Unit = &v +} + +// GetUseMetricPrefix returns the UseMetricPrefix field value if set, zero value otherwise. +func (o *BaseToken) GetUseMetricPrefix() bool { + if o == nil || isNil(o.UseMetricPrefix) { + var ret bool + return ret + } + return *o.UseMetricPrefix +} + +// GetUseMetricPrefixOk returns a tuple with the UseMetricPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseToken) GetUseMetricPrefixOk() (*bool, bool) { + if o == nil || isNil(o.UseMetricPrefix) { + return nil, false + } + return o.UseMetricPrefix, true +} + +// HasUseMetricPrefix returns a boolean if a field has been set. +func (o *BaseToken) HasUseMetricPrefix() bool { + if o != nil && !isNil(o.UseMetricPrefix) { + return true + } + + return false +} + +// SetUseMetricPrefix gets a reference to the given bool and assigns it to the UseMetricPrefix field. +func (o *BaseToken) SetUseMetricPrefix(v bool) { + o.UseMetricPrefix = &v +} + +func (o BaseToken) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Decimals) { + toSerialize["decimals"] = o.Decimals + } + if !isNil(o.Name) { + toSerialize["name"] = o.Name + } + if !isNil(o.Subunit) { + toSerialize["subunit"] = o.Subunit + } + if !isNil(o.TickerSymbol) { + toSerialize["tickerSymbol"] = o.TickerSymbol + } + if !isNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + if !isNil(o.UseMetricPrefix) { + toSerialize["useMetricPrefix"] = o.UseMetricPrefix + } + return json.Marshal(toSerialize) +} + +type NullableBaseToken struct { + value *BaseToken + isSet bool +} + +func (v NullableBaseToken) Get() *BaseToken { + return v.value +} + +func (v *NullableBaseToken) Set(val *BaseToken) { + v.value = val + v.isSet = true +} + +func (v NullableBaseToken) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseToken(val *BaseToken) *NullableBaseToken { + return &NullableBaseToken{value: val, isSet: true} +} + +func (v NullableBaseToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_blob.go b/client/model_blob.go new file mode 100644 index 0000000000..29a9ce4bd9 --- /dev/null +++ b/client/model_blob.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// Blob struct for Blob +type Blob struct { + Hash *string `json:"Hash,omitempty"` + Size *int32 `json:"Size,omitempty"` +} + +// NewBlob instantiates a new Blob object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlob() *Blob { + this := Blob{} + return &this +} + +// NewBlobWithDefaults instantiates a new Blob object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlobWithDefaults() *Blob { + this := Blob{} + return &this +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *Blob) GetHash() string { + if o == nil || isNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Blob) GetHashOk() (*string, bool) { + if o == nil || isNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *Blob) HasHash() bool { + if o != nil && !isNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *Blob) SetHash(v string) { + o.Hash = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Blob) GetSize() int32 { + if o == nil || isNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Blob) GetSizeOk() (*int32, bool) { + if o == nil || isNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Blob) HasSize() bool { + if o != nil && !isNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *Blob) SetSize(v int32) { + o.Size = &v +} + +func (o Blob) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Hash) { + toSerialize["Hash"] = o.Hash + } + if !isNil(o.Size) { + toSerialize["Size"] = o.Size + } + return json.Marshal(toSerialize) +} + +type NullableBlob struct { + value *Blob + isSet bool +} + +func (v NullableBlob) Get() *Blob { + return v.value +} + +func (v *NullableBlob) Set(val *Blob) { + v.value = val + v.isSet = true +} + +func (v NullableBlob) IsSet() bool { + return v.isSet +} + +func (v *NullableBlob) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlob(val *Blob) *NullableBlob { + return &NullableBlob{value: val, isSet: true} +} + +func (v NullableBlob) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlob) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_blob_info_response.go b/client/model_blob_info_response.go new file mode 100644 index 0000000000..9f60150420 --- /dev/null +++ b/client/model_blob_info_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BlobInfoResponse struct for BlobInfoResponse +type BlobInfoResponse struct { + Fields *map[string]int32 `json:"Fields,omitempty"` +} + +// NewBlobInfoResponse instantiates a new BlobInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlobInfoResponse() *BlobInfoResponse { + this := BlobInfoResponse{} + return &this +} + +// NewBlobInfoResponseWithDefaults instantiates a new BlobInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlobInfoResponseWithDefaults() *BlobInfoResponse { + this := BlobInfoResponse{} + return &this +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *BlobInfoResponse) GetFields() map[string]int32 { + if o == nil || isNil(o.Fields) { + var ret map[string]int32 + return ret + } + return *o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool) { + if o == nil || isNil(o.Fields) { + return nil, false + } + return o.Fields, true +} + +// HasFields returns a boolean if a field has been set. +func (o *BlobInfoResponse) HasFields() bool { + if o != nil && !isNil(o.Fields) { + return true + } + + return false +} + +// SetFields gets a reference to the given map[string]int32 and assigns it to the Fields field. +func (o *BlobInfoResponse) SetFields(v map[string]int32) { + o.Fields = &v +} + +func (o BlobInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Fields) { + toSerialize["Fields"] = o.Fields + } + return json.Marshal(toSerialize) +} + +type NullableBlobInfoResponse struct { + value *BlobInfoResponse + isSet bool +} + +func (v NullableBlobInfoResponse) Get() *BlobInfoResponse { + return v.value +} + +func (v *NullableBlobInfoResponse) Set(val *BlobInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBlobInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBlobInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlobInfoResponse(val *BlobInfoResponse) *NullableBlobInfoResponse { + return &NullableBlobInfoResponse{value: val, isSet: true} +} + +func (v NullableBlobInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlobInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_blob_list_response.go b/client/model_blob_list_response.go new file mode 100644 index 0000000000..8ddc0d0ac8 --- /dev/null +++ b/client/model_blob_list_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BlobListResponse struct for BlobListResponse +type BlobListResponse struct { + Blobs []Blob `json:"Blobs,omitempty"` +} + +// NewBlobListResponse instantiates a new BlobListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlobListResponse() *BlobListResponse { + this := BlobListResponse{} + return &this +} + +// NewBlobListResponseWithDefaults instantiates a new BlobListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlobListResponseWithDefaults() *BlobListResponse { + this := BlobListResponse{} + return &this +} + +// GetBlobs returns the Blobs field value if set, zero value otherwise. +func (o *BlobListResponse) GetBlobs() []Blob { + if o == nil || isNil(o.Blobs) { + var ret []Blob + return ret + } + return o.Blobs +} + +// GetBlobsOk returns a tuple with the Blobs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlobListResponse) GetBlobsOk() ([]Blob, bool) { + if o == nil || isNil(o.Blobs) { + return nil, false + } + return o.Blobs, true +} + +// HasBlobs returns a boolean if a field has been set. +func (o *BlobListResponse) HasBlobs() bool { + if o != nil && !isNil(o.Blobs) { + return true + } + + return false +} + +// SetBlobs gets a reference to the given []Blob and assigns it to the Blobs field. +func (o *BlobListResponse) SetBlobs(v []Blob) { + o.Blobs = v +} + +func (o BlobListResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Blobs) { + toSerialize["Blobs"] = o.Blobs + } + return json.Marshal(toSerialize) +} + +type NullableBlobListResponse struct { + value *BlobListResponse + isSet bool +} + +func (v NullableBlobListResponse) Get() *BlobListResponse { + return v.value +} + +func (v *NullableBlobListResponse) Set(val *BlobListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBlobListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBlobListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlobListResponse(val *BlobListResponse) *NullableBlobListResponse { + return &NullableBlobListResponse{value: val, isSet: true} +} + +func (v NullableBlobListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlobListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_blob_value_response.go b/client/model_blob_value_response.go new file mode 100644 index 0000000000..484d8848c7 --- /dev/null +++ b/client/model_blob_value_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BlobValueResponse struct for BlobValueResponse +type BlobValueResponse struct { + ValueData *string `json:"ValueData,omitempty"` +} + +// NewBlobValueResponse instantiates a new BlobValueResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlobValueResponse() *BlobValueResponse { + this := BlobValueResponse{} + return &this +} + +// NewBlobValueResponseWithDefaults instantiates a new BlobValueResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlobValueResponseWithDefaults() *BlobValueResponse { + this := BlobValueResponse{} + return &this +} + +// GetValueData returns the ValueData field value if set, zero value otherwise. +func (o *BlobValueResponse) GetValueData() string { + if o == nil || isNil(o.ValueData) { + var ret string + return ret + } + return *o.ValueData +} + +// GetValueDataOk returns a tuple with the ValueData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlobValueResponse) GetValueDataOk() (*string, bool) { + if o == nil || isNil(o.ValueData) { + return nil, false + } + return o.ValueData, true +} + +// HasValueData returns a boolean if a field has been set. +func (o *BlobValueResponse) HasValueData() bool { + if o != nil && !isNil(o.ValueData) { + return true + } + + return false +} + +// SetValueData gets a reference to the given string and assigns it to the ValueData field. +func (o *BlobValueResponse) SetValueData(v string) { + o.ValueData = &v +} + +func (o BlobValueResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ValueData) { + toSerialize["ValueData"] = o.ValueData + } + return json.Marshal(toSerialize) +} + +type NullableBlobValueResponse struct { + value *BlobValueResponse + isSet bool +} + +func (v NullableBlobValueResponse) Get() *BlobValueResponse { + return v.value +} + +func (v *NullableBlobValueResponse) Set(val *BlobValueResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBlobValueResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBlobValueResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlobValueResponse(val *BlobValueResponse) *NullableBlobValueResponse { + return &NullableBlobValueResponse{value: val, isSet: true} +} + +func (v NullableBlobValueResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlobValueResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_block_info_response.go b/client/model_block_info_response.go new file mode 100644 index 0000000000..042c295c5c --- /dev/null +++ b/client/model_block_info_response.go @@ -0,0 +1,548 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// BlockInfoResponse struct for BlockInfoResponse +type BlockInfoResponse struct { + AnchorTransactionId *string `json:"anchorTransactionId,omitempty"` + BlockIndex *int32 `json:"blockIndex,omitempty"` + GasBurned *int64 `json:"gasBurned,omitempty"` + GasFeeCharged *int64 `json:"gasFeeCharged,omitempty"` + L1CommitmentHash *string `json:"l1CommitmentHash,omitempty"` + NumOffLedgerRequests *int32 `json:"numOffLedgerRequests,omitempty"` + NumSuccessfulRequests *int32 `json:"numSuccessfulRequests,omitempty"` + PreviousL1CommitmentHash *string `json:"previousL1CommitmentHash,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` + TotalBaseTokensInL2Accounts *int64 `json:"totalBaseTokensInL2Accounts,omitempty"` + TotalRequests *int32 `json:"totalRequests,omitempty"` + TotalStorageDeposit *int64 `json:"totalStorageDeposit,omitempty"` + TransactionSubEssenceHash *string `json:"transactionSubEssenceHash,omitempty"` +} + +// NewBlockInfoResponse instantiates a new BlockInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlockInfoResponse() *BlockInfoResponse { + this := BlockInfoResponse{} + return &this +} + +// NewBlockInfoResponseWithDefaults instantiates a new BlockInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlockInfoResponseWithDefaults() *BlockInfoResponse { + this := BlockInfoResponse{} + return &this +} + +// GetAnchorTransactionId returns the AnchorTransactionId field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetAnchorTransactionId() string { + if o == nil || isNil(o.AnchorTransactionId) { + var ret string + return ret + } + return *o.AnchorTransactionId +} + +// GetAnchorTransactionIdOk returns a tuple with the AnchorTransactionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetAnchorTransactionIdOk() (*string, bool) { + if o == nil || isNil(o.AnchorTransactionId) { + return nil, false + } + return o.AnchorTransactionId, true +} + +// HasAnchorTransactionId returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasAnchorTransactionId() bool { + if o != nil && !isNil(o.AnchorTransactionId) { + return true + } + + return false +} + +// SetAnchorTransactionId gets a reference to the given string and assigns it to the AnchorTransactionId field. +func (o *BlockInfoResponse) SetAnchorTransactionId(v string) { + o.AnchorTransactionId = &v +} + +// GetBlockIndex returns the BlockIndex field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetBlockIndex() int32 { + if o == nil || isNil(o.BlockIndex) { + var ret int32 + return ret + } + return *o.BlockIndex +} + +// GetBlockIndexOk returns a tuple with the BlockIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetBlockIndexOk() (*int32, bool) { + if o == nil || isNil(o.BlockIndex) { + return nil, false + } + return o.BlockIndex, true +} + +// HasBlockIndex returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasBlockIndex() bool { + if o != nil && !isNil(o.BlockIndex) { + return true + } + + return false +} + +// SetBlockIndex gets a reference to the given int32 and assigns it to the BlockIndex field. +func (o *BlockInfoResponse) SetBlockIndex(v int32) { + o.BlockIndex = &v +} + +// GetGasBurned returns the GasBurned field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetGasBurned() int64 { + if o == nil || isNil(o.GasBurned) { + var ret int64 + return ret + } + return *o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool) { + if o == nil || isNil(o.GasBurned) { + return nil, false + } + return o.GasBurned, true +} + +// HasGasBurned returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasGasBurned() bool { + if o != nil && !isNil(o.GasBurned) { + return true + } + + return false +} + +// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. +func (o *BlockInfoResponse) SetGasBurned(v int64) { + o.GasBurned = &v +} + +// GetGasFeeCharged returns the GasFeeCharged field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetGasFeeCharged() int64 { + if o == nil || isNil(o.GasFeeCharged) { + var ret int64 + return ret + } + return *o.GasFeeCharged +} + +// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool) { + if o == nil || isNil(o.GasFeeCharged) { + return nil, false + } + return o.GasFeeCharged, true +} + +// HasGasFeeCharged returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasGasFeeCharged() bool { + if o != nil && !isNil(o.GasFeeCharged) { + return true + } + + return false +} + +// SetGasFeeCharged gets a reference to the given int64 and assigns it to the GasFeeCharged field. +func (o *BlockInfoResponse) SetGasFeeCharged(v int64) { + o.GasFeeCharged = &v +} + +// GetL1CommitmentHash returns the L1CommitmentHash field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetL1CommitmentHash() string { + if o == nil || isNil(o.L1CommitmentHash) { + var ret string + return ret + } + return *o.L1CommitmentHash +} + +// GetL1CommitmentHashOk returns a tuple with the L1CommitmentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetL1CommitmentHashOk() (*string, bool) { + if o == nil || isNil(o.L1CommitmentHash) { + return nil, false + } + return o.L1CommitmentHash, true +} + +// HasL1CommitmentHash returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasL1CommitmentHash() bool { + if o != nil && !isNil(o.L1CommitmentHash) { + return true + } + + return false +} + +// SetL1CommitmentHash gets a reference to the given string and assigns it to the L1CommitmentHash field. +func (o *BlockInfoResponse) SetL1CommitmentHash(v string) { + o.L1CommitmentHash = &v +} + +// GetNumOffLedgerRequests returns the NumOffLedgerRequests field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetNumOffLedgerRequests() int32 { + if o == nil || isNil(o.NumOffLedgerRequests) { + var ret int32 + return ret + } + return *o.NumOffLedgerRequests +} + +// GetNumOffLedgerRequestsOk returns a tuple with the NumOffLedgerRequests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetNumOffLedgerRequestsOk() (*int32, bool) { + if o == nil || isNil(o.NumOffLedgerRequests) { + return nil, false + } + return o.NumOffLedgerRequests, true +} + +// HasNumOffLedgerRequests returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasNumOffLedgerRequests() bool { + if o != nil && !isNil(o.NumOffLedgerRequests) { + return true + } + + return false +} + +// SetNumOffLedgerRequests gets a reference to the given int32 and assigns it to the NumOffLedgerRequests field. +func (o *BlockInfoResponse) SetNumOffLedgerRequests(v int32) { + o.NumOffLedgerRequests = &v +} + +// GetNumSuccessfulRequests returns the NumSuccessfulRequests field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetNumSuccessfulRequests() int32 { + if o == nil || isNil(o.NumSuccessfulRequests) { + var ret int32 + return ret + } + return *o.NumSuccessfulRequests +} + +// GetNumSuccessfulRequestsOk returns a tuple with the NumSuccessfulRequests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetNumSuccessfulRequestsOk() (*int32, bool) { + if o == nil || isNil(o.NumSuccessfulRequests) { + return nil, false + } + return o.NumSuccessfulRequests, true +} + +// HasNumSuccessfulRequests returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasNumSuccessfulRequests() bool { + if o != nil && !isNil(o.NumSuccessfulRequests) { + return true + } + + return false +} + +// SetNumSuccessfulRequests gets a reference to the given int32 and assigns it to the NumSuccessfulRequests field. +func (o *BlockInfoResponse) SetNumSuccessfulRequests(v int32) { + o.NumSuccessfulRequests = &v +} + +// GetPreviousL1CommitmentHash returns the PreviousL1CommitmentHash field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetPreviousL1CommitmentHash() string { + if o == nil || isNil(o.PreviousL1CommitmentHash) { + var ret string + return ret + } + return *o.PreviousL1CommitmentHash +} + +// GetPreviousL1CommitmentHashOk returns a tuple with the PreviousL1CommitmentHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetPreviousL1CommitmentHashOk() (*string, bool) { + if o == nil || isNil(o.PreviousL1CommitmentHash) { + return nil, false + } + return o.PreviousL1CommitmentHash, true +} + +// HasPreviousL1CommitmentHash returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasPreviousL1CommitmentHash() bool { + if o != nil && !isNil(o.PreviousL1CommitmentHash) { + return true + } + + return false +} + +// SetPreviousL1CommitmentHash gets a reference to the given string and assigns it to the PreviousL1CommitmentHash field. +func (o *BlockInfoResponse) SetPreviousL1CommitmentHash(v string) { + o.PreviousL1CommitmentHash = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *BlockInfoResponse) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +// GetTotalBaseTokensInL2Accounts returns the TotalBaseTokensInL2Accounts field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64 { + if o == nil || isNil(o.TotalBaseTokensInL2Accounts) { + var ret int64 + return ret + } + return *o.TotalBaseTokensInL2Accounts +} + +// GetTotalBaseTokensInL2AccountsOk returns a tuple with the TotalBaseTokensInL2Accounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool) { + if o == nil || isNil(o.TotalBaseTokensInL2Accounts) { + return nil, false + } + return o.TotalBaseTokensInL2Accounts, true +} + +// HasTotalBaseTokensInL2Accounts returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasTotalBaseTokensInL2Accounts() bool { + if o != nil && !isNil(o.TotalBaseTokensInL2Accounts) { + return true + } + + return false +} + +// SetTotalBaseTokensInL2Accounts gets a reference to the given int64 and assigns it to the TotalBaseTokensInL2Accounts field. +func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v int64) { + o.TotalBaseTokensInL2Accounts = &v +} + +// GetTotalRequests returns the TotalRequests field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetTotalRequests() int32 { + if o == nil || isNil(o.TotalRequests) { + var ret int32 + return ret + } + return *o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTotalRequestsOk() (*int32, bool) { + if o == nil || isNil(o.TotalRequests) { + return nil, false + } + return o.TotalRequests, true +} + +// HasTotalRequests returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasTotalRequests() bool { + if o != nil && !isNil(o.TotalRequests) { + return true + } + + return false +} + +// SetTotalRequests gets a reference to the given int32 and assigns it to the TotalRequests field. +func (o *BlockInfoResponse) SetTotalRequests(v int32) { + o.TotalRequests = &v +} + +// GetTotalStorageDeposit returns the TotalStorageDeposit field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetTotalStorageDeposit() int64 { + if o == nil || isNil(o.TotalStorageDeposit) { + var ret int64 + return ret + } + return *o.TotalStorageDeposit +} + +// GetTotalStorageDepositOk returns a tuple with the TotalStorageDeposit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool) { + if o == nil || isNil(o.TotalStorageDeposit) { + return nil, false + } + return o.TotalStorageDeposit, true +} + +// HasTotalStorageDeposit returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasTotalStorageDeposit() bool { + if o != nil && !isNil(o.TotalStorageDeposit) { + return true + } + + return false +} + +// SetTotalStorageDeposit gets a reference to the given int64 and assigns it to the TotalStorageDeposit field. +func (o *BlockInfoResponse) SetTotalStorageDeposit(v int64) { + o.TotalStorageDeposit = &v +} + +// GetTransactionSubEssenceHash returns the TransactionSubEssenceHash field value if set, zero value otherwise. +func (o *BlockInfoResponse) GetTransactionSubEssenceHash() string { + if o == nil || isNil(o.TransactionSubEssenceHash) { + var ret string + return ret + } + return *o.TransactionSubEssenceHash +} + +// GetTransactionSubEssenceHashOk returns a tuple with the TransactionSubEssenceHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTransactionSubEssenceHashOk() (*string, bool) { + if o == nil || isNil(o.TransactionSubEssenceHash) { + return nil, false + } + return o.TransactionSubEssenceHash, true +} + +// HasTransactionSubEssenceHash returns a boolean if a field has been set. +func (o *BlockInfoResponse) HasTransactionSubEssenceHash() bool { + if o != nil && !isNil(o.TransactionSubEssenceHash) { + return true + } + + return false +} + +// SetTransactionSubEssenceHash gets a reference to the given string and assigns it to the TransactionSubEssenceHash field. +func (o *BlockInfoResponse) SetTransactionSubEssenceHash(v string) { + o.TransactionSubEssenceHash = &v +} + +func (o BlockInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.AnchorTransactionId) { + toSerialize["anchorTransactionId"] = o.AnchorTransactionId + } + if !isNil(o.BlockIndex) { + toSerialize["blockIndex"] = o.BlockIndex + } + if !isNil(o.GasBurned) { + toSerialize["gasBurned"] = o.GasBurned + } + if !isNil(o.GasFeeCharged) { + toSerialize["gasFeeCharged"] = o.GasFeeCharged + } + if !isNil(o.L1CommitmentHash) { + toSerialize["l1CommitmentHash"] = o.L1CommitmentHash + } + if !isNil(o.NumOffLedgerRequests) { + toSerialize["numOffLedgerRequests"] = o.NumOffLedgerRequests + } + if !isNil(o.NumSuccessfulRequests) { + toSerialize["numSuccessfulRequests"] = o.NumSuccessfulRequests + } + if !isNil(o.PreviousL1CommitmentHash) { + toSerialize["previousL1CommitmentHash"] = o.PreviousL1CommitmentHash + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + if !isNil(o.TotalBaseTokensInL2Accounts) { + toSerialize["totalBaseTokensInL2Accounts"] = o.TotalBaseTokensInL2Accounts + } + if !isNil(o.TotalRequests) { + toSerialize["totalRequests"] = o.TotalRequests + } + if !isNil(o.TotalStorageDeposit) { + toSerialize["totalStorageDeposit"] = o.TotalStorageDeposit + } + if !isNil(o.TransactionSubEssenceHash) { + toSerialize["transactionSubEssenceHash"] = o.TransactionSubEssenceHash + } + return json.Marshal(toSerialize) +} + +type NullableBlockInfoResponse struct { + value *BlockInfoResponse + isSet bool +} + +func (v NullableBlockInfoResponse) Get() *BlockInfoResponse { + return v.value +} + +func (v *NullableBlockInfoResponse) Set(val *BlockInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBlockInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBlockInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlockInfoResponse(val *BlockInfoResponse) *NullableBlockInfoResponse { + return &NullableBlockInfoResponse{value: val, isSet: true} +} + +func (v NullableBlockInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlockInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_block_receipt_error.go b/client/model_block_receipt_error.go new file mode 100644 index 0000000000..ac743f5bdb --- /dev/null +++ b/client/model_block_receipt_error.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BlockReceiptError struct for BlockReceiptError +type BlockReceiptError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Hash *string `json:"hash,omitempty"` +} + +// NewBlockReceiptError instantiates a new BlockReceiptError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlockReceiptError() *BlockReceiptError { + this := BlockReceiptError{} + return &this +} + +// NewBlockReceiptErrorWithDefaults instantiates a new BlockReceiptError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlockReceiptErrorWithDefaults() *BlockReceiptError { + this := BlockReceiptError{} + return &this +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *BlockReceiptError) GetErrorMessage() string { + if o == nil || isNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockReceiptError) GetErrorMessageOk() (*string, bool) { + if o == nil || isNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *BlockReceiptError) HasErrorMessage() bool { + if o != nil && !isNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *BlockReceiptError) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetHash returns the Hash field value if set, zero value otherwise. +func (o *BlockReceiptError) GetHash() string { + if o == nil || isNil(o.Hash) { + var ret string + return ret + } + return *o.Hash +} + +// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockReceiptError) GetHashOk() (*string, bool) { + if o == nil || isNil(o.Hash) { + return nil, false + } + return o.Hash, true +} + +// HasHash returns a boolean if a field has been set. +func (o *BlockReceiptError) HasHash() bool { + if o != nil && !isNil(o.Hash) { + return true + } + + return false +} + +// SetHash gets a reference to the given string and assigns it to the Hash field. +func (o *BlockReceiptError) SetHash(v string) { + o.Hash = &v +} + +func (o BlockReceiptError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !isNil(o.Hash) { + toSerialize["hash"] = o.Hash + } + return json.Marshal(toSerialize) +} + +type NullableBlockReceiptError struct { + value *BlockReceiptError + isSet bool +} + +func (v NullableBlockReceiptError) Get() *BlockReceiptError { + return v.value +} + +func (v *NullableBlockReceiptError) Set(val *BlockReceiptError) { + v.value = val + v.isSet = true +} + +func (v NullableBlockReceiptError) IsSet() bool { + return v.isSet +} + +func (v *NullableBlockReceiptError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlockReceiptError(val *BlockReceiptError) *NullableBlockReceiptError { + return &NullableBlockReceiptError{value: val, isSet: true} +} + +func (v NullableBlockReceiptError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlockReceiptError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_block_receipts_response.go b/client/model_block_receipts_response.go new file mode 100644 index 0000000000..c987770251 --- /dev/null +++ b/client/model_block_receipts_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BlockReceiptsResponse struct for BlockReceiptsResponse +type BlockReceiptsResponse struct { + Receipts []RequestReceiptResponse `json:"receipts,omitempty"` +} + +// NewBlockReceiptsResponse instantiates a new BlockReceiptsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlockReceiptsResponse() *BlockReceiptsResponse { + this := BlockReceiptsResponse{} + return &this +} + +// NewBlockReceiptsResponseWithDefaults instantiates a new BlockReceiptsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlockReceiptsResponseWithDefaults() *BlockReceiptsResponse { + this := BlockReceiptsResponse{} + return &this +} + +// GetReceipts returns the Receipts field value if set, zero value otherwise. +func (o *BlockReceiptsResponse) GetReceipts() []RequestReceiptResponse { + if o == nil || isNil(o.Receipts) { + var ret []RequestReceiptResponse + return ret + } + return o.Receipts +} + +// GetReceiptsOk returns a tuple with the Receipts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlockReceiptsResponse) GetReceiptsOk() ([]RequestReceiptResponse, bool) { + if o == nil || isNil(o.Receipts) { + return nil, false + } + return o.Receipts, true +} + +// HasReceipts returns a boolean if a field has been set. +func (o *BlockReceiptsResponse) HasReceipts() bool { + if o != nil && !isNil(o.Receipts) { + return true + } + + return false +} + +// SetReceipts gets a reference to the given []RequestReceiptResponse and assigns it to the Receipts field. +func (o *BlockReceiptsResponse) SetReceipts(v []RequestReceiptResponse) { + o.Receipts = v +} + +func (o BlockReceiptsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Receipts) { + toSerialize["receipts"] = o.Receipts + } + return json.Marshal(toSerialize) +} + +type NullableBlockReceiptsResponse struct { + value *BlockReceiptsResponse + isSet bool +} + +func (v NullableBlockReceiptsResponse) Get() *BlockReceiptsResponse { + return v.value +} + +func (v *NullableBlockReceiptsResponse) Set(val *BlockReceiptsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBlockReceiptsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBlockReceiptsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlockReceiptsResponse(val *BlockReceiptsResponse) *NullableBlockReceiptsResponse { + return &NullableBlockReceiptsResponse{value: val, isSet: true} +} + +func (v NullableBlockReceiptsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlockReceiptsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_burn_log.go b/client/model_burn_log.go new file mode 100644 index 0000000000..44535089c4 --- /dev/null +++ b/client/model_burn_log.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BurnLog struct for BurnLog +type BurnLog struct { + Records []BurnRecord `json:"Records,omitempty"` +} + +// NewBurnLog instantiates a new BurnLog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBurnLog() *BurnLog { + this := BurnLog{} + return &this +} + +// NewBurnLogWithDefaults instantiates a new BurnLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBurnLogWithDefaults() *BurnLog { + this := BurnLog{} + return &this +} + +// GetRecords returns the Records field value if set, zero value otherwise. +func (o *BurnLog) GetRecords() []BurnRecord { + if o == nil || isNil(o.Records) { + var ret []BurnRecord + return ret + } + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BurnLog) GetRecordsOk() ([]BurnRecord, bool) { + if o == nil || isNil(o.Records) { + return nil, false + } + return o.Records, true +} + +// HasRecords returns a boolean if a field has been set. +func (o *BurnLog) HasRecords() bool { + if o != nil && !isNil(o.Records) { + return true + } + + return false +} + +// SetRecords gets a reference to the given []BurnRecord and assigns it to the Records field. +func (o *BurnLog) SetRecords(v []BurnRecord) { + o.Records = v +} + +func (o BurnLog) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Records) { + toSerialize["Records"] = o.Records + } + return json.Marshal(toSerialize) +} + +type NullableBurnLog struct { + value *BurnLog + isSet bool +} + +func (v NullableBurnLog) Get() *BurnLog { + return v.value +} + +func (v *NullableBurnLog) Set(val *BurnLog) { + v.value = val + v.isSet = true +} + +func (v NullableBurnLog) IsSet() bool { + return v.isSet +} + +func (v *NullableBurnLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBurnLog(val *BurnLog) *NullableBurnLog { + return &NullableBurnLog{value: val, isSet: true} +} + +func (v NullableBurnLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBurnLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_burn_record.go b/client/model_burn_record.go new file mode 100644 index 0000000000..fff5ef025a --- /dev/null +++ b/client/model_burn_record.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// BurnRecord struct for BurnRecord +type BurnRecord struct { + Code *int32 `json:"Code,omitempty"` + GasBurned *int64 `json:"GasBurned,omitempty"` +} + +// NewBurnRecord instantiates a new BurnRecord object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBurnRecord() *BurnRecord { + this := BurnRecord{} + return &this +} + +// NewBurnRecordWithDefaults instantiates a new BurnRecord object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBurnRecordWithDefaults() *BurnRecord { + this := BurnRecord{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *BurnRecord) GetCode() int32 { + if o == nil || isNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BurnRecord) GetCodeOk() (*int32, bool) { + if o == nil || isNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *BurnRecord) HasCode() bool { + if o != nil && !isNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *BurnRecord) SetCode(v int32) { + o.Code = &v +} + +// GetGasBurned returns the GasBurned field value if set, zero value otherwise. +func (o *BurnRecord) GetGasBurned() int64 { + if o == nil || isNil(o.GasBurned) { + var ret int64 + return ret + } + return *o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BurnRecord) GetGasBurnedOk() (*int64, bool) { + if o == nil || isNil(o.GasBurned) { + return nil, false + } + return o.GasBurned, true +} + +// HasGasBurned returns a boolean if a field has been set. +func (o *BurnRecord) HasGasBurned() bool { + if o != nil && !isNil(o.GasBurned) { + return true + } + + return false +} + +// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. +func (o *BurnRecord) SetGasBurned(v int64) { + o.GasBurned = &v +} + +func (o BurnRecord) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Code) { + toSerialize["Code"] = o.Code + } + if !isNil(o.GasBurned) { + toSerialize["GasBurned"] = o.GasBurned + } + return json.Marshal(toSerialize) +} + +type NullableBurnRecord struct { + value *BurnRecord + isSet bool +} + +func (v NullableBurnRecord) Get() *BurnRecord { + return v.value +} + +func (v *NullableBurnRecord) Set(val *BurnRecord) { + v.value = val + v.isSet = true +} + +func (v NullableBurnRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableBurnRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBurnRecord(val *BurnRecord) *NullableBurnRecord { + return &NullableBurnRecord{value: val, isSet: true} +} + +func (v NullableBurnRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBurnRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_call_target.go b/client/model_call_target.go new file mode 100644 index 0000000000..71fb6c4b11 --- /dev/null +++ b/client/model_call_target.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// CallTarget struct for CallTarget +type CallTarget struct { + Contract *int32 `json:"Contract,omitempty"` + EntryPoint *int32 `json:"EntryPoint,omitempty"` +} + +// NewCallTarget instantiates a new CallTarget object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCallTarget() *CallTarget { + this := CallTarget{} + return &this +} + +// NewCallTargetWithDefaults instantiates a new CallTarget object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCallTargetWithDefaults() *CallTarget { + this := CallTarget{} + return &this +} + +// GetContract returns the Contract field value if set, zero value otherwise. +func (o *CallTarget) GetContract() int32 { + if o == nil || isNil(o.Contract) { + var ret int32 + return ret + } + return *o.Contract +} + +// GetContractOk returns a tuple with the Contract field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CallTarget) GetContractOk() (*int32, bool) { + if o == nil || isNil(o.Contract) { + return nil, false + } + return o.Contract, true +} + +// HasContract returns a boolean if a field has been set. +func (o *CallTarget) HasContract() bool { + if o != nil && !isNil(o.Contract) { + return true + } + + return false +} + +// SetContract gets a reference to the given int32 and assigns it to the Contract field. +func (o *CallTarget) SetContract(v int32) { + o.Contract = &v +} + +// GetEntryPoint returns the EntryPoint field value if set, zero value otherwise. +func (o *CallTarget) GetEntryPoint() int32 { + if o == nil || isNil(o.EntryPoint) { + var ret int32 + return ret + } + return *o.EntryPoint +} + +// GetEntryPointOk returns a tuple with the EntryPoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CallTarget) GetEntryPointOk() (*int32, bool) { + if o == nil || isNil(o.EntryPoint) { + return nil, false + } + return o.EntryPoint, true +} + +// HasEntryPoint returns a boolean if a field has been set. +func (o *CallTarget) HasEntryPoint() bool { + if o != nil && !isNil(o.EntryPoint) { + return true + } + + return false +} + +// SetEntryPoint gets a reference to the given int32 and assigns it to the EntryPoint field. +func (o *CallTarget) SetEntryPoint(v int32) { + o.EntryPoint = &v +} + +func (o CallTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Contract) { + toSerialize["Contract"] = o.Contract + } + if !isNil(o.EntryPoint) { + toSerialize["EntryPoint"] = o.EntryPoint + } + return json.Marshal(toSerialize) +} + +type NullableCallTarget struct { + value *CallTarget + isSet bool +} + +func (v NullableCallTarget) Get() *CallTarget { + return v.value +} + +func (v *NullableCallTarget) Set(val *CallTarget) { + v.value = val + v.isSet = true +} + +func (v NullableCallTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableCallTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCallTarget(val *CallTarget) *NullableCallTarget { + return &NullableCallTarget{value: val, isSet: true} +} + +func (v NullableCallTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCallTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_chain_info_response.go b/client/model_chain_info_response.go new file mode 100644 index 0000000000..6a138aa9ca --- /dev/null +++ b/client/model_chain_info_response.go @@ -0,0 +1,411 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ChainInfoResponse struct for ChainInfoResponse +type ChainInfoResponse struct { + // ChainID (Bech32-encoded). + ChainID *string `json:"chainID,omitempty"` + // The chain owner address (Bech32-encoded). + ChainOwnerId *string `json:"chainOwnerId,omitempty"` + // The description of the chain. + Description *string `json:"description,omitempty"` + // The EVM chain ID + EvmChainId *int32 `json:"evmChainId,omitempty"` + GasFeePolicy *GasFeePolicy `json:"gasFeePolicy,omitempty"` + // Whether or not the chain is active. + IsActive *bool `json:"isActive,omitempty"` + // The maximum contract blob size. + MaxBlobSize *int32 `json:"maxBlobSize,omitempty"` + // The maximum event size. + MaxEventSize *int32 `json:"maxEventSize,omitempty"` + // The maximum amount of events per request. + MaxEventsPerReq *int32 `json:"maxEventsPerReq,omitempty"` +} + +// NewChainInfoResponse instantiates a new ChainInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChainInfoResponse() *ChainInfoResponse { + this := ChainInfoResponse{} + return &this +} + +// NewChainInfoResponseWithDefaults instantiates a new ChainInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainInfoResponseWithDefaults() *ChainInfoResponse { + this := ChainInfoResponse{} + return &this +} + +// GetChainID returns the ChainID field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetChainID() string { + if o == nil || isNil(o.ChainID) { + var ret string + return ret + } + return *o.ChainID +} + +// GetChainIDOk returns a tuple with the ChainID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetChainIDOk() (*string, bool) { + if o == nil || isNil(o.ChainID) { + return nil, false + } + return o.ChainID, true +} + +// HasChainID returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasChainID() bool { + if o != nil && !isNil(o.ChainID) { + return true + } + + return false +} + +// SetChainID gets a reference to the given string and assigns it to the ChainID field. +func (o *ChainInfoResponse) SetChainID(v string) { + o.ChainID = &v +} + +// GetChainOwnerId returns the ChainOwnerId field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetChainOwnerId() string { + if o == nil || isNil(o.ChainOwnerId) { + var ret string + return ret + } + return *o.ChainOwnerId +} + +// GetChainOwnerIdOk returns a tuple with the ChainOwnerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetChainOwnerIdOk() (*string, bool) { + if o == nil || isNil(o.ChainOwnerId) { + return nil, false + } + return o.ChainOwnerId, true +} + +// HasChainOwnerId returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasChainOwnerId() bool { + if o != nil && !isNil(o.ChainOwnerId) { + return true + } + + return false +} + +// SetChainOwnerId gets a reference to the given string and assigns it to the ChainOwnerId field. +func (o *ChainInfoResponse) SetChainOwnerId(v string) { + o.ChainOwnerId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ChainInfoResponse) SetDescription(v string) { + o.Description = &v +} + +// GetEvmChainId returns the EvmChainId field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetEvmChainId() int32 { + if o == nil || isNil(o.EvmChainId) { + var ret int32 + return ret + } + return *o.EvmChainId +} + +// GetEvmChainIdOk returns a tuple with the EvmChainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetEvmChainIdOk() (*int32, bool) { + if o == nil || isNil(o.EvmChainId) { + return nil, false + } + return o.EvmChainId, true +} + +// HasEvmChainId returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasEvmChainId() bool { + if o != nil && !isNil(o.EvmChainId) { + return true + } + + return false +} + +// SetEvmChainId gets a reference to the given int32 and assigns it to the EvmChainId field. +func (o *ChainInfoResponse) SetEvmChainId(v int32) { + o.EvmChainId = &v +} + +// GetGasFeePolicy returns the GasFeePolicy field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetGasFeePolicy() GasFeePolicy { + if o == nil || isNil(o.GasFeePolicy) { + var ret GasFeePolicy + return ret + } + return *o.GasFeePolicy +} + +// GetGasFeePolicyOk returns a tuple with the GasFeePolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool) { + if o == nil || isNil(o.GasFeePolicy) { + return nil, false + } + return o.GasFeePolicy, true +} + +// HasGasFeePolicy returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasGasFeePolicy() bool { + if o != nil && !isNil(o.GasFeePolicy) { + return true + } + + return false +} + +// SetGasFeePolicy gets a reference to the given GasFeePolicy and assigns it to the GasFeePolicy field. +func (o *ChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { + o.GasFeePolicy = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetIsActive() bool { + if o == nil || isNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetIsActiveOk() (*bool, bool) { + if o == nil || isNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasIsActive() bool { + if o != nil && !isNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *ChainInfoResponse) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetMaxBlobSize returns the MaxBlobSize field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetMaxBlobSize() int32 { + if o == nil || isNil(o.MaxBlobSize) { + var ret int32 + return ret + } + return *o.MaxBlobSize +} + +// GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { + if o == nil || isNil(o.MaxBlobSize) { + return nil, false + } + return o.MaxBlobSize, true +} + +// HasMaxBlobSize returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasMaxBlobSize() bool { + if o != nil && !isNil(o.MaxBlobSize) { + return true + } + + return false +} + +// SetMaxBlobSize gets a reference to the given int32 and assigns it to the MaxBlobSize field. +func (o *ChainInfoResponse) SetMaxBlobSize(v int32) { + o.MaxBlobSize = &v +} + +// GetMaxEventSize returns the MaxEventSize field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetMaxEventSize() int32 { + if o == nil || isNil(o.MaxEventSize) { + var ret int32 + return ret + } + return *o.MaxEventSize +} + +// GetMaxEventSizeOk returns a tuple with the MaxEventSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { + if o == nil || isNil(o.MaxEventSize) { + return nil, false + } + return o.MaxEventSize, true +} + +// HasMaxEventSize returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasMaxEventSize() bool { + if o != nil && !isNil(o.MaxEventSize) { + return true + } + + return false +} + +// SetMaxEventSize gets a reference to the given int32 and assigns it to the MaxEventSize field. +func (o *ChainInfoResponse) SetMaxEventSize(v int32) { + o.MaxEventSize = &v +} + +// GetMaxEventsPerReq returns the MaxEventsPerReq field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetMaxEventsPerReq() int32 { + if o == nil || isNil(o.MaxEventsPerReq) { + var ret int32 + return ret + } + return *o.MaxEventsPerReq +} + +// GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { + if o == nil || isNil(o.MaxEventsPerReq) { + return nil, false + } + return o.MaxEventsPerReq, true +} + +// HasMaxEventsPerReq returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasMaxEventsPerReq() bool { + if o != nil && !isNil(o.MaxEventsPerReq) { + return true + } + + return false +} + +// SetMaxEventsPerReq gets a reference to the given int32 and assigns it to the MaxEventsPerReq field. +func (o *ChainInfoResponse) SetMaxEventsPerReq(v int32) { + o.MaxEventsPerReq = &v +} + +func (o ChainInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ChainID) { + toSerialize["chainID"] = o.ChainID + } + if !isNil(o.ChainOwnerId) { + toSerialize["chainOwnerId"] = o.ChainOwnerId + } + if !isNil(o.Description) { + toSerialize["description"] = o.Description + } + if !isNil(o.EvmChainId) { + toSerialize["evmChainId"] = o.EvmChainId + } + if !isNil(o.GasFeePolicy) { + toSerialize["gasFeePolicy"] = o.GasFeePolicy + } + if !isNil(o.IsActive) { + toSerialize["isActive"] = o.IsActive + } + if !isNil(o.MaxBlobSize) { + toSerialize["maxBlobSize"] = o.MaxBlobSize + } + if !isNil(o.MaxEventSize) { + toSerialize["maxEventSize"] = o.MaxEventSize + } + if !isNil(o.MaxEventsPerReq) { + toSerialize["maxEventsPerReq"] = o.MaxEventsPerReq + } + return json.Marshal(toSerialize) +} + +type NullableChainInfoResponse struct { + value *ChainInfoResponse + isSet bool +} + +func (v NullableChainInfoResponse) Get() *ChainInfoResponse { + return v.value +} + +func (v *NullableChainInfoResponse) Set(val *ChainInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableChainInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableChainInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainInfoResponse(val *ChainInfoResponse) *NullableChainInfoResponse { + return &NullableChainInfoResponse{value: val, isSet: true} +} + +func (v NullableChainInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_chain_metrics.go b/client/model_chain_metrics.go new file mode 100644 index 0000000000..de00a7baa3 --- /dev/null +++ b/client/model_chain_metrics.go @@ -0,0 +1,403 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ChainMetrics struct for ChainMetrics +type ChainMetrics struct { + InAliasOutput *AliasOutputMetricItem `json:"inAliasOutput,omitempty"` + InOnLedgerRequest *OnLedgerRequestMetricItem `json:"inOnLedgerRequest,omitempty"` + InOutput *InOutputMetricItem `json:"inOutput,omitempty"` + InStateOutput *InStateOutputMetricItem `json:"inStateOutput,omitempty"` + InTxInclusionState *TxInclusionStateMsgMetricItem `json:"inTxInclusionState,omitempty"` + OutPublishGovernanceTransaction *TransactionMetricItem `json:"outPublishGovernanceTransaction,omitempty"` + OutPullLatestOutput *InterfaceMetricItem `json:"outPullLatestOutput,omitempty"` + OutPullOutputByID *UTXOInputMetricItem `json:"outPullOutputByID,omitempty"` + OutPullTxInclusionState *TransactionIDMetricItem `json:"outPullTxInclusionState,omitempty"` +} + +// NewChainMetrics instantiates a new ChainMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChainMetrics() *ChainMetrics { + this := ChainMetrics{} + return &this +} + +// NewChainMetricsWithDefaults instantiates a new ChainMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainMetricsWithDefaults() *ChainMetrics { + this := ChainMetrics{} + return &this +} + +// GetInAliasOutput returns the InAliasOutput field value if set, zero value otherwise. +func (o *ChainMetrics) GetInAliasOutput() AliasOutputMetricItem { + if o == nil || isNil(o.InAliasOutput) { + var ret AliasOutputMetricItem + return ret + } + return *o.InAliasOutput +} + +// GetInAliasOutputOk returns a tuple with the InAliasOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInAliasOutputOk() (*AliasOutputMetricItem, bool) { + if o == nil || isNil(o.InAliasOutput) { + return nil, false + } + return o.InAliasOutput, true +} + +// HasInAliasOutput returns a boolean if a field has been set. +func (o *ChainMetrics) HasInAliasOutput() bool { + if o != nil && !isNil(o.InAliasOutput) { + return true + } + + return false +} + +// SetInAliasOutput gets a reference to the given AliasOutputMetricItem and assigns it to the InAliasOutput field. +func (o *ChainMetrics) SetInAliasOutput(v AliasOutputMetricItem) { + o.InAliasOutput = &v +} + +// GetInOnLedgerRequest returns the InOnLedgerRequest field value if set, zero value otherwise. +func (o *ChainMetrics) GetInOnLedgerRequest() OnLedgerRequestMetricItem { + if o == nil || isNil(o.InOnLedgerRequest) { + var ret OnLedgerRequestMetricItem + return ret + } + return *o.InOnLedgerRequest +} + +// GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInOnLedgerRequestOk() (*OnLedgerRequestMetricItem, bool) { + if o == nil || isNil(o.InOnLedgerRequest) { + return nil, false + } + return o.InOnLedgerRequest, true +} + +// HasInOnLedgerRequest returns a boolean if a field has been set. +func (o *ChainMetrics) HasInOnLedgerRequest() bool { + if o != nil && !isNil(o.InOnLedgerRequest) { + return true + } + + return false +} + +// SetInOnLedgerRequest gets a reference to the given OnLedgerRequestMetricItem and assigns it to the InOnLedgerRequest field. +func (o *ChainMetrics) SetInOnLedgerRequest(v OnLedgerRequestMetricItem) { + o.InOnLedgerRequest = &v +} + +// GetInOutput returns the InOutput field value if set, zero value otherwise. +func (o *ChainMetrics) GetInOutput() InOutputMetricItem { + if o == nil || isNil(o.InOutput) { + var ret InOutputMetricItem + return ret + } + return *o.InOutput +} + +// GetInOutputOk returns a tuple with the InOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInOutputOk() (*InOutputMetricItem, bool) { + if o == nil || isNil(o.InOutput) { + return nil, false + } + return o.InOutput, true +} + +// HasInOutput returns a boolean if a field has been set. +func (o *ChainMetrics) HasInOutput() bool { + if o != nil && !isNil(o.InOutput) { + return true + } + + return false +} + +// SetInOutput gets a reference to the given InOutputMetricItem and assigns it to the InOutput field. +func (o *ChainMetrics) SetInOutput(v InOutputMetricItem) { + o.InOutput = &v +} + +// GetInStateOutput returns the InStateOutput field value if set, zero value otherwise. +func (o *ChainMetrics) GetInStateOutput() InStateOutputMetricItem { + if o == nil || isNil(o.InStateOutput) { + var ret InStateOutputMetricItem + return ret + } + return *o.InStateOutput +} + +// GetInStateOutputOk returns a tuple with the InStateOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInStateOutputOk() (*InStateOutputMetricItem, bool) { + if o == nil || isNil(o.InStateOutput) { + return nil, false + } + return o.InStateOutput, true +} + +// HasInStateOutput returns a boolean if a field has been set. +func (o *ChainMetrics) HasInStateOutput() bool { + if o != nil && !isNil(o.InStateOutput) { + return true + } + + return false +} + +// SetInStateOutput gets a reference to the given InStateOutputMetricItem and assigns it to the InStateOutput field. +func (o *ChainMetrics) SetInStateOutput(v InStateOutputMetricItem) { + o.InStateOutput = &v +} + +// GetInTxInclusionState returns the InTxInclusionState field value if set, zero value otherwise. +func (o *ChainMetrics) GetInTxInclusionState() TxInclusionStateMsgMetricItem { + if o == nil || isNil(o.InTxInclusionState) { + var ret TxInclusionStateMsgMetricItem + return ret + } + return *o.InTxInclusionState +} + +// GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInTxInclusionStateOk() (*TxInclusionStateMsgMetricItem, bool) { + if o == nil || isNil(o.InTxInclusionState) { + return nil, false + } + return o.InTxInclusionState, true +} + +// HasInTxInclusionState returns a boolean if a field has been set. +func (o *ChainMetrics) HasInTxInclusionState() bool { + if o != nil && !isNil(o.InTxInclusionState) { + return true + } + + return false +} + +// SetInTxInclusionState gets a reference to the given TxInclusionStateMsgMetricItem and assigns it to the InTxInclusionState field. +func (o *ChainMetrics) SetInTxInclusionState(v TxInclusionStateMsgMetricItem) { + o.InTxInclusionState = &v +} + +// GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field value if set, zero value otherwise. +func (o *ChainMetrics) GetOutPublishGovernanceTransaction() TransactionMetricItem { + if o == nil || isNil(o.OutPublishGovernanceTransaction) { + var ret TransactionMetricItem + return ret + } + return *o.OutPublishGovernanceTransaction +} + +// GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPublishGovernanceTransactionOk() (*TransactionMetricItem, bool) { + if o == nil || isNil(o.OutPublishGovernanceTransaction) { + return nil, false + } + return o.OutPublishGovernanceTransaction, true +} + +// HasOutPublishGovernanceTransaction returns a boolean if a field has been set. +func (o *ChainMetrics) HasOutPublishGovernanceTransaction() bool { + if o != nil && !isNil(o.OutPublishGovernanceTransaction) { + return true + } + + return false +} + +// SetOutPublishGovernanceTransaction gets a reference to the given TransactionMetricItem and assigns it to the OutPublishGovernanceTransaction field. +func (o *ChainMetrics) SetOutPublishGovernanceTransaction(v TransactionMetricItem) { + o.OutPublishGovernanceTransaction = &v +} + +// GetOutPullLatestOutput returns the OutPullLatestOutput field value if set, zero value otherwise. +func (o *ChainMetrics) GetOutPullLatestOutput() InterfaceMetricItem { + if o == nil || isNil(o.OutPullLatestOutput) { + var ret InterfaceMetricItem + return ret + } + return *o.OutPullLatestOutput +} + +// GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPullLatestOutputOk() (*InterfaceMetricItem, bool) { + if o == nil || isNil(o.OutPullLatestOutput) { + return nil, false + } + return o.OutPullLatestOutput, true +} + +// HasOutPullLatestOutput returns a boolean if a field has been set. +func (o *ChainMetrics) HasOutPullLatestOutput() bool { + if o != nil && !isNil(o.OutPullLatestOutput) { + return true + } + + return false +} + +// SetOutPullLatestOutput gets a reference to the given InterfaceMetricItem and assigns it to the OutPullLatestOutput field. +func (o *ChainMetrics) SetOutPullLatestOutput(v InterfaceMetricItem) { + o.OutPullLatestOutput = &v +} + +// GetOutPullOutputByID returns the OutPullOutputByID field value if set, zero value otherwise. +func (o *ChainMetrics) GetOutPullOutputByID() UTXOInputMetricItem { + if o == nil || isNil(o.OutPullOutputByID) { + var ret UTXOInputMetricItem + return ret + } + return *o.OutPullOutputByID +} + +// GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPullOutputByIDOk() (*UTXOInputMetricItem, bool) { + if o == nil || isNil(o.OutPullOutputByID) { + return nil, false + } + return o.OutPullOutputByID, true +} + +// HasOutPullOutputByID returns a boolean if a field has been set. +func (o *ChainMetrics) HasOutPullOutputByID() bool { + if o != nil && !isNil(o.OutPullOutputByID) { + return true + } + + return false +} + +// SetOutPullOutputByID gets a reference to the given UTXOInputMetricItem and assigns it to the OutPullOutputByID field. +func (o *ChainMetrics) SetOutPullOutputByID(v UTXOInputMetricItem) { + o.OutPullOutputByID = &v +} + +// GetOutPullTxInclusionState returns the OutPullTxInclusionState field value if set, zero value otherwise. +func (o *ChainMetrics) GetOutPullTxInclusionState() TransactionIDMetricItem { + if o == nil || isNil(o.OutPullTxInclusionState) { + var ret TransactionIDMetricItem + return ret + } + return *o.OutPullTxInclusionState +} + +// GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPullTxInclusionStateOk() (*TransactionIDMetricItem, bool) { + if o == nil || isNil(o.OutPullTxInclusionState) { + return nil, false + } + return o.OutPullTxInclusionState, true +} + +// HasOutPullTxInclusionState returns a boolean if a field has been set. +func (o *ChainMetrics) HasOutPullTxInclusionState() bool { + if o != nil && !isNil(o.OutPullTxInclusionState) { + return true + } + + return false +} + +// SetOutPullTxInclusionState gets a reference to the given TransactionIDMetricItem and assigns it to the OutPullTxInclusionState field. +func (o *ChainMetrics) SetOutPullTxInclusionState(v TransactionIDMetricItem) { + o.OutPullTxInclusionState = &v +} + +func (o ChainMetrics) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.InAliasOutput) { + toSerialize["inAliasOutput"] = o.InAliasOutput + } + if !isNil(o.InOnLedgerRequest) { + toSerialize["inOnLedgerRequest"] = o.InOnLedgerRequest + } + if !isNil(o.InOutput) { + toSerialize["inOutput"] = o.InOutput + } + if !isNil(o.InStateOutput) { + toSerialize["inStateOutput"] = o.InStateOutput + } + if !isNil(o.InTxInclusionState) { + toSerialize["inTxInclusionState"] = o.InTxInclusionState + } + if !isNil(o.OutPublishGovernanceTransaction) { + toSerialize["outPublishGovernanceTransaction"] = o.OutPublishGovernanceTransaction + } + if !isNil(o.OutPullLatestOutput) { + toSerialize["outPullLatestOutput"] = o.OutPullLatestOutput + } + if !isNil(o.OutPullOutputByID) { + toSerialize["outPullOutputByID"] = o.OutPullOutputByID + } + if !isNil(o.OutPullTxInclusionState) { + toSerialize["outPullTxInclusionState"] = o.OutPullTxInclusionState + } + return json.Marshal(toSerialize) +} + +type NullableChainMetrics struct { + value *ChainMetrics + isSet bool +} + +func (v NullableChainMetrics) Get() *ChainMetrics { + return v.value +} + +func (v *NullableChainMetrics) Set(val *ChainMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableChainMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableChainMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainMetrics(val *ChainMetrics) *NullableChainMetrics { + return &NullableChainMetrics{value: val, isSet: true} +} + +func (v NullableChainMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_committee_info_response.go b/client/model_committee_info_response.go new file mode 100644 index 0000000000..c9a34780df --- /dev/null +++ b/client/model_committee_info_response.go @@ -0,0 +1,300 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// CommitteeInfoResponse struct for CommitteeInfoResponse +type CommitteeInfoResponse struct { + // A list of all access nodes and their peering info. + AccessNodes []CommitteeNode `json:"accessNodes,omitempty"` + // Whether or not the chain is active. + Active *bool `json:"active,omitempty"` + // A list of all candidate nodes and their peering info. + CandidateNodes []CommitteeNode `json:"candidateNodes,omitempty"` + // ChainID (Bech32-encoded). + ChainId *string `json:"chainId,omitempty"` + // A list of all committee nodes and their peering info. + CommitteeNodes []CommitteeNode `json:"committeeNodes,omitempty"` + StateAddress *string `json:"stateAddress,omitempty"` +} + +// NewCommitteeInfoResponse instantiates a new CommitteeInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommitteeInfoResponse() *CommitteeInfoResponse { + this := CommitteeInfoResponse{} + return &this +} + +// NewCommitteeInfoResponseWithDefaults instantiates a new CommitteeInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitteeInfoResponseWithDefaults() *CommitteeInfoResponse { + this := CommitteeInfoResponse{} + return &this +} + +// GetAccessNodes returns the AccessNodes field value if set, zero value otherwise. +func (o *CommitteeInfoResponse) GetAccessNodes() []CommitteeNode { + if o == nil || isNil(o.AccessNodes) { + var ret []CommitteeNode + return ret + } + return o.AccessNodes +} + +// GetAccessNodesOk returns a tuple with the AccessNodes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeInfoResponse) GetAccessNodesOk() ([]CommitteeNode, bool) { + if o == nil || isNil(o.AccessNodes) { + return nil, false + } + return o.AccessNodes, true +} + +// HasAccessNodes returns a boolean if a field has been set. +func (o *CommitteeInfoResponse) HasAccessNodes() bool { + if o != nil && !isNil(o.AccessNodes) { + return true + } + + return false +} + +// SetAccessNodes gets a reference to the given []CommitteeNode and assigns it to the AccessNodes field. +func (o *CommitteeInfoResponse) SetAccessNodes(v []CommitteeNode) { + o.AccessNodes = v +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *CommitteeInfoResponse) GetActive() bool { + if o == nil || isNil(o.Active) { + var ret bool + return ret + } + return *o.Active +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeInfoResponse) GetActiveOk() (*bool, bool) { + if o == nil || isNil(o.Active) { + return nil, false + } + return o.Active, true +} + +// HasActive returns a boolean if a field has been set. +func (o *CommitteeInfoResponse) HasActive() bool { + if o != nil && !isNil(o.Active) { + return true + } + + return false +} + +// SetActive gets a reference to the given bool and assigns it to the Active field. +func (o *CommitteeInfoResponse) SetActive(v bool) { + o.Active = &v +} + +// GetCandidateNodes returns the CandidateNodes field value if set, zero value otherwise. +func (o *CommitteeInfoResponse) GetCandidateNodes() []CommitteeNode { + if o == nil || isNil(o.CandidateNodes) { + var ret []CommitteeNode + return ret + } + return o.CandidateNodes +} + +// GetCandidateNodesOk returns a tuple with the CandidateNodes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeInfoResponse) GetCandidateNodesOk() ([]CommitteeNode, bool) { + if o == nil || isNil(o.CandidateNodes) { + return nil, false + } + return o.CandidateNodes, true +} + +// HasCandidateNodes returns a boolean if a field has been set. +func (o *CommitteeInfoResponse) HasCandidateNodes() bool { + if o != nil && !isNil(o.CandidateNodes) { + return true + } + + return false +} + +// SetCandidateNodes gets a reference to the given []CommitteeNode and assigns it to the CandidateNodes field. +func (o *CommitteeInfoResponse) SetCandidateNodes(v []CommitteeNode) { + o.CandidateNodes = v +} + +// GetChainId returns the ChainId field value if set, zero value otherwise. +func (o *CommitteeInfoResponse) GetChainId() string { + if o == nil || isNil(o.ChainId) { + var ret string + return ret + } + return *o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeInfoResponse) GetChainIdOk() (*string, bool) { + if o == nil || isNil(o.ChainId) { + return nil, false + } + return o.ChainId, true +} + +// HasChainId returns a boolean if a field has been set. +func (o *CommitteeInfoResponse) HasChainId() bool { + if o != nil && !isNil(o.ChainId) { + return true + } + + return false +} + +// SetChainId gets a reference to the given string and assigns it to the ChainId field. +func (o *CommitteeInfoResponse) SetChainId(v string) { + o.ChainId = &v +} + +// GetCommitteeNodes returns the CommitteeNodes field value if set, zero value otherwise. +func (o *CommitteeInfoResponse) GetCommitteeNodes() []CommitteeNode { + if o == nil || isNil(o.CommitteeNodes) { + var ret []CommitteeNode + return ret + } + return o.CommitteeNodes +} + +// GetCommitteeNodesOk returns a tuple with the CommitteeNodes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeInfoResponse) GetCommitteeNodesOk() ([]CommitteeNode, bool) { + if o == nil || isNil(o.CommitteeNodes) { + return nil, false + } + return o.CommitteeNodes, true +} + +// HasCommitteeNodes returns a boolean if a field has been set. +func (o *CommitteeInfoResponse) HasCommitteeNodes() bool { + if o != nil && !isNil(o.CommitteeNodes) { + return true + } + + return false +} + +// SetCommitteeNodes gets a reference to the given []CommitteeNode and assigns it to the CommitteeNodes field. +func (o *CommitteeInfoResponse) SetCommitteeNodes(v []CommitteeNode) { + o.CommitteeNodes = v +} + +// GetStateAddress returns the StateAddress field value if set, zero value otherwise. +func (o *CommitteeInfoResponse) GetStateAddress() string { + if o == nil || isNil(o.StateAddress) { + var ret string + return ret + } + return *o.StateAddress +} + +// GetStateAddressOk returns a tuple with the StateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeInfoResponse) GetStateAddressOk() (*string, bool) { + if o == nil || isNil(o.StateAddress) { + return nil, false + } + return o.StateAddress, true +} + +// HasStateAddress returns a boolean if a field has been set. +func (o *CommitteeInfoResponse) HasStateAddress() bool { + if o != nil && !isNil(o.StateAddress) { + return true + } + + return false +} + +// SetStateAddress gets a reference to the given string and assigns it to the StateAddress field. +func (o *CommitteeInfoResponse) SetStateAddress(v string) { + o.StateAddress = &v +} + +func (o CommitteeInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.AccessNodes) { + toSerialize["accessNodes"] = o.AccessNodes + } + if !isNil(o.Active) { + toSerialize["active"] = o.Active + } + if !isNil(o.CandidateNodes) { + toSerialize["candidateNodes"] = o.CandidateNodes + } + if !isNil(o.ChainId) { + toSerialize["chainId"] = o.ChainId + } + if !isNil(o.CommitteeNodes) { + toSerialize["committeeNodes"] = o.CommitteeNodes + } + if !isNil(o.StateAddress) { + toSerialize["stateAddress"] = o.StateAddress + } + return json.Marshal(toSerialize) +} + +type NullableCommitteeInfoResponse struct { + value *CommitteeInfoResponse + isSet bool +} + +func (v NullableCommitteeInfoResponse) Get() *CommitteeInfoResponse { + return v.value +} + +func (v *NullableCommitteeInfoResponse) Set(val *CommitteeInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCommitteeInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitteeInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitteeInfoResponse(val *CommitteeInfoResponse) *NullableCommitteeInfoResponse { + return &NullableCommitteeInfoResponse{value: val, isSet: true} +} + +func (v NullableCommitteeInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitteeInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_committee_node.go b/client/model_committee_node.go new file mode 100644 index 0000000000..6c244ec2dd --- /dev/null +++ b/client/model_committee_node.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// CommitteeNode struct for CommitteeNode +type CommitteeNode struct { + AccessAPI *string `json:"accessAPI,omitempty"` + Node *PeeringNodeStatusResponse `json:"node,omitempty"` +} + +// NewCommitteeNode instantiates a new CommitteeNode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCommitteeNode() *CommitteeNode { + this := CommitteeNode{} + return &this +} + +// NewCommitteeNodeWithDefaults instantiates a new CommitteeNode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCommitteeNodeWithDefaults() *CommitteeNode { + this := CommitteeNode{} + return &this +} + +// GetAccessAPI returns the AccessAPI field value if set, zero value otherwise. +func (o *CommitteeNode) GetAccessAPI() string { + if o == nil || isNil(o.AccessAPI) { + var ret string + return ret + } + return *o.AccessAPI +} + +// GetAccessAPIOk returns a tuple with the AccessAPI field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeNode) GetAccessAPIOk() (*string, bool) { + if o == nil || isNil(o.AccessAPI) { + return nil, false + } + return o.AccessAPI, true +} + +// HasAccessAPI returns a boolean if a field has been set. +func (o *CommitteeNode) HasAccessAPI() bool { + if o != nil && !isNil(o.AccessAPI) { + return true + } + + return false +} + +// SetAccessAPI gets a reference to the given string and assigns it to the AccessAPI field. +func (o *CommitteeNode) SetAccessAPI(v string) { + o.AccessAPI = &v +} + +// GetNode returns the Node field value if set, zero value otherwise. +func (o *CommitteeNode) GetNode() PeeringNodeStatusResponse { + if o == nil || isNil(o.Node) { + var ret PeeringNodeStatusResponse + return ret + } + return *o.Node +} + +// GetNodeOk returns a tuple with the Node field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CommitteeNode) GetNodeOk() (*PeeringNodeStatusResponse, bool) { + if o == nil || isNil(o.Node) { + return nil, false + } + return o.Node, true +} + +// HasNode returns a boolean if a field has been set. +func (o *CommitteeNode) HasNode() bool { + if o != nil && !isNil(o.Node) { + return true + } + + return false +} + +// SetNode gets a reference to the given PeeringNodeStatusResponse and assigns it to the Node field. +func (o *CommitteeNode) SetNode(v PeeringNodeStatusResponse) { + o.Node = &v +} + +func (o CommitteeNode) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.AccessAPI) { + toSerialize["accessAPI"] = o.AccessAPI + } + if !isNil(o.Node) { + toSerialize["node"] = o.Node + } + return json.Marshal(toSerialize) +} + +type NullableCommitteeNode struct { + value *CommitteeNode + isSet bool +} + +func (v NullableCommitteeNode) Get() *CommitteeNode { + return v.value +} + +func (v *NullableCommitteeNode) Set(val *CommitteeNode) { + v.value = val + v.isSet = true +} + +func (v NullableCommitteeNode) IsSet() bool { + return v.isSet +} + +func (v *NullableCommitteeNode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCommitteeNode(val *CommitteeNode) *NullableCommitteeNode { + return &NullableCommitteeNode{value: val, isSet: true} +} + +func (v NullableCommitteeNode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCommitteeNode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_consensus_pipe_metrics.go b/client/model_consensus_pipe_metrics.go new file mode 100644 index 0000000000..16e6c0c14c --- /dev/null +++ b/client/model_consensus_pipe_metrics.go @@ -0,0 +1,259 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ConsensusPipeMetrics struct for ConsensusPipeMetrics +type ConsensusPipeMetrics struct { + EventACSMsgPipeSize *int32 `json:"eventACSMsgPipeSize,omitempty"` + EventPeerLogIndexMsgPipeSize *int32 `json:"eventPeerLogIndexMsgPipeSize,omitempty"` + EventStateTransitionMsgPipeSize *int32 `json:"eventStateTransitionMsgPipeSize,omitempty"` + EventTimerMsgPipeSize *int32 `json:"eventTimerMsgPipeSize,omitempty"` + EventVMResultMsgPipeSize *int32 `json:"eventVMResultMsgPipeSize,omitempty"` +} + +// NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsensusPipeMetrics() *ConsensusPipeMetrics { + this := ConsensusPipeMetrics{} + return &this +} + +// NewConsensusPipeMetricsWithDefaults instantiates a new ConsensusPipeMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsensusPipeMetricsWithDefaults() *ConsensusPipeMetrics { + this := ConsensusPipeMetrics{} + return &this +} + +// GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field value if set, zero value otherwise. +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32 { + if o == nil || isNil(o.EventACSMsgPipeSize) { + var ret int32 + return ret + } + return *o.EventACSMsgPipeSize +} + +// GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool) { + if o == nil || isNil(o.EventACSMsgPipeSize) { + return nil, false + } + return o.EventACSMsgPipeSize, true +} + +// HasEventACSMsgPipeSize returns a boolean if a field has been set. +func (o *ConsensusPipeMetrics) HasEventACSMsgPipeSize() bool { + if o != nil && !isNil(o.EventACSMsgPipeSize) { + return true + } + + return false +} + +// SetEventACSMsgPipeSize gets a reference to the given int32 and assigns it to the EventACSMsgPipeSize field. +func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32) { + o.EventACSMsgPipeSize = &v +} + +// GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field value if set, zero value otherwise. +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32 { + if o == nil || isNil(o.EventPeerLogIndexMsgPipeSize) { + var ret int32 + return ret + } + return *o.EventPeerLogIndexMsgPipeSize +} + +// GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool) { + if o == nil || isNil(o.EventPeerLogIndexMsgPipeSize) { + return nil, false + } + return o.EventPeerLogIndexMsgPipeSize, true +} + +// HasEventPeerLogIndexMsgPipeSize returns a boolean if a field has been set. +func (o *ConsensusPipeMetrics) HasEventPeerLogIndexMsgPipeSize() bool { + if o != nil && !isNil(o.EventPeerLogIndexMsgPipeSize) { + return true + } + + return false +} + +// SetEventPeerLogIndexMsgPipeSize gets a reference to the given int32 and assigns it to the EventPeerLogIndexMsgPipeSize field. +func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32) { + o.EventPeerLogIndexMsgPipeSize = &v +} + +// GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field value if set, zero value otherwise. +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32 { + if o == nil || isNil(o.EventStateTransitionMsgPipeSize) { + var ret int32 + return ret + } + return *o.EventStateTransitionMsgPipeSize +} + +// GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool) { + if o == nil || isNil(o.EventStateTransitionMsgPipeSize) { + return nil, false + } + return o.EventStateTransitionMsgPipeSize, true +} + +// HasEventStateTransitionMsgPipeSize returns a boolean if a field has been set. +func (o *ConsensusPipeMetrics) HasEventStateTransitionMsgPipeSize() bool { + if o != nil && !isNil(o.EventStateTransitionMsgPipeSize) { + return true + } + + return false +} + +// SetEventStateTransitionMsgPipeSize gets a reference to the given int32 and assigns it to the EventStateTransitionMsgPipeSize field. +func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32) { + o.EventStateTransitionMsgPipeSize = &v +} + +// GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field value if set, zero value otherwise. +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32 { + if o == nil || isNil(o.EventTimerMsgPipeSize) { + var ret int32 + return ret + } + return *o.EventTimerMsgPipeSize +} + +// GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool) { + if o == nil || isNil(o.EventTimerMsgPipeSize) { + return nil, false + } + return o.EventTimerMsgPipeSize, true +} + +// HasEventTimerMsgPipeSize returns a boolean if a field has been set. +func (o *ConsensusPipeMetrics) HasEventTimerMsgPipeSize() bool { + if o != nil && !isNil(o.EventTimerMsgPipeSize) { + return true + } + + return false +} + +// SetEventTimerMsgPipeSize gets a reference to the given int32 and assigns it to the EventTimerMsgPipeSize field. +func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32) { + o.EventTimerMsgPipeSize = &v +} + +// GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field value if set, zero value otherwise. +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32 { + if o == nil || isNil(o.EventVMResultMsgPipeSize) { + var ret int32 + return ret + } + return *o.EventVMResultMsgPipeSize +} + +// GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool) { + if o == nil || isNil(o.EventVMResultMsgPipeSize) { + return nil, false + } + return o.EventVMResultMsgPipeSize, true +} + +// HasEventVMResultMsgPipeSize returns a boolean if a field has been set. +func (o *ConsensusPipeMetrics) HasEventVMResultMsgPipeSize() bool { + if o != nil && !isNil(o.EventVMResultMsgPipeSize) { + return true + } + + return false +} + +// SetEventVMResultMsgPipeSize gets a reference to the given int32 and assigns it to the EventVMResultMsgPipeSize field. +func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32) { + o.EventVMResultMsgPipeSize = &v +} + +func (o ConsensusPipeMetrics) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.EventACSMsgPipeSize) { + toSerialize["eventACSMsgPipeSize"] = o.EventACSMsgPipeSize + } + if !isNil(o.EventPeerLogIndexMsgPipeSize) { + toSerialize["eventPeerLogIndexMsgPipeSize"] = o.EventPeerLogIndexMsgPipeSize + } + if !isNil(o.EventStateTransitionMsgPipeSize) { + toSerialize["eventStateTransitionMsgPipeSize"] = o.EventStateTransitionMsgPipeSize + } + if !isNil(o.EventTimerMsgPipeSize) { + toSerialize["eventTimerMsgPipeSize"] = o.EventTimerMsgPipeSize + } + if !isNil(o.EventVMResultMsgPipeSize) { + toSerialize["eventVMResultMsgPipeSize"] = o.EventVMResultMsgPipeSize + } + return json.Marshal(toSerialize) +} + +type NullableConsensusPipeMetrics struct { + value *ConsensusPipeMetrics + isSet bool +} + +func (v NullableConsensusPipeMetrics) Get() *ConsensusPipeMetrics { + return v.value +} + +func (v *NullableConsensusPipeMetrics) Set(val *ConsensusPipeMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusPipeMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusPipeMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusPipeMetrics(val *ConsensusPipeMetrics) *NullableConsensusPipeMetrics { + return &NullableConsensusPipeMetrics{value: val, isSet: true} +} + +func (v NullableConsensusPipeMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusPipeMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_consensus_workflow_metrics.go b/client/model_consensus_workflow_metrics.go new file mode 100644 index 0000000000..222fe9222b --- /dev/null +++ b/client/model_consensus_workflow_metrics.go @@ -0,0 +1,746 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// ConsensusWorkflowMetrics struct for ConsensusWorkflowMetrics +type ConsensusWorkflowMetrics struct { + // Shows current state index of the consensus + CurrentStateIndex *int32 `json:"currentStateIndex,omitempty"` + // Shows if batch proposal is sent out in current consensus iteration + FlagBatchProposalSent *bool `json:"flagBatchProposalSent,omitempty"` + // Shows if consensus on batch is reached and known in current consensus iteration + FlagConsensusBatchKnown *bool `json:"flagConsensusBatchKnown,omitempty"` + // Shows if consensus algorithm is still not completed in current consensus iteration + FlagInProgress *bool `json:"flagInProgress,omitempty"` + // Shows if state output is received in current consensus iteration + FlagStateReceived *bool `json:"flagStateReceived,omitempty"` + // Shows if consensus on transaction is reached in current consensus iteration + FlagTransactionFinalized *bool `json:"flagTransactionFinalized,omitempty"` + // Shows if transaction is posted to L1 in current consensus iteration + FlagTransactionPosted *bool `json:"flagTransactionPosted,omitempty"` + // Shows if L1 reported that it has seen the transaction of current consensus iteration + FlagTransactionSeen *bool `json:"flagTransactionSeen,omitempty"` + // Shows if virtual machine has returned its results in current consensus iteration + FlagVMResultSigned *bool `json:"flagVMResultSigned,omitempty"` + // Shows if virtual machine is started in current consensus iteration + FlagVMStarted *bool `json:"flagVMStarted,omitempty"` + // Shows when batch proposal was last sent out in current consensus iteration + TimeBatchProposalSent *time.Time `json:"timeBatchProposalSent,omitempty"` + // Shows when algorithm was last completed in current consensus iteration + TimeCompleted *time.Time `json:"timeCompleted,omitempty"` + // Shows when ACS results of consensus on batch was last received in current consensus iteration + TimeConsensusBatchKnown *time.Time `json:"timeConsensusBatchKnown,omitempty"` + // Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration + TimeTransactionFinalized *time.Time `json:"timeTransactionFinalized,omitempty"` + // Shows when transaction was last posted to L1 in current consensus iteration + TimeTransactionPosted *time.Time `json:"timeTransactionPosted,omitempty"` + // Shows when algorithm last noted that transaction had been seen by L1 in current consensus iteration + TimeTransactionSeen *time.Time `json:"timeTransactionSeen,omitempty"` + // Shows when virtual machine results were last received and signed in current consensus iteration + TimeVMResultSigned *time.Time `json:"timeVMResultSigned,omitempty"` + // Shows when virtual machine was last started in current consensus iteration + TimeVMStarted *time.Time `json:"timeVMStarted,omitempty"` +} + +// NewConsensusWorkflowMetrics instantiates a new ConsensusWorkflowMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsensusWorkflowMetrics() *ConsensusWorkflowMetrics { + this := ConsensusWorkflowMetrics{} + return &this +} + +// NewConsensusWorkflowMetricsWithDefaults instantiates a new ConsensusWorkflowMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsensusWorkflowMetricsWithDefaults() *ConsensusWorkflowMetrics { + this := ConsensusWorkflowMetrics{} + return &this +} + +// GetCurrentStateIndex returns the CurrentStateIndex field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetCurrentStateIndex() int32 { + if o == nil || isNil(o.CurrentStateIndex) { + var ret int32 + return ret + } + return *o.CurrentStateIndex +} + +// GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetCurrentStateIndexOk() (*int32, bool) { + if o == nil || isNil(o.CurrentStateIndex) { + return nil, false + } + return o.CurrentStateIndex, true +} + +// HasCurrentStateIndex returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasCurrentStateIndex() bool { + if o != nil && !isNil(o.CurrentStateIndex) { + return true + } + + return false +} + +// SetCurrentStateIndex gets a reference to the given int32 and assigns it to the CurrentStateIndex field. +func (o *ConsensusWorkflowMetrics) SetCurrentStateIndex(v int32) { + o.CurrentStateIndex = &v +} + +// GetFlagBatchProposalSent returns the FlagBatchProposalSent field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSent() bool { + if o == nil || isNil(o.FlagBatchProposalSent) { + var ret bool + return ret + } + return *o.FlagBatchProposalSent +} + +// GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSentOk() (*bool, bool) { + if o == nil || isNil(o.FlagBatchProposalSent) { + return nil, false + } + return o.FlagBatchProposalSent, true +} + +// HasFlagBatchProposalSent returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagBatchProposalSent() bool { + if o != nil && !isNil(o.FlagBatchProposalSent) { + return true + } + + return false +} + +// SetFlagBatchProposalSent gets a reference to the given bool and assigns it to the FlagBatchProposalSent field. +func (o *ConsensusWorkflowMetrics) SetFlagBatchProposalSent(v bool) { + o.FlagBatchProposalSent = &v +} + +// GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnown() bool { + if o == nil || isNil(o.FlagConsensusBatchKnown) { + var ret bool + return ret + } + return *o.FlagConsensusBatchKnown +} + +// GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnownOk() (*bool, bool) { + if o == nil || isNil(o.FlagConsensusBatchKnown) { + return nil, false + } + return o.FlagConsensusBatchKnown, true +} + +// HasFlagConsensusBatchKnown returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagConsensusBatchKnown() bool { + if o != nil && !isNil(o.FlagConsensusBatchKnown) { + return true + } + + return false +} + +// SetFlagConsensusBatchKnown gets a reference to the given bool and assigns it to the FlagConsensusBatchKnown field. +func (o *ConsensusWorkflowMetrics) SetFlagConsensusBatchKnown(v bool) { + o.FlagConsensusBatchKnown = &v +} + +// GetFlagInProgress returns the FlagInProgress field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagInProgress() bool { + if o == nil || isNil(o.FlagInProgress) { + var ret bool + return ret + } + return *o.FlagInProgress +} + +// GetFlagInProgressOk returns a tuple with the FlagInProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagInProgressOk() (*bool, bool) { + if o == nil || isNil(o.FlagInProgress) { + return nil, false + } + return o.FlagInProgress, true +} + +// HasFlagInProgress returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagInProgress() bool { + if o != nil && !isNil(o.FlagInProgress) { + return true + } + + return false +} + +// SetFlagInProgress gets a reference to the given bool and assigns it to the FlagInProgress field. +func (o *ConsensusWorkflowMetrics) SetFlagInProgress(v bool) { + o.FlagInProgress = &v +} + +// GetFlagStateReceived returns the FlagStateReceived field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagStateReceived() bool { + if o == nil || isNil(o.FlagStateReceived) { + var ret bool + return ret + } + return *o.FlagStateReceived +} + +// GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagStateReceivedOk() (*bool, bool) { + if o == nil || isNil(o.FlagStateReceived) { + return nil, false + } + return o.FlagStateReceived, true +} + +// HasFlagStateReceived returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagStateReceived() bool { + if o != nil && !isNil(o.FlagStateReceived) { + return true + } + + return false +} + +// SetFlagStateReceived gets a reference to the given bool and assigns it to the FlagStateReceived field. +func (o *ConsensusWorkflowMetrics) SetFlagStateReceived(v bool) { + o.FlagStateReceived = &v +} + +// GetFlagTransactionFinalized returns the FlagTransactionFinalized field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalized() bool { + if o == nil || isNil(o.FlagTransactionFinalized) { + var ret bool + return ret + } + return *o.FlagTransactionFinalized +} + +// GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalizedOk() (*bool, bool) { + if o == nil || isNil(o.FlagTransactionFinalized) { + return nil, false + } + return o.FlagTransactionFinalized, true +} + +// HasFlagTransactionFinalized returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagTransactionFinalized() bool { + if o != nil && !isNil(o.FlagTransactionFinalized) { + return true + } + + return false +} + +// SetFlagTransactionFinalized gets a reference to the given bool and assigns it to the FlagTransactionFinalized field. +func (o *ConsensusWorkflowMetrics) SetFlagTransactionFinalized(v bool) { + o.FlagTransactionFinalized = &v +} + +// GetFlagTransactionPosted returns the FlagTransactionPosted field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionPosted() bool { + if o == nil || isNil(o.FlagTransactionPosted) { + var ret bool + return ret + } + return *o.FlagTransactionPosted +} + +// GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionPostedOk() (*bool, bool) { + if o == nil || isNil(o.FlagTransactionPosted) { + return nil, false + } + return o.FlagTransactionPosted, true +} + +// HasFlagTransactionPosted returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagTransactionPosted() bool { + if o != nil && !isNil(o.FlagTransactionPosted) { + return true + } + + return false +} + +// SetFlagTransactionPosted gets a reference to the given bool and assigns it to the FlagTransactionPosted field. +func (o *ConsensusWorkflowMetrics) SetFlagTransactionPosted(v bool) { + o.FlagTransactionPosted = &v +} + +// GetFlagTransactionSeen returns the FlagTransactionSeen field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeen() bool { + if o == nil || isNil(o.FlagTransactionSeen) { + var ret bool + return ret + } + return *o.FlagTransactionSeen +} + +// GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeenOk() (*bool, bool) { + if o == nil || isNil(o.FlagTransactionSeen) { + return nil, false + } + return o.FlagTransactionSeen, true +} + +// HasFlagTransactionSeen returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagTransactionSeen() bool { + if o != nil && !isNil(o.FlagTransactionSeen) { + return true + } + + return false +} + +// SetFlagTransactionSeen gets a reference to the given bool and assigns it to the FlagTransactionSeen field. +func (o *ConsensusWorkflowMetrics) SetFlagTransactionSeen(v bool) { + o.FlagTransactionSeen = &v +} + +// GetFlagVMResultSigned returns the FlagVMResultSigned field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagVMResultSigned() bool { + if o == nil || isNil(o.FlagVMResultSigned) { + var ret bool + return ret + } + return *o.FlagVMResultSigned +} + +// GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagVMResultSignedOk() (*bool, bool) { + if o == nil || isNil(o.FlagVMResultSigned) { + return nil, false + } + return o.FlagVMResultSigned, true +} + +// HasFlagVMResultSigned returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagVMResultSigned() bool { + if o != nil && !isNil(o.FlagVMResultSigned) { + return true + } + + return false +} + +// SetFlagVMResultSigned gets a reference to the given bool and assigns it to the FlagVMResultSigned field. +func (o *ConsensusWorkflowMetrics) SetFlagVMResultSigned(v bool) { + o.FlagVMResultSigned = &v +} + +// GetFlagVMStarted returns the FlagVMStarted field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetFlagVMStarted() bool { + if o == nil || isNil(o.FlagVMStarted) { + var ret bool + return ret + } + return *o.FlagVMStarted +} + +// GetFlagVMStartedOk returns a tuple with the FlagVMStarted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagVMStartedOk() (*bool, bool) { + if o == nil || isNil(o.FlagVMStarted) { + return nil, false + } + return o.FlagVMStarted, true +} + +// HasFlagVMStarted returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasFlagVMStarted() bool { + if o != nil && !isNil(o.FlagVMStarted) { + return true + } + + return false +} + +// SetFlagVMStarted gets a reference to the given bool and assigns it to the FlagVMStarted field. +func (o *ConsensusWorkflowMetrics) SetFlagVMStarted(v bool) { + o.FlagVMStarted = &v +} + +// GetTimeBatchProposalSent returns the TimeBatchProposalSent field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSent() time.Time { + if o == nil || isNil(o.TimeBatchProposalSent) { + var ret time.Time + return ret + } + return *o.TimeBatchProposalSent +} + +// GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSentOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeBatchProposalSent) { + return nil, false + } + return o.TimeBatchProposalSent, true +} + +// HasTimeBatchProposalSent returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeBatchProposalSent() bool { + if o != nil && !isNil(o.TimeBatchProposalSent) { + return true + } + + return false +} + +// SetTimeBatchProposalSent gets a reference to the given time.Time and assigns it to the TimeBatchProposalSent field. +func (o *ConsensusWorkflowMetrics) SetTimeBatchProposalSent(v time.Time) { + o.TimeBatchProposalSent = &v +} + +// GetTimeCompleted returns the TimeCompleted field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeCompleted() time.Time { + if o == nil || isNil(o.TimeCompleted) { + var ret time.Time + return ret + } + return *o.TimeCompleted +} + +// GetTimeCompletedOk returns a tuple with the TimeCompleted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeCompletedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeCompleted) { + return nil, false + } + return o.TimeCompleted, true +} + +// HasTimeCompleted returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeCompleted() bool { + if o != nil && !isNil(o.TimeCompleted) { + return true + } + + return false +} + +// SetTimeCompleted gets a reference to the given time.Time and assigns it to the TimeCompleted field. +func (o *ConsensusWorkflowMetrics) SetTimeCompleted(v time.Time) { + o.TimeCompleted = &v +} + +// GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnown() time.Time { + if o == nil || isNil(o.TimeConsensusBatchKnown) { + var ret time.Time + return ret + } + return *o.TimeConsensusBatchKnown +} + +// GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnownOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeConsensusBatchKnown) { + return nil, false + } + return o.TimeConsensusBatchKnown, true +} + +// HasTimeConsensusBatchKnown returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeConsensusBatchKnown() bool { + if o != nil && !isNil(o.TimeConsensusBatchKnown) { + return true + } + + return false +} + +// SetTimeConsensusBatchKnown gets a reference to the given time.Time and assigns it to the TimeConsensusBatchKnown field. +func (o *ConsensusWorkflowMetrics) SetTimeConsensusBatchKnown(v time.Time) { + o.TimeConsensusBatchKnown = &v +} + +// GetTimeTransactionFinalized returns the TimeTransactionFinalized field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalized() time.Time { + if o == nil || isNil(o.TimeTransactionFinalized) { + var ret time.Time + return ret + } + return *o.TimeTransactionFinalized +} + +// GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalizedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeTransactionFinalized) { + return nil, false + } + return o.TimeTransactionFinalized, true +} + +// HasTimeTransactionFinalized returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeTransactionFinalized() bool { + if o != nil && !isNil(o.TimeTransactionFinalized) { + return true + } + + return false +} + +// SetTimeTransactionFinalized gets a reference to the given time.Time and assigns it to the TimeTransactionFinalized field. +func (o *ConsensusWorkflowMetrics) SetTimeTransactionFinalized(v time.Time) { + o.TimeTransactionFinalized = &v +} + +// GetTimeTransactionPosted returns the TimeTransactionPosted field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionPosted() time.Time { + if o == nil || isNil(o.TimeTransactionPosted) { + var ret time.Time + return ret + } + return *o.TimeTransactionPosted +} + +// GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionPostedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeTransactionPosted) { + return nil, false + } + return o.TimeTransactionPosted, true +} + +// HasTimeTransactionPosted returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeTransactionPosted() bool { + if o != nil && !isNil(o.TimeTransactionPosted) { + return true + } + + return false +} + +// SetTimeTransactionPosted gets a reference to the given time.Time and assigns it to the TimeTransactionPosted field. +func (o *ConsensusWorkflowMetrics) SetTimeTransactionPosted(v time.Time) { + o.TimeTransactionPosted = &v +} + +// GetTimeTransactionSeen returns the TimeTransactionSeen field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeen() time.Time { + if o == nil || isNil(o.TimeTransactionSeen) { + var ret time.Time + return ret + } + return *o.TimeTransactionSeen +} + +// GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeenOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeTransactionSeen) { + return nil, false + } + return o.TimeTransactionSeen, true +} + +// HasTimeTransactionSeen returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeTransactionSeen() bool { + if o != nil && !isNil(o.TimeTransactionSeen) { + return true + } + + return false +} + +// SetTimeTransactionSeen gets a reference to the given time.Time and assigns it to the TimeTransactionSeen field. +func (o *ConsensusWorkflowMetrics) SetTimeTransactionSeen(v time.Time) { + o.TimeTransactionSeen = &v +} + +// GetTimeVMResultSigned returns the TimeVMResultSigned field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeVMResultSigned() time.Time { + if o == nil || isNil(o.TimeVMResultSigned) { + var ret time.Time + return ret + } + return *o.TimeVMResultSigned +} + +// GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeVMResultSignedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeVMResultSigned) { + return nil, false + } + return o.TimeVMResultSigned, true +} + +// HasTimeVMResultSigned returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeVMResultSigned() bool { + if o != nil && !isNil(o.TimeVMResultSigned) { + return true + } + + return false +} + +// SetTimeVMResultSigned gets a reference to the given time.Time and assigns it to the TimeVMResultSigned field. +func (o *ConsensusWorkflowMetrics) SetTimeVMResultSigned(v time.Time) { + o.TimeVMResultSigned = &v +} + +// GetTimeVMStarted returns the TimeVMStarted field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetTimeVMStarted() time.Time { + if o == nil || isNil(o.TimeVMStarted) { + var ret time.Time + return ret + } + return *o.TimeVMStarted +} + +// GetTimeVMStartedOk returns a tuple with the TimeVMStarted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeVMStartedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeVMStarted) { + return nil, false + } + return o.TimeVMStarted, true +} + +// HasTimeVMStarted returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasTimeVMStarted() bool { + if o != nil && !isNil(o.TimeVMStarted) { + return true + } + + return false +} + +// SetTimeVMStarted gets a reference to the given time.Time and assigns it to the TimeVMStarted field. +func (o *ConsensusWorkflowMetrics) SetTimeVMStarted(v time.Time) { + o.TimeVMStarted = &v +} + +func (o ConsensusWorkflowMetrics) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CurrentStateIndex) { + toSerialize["currentStateIndex"] = o.CurrentStateIndex + } + if !isNil(o.FlagBatchProposalSent) { + toSerialize["flagBatchProposalSent"] = o.FlagBatchProposalSent + } + if !isNil(o.FlagConsensusBatchKnown) { + toSerialize["flagConsensusBatchKnown"] = o.FlagConsensusBatchKnown + } + if !isNil(o.FlagInProgress) { + toSerialize["flagInProgress"] = o.FlagInProgress + } + if !isNil(o.FlagStateReceived) { + toSerialize["flagStateReceived"] = o.FlagStateReceived + } + if !isNil(o.FlagTransactionFinalized) { + toSerialize["flagTransactionFinalized"] = o.FlagTransactionFinalized + } + if !isNil(o.FlagTransactionPosted) { + toSerialize["flagTransactionPosted"] = o.FlagTransactionPosted + } + if !isNil(o.FlagTransactionSeen) { + toSerialize["flagTransactionSeen"] = o.FlagTransactionSeen + } + if !isNil(o.FlagVMResultSigned) { + toSerialize["flagVMResultSigned"] = o.FlagVMResultSigned + } + if !isNil(o.FlagVMStarted) { + toSerialize["flagVMStarted"] = o.FlagVMStarted + } + if !isNil(o.TimeBatchProposalSent) { + toSerialize["timeBatchProposalSent"] = o.TimeBatchProposalSent + } + if !isNil(o.TimeCompleted) { + toSerialize["timeCompleted"] = o.TimeCompleted + } + if !isNil(o.TimeConsensusBatchKnown) { + toSerialize["timeConsensusBatchKnown"] = o.TimeConsensusBatchKnown + } + if !isNil(o.TimeTransactionFinalized) { + toSerialize["timeTransactionFinalized"] = o.TimeTransactionFinalized + } + if !isNil(o.TimeTransactionPosted) { + toSerialize["timeTransactionPosted"] = o.TimeTransactionPosted + } + if !isNil(o.TimeTransactionSeen) { + toSerialize["timeTransactionSeen"] = o.TimeTransactionSeen + } + if !isNil(o.TimeVMResultSigned) { + toSerialize["timeVMResultSigned"] = o.TimeVMResultSigned + } + if !isNil(o.TimeVMStarted) { + toSerialize["timeVMStarted"] = o.TimeVMStarted + } + return json.Marshal(toSerialize) +} + +type NullableConsensusWorkflowMetrics struct { + value *ConsensusWorkflowMetrics + isSet bool +} + +func (v NullableConsensusWorkflowMetrics) Get() *ConsensusWorkflowMetrics { + return v.value +} + +func (v *NullableConsensusWorkflowMetrics) Set(val *ConsensusWorkflowMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusWorkflowMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusWorkflowMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusWorkflowMetrics(val *ConsensusWorkflowMetrics) *NullableConsensusWorkflowMetrics { + return &NullableConsensusWorkflowMetrics{value: val, isSet: true} +} + +func (v NullableConsensusWorkflowMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusWorkflowMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_contract_call_view_request.go b/client/model_contract_call_view_request.go new file mode 100644 index 0000000000..97878ce7be --- /dev/null +++ b/client/model_contract_call_view_request.go @@ -0,0 +1,300 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ContractCallViewRequest struct for ContractCallViewRequest +type ContractCallViewRequest struct { + Arguments *JSONDict `json:"arguments,omitempty"` + // The chain id + ChainId *string `json:"chainId,omitempty"` + // The contract name as HName (Hex) + ContractHName *string `json:"contractHName,omitempty"` + // The contract name + ContractName *string `json:"contractName,omitempty"` + // The function name as HName (Hex) + FunctionHName *string `json:"functionHName,omitempty"` + // The function name + FunctionName *string `json:"functionName,omitempty"` +} + +// NewContractCallViewRequest instantiates a new ContractCallViewRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractCallViewRequest() *ContractCallViewRequest { + this := ContractCallViewRequest{} + return &this +} + +// NewContractCallViewRequestWithDefaults instantiates a new ContractCallViewRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractCallViewRequestWithDefaults() *ContractCallViewRequest { + this := ContractCallViewRequest{} + return &this +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *ContractCallViewRequest) GetArguments() JSONDict { + if o == nil || isNil(o.Arguments) { + var ret JSONDict + return ret + } + return *o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetArgumentsOk() (*JSONDict, bool) { + if o == nil || isNil(o.Arguments) { + return nil, false + } + return o.Arguments, true +} + +// HasArguments returns a boolean if a field has been set. +func (o *ContractCallViewRequest) HasArguments() bool { + if o != nil && !isNil(o.Arguments) { + return true + } + + return false +} + +// SetArguments gets a reference to the given JSONDict and assigns it to the Arguments field. +func (o *ContractCallViewRequest) SetArguments(v JSONDict) { + o.Arguments = &v +} + +// GetChainId returns the ChainId field value if set, zero value otherwise. +func (o *ContractCallViewRequest) GetChainId() string { + if o == nil || isNil(o.ChainId) { + var ret string + return ret + } + return *o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetChainIdOk() (*string, bool) { + if o == nil || isNil(o.ChainId) { + return nil, false + } + return o.ChainId, true +} + +// HasChainId returns a boolean if a field has been set. +func (o *ContractCallViewRequest) HasChainId() bool { + if o != nil && !isNil(o.ChainId) { + return true + } + + return false +} + +// SetChainId gets a reference to the given string and assigns it to the ChainId field. +func (o *ContractCallViewRequest) SetChainId(v string) { + o.ChainId = &v +} + +// GetContractHName returns the ContractHName field value if set, zero value otherwise. +func (o *ContractCallViewRequest) GetContractHName() string { + if o == nil || isNil(o.ContractHName) { + var ret string + return ret + } + return *o.ContractHName +} + +// GetContractHNameOk returns a tuple with the ContractHName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetContractHNameOk() (*string, bool) { + if o == nil || isNil(o.ContractHName) { + return nil, false + } + return o.ContractHName, true +} + +// HasContractHName returns a boolean if a field has been set. +func (o *ContractCallViewRequest) HasContractHName() bool { + if o != nil && !isNil(o.ContractHName) { + return true + } + + return false +} + +// SetContractHName gets a reference to the given string and assigns it to the ContractHName field. +func (o *ContractCallViewRequest) SetContractHName(v string) { + o.ContractHName = &v +} + +// GetContractName returns the ContractName field value if set, zero value otherwise. +func (o *ContractCallViewRequest) GetContractName() string { + if o == nil || isNil(o.ContractName) { + var ret string + return ret + } + return *o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetContractNameOk() (*string, bool) { + if o == nil || isNil(o.ContractName) { + return nil, false + } + return o.ContractName, true +} + +// HasContractName returns a boolean if a field has been set. +func (o *ContractCallViewRequest) HasContractName() bool { + if o != nil && !isNil(o.ContractName) { + return true + } + + return false +} + +// SetContractName gets a reference to the given string and assigns it to the ContractName field. +func (o *ContractCallViewRequest) SetContractName(v string) { + o.ContractName = &v +} + +// GetFunctionHName returns the FunctionHName field value if set, zero value otherwise. +func (o *ContractCallViewRequest) GetFunctionHName() string { + if o == nil || isNil(o.FunctionHName) { + var ret string + return ret + } + return *o.FunctionHName +} + +// GetFunctionHNameOk returns a tuple with the FunctionHName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetFunctionHNameOk() (*string, bool) { + if o == nil || isNil(o.FunctionHName) { + return nil, false + } + return o.FunctionHName, true +} + +// HasFunctionHName returns a boolean if a field has been set. +func (o *ContractCallViewRequest) HasFunctionHName() bool { + if o != nil && !isNil(o.FunctionHName) { + return true + } + + return false +} + +// SetFunctionHName gets a reference to the given string and assigns it to the FunctionHName field. +func (o *ContractCallViewRequest) SetFunctionHName(v string) { + o.FunctionHName = &v +} + +// GetFunctionName returns the FunctionName field value if set, zero value otherwise. +func (o *ContractCallViewRequest) GetFunctionName() string { + if o == nil || isNil(o.FunctionName) { + var ret string + return ret + } + return *o.FunctionName +} + +// GetFunctionNameOk returns a tuple with the FunctionName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetFunctionNameOk() (*string, bool) { + if o == nil || isNil(o.FunctionName) { + return nil, false + } + return o.FunctionName, true +} + +// HasFunctionName returns a boolean if a field has been set. +func (o *ContractCallViewRequest) HasFunctionName() bool { + if o != nil && !isNil(o.FunctionName) { + return true + } + + return false +} + +// SetFunctionName gets a reference to the given string and assigns it to the FunctionName field. +func (o *ContractCallViewRequest) SetFunctionName(v string) { + o.FunctionName = &v +} + +func (o ContractCallViewRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Arguments) { + toSerialize["arguments"] = o.Arguments + } + if !isNil(o.ChainId) { + toSerialize["chainId"] = o.ChainId + } + if !isNil(o.ContractHName) { + toSerialize["contractHName"] = o.ContractHName + } + if !isNil(o.ContractName) { + toSerialize["contractName"] = o.ContractName + } + if !isNil(o.FunctionHName) { + toSerialize["functionHName"] = o.FunctionHName + } + if !isNil(o.FunctionName) { + toSerialize["functionName"] = o.FunctionName + } + return json.Marshal(toSerialize) +} + +type NullableContractCallViewRequest struct { + value *ContractCallViewRequest + isSet bool +} + +func (v NullableContractCallViewRequest) Get() *ContractCallViewRequest { + return v.value +} + +func (v *NullableContractCallViewRequest) Set(val *ContractCallViewRequest) { + v.value = val + v.isSet = true +} + +func (v NullableContractCallViewRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableContractCallViewRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractCallViewRequest(val *ContractCallViewRequest) *NullableContractCallViewRequest { + return &NullableContractCallViewRequest{value: val, isSet: true} +} + +func (v NullableContractCallViewRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractCallViewRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_contract_info_response.go b/client/model_contract_info_response.go new file mode 100644 index 0000000000..86bf4507b0 --- /dev/null +++ b/client/model_contract_info_response.go @@ -0,0 +1,227 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ContractInfoResponse struct for ContractInfoResponse +type ContractInfoResponse struct { + // The description of the contract. + Description *string `json:"description,omitempty"` + // The id (HName as Hex)) of the contract. + HName *string `json:"hName,omitempty"` + // The name of the contract. + Name *string `json:"name,omitempty"` + // The hash of the contract. + ProgramHash []int32 `json:"programHash,omitempty"` +} + +// NewContractInfoResponse instantiates a new ContractInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractInfoResponse() *ContractInfoResponse { + this := ContractInfoResponse{} + return &this +} + +// NewContractInfoResponseWithDefaults instantiates a new ContractInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractInfoResponseWithDefaults() *ContractInfoResponse { + this := ContractInfoResponse{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ContractInfoResponse) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractInfoResponse) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ContractInfoResponse) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ContractInfoResponse) SetDescription(v string) { + o.Description = &v +} + +// GetHName returns the HName field value if set, zero value otherwise. +func (o *ContractInfoResponse) GetHName() string { + if o == nil || isNil(o.HName) { + var ret string + return ret + } + return *o.HName +} + +// GetHNameOk returns a tuple with the HName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractInfoResponse) GetHNameOk() (*string, bool) { + if o == nil || isNil(o.HName) { + return nil, false + } + return o.HName, true +} + +// HasHName returns a boolean if a field has been set. +func (o *ContractInfoResponse) HasHName() bool { + if o != nil && !isNil(o.HName) { + return true + } + + return false +} + +// SetHName gets a reference to the given string and assigns it to the HName field. +func (o *ContractInfoResponse) SetHName(v string) { + o.HName = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ContractInfoResponse) GetName() string { + if o == nil || isNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractInfoResponse) GetNameOk() (*string, bool) { + if o == nil || isNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ContractInfoResponse) HasName() bool { + if o != nil && !isNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ContractInfoResponse) SetName(v string) { + o.Name = &v +} + +// GetProgramHash returns the ProgramHash field value if set, zero value otherwise. +func (o *ContractInfoResponse) GetProgramHash() []int32 { + if o == nil || isNil(o.ProgramHash) { + var ret []int32 + return ret + } + return o.ProgramHash +} + +// GetProgramHashOk returns a tuple with the ProgramHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContractInfoResponse) GetProgramHashOk() ([]int32, bool) { + if o == nil || isNil(o.ProgramHash) { + return nil, false + } + return o.ProgramHash, true +} + +// HasProgramHash returns a boolean if a field has been set. +func (o *ContractInfoResponse) HasProgramHash() bool { + if o != nil && !isNil(o.ProgramHash) { + return true + } + + return false +} + +// SetProgramHash gets a reference to the given []int32 and assigns it to the ProgramHash field. +func (o *ContractInfoResponse) SetProgramHash(v []int32) { + o.ProgramHash = v +} + +func (o ContractInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Description) { + toSerialize["description"] = o.Description + } + if !isNil(o.HName) { + toSerialize["hName"] = o.HName + } + if !isNil(o.Name) { + toSerialize["name"] = o.Name + } + if !isNil(o.ProgramHash) { + toSerialize["programHash"] = o.ProgramHash + } + return json.Marshal(toSerialize) +} + +type NullableContractInfoResponse struct { + value *ContractInfoResponse + isSet bool +} + +func (v NullableContractInfoResponse) Get() *ContractInfoResponse { + return v.value +} + +func (v *NullableContractInfoResponse) Set(val *ContractInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableContractInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableContractInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractInfoResponse(val *ContractInfoResponse) *NullableContractInfoResponse { + return &NullableContractInfoResponse{value: val, isSet: true} +} + +func (v NullableContractInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_control_addresses_response.go b/client/model_control_addresses_response.go new file mode 100644 index 0000000000..5996c3c83c --- /dev/null +++ b/client/model_control_addresses_response.go @@ -0,0 +1,187 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ControlAddressesResponse struct for ControlAddressesResponse +type ControlAddressesResponse struct { + GoverningAddress *string `json:"governingAddress,omitempty"` + SinceBlockIndex *int32 `json:"sinceBlockIndex,omitempty"` + StateAddress *string `json:"stateAddress,omitempty"` +} + +// NewControlAddressesResponse instantiates a new ControlAddressesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewControlAddressesResponse() *ControlAddressesResponse { + this := ControlAddressesResponse{} + return &this +} + +// NewControlAddressesResponseWithDefaults instantiates a new ControlAddressesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewControlAddressesResponseWithDefaults() *ControlAddressesResponse { + this := ControlAddressesResponse{} + return &this +} + +// GetGoverningAddress returns the GoverningAddress field value if set, zero value otherwise. +func (o *ControlAddressesResponse) GetGoverningAddress() string { + if o == nil || isNil(o.GoverningAddress) { + var ret string + return ret + } + return *o.GoverningAddress +} + +// GetGoverningAddressOk returns a tuple with the GoverningAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ControlAddressesResponse) GetGoverningAddressOk() (*string, bool) { + if o == nil || isNil(o.GoverningAddress) { + return nil, false + } + return o.GoverningAddress, true +} + +// HasGoverningAddress returns a boolean if a field has been set. +func (o *ControlAddressesResponse) HasGoverningAddress() bool { + if o != nil && !isNil(o.GoverningAddress) { + return true + } + + return false +} + +// SetGoverningAddress gets a reference to the given string and assigns it to the GoverningAddress field. +func (o *ControlAddressesResponse) SetGoverningAddress(v string) { + o.GoverningAddress = &v +} + +// GetSinceBlockIndex returns the SinceBlockIndex field value if set, zero value otherwise. +func (o *ControlAddressesResponse) GetSinceBlockIndex() int32 { + if o == nil || isNil(o.SinceBlockIndex) { + var ret int32 + return ret + } + return *o.SinceBlockIndex +} + +// GetSinceBlockIndexOk returns a tuple with the SinceBlockIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ControlAddressesResponse) GetSinceBlockIndexOk() (*int32, bool) { + if o == nil || isNil(o.SinceBlockIndex) { + return nil, false + } + return o.SinceBlockIndex, true +} + +// HasSinceBlockIndex returns a boolean if a field has been set. +func (o *ControlAddressesResponse) HasSinceBlockIndex() bool { + if o != nil && !isNil(o.SinceBlockIndex) { + return true + } + + return false +} + +// SetSinceBlockIndex gets a reference to the given int32 and assigns it to the SinceBlockIndex field. +func (o *ControlAddressesResponse) SetSinceBlockIndex(v int32) { + o.SinceBlockIndex = &v +} + +// GetStateAddress returns the StateAddress field value if set, zero value otherwise. +func (o *ControlAddressesResponse) GetStateAddress() string { + if o == nil || isNil(o.StateAddress) { + var ret string + return ret + } + return *o.StateAddress +} + +// GetStateAddressOk returns a tuple with the StateAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ControlAddressesResponse) GetStateAddressOk() (*string, bool) { + if o == nil || isNil(o.StateAddress) { + return nil, false + } + return o.StateAddress, true +} + +// HasStateAddress returns a boolean if a field has been set. +func (o *ControlAddressesResponse) HasStateAddress() bool { + if o != nil && !isNil(o.StateAddress) { + return true + } + + return false +} + +// SetStateAddress gets a reference to the given string and assigns it to the StateAddress field. +func (o *ControlAddressesResponse) SetStateAddress(v string) { + o.StateAddress = &v +} + +func (o ControlAddressesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.GoverningAddress) { + toSerialize["governingAddress"] = o.GoverningAddress + } + if !isNil(o.SinceBlockIndex) { + toSerialize["sinceBlockIndex"] = o.SinceBlockIndex + } + if !isNil(o.StateAddress) { + toSerialize["stateAddress"] = o.StateAddress + } + return json.Marshal(toSerialize) +} + +type NullableControlAddressesResponse struct { + value *ControlAddressesResponse + isSet bool +} + +func (v NullableControlAddressesResponse) Get() *ControlAddressesResponse { + return v.value +} + +func (v *NullableControlAddressesResponse) Set(val *ControlAddressesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableControlAddressesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableControlAddressesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableControlAddressesResponse(val *ControlAddressesResponse) *NullableControlAddressesResponse { + return &NullableControlAddressesResponse{value: val, isSet: true} +} + +func (v NullableControlAddressesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableControlAddressesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_dk_shares_info.go b/client/model_dk_shares_info.go new file mode 100644 index 0000000000..11bc4a75e8 --- /dev/null +++ b/client/model_dk_shares_info.go @@ -0,0 +1,299 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// DKSharesInfo struct for DKSharesInfo +type DKSharesInfo struct { + // New generated shared address. + Address *string `json:"address,omitempty"` + // Identities of the nodes sharing the key. (Hex) + PeerIdentities []string `json:"peerIdentities,omitempty"` + PeerIndex *int32 `json:"peerIndex,omitempty"` + // Used public key. (Hex) + PublicKey *string `json:"publicKey,omitempty"` + // Public key shares for all the peers. (Hex) + PublicKeyShares []string `json:"publicKeyShares,omitempty"` + Threshold *int32 `json:"threshold,omitempty"` +} + +// NewDKSharesInfo instantiates a new DKSharesInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDKSharesInfo() *DKSharesInfo { + this := DKSharesInfo{} + return &this +} + +// NewDKSharesInfoWithDefaults instantiates a new DKSharesInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDKSharesInfoWithDefaults() *DKSharesInfo { + this := DKSharesInfo{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *DKSharesInfo) GetAddress() string { + if o == nil || isNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetAddressOk() (*string, bool) { + if o == nil || isNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *DKSharesInfo) HasAddress() bool { + if o != nil && !isNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *DKSharesInfo) SetAddress(v string) { + o.Address = &v +} + +// GetPeerIdentities returns the PeerIdentities field value if set, zero value otherwise. +func (o *DKSharesInfo) GetPeerIdentities() []string { + if o == nil || isNil(o.PeerIdentities) { + var ret []string + return ret + } + return o.PeerIdentities +} + +// GetPeerIdentitiesOk returns a tuple with the PeerIdentities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPeerIdentitiesOk() ([]string, bool) { + if o == nil || isNil(o.PeerIdentities) { + return nil, false + } + return o.PeerIdentities, true +} + +// HasPeerIdentities returns a boolean if a field has been set. +func (o *DKSharesInfo) HasPeerIdentities() bool { + if o != nil && !isNil(o.PeerIdentities) { + return true + } + + return false +} + +// SetPeerIdentities gets a reference to the given []string and assigns it to the PeerIdentities field. +func (o *DKSharesInfo) SetPeerIdentities(v []string) { + o.PeerIdentities = v +} + +// GetPeerIndex returns the PeerIndex field value if set, zero value otherwise. +func (o *DKSharesInfo) GetPeerIndex() int32 { + if o == nil || isNil(o.PeerIndex) { + var ret int32 + return ret + } + return *o.PeerIndex +} + +// GetPeerIndexOk returns a tuple with the PeerIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPeerIndexOk() (*int32, bool) { + if o == nil || isNil(o.PeerIndex) { + return nil, false + } + return o.PeerIndex, true +} + +// HasPeerIndex returns a boolean if a field has been set. +func (o *DKSharesInfo) HasPeerIndex() bool { + if o != nil && !isNil(o.PeerIndex) { + return true + } + + return false +} + +// SetPeerIndex gets a reference to the given int32 and assigns it to the PeerIndex field. +func (o *DKSharesInfo) SetPeerIndex(v int32) { + o.PeerIndex = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *DKSharesInfo) GetPublicKey() string { + if o == nil || isNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPublicKeyOk() (*string, bool) { + if o == nil || isNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *DKSharesInfo) HasPublicKey() bool { + if o != nil && !isNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *DKSharesInfo) SetPublicKey(v string) { + o.PublicKey = &v +} + +// GetPublicKeyShares returns the PublicKeyShares field value if set, zero value otherwise. +func (o *DKSharesInfo) GetPublicKeyShares() []string { + if o == nil || isNil(o.PublicKeyShares) { + var ret []string + return ret + } + return o.PublicKeyShares +} + +// GetPublicKeySharesOk returns a tuple with the PublicKeyShares field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPublicKeySharesOk() ([]string, bool) { + if o == nil || isNil(o.PublicKeyShares) { + return nil, false + } + return o.PublicKeyShares, true +} + +// HasPublicKeyShares returns a boolean if a field has been set. +func (o *DKSharesInfo) HasPublicKeyShares() bool { + if o != nil && !isNil(o.PublicKeyShares) { + return true + } + + return false +} + +// SetPublicKeyShares gets a reference to the given []string and assigns it to the PublicKeyShares field. +func (o *DKSharesInfo) SetPublicKeyShares(v []string) { + o.PublicKeyShares = v +} + +// GetThreshold returns the Threshold field value if set, zero value otherwise. +func (o *DKSharesInfo) GetThreshold() int32 { + if o == nil || isNil(o.Threshold) { + var ret int32 + return ret + } + return *o.Threshold +} + +// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetThresholdOk() (*int32, bool) { + if o == nil || isNil(o.Threshold) { + return nil, false + } + return o.Threshold, true +} + +// HasThreshold returns a boolean if a field has been set. +func (o *DKSharesInfo) HasThreshold() bool { + if o != nil && !isNil(o.Threshold) { + return true + } + + return false +} + +// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. +func (o *DKSharesInfo) SetThreshold(v int32) { + o.Threshold = &v +} + +func (o DKSharesInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Address) { + toSerialize["address"] = o.Address + } + if !isNil(o.PeerIdentities) { + toSerialize["peerIdentities"] = o.PeerIdentities + } + if !isNil(o.PeerIndex) { + toSerialize["peerIndex"] = o.PeerIndex + } + if !isNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + if !isNil(o.PublicKeyShares) { + toSerialize["publicKeyShares"] = o.PublicKeyShares + } + if !isNil(o.Threshold) { + toSerialize["threshold"] = o.Threshold + } + return json.Marshal(toSerialize) +} + +type NullableDKSharesInfo struct { + value *DKSharesInfo + isSet bool +} + +func (v NullableDKSharesInfo) Get() *DKSharesInfo { + return v.value +} + +func (v *NullableDKSharesInfo) Set(val *DKSharesInfo) { + v.value = val + v.isSet = true +} + +func (v NullableDKSharesInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableDKSharesInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDKSharesInfo(val *DKSharesInfo) *NullableDKSharesInfo { + return &NullableDKSharesInfo{value: val, isSet: true} +} + +func (v NullableDKSharesInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDKSharesInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_dk_shares_post_request.go b/client/model_dk_shares_post_request.go new file mode 100644 index 0000000000..cdb20efed8 --- /dev/null +++ b/client/model_dk_shares_post_request.go @@ -0,0 +1,189 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// DKSharesPostRequest struct for DKSharesPostRequest +type DKSharesPostRequest struct { + PeerIdentities []string `json:"peerIdentities,omitempty"` + // Should be =< len(PeerPublicIdentities) + Threshold *int32 `json:"threshold,omitempty"` + // Timeout in milliseconds. + TimeoutMS *int32 `json:"timeoutMS,omitempty"` +} + +// NewDKSharesPostRequest instantiates a new DKSharesPostRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDKSharesPostRequest() *DKSharesPostRequest { + this := DKSharesPostRequest{} + return &this +} + +// NewDKSharesPostRequestWithDefaults instantiates a new DKSharesPostRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDKSharesPostRequestWithDefaults() *DKSharesPostRequest { + this := DKSharesPostRequest{} + return &this +} + +// GetPeerIdentities returns the PeerIdentities field value if set, zero value otherwise. +func (o *DKSharesPostRequest) GetPeerIdentities() []string { + if o == nil || isNil(o.PeerIdentities) { + var ret []string + return ret + } + return o.PeerIdentities +} + +// GetPeerIdentitiesOk returns a tuple with the PeerIdentities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesPostRequest) GetPeerIdentitiesOk() ([]string, bool) { + if o == nil || isNil(o.PeerIdentities) { + return nil, false + } + return o.PeerIdentities, true +} + +// HasPeerIdentities returns a boolean if a field has been set. +func (o *DKSharesPostRequest) HasPeerIdentities() bool { + if o != nil && !isNil(o.PeerIdentities) { + return true + } + + return false +} + +// SetPeerIdentities gets a reference to the given []string and assigns it to the PeerIdentities field. +func (o *DKSharesPostRequest) SetPeerIdentities(v []string) { + o.PeerIdentities = v +} + +// GetThreshold returns the Threshold field value if set, zero value otherwise. +func (o *DKSharesPostRequest) GetThreshold() int32 { + if o == nil || isNil(o.Threshold) { + var ret int32 + return ret + } + return *o.Threshold +} + +// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesPostRequest) GetThresholdOk() (*int32, bool) { + if o == nil || isNil(o.Threshold) { + return nil, false + } + return o.Threshold, true +} + +// HasThreshold returns a boolean if a field has been set. +func (o *DKSharesPostRequest) HasThreshold() bool { + if o != nil && !isNil(o.Threshold) { + return true + } + + return false +} + +// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. +func (o *DKSharesPostRequest) SetThreshold(v int32) { + o.Threshold = &v +} + +// GetTimeoutMS returns the TimeoutMS field value if set, zero value otherwise. +func (o *DKSharesPostRequest) GetTimeoutMS() int32 { + if o == nil || isNil(o.TimeoutMS) { + var ret int32 + return ret + } + return *o.TimeoutMS +} + +// GetTimeoutMSOk returns a tuple with the TimeoutMS field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DKSharesPostRequest) GetTimeoutMSOk() (*int32, bool) { + if o == nil || isNil(o.TimeoutMS) { + return nil, false + } + return o.TimeoutMS, true +} + +// HasTimeoutMS returns a boolean if a field has been set. +func (o *DKSharesPostRequest) HasTimeoutMS() bool { + if o != nil && !isNil(o.TimeoutMS) { + return true + } + + return false +} + +// SetTimeoutMS gets a reference to the given int32 and assigns it to the TimeoutMS field. +func (o *DKSharesPostRequest) SetTimeoutMS(v int32) { + o.TimeoutMS = &v +} + +func (o DKSharesPostRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.PeerIdentities) { + toSerialize["peerIdentities"] = o.PeerIdentities + } + if !isNil(o.Threshold) { + toSerialize["threshold"] = o.Threshold + } + if !isNil(o.TimeoutMS) { + toSerialize["timeoutMS"] = o.TimeoutMS + } + return json.Marshal(toSerialize) +} + +type NullableDKSharesPostRequest struct { + value *DKSharesPostRequest + isSet bool +} + +func (v NullableDKSharesPostRequest) Get() *DKSharesPostRequest { + return v.value +} + +func (v *NullableDKSharesPostRequest) Set(val *DKSharesPostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDKSharesPostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDKSharesPostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDKSharesPostRequest(val *DKSharesPostRequest) *NullableDKSharesPostRequest { + return &NullableDKSharesPostRequest{value: val, isSet: true} +} + +func (v NullableDKSharesPostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDKSharesPostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_error_message_format_response.go b/client/model_error_message_format_response.go new file mode 100644 index 0000000000..7b401f691a --- /dev/null +++ b/client/model_error_message_format_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ErrorMessageFormatResponse struct for ErrorMessageFormatResponse +type ErrorMessageFormatResponse struct { + MessageFormat *string `json:"MessageFormat,omitempty"` +} + +// NewErrorMessageFormatResponse instantiates a new ErrorMessageFormatResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorMessageFormatResponse() *ErrorMessageFormatResponse { + this := ErrorMessageFormatResponse{} + return &this +} + +// NewErrorMessageFormatResponseWithDefaults instantiates a new ErrorMessageFormatResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorMessageFormatResponseWithDefaults() *ErrorMessageFormatResponse { + this := ErrorMessageFormatResponse{} + return &this +} + +// GetMessageFormat returns the MessageFormat field value if set, zero value otherwise. +func (o *ErrorMessageFormatResponse) GetMessageFormat() string { + if o == nil || isNil(o.MessageFormat) { + var ret string + return ret + } + return *o.MessageFormat +} + +// GetMessageFormatOk returns a tuple with the MessageFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorMessageFormatResponse) GetMessageFormatOk() (*string, bool) { + if o == nil || isNil(o.MessageFormat) { + return nil, false + } + return o.MessageFormat, true +} + +// HasMessageFormat returns a boolean if a field has been set. +func (o *ErrorMessageFormatResponse) HasMessageFormat() bool { + if o != nil && !isNil(o.MessageFormat) { + return true + } + + return false +} + +// SetMessageFormat gets a reference to the given string and assigns it to the MessageFormat field. +func (o *ErrorMessageFormatResponse) SetMessageFormat(v string) { + o.MessageFormat = &v +} + +func (o ErrorMessageFormatResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.MessageFormat) { + toSerialize["MessageFormat"] = o.MessageFormat + } + return json.Marshal(toSerialize) +} + +type NullableErrorMessageFormatResponse struct { + value *ErrorMessageFormatResponse + isSet bool +} + +func (v NullableErrorMessageFormatResponse) Get() *ErrorMessageFormatResponse { + return v.value +} + +func (v *NullableErrorMessageFormatResponse) Set(val *ErrorMessageFormatResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorMessageFormatResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorMessageFormatResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorMessageFormatResponse(val *ErrorMessageFormatResponse) *NullableErrorMessageFormatResponse { + return &NullableErrorMessageFormatResponse{value: val, isSet: true} +} + +func (v NullableErrorMessageFormatResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorMessageFormatResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_events_response.go b/client/model_events_response.go new file mode 100644 index 0000000000..dc35d6ed19 --- /dev/null +++ b/client/model_events_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// EventsResponse struct for EventsResponse +type EventsResponse struct { + Events []string `json:"events,omitempty"` +} + +// NewEventsResponse instantiates a new EventsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventsResponse() *EventsResponse { + this := EventsResponse{} + return &this +} + +// NewEventsResponseWithDefaults instantiates a new EventsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventsResponseWithDefaults() *EventsResponse { + this := EventsResponse{} + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *EventsResponse) GetEvents() []string { + if o == nil || isNil(o.Events) { + var ret []string + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventsResponse) GetEventsOk() ([]string, bool) { + if o == nil || isNil(o.Events) { + return nil, false + } + return o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *EventsResponse) HasEvents() bool { + if o != nil && !isNil(o.Events) { + return true + } + + return false +} + +// SetEvents gets a reference to the given []string and assigns it to the Events field. +func (o *EventsResponse) SetEvents(v []string) { + o.Events = v +} + +func (o EventsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Events) { + toSerialize["events"] = o.Events + } + return json.Marshal(toSerialize) +} + +type NullableEventsResponse struct { + value *EventsResponse + isSet bool +} + +func (v NullableEventsResponse) Get() *EventsResponse { + return v.value +} + +func (v *NullableEventsResponse) Set(val *EventsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableEventsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableEventsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventsResponse(val *EventsResponse) *NullableEventsResponse { + return &NullableEventsResponse{value: val, isSet: true} +} + +func (v NullableEventsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_foundry_output_response.go b/client/model_foundry_output_response.go new file mode 100644 index 0000000000..76ae082692 --- /dev/null +++ b/client/model_foundry_output_response.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// FoundryOutputResponse struct for FoundryOutputResponse +type FoundryOutputResponse struct { + Assets *AssetsResponse `json:"assets,omitempty"` + FoundryId *string `json:"foundryId,omitempty"` +} + +// NewFoundryOutputResponse instantiates a new FoundryOutputResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFoundryOutputResponse() *FoundryOutputResponse { + this := FoundryOutputResponse{} + return &this +} + +// NewFoundryOutputResponseWithDefaults instantiates a new FoundryOutputResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFoundryOutputResponseWithDefaults() *FoundryOutputResponse { + this := FoundryOutputResponse{} + return &this +} + +// GetAssets returns the Assets field value if set, zero value otherwise. +func (o *FoundryOutputResponse) GetAssets() AssetsResponse { + if o == nil || isNil(o.Assets) { + var ret AssetsResponse + return ret + } + return *o.Assets +} + +// GetAssetsOk returns a tuple with the Assets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FoundryOutputResponse) GetAssetsOk() (*AssetsResponse, bool) { + if o == nil || isNil(o.Assets) { + return nil, false + } + return o.Assets, true +} + +// HasAssets returns a boolean if a field has been set. +func (o *FoundryOutputResponse) HasAssets() bool { + if o != nil && !isNil(o.Assets) { + return true + } + + return false +} + +// SetAssets gets a reference to the given AssetsResponse and assigns it to the Assets field. +func (o *FoundryOutputResponse) SetAssets(v AssetsResponse) { + o.Assets = &v +} + +// GetFoundryId returns the FoundryId field value if set, zero value otherwise. +func (o *FoundryOutputResponse) GetFoundryId() string { + if o == nil || isNil(o.FoundryId) { + var ret string + return ret + } + return *o.FoundryId +} + +// GetFoundryIdOk returns a tuple with the FoundryId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FoundryOutputResponse) GetFoundryIdOk() (*string, bool) { + if o == nil || isNil(o.FoundryId) { + return nil, false + } + return o.FoundryId, true +} + +// HasFoundryId returns a boolean if a field has been set. +func (o *FoundryOutputResponse) HasFoundryId() bool { + if o != nil && !isNil(o.FoundryId) { + return true + } + + return false +} + +// SetFoundryId gets a reference to the given string and assigns it to the FoundryId field. +func (o *FoundryOutputResponse) SetFoundryId(v string) { + o.FoundryId = &v +} + +func (o FoundryOutputResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Assets) { + toSerialize["assets"] = o.Assets + } + if !isNil(o.FoundryId) { + toSerialize["foundryId"] = o.FoundryId + } + return json.Marshal(toSerialize) +} + +type NullableFoundryOutputResponse struct { + value *FoundryOutputResponse + isSet bool +} + +func (v NullableFoundryOutputResponse) Get() *FoundryOutputResponse { + return v.value +} + +func (v *NullableFoundryOutputResponse) Set(val *FoundryOutputResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFoundryOutputResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFoundryOutputResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFoundryOutputResponse(val *FoundryOutputResponse) *NullableFoundryOutputResponse { + return &NullableFoundryOutputResponse{value: val, isSet: true} +} + +func (v NullableFoundryOutputResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFoundryOutputResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_fungible_tokens.go b/client/model_fungible_tokens.go new file mode 100644 index 0000000000..65c2907a08 --- /dev/null +++ b/client/model_fungible_tokens.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// FungibleTokens struct for FungibleTokens +type FungibleTokens struct { + BaseTokens *int64 `json:"baseTokens,omitempty"` + NativeTokens []NativeToken `json:"nativeTokens,omitempty"` +} + +// NewFungibleTokens instantiates a new FungibleTokens object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFungibleTokens() *FungibleTokens { + this := FungibleTokens{} + return &this +} + +// NewFungibleTokensWithDefaults instantiates a new FungibleTokens object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFungibleTokensWithDefaults() *FungibleTokens { + this := FungibleTokens{} + return &this +} + +// GetBaseTokens returns the BaseTokens field value if set, zero value otherwise. +func (o *FungibleTokens) GetBaseTokens() int64 { + if o == nil || isNil(o.BaseTokens) { + var ret int64 + return ret + } + return *o.BaseTokens +} + +// GetBaseTokensOk returns a tuple with the BaseTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FungibleTokens) GetBaseTokensOk() (*int64, bool) { + if o == nil || isNil(o.BaseTokens) { + return nil, false + } + return o.BaseTokens, true +} + +// HasBaseTokens returns a boolean if a field has been set. +func (o *FungibleTokens) HasBaseTokens() bool { + if o != nil && !isNil(o.BaseTokens) { + return true + } + + return false +} + +// SetBaseTokens gets a reference to the given int64 and assigns it to the BaseTokens field. +func (o *FungibleTokens) SetBaseTokens(v int64) { + o.BaseTokens = &v +} + +// GetNativeTokens returns the NativeTokens field value if set, zero value otherwise. +func (o *FungibleTokens) GetNativeTokens() []NativeToken { + if o == nil || isNil(o.NativeTokens) { + var ret []NativeToken + return ret + } + return o.NativeTokens +} + +// GetNativeTokensOk returns a tuple with the NativeTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FungibleTokens) GetNativeTokensOk() ([]NativeToken, bool) { + if o == nil || isNil(o.NativeTokens) { + return nil, false + } + return o.NativeTokens, true +} + +// HasNativeTokens returns a boolean if a field has been set. +func (o *FungibleTokens) HasNativeTokens() bool { + if o != nil && !isNil(o.NativeTokens) { + return true + } + + return false +} + +// SetNativeTokens gets a reference to the given []NativeToken and assigns it to the NativeTokens field. +func (o *FungibleTokens) SetNativeTokens(v []NativeToken) { + o.NativeTokens = v +} + +func (o FungibleTokens) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BaseTokens) { + toSerialize["baseTokens"] = o.BaseTokens + } + if !isNil(o.NativeTokens) { + toSerialize["nativeTokens"] = o.NativeTokens + } + return json.Marshal(toSerialize) +} + +type NullableFungibleTokens struct { + value *FungibleTokens + isSet bool +} + +func (v NullableFungibleTokens) Get() *FungibleTokens { + return v.value +} + +func (v *NullableFungibleTokens) Set(val *FungibleTokens) { + v.value = val + v.isSet = true +} + +func (v NullableFungibleTokens) IsSet() bool { + return v.isSet +} + +func (v *NullableFungibleTokens) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFungibleTokens(val *FungibleTokens) *NullableFungibleTokens { + return &NullableFungibleTokens{value: val, isSet: true} +} + +func (v NullableFungibleTokens) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFungibleTokens) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_gas_fee_policy.go b/client/model_gas_fee_policy.go new file mode 100644 index 0000000000..86edf9ffb5 --- /dev/null +++ b/client/model_gas_fee_policy.go @@ -0,0 +1,190 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// GasFeePolicy struct for GasFeePolicy +type GasFeePolicy struct { + // The gas fee token id. Empty if base token. + GasFeeTokenId *string `json:"gasFeeTokenId,omitempty"` + // The amount of gas per token. + GasPerToken *int64 `json:"gasPerToken,omitempty"` + // The validator fee share. + ValidatorFeeShare *int32 `json:"validatorFeeShare,omitempty"` +} + +// NewGasFeePolicy instantiates a new GasFeePolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGasFeePolicy() *GasFeePolicy { + this := GasFeePolicy{} + return &this +} + +// NewGasFeePolicyWithDefaults instantiates a new GasFeePolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGasFeePolicyWithDefaults() *GasFeePolicy { + this := GasFeePolicy{} + return &this +} + +// GetGasFeeTokenId returns the GasFeeTokenId field value if set, zero value otherwise. +func (o *GasFeePolicy) GetGasFeeTokenId() string { + if o == nil || isNil(o.GasFeeTokenId) { + var ret string + return ret + } + return *o.GasFeeTokenId +} + +// GetGasFeeTokenIdOk returns a tuple with the GasFeeTokenId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasFeePolicy) GetGasFeeTokenIdOk() (*string, bool) { + if o == nil || isNil(o.GasFeeTokenId) { + return nil, false + } + return o.GasFeeTokenId, true +} + +// HasGasFeeTokenId returns a boolean if a field has been set. +func (o *GasFeePolicy) HasGasFeeTokenId() bool { + if o != nil && !isNil(o.GasFeeTokenId) { + return true + } + + return false +} + +// SetGasFeeTokenId gets a reference to the given string and assigns it to the GasFeeTokenId field. +func (o *GasFeePolicy) SetGasFeeTokenId(v string) { + o.GasFeeTokenId = &v +} + +// GetGasPerToken returns the GasPerToken field value if set, zero value otherwise. +func (o *GasFeePolicy) GetGasPerToken() int64 { + if o == nil || isNil(o.GasPerToken) { + var ret int64 + return ret + } + return *o.GasPerToken +} + +// GetGasPerTokenOk returns a tuple with the GasPerToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasFeePolicy) GetGasPerTokenOk() (*int64, bool) { + if o == nil || isNil(o.GasPerToken) { + return nil, false + } + return o.GasPerToken, true +} + +// HasGasPerToken returns a boolean if a field has been set. +func (o *GasFeePolicy) HasGasPerToken() bool { + if o != nil && !isNil(o.GasPerToken) { + return true + } + + return false +} + +// SetGasPerToken gets a reference to the given int64 and assigns it to the GasPerToken field. +func (o *GasFeePolicy) SetGasPerToken(v int64) { + o.GasPerToken = &v +} + +// GetValidatorFeeShare returns the ValidatorFeeShare field value if set, zero value otherwise. +func (o *GasFeePolicy) GetValidatorFeeShare() int32 { + if o == nil || isNil(o.ValidatorFeeShare) { + var ret int32 + return ret + } + return *o.ValidatorFeeShare +} + +// GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool) { + if o == nil || isNil(o.ValidatorFeeShare) { + return nil, false + } + return o.ValidatorFeeShare, true +} + +// HasValidatorFeeShare returns a boolean if a field has been set. +func (o *GasFeePolicy) HasValidatorFeeShare() bool { + if o != nil && !isNil(o.ValidatorFeeShare) { + return true + } + + return false +} + +// SetValidatorFeeShare gets a reference to the given int32 and assigns it to the ValidatorFeeShare field. +func (o *GasFeePolicy) SetValidatorFeeShare(v int32) { + o.ValidatorFeeShare = &v +} + +func (o GasFeePolicy) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.GasFeeTokenId) { + toSerialize["gasFeeTokenId"] = o.GasFeeTokenId + } + if !isNil(o.GasPerToken) { + toSerialize["gasPerToken"] = o.GasPerToken + } + if !isNil(o.ValidatorFeeShare) { + toSerialize["validatorFeeShare"] = o.ValidatorFeeShare + } + return json.Marshal(toSerialize) +} + +type NullableGasFeePolicy struct { + value *GasFeePolicy + isSet bool +} + +func (v NullableGasFeePolicy) Get() *GasFeePolicy { + return v.value +} + +func (v *NullableGasFeePolicy) Set(val *GasFeePolicy) { + v.value = val + v.isSet = true +} + +func (v NullableGasFeePolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableGasFeePolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGasFeePolicy(val *GasFeePolicy) *NullableGasFeePolicy { + return &NullableGasFeePolicy{value: val, isSet: true} +} + +func (v NullableGasFeePolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGasFeePolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_gov_chain_info_response.go b/client/model_gov_chain_info_response.go new file mode 100644 index 0000000000..8db80617f3 --- /dev/null +++ b/client/model_gov_chain_info_response.go @@ -0,0 +1,337 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// GovChainInfoResponse struct for GovChainInfoResponse +type GovChainInfoResponse struct { + // ChainID (Bech32-encoded). + ChainID *string `json:"chainID,omitempty"` + // The chain owner address (Bech32-encoded). + ChainOwnerId *string `json:"chainOwnerId,omitempty"` + // The description of the chain. + Description *string `json:"description,omitempty"` + GasFeePolicy *GasFeePolicy `json:"gasFeePolicy,omitempty"` + // The maximum contract blob size. + MaxBlobSize *int32 `json:"maxBlobSize,omitempty"` + // The maximum event size. + MaxEventSize *int32 `json:"maxEventSize,omitempty"` + // The maximum amount of events per request. + MaxEventsPerReq *int32 `json:"maxEventsPerReq,omitempty"` +} + +// NewGovChainInfoResponse instantiates a new GovChainInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGovChainInfoResponse() *GovChainInfoResponse { + this := GovChainInfoResponse{} + return &this +} + +// NewGovChainInfoResponseWithDefaults instantiates a new GovChainInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGovChainInfoResponseWithDefaults() *GovChainInfoResponse { + this := GovChainInfoResponse{} + return &this +} + +// GetChainID returns the ChainID field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetChainID() string { + if o == nil || isNil(o.ChainID) { + var ret string + return ret + } + return *o.ChainID +} + +// GetChainIDOk returns a tuple with the ChainID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetChainIDOk() (*string, bool) { + if o == nil || isNil(o.ChainID) { + return nil, false + } + return o.ChainID, true +} + +// HasChainID returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasChainID() bool { + if o != nil && !isNil(o.ChainID) { + return true + } + + return false +} + +// SetChainID gets a reference to the given string and assigns it to the ChainID field. +func (o *GovChainInfoResponse) SetChainID(v string) { + o.ChainID = &v +} + +// GetChainOwnerId returns the ChainOwnerId field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetChainOwnerId() string { + if o == nil || isNil(o.ChainOwnerId) { + var ret string + return ret + } + return *o.ChainOwnerId +} + +// GetChainOwnerIdOk returns a tuple with the ChainOwnerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetChainOwnerIdOk() (*string, bool) { + if o == nil || isNil(o.ChainOwnerId) { + return nil, false + } + return o.ChainOwnerId, true +} + +// HasChainOwnerId returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasChainOwnerId() bool { + if o != nil && !isNil(o.ChainOwnerId) { + return true + } + + return false +} + +// SetChainOwnerId gets a reference to the given string and assigns it to the ChainOwnerId field. +func (o *GovChainInfoResponse) SetChainOwnerId(v string) { + o.ChainOwnerId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GovChainInfoResponse) SetDescription(v string) { + o.Description = &v +} + +// GetGasFeePolicy returns the GasFeePolicy field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetGasFeePolicy() GasFeePolicy { + if o == nil || isNil(o.GasFeePolicy) { + var ret GasFeePolicy + return ret + } + return *o.GasFeePolicy +} + +// GetGasFeePolicyOk returns a tuple with the GasFeePolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool) { + if o == nil || isNil(o.GasFeePolicy) { + return nil, false + } + return o.GasFeePolicy, true +} + +// HasGasFeePolicy returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasGasFeePolicy() bool { + if o != nil && !isNil(o.GasFeePolicy) { + return true + } + + return false +} + +// SetGasFeePolicy gets a reference to the given GasFeePolicy and assigns it to the GasFeePolicy field. +func (o *GovChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { + o.GasFeePolicy = &v +} + +// GetMaxBlobSize returns the MaxBlobSize field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetMaxBlobSize() int32 { + if o == nil || isNil(o.MaxBlobSize) { + var ret int32 + return ret + } + return *o.MaxBlobSize +} + +// GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { + if o == nil || isNil(o.MaxBlobSize) { + return nil, false + } + return o.MaxBlobSize, true +} + +// HasMaxBlobSize returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasMaxBlobSize() bool { + if o != nil && !isNil(o.MaxBlobSize) { + return true + } + + return false +} + +// SetMaxBlobSize gets a reference to the given int32 and assigns it to the MaxBlobSize field. +func (o *GovChainInfoResponse) SetMaxBlobSize(v int32) { + o.MaxBlobSize = &v +} + +// GetMaxEventSize returns the MaxEventSize field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetMaxEventSize() int32 { + if o == nil || isNil(o.MaxEventSize) { + var ret int32 + return ret + } + return *o.MaxEventSize +} + +// GetMaxEventSizeOk returns a tuple with the MaxEventSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { + if o == nil || isNil(o.MaxEventSize) { + return nil, false + } + return o.MaxEventSize, true +} + +// HasMaxEventSize returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasMaxEventSize() bool { + if o != nil && !isNil(o.MaxEventSize) { + return true + } + + return false +} + +// SetMaxEventSize gets a reference to the given int32 and assigns it to the MaxEventSize field. +func (o *GovChainInfoResponse) SetMaxEventSize(v int32) { + o.MaxEventSize = &v +} + +// GetMaxEventsPerReq returns the MaxEventsPerReq field value if set, zero value otherwise. +func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32 { + if o == nil || isNil(o.MaxEventsPerReq) { + var ret int32 + return ret + } + return *o.MaxEventsPerReq +} + +// GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { + if o == nil || isNil(o.MaxEventsPerReq) { + return nil, false + } + return o.MaxEventsPerReq, true +} + +// HasMaxEventsPerReq returns a boolean if a field has been set. +func (o *GovChainInfoResponse) HasMaxEventsPerReq() bool { + if o != nil && !isNil(o.MaxEventsPerReq) { + return true + } + + return false +} + +// SetMaxEventsPerReq gets a reference to the given int32 and assigns it to the MaxEventsPerReq field. +func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32) { + o.MaxEventsPerReq = &v +} + +func (o GovChainInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ChainID) { + toSerialize["chainID"] = o.ChainID + } + if !isNil(o.ChainOwnerId) { + toSerialize["chainOwnerId"] = o.ChainOwnerId + } + if !isNil(o.Description) { + toSerialize["description"] = o.Description + } + if !isNil(o.GasFeePolicy) { + toSerialize["gasFeePolicy"] = o.GasFeePolicy + } + if !isNil(o.MaxBlobSize) { + toSerialize["maxBlobSize"] = o.MaxBlobSize + } + if !isNil(o.MaxEventSize) { + toSerialize["maxEventSize"] = o.MaxEventSize + } + if !isNil(o.MaxEventsPerReq) { + toSerialize["maxEventsPerReq"] = o.MaxEventsPerReq + } + return json.Marshal(toSerialize) +} + +type NullableGovChainInfoResponse struct { + value *GovChainInfoResponse + isSet bool +} + +func (v NullableGovChainInfoResponse) Get() *GovChainInfoResponse { + return v.value +} + +func (v *NullableGovChainInfoResponse) Set(val *GovChainInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGovChainInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGovChainInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGovChainInfoResponse(val *GovChainInfoResponse) *NullableGovChainInfoResponse { + return &NullableGovChainInfoResponse{value: val, isSet: true} +} + +func (v NullableGovChainInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGovChainInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_in_output.go b/client/model_in_output.go new file mode 100644 index 0000000000..24d8e97bd7 --- /dev/null +++ b/client/model_in_output.go @@ -0,0 +1,152 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InOutput struct for InOutput +type InOutput struct { + Output *Output `json:"output,omitempty"` + // The output ID + OutputId *string `json:"outputId,omitempty"` +} + +// NewInOutput instantiates a new InOutput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInOutput() *InOutput { + this := InOutput{} + return &this +} + +// NewInOutputWithDefaults instantiates a new InOutput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInOutputWithDefaults() *InOutput { + this := InOutput{} + return &this +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *InOutput) GetOutput() Output { + if o == nil || isNil(o.Output) { + var ret Output + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InOutput) GetOutputOk() (*Output, bool) { + if o == nil || isNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *InOutput) HasOutput() bool { + if o != nil && !isNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given Output and assigns it to the Output field. +func (o *InOutput) SetOutput(v Output) { + o.Output = &v +} + +// GetOutputId returns the OutputId field value if set, zero value otherwise. +func (o *InOutput) GetOutputId() string { + if o == nil || isNil(o.OutputId) { + var ret string + return ret + } + return *o.OutputId +} + +// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InOutput) GetOutputIdOk() (*string, bool) { + if o == nil || isNil(o.OutputId) { + return nil, false + } + return o.OutputId, true +} + +// HasOutputId returns a boolean if a field has been set. +func (o *InOutput) HasOutputId() bool { + if o != nil && !isNil(o.OutputId) { + return true + } + + return false +} + +// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +func (o *InOutput) SetOutputId(v string) { + o.OutputId = &v +} + +func (o InOutput) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Output) { + toSerialize["output"] = o.Output + } + if !isNil(o.OutputId) { + toSerialize["outputId"] = o.OutputId + } + return json.Marshal(toSerialize) +} + +type NullableInOutput struct { + value *InOutput + isSet bool +} + +func (v NullableInOutput) Get() *InOutput { + return v.value +} + +func (v *NullableInOutput) Set(val *InOutput) { + v.value = val + v.isSet = true +} + +func (v NullableInOutput) IsSet() bool { + return v.isSet +} + +func (v *NullableInOutput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInOutput(val *InOutput) *NullableInOutput { + return &NullableInOutput{value: val, isSet: true} +} + +func (v NullableInOutput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInOutput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_in_output_metric_item.go b/client/model_in_output_metric_item.go new file mode 100644 index 0000000000..ce44810f8b --- /dev/null +++ b/client/model_in_output_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// InOutputMetricItem struct for InOutputMetricItem +type InOutputMetricItem struct { + LastMessage *InOutput `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewInOutputMetricItem instantiates a new InOutputMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInOutputMetricItem() *InOutputMetricItem { + this := InOutputMetricItem{} + return &this +} + +// NewInOutputMetricItemWithDefaults instantiates a new InOutputMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInOutputMetricItemWithDefaults() *InOutputMetricItem { + this := InOutputMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *InOutputMetricItem) GetLastMessage() InOutput { + if o == nil || isNil(o.LastMessage) { + var ret InOutput + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InOutputMetricItem) GetLastMessageOk() (*InOutput, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *InOutputMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given InOutput and assigns it to the LastMessage field. +func (o *InOutputMetricItem) SetLastMessage(v InOutput) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *InOutputMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InOutputMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *InOutputMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *InOutputMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *InOutputMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InOutputMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *InOutputMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *InOutputMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o InOutputMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableInOutputMetricItem struct { + value *InOutputMetricItem + isSet bool +} + +func (v NullableInOutputMetricItem) Get() *InOutputMetricItem { + return v.value +} + +func (v *NullableInOutputMetricItem) Set(val *InOutputMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableInOutputMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInOutputMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInOutputMetricItem(val *InOutputMetricItem) *NullableInOutputMetricItem { + return &NullableInOutputMetricItem{value: val, isSet: true} +} + +func (v NullableInOutputMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInOutputMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_in_state_output.go b/client/model_in_state_output.go new file mode 100644 index 0000000000..100be4fb99 --- /dev/null +++ b/client/model_in_state_output.go @@ -0,0 +1,152 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InStateOutput struct for InStateOutput +type InStateOutput struct { + Output *Output `json:"output,omitempty"` + // The output ID + OutputId *string `json:"outputId,omitempty"` +} + +// NewInStateOutput instantiates a new InStateOutput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInStateOutput() *InStateOutput { + this := InStateOutput{} + return &this +} + +// NewInStateOutputWithDefaults instantiates a new InStateOutput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInStateOutputWithDefaults() *InStateOutput { + this := InStateOutput{} + return &this +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *InStateOutput) GetOutput() Output { + if o == nil || isNil(o.Output) { + var ret Output + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InStateOutput) GetOutputOk() (*Output, bool) { + if o == nil || isNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *InStateOutput) HasOutput() bool { + if o != nil && !isNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given Output and assigns it to the Output field. +func (o *InStateOutput) SetOutput(v Output) { + o.Output = &v +} + +// GetOutputId returns the OutputId field value if set, zero value otherwise. +func (o *InStateOutput) GetOutputId() string { + if o == nil || isNil(o.OutputId) { + var ret string + return ret + } + return *o.OutputId +} + +// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InStateOutput) GetOutputIdOk() (*string, bool) { + if o == nil || isNil(o.OutputId) { + return nil, false + } + return o.OutputId, true +} + +// HasOutputId returns a boolean if a field has been set. +func (o *InStateOutput) HasOutputId() bool { + if o != nil && !isNil(o.OutputId) { + return true + } + + return false +} + +// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +func (o *InStateOutput) SetOutputId(v string) { + o.OutputId = &v +} + +func (o InStateOutput) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Output) { + toSerialize["output"] = o.Output + } + if !isNil(o.OutputId) { + toSerialize["outputId"] = o.OutputId + } + return json.Marshal(toSerialize) +} + +type NullableInStateOutput struct { + value *InStateOutput + isSet bool +} + +func (v NullableInStateOutput) Get() *InStateOutput { + return v.value +} + +func (v *NullableInStateOutput) Set(val *InStateOutput) { + v.value = val + v.isSet = true +} + +func (v NullableInStateOutput) IsSet() bool { + return v.isSet +} + +func (v *NullableInStateOutput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInStateOutput(val *InStateOutput) *NullableInStateOutput { + return &NullableInStateOutput{value: val, isSet: true} +} + +func (v NullableInStateOutput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInStateOutput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_in_state_output_metric_item.go b/client/model_in_state_output_metric_item.go new file mode 100644 index 0000000000..a0a46c4aa5 --- /dev/null +++ b/client/model_in_state_output_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// InStateOutputMetricItem struct for InStateOutputMetricItem +type InStateOutputMetricItem struct { + LastMessage *InStateOutput `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewInStateOutputMetricItem instantiates a new InStateOutputMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInStateOutputMetricItem() *InStateOutputMetricItem { + this := InStateOutputMetricItem{} + return &this +} + +// NewInStateOutputMetricItemWithDefaults instantiates a new InStateOutputMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInStateOutputMetricItemWithDefaults() *InStateOutputMetricItem { + this := InStateOutputMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *InStateOutputMetricItem) GetLastMessage() InStateOutput { + if o == nil || isNil(o.LastMessage) { + var ret InStateOutput + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InStateOutputMetricItem) GetLastMessageOk() (*InStateOutput, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *InStateOutputMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given InStateOutput and assigns it to the LastMessage field. +func (o *InStateOutputMetricItem) SetLastMessage(v InStateOutput) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *InStateOutputMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InStateOutputMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *InStateOutputMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *InStateOutputMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *InStateOutputMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InStateOutputMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *InStateOutputMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *InStateOutputMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o InStateOutputMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableInStateOutputMetricItem struct { + value *InStateOutputMetricItem + isSet bool +} + +func (v NullableInStateOutputMetricItem) Get() *InStateOutputMetricItem { + return v.value +} + +func (v *NullableInStateOutputMetricItem) Set(val *InStateOutputMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableInStateOutputMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInStateOutputMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInStateOutputMetricItem(val *InStateOutputMetricItem) *NullableInStateOutputMetricItem { + return &NullableInStateOutputMetricItem{value: val, isSet: true} +} + +func (v NullableInStateOutputMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInStateOutputMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_info_response.go b/client/model_info_response.go new file mode 100644 index 0000000000..222b04e4cd --- /dev/null +++ b/client/model_info_response.go @@ -0,0 +1,226 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InfoResponse struct for InfoResponse +type InfoResponse struct { + L1Params *L1Params `json:"l1Params,omitempty"` + // The net id of the node + NetID *string `json:"netID,omitempty"` + // The public key of the node (Hex) + PublicKey *string `json:"publicKey,omitempty"` + // The version of the node + Version *string `json:"version,omitempty"` +} + +// NewInfoResponse instantiates a new InfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInfoResponse() *InfoResponse { + this := InfoResponse{} + return &this +} + +// NewInfoResponseWithDefaults instantiates a new InfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInfoResponseWithDefaults() *InfoResponse { + this := InfoResponse{} + return &this +} + +// GetL1Params returns the L1Params field value if set, zero value otherwise. +func (o *InfoResponse) GetL1Params() L1Params { + if o == nil || isNil(o.L1Params) { + var ret L1Params + return ret + } + return *o.L1Params +} + +// GetL1ParamsOk returns a tuple with the L1Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InfoResponse) GetL1ParamsOk() (*L1Params, bool) { + if o == nil || isNil(o.L1Params) { + return nil, false + } + return o.L1Params, true +} + +// HasL1Params returns a boolean if a field has been set. +func (o *InfoResponse) HasL1Params() bool { + if o != nil && !isNil(o.L1Params) { + return true + } + + return false +} + +// SetL1Params gets a reference to the given L1Params and assigns it to the L1Params field. +func (o *InfoResponse) SetL1Params(v L1Params) { + o.L1Params = &v +} + +// GetNetID returns the NetID field value if set, zero value otherwise. +func (o *InfoResponse) GetNetID() string { + if o == nil || isNil(o.NetID) { + var ret string + return ret + } + return *o.NetID +} + +// GetNetIDOk returns a tuple with the NetID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InfoResponse) GetNetIDOk() (*string, bool) { + if o == nil || isNil(o.NetID) { + return nil, false + } + return o.NetID, true +} + +// HasNetID returns a boolean if a field has been set. +func (o *InfoResponse) HasNetID() bool { + if o != nil && !isNil(o.NetID) { + return true + } + + return false +} + +// SetNetID gets a reference to the given string and assigns it to the NetID field. +func (o *InfoResponse) SetNetID(v string) { + o.NetID = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *InfoResponse) GetPublicKey() string { + if o == nil || isNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InfoResponse) GetPublicKeyOk() (*string, bool) { + if o == nil || isNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *InfoResponse) HasPublicKey() bool { + if o != nil && !isNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *InfoResponse) SetPublicKey(v string) { + o.PublicKey = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *InfoResponse) GetVersion() string { + if o == nil || isNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InfoResponse) GetVersionOk() (*string, bool) { + if o == nil || isNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *InfoResponse) HasVersion() bool { + if o != nil && !isNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *InfoResponse) SetVersion(v string) { + o.Version = &v +} + +func (o InfoResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.L1Params) { + toSerialize["l1Params"] = o.L1Params + } + if !isNil(o.NetID) { + toSerialize["netID"] = o.NetID + } + if !isNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + if !isNil(o.Version) { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableInfoResponse struct { + value *InfoResponse + isSet bool +} + +func (v NullableInfoResponse) Get() *InfoResponse { + return v.value +} + +func (v *NullableInfoResponse) Set(val *InfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInfoResponse(val *InfoResponse) *NullableInfoResponse { + return &NullableInfoResponse{value: val, isSet: true} +} + +func (v NullableInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_interface_metric_item.go b/client/model_interface_metric_item.go new file mode 100644 index 0000000000..1513b8d53f --- /dev/null +++ b/client/model_interface_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// InterfaceMetricItem struct for InterfaceMetricItem +type InterfaceMetricItem struct { + LastMessage *string `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewInterfaceMetricItem instantiates a new InterfaceMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterfaceMetricItem() *InterfaceMetricItem { + this := InterfaceMetricItem{} + return &this +} + +// NewInterfaceMetricItemWithDefaults instantiates a new InterfaceMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterfaceMetricItemWithDefaults() *InterfaceMetricItem { + this := InterfaceMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *InterfaceMetricItem) GetLastMessage() string { + if o == nil || isNil(o.LastMessage) { + var ret string + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceMetricItem) GetLastMessageOk() (*string, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *InterfaceMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given string and assigns it to the LastMessage field. +func (o *InterfaceMetricItem) SetLastMessage(v string) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *InterfaceMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *InterfaceMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *InterfaceMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *InterfaceMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterfaceMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *InterfaceMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *InterfaceMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o InterfaceMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableInterfaceMetricItem struct { + value *InterfaceMetricItem + isSet bool +} + +func (v NullableInterfaceMetricItem) Get() *InterfaceMetricItem { + return v.value +} + +func (v *NullableInterfaceMetricItem) Set(val *InterfaceMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableInterfaceMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInterfaceMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterfaceMetricItem(val *InterfaceMetricItem) *NullableInterfaceMetricItem { + return &NullableInterfaceMetricItem{value: val, isSet: true} +} + +func (v NullableInterfaceMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterfaceMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_item.go b/client/model_item.go new file mode 100644 index 0000000000..90758df729 --- /dev/null +++ b/client/model_item.go @@ -0,0 +1,153 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// Item struct for Item +type Item struct { + // key (hex-encoded) + Key *string `json:"key,omitempty"` + // value (hex-encoded) + Value *string `json:"value,omitempty"` +} + +// NewItem instantiates a new Item object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewItem() *Item { + this := Item{} + return &this +} + +// NewItemWithDefaults instantiates a new Item object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewItemWithDefaults() *Item { + this := Item{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *Item) GetKey() string { + if o == nil || isNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Item) GetKeyOk() (*string, bool) { + if o == nil || isNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *Item) HasKey() bool { + if o != nil && !isNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *Item) SetKey(v string) { + o.Key = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *Item) GetValue() string { + if o == nil || isNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Item) GetValueOk() (*string, bool) { + if o == nil || isNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *Item) HasValue() bool { + if o != nil && !isNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *Item) SetValue(v string) { + o.Value = &v +} + +func (o Item) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Key) { + toSerialize["key"] = o.Key + } + if !isNil(o.Value) { + toSerialize["value"] = o.Value + } + return json.Marshal(toSerialize) +} + +type NullableItem struct { + value *Item + isSet bool +} + +func (v NullableItem) Get() *Item { + return v.value +} + +func (v *NullableItem) Set(val *Item) { + v.value = val + v.isSet = true +} + +func (v NullableItem) IsSet() bool { + return v.isSet +} + +func (v *NullableItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableItem(val *Item) *NullableItem { + return &NullableItem{value: val, isSet: true} +} + +func (v NullableItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_json_dict.go b/client/model_json_dict.go new file mode 100644 index 0000000000..b01df57703 --- /dev/null +++ b/client/model_json_dict.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// JSONDict struct for JSONDict +type JSONDict struct { + Items []Item `json:"Items,omitempty"` +} + +// NewJSONDict instantiates a new JSONDict object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewJSONDict() *JSONDict { + this := JSONDict{} + return &this +} + +// NewJSONDictWithDefaults instantiates a new JSONDict object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewJSONDictWithDefaults() *JSONDict { + this := JSONDict{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *JSONDict) GetItems() []Item { + if o == nil || isNil(o.Items) { + var ret []Item + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *JSONDict) GetItemsOk() ([]Item, bool) { + if o == nil || isNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *JSONDict) HasItems() bool { + if o != nil && !isNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []Item and assigns it to the Items field. +func (o *JSONDict) SetItems(v []Item) { + o.Items = v +} + +func (o JSONDict) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Items) { + toSerialize["Items"] = o.Items + } + return json.Marshal(toSerialize) +} + +type NullableJSONDict struct { + value *JSONDict + isSet bool +} + +func (v NullableJSONDict) Get() *JSONDict { + return v.value +} + +func (v *NullableJSONDict) Set(val *JSONDict) { + v.value = val + v.isSet = true +} + +func (v NullableJSONDict) IsSet() bool { + return v.isSet +} + +func (v *NullableJSONDict) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableJSONDict(val *JSONDict) *NullableJSONDict { + return &NullableJSONDict{value: val, isSet: true} +} + +func (v NullableJSONDict) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableJSONDict) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_l1_params.go b/client/model_l1_params.go new file mode 100644 index 0000000000..ead347d672 --- /dev/null +++ b/client/model_l1_params.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// L1Params struct for L1Params +type L1Params struct { + BaseToken *BaseToken `json:"baseToken,omitempty"` + // The max payload size + MaxPayloadSize *int32 `json:"maxPayloadSize,omitempty"` + Protocol *ProtocolParameters `json:"protocol,omitempty"` +} + +// NewL1Params instantiates a new L1Params object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewL1Params() *L1Params { + this := L1Params{} + return &this +} + +// NewL1ParamsWithDefaults instantiates a new L1Params object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewL1ParamsWithDefaults() *L1Params { + this := L1Params{} + return &this +} + +// GetBaseToken returns the BaseToken field value if set, zero value otherwise. +func (o *L1Params) GetBaseToken() BaseToken { + if o == nil || isNil(o.BaseToken) { + var ret BaseToken + return ret + } + return *o.BaseToken +} + +// GetBaseTokenOk returns a tuple with the BaseToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L1Params) GetBaseTokenOk() (*BaseToken, bool) { + if o == nil || isNil(o.BaseToken) { + return nil, false + } + return o.BaseToken, true +} + +// HasBaseToken returns a boolean if a field has been set. +func (o *L1Params) HasBaseToken() bool { + if o != nil && !isNil(o.BaseToken) { + return true + } + + return false +} + +// SetBaseToken gets a reference to the given BaseToken and assigns it to the BaseToken field. +func (o *L1Params) SetBaseToken(v BaseToken) { + o.BaseToken = &v +} + +// GetMaxPayloadSize returns the MaxPayloadSize field value if set, zero value otherwise. +func (o *L1Params) GetMaxPayloadSize() int32 { + if o == nil || isNil(o.MaxPayloadSize) { + var ret int32 + return ret + } + return *o.MaxPayloadSize +} + +// GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool) { + if o == nil || isNil(o.MaxPayloadSize) { + return nil, false + } + return o.MaxPayloadSize, true +} + +// HasMaxPayloadSize returns a boolean if a field has been set. +func (o *L1Params) HasMaxPayloadSize() bool { + if o != nil && !isNil(o.MaxPayloadSize) { + return true + } + + return false +} + +// SetMaxPayloadSize gets a reference to the given int32 and assigns it to the MaxPayloadSize field. +func (o *L1Params) SetMaxPayloadSize(v int32) { + o.MaxPayloadSize = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *L1Params) GetProtocol() ProtocolParameters { + if o == nil || isNil(o.Protocol) { + var ret ProtocolParameters + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *L1Params) GetProtocolOk() (*ProtocolParameters, bool) { + if o == nil || isNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *L1Params) HasProtocol() bool { + if o != nil && !isNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given ProtocolParameters and assigns it to the Protocol field. +func (o *L1Params) SetProtocol(v ProtocolParameters) { + o.Protocol = &v +} + +func (o L1Params) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BaseToken) { + toSerialize["baseToken"] = o.BaseToken + } + if !isNil(o.MaxPayloadSize) { + toSerialize["maxPayloadSize"] = o.MaxPayloadSize + } + if !isNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return json.Marshal(toSerialize) +} + +type NullableL1Params struct { + value *L1Params + isSet bool +} + +func (v NullableL1Params) Get() *L1Params { + return v.value +} + +func (v *NullableL1Params) Set(val *L1Params) { + v.value = val + v.isSet = true +} + +func (v NullableL1Params) IsSet() bool { + return v.isSet +} + +func (v *NullableL1Params) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableL1Params(val *L1Params) *NullableL1Params { + return &NullableL1Params{value: val, isSet: true} +} + +func (v NullableL1Params) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableL1Params) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_native_token.go b/client/model_native_token.go new file mode 100644 index 0000000000..c2a419cc0a --- /dev/null +++ b/client/model_native_token.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// NativeToken struct for NativeToken +type NativeToken struct { + Amount *string `json:"amount,omitempty"` + Id *string `json:"id,omitempty"` +} + +// NewNativeToken instantiates a new NativeToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNativeToken() *NativeToken { + this := NativeToken{} + return &this +} + +// NewNativeTokenWithDefaults instantiates a new NativeToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNativeTokenWithDefaults() *NativeToken { + this := NativeToken{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *NativeToken) GetAmount() string { + if o == nil || isNil(o.Amount) { + var ret string + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeToken) GetAmountOk() (*string, bool) { + if o == nil || isNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *NativeToken) HasAmount() bool { + if o != nil && !isNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given string and assigns it to the Amount field. +func (o *NativeToken) SetAmount(v string) { + o.Amount = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NativeToken) GetId() string { + if o == nil || isNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeToken) GetIdOk() (*string, bool) { + if o == nil || isNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NativeToken) HasId() bool { + if o != nil && !isNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NativeToken) SetId(v string) { + o.Id = &v +} + +func (o NativeToken) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !isNil(o.Id) { + toSerialize["id"] = o.Id + } + return json.Marshal(toSerialize) +} + +type NullableNativeToken struct { + value *NativeToken + isSet bool +} + +func (v NullableNativeToken) Get() *NativeToken { + return v.value +} + +func (v *NullableNativeToken) Set(val *NativeToken) { + v.value = val + v.isSet = true +} + +func (v NullableNativeToken) IsSet() bool { + return v.isSet +} + +func (v *NullableNativeToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNativeToken(val *NativeToken) *NullableNativeToken { + return &NullableNativeToken{value: val, isSet: true} +} + +func (v NullableNativeToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNativeToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_native_token_id_registry_response.go b/client/model_native_token_id_registry_response.go new file mode 100644 index 0000000000..f42c6d2a65 --- /dev/null +++ b/client/model_native_token_id_registry_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// NativeTokenIDRegistryResponse struct for NativeTokenIDRegistryResponse +type NativeTokenIDRegistryResponse struct { + NativeTokenRegistryIds []string `json:"nativeTokenRegistryIds,omitempty"` +} + +// NewNativeTokenIDRegistryResponse instantiates a new NativeTokenIDRegistryResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNativeTokenIDRegistryResponse() *NativeTokenIDRegistryResponse { + this := NativeTokenIDRegistryResponse{} + return &this +} + +// NewNativeTokenIDRegistryResponseWithDefaults instantiates a new NativeTokenIDRegistryResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNativeTokenIDRegistryResponseWithDefaults() *NativeTokenIDRegistryResponse { + this := NativeTokenIDRegistryResponse{} + return &this +} + +// GetNativeTokenRegistryIds returns the NativeTokenRegistryIds field value if set, zero value otherwise. +func (o *NativeTokenIDRegistryResponse) GetNativeTokenRegistryIds() []string { + if o == nil || isNil(o.NativeTokenRegistryIds) { + var ret []string + return ret + } + return o.NativeTokenRegistryIds +} + +// GetNativeTokenRegistryIdsOk returns a tuple with the NativeTokenRegistryIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeTokenIDRegistryResponse) GetNativeTokenRegistryIdsOk() ([]string, bool) { + if o == nil || isNil(o.NativeTokenRegistryIds) { + return nil, false + } + return o.NativeTokenRegistryIds, true +} + +// HasNativeTokenRegistryIds returns a boolean if a field has been set. +func (o *NativeTokenIDRegistryResponse) HasNativeTokenRegistryIds() bool { + if o != nil && !isNil(o.NativeTokenRegistryIds) { + return true + } + + return false +} + +// SetNativeTokenRegistryIds gets a reference to the given []string and assigns it to the NativeTokenRegistryIds field. +func (o *NativeTokenIDRegistryResponse) SetNativeTokenRegistryIds(v []string) { + o.NativeTokenRegistryIds = v +} + +func (o NativeTokenIDRegistryResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.NativeTokenRegistryIds) { + toSerialize["nativeTokenRegistryIds"] = o.NativeTokenRegistryIds + } + return json.Marshal(toSerialize) +} + +type NullableNativeTokenIDRegistryResponse struct { + value *NativeTokenIDRegistryResponse + isSet bool +} + +func (v NullableNativeTokenIDRegistryResponse) Get() *NativeTokenIDRegistryResponse { + return v.value +} + +func (v *NullableNativeTokenIDRegistryResponse) Set(val *NativeTokenIDRegistryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNativeTokenIDRegistryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNativeTokenIDRegistryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNativeTokenIDRegistryResponse(val *NativeTokenIDRegistryResponse) *NullableNativeTokenIDRegistryResponse { + return &NullableNativeTokenIDRegistryResponse{value: val, isSet: true} +} + +func (v NullableNativeTokenIDRegistryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNativeTokenIDRegistryResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_nft_data_response.go b/client/model_nft_data_response.go new file mode 100644 index 0000000000..5ccf22fd8d --- /dev/null +++ b/client/model_nft_data_response.go @@ -0,0 +1,223 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// NFTDataResponse struct for NFTDataResponse +type NFTDataResponse struct { + Id *string `json:"id,omitempty"` + Issuer *string `json:"issuer,omitempty"` + Metadata *string `json:"metadata,omitempty"` + Owner *string `json:"owner,omitempty"` +} + +// NewNFTDataResponse instantiates a new NFTDataResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNFTDataResponse() *NFTDataResponse { + this := NFTDataResponse{} + return &this +} + +// NewNFTDataResponseWithDefaults instantiates a new NFTDataResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNFTDataResponseWithDefaults() *NFTDataResponse { + this := NFTDataResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NFTDataResponse) GetId() string { + if o == nil || isNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NFTDataResponse) GetIdOk() (*string, bool) { + if o == nil || isNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NFTDataResponse) HasId() bool { + if o != nil && !isNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NFTDataResponse) SetId(v string) { + o.Id = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *NFTDataResponse) GetIssuer() string { + if o == nil || isNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NFTDataResponse) GetIssuerOk() (*string, bool) { + if o == nil || isNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *NFTDataResponse) HasIssuer() bool { + if o != nil && !isNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *NFTDataResponse) SetIssuer(v string) { + o.Issuer = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *NFTDataResponse) GetMetadata() string { + if o == nil || isNil(o.Metadata) { + var ret string + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NFTDataResponse) GetMetadataOk() (*string, bool) { + if o == nil || isNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *NFTDataResponse) HasMetadata() bool { + if o != nil && !isNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +func (o *NFTDataResponse) SetMetadata(v string) { + o.Metadata = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *NFTDataResponse) GetOwner() string { + if o == nil || isNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NFTDataResponse) GetOwnerOk() (*string, bool) { + if o == nil || isNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *NFTDataResponse) HasOwner() bool { + if o != nil && !isNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *NFTDataResponse) SetOwner(v string) { + o.Owner = &v +} + +func (o NFTDataResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Id) { + toSerialize["id"] = o.Id + } + if !isNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !isNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !isNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + return json.Marshal(toSerialize) +} + +type NullableNFTDataResponse struct { + value *NFTDataResponse + isSet bool +} + +func (v NullableNFTDataResponse) Get() *NFTDataResponse { + return v.value +} + +func (v *NullableNFTDataResponse) Set(val *NFTDataResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNFTDataResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNFTDataResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNFTDataResponse(val *NFTDataResponse) *NullableNFTDataResponse { + return &NullableNFTDataResponse{value: val, isSet: true} +} + +func (v NullableNFTDataResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNFTDataResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_node_owner_certificate_request.go b/client/model_node_owner_certificate_request.go new file mode 100644 index 0000000000..e9a998e839 --- /dev/null +++ b/client/model_node_owner_certificate_request.go @@ -0,0 +1,153 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// NodeOwnerCertificateRequest struct for NodeOwnerCertificateRequest +type NodeOwnerCertificateRequest struct { + // Node owner address. (Bech32) + OwnerAddress *string `json:"ownerAddress,omitempty"` + // The public key of the node (Hex) + PublicKey *string `json:"publicKey,omitempty"` +} + +// NewNodeOwnerCertificateRequest instantiates a new NodeOwnerCertificateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeOwnerCertificateRequest() *NodeOwnerCertificateRequest { + this := NodeOwnerCertificateRequest{} + return &this +} + +// NewNodeOwnerCertificateRequestWithDefaults instantiates a new NodeOwnerCertificateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeOwnerCertificateRequestWithDefaults() *NodeOwnerCertificateRequest { + this := NodeOwnerCertificateRequest{} + return &this +} + +// GetOwnerAddress returns the OwnerAddress field value if set, zero value otherwise. +func (o *NodeOwnerCertificateRequest) GetOwnerAddress() string { + if o == nil || isNil(o.OwnerAddress) { + var ret string + return ret + } + return *o.OwnerAddress +} + +// GetOwnerAddressOk returns a tuple with the OwnerAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeOwnerCertificateRequest) GetOwnerAddressOk() (*string, bool) { + if o == nil || isNil(o.OwnerAddress) { + return nil, false + } + return o.OwnerAddress, true +} + +// HasOwnerAddress returns a boolean if a field has been set. +func (o *NodeOwnerCertificateRequest) HasOwnerAddress() bool { + if o != nil && !isNil(o.OwnerAddress) { + return true + } + + return false +} + +// SetOwnerAddress gets a reference to the given string and assigns it to the OwnerAddress field. +func (o *NodeOwnerCertificateRequest) SetOwnerAddress(v string) { + o.OwnerAddress = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *NodeOwnerCertificateRequest) GetPublicKey() string { + if o == nil || isNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeOwnerCertificateRequest) GetPublicKeyOk() (*string, bool) { + if o == nil || isNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *NodeOwnerCertificateRequest) HasPublicKey() bool { + if o != nil && !isNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *NodeOwnerCertificateRequest) SetPublicKey(v string) { + o.PublicKey = &v +} + +func (o NodeOwnerCertificateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.OwnerAddress) { + toSerialize["ownerAddress"] = o.OwnerAddress + } + if !isNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + return json.Marshal(toSerialize) +} + +type NullableNodeOwnerCertificateRequest struct { + value *NodeOwnerCertificateRequest + isSet bool +} + +func (v NullableNodeOwnerCertificateRequest) Get() *NodeOwnerCertificateRequest { + return v.value +} + +func (v *NullableNodeOwnerCertificateRequest) Set(val *NodeOwnerCertificateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNodeOwnerCertificateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeOwnerCertificateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeOwnerCertificateRequest(val *NodeOwnerCertificateRequest) *NullableNodeOwnerCertificateRequest { + return &NullableNodeOwnerCertificateRequest{value: val, isSet: true} +} + +func (v NullableNodeOwnerCertificateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeOwnerCertificateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_off_ledger_request.go b/client/model_off_ledger_request.go new file mode 100644 index 0000000000..e2ad571682 --- /dev/null +++ b/client/model_off_ledger_request.go @@ -0,0 +1,153 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// OffLedgerRequest struct for OffLedgerRequest +type OffLedgerRequest struct { + // The chain id + ChainId *string `json:"chainId,omitempty"` + // Offledger Request (Hex) + Request *string `json:"request,omitempty"` +} + +// NewOffLedgerRequest instantiates a new OffLedgerRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffLedgerRequest() *OffLedgerRequest { + this := OffLedgerRequest{} + return &this +} + +// NewOffLedgerRequestWithDefaults instantiates a new OffLedgerRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOffLedgerRequestWithDefaults() *OffLedgerRequest { + this := OffLedgerRequest{} + return &this +} + +// GetChainId returns the ChainId field value if set, zero value otherwise. +func (o *OffLedgerRequest) GetChainId() string { + if o == nil || isNil(o.ChainId) { + var ret string + return ret + } + return *o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OffLedgerRequest) GetChainIdOk() (*string, bool) { + if o == nil || isNil(o.ChainId) { + return nil, false + } + return o.ChainId, true +} + +// HasChainId returns a boolean if a field has been set. +func (o *OffLedgerRequest) HasChainId() bool { + if o != nil && !isNil(o.ChainId) { + return true + } + + return false +} + +// SetChainId gets a reference to the given string and assigns it to the ChainId field. +func (o *OffLedgerRequest) SetChainId(v string) { + o.ChainId = &v +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *OffLedgerRequest) GetRequest() string { + if o == nil || isNil(o.Request) { + var ret string + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OffLedgerRequest) GetRequestOk() (*string, bool) { + if o == nil || isNil(o.Request) { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *OffLedgerRequest) HasRequest() bool { + if o != nil && !isNil(o.Request) { + return true + } + + return false +} + +// SetRequest gets a reference to the given string and assigns it to the Request field. +func (o *OffLedgerRequest) SetRequest(v string) { + o.Request = &v +} + +func (o OffLedgerRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ChainId) { + toSerialize["chainId"] = o.ChainId + } + if !isNil(o.Request) { + toSerialize["request"] = o.Request + } + return json.Marshal(toSerialize) +} + +type NullableOffLedgerRequest struct { + value *OffLedgerRequest + isSet bool +} + +func (v NullableOffLedgerRequest) Get() *OffLedgerRequest { + return v.value +} + +func (v *NullableOffLedgerRequest) Set(val *OffLedgerRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOffLedgerRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOffLedgerRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffLedgerRequest(val *OffLedgerRequest) *NullableOffLedgerRequest { + return &NullableOffLedgerRequest{value: val, isSet: true} +} + +func (v NullableOffLedgerRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffLedgerRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_on_ledger_request.go b/client/model_on_ledger_request.go new file mode 100644 index 0000000000..bf196ec673 --- /dev/null +++ b/client/model_on_ledger_request.go @@ -0,0 +1,226 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// OnLedgerRequest struct for OnLedgerRequest +type OnLedgerRequest struct { + // The request ID + Id *string `json:"id,omitempty"` + Output *Output `json:"output,omitempty"` + // The output ID + OutputId *string `json:"outputId,omitempty"` + // The raw data of the request (Hex) + Raw *string `json:"raw,omitempty"` +} + +// NewOnLedgerRequest instantiates a new OnLedgerRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOnLedgerRequest() *OnLedgerRequest { + this := OnLedgerRequest{} + return &this +} + +// NewOnLedgerRequestWithDefaults instantiates a new OnLedgerRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOnLedgerRequestWithDefaults() *OnLedgerRequest { + this := OnLedgerRequest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OnLedgerRequest) GetId() string { + if o == nil || isNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequest) GetIdOk() (*string, bool) { + if o == nil || isNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OnLedgerRequest) HasId() bool { + if o != nil && !isNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OnLedgerRequest) SetId(v string) { + o.Id = &v +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *OnLedgerRequest) GetOutput() Output { + if o == nil || isNil(o.Output) { + var ret Output + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequest) GetOutputOk() (*Output, bool) { + if o == nil || isNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *OnLedgerRequest) HasOutput() bool { + if o != nil && !isNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given Output and assigns it to the Output field. +func (o *OnLedgerRequest) SetOutput(v Output) { + o.Output = &v +} + +// GetOutputId returns the OutputId field value if set, zero value otherwise. +func (o *OnLedgerRequest) GetOutputId() string { + if o == nil || isNil(o.OutputId) { + var ret string + return ret + } + return *o.OutputId +} + +// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequest) GetOutputIdOk() (*string, bool) { + if o == nil || isNil(o.OutputId) { + return nil, false + } + return o.OutputId, true +} + +// HasOutputId returns a boolean if a field has been set. +func (o *OnLedgerRequest) HasOutputId() bool { + if o != nil && !isNil(o.OutputId) { + return true + } + + return false +} + +// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +func (o *OnLedgerRequest) SetOutputId(v string) { + o.OutputId = &v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *OnLedgerRequest) GetRaw() string { + if o == nil || isNil(o.Raw) { + var ret string + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequest) GetRawOk() (*string, bool) { + if o == nil || isNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *OnLedgerRequest) HasRaw() bool { + if o != nil && !isNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given string and assigns it to the Raw field. +func (o *OnLedgerRequest) SetRaw(v string) { + o.Raw = &v +} + +func (o OnLedgerRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Id) { + toSerialize["id"] = o.Id + } + if !isNil(o.Output) { + toSerialize["output"] = o.Output + } + if !isNil(o.OutputId) { + toSerialize["outputId"] = o.OutputId + } + if !isNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + return json.Marshal(toSerialize) +} + +type NullableOnLedgerRequest struct { + value *OnLedgerRequest + isSet bool +} + +func (v NullableOnLedgerRequest) Get() *OnLedgerRequest { + return v.value +} + +func (v *NullableOnLedgerRequest) Set(val *OnLedgerRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOnLedgerRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOnLedgerRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOnLedgerRequest(val *OnLedgerRequest) *NullableOnLedgerRequest { + return &NullableOnLedgerRequest{value: val, isSet: true} +} + +func (v NullableOnLedgerRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOnLedgerRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_on_ledger_request_metric_item.go b/client/model_on_ledger_request_metric_item.go new file mode 100644 index 0000000000..c52287836b --- /dev/null +++ b/client/model_on_ledger_request_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// OnLedgerRequestMetricItem struct for OnLedgerRequestMetricItem +type OnLedgerRequestMetricItem struct { + LastMessage *OnLedgerRequest `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewOnLedgerRequestMetricItem instantiates a new OnLedgerRequestMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOnLedgerRequestMetricItem() *OnLedgerRequestMetricItem { + this := OnLedgerRequestMetricItem{} + return &this +} + +// NewOnLedgerRequestMetricItemWithDefaults instantiates a new OnLedgerRequestMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOnLedgerRequestMetricItemWithDefaults() *OnLedgerRequestMetricItem { + this := OnLedgerRequestMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *OnLedgerRequestMetricItem) GetLastMessage() OnLedgerRequest { + if o == nil || isNil(o.LastMessage) { + var ret OnLedgerRequest + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequestMetricItem) GetLastMessageOk() (*OnLedgerRequest, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *OnLedgerRequestMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given OnLedgerRequest and assigns it to the LastMessage field. +func (o *OnLedgerRequestMetricItem) SetLastMessage(v OnLedgerRequest) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *OnLedgerRequestMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequestMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *OnLedgerRequestMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *OnLedgerRequestMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *OnLedgerRequestMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OnLedgerRequestMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *OnLedgerRequestMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *OnLedgerRequestMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o OnLedgerRequestMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableOnLedgerRequestMetricItem struct { + value *OnLedgerRequestMetricItem + isSet bool +} + +func (v NullableOnLedgerRequestMetricItem) Get() *OnLedgerRequestMetricItem { + return v.value +} + +func (v *NullableOnLedgerRequestMetricItem) Set(val *OnLedgerRequestMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableOnLedgerRequestMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableOnLedgerRequestMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOnLedgerRequestMetricItem(val *OnLedgerRequestMetricItem) *NullableOnLedgerRequestMetricItem { + return &NullableOnLedgerRequestMetricItem{value: val, isSet: true} +} + +func (v NullableOnLedgerRequestMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOnLedgerRequestMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_output.go b/client/model_output.go new file mode 100644 index 0000000000..5667a94e50 --- /dev/null +++ b/client/model_output.go @@ -0,0 +1,153 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// Output struct for Output +type Output struct { + // The output type + OutputType *int32 `json:"outputType,omitempty"` + // The raw data of the output (Hex) + Raw *string `json:"raw,omitempty"` +} + +// NewOutput instantiates a new Output object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutput() *Output { + this := Output{} + return &this +} + +// NewOutputWithDefaults instantiates a new Output object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutputWithDefaults() *Output { + this := Output{} + return &this +} + +// GetOutputType returns the OutputType field value if set, zero value otherwise. +func (o *Output) GetOutputType() int32 { + if o == nil || isNil(o.OutputType) { + var ret int32 + return ret + } + return *o.OutputType +} + +// GetOutputTypeOk returns a tuple with the OutputType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Output) GetOutputTypeOk() (*int32, bool) { + if o == nil || isNil(o.OutputType) { + return nil, false + } + return o.OutputType, true +} + +// HasOutputType returns a boolean if a field has been set. +func (o *Output) HasOutputType() bool { + if o != nil && !isNil(o.OutputType) { + return true + } + + return false +} + +// SetOutputType gets a reference to the given int32 and assigns it to the OutputType field. +func (o *Output) SetOutputType(v int32) { + o.OutputType = &v +} + +// GetRaw returns the Raw field value if set, zero value otherwise. +func (o *Output) GetRaw() string { + if o == nil || isNil(o.Raw) { + var ret string + return ret + } + return *o.Raw +} + +// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Output) GetRawOk() (*string, bool) { + if o == nil || isNil(o.Raw) { + return nil, false + } + return o.Raw, true +} + +// HasRaw returns a boolean if a field has been set. +func (o *Output) HasRaw() bool { + if o != nil && !isNil(o.Raw) { + return true + } + + return false +} + +// SetRaw gets a reference to the given string and assigns it to the Raw field. +func (o *Output) SetRaw(v string) { + o.Raw = &v +} + +func (o Output) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.OutputType) { + toSerialize["outputType"] = o.OutputType + } + if !isNil(o.Raw) { + toSerialize["raw"] = o.Raw + } + return json.Marshal(toSerialize) +} + +type NullableOutput struct { + value *Output + isSet bool +} + +func (v NullableOutput) Get() *Output { + return v.value +} + +func (v *NullableOutput) Set(val *Output) { + v.value = val + v.isSet = true +} + +func (v NullableOutput) IsSet() bool { + return v.isSet +} + +func (v *NullableOutput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutput(val *Output) *NullableOutput { + return &NullableOutput{value: val, isSet: true} +} + +func (v NullableOutput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_output_id.go b/client/model_output_id.go new file mode 100644 index 0000000000..f7fdadf605 --- /dev/null +++ b/client/model_output_id.go @@ -0,0 +1,116 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// OutputID struct for OutputID +type OutputID struct { + // The output ID + OutputId *string `json:"outputId,omitempty"` +} + +// NewOutputID instantiates a new OutputID object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutputID() *OutputID { + this := OutputID{} + return &this +} + +// NewOutputIDWithDefaults instantiates a new OutputID object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutputIDWithDefaults() *OutputID { + this := OutputID{} + return &this +} + +// GetOutputId returns the OutputId field value if set, zero value otherwise. +func (o *OutputID) GetOutputId() string { + if o == nil || isNil(o.OutputId) { + var ret string + return ret + } + return *o.OutputId +} + +// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutputID) GetOutputIdOk() (*string, bool) { + if o == nil || isNil(o.OutputId) { + return nil, false + } + return o.OutputId, true +} + +// HasOutputId returns a boolean if a field has been set. +func (o *OutputID) HasOutputId() bool { + if o != nil && !isNil(o.OutputId) { + return true + } + + return false +} + +// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +func (o *OutputID) SetOutputId(v string) { + o.OutputId = &v +} + +func (o OutputID) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.OutputId) { + toSerialize["outputId"] = o.OutputId + } + return json.Marshal(toSerialize) +} + +type NullableOutputID struct { + value *OutputID + isSet bool +} + +func (v NullableOutputID) Get() *OutputID { + return v.value +} + +func (v *NullableOutputID) Set(val *OutputID) { + v.value = val + v.isSet = true +} + +func (v NullableOutputID) IsSet() bool { + return v.isSet +} + +func (v *NullableOutputID) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutputID(val *OutputID) *NullableOutputID { + return &NullableOutputID{value: val, isSet: true} +} + +func (v NullableOutputID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutputID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_peering_node_identity_response.go b/client/model_peering_node_identity_response.go new file mode 100644 index 0000000000..e4b57947ec --- /dev/null +++ b/client/model_peering_node_identity_response.go @@ -0,0 +1,189 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// PeeringNodeIdentityResponse struct for PeeringNodeIdentityResponse +type PeeringNodeIdentityResponse struct { + IsTrusted *bool `json:"isTrusted,omitempty"` + // The NetID of the peer + NetId *string `json:"netId,omitempty"` + // The peers public key encoded in Hex + PublicKey *string `json:"publicKey,omitempty"` +} + +// NewPeeringNodeIdentityResponse instantiates a new PeeringNodeIdentityResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPeeringNodeIdentityResponse() *PeeringNodeIdentityResponse { + this := PeeringNodeIdentityResponse{} + return &this +} + +// NewPeeringNodeIdentityResponseWithDefaults instantiates a new PeeringNodeIdentityResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPeeringNodeIdentityResponseWithDefaults() *PeeringNodeIdentityResponse { + this := PeeringNodeIdentityResponse{} + return &this +} + +// GetIsTrusted returns the IsTrusted field value if set, zero value otherwise. +func (o *PeeringNodeIdentityResponse) GetIsTrusted() bool { + if o == nil || isNil(o.IsTrusted) { + var ret bool + return ret + } + return *o.IsTrusted +} + +// GetIsTrustedOk returns a tuple with the IsTrusted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeIdentityResponse) GetIsTrustedOk() (*bool, bool) { + if o == nil || isNil(o.IsTrusted) { + return nil, false + } + return o.IsTrusted, true +} + +// HasIsTrusted returns a boolean if a field has been set. +func (o *PeeringNodeIdentityResponse) HasIsTrusted() bool { + if o != nil && !isNil(o.IsTrusted) { + return true + } + + return false +} + +// SetIsTrusted gets a reference to the given bool and assigns it to the IsTrusted field. +func (o *PeeringNodeIdentityResponse) SetIsTrusted(v bool) { + o.IsTrusted = &v +} + +// GetNetId returns the NetId field value if set, zero value otherwise. +func (o *PeeringNodeIdentityResponse) GetNetId() string { + if o == nil || isNil(o.NetId) { + var ret string + return ret + } + return *o.NetId +} + +// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeIdentityResponse) GetNetIdOk() (*string, bool) { + if o == nil || isNil(o.NetId) { + return nil, false + } + return o.NetId, true +} + +// HasNetId returns a boolean if a field has been set. +func (o *PeeringNodeIdentityResponse) HasNetId() bool { + if o != nil && !isNil(o.NetId) { + return true + } + + return false +} + +// SetNetId gets a reference to the given string and assigns it to the NetId field. +func (o *PeeringNodeIdentityResponse) SetNetId(v string) { + o.NetId = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *PeeringNodeIdentityResponse) GetPublicKey() string { + if o == nil || isNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeIdentityResponse) GetPublicKeyOk() (*string, bool) { + if o == nil || isNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *PeeringNodeIdentityResponse) HasPublicKey() bool { + if o != nil && !isNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *PeeringNodeIdentityResponse) SetPublicKey(v string) { + o.PublicKey = &v +} + +func (o PeeringNodeIdentityResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.IsTrusted) { + toSerialize["isTrusted"] = o.IsTrusted + } + if !isNil(o.NetId) { + toSerialize["netId"] = o.NetId + } + if !isNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + return json.Marshal(toSerialize) +} + +type NullablePeeringNodeIdentityResponse struct { + value *PeeringNodeIdentityResponse + isSet bool +} + +func (v NullablePeeringNodeIdentityResponse) Get() *PeeringNodeIdentityResponse { + return v.value +} + +func (v *NullablePeeringNodeIdentityResponse) Set(val *PeeringNodeIdentityResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePeeringNodeIdentityResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePeeringNodeIdentityResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePeeringNodeIdentityResponse(val *PeeringNodeIdentityResponse) *NullablePeeringNodeIdentityResponse { + return &NullablePeeringNodeIdentityResponse{value: val, isSet: true} +} + +func (v NullablePeeringNodeIdentityResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePeeringNodeIdentityResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_peering_node_status_response.go b/client/model_peering_node_status_response.go new file mode 100644 index 0000000000..2bdaeee480 --- /dev/null +++ b/client/model_peering_node_status_response.go @@ -0,0 +1,263 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// PeeringNodeStatusResponse struct for PeeringNodeStatusResponse +type PeeringNodeStatusResponse struct { + // Whether or not the peer is activated + IsAlive *bool `json:"isAlive,omitempty"` + IsTrusted *bool `json:"isTrusted,omitempty"` + // The NetID of the peer + NetId *string `json:"netId,omitempty"` + // The amount of users attached to the peer + NumUsers *int32 `json:"numUsers,omitempty"` + // The peers public key encoded in Hex + PublicKey *string `json:"publicKey,omitempty"` +} + +// NewPeeringNodeStatusResponse instantiates a new PeeringNodeStatusResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPeeringNodeStatusResponse() *PeeringNodeStatusResponse { + this := PeeringNodeStatusResponse{} + return &this +} + +// NewPeeringNodeStatusResponseWithDefaults instantiates a new PeeringNodeStatusResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPeeringNodeStatusResponseWithDefaults() *PeeringNodeStatusResponse { + this := PeeringNodeStatusResponse{} + return &this +} + +// GetIsAlive returns the IsAlive field value if set, zero value otherwise. +func (o *PeeringNodeStatusResponse) GetIsAlive() bool { + if o == nil || isNil(o.IsAlive) { + var ret bool + return ret + } + return *o.IsAlive +} + +// GetIsAliveOk returns a tuple with the IsAlive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatusResponse) GetIsAliveOk() (*bool, bool) { + if o == nil || isNil(o.IsAlive) { + return nil, false + } + return o.IsAlive, true +} + +// HasIsAlive returns a boolean if a field has been set. +func (o *PeeringNodeStatusResponse) HasIsAlive() bool { + if o != nil && !isNil(o.IsAlive) { + return true + } + + return false +} + +// SetIsAlive gets a reference to the given bool and assigns it to the IsAlive field. +func (o *PeeringNodeStatusResponse) SetIsAlive(v bool) { + o.IsAlive = &v +} + +// GetIsTrusted returns the IsTrusted field value if set, zero value otherwise. +func (o *PeeringNodeStatusResponse) GetIsTrusted() bool { + if o == nil || isNil(o.IsTrusted) { + var ret bool + return ret + } + return *o.IsTrusted +} + +// GetIsTrustedOk returns a tuple with the IsTrusted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatusResponse) GetIsTrustedOk() (*bool, bool) { + if o == nil || isNil(o.IsTrusted) { + return nil, false + } + return o.IsTrusted, true +} + +// HasIsTrusted returns a boolean if a field has been set. +func (o *PeeringNodeStatusResponse) HasIsTrusted() bool { + if o != nil && !isNil(o.IsTrusted) { + return true + } + + return false +} + +// SetIsTrusted gets a reference to the given bool and assigns it to the IsTrusted field. +func (o *PeeringNodeStatusResponse) SetIsTrusted(v bool) { + o.IsTrusted = &v +} + +// GetNetId returns the NetId field value if set, zero value otherwise. +func (o *PeeringNodeStatusResponse) GetNetId() string { + if o == nil || isNil(o.NetId) { + var ret string + return ret + } + return *o.NetId +} + +// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatusResponse) GetNetIdOk() (*string, bool) { + if o == nil || isNil(o.NetId) { + return nil, false + } + return o.NetId, true +} + +// HasNetId returns a boolean if a field has been set. +func (o *PeeringNodeStatusResponse) HasNetId() bool { + if o != nil && !isNil(o.NetId) { + return true + } + + return false +} + +// SetNetId gets a reference to the given string and assigns it to the NetId field. +func (o *PeeringNodeStatusResponse) SetNetId(v string) { + o.NetId = &v +} + +// GetNumUsers returns the NumUsers field value if set, zero value otherwise. +func (o *PeeringNodeStatusResponse) GetNumUsers() int32 { + if o == nil || isNil(o.NumUsers) { + var ret int32 + return ret + } + return *o.NumUsers +} + +// GetNumUsersOk returns a tuple with the NumUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool) { + if o == nil || isNil(o.NumUsers) { + return nil, false + } + return o.NumUsers, true +} + +// HasNumUsers returns a boolean if a field has been set. +func (o *PeeringNodeStatusResponse) HasNumUsers() bool { + if o != nil && !isNil(o.NumUsers) { + return true + } + + return false +} + +// SetNumUsers gets a reference to the given int32 and assigns it to the NumUsers field. +func (o *PeeringNodeStatusResponse) SetNumUsers(v int32) { + o.NumUsers = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *PeeringNodeStatusResponse) GetPublicKey() string { + if o == nil || isNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatusResponse) GetPublicKeyOk() (*string, bool) { + if o == nil || isNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *PeeringNodeStatusResponse) HasPublicKey() bool { + if o != nil && !isNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *PeeringNodeStatusResponse) SetPublicKey(v string) { + o.PublicKey = &v +} + +func (o PeeringNodeStatusResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.IsAlive) { + toSerialize["isAlive"] = o.IsAlive + } + if !isNil(o.IsTrusted) { + toSerialize["isTrusted"] = o.IsTrusted + } + if !isNil(o.NetId) { + toSerialize["netId"] = o.NetId + } + if !isNil(o.NumUsers) { + toSerialize["numUsers"] = o.NumUsers + } + if !isNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + return json.Marshal(toSerialize) +} + +type NullablePeeringNodeStatusResponse struct { + value *PeeringNodeStatusResponse + isSet bool +} + +func (v NullablePeeringNodeStatusResponse) Get() *PeeringNodeStatusResponse { + return v.value +} + +func (v *NullablePeeringNodeStatusResponse) Set(val *PeeringNodeStatusResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePeeringNodeStatusResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePeeringNodeStatusResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePeeringNodeStatusResponse(val *PeeringNodeStatusResponse) *NullablePeeringNodeStatusResponse { + return &NullablePeeringNodeStatusResponse{value: val, isSet: true} +} + +func (v NullablePeeringNodeStatusResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePeeringNodeStatusResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_peering_trust_request.go b/client/model_peering_trust_request.go new file mode 100644 index 0000000000..7573739aab --- /dev/null +++ b/client/model_peering_trust_request.go @@ -0,0 +1,153 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// PeeringTrustRequest struct for PeeringTrustRequest +type PeeringTrustRequest struct { + // The NetID of the peer + NetId *string `json:"netId,omitempty"` + // The peers public key encoded in Hex + PublicKey *string `json:"publicKey,omitempty"` +} + +// NewPeeringTrustRequest instantiates a new PeeringTrustRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPeeringTrustRequest() *PeeringTrustRequest { + this := PeeringTrustRequest{} + return &this +} + +// NewPeeringTrustRequestWithDefaults instantiates a new PeeringTrustRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPeeringTrustRequestWithDefaults() *PeeringTrustRequest { + this := PeeringTrustRequest{} + return &this +} + +// GetNetId returns the NetId field value if set, zero value otherwise. +func (o *PeeringTrustRequest) GetNetId() string { + if o == nil || isNil(o.NetId) { + var ret string + return ret + } + return *o.NetId +} + +// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringTrustRequest) GetNetIdOk() (*string, bool) { + if o == nil || isNil(o.NetId) { + return nil, false + } + return o.NetId, true +} + +// HasNetId returns a boolean if a field has been set. +func (o *PeeringTrustRequest) HasNetId() bool { + if o != nil && !isNil(o.NetId) { + return true + } + + return false +} + +// SetNetId gets a reference to the given string and assigns it to the NetId field. +func (o *PeeringTrustRequest) SetNetId(v string) { + o.NetId = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *PeeringTrustRequest) GetPublicKey() string { + if o == nil || isNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringTrustRequest) GetPublicKeyOk() (*string, bool) { + if o == nil || isNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *PeeringTrustRequest) HasPublicKey() bool { + if o != nil && !isNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *PeeringTrustRequest) SetPublicKey(v string) { + o.PublicKey = &v +} + +func (o PeeringTrustRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.NetId) { + toSerialize["netId"] = o.NetId + } + if !isNil(o.PublicKey) { + toSerialize["publicKey"] = o.PublicKey + } + return json.Marshal(toSerialize) +} + +type NullablePeeringTrustRequest struct { + value *PeeringTrustRequest + isSet bool +} + +func (v NullablePeeringTrustRequest) Get() *PeeringTrustRequest { + return v.value +} + +func (v *NullablePeeringTrustRequest) Set(val *PeeringTrustRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePeeringTrustRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePeeringTrustRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePeeringTrustRequest(val *PeeringTrustRequest) *NullablePeeringTrustRequest { + return &NullablePeeringTrustRequest{value: val, isSet: true} +} + +func (v NullablePeeringTrustRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePeeringTrustRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_protocol_parameters.go b/client/model_protocol_parameters.go new file mode 100644 index 0000000000..58611d0e76 --- /dev/null +++ b/client/model_protocol_parameters.go @@ -0,0 +1,337 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ProtocolParameters struct for ProtocolParameters +type ProtocolParameters struct { + // The human readable network prefix + Bech32Hrp *string `json:"bech32Hrp,omitempty"` + // The networks max depth + BelowMaxDepth *int32 `json:"belowMaxDepth,omitempty"` + // The minimal PoW score + MinPowScore *int32 `json:"minPowScore,omitempty"` + // The network name + NetworkName *string `json:"networkName,omitempty"` + RentStructure *RentStructure `json:"rentStructure,omitempty"` + // The token supply + TokenSupply *string `json:"tokenSupply,omitempty"` + // The protocol version + Version *int32 `json:"version,omitempty"` +} + +// NewProtocolParameters instantiates a new ProtocolParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtocolParameters() *ProtocolParameters { + this := ProtocolParameters{} + return &this +} + +// NewProtocolParametersWithDefaults instantiates a new ProtocolParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtocolParametersWithDefaults() *ProtocolParameters { + this := ProtocolParameters{} + return &this +} + +// GetBech32Hrp returns the Bech32Hrp field value if set, zero value otherwise. +func (o *ProtocolParameters) GetBech32Hrp() string { + if o == nil || isNil(o.Bech32Hrp) { + var ret string + return ret + } + return *o.Bech32Hrp +} + +// GetBech32HrpOk returns a tuple with the Bech32Hrp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetBech32HrpOk() (*string, bool) { + if o == nil || isNil(o.Bech32Hrp) { + return nil, false + } + return o.Bech32Hrp, true +} + +// HasBech32Hrp returns a boolean if a field has been set. +func (o *ProtocolParameters) HasBech32Hrp() bool { + if o != nil && !isNil(o.Bech32Hrp) { + return true + } + + return false +} + +// SetBech32Hrp gets a reference to the given string and assigns it to the Bech32Hrp field. +func (o *ProtocolParameters) SetBech32Hrp(v string) { + o.Bech32Hrp = &v +} + +// GetBelowMaxDepth returns the BelowMaxDepth field value if set, zero value otherwise. +func (o *ProtocolParameters) GetBelowMaxDepth() int32 { + if o == nil || isNil(o.BelowMaxDepth) { + var ret int32 + return ret + } + return *o.BelowMaxDepth +} + +// GetBelowMaxDepthOk returns a tuple with the BelowMaxDepth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetBelowMaxDepthOk() (*int32, bool) { + if o == nil || isNil(o.BelowMaxDepth) { + return nil, false + } + return o.BelowMaxDepth, true +} + +// HasBelowMaxDepth returns a boolean if a field has been set. +func (o *ProtocolParameters) HasBelowMaxDepth() bool { + if o != nil && !isNil(o.BelowMaxDepth) { + return true + } + + return false +} + +// SetBelowMaxDepth gets a reference to the given int32 and assigns it to the BelowMaxDepth field. +func (o *ProtocolParameters) SetBelowMaxDepth(v int32) { + o.BelowMaxDepth = &v +} + +// GetMinPowScore returns the MinPowScore field value if set, zero value otherwise. +func (o *ProtocolParameters) GetMinPowScore() int32 { + if o == nil || isNil(o.MinPowScore) { + var ret int32 + return ret + } + return *o.MinPowScore +} + +// GetMinPowScoreOk returns a tuple with the MinPowScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetMinPowScoreOk() (*int32, bool) { + if o == nil || isNil(o.MinPowScore) { + return nil, false + } + return o.MinPowScore, true +} + +// HasMinPowScore returns a boolean if a field has been set. +func (o *ProtocolParameters) HasMinPowScore() bool { + if o != nil && !isNil(o.MinPowScore) { + return true + } + + return false +} + +// SetMinPowScore gets a reference to the given int32 and assigns it to the MinPowScore field. +func (o *ProtocolParameters) SetMinPowScore(v int32) { + o.MinPowScore = &v +} + +// GetNetworkName returns the NetworkName field value if set, zero value otherwise. +func (o *ProtocolParameters) GetNetworkName() string { + if o == nil || isNil(o.NetworkName) { + var ret string + return ret + } + return *o.NetworkName +} + +// GetNetworkNameOk returns a tuple with the NetworkName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetNetworkNameOk() (*string, bool) { + if o == nil || isNil(o.NetworkName) { + return nil, false + } + return o.NetworkName, true +} + +// HasNetworkName returns a boolean if a field has been set. +func (o *ProtocolParameters) HasNetworkName() bool { + if o != nil && !isNil(o.NetworkName) { + return true + } + + return false +} + +// SetNetworkName gets a reference to the given string and assigns it to the NetworkName field. +func (o *ProtocolParameters) SetNetworkName(v string) { + o.NetworkName = &v +} + +// GetRentStructure returns the RentStructure field value if set, zero value otherwise. +func (o *ProtocolParameters) GetRentStructure() RentStructure { + if o == nil || isNil(o.RentStructure) { + var ret RentStructure + return ret + } + return *o.RentStructure +} + +// GetRentStructureOk returns a tuple with the RentStructure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetRentStructureOk() (*RentStructure, bool) { + if o == nil || isNil(o.RentStructure) { + return nil, false + } + return o.RentStructure, true +} + +// HasRentStructure returns a boolean if a field has been set. +func (o *ProtocolParameters) HasRentStructure() bool { + if o != nil && !isNil(o.RentStructure) { + return true + } + + return false +} + +// SetRentStructure gets a reference to the given RentStructure and assigns it to the RentStructure field. +func (o *ProtocolParameters) SetRentStructure(v RentStructure) { + o.RentStructure = &v +} + +// GetTokenSupply returns the TokenSupply field value if set, zero value otherwise. +func (o *ProtocolParameters) GetTokenSupply() string { + if o == nil || isNil(o.TokenSupply) { + var ret string + return ret + } + return *o.TokenSupply +} + +// GetTokenSupplyOk returns a tuple with the TokenSupply field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetTokenSupplyOk() (*string, bool) { + if o == nil || isNil(o.TokenSupply) { + return nil, false + } + return o.TokenSupply, true +} + +// HasTokenSupply returns a boolean if a field has been set. +func (o *ProtocolParameters) HasTokenSupply() bool { + if o != nil && !isNil(o.TokenSupply) { + return true + } + + return false +} + +// SetTokenSupply gets a reference to the given string and assigns it to the TokenSupply field. +func (o *ProtocolParameters) SetTokenSupply(v string) { + o.TokenSupply = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ProtocolParameters) GetVersion() int32 { + if o == nil || isNil(o.Version) { + var ret int32 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetVersionOk() (*int32, bool) { + if o == nil || isNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ProtocolParameters) HasVersion() bool { + if o != nil && !isNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given int32 and assigns it to the Version field. +func (o *ProtocolParameters) SetVersion(v int32) { + o.Version = &v +} + +func (o ProtocolParameters) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Bech32Hrp) { + toSerialize["bech32Hrp"] = o.Bech32Hrp + } + if !isNil(o.BelowMaxDepth) { + toSerialize["belowMaxDepth"] = o.BelowMaxDepth + } + if !isNil(o.MinPowScore) { + toSerialize["minPowScore"] = o.MinPowScore + } + if !isNil(o.NetworkName) { + toSerialize["networkName"] = o.NetworkName + } + if !isNil(o.RentStructure) { + toSerialize["rentStructure"] = o.RentStructure + } + if !isNil(o.TokenSupply) { + toSerialize["tokenSupply"] = o.TokenSupply + } + if !isNil(o.Version) { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableProtocolParameters struct { + value *ProtocolParameters + isSet bool +} + +func (v NullableProtocolParameters) Get() *ProtocolParameters { + return v.value +} + +func (v *NullableProtocolParameters) Set(val *ProtocolParameters) { + v.value = val + v.isSet = true +} + +func (v NullableProtocolParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocolParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocolParameters(val *ProtocolParameters) *NullableProtocolParameters { + return &NullableProtocolParameters{value: val, isSet: true} +} + +func (v NullableProtocolParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocolParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_receipt_error.go b/client/model_receipt_error.go new file mode 100644 index 0000000000..097005693a --- /dev/null +++ b/client/model_receipt_error.go @@ -0,0 +1,295 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ReceiptError struct for ReceiptError +type ReceiptError struct { + ContractId *int32 `json:"contractId,omitempty"` + ErrorCode *string `json:"errorCode,omitempty"` + ErrorId *int32 `json:"errorId,omitempty"` + Message *string `json:"message,omitempty"` + MessageFormat *string `json:"messageFormat,omitempty"` + Parameters []string `json:"parameters,omitempty"` +} + +// NewReceiptError instantiates a new ReceiptError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReceiptError() *ReceiptError { + this := ReceiptError{} + return &this +} + +// NewReceiptErrorWithDefaults instantiates a new ReceiptError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReceiptErrorWithDefaults() *ReceiptError { + this := ReceiptError{} + return &this +} + +// GetContractId returns the ContractId field value if set, zero value otherwise. +func (o *ReceiptError) GetContractId() int32 { + if o == nil || isNil(o.ContractId) { + var ret int32 + return ret + } + return *o.ContractId +} + +// GetContractIdOk returns a tuple with the ContractId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetContractIdOk() (*int32, bool) { + if o == nil || isNil(o.ContractId) { + return nil, false + } + return o.ContractId, true +} + +// HasContractId returns a boolean if a field has been set. +func (o *ReceiptError) HasContractId() bool { + if o != nil && !isNil(o.ContractId) { + return true + } + + return false +} + +// SetContractId gets a reference to the given int32 and assigns it to the ContractId field. +func (o *ReceiptError) SetContractId(v int32) { + o.ContractId = &v +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *ReceiptError) GetErrorCode() string { + if o == nil || isNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetErrorCodeOk() (*string, bool) { + if o == nil || isNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *ReceiptError) HasErrorCode() bool { + if o != nil && !isNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *ReceiptError) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetErrorId returns the ErrorId field value if set, zero value otherwise. +func (o *ReceiptError) GetErrorId() int32 { + if o == nil || isNil(o.ErrorId) { + var ret int32 + return ret + } + return *o.ErrorId +} + +// GetErrorIdOk returns a tuple with the ErrorId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetErrorIdOk() (*int32, bool) { + if o == nil || isNil(o.ErrorId) { + return nil, false + } + return o.ErrorId, true +} + +// HasErrorId returns a boolean if a field has been set. +func (o *ReceiptError) HasErrorId() bool { + if o != nil && !isNil(o.ErrorId) { + return true + } + + return false +} + +// SetErrorId gets a reference to the given int32 and assigns it to the ErrorId field. +func (o *ReceiptError) SetErrorId(v int32) { + o.ErrorId = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ReceiptError) GetMessage() string { + if o == nil || isNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetMessageOk() (*string, bool) { + if o == nil || isNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ReceiptError) HasMessage() bool { + if o != nil && !isNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ReceiptError) SetMessage(v string) { + o.Message = &v +} + +// GetMessageFormat returns the MessageFormat field value if set, zero value otherwise. +func (o *ReceiptError) GetMessageFormat() string { + if o == nil || isNil(o.MessageFormat) { + var ret string + return ret + } + return *o.MessageFormat +} + +// GetMessageFormatOk returns a tuple with the MessageFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetMessageFormatOk() (*string, bool) { + if o == nil || isNil(o.MessageFormat) { + return nil, false + } + return o.MessageFormat, true +} + +// HasMessageFormat returns a boolean if a field has been set. +func (o *ReceiptError) HasMessageFormat() bool { + if o != nil && !isNil(o.MessageFormat) { + return true + } + + return false +} + +// SetMessageFormat gets a reference to the given string and assigns it to the MessageFormat field. +func (o *ReceiptError) SetMessageFormat(v string) { + o.MessageFormat = &v +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *ReceiptError) GetParameters() []string { + if o == nil || isNil(o.Parameters) { + var ret []string + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetParametersOk() ([]string, bool) { + if o == nil || isNil(o.Parameters) { + return nil, false + } + return o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *ReceiptError) HasParameters() bool { + if o != nil && !isNil(o.Parameters) { + return true + } + + return false +} + +// SetParameters gets a reference to the given []string and assigns it to the Parameters field. +func (o *ReceiptError) SetParameters(v []string) { + o.Parameters = v +} + +func (o ReceiptError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ContractId) { + toSerialize["contractId"] = o.ContractId + } + if !isNil(o.ErrorCode) { + toSerialize["errorCode"] = o.ErrorCode + } + if !isNil(o.ErrorId) { + toSerialize["errorId"] = o.ErrorId + } + if !isNil(o.Message) { + toSerialize["message"] = o.Message + } + if !isNil(o.MessageFormat) { + toSerialize["messageFormat"] = o.MessageFormat + } + if !isNil(o.Parameters) { + toSerialize["parameters"] = o.Parameters + } + return json.Marshal(toSerialize) +} + +type NullableReceiptError struct { + value *ReceiptError + isSet bool +} + +func (v NullableReceiptError) Get() *ReceiptError { + return v.value +} + +func (v *NullableReceiptError) Set(val *ReceiptError) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptError) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptError(val *ReceiptError) *NullableReceiptError { + return &NullableReceiptError{value: val, isSet: true} +} + +func (v NullableReceiptError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_receipt_response.go b/client/model_receipt_response.go new file mode 100644 index 0000000000..dbe61b3ec6 --- /dev/null +++ b/client/model_receipt_response.go @@ -0,0 +1,367 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ReceiptResponse struct for ReceiptResponse +type ReceiptResponse struct { + BlockIndex *int32 `json:"blockIndex,omitempty"` + Error *ReceiptError `json:"error,omitempty"` + GasBudget *int64 `json:"gasBudget,omitempty"` + GasBurnLog []BurnRecord `json:"gasBurnLog,omitempty"` + GasBurned *int64 `json:"gasBurned,omitempty"` + GasFeeCharged *int64 `json:"gasFeeCharged,omitempty"` + Request *string `json:"request,omitempty"` + RequestIndex *int32 `json:"requestIndex,omitempty"` +} + +// NewReceiptResponse instantiates a new ReceiptResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReceiptResponse() *ReceiptResponse { + this := ReceiptResponse{} + return &this +} + +// NewReceiptResponseWithDefaults instantiates a new ReceiptResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReceiptResponseWithDefaults() *ReceiptResponse { + this := ReceiptResponse{} + return &this +} + +// GetBlockIndex returns the BlockIndex field value if set, zero value otherwise. +func (o *ReceiptResponse) GetBlockIndex() int32 { + if o == nil || isNil(o.BlockIndex) { + var ret int32 + return ret + } + return *o.BlockIndex +} + +// GetBlockIndexOk returns a tuple with the BlockIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetBlockIndexOk() (*int32, bool) { + if o == nil || isNil(o.BlockIndex) { + return nil, false + } + return o.BlockIndex, true +} + +// HasBlockIndex returns a boolean if a field has been set. +func (o *ReceiptResponse) HasBlockIndex() bool { + if o != nil && !isNil(o.BlockIndex) { + return true + } + + return false +} + +// SetBlockIndex gets a reference to the given int32 and assigns it to the BlockIndex field. +func (o *ReceiptResponse) SetBlockIndex(v int32) { + o.BlockIndex = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ReceiptResponse) GetError() ReceiptError { + if o == nil || isNil(o.Error) { + var ret ReceiptError + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetErrorOk() (*ReceiptError, bool) { + if o == nil || isNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ReceiptResponse) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given ReceiptError and assigns it to the Error field. +func (o *ReceiptResponse) SetError(v ReceiptError) { + o.Error = &v +} + +// GetGasBudget returns the GasBudget field value if set, zero value otherwise. +func (o *ReceiptResponse) GetGasBudget() int64 { + if o == nil || isNil(o.GasBudget) { + var ret int64 + return ret + } + return *o.GasBudget +} + +// GetGasBudgetOk returns a tuple with the GasBudget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool) { + if o == nil || isNil(o.GasBudget) { + return nil, false + } + return o.GasBudget, true +} + +// HasGasBudget returns a boolean if a field has been set. +func (o *ReceiptResponse) HasGasBudget() bool { + if o != nil && !isNil(o.GasBudget) { + return true + } + + return false +} + +// SetGasBudget gets a reference to the given int64 and assigns it to the GasBudget field. +func (o *ReceiptResponse) SetGasBudget(v int64) { + o.GasBudget = &v +} + +// GetGasBurnLog returns the GasBurnLog field value if set, zero value otherwise. +func (o *ReceiptResponse) GetGasBurnLog() []BurnRecord { + if o == nil || isNil(o.GasBurnLog) { + var ret []BurnRecord + return ret + } + return o.GasBurnLog +} + +// GetGasBurnLogOk returns a tuple with the GasBurnLog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasBurnLogOk() ([]BurnRecord, bool) { + if o == nil || isNil(o.GasBurnLog) { + return nil, false + } + return o.GasBurnLog, true +} + +// HasGasBurnLog returns a boolean if a field has been set. +func (o *ReceiptResponse) HasGasBurnLog() bool { + if o != nil && !isNil(o.GasBurnLog) { + return true + } + + return false +} + +// SetGasBurnLog gets a reference to the given []BurnRecord and assigns it to the GasBurnLog field. +func (o *ReceiptResponse) SetGasBurnLog(v []BurnRecord) { + o.GasBurnLog = v +} + +// GetGasBurned returns the GasBurned field value if set, zero value otherwise. +func (o *ReceiptResponse) GetGasBurned() int64 { + if o == nil || isNil(o.GasBurned) { + var ret int64 + return ret + } + return *o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool) { + if o == nil || isNil(o.GasBurned) { + return nil, false + } + return o.GasBurned, true +} + +// HasGasBurned returns a boolean if a field has been set. +func (o *ReceiptResponse) HasGasBurned() bool { + if o != nil && !isNil(o.GasBurned) { + return true + } + + return false +} + +// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. +func (o *ReceiptResponse) SetGasBurned(v int64) { + o.GasBurned = &v +} + +// GetGasFeeCharged returns the GasFeeCharged field value if set, zero value otherwise. +func (o *ReceiptResponse) GetGasFeeCharged() int64 { + if o == nil || isNil(o.GasFeeCharged) { + var ret int64 + return ret + } + return *o.GasFeeCharged +} + +// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { + if o == nil || isNil(o.GasFeeCharged) { + return nil, false + } + return o.GasFeeCharged, true +} + +// HasGasFeeCharged returns a boolean if a field has been set. +func (o *ReceiptResponse) HasGasFeeCharged() bool { + if o != nil && !isNil(o.GasFeeCharged) { + return true + } + + return false +} + +// SetGasFeeCharged gets a reference to the given int64 and assigns it to the GasFeeCharged field. +func (o *ReceiptResponse) SetGasFeeCharged(v int64) { + o.GasFeeCharged = &v +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *ReceiptResponse) GetRequest() string { + if o == nil || isNil(o.Request) { + var ret string + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetRequestOk() (*string, bool) { + if o == nil || isNil(o.Request) { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *ReceiptResponse) HasRequest() bool { + if o != nil && !isNil(o.Request) { + return true + } + + return false +} + +// SetRequest gets a reference to the given string and assigns it to the Request field. +func (o *ReceiptResponse) SetRequest(v string) { + o.Request = &v +} + +// GetRequestIndex returns the RequestIndex field value if set, zero value otherwise. +func (o *ReceiptResponse) GetRequestIndex() int32 { + if o == nil || isNil(o.RequestIndex) { + var ret int32 + return ret + } + return *o.RequestIndex +} + +// GetRequestIndexOk returns a tuple with the RequestIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetRequestIndexOk() (*int32, bool) { + if o == nil || isNil(o.RequestIndex) { + return nil, false + } + return o.RequestIndex, true +} + +// HasRequestIndex returns a boolean if a field has been set. +func (o *ReceiptResponse) HasRequestIndex() bool { + if o != nil && !isNil(o.RequestIndex) { + return true + } + + return false +} + +// SetRequestIndex gets a reference to the given int32 and assigns it to the RequestIndex field. +func (o *ReceiptResponse) SetRequestIndex(v int32) { + o.RequestIndex = &v +} + +func (o ReceiptResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BlockIndex) { + toSerialize["blockIndex"] = o.BlockIndex + } + if !isNil(o.Error) { + toSerialize["error"] = o.Error + } + if !isNil(o.GasBudget) { + toSerialize["gasBudget"] = o.GasBudget + } + if !isNil(o.GasBurnLog) { + toSerialize["gasBurnLog"] = o.GasBurnLog + } + if !isNil(o.GasBurned) { + toSerialize["gasBurned"] = o.GasBurned + } + if !isNil(o.GasFeeCharged) { + toSerialize["gasFeeCharged"] = o.GasFeeCharged + } + if !isNil(o.Request) { + toSerialize["request"] = o.Request + } + if !isNil(o.RequestIndex) { + toSerialize["requestIndex"] = o.RequestIndex + } + return json.Marshal(toSerialize) +} + +type NullableReceiptResponse struct { + value *ReceiptResponse + isSet bool +} + +func (v NullableReceiptResponse) Get() *ReceiptResponse { + return v.value +} + +func (v *NullableReceiptResponse) Set(val *ReceiptResponse) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptResponse(val *ReceiptResponse) *NullableReceiptResponse { + return &NullableReceiptResponse{value: val, isSet: true} +} + +func (v NullableReceiptResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_rent_structure.go b/client/model_rent_structure.go new file mode 100644 index 0000000000..edc21a2413 --- /dev/null +++ b/client/model_rent_structure.go @@ -0,0 +1,190 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// RentStructure struct for RentStructure +type RentStructure struct { + // The virtual byte cost + VByteCost *int32 `json:"vByteCost,omitempty"` + // The virtual byte factor for data fields + VByteFactorData *int32 `json:"vByteFactorData,omitempty"` + // The virtual byte factor for key/lookup generating fields + VByteFactorKey *int32 `json:"vByteFactorKey,omitempty"` +} + +// NewRentStructure instantiates a new RentStructure object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRentStructure() *RentStructure { + this := RentStructure{} + return &this +} + +// NewRentStructureWithDefaults instantiates a new RentStructure object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRentStructureWithDefaults() *RentStructure { + this := RentStructure{} + return &this +} + +// GetVByteCost returns the VByteCost field value if set, zero value otherwise. +func (o *RentStructure) GetVByteCost() int32 { + if o == nil || isNil(o.VByteCost) { + var ret int32 + return ret + } + return *o.VByteCost +} + +// GetVByteCostOk returns a tuple with the VByteCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RentStructure) GetVByteCostOk() (*int32, bool) { + if o == nil || isNil(o.VByteCost) { + return nil, false + } + return o.VByteCost, true +} + +// HasVByteCost returns a boolean if a field has been set. +func (o *RentStructure) HasVByteCost() bool { + if o != nil && !isNil(o.VByteCost) { + return true + } + + return false +} + +// SetVByteCost gets a reference to the given int32 and assigns it to the VByteCost field. +func (o *RentStructure) SetVByteCost(v int32) { + o.VByteCost = &v +} + +// GetVByteFactorData returns the VByteFactorData field value if set, zero value otherwise. +func (o *RentStructure) GetVByteFactorData() int32 { + if o == nil || isNil(o.VByteFactorData) { + var ret int32 + return ret + } + return *o.VByteFactorData +} + +// GetVByteFactorDataOk returns a tuple with the VByteFactorData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool) { + if o == nil || isNil(o.VByteFactorData) { + return nil, false + } + return o.VByteFactorData, true +} + +// HasVByteFactorData returns a boolean if a field has been set. +func (o *RentStructure) HasVByteFactorData() bool { + if o != nil && !isNil(o.VByteFactorData) { + return true + } + + return false +} + +// SetVByteFactorData gets a reference to the given int32 and assigns it to the VByteFactorData field. +func (o *RentStructure) SetVByteFactorData(v int32) { + o.VByteFactorData = &v +} + +// GetVByteFactorKey returns the VByteFactorKey field value if set, zero value otherwise. +func (o *RentStructure) GetVByteFactorKey() int32 { + if o == nil || isNil(o.VByteFactorKey) { + var ret int32 + return ret + } + return *o.VByteFactorKey +} + +// GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool) { + if o == nil || isNil(o.VByteFactorKey) { + return nil, false + } + return o.VByteFactorKey, true +} + +// HasVByteFactorKey returns a boolean if a field has been set. +func (o *RentStructure) HasVByteFactorKey() bool { + if o != nil && !isNil(o.VByteFactorKey) { + return true + } + + return false +} + +// SetVByteFactorKey gets a reference to the given int32 and assigns it to the VByteFactorKey field. +func (o *RentStructure) SetVByteFactorKey(v int32) { + o.VByteFactorKey = &v +} + +func (o RentStructure) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.VByteCost) { + toSerialize["vByteCost"] = o.VByteCost + } + if !isNil(o.VByteFactorData) { + toSerialize["vByteFactorData"] = o.VByteFactorData + } + if !isNil(o.VByteFactorKey) { + toSerialize["vByteFactorKey"] = o.VByteFactorKey + } + return json.Marshal(toSerialize) +} + +type NullableRentStructure struct { + value *RentStructure + isSet bool +} + +func (v NullableRentStructure) Get() *RentStructure { + return v.value +} + +func (v *NullableRentStructure) Set(val *RentStructure) { + v.value = val + v.isSet = true +} + +func (v NullableRentStructure) IsSet() bool { + return v.isSet +} + +func (v *NullableRentStructure) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRentStructure(val *RentStructure) *NullableRentStructure { + return &NullableRentStructure{value: val, isSet: true} +} + +func (v NullableRentStructure) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRentStructure) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_request_detail.go b/client/model_request_detail.go new file mode 100644 index 0000000000..c0827f8ce4 --- /dev/null +++ b/client/model_request_detail.go @@ -0,0 +1,475 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// RequestDetail struct for RequestDetail +type RequestDetail struct { + Allowance *Allowance `json:"allowance,omitempty"` + CallTarget *CallTarget `json:"callTarget,omitempty"` + FungibleTokens *FungibleTokens `json:"fungibleTokens,omitempty"` + GasGudget *int64 `json:"gasGudget,omitempty"` + IsEVM *bool `json:"isEVM,omitempty"` + IsOffLedger *bool `json:"isOffLedger,omitempty"` + Nft *NFTDataResponse `json:"nft,omitempty"` + Params *JSONDict `json:"params,omitempty"` + RequestId *string `json:"requestId,omitempty"` + SenderAccount *string `json:"senderAccount,omitempty"` + TargetAddress *string `json:"targetAddress,omitempty"` +} + +// NewRequestDetail instantiates a new RequestDetail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestDetail() *RequestDetail { + this := RequestDetail{} + return &this +} + +// NewRequestDetailWithDefaults instantiates a new RequestDetail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestDetailWithDefaults() *RequestDetail { + this := RequestDetail{} + return &this +} + +// GetAllowance returns the Allowance field value if set, zero value otherwise. +func (o *RequestDetail) GetAllowance() Allowance { + if o == nil || isNil(o.Allowance) { + var ret Allowance + return ret + } + return *o.Allowance +} + +// GetAllowanceOk returns a tuple with the Allowance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool) { + if o == nil || isNil(o.Allowance) { + return nil, false + } + return o.Allowance, true +} + +// HasAllowance returns a boolean if a field has been set. +func (o *RequestDetail) HasAllowance() bool { + if o != nil && !isNil(o.Allowance) { + return true + } + + return false +} + +// SetAllowance gets a reference to the given Allowance and assigns it to the Allowance field. +func (o *RequestDetail) SetAllowance(v Allowance) { + o.Allowance = &v +} + +// GetCallTarget returns the CallTarget field value if set, zero value otherwise. +func (o *RequestDetail) GetCallTarget() CallTarget { + if o == nil || isNil(o.CallTarget) { + var ret CallTarget + return ret + } + return *o.CallTarget +} + +// GetCallTargetOk returns a tuple with the CallTarget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetCallTargetOk() (*CallTarget, bool) { + if o == nil || isNil(o.CallTarget) { + return nil, false + } + return o.CallTarget, true +} + +// HasCallTarget returns a boolean if a field has been set. +func (o *RequestDetail) HasCallTarget() bool { + if o != nil && !isNil(o.CallTarget) { + return true + } + + return false +} + +// SetCallTarget gets a reference to the given CallTarget and assigns it to the CallTarget field. +func (o *RequestDetail) SetCallTarget(v CallTarget) { + o.CallTarget = &v +} + +// GetFungibleTokens returns the FungibleTokens field value if set, zero value otherwise. +func (o *RequestDetail) GetFungibleTokens() FungibleTokens { + if o == nil || isNil(o.FungibleTokens) { + var ret FungibleTokens + return ret + } + return *o.FungibleTokens +} + +// GetFungibleTokensOk returns a tuple with the FungibleTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool) { + if o == nil || isNil(o.FungibleTokens) { + return nil, false + } + return o.FungibleTokens, true +} + +// HasFungibleTokens returns a boolean if a field has been set. +func (o *RequestDetail) HasFungibleTokens() bool { + if o != nil && !isNil(o.FungibleTokens) { + return true + } + + return false +} + +// SetFungibleTokens gets a reference to the given FungibleTokens and assigns it to the FungibleTokens field. +func (o *RequestDetail) SetFungibleTokens(v FungibleTokens) { + o.FungibleTokens = &v +} + +// GetGasGudget returns the GasGudget field value if set, zero value otherwise. +func (o *RequestDetail) GetGasGudget() int64 { + if o == nil || isNil(o.GasGudget) { + var ret int64 + return ret + } + return *o.GasGudget +} + +// GetGasGudgetOk returns a tuple with the GasGudget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetGasGudgetOk() (*int64, bool) { + if o == nil || isNil(o.GasGudget) { + return nil, false + } + return o.GasGudget, true +} + +// HasGasGudget returns a boolean if a field has been set. +func (o *RequestDetail) HasGasGudget() bool { + if o != nil && !isNil(o.GasGudget) { + return true + } + + return false +} + +// SetGasGudget gets a reference to the given int64 and assigns it to the GasGudget field. +func (o *RequestDetail) SetGasGudget(v int64) { + o.GasGudget = &v +} + +// GetIsEVM returns the IsEVM field value if set, zero value otherwise. +func (o *RequestDetail) GetIsEVM() bool { + if o == nil || isNil(o.IsEVM) { + var ret bool + return ret + } + return *o.IsEVM +} + +// GetIsEVMOk returns a tuple with the IsEVM field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetIsEVMOk() (*bool, bool) { + if o == nil || isNil(o.IsEVM) { + return nil, false + } + return o.IsEVM, true +} + +// HasIsEVM returns a boolean if a field has been set. +func (o *RequestDetail) HasIsEVM() bool { + if o != nil && !isNil(o.IsEVM) { + return true + } + + return false +} + +// SetIsEVM gets a reference to the given bool and assigns it to the IsEVM field. +func (o *RequestDetail) SetIsEVM(v bool) { + o.IsEVM = &v +} + +// GetIsOffLedger returns the IsOffLedger field value if set, zero value otherwise. +func (o *RequestDetail) GetIsOffLedger() bool { + if o == nil || isNil(o.IsOffLedger) { + var ret bool + return ret + } + return *o.IsOffLedger +} + +// GetIsOffLedgerOk returns a tuple with the IsOffLedger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetIsOffLedgerOk() (*bool, bool) { + if o == nil || isNil(o.IsOffLedger) { + return nil, false + } + return o.IsOffLedger, true +} + +// HasIsOffLedger returns a boolean if a field has been set. +func (o *RequestDetail) HasIsOffLedger() bool { + if o != nil && !isNil(o.IsOffLedger) { + return true + } + + return false +} + +// SetIsOffLedger gets a reference to the given bool and assigns it to the IsOffLedger field. +func (o *RequestDetail) SetIsOffLedger(v bool) { + o.IsOffLedger = &v +} + +// GetNft returns the Nft field value if set, zero value otherwise. +func (o *RequestDetail) GetNft() NFTDataResponse { + if o == nil || isNil(o.Nft) { + var ret NFTDataResponse + return ret + } + return *o.Nft +} + +// GetNftOk returns a tuple with the Nft field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetNftOk() (*NFTDataResponse, bool) { + if o == nil || isNil(o.Nft) { + return nil, false + } + return o.Nft, true +} + +// HasNft returns a boolean if a field has been set. +func (o *RequestDetail) HasNft() bool { + if o != nil && !isNil(o.Nft) { + return true + } + + return false +} + +// SetNft gets a reference to the given NFTDataResponse and assigns it to the Nft field. +func (o *RequestDetail) SetNft(v NFTDataResponse) { + o.Nft = &v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *RequestDetail) GetParams() JSONDict { + if o == nil || isNil(o.Params) { + var ret JSONDict + return ret + } + return *o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetParamsOk() (*JSONDict, bool) { + if o == nil || isNil(o.Params) { + return nil, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *RequestDetail) HasParams() bool { + if o != nil && !isNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given JSONDict and assigns it to the Params field. +func (o *RequestDetail) SetParams(v JSONDict) { + o.Params = &v +} + +// GetRequestId returns the RequestId field value if set, zero value otherwise. +func (o *RequestDetail) GetRequestId() string { + if o == nil || isNil(o.RequestId) { + var ret string + return ret + } + return *o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetRequestIdOk() (*string, bool) { + if o == nil || isNil(o.RequestId) { + return nil, false + } + return o.RequestId, true +} + +// HasRequestId returns a boolean if a field has been set. +func (o *RequestDetail) HasRequestId() bool { + if o != nil && !isNil(o.RequestId) { + return true + } + + return false +} + +// SetRequestId gets a reference to the given string and assigns it to the RequestId field. +func (o *RequestDetail) SetRequestId(v string) { + o.RequestId = &v +} + +// GetSenderAccount returns the SenderAccount field value if set, zero value otherwise. +func (o *RequestDetail) GetSenderAccount() string { + if o == nil || isNil(o.SenderAccount) { + var ret string + return ret + } + return *o.SenderAccount +} + +// GetSenderAccountOk returns a tuple with the SenderAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetSenderAccountOk() (*string, bool) { + if o == nil || isNil(o.SenderAccount) { + return nil, false + } + return o.SenderAccount, true +} + +// HasSenderAccount returns a boolean if a field has been set. +func (o *RequestDetail) HasSenderAccount() bool { + if o != nil && !isNil(o.SenderAccount) { + return true + } + + return false +} + +// SetSenderAccount gets a reference to the given string and assigns it to the SenderAccount field. +func (o *RequestDetail) SetSenderAccount(v string) { + o.SenderAccount = &v +} + +// GetTargetAddress returns the TargetAddress field value if set, zero value otherwise. +func (o *RequestDetail) GetTargetAddress() string { + if o == nil || isNil(o.TargetAddress) { + var ret string + return ret + } + return *o.TargetAddress +} + +// GetTargetAddressOk returns a tuple with the TargetAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetTargetAddressOk() (*string, bool) { + if o == nil || isNil(o.TargetAddress) { + return nil, false + } + return o.TargetAddress, true +} + +// HasTargetAddress returns a boolean if a field has been set. +func (o *RequestDetail) HasTargetAddress() bool { + if o != nil && !isNil(o.TargetAddress) { + return true + } + + return false +} + +// SetTargetAddress gets a reference to the given string and assigns it to the TargetAddress field. +func (o *RequestDetail) SetTargetAddress(v string) { + o.TargetAddress = &v +} + +func (o RequestDetail) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Allowance) { + toSerialize["allowance"] = o.Allowance + } + if !isNil(o.CallTarget) { + toSerialize["callTarget"] = o.CallTarget + } + if !isNil(o.FungibleTokens) { + toSerialize["fungibleTokens"] = o.FungibleTokens + } + if !isNil(o.GasGudget) { + toSerialize["gasGudget"] = o.GasGudget + } + if !isNil(o.IsEVM) { + toSerialize["isEVM"] = o.IsEVM + } + if !isNil(o.IsOffLedger) { + toSerialize["isOffLedger"] = o.IsOffLedger + } + if !isNil(o.Nft) { + toSerialize["nft"] = o.Nft + } + if !isNil(o.Params) { + toSerialize["params"] = o.Params + } + if !isNil(o.RequestId) { + toSerialize["requestId"] = o.RequestId + } + if !isNil(o.SenderAccount) { + toSerialize["senderAccount"] = o.SenderAccount + } + if !isNil(o.TargetAddress) { + toSerialize["targetAddress"] = o.TargetAddress + } + return json.Marshal(toSerialize) +} + +type NullableRequestDetail struct { + value *RequestDetail + isSet bool +} + +func (v NullableRequestDetail) Get() *RequestDetail { + return v.value +} + +func (v *NullableRequestDetail) Set(val *RequestDetail) { + v.value = val + v.isSet = true +} + +func (v NullableRequestDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestDetail(val *RequestDetail) *NullableRequestDetail { + return &NullableRequestDetail{value: val, isSet: true} +} + +func (v NullableRequestDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_request_ids_response.go b/client/model_request_ids_response.go new file mode 100644 index 0000000000..fbafa774ae --- /dev/null +++ b/client/model_request_ids_response.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// RequestIDsResponse struct for RequestIDsResponse +type RequestIDsResponse struct { + RequestIds []string `json:"requestIds,omitempty"` +} + +// NewRequestIDsResponse instantiates a new RequestIDsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestIDsResponse() *RequestIDsResponse { + this := RequestIDsResponse{} + return &this +} + +// NewRequestIDsResponseWithDefaults instantiates a new RequestIDsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestIDsResponseWithDefaults() *RequestIDsResponse { + this := RequestIDsResponse{} + return &this +} + +// GetRequestIds returns the RequestIds field value if set, zero value otherwise. +func (o *RequestIDsResponse) GetRequestIds() []string { + if o == nil || isNil(o.RequestIds) { + var ret []string + return ret + } + return o.RequestIds +} + +// GetRequestIdsOk returns a tuple with the RequestIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestIDsResponse) GetRequestIdsOk() ([]string, bool) { + if o == nil || isNil(o.RequestIds) { + return nil, false + } + return o.RequestIds, true +} + +// HasRequestIds returns a boolean if a field has been set. +func (o *RequestIDsResponse) HasRequestIds() bool { + if o != nil && !isNil(o.RequestIds) { + return true + } + + return false +} + +// SetRequestIds gets a reference to the given []string and assigns it to the RequestIds field. +func (o *RequestIDsResponse) SetRequestIds(v []string) { + o.RequestIds = v +} + +func (o RequestIDsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.RequestIds) { + toSerialize["requestIds"] = o.RequestIds + } + return json.Marshal(toSerialize) +} + +type NullableRequestIDsResponse struct { + value *RequestIDsResponse + isSet bool +} + +func (v NullableRequestIDsResponse) Get() *RequestIDsResponse { + return v.value +} + +func (v *NullableRequestIDsResponse) Set(val *RequestIDsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestIDsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestIDsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestIDsResponse(val *RequestIDsResponse) *NullableRequestIDsResponse { + return &NullableRequestIDsResponse{value: val, isSet: true} +} + +func (v NullableRequestIDsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestIDsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_request_processed_response.go b/client/model_request_processed_response.go new file mode 100644 index 0000000000..cd11b94dac --- /dev/null +++ b/client/model_request_processed_response.go @@ -0,0 +1,187 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// RequestProcessedResponse struct for RequestProcessedResponse +type RequestProcessedResponse struct { + ChainId *string `json:"chainId,omitempty"` + IsProcessed *bool `json:"isProcessed,omitempty"` + RequestId *string `json:"requestId,omitempty"` +} + +// NewRequestProcessedResponse instantiates a new RequestProcessedResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestProcessedResponse() *RequestProcessedResponse { + this := RequestProcessedResponse{} + return &this +} + +// NewRequestProcessedResponseWithDefaults instantiates a new RequestProcessedResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestProcessedResponseWithDefaults() *RequestProcessedResponse { + this := RequestProcessedResponse{} + return &this +} + +// GetChainId returns the ChainId field value if set, zero value otherwise. +func (o *RequestProcessedResponse) GetChainId() string { + if o == nil || isNil(o.ChainId) { + var ret string + return ret + } + return *o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestProcessedResponse) GetChainIdOk() (*string, bool) { + if o == nil || isNil(o.ChainId) { + return nil, false + } + return o.ChainId, true +} + +// HasChainId returns a boolean if a field has been set. +func (o *RequestProcessedResponse) HasChainId() bool { + if o != nil && !isNil(o.ChainId) { + return true + } + + return false +} + +// SetChainId gets a reference to the given string and assigns it to the ChainId field. +func (o *RequestProcessedResponse) SetChainId(v string) { + o.ChainId = &v +} + +// GetIsProcessed returns the IsProcessed field value if set, zero value otherwise. +func (o *RequestProcessedResponse) GetIsProcessed() bool { + if o == nil || isNil(o.IsProcessed) { + var ret bool + return ret + } + return *o.IsProcessed +} + +// GetIsProcessedOk returns a tuple with the IsProcessed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestProcessedResponse) GetIsProcessedOk() (*bool, bool) { + if o == nil || isNil(o.IsProcessed) { + return nil, false + } + return o.IsProcessed, true +} + +// HasIsProcessed returns a boolean if a field has been set. +func (o *RequestProcessedResponse) HasIsProcessed() bool { + if o != nil && !isNil(o.IsProcessed) { + return true + } + + return false +} + +// SetIsProcessed gets a reference to the given bool and assigns it to the IsProcessed field. +func (o *RequestProcessedResponse) SetIsProcessed(v bool) { + o.IsProcessed = &v +} + +// GetRequestId returns the RequestId field value if set, zero value otherwise. +func (o *RequestProcessedResponse) GetRequestId() string { + if o == nil || isNil(o.RequestId) { + var ret string + return ret + } + return *o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestProcessedResponse) GetRequestIdOk() (*string, bool) { + if o == nil || isNil(o.RequestId) { + return nil, false + } + return o.RequestId, true +} + +// HasRequestId returns a boolean if a field has been set. +func (o *RequestProcessedResponse) HasRequestId() bool { + if o != nil && !isNil(o.RequestId) { + return true + } + + return false +} + +// SetRequestId gets a reference to the given string and assigns it to the RequestId field. +func (o *RequestProcessedResponse) SetRequestId(v string) { + o.RequestId = &v +} + +func (o RequestProcessedResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ChainId) { + toSerialize["chainId"] = o.ChainId + } + if !isNil(o.IsProcessed) { + toSerialize["isProcessed"] = o.IsProcessed + } + if !isNil(o.RequestId) { + toSerialize["requestId"] = o.RequestId + } + return json.Marshal(toSerialize) +} + +type NullableRequestProcessedResponse struct { + value *RequestProcessedResponse + isSet bool +} + +func (v NullableRequestProcessedResponse) Get() *RequestProcessedResponse { + return v.value +} + +func (v *NullableRequestProcessedResponse) Set(val *RequestProcessedResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestProcessedResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestProcessedResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestProcessedResponse(val *RequestProcessedResponse) *NullableRequestProcessedResponse { + return &NullableRequestProcessedResponse{value: val, isSet: true} +} + +func (v NullableRequestProcessedResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestProcessedResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_request_receipt_response.go b/client/model_request_receipt_response.go new file mode 100644 index 0000000000..dc63955cba --- /dev/null +++ b/client/model_request_receipt_response.go @@ -0,0 +1,367 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// RequestReceiptResponse struct for RequestReceiptResponse +type RequestReceiptResponse struct { + BlockIndex *int32 `json:"blockIndex,omitempty"` + Error *BlockReceiptError `json:"error,omitempty"` + GasBudget *int64 `json:"gasBudget,omitempty"` + GasBurnLog *BurnLog `json:"gasBurnLog,omitempty"` + GasBurned *int64 `json:"gasBurned,omitempty"` + GasFeeCharged *int64 `json:"gasFeeCharged,omitempty"` + Request *RequestDetail `json:"request,omitempty"` + RequestIndex *int32 `json:"requestIndex,omitempty"` +} + +// NewRequestReceiptResponse instantiates a new RequestReceiptResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestReceiptResponse() *RequestReceiptResponse { + this := RequestReceiptResponse{} + return &this +} + +// NewRequestReceiptResponseWithDefaults instantiates a new RequestReceiptResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestReceiptResponseWithDefaults() *RequestReceiptResponse { + this := RequestReceiptResponse{} + return &this +} + +// GetBlockIndex returns the BlockIndex field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetBlockIndex() int32 { + if o == nil || isNil(o.BlockIndex) { + var ret int32 + return ret + } + return *o.BlockIndex +} + +// GetBlockIndexOk returns a tuple with the BlockIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetBlockIndexOk() (*int32, bool) { + if o == nil || isNil(o.BlockIndex) { + return nil, false + } + return o.BlockIndex, true +} + +// HasBlockIndex returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasBlockIndex() bool { + if o != nil && !isNil(o.BlockIndex) { + return true + } + + return false +} + +// SetBlockIndex gets a reference to the given int32 and assigns it to the BlockIndex field. +func (o *RequestReceiptResponse) SetBlockIndex(v int32) { + o.BlockIndex = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetError() BlockReceiptError { + if o == nil || isNil(o.Error) { + var ret BlockReceiptError + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetErrorOk() (*BlockReceiptError, bool) { + if o == nil || isNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given BlockReceiptError and assigns it to the Error field. +func (o *RequestReceiptResponse) SetError(v BlockReceiptError) { + o.Error = &v +} + +// GetGasBudget returns the GasBudget field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetGasBudget() int64 { + if o == nil || isNil(o.GasBudget) { + var ret int64 + return ret + } + return *o.GasBudget +} + +// GetGasBudgetOk returns a tuple with the GasBudget field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool) { + if o == nil || isNil(o.GasBudget) { + return nil, false + } + return o.GasBudget, true +} + +// HasGasBudget returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasGasBudget() bool { + if o != nil && !isNil(o.GasBudget) { + return true + } + + return false +} + +// SetGasBudget gets a reference to the given int64 and assigns it to the GasBudget field. +func (o *RequestReceiptResponse) SetGasBudget(v int64) { + o.GasBudget = &v +} + +// GetGasBurnLog returns the GasBurnLog field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetGasBurnLog() BurnLog { + if o == nil || isNil(o.GasBurnLog) { + var ret BurnLog + return ret + } + return *o.GasBurnLog +} + +// GetGasBurnLogOk returns a tuple with the GasBurnLog field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasBurnLogOk() (*BurnLog, bool) { + if o == nil || isNil(o.GasBurnLog) { + return nil, false + } + return o.GasBurnLog, true +} + +// HasGasBurnLog returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasGasBurnLog() bool { + if o != nil && !isNil(o.GasBurnLog) { + return true + } + + return false +} + +// SetGasBurnLog gets a reference to the given BurnLog and assigns it to the GasBurnLog field. +func (o *RequestReceiptResponse) SetGasBurnLog(v BurnLog) { + o.GasBurnLog = &v +} + +// GetGasBurned returns the GasBurned field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetGasBurned() int64 { + if o == nil || isNil(o.GasBurned) { + var ret int64 + return ret + } + return *o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool) { + if o == nil || isNil(o.GasBurned) { + return nil, false + } + return o.GasBurned, true +} + +// HasGasBurned returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasGasBurned() bool { + if o != nil && !isNil(o.GasBurned) { + return true + } + + return false +} + +// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. +func (o *RequestReceiptResponse) SetGasBurned(v int64) { + o.GasBurned = &v +} + +// GetGasFeeCharged returns the GasFeeCharged field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetGasFeeCharged() int64 { + if o == nil || isNil(o.GasFeeCharged) { + var ret int64 + return ret + } + return *o.GasFeeCharged +} + +// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { + if o == nil || isNil(o.GasFeeCharged) { + return nil, false + } + return o.GasFeeCharged, true +} + +// HasGasFeeCharged returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasGasFeeCharged() bool { + if o != nil && !isNil(o.GasFeeCharged) { + return true + } + + return false +} + +// SetGasFeeCharged gets a reference to the given int64 and assigns it to the GasFeeCharged field. +func (o *RequestReceiptResponse) SetGasFeeCharged(v int64) { + o.GasFeeCharged = &v +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetRequest() RequestDetail { + if o == nil || isNil(o.Request) { + var ret RequestDetail + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetRequestOk() (*RequestDetail, bool) { + if o == nil || isNil(o.Request) { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasRequest() bool { + if o != nil && !isNil(o.Request) { + return true + } + + return false +} + +// SetRequest gets a reference to the given RequestDetail and assigns it to the Request field. +func (o *RequestReceiptResponse) SetRequest(v RequestDetail) { + o.Request = &v +} + +// GetRequestIndex returns the RequestIndex field value if set, zero value otherwise. +func (o *RequestReceiptResponse) GetRequestIndex() int32 { + if o == nil || isNil(o.RequestIndex) { + var ret int32 + return ret + } + return *o.RequestIndex +} + +// GetRequestIndexOk returns a tuple with the RequestIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetRequestIndexOk() (*int32, bool) { + if o == nil || isNil(o.RequestIndex) { + return nil, false + } + return o.RequestIndex, true +} + +// HasRequestIndex returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasRequestIndex() bool { + if o != nil && !isNil(o.RequestIndex) { + return true + } + + return false +} + +// SetRequestIndex gets a reference to the given int32 and assigns it to the RequestIndex field. +func (o *RequestReceiptResponse) SetRequestIndex(v int32) { + o.RequestIndex = &v +} + +func (o RequestReceiptResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.BlockIndex) { + toSerialize["blockIndex"] = o.BlockIndex + } + if !isNil(o.Error) { + toSerialize["error"] = o.Error + } + if !isNil(o.GasBudget) { + toSerialize["gasBudget"] = o.GasBudget + } + if !isNil(o.GasBurnLog) { + toSerialize["gasBurnLog"] = o.GasBurnLog + } + if !isNil(o.GasBurned) { + toSerialize["gasBurned"] = o.GasBurned + } + if !isNil(o.GasFeeCharged) { + toSerialize["gasFeeCharged"] = o.GasFeeCharged + } + if !isNil(o.Request) { + toSerialize["request"] = o.Request + } + if !isNil(o.RequestIndex) { + toSerialize["requestIndex"] = o.RequestIndex + } + return json.Marshal(toSerialize) +} + +type NullableRequestReceiptResponse struct { + value *RequestReceiptResponse + isSet bool +} + +func (v NullableRequestReceiptResponse) Get() *RequestReceiptResponse { + return v.value +} + +func (v *NullableRequestReceiptResponse) Set(val *RequestReceiptResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestReceiptResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestReceiptResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestReceiptResponse(val *RequestReceiptResponse) *NullableRequestReceiptResponse { + return &NullableRequestReceiptResponse{value: val, isSet: true} +} + +func (v NullableRequestReceiptResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestReceiptResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_transaction.go b/client/model_transaction.go new file mode 100644 index 0000000000..ab13a31001 --- /dev/null +++ b/client/model_transaction.go @@ -0,0 +1,116 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// Transaction struct for Transaction +type Transaction struct { + // The transaction ID + TxId *string `json:"txId,omitempty"` +} + +// NewTransaction instantiates a new Transaction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransaction() *Transaction { + this := Transaction{} + return &this +} + +// NewTransactionWithDefaults instantiates a new Transaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionWithDefaults() *Transaction { + this := Transaction{} + return &this +} + +// GetTxId returns the TxId field value if set, zero value otherwise. +func (o *Transaction) GetTxId() string { + if o == nil || isNil(o.TxId) { + var ret string + return ret + } + return *o.TxId +} + +// GetTxIdOk returns a tuple with the TxId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Transaction) GetTxIdOk() (*string, bool) { + if o == nil || isNil(o.TxId) { + return nil, false + } + return o.TxId, true +} + +// HasTxId returns a boolean if a field has been set. +func (o *Transaction) HasTxId() bool { + if o != nil && !isNil(o.TxId) { + return true + } + + return false +} + +// SetTxId gets a reference to the given string and assigns it to the TxId field. +func (o *Transaction) SetTxId(v string) { + o.TxId = &v +} + +func (o Transaction) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.TxId) { + toSerialize["txId"] = o.TxId + } + return json.Marshal(toSerialize) +} + +type NullableTransaction struct { + value *Transaction + isSet bool +} + +func (v NullableTransaction) Get() *Transaction { + return v.value +} + +func (v *NullableTransaction) Set(val *Transaction) { + v.value = val + v.isSet = true +} + +func (v NullableTransaction) IsSet() bool { + return v.isSet +} + +func (v *NullableTransaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransaction(val *Transaction) *NullableTransaction { + return &NullableTransaction{value: val, isSet: true} +} + +func (v NullableTransaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_transaction_id_metric_item.go b/client/model_transaction_id_metric_item.go new file mode 100644 index 0000000000..e9a09f7ea3 --- /dev/null +++ b/client/model_transaction_id_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// TransactionIDMetricItem struct for TransactionIDMetricItem +type TransactionIDMetricItem struct { + LastMessage *Transaction `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewTransactionIDMetricItem instantiates a new TransactionIDMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionIDMetricItem() *TransactionIDMetricItem { + this := TransactionIDMetricItem{} + return &this +} + +// NewTransactionIDMetricItemWithDefaults instantiates a new TransactionIDMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionIDMetricItemWithDefaults() *TransactionIDMetricItem { + this := TransactionIDMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *TransactionIDMetricItem) GetLastMessage() Transaction { + if o == nil || isNil(o.LastMessage) { + var ret Transaction + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionIDMetricItem) GetLastMessageOk() (*Transaction, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *TransactionIDMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given Transaction and assigns it to the LastMessage field. +func (o *TransactionIDMetricItem) SetLastMessage(v Transaction) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *TransactionIDMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionIDMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *TransactionIDMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *TransactionIDMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *TransactionIDMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionIDMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *TransactionIDMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *TransactionIDMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o TransactionIDMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableTransactionIDMetricItem struct { + value *TransactionIDMetricItem + isSet bool +} + +func (v NullableTransactionIDMetricItem) Get() *TransactionIDMetricItem { + return v.value +} + +func (v *NullableTransactionIDMetricItem) Set(val *TransactionIDMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionIDMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionIDMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionIDMetricItem(val *TransactionIDMetricItem) *NullableTransactionIDMetricItem { + return &NullableTransactionIDMetricItem{value: val, isSet: true} +} + +func (v NullableTransactionIDMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionIDMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_transaction_metric_item.go b/client/model_transaction_metric_item.go new file mode 100644 index 0000000000..7e01b952b7 --- /dev/null +++ b/client/model_transaction_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// TransactionMetricItem struct for TransactionMetricItem +type TransactionMetricItem struct { + LastMessage *Transaction `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewTransactionMetricItem instantiates a new TransactionMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionMetricItem() *TransactionMetricItem { + this := TransactionMetricItem{} + return &this +} + +// NewTransactionMetricItemWithDefaults instantiates a new TransactionMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionMetricItemWithDefaults() *TransactionMetricItem { + this := TransactionMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *TransactionMetricItem) GetLastMessage() Transaction { + if o == nil || isNil(o.LastMessage) { + var ret Transaction + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionMetricItem) GetLastMessageOk() (*Transaction, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *TransactionMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given Transaction and assigns it to the LastMessage field. +func (o *TransactionMetricItem) SetLastMessage(v Transaction) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *TransactionMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *TransactionMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *TransactionMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *TransactionMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *TransactionMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *TransactionMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o TransactionMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableTransactionMetricItem struct { + value *TransactionMetricItem + isSet bool +} + +func (v NullableTransactionMetricItem) Get() *TransactionMetricItem { + return v.value +} + +func (v *NullableTransactionMetricItem) Set(val *TransactionMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionMetricItem(val *TransactionMetricItem) *NullableTransactionMetricItem { + return &NullableTransactionMetricItem{value: val, isSet: true} +} + +func (v NullableTransactionMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_tx_inclusion_state_msg.go b/client/model_tx_inclusion_state_msg.go new file mode 100644 index 0000000000..0465d6b25c --- /dev/null +++ b/client/model_tx_inclusion_state_msg.go @@ -0,0 +1,153 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// TxInclusionStateMsg struct for TxInclusionStateMsg +type TxInclusionStateMsg struct { + // The inclusion state + State *string `json:"state,omitempty"` + // The transaction ID + TxId *string `json:"txId,omitempty"` +} + +// NewTxInclusionStateMsg instantiates a new TxInclusionStateMsg object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTxInclusionStateMsg() *TxInclusionStateMsg { + this := TxInclusionStateMsg{} + return &this +} + +// NewTxInclusionStateMsgWithDefaults instantiates a new TxInclusionStateMsg object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTxInclusionStateMsgWithDefaults() *TxInclusionStateMsg { + this := TxInclusionStateMsg{} + return &this +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *TxInclusionStateMsg) GetState() string { + if o == nil || isNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TxInclusionStateMsg) GetStateOk() (*string, bool) { + if o == nil || isNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *TxInclusionStateMsg) HasState() bool { + if o != nil && !isNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *TxInclusionStateMsg) SetState(v string) { + o.State = &v +} + +// GetTxId returns the TxId field value if set, zero value otherwise. +func (o *TxInclusionStateMsg) GetTxId() string { + if o == nil || isNil(o.TxId) { + var ret string + return ret + } + return *o.TxId +} + +// GetTxIdOk returns a tuple with the TxId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TxInclusionStateMsg) GetTxIdOk() (*string, bool) { + if o == nil || isNil(o.TxId) { + return nil, false + } + return o.TxId, true +} + +// HasTxId returns a boolean if a field has been set. +func (o *TxInclusionStateMsg) HasTxId() bool { + if o != nil && !isNil(o.TxId) { + return true + } + + return false +} + +// SetTxId gets a reference to the given string and assigns it to the TxId field. +func (o *TxInclusionStateMsg) SetTxId(v string) { + o.TxId = &v +} + +func (o TxInclusionStateMsg) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.State) { + toSerialize["state"] = o.State + } + if !isNil(o.TxId) { + toSerialize["txId"] = o.TxId + } + return json.Marshal(toSerialize) +} + +type NullableTxInclusionStateMsg struct { + value *TxInclusionStateMsg + isSet bool +} + +func (v NullableTxInclusionStateMsg) Get() *TxInclusionStateMsg { + return v.value +} + +func (v *NullableTxInclusionStateMsg) Set(val *TxInclusionStateMsg) { + v.value = val + v.isSet = true +} + +func (v NullableTxInclusionStateMsg) IsSet() bool { + return v.isSet +} + +func (v *NullableTxInclusionStateMsg) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTxInclusionStateMsg(val *TxInclusionStateMsg) *NullableTxInclusionStateMsg { + return &NullableTxInclusionStateMsg{value: val, isSet: true} +} + +func (v NullableTxInclusionStateMsg) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTxInclusionStateMsg) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_tx_inclusion_state_msg_metric_item.go b/client/model_tx_inclusion_state_msg_metric_item.go new file mode 100644 index 0000000000..fbb9b70241 --- /dev/null +++ b/client/model_tx_inclusion_state_msg_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// TxInclusionStateMsgMetricItem struct for TxInclusionStateMsgMetricItem +type TxInclusionStateMsgMetricItem struct { + LastMessage *TxInclusionStateMsg `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewTxInclusionStateMsgMetricItem instantiates a new TxInclusionStateMsgMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTxInclusionStateMsgMetricItem() *TxInclusionStateMsgMetricItem { + this := TxInclusionStateMsgMetricItem{} + return &this +} + +// NewTxInclusionStateMsgMetricItemWithDefaults instantiates a new TxInclusionStateMsgMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTxInclusionStateMsgMetricItemWithDefaults() *TxInclusionStateMsgMetricItem { + this := TxInclusionStateMsgMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *TxInclusionStateMsgMetricItem) GetLastMessage() TxInclusionStateMsg { + if o == nil || isNil(o.LastMessage) { + var ret TxInclusionStateMsg + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TxInclusionStateMsgMetricItem) GetLastMessageOk() (*TxInclusionStateMsg, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *TxInclusionStateMsgMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given TxInclusionStateMsg and assigns it to the LastMessage field. +func (o *TxInclusionStateMsgMetricItem) SetLastMessage(v TxInclusionStateMsg) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *TxInclusionStateMsgMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TxInclusionStateMsgMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *TxInclusionStateMsgMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *TxInclusionStateMsgMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *TxInclusionStateMsgMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TxInclusionStateMsgMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *TxInclusionStateMsgMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *TxInclusionStateMsgMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o TxInclusionStateMsgMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableTxInclusionStateMsgMetricItem struct { + value *TxInclusionStateMsgMetricItem + isSet bool +} + +func (v NullableTxInclusionStateMsgMetricItem) Get() *TxInclusionStateMsgMetricItem { + return v.value +} + +func (v *NullableTxInclusionStateMsgMetricItem) Set(val *TxInclusionStateMsgMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableTxInclusionStateMsgMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableTxInclusionStateMsgMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTxInclusionStateMsgMetricItem(val *TxInclusionStateMsgMetricItem) *NullableTxInclusionStateMsgMetricItem { + return &NullableTxInclusionStateMsgMetricItem{value: val, isSet: true} +} + +func (v NullableTxInclusionStateMsgMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTxInclusionStateMsgMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_update_user_password_request.go b/client/model_update_user_password_request.go new file mode 100644 index 0000000000..9bd4f5149c --- /dev/null +++ b/client/model_update_user_password_request.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// UpdateUserPasswordRequest struct for UpdateUserPasswordRequest +type UpdateUserPasswordRequest struct { + Password *string `json:"password,omitempty"` +} + +// NewUpdateUserPasswordRequest instantiates a new UpdateUserPasswordRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserPasswordRequest() *UpdateUserPasswordRequest { + this := UpdateUserPasswordRequest{} + return &this +} + +// NewUpdateUserPasswordRequestWithDefaults instantiates a new UpdateUserPasswordRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserPasswordRequestWithDefaults() *UpdateUserPasswordRequest { + this := UpdateUserPasswordRequest{} + return &this +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UpdateUserPasswordRequest) GetPassword() string { + if o == nil || isNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPasswordRequest) GetPasswordOk() (*string, bool) { + if o == nil || isNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *UpdateUserPasswordRequest) HasPassword() bool { + if o != nil && !isNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *UpdateUserPasswordRequest) SetPassword(v string) { + o.Password = &v +} + +func (o UpdateUserPasswordRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Password) { + toSerialize["password"] = o.Password + } + return json.Marshal(toSerialize) +} + +type NullableUpdateUserPasswordRequest struct { + value *UpdateUserPasswordRequest + isSet bool +} + +func (v NullableUpdateUserPasswordRequest) Get() *UpdateUserPasswordRequest { + return v.value +} + +func (v *NullableUpdateUserPasswordRequest) Set(val *UpdateUserPasswordRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPasswordRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPasswordRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPasswordRequest(val *UpdateUserPasswordRequest) *NullableUpdateUserPasswordRequest { + return &NullableUpdateUserPasswordRequest{value: val, isSet: true} +} + +func (v NullableUpdateUserPasswordRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPasswordRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_update_user_permissions_request.go b/client/model_update_user_permissions_request.go new file mode 100644 index 0000000000..2c0de446f6 --- /dev/null +++ b/client/model_update_user_permissions_request.go @@ -0,0 +1,115 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// UpdateUserPermissionsRequest struct for UpdateUserPermissionsRequest +type UpdateUserPermissionsRequest struct { + Permissions []string `json:"permissions,omitempty"` +} + +// NewUpdateUserPermissionsRequest instantiates a new UpdateUserPermissionsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateUserPermissionsRequest() *UpdateUserPermissionsRequest { + this := UpdateUserPermissionsRequest{} + return &this +} + +// NewUpdateUserPermissionsRequestWithDefaults instantiates a new UpdateUserPermissionsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateUserPermissionsRequestWithDefaults() *UpdateUserPermissionsRequest { + this := UpdateUserPermissionsRequest{} + return &this +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *UpdateUserPermissionsRequest) GetPermissions() []string { + if o == nil || isNil(o.Permissions) { + var ret []string + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateUserPermissionsRequest) GetPermissionsOk() ([]string, bool) { + if o == nil || isNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *UpdateUserPermissionsRequest) HasPermissions() bool { + if o != nil && !isNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +func (o *UpdateUserPermissionsRequest) SetPermissions(v []string) { + o.Permissions = v +} + +func (o UpdateUserPermissionsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + return json.Marshal(toSerialize) +} + +type NullableUpdateUserPermissionsRequest struct { + value *UpdateUserPermissionsRequest + isSet bool +} + +func (v NullableUpdateUserPermissionsRequest) Get() *UpdateUserPermissionsRequest { + return v.value +} + +func (v *NullableUpdateUserPermissionsRequest) Set(val *UpdateUserPermissionsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateUserPermissionsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateUserPermissionsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateUserPermissionsRequest(val *UpdateUserPermissionsRequest) *NullableUpdateUserPermissionsRequest { + return &NullableUpdateUserPermissionsRequest{value: val, isSet: true} +} + +func (v NullableUpdateUserPermissionsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateUserPermissionsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_user.go b/client/model_user.go new file mode 100644 index 0000000000..0b60ab662c --- /dev/null +++ b/client/model_user.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// User struct for User +type User struct { + Permissions []string `json:"permissions,omitempty"` + Username *string `json:"username,omitempty"` +} + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *User) GetPermissions() []string { + if o == nil || isNil(o.Permissions) { + var ret []string + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPermissionsOk() ([]string, bool) { + if o == nil || isNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *User) HasPermissions() bool { + if o != nil && !isNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +func (o *User) SetPermissions(v []string) { + o.Permissions = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || isNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || isNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && !isNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + if !isNil(o.Username) { + toSerialize["username"] = o.Username + } + return json.Marshal(toSerialize) +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_utxo_input_metric_item.go b/client/model_utxo_input_metric_item.go new file mode 100644 index 0000000000..3a6b043d81 --- /dev/null +++ b/client/model_utxo_input_metric_item.go @@ -0,0 +1,188 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// UTXOInputMetricItem struct for UTXOInputMetricItem +type UTXOInputMetricItem struct { + LastMessage *OutputID `json:"lastMessage,omitempty"` + Messages *int32 `json:"messages,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +// NewUTXOInputMetricItem instantiates a new UTXOInputMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUTXOInputMetricItem() *UTXOInputMetricItem { + this := UTXOInputMetricItem{} + return &this +} + +// NewUTXOInputMetricItemWithDefaults instantiates a new UTXOInputMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUTXOInputMetricItemWithDefaults() *UTXOInputMetricItem { + this := UTXOInputMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *UTXOInputMetricItem) GetLastMessage() OutputID { + if o == nil || isNil(o.LastMessage) { + var ret OutputID + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UTXOInputMetricItem) GetLastMessageOk() (*OutputID, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *UTXOInputMetricItem) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given OutputID and assigns it to the LastMessage field. +func (o *UTXOInputMetricItem) SetLastMessage(v OutputID) { + o.LastMessage = &v +} + +// GetMessages returns the Messages field value if set, zero value otherwise. +func (o *UTXOInputMetricItem) GetMessages() int32 { + if o == nil || isNil(o.Messages) { + var ret int32 + return ret + } + return *o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UTXOInputMetricItem) GetMessagesOk() (*int32, bool) { + if o == nil || isNil(o.Messages) { + return nil, false + } + return o.Messages, true +} + +// HasMessages returns a boolean if a field has been set. +func (o *UTXOInputMetricItem) HasMessages() bool { + if o != nil && !isNil(o.Messages) { + return true + } + + return false +} + +// SetMessages gets a reference to the given int32 and assigns it to the Messages field. +func (o *UTXOInputMetricItem) SetMessages(v int32) { + o.Messages = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *UTXOInputMetricItem) GetTimestamp() time.Time { + if o == nil || isNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UTXOInputMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *UTXOInputMetricItem) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *UTXOInputMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o UTXOInputMetricItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Messages) { + toSerialize["messages"] = o.Messages + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return json.Marshal(toSerialize) +} + +type NullableUTXOInputMetricItem struct { + value *UTXOInputMetricItem + isSet bool +} + +func (v NullableUTXOInputMetricItem) Get() *UTXOInputMetricItem { + return v.value +} + +func (v *NullableUTXOInputMetricItem) Set(val *UTXOInputMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableUTXOInputMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableUTXOInputMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUTXOInputMetricItem(val *UTXOInputMetricItem) *NullableUTXOInputMetricItem { + return &NullableUTXOInputMetricItem{value: val, isSet: true} +} + +func (v NullableUTXOInputMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUTXOInputMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_validation_error.go b/client/model_validation_error.go new file mode 100644 index 0000000000..3953b0ec23 --- /dev/null +++ b/client/model_validation_error.go @@ -0,0 +1,151 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ValidationError struct for ValidationError +type ValidationError struct { + Error *string `json:"Error,omitempty"` + MissingPermission *string `json:"MissingPermission,omitempty"` +} + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError() *ValidationError { + this := ValidationError{} + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ValidationError) GetError() string { + if o == nil || isNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetErrorOk() (*string, bool) { + if o == nil || isNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ValidationError) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *ValidationError) SetError(v string) { + o.Error = &v +} + +// GetMissingPermission returns the MissingPermission field value if set, zero value otherwise. +func (o *ValidationError) GetMissingPermission() string { + if o == nil || isNil(o.MissingPermission) { + var ret string + return ret + } + return *o.MissingPermission +} + +// GetMissingPermissionOk returns a tuple with the MissingPermission field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetMissingPermissionOk() (*string, bool) { + if o == nil || isNil(o.MissingPermission) { + return nil, false + } + return o.MissingPermission, true +} + +// HasMissingPermission returns a boolean if a field has been set. +func (o *ValidationError) HasMissingPermission() bool { + if o != nil && !isNil(o.MissingPermission) { + return true + } + + return false +} + +// SetMissingPermission gets a reference to the given string and assigns it to the MissingPermission field. +func (o *ValidationError) SetMissingPermission(v string) { + o.MissingPermission = &v +} + +func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Error) { + toSerialize["Error"] = o.Error + } + if !isNil(o.MissingPermission) { + toSerialize["MissingPermission"] = o.MissingPermission + } + return json.Marshal(toSerialize) +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/multiclient/activate.go b/client/multiclient/activate.go deleted file mode 100644 index 5f68a8efc8..0000000000 --- a/client/multiclient/activate.go +++ /dev/null @@ -1,20 +0,0 @@ -package multiclient - -import ( - "github.com/iotaledger/wasp/client" - "github.com/iotaledger/wasp/packages/isc" -) - -// ActivateChain sends a request to activate a chain in all wasp nodes -func (m *MultiClient) ActivateChain(chainID isc.ChainID) error { - return m.Do(func(i int, w *client.WaspClient) error { - return w.ActivateChain(chainID) - }) -} - -// DeactivateChain sends a request to deactivate a chain in all wasp nodes -func (m *MultiClient) DeactivateChain(chainID isc.ChainID) error { - return m.Do(func(i int, w *client.WaspClient) error { - return w.DeactivateChain(chainID) - }) -} diff --git a/client/multiclient/chain_record.go b/client/multiclient/chain_record.go deleted file mode 100644 index d2c2d34eb5..0000000000 --- a/client/multiclient/chain_record.go +++ /dev/null @@ -1,13 +0,0 @@ -package multiclient - -import ( - "github.com/iotaledger/wasp/client" - "github.com/iotaledger/wasp/packages/registry" -) - -// PutChainRecord calls PutChainRecord in all wasp nodes -func (m *MultiClient) PutChainRecord(bd *registry.ChainRecord) error { - return m.Do(func(i int, w *client.WaspClient) error { - return w.PutChainRecord(bd) - }) -} diff --git a/client/multiclient/dkshares.go b/client/multiclient/dkshares.go deleted file mode 100644 index 58edd024e3..0000000000 --- a/client/multiclient/dkshares.go +++ /dev/null @@ -1,18 +0,0 @@ -package multiclient - -import ( - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client" - "github.com/iotaledger/wasp/packages/webapi/v1/model" -) - -// DKSharesGet retrieves distributed key info with specific ChainID from multiple hosts. -func (m *MultiClient) DKSharesGet(sharedAddress iotago.Address) ([]*model.DKSharesInfo, error) { - ret := make([]*model.DKSharesInfo, len(m.nodes)) - err := m.Do(func(i int, w *client.WaspClient) error { - k, err := w.DKSharesGet(sharedAddress) - ret[i] = k - return err - }) - return ret, err -} diff --git a/client/multiclient/multiclient.go b/client/multiclient/multiclient.go deleted file mode 100644 index e5943ec85a..0000000000 --- a/client/multiclient/multiclient.go +++ /dev/null @@ -1,67 +0,0 @@ -package multiclient - -import ( - "net/http" - "time" - - "github.com/iotaledger/wasp/client" - "github.com/iotaledger/wasp/packages/util/multicall" -) - -// MultiClient allows to send webapi requests in parallel to multiple wasp nodes -type MultiClient struct { - nodes []*client.WaspClient - - Timeout time.Duration -} - -// New creates a new instance of MultiClient -func New(hosts []string, httpClient ...func() http.Client) *MultiClient { - m := &MultiClient{ - nodes: make([]*client.WaspClient, len(hosts)), - } - for i, host := range hosts { - if len(httpClient) > 0 { - m.nodes[i] = client.NewWaspClient(host, httpClient[0]()) - } else { - m.nodes[i] = client.NewWaspClient(host) - } - } - m.Timeout = 30 * time.Second - return m -} - -func (m *MultiClient) WithToken(token string) *MultiClient { - for _, v := range m.nodes { - v.WithToken(token) - } - - return m -} - -func (m *MultiClient) WithLogFunc(logFunc func(msg string, args ...interface{})) *MultiClient { - for i, node := range m.nodes { - m.nodes[i] = node.WithLogFunc(logFunc) - } - return m -} - -func (m *MultiClient) Len() int { - return len(m.nodes) -} - -// Do executes a callback once for each node in parallel, then wraps all error results into a single one -func (m *MultiClient) Do(f func(int, *client.WaspClient) error) error { - return m.DoWithQuorum(f, len(m.nodes)) -} - -// Do executes a callback once for each node in parallel, then wraps all error results into a single one -func (m *MultiClient) DoWithQuorum(f func(int, *client.WaspClient) error, quorum int) error { - funs := make([]func() error, len(m.nodes)) - for i := range m.nodes { - j := i // duplicate variable for closure - funs[j] = func() error { return f(j, m.nodes[j]) } - } - errs := multicall.MultiCall(funs, m.Timeout) - return multicall.WrapErrorsWithQuorum(errs, quorum) -} diff --git a/client/multiclient/reqstatus.go b/client/multiclient/reqstatus.go deleted file mode 100644 index 5fe06ccaf7..0000000000 --- a/client/multiclient/reqstatus.go +++ /dev/null @@ -1,70 +0,0 @@ -package multiclient - -import ( - "fmt" - "time" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client" - "github.com/iotaledger/wasp/packages/isc" -) - -// WaitUntilRequestProcessed blocks until the request has been processed by all nodes -func (m *MultiClient) WaitUntilRequestProcessed(chainID isc.ChainID, reqID isc.RequestID, timeout time.Duration) (*isc.Receipt, error) { - oldTimeout := m.Timeout - defer func() { m.Timeout = oldTimeout }() - - m.Timeout = timeout - - var receipt *isc.Receipt - var err error - err = m.Do(func(i int, w *client.WaspClient) error { - receipt, err = w.WaitUntilRequestProcessed(chainID, reqID, timeout) - return err - }) - return receipt, err -} - -// WaitUntilRequestProcessedSuccessfully is similar to WaitUntilRequestProcessed, -// but also checks the receipt and return an error if the request was processed with an error -func (m *MultiClient) WaitUntilRequestProcessedSuccessfully(chainID isc.ChainID, reqID isc.RequestID, timeout time.Duration) (*isc.Receipt, error) { - receipt, err := m.WaitUntilRequestProcessed(chainID, reqID, timeout) - if err != nil { - return receipt, err - } - if receipt.ResolvedError != "" { - return receipt, fmt.Errorf("request processed with an error: %s", receipt.ResolvedError) - } - return receipt, nil -} - -// WaitUntilAllRequestsProcessed blocks until all requests in the given transaction have been processed -// by all nodes -func (m *MultiClient) WaitUntilAllRequestsProcessed(chainID isc.ChainID, tx *iotago.Transaction, timeout time.Duration) ([]*isc.Receipt, error) { - oldTimeout := m.Timeout - defer func() { m.Timeout = oldTimeout }() - - m.Timeout = timeout - var receipts []*isc.Receipt - var err error - err = m.Do(func(i int, w *client.WaspClient) error { - receipts, err = w.WaitUntilAllRequestsProcessed(chainID, tx, timeout) - return err - }) - return receipts, err -} - -// WaitUntilAllRequestsProcessedSuccessfully is similar to WaitUntilAllRequestsProcessed -// but also checks the receipts and return an error if any of the requests was processed with an error -func (m *MultiClient) WaitUntilAllRequestsProcessedSuccessfully(chainID isc.ChainID, tx *iotago.Transaction, timeout time.Duration) ([]*isc.Receipt, error) { - receipts, err := m.WaitUntilAllRequestsProcessed(chainID, tx, timeout) - if err != nil { - return receipts, err - } - for i, receipt := range receipts { - if receipt.ResolvedError != "" { - return receipts, fmt.Errorf("error found on receipt #%d: %s", i, receipt.ResolvedError) - } - } - return receipts, nil -} diff --git a/client/node_ownership.go b/client/node_ownership.go deleted file mode 100644 index e36aeb2be9..0000000000 --- a/client/node_ownership.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package client - -import ( - "net/http" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func (c *WaspClient) NodeOwnershipCertificate(nodePubKey *cryptolib.PublicKey, ownerAddress iotago.Address) (governance.NodeOwnershipCertificate, error) { - req := model.NodeOwnerCertificateRequest{ - NodePubKey: model.NewBytes(nodePubKey.AsBytes()), - OwnerAddress: model.NewAddress(ownerAddress), - } - res := model.NodeOwnerCertificateResponse{} - if err := c.do(http.MethodPost, routes.AdmNodeOwnerCertificate(), req, &res); err != nil { - return nil, err - } - return governance.NewNodeOwnershipCertificateFromBytes(res.Certificate.Bytes()), nil -} diff --git a/client/offledger.go b/client/offledger.go deleted file mode 100644 index 109e049ee6..0000000000 --- a/client/offledger.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func (c *WaspClient) PostOffLedgerRequest(chainID isc.ChainID, req isc.OffLedgerRequest) error { - data := model.OffLedgerRequestBody{ - Request: model.NewBytes(req.Bytes()), - } - return c.do(http.MethodPost, routes.NewRequest(chainID.String()), data, nil) -} diff --git a/client/peering.go b/client/peering.go deleted file mode 100644 index 47955d124a..0000000000 --- a/client/peering.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func (c *WaspClient) GetPeeringSelf() (*model.PeeringTrustedNode, error) { - var response *model.PeeringTrustedNode - err := c.do(http.MethodGet, routes.PeeringSelfGet(), nil, &response) - return response, err -} - -func (c *WaspClient) GetPeeringTrustedList() ([]*model.PeeringTrustedNode, error) { - var response []*model.PeeringTrustedNode - err := c.do(http.MethodGet, routes.PeeringTrustedList(), nil, &response) - return response, err -} - -func (c *WaspClient) GetPeeringTrusted(pubKey string) (*model.PeeringTrustedNode, error) { - var response *model.PeeringTrustedNode - err := c.do(http.MethodGet, routes.PeeringTrustedGet(pubKey), nil, &response) - return response, err -} - -func (c *WaspClient) PutPeeringTrusted(pubKey, netID string) (*model.PeeringTrustedNode, error) { - request := model.PeeringTrustedNode{ - PubKey: pubKey, - NetID: netID, - } - var response model.PeeringTrustedNode - err := c.do(http.MethodPut, routes.PeeringTrustedPut(pubKey), request, &response) - return &response, err -} - -func (c *WaspClient) PostPeeringTrusted(pubKey, netID string) (*model.PeeringTrustedNode, error) { - request := model.PeeringTrustedNode{ - PubKey: pubKey, - NetID: netID, - } - var response model.PeeringTrustedNode - err := c.do(http.MethodPost, routes.PeeringTrustedPost(), request, &response) - return &response, err -} - -func (c *WaspClient) DeletePeeringTrusted(pubKey string) error { - err := c.do(http.MethodDelete, routes.PeeringTrustedDelete(pubKey), nil, nil) - return err -} diff --git a/client/reqstatus.go b/client/reqstatus.go deleted file mode 100644 index 095815adfb..0000000000 --- a/client/reqstatus.go +++ /dev/null @@ -1,85 +0,0 @@ -package client - -import ( - "encoding/json" - "net/http" - "time" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// RequestReceipt fetches the processing status of a request. -func (c *WaspClient) RequestReceipt(chainID isc.ChainID, reqID isc.RequestID) (*isc.Receipt, error) { - var res model.RequestReceiptResponse - if err := c.do(http.MethodGet, routes.RequestReceipt(chainID.String(), reqID.String()), nil, &res); err != nil { - return nil, err - } - if res.Receipt == "" { - return nil, nil - } - var receipt isc.Receipt - err := json.Unmarshal([]byte(res.Receipt), &receipt) - if err != nil { - return nil, err - } - return &receipt, nil -} - -const waitRequestProcessedDefaultTimeout = 30 * time.Second - -// WaitUntilRequestProcessed blocks until the request has been processed by the node -func (c *WaspClient) WaitUntilRequestProcessed(chainID isc.ChainID, reqID isc.RequestID, timeout time.Duration) (*isc.Receipt, error) { - now := time.Now() - if timeout == 0 { - timeout = waitRequestProcessedDefaultTimeout - } - var res model.RequestReceiptResponse - err := c.do( - http.MethodGet, - routes.WaitRequestProcessed(chainID.String(), reqID.String()), - &model.WaitRequestProcessedParams{Timeout: timeout}, - &res, - ) - if err != nil { - c.log("WaitUntilRequestProcessed, chainID=%v, reqID=%v failed in %v with: %v", chainID, reqID, time.Since(now), err) - return nil, err - } - var receipt isc.Receipt - err = json.Unmarshal([]byte(res.Receipt), &receipt) - if err != nil { - c.log("WaitUntilRequestProcessed, chainID=%v, reqID=%v failed in %v with: %v", chainID, reqID, time.Since(now), err) - return nil, err - } - c.log("WaitUntilRequestProcessed, chainID=%v, reqID=%v done in %v", chainID, reqID, time.Since(now)) - return &receipt, nil -} - -// WaitUntilAllRequestsProcessed blocks until all requests in the given transaction have been processed -// by the node -func (c *WaspClient) WaitUntilAllRequestsProcessed(chainID isc.ChainID, tx *iotago.Transaction, timeout time.Duration) ([]*isc.Receipt, error) { - now := time.Now() - txID, err := tx.ID() - if err != nil { - c.log("WaitUntilAllRequestsProcessed, chainID=%v, tx=? failed in %v with: %v", chainID, time.Since(now), err) - return nil, err - } - reqs, err := isc.RequestsInTransaction(tx) - if err != nil { - c.log("WaitUntilAllRequestsProcessed, chainID=%v, tx=%v failed in %v with: %v", chainID, txID.ToHex(), time.Since(now), err) - return nil, err - } - ret := make([]*isc.Receipt, len(reqs)) - for i, req := range reqs[chainID] { - receipt, err := c.WaitUntilRequestProcessed(chainID, req.ID(), timeout) - if err != nil { - c.log("WaitUntilAllRequestsProcessed, chainID=%v, tx=%v failed in %v with: %v", chainID, txID.ToHex(), time.Since(now), err) - return nil, err - } - ret[i] = receipt - } - c.log("WaitUntilAllRequestsProcessed, chainID=%v, tx=%v done in %v", chainID, txID.ToHex(), time.Since(now)) - return ret, nil -} diff --git a/client/response.go b/client/response.go new file mode 100644 index 0000000000..3d38eb042b --- /dev/null +++ b/client/response.go @@ -0,0 +1,47 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/client/scclient/callview.go b/client/scclient/callview.go deleted file mode 100644 index 42993803ca..0000000000 --- a/client/scclient/callview.go +++ /dev/null @@ -1,9 +0,0 @@ -package scclient - -import ( - "github.com/iotaledger/wasp/packages/kv/dict" -) - -func (c *SCClient) CallView(functionName string, args dict.Dict) (dict.Dict, error) { - return c.ChainClient.CallView(c.ContractHname, functionName, args) -} diff --git a/client/scclient/postrequest.go b/client/scclient/postrequest.go deleted file mode 100644 index ed33010783..0000000000 --- a/client/scclient/postrequest.go +++ /dev/null @@ -1,19 +0,0 @@ -package scclient - -import ( - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/packages/isc" -) - -func (c *SCClient) PostRequest(fname string, params ...chainclient.PostRequestParams) (*iotago.Transaction, error) { - return c.ChainClient.Post1Request(c.ContractHname, isc.Hn(fname), params...) -} - -func (c *SCClient) PostNRequests(fname string, n int, params ...chainclient.PostRequestParams) ([]*iotago.Transaction, error) { - return c.ChainClient.PostNRequests(c.ContractHname, isc.Hn(fname), n, params...) -} - -func (c *SCClient) PostOffLedgerRequest(fname string, params ...chainclient.PostRequestParams) (isc.OffLedgerRequest, error) { - return c.ChainClient.PostOffLedgerRequest(c.ContractHname, isc.Hn(fname), params...) -} diff --git a/client/scclient/scclient.go b/client/scclient/scclient.go deleted file mode 100644 index 26b9219b11..0000000000 --- a/client/scclient/scclient.go +++ /dev/null @@ -1,23 +0,0 @@ -package scclient - -import ( - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/packages/isc" -) - -// SCClient allows to send webapi requests targeted to a specific contract -type SCClient struct { - ChainClient *chainclient.Client - ContractHname isc.Hname -} - -// New creates a new SCClient -func New( - chainClient *chainclient.Client, - contractHname isc.Hname, -) *SCClient { - return &SCClient{ - ChainClient: chainClient, - ContractHname: contractHname, - } -} diff --git a/client/scclient/stateget.go b/client/scclient/stateget.go deleted file mode 100644 index 666bc943dd..0000000000 --- a/client/scclient/stateget.go +++ /dev/null @@ -1,6 +0,0 @@ -package scclient - -// StateGet fetches the raw value associated with the given key in the smart contract state -func (c *SCClient) StateGet(key string) ([]byte, error) { - return c.ChainClient.StateGet(string(c.ContractHname.Bytes()) + key) -} diff --git a/client/shutdown.go b/client/shutdown.go deleted file mode 100644 index 54f97c04f0..0000000000 --- a/client/shutdown.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -import ( - "net/http" - - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// Shutdown shuts down the node -func (c *WaspClient) Shutdown() error { - return c.do(http.MethodGet, routes.Shutdown(), nil, nil) -} diff --git a/client/stateget.go b/client/stateget.go deleted file mode 100644 index a278034bf4..0000000000 --- a/client/stateget.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -import ( - "net/http" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -// StateGet fetches the raw value associated with the given key in the chain state -func (c *WaspClient) StateGet(chainID isc.ChainID, key string) ([]byte, error) { - var res []byte - if err := c.do(http.MethodGet, routes.StateGet(chainID.String(), iotago.EncodeHex([]byte(key))), nil, &res); err != nil { - return nil, err - } - return res, nil -} diff --git a/client/test/api_chains_test.go b/client/test/api_chains_test.go new file mode 100644 index 0000000000..d697cbedb6 --- /dev/null +++ b/client/test/api_chains_test.go @@ -0,0 +1,181 @@ +/* +Wasp API + +Testing ChainsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "./openapi" +) + +func Test_openapi_ChainsApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ChainsApiService ActivateChain", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.ChainsApi.ActivateChain(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService AddAccessNode", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var publicKey string + + resp, httpRes, err := apiClient.ChainsApi.AddAccessNode(context.Background(), chainID, publicKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService AttachToWebsocket", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.ChainsApi.AttachToWebsocket(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService DeactivateChain", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.ChainsApi.DeactivateChain(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService GetChainInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.ChainsApi.GetChainInfo(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService GetChains", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ChainsApi.GetChains(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService GetCommitteeInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.ChainsApi.GetCommitteeInfo(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService GetContracts", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.ChainsApi.GetContracts(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService GetRequestIDFromEVMTransactionID", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var txHash string + + resp, httpRes, err := apiClient.ChainsApi.GetRequestIDFromEVMTransactionID(context.Background(), chainID, txHash).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService GetStateValue", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var stateKey string + + resp, httpRes, err := apiClient.ChainsApi.GetStateValue(context.Background(), chainID, stateKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ChainsApiService RemoveAccessNode", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var publicKey string + + resp, httpRes, err := apiClient.ChainsApi.RemoveAccessNode(context.Background(), chainID, publicKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/client/test/api_corecontracts_test.go b/client/test/api_corecontracts_test.go new file mode 100644 index 0000000000..52e422d514 --- /dev/null +++ b/client/test/api_corecontracts_test.go @@ -0,0 +1,407 @@ +/* +Wasp API + +Testing CorecontractsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "./openapi" +) + +func Test_openapi_CorecontractsApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test CorecontractsApiService AccountsGetAccountBalance", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var agentID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID, agentID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetAccountNFTIDs", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var agentID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNFTIDs(context.Background(), chainID, agentID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetAccountNonce", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var agentID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNonce(context.Background(), chainID, agentID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetAccounts", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetFoundryOutput", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var chainID2 string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, chainID2).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetNFTData", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var nftID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNFTData(context.Background(), chainID, nftID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetNativeTokenIDRegistry", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNativeTokenIDRegistry(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService AccountsGetTotalAssets", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetTotalAssets(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlobsGetAllBlobs", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetAllBlobs(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlobsGetBlobInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var blobHash string + + resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobInfo(context.Background(), chainID, blobHash).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlobsGetBlobValue", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var blobHash string + var fieldKey string + + resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobValue(context.Background(), chainID, blobHash, fieldKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetBlockInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var blockIndex int32 + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetBlockInfo(context.Background(), chainID, blockIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetControlAddresses", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetControlAddresses(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetEventsOfBlock", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var blockIndex int32 + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfBlock(context.Background(), chainID, blockIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetEventsOfContract", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var contractHname string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfContract(context.Background(), chainID, contractHname).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetEventsOfLatestBlock", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetEventsOfRequest", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var requestID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfRequest(context.Background(), chainID, requestID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetLatestBlockInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForBlock", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var blockIndex int32 + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForBlock(context.Background(), chainID, blockIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForLatestBlock", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForLatestBlock(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetRequestIsProcessed", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var requestID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIsProcessed(context.Background(), chainID, requestID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetRequestReceipt", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var requestID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceipt(context.Background(), chainID, requestID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfBlock", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var blockIndex int32 + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), chainID, blockIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfLatestBlock", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService ErrorsGetErrorMessageFormat", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var contractHname string + var errorID string + + resp, httpRes, err := apiClient.CorecontractsApi.ErrorsGetErrorMessageFormat(context.Background(), chainID, contractHname, errorID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test CorecontractsApiService GovernanceGetChainInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.CorecontractsApi.GovernanceGetChainInfo(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/client/test/api_metrics_test.go b/client/test/api_metrics_test.go new file mode 100644 index 0000000000..1c5cf72d9e --- /dev/null +++ b/client/test/api_metrics_test.go @@ -0,0 +1,79 @@ +/* +Wasp API + +Testing MetricsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "./openapi" +) + +func Test_openapi_MetricsApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test MetricsApiService GetChainMetrics", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.MetricsApi.GetChainMetrics(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test MetricsApiService GetChainPipeMetrics", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.MetricsApi.GetChainPipeMetrics(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test MetricsApiService GetChainWorkflowMetrics", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.MetricsApi.GetChainWorkflowMetrics(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test MetricsApiService GetL1Metrics", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MetricsApi.GetL1Metrics(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/client/test/api_node_test.go b/client/test/api_node_test.go new file mode 100644 index 0000000000..c8c63278f4 --- /dev/null +++ b/client/test/api_node_test.go @@ -0,0 +1,171 @@ +/* +Wasp API + +Testing NodeApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "./openapi" +) + +func Test_openapi_NodeApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test NodeApiService DistrustPeer", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.DistrustPeer(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GenerateDKS", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GenerateDKS(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetAllPeers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GetAllPeers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetConfiguration", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GetConfiguration(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetDKSInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var sharedAddress string + + resp, httpRes, err := apiClient.NodeApi.GetDKSInfo(context.Background(), sharedAddress).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GetInfo(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetPeeringIdentity", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetTrustedPeers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GetTrustedPeers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService GetVersion", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.GetVersion(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService SetNodeOwner", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.SetNodeOwner(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService ShutdownNode", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.ShutdownNode(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodeApiService TrustPeer", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodeApi.TrustPeer(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/client/test/api_requests_test.go b/client/test/api_requests_test.go new file mode 100644 index 0000000000..babcd723f3 --- /dev/null +++ b/client/test/api_requests_test.go @@ -0,0 +1,79 @@ +/* +Wasp API + +Testing RequestsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "./openapi" +) + +func Test_openapi_RequestsApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test RequestsApiService CallView", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RequestsApi.CallView(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RequestsApiService GetReceipt", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var requestID string + + resp, httpRes, err := apiClient.RequestsApi.GetReceipt(context.Background(), chainID, requestID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RequestsApiService OffLedger", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RequestsApi.OffLedger(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RequestsApiService WaitForTransaction", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var requestID string + + resp, httpRes, err := apiClient.RequestsApi.WaitForTransaction(context.Background(), chainID, requestID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/client/test/api_users_test.go b/client/test/api_users_test.go new file mode 100644 index 0000000000..f6d31e327f --- /dev/null +++ b/client/test/api_users_test.go @@ -0,0 +1,105 @@ +/* +Wasp API + +Testing UsersApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package openapi + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "./openapi" +) + +func Test_openapi_UsersApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UsersApiService AddUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.AddUser(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersApiService ChangeUserPassword", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UsersApi.ChangeUserPassword(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersApiService ChangeUserPermissions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UsersApi.ChangeUserPermissions(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersApiService DeleteUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UsersApi.DeleteUser(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersApiService GetUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UsersApi.GetUser(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersApiService GetUsers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.GetUsers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/client/utils.go b/client/utils.go new file mode 100644 index 0000000000..192629546b --- /dev/null +++ b/client/utils.go @@ -0,0 +1,343 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-402-g2adcf666b +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/packages/webapi/v2/CLIENT_LIBRARY_CODE_GEN.md b/packages/webapi/CLIENT_LIBRARY_CODE_GEN.md similarity index 100% rename from packages/webapi/v2/CLIENT_LIBRARY_CODE_GEN.md rename to packages/webapi/CLIENT_LIBRARY_CODE_GEN.md diff --git a/packages/webapi/v2/api.go b/packages/webapi/api.go similarity index 64% rename from packages/webapi/v2/api.go rename to packages/webapi/api.go index 792f9e171e..2e229e2085 100644 --- a/packages/webapi/v2/api.go +++ b/packages/webapi/api.go @@ -1,4 +1,4 @@ -package v2 +package webapi import ( "time" @@ -15,14 +15,14 @@ import ( "github.com/iotaledger/wasp/packages/peering" "github.com/iotaledger/wasp/packages/registry" userspkg "github.com/iotaledger/wasp/packages/users" - "github.com/iotaledger/wasp/packages/webapi/v2/controllers/chain" - "github.com/iotaledger/wasp/packages/webapi/v2/controllers/corecontracts" - "github.com/iotaledger/wasp/packages/webapi/v2/controllers/metrics" - "github.com/iotaledger/wasp/packages/webapi/v2/controllers/node" - "github.com/iotaledger/wasp/packages/webapi/v2/controllers/requests" - "github.com/iotaledger/wasp/packages/webapi/v2/controllers/users" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/services" + "github.com/iotaledger/wasp/packages/webapi/controllers/chain" + "github.com/iotaledger/wasp/packages/webapi/controllers/corecontracts" + "github.com/iotaledger/wasp/packages/webapi/controllers/metrics" + "github.com/iotaledger/wasp/packages/webapi/controllers/node" + "github.com/iotaledger/wasp/packages/webapi/controllers/requests" + "github.com/iotaledger/wasp/packages/webapi/controllers/users" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + services2 "github.com/iotaledger/wasp/packages/webapi/services" ) func loadControllers(server echoswagger.ApiRoot, mocker *Mocker, controllersToLoad []interfaces.APIController) { @@ -60,17 +60,17 @@ func Init( mocker := NewMocker() mocker.LoadMockFiles() - vmService := services.NewVMService(chainsProvider) - chainService := services.NewChainService(chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) - committeeService := services.NewCommitteeService(chainsProvider, networkProvider, dkShareRegistryProvider) - registryService := services.NewRegistryService(chainsProvider, chainRecordRegistryProvider) - offLedgerService := services.NewOffLedgerService(chainService, networkProvider, requestCacheTTL) - metricsService := services.NewMetricsService(chainsProvider) - peeringService := services.NewPeeringService(chainsProvider, networkProvider, trustedNetworkManager) - evmService := services.NewEVMService(chainService, networkProvider) - nodeService := services.NewNodeService(chainRecordRegistryProvider, nodeOwnerAddresses, nodeIdentityProvider, shutdownHandler, trustedNetworkManager) - dkgService := services.NewDKGService(dkShareRegistryProvider, dkgNodeProvider) - userService := services.NewUserService(userManager) + vmService := services2.NewVMService(chainsProvider) + chainService := services2.NewChainService(chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) + committeeService := services2.NewCommitteeService(chainsProvider, networkProvider, dkShareRegistryProvider) + registryService := services2.NewRegistryService(chainsProvider, chainRecordRegistryProvider) + offLedgerService := services2.NewOffLedgerService(chainService, networkProvider, requestCacheTTL) + metricsService := services2.NewMetricsService(chainsProvider) + peeringService := services2.NewPeeringService(chainsProvider, networkProvider, trustedNetworkManager) + evmService := services2.NewEVMService(chainService, networkProvider) + nodeService := services2.NewNodeService(chainRecordRegistryProvider, nodeOwnerAddresses, nodeIdentityProvider, shutdownHandler, trustedNetworkManager) + dkgService := services2.NewDKGService(dkShareRegistryProvider, dkgNodeProvider) + userService := services2.NewUserService(userManager) // -- claimValidator := func(claims *authentication.WaspClaims) bool { diff --git a/packages/webapi/v2/apierrors/errorhandler.go b/packages/webapi/apierrors/errorhandler.go similarity index 100% rename from packages/webapi/v2/apierrors/errorhandler.go rename to packages/webapi/apierrors/errorhandler.go diff --git a/packages/webapi/v2/apierrors/errors.go b/packages/webapi/apierrors/errors.go similarity index 100% rename from packages/webapi/v2/apierrors/errors.go rename to packages/webapi/apierrors/errors.go diff --git a/packages/webapi/v2/apierrors/httperror.go b/packages/webapi/apierrors/httperror.go similarity index 100% rename from packages/webapi/v2/apierrors/httperror.go rename to packages/webapi/apierrors/httperror.go diff --git a/packages/webapi/compatibility_error_handler.go b/packages/webapi/compatibility_error_handler.go index 17ec3fef36..5a4979261c 100644 --- a/packages/webapi/compatibility_error_handler.go +++ b/packages/webapi/compatibility_error_handler.go @@ -4,21 +4,13 @@ import ( "github.com/labstack/echo/v4" "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" + "github.com/iotaledger/wasp/packages/webapi/apierrors" ) // CompatibilityHTTPErrorHandler differentiates V1/V2 error types and uses their respective handler functions. func CompatibilityHTTPErrorHandler(logger *logger.Logger) func(error, echo.Context) { return func(err error, c echo.Context) { logger.Errorf("Compatibility Error Handler: %v", err) - - // Use V1 error handler, if error is a V1 error - if _, ok := err.(*httperrors.HTTPError); ok { - httperrors.HTTPErrorHandler(err, c) - return - } - // Use V2 error handler otherwise. This is also a catch-all for any other error type. _ = apierrors.HTTPErrorHandler(err, c) } diff --git a/packages/webapi/v2/controllers/chain/access_nodes.go b/packages/webapi/controllers/chain/access_nodes.go similarity index 86% rename from packages/webapi/v2/controllers/chain/access_nodes.go rename to packages/webapi/controllers/chain/access_nodes.go index 98027c1608..fc5b87f9bc 100644 --- a/packages/webapi/v2/controllers/chain/access_nodes.go +++ b/packages/webapi/controllers/chain/access_nodes.go @@ -8,9 +8,9 @@ import ( "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/params" ) func decodeAccessNodeRequest(e echo.Context) (isc.ChainID, *cryptolib.PublicKey, error) { diff --git a/packages/webapi/v2/controllers/chain/chain.go b/packages/webapi/controllers/chain/chain.go similarity index 93% rename from packages/webapi/v2/controllers/chain/chain.go rename to packages/webapi/controllers/chain/chain.go index 6e5d68eb71..5c0ca8f7ea 100644 --- a/packages/webapi/v2/controllers/chain/chain.go +++ b/packages/webapi/controllers/chain/chain.go @@ -6,9 +6,9 @@ import ( "github.com/labstack/echo/v4" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) getCommitteeInfo(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/chain/contracts.go b/packages/webapi/controllers/chain/contracts.go similarity index 86% rename from packages/webapi/v2/controllers/chain/contracts.go rename to packages/webapi/controllers/chain/contracts.go index 3fc040d8ff..e3c16a2591 100644 --- a/packages/webapi/v2/controllers/chain/contracts.go +++ b/packages/webapi/controllers/chain/contracts.go @@ -5,8 +5,8 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) getContracts(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/chain/controller.go b/packages/webapi/controllers/chain/controller.go similarity index 98% rename from packages/webapi/v2/controllers/chain/controller.go rename to packages/webapi/controllers/chain/controller.go index 6373039ba3..2d7a51de77 100644 --- a/packages/webapi/v2/controllers/chain/controller.go +++ b/packages/webapi/controllers/chain/controller.go @@ -9,8 +9,8 @@ import ( "github.com/iotaledger/wasp/packages/authentication" "github.com/iotaledger/wasp/packages/authentication/shared/permissions" "github.com/iotaledger/wasp/packages/publisher/publisherws" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" ) type Controller struct { diff --git a/packages/webapi/v2/controllers/chain/evm.go b/packages/webapi/controllers/chain/evm.go similarity index 84% rename from packages/webapi/v2/controllers/chain/evm.go rename to packages/webapi/controllers/chain/evm.go index 15fad52935..7e67212beb 100644 --- a/packages/webapi/v2/controllers/chain/evm.go +++ b/packages/webapi/controllers/chain/evm.go @@ -5,8 +5,8 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) handleJSONRPC(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/chain/management.go b/packages/webapi/controllers/chain/management.go similarity index 91% rename from packages/webapi/v2/controllers/chain/management.go rename to packages/webapi/controllers/chain/management.go index e6dbc784c7..d02b3fb0b0 100644 --- a/packages/webapi/v2/controllers/chain/management.go +++ b/packages/webapi/controllers/chain/management.go @@ -5,7 +5,7 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) activateChain(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/chain/websocket.go b/packages/webapi/controllers/chain/websocket.go similarity index 82% rename from packages/webapi/v2/controllers/chain/websocket.go rename to packages/webapi/controllers/chain/websocket.go index bfa36e882e..110df5abe9 100644 --- a/packages/webapi/v2/controllers/chain/websocket.go +++ b/packages/webapi/controllers/chain/websocket.go @@ -3,7 +3,7 @@ package chain import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) handleWebSocket(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/corecontracts/accounts.go b/packages/webapi/controllers/corecontracts/accounts.go similarity index 96% rename from packages/webapi/v2/controllers/corecontracts/accounts.go rename to packages/webapi/controllers/corecontracts/accounts.go index a938b3c3b6..3668e55b1d 100644 --- a/packages/webapi/v2/controllers/corecontracts/accounts.go +++ b/packages/webapi/controllers/corecontracts/accounts.go @@ -5,9 +5,9 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) getAccounts(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/corecontracts/blob.go b/packages/webapi/controllers/corecontracts/blob.go similarity index 94% rename from packages/webapi/v2/controllers/corecontracts/blob.go rename to packages/webapi/controllers/corecontracts/blob.go index edbe27702c..e478f50dc5 100644 --- a/packages/webapi/v2/controllers/corecontracts/blob.go +++ b/packages/webapi/controllers/corecontracts/blob.go @@ -6,8 +6,8 @@ import ( "github.com/labstack/echo/v4" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/params" ) type Blob struct { diff --git a/packages/webapi/v2/controllers/corecontracts/blocklog.go b/packages/webapi/controllers/corecontracts/blocklog.go similarity index 97% rename from packages/webapi/v2/controllers/corecontracts/blocklog.go rename to packages/webapi/controllers/corecontracts/blocklog.go index cd5f4082f4..f0123cf35a 100644 --- a/packages/webapi/v2/controllers/corecontracts/blocklog.go +++ b/packages/webapi/controllers/corecontracts/blocklog.go @@ -12,10 +12,10 @@ import ( "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/vm/core/errors" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) getControlAddresses(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/corecontracts/controller.go b/packages/webapi/controllers/corecontracts/controller.go similarity index 98% rename from packages/webapi/v2/controllers/corecontracts/controller.go rename to packages/webapi/controllers/corecontracts/controller.go index c72a947321..09b7345e85 100644 --- a/packages/webapi/v2/controllers/corecontracts/controller.go +++ b/packages/webapi/controllers/corecontracts/controller.go @@ -6,9 +6,9 @@ import ( "github.com/pangpanglabs/echoswagger/v2" "github.com/iotaledger/wasp/packages/authentication" - "github.com/iotaledger/wasp/packages/webapi/v2/corecontracts" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/corecontracts" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" ) type Controller struct { diff --git a/packages/webapi/v2/controllers/corecontracts/errors.go b/packages/webapi/controllers/corecontracts/errors.go similarity index 87% rename from packages/webapi/v2/controllers/corecontracts/errors.go rename to packages/webapi/controllers/corecontracts/errors.go index 4db9f33cf0..9c2c90613c 100644 --- a/packages/webapi/v2/controllers/corecontracts/errors.go +++ b/packages/webapi/controllers/corecontracts/errors.go @@ -5,8 +5,8 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/params" ) type ErrorMessageFormatResponse struct { diff --git a/packages/webapi/v2/controllers/corecontracts/governance.go b/packages/webapi/controllers/corecontracts/governance.go similarity index 95% rename from packages/webapi/v2/controllers/corecontracts/governance.go rename to packages/webapi/controllers/corecontracts/governance.go index fb078adbfa..572828a60b 100644 --- a/packages/webapi/v2/controllers/corecontracts/governance.go +++ b/packages/webapi/controllers/corecontracts/governance.go @@ -7,8 +7,8 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/params" ) type gasFeePolicy struct { diff --git a/packages/webapi/v2/controllers/metrics/chain.go b/packages/webapi/controllers/metrics/chain.go similarity index 90% rename from packages/webapi/v2/controllers/metrics/chain.go rename to packages/webapi/controllers/metrics/chain.go index 467955e4af..e2c089c027 100644 --- a/packages/webapi/v2/controllers/metrics/chain.go +++ b/packages/webapi/controllers/metrics/chain.go @@ -5,8 +5,8 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) getL1Metrics(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/metrics/controller.go b/packages/webapi/controllers/metrics/controller.go similarity index 95% rename from packages/webapi/v2/controllers/metrics/controller.go rename to packages/webapi/controllers/metrics/controller.go index 240d4d13d6..7d32429cf1 100644 --- a/packages/webapi/v2/controllers/metrics/controller.go +++ b/packages/webapi/controllers/metrics/controller.go @@ -7,8 +7,8 @@ import ( "github.com/iotaledger/wasp/packages/authentication" "github.com/iotaledger/wasp/packages/authentication/shared/permissions" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" ) type Controller struct { diff --git a/packages/webapi/v2/controllers/node/controller.go b/packages/webapi/controllers/node/controller.go similarity index 88% rename from packages/webapi/v2/controllers/node/controller.go rename to packages/webapi/controllers/node/controller.go index 52c9de41bf..d80871a709 100644 --- a/packages/webapi/v2/controllers/node/controller.go +++ b/packages/webapi/controllers/node/controller.go @@ -8,9 +8,9 @@ import ( "github.com/iotaledger/hive.go/core/configuration" "github.com/iotaledger/wasp/packages/authentication" "github.com/iotaledger/wasp/packages/authentication/shared/permissions" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/services" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + models2 "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/services" ) type Controller struct { @@ -45,39 +45,39 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfaces.Mocker) { adminAPI.GET("node/info", c.getInfo). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "Returns information about this node.", mocker.Get(models.InfoResponse{}), nil). + AddResponse(http.StatusOK, "Returns information about this node.", mocker.Get(models2.InfoResponse{}), nil). SetOperationId("getInfo"). SetSummary("Returns private information about this node.") adminAPI.GET("node/peers/trusted", c.getTrustedPeers, authentication.ValidatePermissions([]string{permissions.Read})). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "A list of trusted peers", mocker.Get([]models.PeeringNodeIdentityResponse{}), nil). + AddResponse(http.StatusOK, "A list of trusted peers", mocker.Get([]models2.PeeringNodeIdentityResponse{}), nil). SetSummary("Get trusted peers"). SetOperationId("getTrustedPeers") adminAPI.DELETE("node/peers/trusted", c.distrustPeer, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models.PeeringTrustRequest{}), "", "Info of the peer to distrust", true). + AddParamBody(mocker.Get(models2.PeeringTrustRequest{}), "", "Info of the peer to distrust", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "Peer was successfully distrusted", nil, nil). SetSummary("Distrust a peering node"). SetOperationId("distrustPeer") adminAPI.POST("node/owner/certificate", c.setNodeOwner, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models.NodeOwnerCertificateRequest{}), "", "The node owner certificate", true). + AddParamBody(mocker.Get(models2.NodeOwnerCertificateRequest{}), "", "The node owner certificate", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "Node owner was successfully changed", mocker.Get(models.NodeOwnerCertificateResponse{}), nil). SetSummary("Sets the node owner"). SetOperationId("setNodeOwner") adminAPI.POST("node/peers/trusted", c.trustPeer, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models.PeeringTrustRequest{}), "", "Info of the peer to trust", true). + AddParamBody(mocker.Get(models2.PeeringTrustRequest{}), "", "Info of the peer to trust", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "Peer was successfully trusted", nil, nil). SetSummary("Trust a peering node"). SetOperationId("trustPeer") adminAPI.POST("node/dks", c.generateDKS, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models.DKSharesPostRequest{}), "DKSharesPostRequest", "Request parameters", true). + AddParamBody(mocker.Get(models2.DKSharesPostRequest{}), "DKSharesPostRequest", "Request parameters", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "DK shares info", mocker.Get(models.DKSharesInfo{}), nil). SetSummary("Generate a new distributed key"). @@ -86,19 +86,19 @@ func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfa adminAPI.GET("node/dks/:sharedAddress", c.getDKSInfo, authentication.ValidatePermissions([]string{permissions.Read})). AddParamPath("", "sharedAddress", "SharedAddress (Bech32)"). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "DK shares info", mocker.Get(models.DKSharesInfo{}), nil). + AddResponse(http.StatusOK, "DK shares info", mocker.Get(models2.DKSharesInfo{}), nil). SetSummary("Get information about the shared address DKS configuration"). SetOperationId("getDKSInfo") adminAPI.GET("node/peers/identity", c.getIdentity, authentication.ValidatePermissions([]string{permissions.Read})). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "This node peering identity", mocker.Get(models.PeeringNodeIdentityResponse{}), nil). + AddResponse(http.StatusOK, "This node peering identity", mocker.Get(models2.PeeringNodeIdentityResponse{}), nil). SetSummary("Get basic peer info of the current node"). SetOperationId("getPeeringIdentity") adminAPI.GET("node/peers", c.getRegisteredPeers, authentication.ValidatePermissions([]string{permissions.Read})). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "A list of all peers", mocker.Get([]models.PeeringNodeStatusResponse{}), nil). + AddResponse(http.StatusOK, "A list of all peers", mocker.Get([]models2.PeeringNodeStatusResponse{}), nil). SetSummary("Get basic information about all configured peers"). SetOperationId("getAllPeers") diff --git a/packages/webapi/v2/controllers/node/dkg.go b/packages/webapi/controllers/node/dkg.go similarity index 94% rename from packages/webapi/v2/controllers/node/dkg.go rename to packages/webapi/controllers/node/dkg.go index af13dacac8..c22f37c68e 100644 --- a/packages/webapi/v2/controllers/node/dkg.go +++ b/packages/webapi/controllers/node/dkg.go @@ -9,8 +9,8 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" ) func parsePeerPublicKeys(dkgRequestModel models.DKSharesPostRequest) ([]*cryptolib.PublicKey, error) { diff --git a/packages/webapi/v2/controllers/node/info.go b/packages/webapi/controllers/node/info.go similarity index 93% rename from packages/webapi/v2/controllers/node/info.go rename to packages/webapi/controllers/node/info.go index ccff7c852f..e92bab380d 100644 --- a/packages/webapi/v2/controllers/node/info.go +++ b/packages/webapi/controllers/node/info.go @@ -7,7 +7,7 @@ import ( "github.com/labstack/echo/v4" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/models" ) func (c *Controller) getConfiguration(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/node/management.go b/packages/webapi/controllers/node/management.go similarity index 91% rename from packages/webapi/v2/controllers/node/management.go rename to packages/webapi/controllers/node/management.go index c579b93fdc..114c6c6250 100644 --- a/packages/webapi/v2/controllers/node/management.go +++ b/packages/webapi/controllers/node/management.go @@ -4,12 +4,12 @@ import ( "net/http" "github.com/iotaledger/wasp/packages/cryptolib" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" "github.com/labstack/echo/v4" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" ) func (c *Controller) setNodeOwner(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/node/peering.go b/packages/webapi/controllers/node/peering.go similarity index 95% rename from packages/webapi/v2/controllers/node/peering.go rename to packages/webapi/controllers/node/peering.go index f4b8d303b6..512f489576 100644 --- a/packages/webapi/v2/controllers/node/peering.go +++ b/packages/webapi/controllers/node/peering.go @@ -6,8 +6,8 @@ import ( "github.com/labstack/echo/v4" "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" ) func (c *Controller) getRegisteredPeers(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/requests/callview.go b/packages/webapi/controllers/requests/callview.go similarity index 92% rename from packages/webapi/v2/controllers/requests/callview.go rename to packages/webapi/controllers/requests/callview.go index ea7c785909..c61531d90c 100644 --- a/packages/webapi/v2/controllers/requests/callview.go +++ b/packages/webapi/controllers/requests/callview.go @@ -4,12 +4,12 @@ import ( "net/http" "github.com/iotaledger/wasp/packages/kv/dict" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" "github.com/labstack/echo/v4" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" ) func (c *Controller) executeCallView(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/requests/controller.go b/packages/webapi/controllers/requests/controller.go similarity index 91% rename from packages/webapi/v2/controllers/requests/controller.go rename to packages/webapi/controllers/requests/controller.go index 47d1e8cfb2..6aeea40684 100644 --- a/packages/webapi/v2/controllers/requests/controller.go +++ b/packages/webapi/controllers/requests/controller.go @@ -6,8 +6,8 @@ import ( "github.com/pangpanglabs/echoswagger/v2" "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + models2 "github.com/iotaledger/wasp/packages/webapi/models" ) type Controller struct { @@ -38,7 +38,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter publicAPI.GET("chains/:chainID/receipts/:requestID", c.getReceipt). AddParamPath("", "chainID", "ChainID (Bech32)"). AddParamPath("", "requestID", "RequestID (Hex)"). - AddResponse(http.StatusOK, "ReceiptResponse", mocker.Get(models.ReceiptResponse{}), nil). + AddResponse(http.StatusOK, "ReceiptResponse", mocker.Get(models2.ReceiptResponse{}), nil). SetSummary("Get a receipt from a request ID"). SetOperationId("getReceipt") @@ -51,7 +51,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter publicAPI.POST("requests/offledger", c.handleOffLedgerRequest). AddParamBody( - models.OffLedgerRequest{Request: "Hex string"}, + models2.OffLedgerRequest{Request: "Hex string"}, "", "Offledger request as JSON. Request encoded in Hex", true). @@ -66,7 +66,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter AddParamPath("", "requestID", "RequestID (Hex)"). AddResponse(http.StatusNotFound, "The chain or request id is invalid", nil, nil). AddResponse(http.StatusRequestTimeout, "The waiting time has reached the defined limit", nil, nil). - AddResponse(http.StatusOK, "The request receipt", mocker.Get(models.ReceiptResponse{}), nil) + AddResponse(http.StatusOK, "The request receipt", mocker.Get(models2.ReceiptResponse{}), nil) } func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfaces.Mocker) { diff --git a/packages/webapi/v2/controllers/requests/offledger.go b/packages/webapi/controllers/requests/offledger.go similarity index 87% rename from packages/webapi/v2/controllers/requests/offledger.go rename to packages/webapi/controllers/requests/offledger.go index 581aaec4b2..ecac89646d 100644 --- a/packages/webapi/v2/controllers/requests/offledger.go +++ b/packages/webapi/controllers/requests/offledger.go @@ -7,8 +7,8 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" ) func (c *Controller) handleOffLedgerRequest(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/requests/receipt.go b/packages/webapi/controllers/requests/receipt.go similarity index 75% rename from packages/webapi/v2/controllers/requests/receipt.go rename to packages/webapi/controllers/requests/receipt.go index 63fad72247..ad9a492f5a 100644 --- a/packages/webapi/v2/controllers/requests/receipt.go +++ b/packages/webapi/controllers/requests/receipt.go @@ -5,9 +5,9 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) getReceipt(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/requests/waitforrequest.go b/packages/webapi/controllers/requests/waitforrequest.go similarity index 83% rename from packages/webapi/v2/controllers/requests/waitforrequest.go rename to packages/webapi/controllers/requests/waitforrequest.go index aca1d75465..94e99fd68a 100644 --- a/packages/webapi/v2/controllers/requests/waitforrequest.go +++ b/packages/webapi/controllers/requests/waitforrequest.go @@ -6,8 +6,8 @@ import ( "github.com/labstack/echo/v4" - "github.com/iotaledger/wasp/packages/webapi/v2/models" - "github.com/iotaledger/wasp/packages/webapi/v2/params" + "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/params" ) func (c *Controller) waitForRequestToFinish(e echo.Context) error { diff --git a/packages/webapi/v2/controllers/users/controller.go b/packages/webapi/controllers/users/controller.go similarity index 97% rename from packages/webapi/v2/controllers/users/controller.go rename to packages/webapi/controllers/users/controller.go index bf207f525e..b7efdd7d38 100644 --- a/packages/webapi/v2/controllers/users/controller.go +++ b/packages/webapi/controllers/users/controller.go @@ -7,8 +7,8 @@ import ( "github.com/iotaledger/wasp/packages/authentication" "github.com/iotaledger/wasp/packages/authentication/shared/permissions" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" ) type Controller struct { diff --git a/packages/webapi/v2/controllers/users/user.go b/packages/webapi/controllers/users/user.go similarity index 96% rename from packages/webapi/v2/controllers/users/user.go rename to packages/webapi/controllers/users/user.go index 6c02e381e6..fc839e60da 100644 --- a/packages/webapi/v2/controllers/users/user.go +++ b/packages/webapi/controllers/users/user.go @@ -7,8 +7,8 @@ import ( "github.com/labstack/echo/v4" "github.com/iotaledger/wasp/packages/authentication" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" ) func (c *Controller) addUser(e echo.Context) error { diff --git a/packages/webapi/v2/corecontracts/README.md b/packages/webapi/corecontracts/README.md similarity index 100% rename from packages/webapi/v2/corecontracts/README.md rename to packages/webapi/corecontracts/README.md diff --git a/packages/webapi/v2/corecontracts/accounts.go b/packages/webapi/corecontracts/accounts.go similarity index 98% rename from packages/webapi/v2/corecontracts/accounts.go rename to packages/webapi/corecontracts/accounts.go index e0d58f02be..e17f658bf1 100644 --- a/packages/webapi/v2/corecontracts/accounts.go +++ b/packages/webapi/corecontracts/accounts.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/collections" "github.com/iotaledger/wasp/packages/vm/core/accounts" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type Accounts struct { diff --git a/packages/webapi/v2/corecontracts/blob.go b/packages/webapi/corecontracts/blob.go similarity index 96% rename from packages/webapi/v2/corecontracts/blob.go rename to packages/webapi/corecontracts/blob.go index 2f94d3655e..ca0d8524a5 100644 --- a/packages/webapi/v2/corecontracts/blob.go +++ b/packages/webapi/corecontracts/blob.go @@ -5,7 +5,7 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/vm/core/blob" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type Blob struct { diff --git a/packages/webapi/v2/corecontracts/blocklog.go b/packages/webapi/corecontracts/blocklog.go similarity index 99% rename from packages/webapi/v2/corecontracts/blocklog.go rename to packages/webapi/corecontracts/blocklog.go index 90b3b17d02..d4359e47c4 100644 --- a/packages/webapi/v2/corecontracts/blocklog.go +++ b/packages/webapi/corecontracts/blocklog.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/kv/kvdecoder" "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type BlockLog struct { diff --git a/packages/webapi/v2/corecontracts/errors.go b/packages/webapi/corecontracts/errors.go similarity index 94% rename from packages/webapi/v2/corecontracts/errors.go rename to packages/webapi/corecontracts/errors.go index d6403134d0..e38c418c93 100644 --- a/packages/webapi/v2/corecontracts/errors.go +++ b/packages/webapi/corecontracts/errors.go @@ -5,7 +5,7 @@ import ( "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/kvdecoder" "github.com/iotaledger/wasp/packages/vm/core/errors" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type Errors struct { diff --git a/packages/webapi/v2/corecontracts/governance.go b/packages/webapi/corecontracts/governance.go similarity index 97% rename from packages/webapi/v2/corecontracts/governance.go rename to packages/webapi/corecontracts/governance.go index adc3f06921..9fb21ee03a 100644 --- a/packages/webapi/v2/corecontracts/governance.go +++ b/packages/webapi/corecontracts/governance.go @@ -6,7 +6,7 @@ import ( "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/collections" "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type Governance struct { diff --git a/packages/webapi/v2/dto/chain.go b/packages/webapi/dto/chain.go similarity index 100% rename from packages/webapi/v2/dto/chain.go rename to packages/webapi/dto/chain.go diff --git a/packages/webapi/v2/dto/metrics.go b/packages/webapi/dto/metrics.go similarity index 100% rename from packages/webapi/v2/dto/metrics.go rename to packages/webapi/dto/metrics.go diff --git a/packages/webapi/v2/dto/node.go b/packages/webapi/dto/node.go similarity index 100% rename from packages/webapi/v2/dto/node.go rename to packages/webapi/dto/node.go diff --git a/packages/webapi/v2/dto/peering.go b/packages/webapi/dto/peering.go similarity index 100% rename from packages/webapi/v2/dto/peering.go rename to packages/webapi/dto/peering.go diff --git a/packages/webapi/v2/interfaces/interfaces.go b/packages/webapi/interfaces/interfaces.go similarity index 76% rename from packages/webapi/v2/interfaces/interfaces.go rename to packages/webapi/interfaces/interfaces.go index f1ca476e33..9d16a07333 100644 --- a/packages/webapi/v2/interfaces/interfaces.go +++ b/packages/webapi/interfaces/interfaces.go @@ -8,6 +8,8 @@ import ( "github.com/iotaledger/wasp/packages/state" "github.com/iotaledger/wasp/packages/vm/core/blocklog" + dto2 "github.com/iotaledger/wasp/packages/webapi/dto" + models2 "github.com/iotaledger/wasp/packages/webapi/models" "github.com/labstack/echo/v4" "github.com/pangpanglabs/echoswagger/v2" @@ -19,8 +21,6 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" - "github.com/iotaledger/wasp/packages/webapi/v2/models" ) type APIController interface { @@ -35,8 +35,8 @@ type ChainService interface { GetAllChainIDs() ([]isc.ChainID, error) HasChain(chainID isc.ChainID) bool GetChainByID(chainID isc.ChainID) chain.Chain - GetChainInfoByChainID(chainID isc.ChainID) (*dto.ChainInfo, error) - GetContracts(chainID isc.ChainID) (dto.ContractsMap, error) + GetChainInfoByChainID(chainID isc.ChainID) (*dto2.ChainInfo, error) + GetContracts(chainID isc.ChainID) (dto2.ContractsMap, error) GetEVMChainID(chainID isc.ChainID) (uint16, error) GetState(chainID isc.ChainID, stateKey []byte) (state []byte, err error) WaitForRequestProcessed(ctx context.Context, chainID isc.ChainID, requestID isc.RequestID, timeout time.Duration) (*isc.Receipt, *isc.VMError, error) @@ -48,10 +48,10 @@ type EVMService interface { } type MetricsService interface { - GetAllChainsMetrics() *dto.ChainMetrics - GetChainConsensusPipeMetrics(chainID isc.ChainID) *models.ConsensusPipeMetrics - GetChainConsensusWorkflowMetrics(chainID isc.ChainID) *models.ConsensusWorkflowMetrics - GetChainMetrics(chainID isc.ChainID) *dto.ChainMetrics + GetAllChainsMetrics() *dto2.ChainMetrics + GetChainConsensusPipeMetrics(chainID isc.ChainID) *models2.ConsensusPipeMetrics + GetChainConsensusWorkflowMetrics(chainID isc.ChainID) *models2.ConsensusWorkflowMetrics + GetChainMetrics(chainID isc.ChainID) *dto2.ChainMetrics } var ErrPeerNotFound = errors.New("couldn't find peer") @@ -68,17 +68,17 @@ type RegistryService interface { } type CommitteeService interface { - GetCommitteeInfo(chainID isc.ChainID) (*dto.ChainNodeInfo, error) + GetCommitteeInfo(chainID isc.ChainID) (*dto2.ChainNodeInfo, error) GetPublicKey() *cryptolib.PublicKey } type PeeringService interface { - DistrustPeer(publicKey *cryptolib.PublicKey) (*dto.PeeringNodeIdentity, error) - GetIdentity() *dto.PeeringNodeIdentity - GetRegisteredPeers() []*dto.PeeringNodeStatus - GetTrustedPeers() ([]*dto.PeeringNodeIdentity, error) + DistrustPeer(publicKey *cryptolib.PublicKey) (*dto2.PeeringNodeIdentity, error) + GetIdentity() *dto2.PeeringNodeIdentity + GetRegisteredPeers() []*dto2.PeeringNodeStatus + GetTrustedPeers() ([]*dto2.PeeringNodeIdentity, error) IsPeerTrusted(publicKey *cryptolib.PublicKey) error - TrustPeer(peer *cryptolib.PublicKey, netID string) (*dto.PeeringNodeIdentity, error) + TrustPeer(peer *cryptolib.PublicKey, netID string) (*dto2.PeeringNodeIdentity, error) } type OffLedgerService interface { @@ -89,8 +89,8 @@ type OffLedgerService interface { type UserService interface { AddUser(username string, password string, permissions []string) error DeleteUser(username string) error - GetUser(username string) (*models.User, error) - GetUsers() []*models.User + GetUser(username string) (*models2.User, error) + GetUsers() []*models2.User UpdateUserPassword(username string, password string) error UpdateUserPermissions(username string, permissions []string) error } diff --git a/packages/webapi/v2/mocker.go b/packages/webapi/mocker.go similarity index 99% rename from packages/webapi/v2/mocker.go rename to packages/webapi/mocker.go index f63a65378d..5fc9be9ec8 100644 --- a/packages/webapi/v2/mocker.go +++ b/packages/webapi/mocker.go @@ -1,4 +1,4 @@ -package v2 +package webapi import ( "embed" diff --git a/packages/webapi/v2/models/L1.go b/packages/webapi/models/L1.go similarity index 100% rename from packages/webapi/v2/models/L1.go rename to packages/webapi/models/L1.go diff --git a/packages/webapi/v2/models/chain.go b/packages/webapi/models/chain.go similarity index 93% rename from packages/webapi/v2/models/chain.go rename to packages/webapi/models/chain.go index 417360d61a..79ae939ab7 100644 --- a/packages/webapi/v2/models/chain.go +++ b/packages/webapi/models/chain.go @@ -3,7 +3,7 @@ package models import ( "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" + dto2 "github.com/iotaledger/wasp/packages/webapi/dto" ) type CommitteeNode struct { @@ -11,7 +11,7 @@ type CommitteeNode struct { Node PeeringNodeStatusResponse `json:"node" swagger:"required"` } -func MapCommitteeNode(status *dto.ChainNodeStatus) CommitteeNode { +func MapCommitteeNode(status *dto2.ChainNodeStatus) CommitteeNode { return CommitteeNode{ AccessAPI: status.AccessAPI, Node: PeeringNodeStatusResponse{ @@ -24,7 +24,7 @@ func MapCommitteeNode(status *dto.ChainNodeStatus) CommitteeNode { } } -func MapCommitteeNodes(status []*dto.ChainNodeStatus) []CommitteeNode { +func MapCommitteeNodes(status []*dto2.ChainNodeStatus) []CommitteeNode { nodes := make([]CommitteeNode, 0) for _, node := range status { @@ -72,7 +72,7 @@ type StateResponse struct { State string `json:"state" swagger:"desc(The state of the requested key (Hex-encoded)),required"` } -func MapChainInfoResponse(chainInfo *dto.ChainInfo, evmChainID uint16) ChainInfoResponse { +func MapChainInfoResponse(chainInfo *dto2.ChainInfo, evmChainID uint16) ChainInfoResponse { gasFeeTokenID := "" if !isc.IsEmptyNativeTokenID(chainInfo.GasFeePolicy.GasFeeTokenID) { diff --git a/packages/webapi/v2/models/core_accounts.go b/packages/webapi/models/core_accounts.go similarity index 100% rename from packages/webapi/v2/models/core_accounts.go rename to packages/webapi/models/core_accounts.go diff --git a/packages/webapi/v2/models/core_blocklog.go b/packages/webapi/models/core_blocklog.go similarity index 100% rename from packages/webapi/v2/models/core_blocklog.go rename to packages/webapi/models/core_blocklog.go diff --git a/packages/webapi/v2/models/dks.go b/packages/webapi/models/dks.go similarity index 100% rename from packages/webapi/v2/models/dks.go rename to packages/webapi/models/dks.go diff --git a/packages/webapi/v2/models/metrics.go b/packages/webapi/models/metrics.go similarity index 99% rename from packages/webapi/v2/models/metrics.go rename to packages/webapi/models/metrics.go index e2007b9b42..445edc8b4b 100644 --- a/packages/webapi/v2/models/metrics.go +++ b/packages/webapi/models/metrics.go @@ -4,8 +4,7 @@ import ( "time" "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" + "github.com/iotaledger/wasp/packages/webapi/dto" ) type MetricItem[T interface{}] struct { diff --git a/packages/webapi/v2/models/mock/ChainInfoResponse.json b/packages/webapi/models/mock/ChainInfoResponse.json similarity index 100% rename from packages/webapi/v2/models/mock/ChainInfoResponse.json rename to packages/webapi/models/mock/ChainInfoResponse.json diff --git a/packages/webapi/v2/models/mock/ChainInfoResponse[].json b/packages/webapi/models/mock/ChainInfoResponse[].json similarity index 100% rename from packages/webapi/v2/models/mock/ChainInfoResponse[].json rename to packages/webapi/models/mock/ChainInfoResponse[].json diff --git a/packages/webapi/v2/models/mock/CommitteeInfoResponse.json b/packages/webapi/models/mock/CommitteeInfoResponse.json similarity index 100% rename from packages/webapi/v2/models/mock/CommitteeInfoResponse.json rename to packages/webapi/models/mock/CommitteeInfoResponse.json diff --git a/packages/webapi/v2/models/mock/ContractInfoResponse[].json b/packages/webapi/models/mock/ContractInfoResponse[].json similarity index 100% rename from packages/webapi/v2/models/mock/ContractInfoResponse[].json rename to packages/webapi/models/mock/ContractInfoResponse[].json diff --git a/packages/webapi/v2/models/mock/InfoResponse.json b/packages/webapi/models/mock/InfoResponse.json similarity index 100% rename from packages/webapi/v2/models/mock/InfoResponse.json rename to packages/webapi/models/mock/InfoResponse.json diff --git a/packages/webapi/v2/models/mock/PeeringNodeIdentityResponse.json b/packages/webapi/models/mock/PeeringNodeIdentityResponse.json similarity index 100% rename from packages/webapi/v2/models/mock/PeeringNodeIdentityResponse.json rename to packages/webapi/models/mock/PeeringNodeIdentityResponse.json diff --git a/packages/webapi/v2/models/mock/PeeringNodeIdentityResponse[].json b/packages/webapi/models/mock/PeeringNodeIdentityResponse[].json similarity index 100% rename from packages/webapi/v2/models/mock/PeeringNodeIdentityResponse[].json rename to packages/webapi/models/mock/PeeringNodeIdentityResponse[].json diff --git a/packages/webapi/v2/models/mock/PeeringNodeStatusResponse.json b/packages/webapi/models/mock/PeeringNodeStatusResponse.json similarity index 100% rename from packages/webapi/v2/models/mock/PeeringNodeStatusResponse.json rename to packages/webapi/models/mock/PeeringNodeStatusResponse.json diff --git a/packages/webapi/v2/models/mock/PeeringNodeStatusResponse[].json b/packages/webapi/models/mock/PeeringNodeStatusResponse[].json similarity index 100% rename from packages/webapi/v2/models/mock/PeeringNodeStatusResponse[].json rename to packages/webapi/models/mock/PeeringNodeStatusResponse[].json diff --git a/packages/webapi/v2/models/mock/PeeringTrustRequest.json b/packages/webapi/models/mock/PeeringTrustRequest.json similarity index 100% rename from packages/webapi/v2/models/mock/PeeringTrustRequest.json rename to packages/webapi/models/mock/PeeringTrustRequest.json diff --git a/packages/webapi/v2/models/node.go b/packages/webapi/models/node.go similarity index 100% rename from packages/webapi/v2/models/node.go rename to packages/webapi/models/node.go diff --git a/packages/webapi/v2/models/peering.go b/packages/webapi/models/peering.go similarity index 100% rename from packages/webapi/v2/models/peering.go rename to packages/webapi/models/peering.go diff --git a/packages/webapi/v2/models/requests.go b/packages/webapi/models/requests.go similarity index 100% rename from packages/webapi/v2/models/requests.go rename to packages/webapi/models/requests.go diff --git a/packages/webapi/v2/models/user.go b/packages/webapi/models/user.go similarity index 100% rename from packages/webapi/v2/models/user.go rename to packages/webapi/models/user.go diff --git a/packages/webapi/v2/models/vm.go b/packages/webapi/models/vm.go similarity index 100% rename from packages/webapi/v2/models/vm.go rename to packages/webapi/models/vm.go diff --git a/packages/webapi/v2/params/decoder.go b/packages/webapi/params/decoder.go similarity index 97% rename from packages/webapi/v2/params/decoder.go rename to packages/webapi/params/decoder.go index f7cee1fd59..d059b0831a 100644 --- a/packages/webapi/v2/params/decoder.go +++ b/packages/webapi/params/decoder.go @@ -10,7 +10,7 @@ import ( "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/apierrors" + "github.com/iotaledger/wasp/packages/webapi/apierrors" ) func DecodeChainID(e echo.Context) (isc.ChainID, error) { diff --git a/packages/webapi/v2/services/chain.go b/packages/webapi/services/chain.go similarity index 96% rename from packages/webapi/v2/services/chain.go rename to packages/webapi/services/chain.go index b2da36f23f..237f8271c6 100644 --- a/packages/webapi/v2/services/chain.go +++ b/packages/webapi/services/chain.go @@ -15,9 +15,9 @@ import ( "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/vm/core/evm" "github.com/iotaledger/wasp/packages/vm/core/root" - "github.com/iotaledger/wasp/packages/webapi/v2/corecontracts" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/corecontracts" + "github.com/iotaledger/wasp/packages/webapi/dto" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) const MaxTimeout = 30 * time.Second diff --git a/packages/webapi/v2/services/committee.go b/packages/webapi/services/committee.go similarity index 91% rename from packages/webapi/v2/services/committee.go rename to packages/webapi/services/committee.go index 31f408e07d..978038e026 100644 --- a/packages/webapi/v2/services/committee.go +++ b/packages/webapi/services/committee.go @@ -10,8 +10,8 @@ import ( "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/tcrypto" "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + dto2 "github.com/iotaledger/wasp/packages/webapi/dto" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type CommitteeService struct { @@ -32,7 +32,7 @@ func (c *CommitteeService) GetPublicKey() *cryptolib.PublicKey { return c.networkProvider.Self().PubKey() } -func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto.ChainNodeInfo, error) { +func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto2.ChainNodeInfo, error) { chain := c.chainsProvider().Get(chainID) if chain == nil { return nil, errors.New("chain does not exist") @@ -69,7 +69,7 @@ func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto.ChainNode return nil, err } - chainNodeInfo := dto.ChainNodeInfo{ + chainNodeInfo := dto2.ChainNodeInfo{ Address: committeeInfo.Address, AccessNodes: accessNodes, CandidateNodes: filteredCandidateNodes, @@ -84,8 +84,8 @@ func getCommitteeNodes( peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, inChainNodes map[cryptolib.PublicKeyKey]bool, -) []*dto.ChainNodeStatus { - nodes := make([]*dto.ChainNodeStatus, 0) +) []*dto2.ChainNodeStatus { + nodes := make([]*dto2.ChainNodeStatus, 0) for _, cmtNodePubKey := range dkShare.GetNodePubKeys() { nodes = append(nodes, makeChainNodeStatus(cmtNodePubKey, peeringStatus, candidateNodes)) @@ -101,8 +101,8 @@ func getAccessNodes( peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, inChainNodes map[cryptolib.PublicKeyKey]bool, -) []*dto.ChainNodeStatus { - nodes := make([]*dto.ChainNodeStatus, 0) +) []*dto2.ChainNodeStatus { + nodes := make([]*dto2.ChainNodeStatus, 0) for _, chainNode := range chainNodes { acnPubKey := chainNode.PubKey() @@ -127,8 +127,8 @@ func getCandidateNodes( peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, inChainNodes map[cryptolib.PublicKeyKey]bool, -) ([]*dto.ChainNodeStatus, error) { - nodes := make([]*dto.ChainNodeStatus, 0) +) ([]*dto2.ChainNodeStatus, error) { + nodes := make([]*dto2.ChainNodeStatus, 0) for _, c := range candidateNodes { pubKey, err := cryptolib.NewPublicKeyFromBytes(c.NodePubKey) @@ -163,9 +163,9 @@ func makeChainNodeStatus( pubKey *cryptolib.PublicKey, peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, -) *dto.ChainNodeStatus { - cns := dto.ChainNodeStatus{ - Node: dto.PeeringNodeStatus{ +) *dto2.ChainNodeStatus { + cns := dto2.ChainNodeStatus{ + Node: dto2.PeeringNodeStatus{ PublicKey: pubKey, }, } diff --git a/packages/webapi/v2/services/dkg.go b/packages/webapi/services/dkg.go similarity index 97% rename from packages/webapi/v2/services/dkg.go rename to packages/webapi/services/dkg.go index 45eee1a2b7..a5a1491e8c 100644 --- a/packages/webapi/v2/services/dkg.go +++ b/packages/webapi/services/dkg.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/tcrypto" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/models" ) const ( diff --git a/packages/webapi/v2/services/evm.go b/packages/webapi/services/evm.go similarity index 97% rename from packages/webapi/v2/services/evm.go rename to packages/webapi/services/evm.go index 2d2e85cb01..f6998edbf4 100644 --- a/packages/webapi/v2/services/evm.go +++ b/packages/webapi/services/evm.go @@ -13,7 +13,7 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type chainServer struct { diff --git a/packages/webapi/v2/services/metrics.go b/packages/webapi/services/metrics.go similarity index 95% rename from packages/webapi/v2/services/metrics.go rename to packages/webapi/services/metrics.go index 01fbe91ec5..300df83710 100644 --- a/packages/webapi/v2/services/metrics.go +++ b/packages/webapi/services/metrics.go @@ -3,9 +3,9 @@ package services import ( "github.com/iotaledger/wasp/packages/chains" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/dto" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" ) type MetricsService struct { diff --git a/packages/webapi/v2/services/node.go b/packages/webapi/services/node.go similarity index 98% rename from packages/webapi/v2/services/node.go rename to packages/webapi/services/node.go index 095a1c8d97..16cc5e1aa4 100644 --- a/packages/webapi/v2/services/node.go +++ b/packages/webapi/services/node.go @@ -13,7 +13,7 @@ import ( "github.com/iotaledger/wasp/packages/peering" "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type NodeService struct { diff --git a/packages/webapi/v2/services/offledger.go b/packages/webapi/services/offledger.go similarity index 98% rename from packages/webapi/v2/services/offledger.go rename to packages/webapi/services/offledger.go index 5eb9a0d4e2..6454f18c5e 100644 --- a/packages/webapi/v2/services/offledger.go +++ b/packages/webapi/services/offledger.go @@ -15,8 +15,8 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/accounts" "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/vm/vmcontext" + "github.com/iotaledger/wasp/packages/webapi/interfaces" "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" ) type OffLedgerService struct { diff --git a/packages/webapi/v2/services/peering.go b/packages/webapi/services/peering.go similarity index 98% rename from packages/webapi/v2/services/peering.go rename to packages/webapi/services/peering.go index 21804faead..7844a09295 100644 --- a/packages/webapi/v2/services/peering.go +++ b/packages/webapi/services/peering.go @@ -4,7 +4,7 @@ import ( "github.com/iotaledger/wasp/packages/chains" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/webapi/v2/dto" + "github.com/iotaledger/wasp/packages/webapi/dto" ) type PeeringService struct { diff --git a/packages/webapi/v2/services/registry.go b/packages/webapi/services/registry.go similarity index 92% rename from packages/webapi/v2/services/registry.go rename to packages/webapi/services/registry.go index 8fd85be9f4..23f8429ef1 100644 --- a/packages/webapi/v2/services/registry.go +++ b/packages/webapi/services/registry.go @@ -4,7 +4,7 @@ import ( "github.com/iotaledger/wasp/packages/chains" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type RegistryService struct { diff --git a/packages/webapi/v2/services/user.go b/packages/webapi/services/user.go similarity index 95% rename from packages/webapi/v2/services/user.go rename to packages/webapi/services/user.go index da5d396ee1..d9b95e805b 100644 --- a/packages/webapi/v2/services/user.go +++ b/packages/webapi/services/user.go @@ -4,8 +4,8 @@ import ( "golang.org/x/exp/maps" "github.com/iotaledger/wasp/packages/users" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + "github.com/iotaledger/wasp/packages/webapi/interfaces" + "github.com/iotaledger/wasp/packages/webapi/models" ) type UserService struct { diff --git a/packages/webapi/v2/services/vm.go b/packages/webapi/services/vm.go similarity index 94% rename from packages/webapi/v2/services/vm.go rename to packages/webapi/services/vm.go index 43ff7700c0..a34865c435 100644 --- a/packages/webapi/v2/services/vm.go +++ b/packages/webapi/services/vm.go @@ -10,8 +10,8 @@ import ( "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/state" "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/webapi/v2/corecontracts" - "github.com/iotaledger/wasp/packages/webapi/v2/interfaces" + "github.com/iotaledger/wasp/packages/webapi/corecontracts" + "github.com/iotaledger/wasp/packages/webapi/interfaces" ) type VMService struct { diff --git a/packages/webapi/v2/test/mock_test.go b/packages/webapi/test/mock_test.go similarity index 68% rename from packages/webapi/v2/test/mock_test.go rename to packages/webapi/test/mock_test.go index 2f7181e0be..73f73788cf 100644 --- a/packages/webapi/v2/test/mock_test.go +++ b/packages/webapi/test/mock_test.go @@ -6,14 +6,14 @@ import ( "github.com/stretchr/testify/require" - v2 "github.com/iotaledger/wasp/packages/webapi/v2" - "github.com/iotaledger/wasp/packages/webapi/v2/models" + v2 "github.com/iotaledger/wasp/packages/webapi" + models2 "github.com/iotaledger/wasp/packages/webapi/models" ) func TestMockingOfPtrStructure(t *testing.T) { mock := v2.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get(&models.PeeringNodeStatusResponse{}) + mockedChainInfoResponse := mock.Get(&models2.PeeringNodeStatusResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) @@ -22,7 +22,7 @@ func TestMockingOfPtrStructure(t *testing.T) { func TestMockingOfStructure(t *testing.T) { mock := v2.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get(models.PeeringNodeStatusResponse{}) + mockedChainInfoResponse := mock.Get(models2.PeeringNodeStatusResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) @@ -31,7 +31,7 @@ func TestMockingOfStructure(t *testing.T) { func TestMockingOfStructureArray(t *testing.T) { mock := v2.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get([]models.PeeringNodeStatusResponse{}) + mockedChainInfoResponse := mock.Get([]models2.PeeringNodeStatusResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) @@ -40,7 +40,7 @@ func TestMockingOfStructureArray(t *testing.T) { func TestMockingOfChainInfo(t *testing.T) { mock := v2.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get([]models.ChainInfoResponse{}) + mockedChainInfoResponse := mock.Get([]models2.ChainInfoResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) @@ -49,7 +49,7 @@ func TestMockingOfChainInfo(t *testing.T) { func TestMockingOfCommitteeInfo(t *testing.T) { mock := v2.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get(models.CommitteeInfoResponse{}) + mockedChainInfoResponse := mock.Get(models2.CommitteeInfoResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) diff --git a/packages/webapi/v1/admapi/accessnodes.go b/packages/webapi/v1/admapi/accessnodes.go deleted file mode 100644 index 94a44ab95d..0000000000 --- a/packages/webapi/v1/admapi/accessnodes.go +++ /dev/null @@ -1,92 +0,0 @@ -package admapi - -import ( - "fmt" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - "github.com/samber/lo" - - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func addAccessNodesEndpoints( - adm echoswagger.ApiGroup, - chainRecordRegistryProvider registry.ChainRecordRegistryProvider, - tnm peering.TrustedNetworkManager, -) { - a := &accessNodesService{ - chainRecordRegistryProvider: chainRecordRegistryProvider, - networkMgr: tnm, - } - adm.PUT(routes.AdmAccessNode(":chainID", ":pubKey"), a.handleAddAccessNode). - AddParamPath("", "chainID", "ChainID (bech32))"). - AddParamPath("", "pubKey", "PublicKey (hex string)"). - SetSummary("Add an access node to a chain") - - adm.DELETE(routes.AdmAccessNode(":chainID", ":pubKey"), a.handleRemoveAccessNode). - AddParamPath("", "chainID", "ChainID (bech32))"). - AddParamPath("", "pubKey", "PublicKey (hex string)"). - SetSummary("Remove an access node from a chain") -} - -type accessNodesService struct { - chainRecordRegistryProvider registry.ChainRecordRegistryProvider - networkMgr peering.TrustedNetworkManager -} - -func paramsPubKey(c echo.Context) (*cryptolib.PublicKey, error) { - return cryptolib.NewPublicKeyFromString(c.Param("pubKey")) -} - -func (a *accessNodesService) handleAddAccessNode(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest("invalid chainID") - } - pubKey, err := paramsPubKey(c) - if err != nil { - return httperrors.BadRequest("invalid pub key") - } - peers, err := a.networkMgr.TrustedPeers() - if err != nil { - return httperrors.ServerError("error getting trusted peers") - } - _, ok := lo.Find(peers, func(p *peering.TrustedPeer) bool { - return p.PubKey().Equals(pubKey) - }) - if !ok { - return httperrors.NotFound(fmt.Sprintf("couldn't find peer with public key %s", pubKey)) - } - _, err = a.chainRecordRegistryProvider.UpdateChainRecord(chainID, func(rec *registry.ChainRecord) bool { - return rec.AddAccessNode(pubKey) - }) - if err != nil { - return httperrors.ServerError("error saving chain record.") - } - return c.NoContent(http.StatusOK) -} - -func (a *accessNodesService) handleRemoveAccessNode(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest("invalid chainID") - } - pubKey, err := paramsPubKey(c) - if err != nil { - return httperrors.BadRequest("invalid pub key") - } - _, err = a.chainRecordRegistryProvider.UpdateChainRecord(chainID, func(rec *registry.ChainRecord) bool { - return rec.RemoveAccessNode(pubKey) - }) - if err != nil { - return httperrors.ServerError("error saving chain record.") - } - return c.NoContent(http.StatusOK) -} diff --git a/packages/webapi/v1/admapi/activatechain.go b/packages/webapi/v1/admapi/activatechain.go deleted file mode 100644 index 64555e91cb..0000000000 --- a/packages/webapi/v1/admapi/activatechain.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package admapi - -import ( - "fmt" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/tcrypto" - "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type chainWebAPI struct { - chainRecordRegistryProvider registry.ChainRecordRegistryProvider - dkShareRegistryProvider registry.DKShareRegistryProvider - nodeIdentityProvider registry.NodeIdentityProvider - chains chains.Provider - network peering.NetworkProvider - nodeConnectionMetrics nodeconnmetrics.NodeConnectionMetrics -} - -func addChainEndpoints(adm echoswagger.ApiGroup, c *chainWebAPI) { - adm.POST(routes.ActivateChain(":chainID"), c.handleActivateChain). - SetDeprecated(). - AddParamPath("", "chainID", "ChainID (bech32))"). - SetSummary("Activate a chain") - - adm.POST(routes.DeactivateChain(":chainID"), c.handleDeactivateChain). - SetDeprecated(). - AddParamPath("", "chainID", "ChainID (bech32))"). - SetSummary("Deactivate a chain") - - adm.GET(routes.GetChainInfo(":chainID"), c.handleGetChainInfo). - SetDeprecated(). - AddParamPath("", "chainID", "ChainID (bech32))"). - SetSummary("Get basic chain info.") -} - -func (w *chainWebAPI) handleActivateChain(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return err - } - - if err := w.chains().Activate(chainID); err != nil { - return err - } - - return c.NoContent(http.StatusOK) -} - -func (w *chainWebAPI) handleDeactivateChain(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return err - } - - err = w.chains().Deactivate(chainID) - if err != nil { - return err - } - - return c.NoContent(http.StatusOK) -} - -func (w *chainWebAPI) handleGetChainInfo(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("Invalid chain id: %s", c.Param("chainID"))) - } - - chainRecord, err := w.chainRecordRegistryProvider.ChainRecord(chainID) - if err != nil { - return err - } - if chainRecord == nil { - return httperrors.NotFound("") - } - if !chainRecord.Active { - return c.JSON(http.StatusOK, model.ChainInfo{ - ChainID: model.ChainIDBech32(chainID.String()), - Active: false, - }) - } - chain := w.chains().Get(chainID) - committeeInfo := chain.GetCommitteeInfo() - var dkShare tcrypto.DKShare - if committeeInfo != nil { - // Consider the committee as empty, if there is no current active committee. - dkShare, err = w.dkShareRegistryProvider.LoadDKShare(committeeInfo.Address) - if err != nil { - return err - } - } - - peeringStatus := peeringStatusIncludeSelf(w.network) - candidateNodes, err := getCandidateNodesAccessNodeInfo(chain.GetCandidateNodes()) - if err != nil { - return err - } - chainNodes := chain.GetChainNodes() - inChainNodes := make(map[cryptolib.PublicKeyKey]bool) - - // - // Committee nodes. - cmtNodes := makeCmtNodes(dkShare, peeringStatus, candidateNodes, inChainNodes) - - // - // Access nodes: accepted as access nodes and not included in the committee. - acnNodes := makeAcnNodes(dkShare, chainNodes, peeringStatus, candidateNodes, inChainNodes) - - // - // Candidate nodes have supplied applications, but are not included - // in the committee and to the set of the access nodes. - cndNodes, err := makeCndNodes(peeringStatus, candidateNodes, inChainNodes) - if err != nil { - return err - } - - res := model.ChainInfo{ - ChainID: model.ChainIDBech32(chainID.String()), - Active: chainRecord.Active, - CommitteeNodes: cmtNodes, - AccessNodes: acnNodes, - CandidateNodes: cndNodes, - } - if committeeInfo.Address != nil { - stateAddr := model.NewAddress(committeeInfo.Address) - res.StateAddress = &stateAddr - } - - return c.JSON(http.StatusOK, res) -} - -func peeringStatusIncludeSelf(networkProvider peering.NetworkProvider) map[cryptolib.PublicKeyKey]peering.PeerStatusProvider { - peeringStatus := make(map[cryptolib.PublicKeyKey]peering.PeerStatusProvider) - for _, n := range networkProvider.PeerStatus() { - peeringStatus[n.PubKey().AsKey()] = n - } - peeringStatus[networkProvider.Self().PubKey().AsKey()] = networkProvider.Self().Status() - return peeringStatus -} - -func makeCmtNodes( - dkShare tcrypto.DKShare, - peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, - candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, - inChainNodes map[cryptolib.PublicKeyKey]bool, -) []*model.ChainNodeStatus { - cmtNodes := make([]*model.ChainNodeStatus, 0) - if dkShare != nil { - for _, cmtNodePubKey := range dkShare.GetNodePubKeys() { - cmtNodes = append(cmtNodes, makeChainNodeStatus(cmtNodePubKey, peeringStatus, candidateNodes)) - inChainNodes[cmtNodePubKey.AsKey()] = true - } - } - return cmtNodes -} - -func makeAcnNodes( - dkShare tcrypto.DKShare, - chainNodes []peering.PeerStatusProvider, - peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, - candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, - inChainNodes map[cryptolib.PublicKeyKey]bool, -) []*model.ChainNodeStatus { - acnNodes := make([]*model.ChainNodeStatus, 0) - for _, chainNode := range chainNodes { - acnPubKey := chainNode.PubKey() - skip := false - if dkShare != nil { - for _, cmtNodePubKey := range dkShare.GetNodePubKeys() { - if acnPubKey.AsKey() == cmtNodePubKey.AsKey() { - skip = true - break - } - } - } - if skip { - continue - } - acnNodes = append(acnNodes, makeChainNodeStatus(acnPubKey, peeringStatus, candidateNodes)) - inChainNodes[acnPubKey.AsKey()] = true - } - return acnNodes -} - -func makeCndNodes( - peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, - candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, - inChainNodes map[cryptolib.PublicKeyKey]bool, -) ([]*model.ChainNodeStatus, error) { - cndNodes := make([]*model.ChainNodeStatus, 0) - for _, c := range candidateNodes { - pubKey, err := cryptolib.NewPublicKeyFromBytes(c.NodePubKey) - if err != nil { - return nil, err - } - if _, ok := inChainNodes[pubKey.AsKey()]; ok { - continue // Only include unused candidates here. - } - cndNodes = append(cndNodes, makeChainNodeStatus(pubKey, peeringStatus, candidateNodes)) - } - return cndNodes, nil -} - -func getCandidateNodesAccessNodeInfo(chainCandidateNodes []*governance.AccessNodeInfo) (map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, error) { - candidateNodes := make(map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo) - for _, chainCandidateNode := range chainCandidateNodes { - pubKey, err := cryptolib.NewPublicKeyFromBytes(chainCandidateNode.NodePubKey) - if err != nil { - return nil, err - } - candidateNodes[pubKey.AsKey()] = chainCandidateNode - } - - return candidateNodes, nil -} - -func makeChainNodeStatus( - pubKey *cryptolib.PublicKey, - peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, - candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, -) *model.ChainNodeStatus { - cns := model.ChainNodeStatus{ - Node: model.PeeringNodeStatus{ - PubKey: pubKey.String(), - }, - } - if n, ok := peeringStatus[pubKey.AsKey()]; ok { - cns.Node.NetID = n.NetID() - cns.Node.IsAlive = n.IsAlive() - cns.Node.NumUsers = n.NumUsers() - } - if n, ok := candidateNodes[pubKey.AsKey()]; ok { - cns.ForCommittee = n.ForCommittee - cns.ForAccess = true - cns.AccessAPI = n.AccessAPI - } - return &cns -} diff --git a/packages/webapi/v1/admapi/chainmetrics.go b/packages/webapi/v1/admapi/chainmetrics.go deleted file mode 100644 index 8d20912444..0000000000 --- a/packages/webapi/v1/admapi/chainmetrics.go +++ /dev/null @@ -1,244 +0,0 @@ -package admapi - -import ( - "fmt" - "net/http" - "time" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func addChainMetricsEndpoints(adm echoswagger.ApiGroup, chainsProvider chains.Provider) { - cms := &chainMetricsService{ - chainsProvider, - } - addChainNodeConnMetricsEndpoints(adm, cms) - addChainConsensusMetricsEndpoints(adm, cms) - addChainConcensusPipeMetricsEndpoints(adm, cms) -} - -func addChainNodeConnMetricsEndpoints(adm echoswagger.ApiGroup, cms *chainMetricsService) { - chainExample := &model.NodeConnectionMessagesMetrics{ - OutPublishStateTransaction: &model.NodeConnectionMessageMetrics{ - Total: 3, - LastEvent: time.Now().Add(-2 * time.Millisecond), - LastMessage: "Last sent PublishStateTransaction message structure", - }, - OutPublishGovernanceTransaction: &model.NodeConnectionMessageMetrics{ - Total: 0, - LastEvent: time.Time{}, - LastMessage: "Last sent PublishGovernanceTransaction message structure", - }, - OutPullLatestOutput: &model.NodeConnectionMessageMetrics{ - Total: 15, - LastEvent: time.Now().Add(-10 * time.Second), - LastMessage: "Last sent PullLatestOutput message structure", - }, - OutPullTxInclusionState: &model.NodeConnectionMessageMetrics{ - Total: 28, - LastEvent: time.Now().Add(-5 * time.Second), - LastMessage: "Last sent PullTxInclusionState message structure", - }, - OutPullOutputByID: &model.NodeConnectionMessageMetrics{ - Total: 132, - LastEvent: time.Now().Add(100 * time.Second), - LastMessage: "Last sent PullOutputByID message structure", - }, - InStateOutput: &model.NodeConnectionMessageMetrics{ - Total: 101, - LastEvent: time.Now().Add(-8 * time.Second), - LastMessage: "Last received State output message structure", - }, - InAliasOutput: &model.NodeConnectionMessageMetrics{ - Total: 203, - LastEvent: time.Now().Add(-123 * time.Millisecond), - LastMessage: "Last received AliasOutput message structure", - }, - InOutput: &model.NodeConnectionMessageMetrics{ - Total: 101, - LastEvent: time.Now().Add(-8 * time.Second), - LastMessage: "Last received Output message structure", - }, - InOnLedgerRequest: &model.NodeConnectionMessageMetrics{ - Total: 85, - LastEvent: time.Now().Add(-2 * time.Second), - LastMessage: "Last received OnLedgerRequest message structure", - }, - InTxInclusionState: &model.NodeConnectionMessageMetrics{ - Total: 999, - LastEvent: time.Now().Add(-1 * time.Second), - LastMessage: "Last received TxInclusionState message structure", - }, - } - - example := &model.NodeConnectionMetrics{ - NodeConnectionMessagesMetrics: *chainExample, - InMilestone: &model.NodeConnectionMessageMetrics{ - Total: 1234, - LastEvent: time.Now().Add(1 * time.Second), - LastMessage: "Last received Milestone message structure", - }, - Registered: []model.ChainIDBech32{ - model.NewChainIDBech32(isc.RandomChainID()), - model.NewChainIDBech32(isc.RandomChainID()), - }, - } - - adm.GET(routes.GetChainsNodeConnectionMetrics(), cms.handleGetChainsNodeConnMetrics). - SetDeprecated(). - SetSummary("Get cummulative chains node connection metrics"). - AddResponse(http.StatusOK, "Cummulative chains metrics", example, nil) - - adm.GET(routes.GetChainNodeConnectionMetrics(":chainID"), cms.handleGetChainNodeConnMetrics). - SetDeprecated(). - SetSummary("Get chain node connection metrics for the given chain ID"). - AddParamPath("", "chainID", "ChainID (bech32)"). - AddResponse(http.StatusOK, "Chain metrics", chainExample, nil) -} - -func addChainConsensusMetricsEndpoints(adm echoswagger.ApiGroup, cms *chainMetricsService) { - example := &model.ConsensusWorkflowStatus{ - FlagStateReceived: true, - FlagBatchProposalSent: true, - FlagConsensusBatchKnown: true, - FlagVMStarted: false, - FlagVMResultSigned: false, - FlagTransactionFinalized: false, - FlagTransactionPosted: false, - FlagTransactionSeen: false, - FlagInProgress: true, - - TimeBatchProposalSent: time.Now().Add(-10 * time.Second), - TimeConsensusBatchKnown: time.Now().Add(-5 * time.Second), - TimeVMStarted: time.Time{}, - TimeVMResultSigned: time.Time{}, - TimeTransactionFinalized: time.Time{}, - TimeTransactionPosted: time.Time{}, - TimeTransactionSeen: time.Time{}, - TimeCompleted: time.Time{}, - - CurrentStateIndex: 0, - } - - adm.GET(routes.GetChainConsensusWorkflowStatus(":chainID"), cms.handleGetChainConsensusWorkflowStatus). - SetDeprecated(). - SetSummary("Get chain state statistics for the given chain ID"). - AddParamPath("", "chainID", "ChainID (bech32)"). - AddResponse(http.StatusOK, "Chain consensus stats", example, nil). - AddResponse(http.StatusNotFound, "Chain consensus hasn't been created", nil, nil) -} - -func addChainConcensusPipeMetricsEndpoints(adm echoswagger.ApiGroup, cms *chainMetricsService) { - example := &model.ConsensusPipeMetrics{ - EventStateTransitionMsgPipeSize: 0, - EventPeerLogIndexMsgPipeSize: 0, - EventACSMsgPipeSize: 0, - EventVMResultMsgPipeSize: 0, - EventTimerMsgPipeSize: 0, - } - - adm.GET(routes.GetChainConsensusPipeMetrics(":chainID"), cms.handleGetChainConsensusPipeMetrics). - SetDeprecated(). - SetSummary("Get consensus pipe metrics"). - AddParamPath("", "chainID", "chainID"). - AddResponse(http.StatusOK, "Chain consensus pipe metrics", example, nil). - AddResponse(http.StatusNotFound, "Chain consensus hasn't been created", nil, nil) -} - -type chainMetricsService struct { - chains chains.Provider -} - -func (cssT *chainMetricsService) handleGetChainsNodeConnMetrics(c echo.Context) error { - metrics := cssT.chains().GetNodeConnectionMetrics() - metricsModel := model.NewNodeConnectionMetrics(metrics) - - return c.JSON(http.StatusOK, metricsModel) -} - -func (cssT *chainMetricsService) handleGetChainNodeConnMetrics(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - theChain := cssT.chains().Get(chainID) - if theChain == nil { - return httperrors.NotFound(fmt.Sprintf("Active chain %s not found", chainID)) - } - metrics := theChain.GetNodeConnectionMetrics() - metricsModel := model.NewNodeConnectionMessagesMetrics(metrics) - - return c.JSON(http.StatusOK, metricsModel) -} - -func (cssT *chainMetricsService) handleGetChainConsensusWorkflowStatus(c echo.Context) error { - theChain, err := cssT.getChain(c) - if err != nil { - return err - } - status := theChain.GetConsensusWorkflowStatus() - if status == nil { - return c.NoContent(http.StatusNotFound) - } - - return c.JSON(http.StatusOK, &model.ConsensusWorkflowStatus{ - FlagStateReceived: status.IsStateReceived(), - FlagBatchProposalSent: status.IsBatchProposalSent(), - FlagConsensusBatchKnown: status.IsConsensusBatchKnown(), - FlagVMStarted: status.IsVMStarted(), - FlagVMResultSigned: status.IsVMResultSigned(), - FlagTransactionFinalized: status.IsTransactionFinalized(), - FlagTransactionPosted: status.IsTransactionPosted(), - FlagTransactionSeen: status.IsTransactionSeen(), - FlagInProgress: status.IsInProgress(), - - TimeBatchProposalSent: status.GetBatchProposalSentTime(), - TimeConsensusBatchKnown: status.GetConsensusBatchKnownTime(), - TimeVMStarted: status.GetVMStartedTime(), - TimeVMResultSigned: status.GetVMResultSignedTime(), - TimeTransactionFinalized: status.GetTransactionFinalizedTime(), - TimeTransactionPosted: status.GetTransactionPostedTime(), - TimeTransactionSeen: status.GetTransactionSeenTime(), - TimeCompleted: status.GetCompletedTime(), - - CurrentStateIndex: status.GetCurrentStateIndex(), - }) -} - -func (cssT *chainMetricsService) handleGetChainConsensusPipeMetrics(c echo.Context) error { - theChain, err := cssT.getChain(c) - if err != nil { - return err - } - pipeMetrics := theChain.GetConsensusPipeMetrics() - if pipeMetrics == nil { - return c.NoContent(http.StatusNotFound) - } - return c.JSON(http.StatusOK, &model.ConsensusPipeMetrics{ - EventStateTransitionMsgPipeSize: pipeMetrics.GetEventStateTransitionMsgPipeSize(), - EventPeerLogIndexMsgPipeSize: pipeMetrics.GetEventPeerLogIndexMsgPipeSize(), - EventACSMsgPipeSize: pipeMetrics.GetEventACSMsgPipeSize(), - EventVMResultMsgPipeSize: pipeMetrics.GetEventVMResultMsgPipeSize(), - EventTimerMsgPipeSize: pipeMetrics.GetEventTimerMsgPipeSize(), - }) -} - -func (cssT *chainMetricsService) getChain(c echo.Context) (chain.Chain, error) { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return nil, httperrors.BadRequest(err.Error()) - } - theChain := cssT.chains().Get(chainID) - if theChain == nil { - return nil, httperrors.NotFound(fmt.Sprintf("Active chain %s not found", chainID)) - } - return theChain, nil -} diff --git a/packages/webapi/v1/admapi/chainrecord.go b/packages/webapi/v1/admapi/chainrecord.go deleted file mode 100644 index 313d47e92a..0000000000 --- a/packages/webapi/v1/admapi/chainrecord.go +++ /dev/null @@ -1,124 +0,0 @@ -package admapi - -import ( - "fmt" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func addChainRecordEndpoints(adm echoswagger.ApiGroup, chainRecordRegistryProvider registry.ChainRecordRegistryProvider, chainsProvider chains.Provider) { - rnd1 := isc.RandomChainID() - example := model.ChainRecord{ - ChainID: model.NewChainIDBech32(rnd1), - Active: false, - } - - s := &chainRecordService{chainRecordRegistryProvider, chainsProvider} - - adm.POST(routes.PutChainRecord(), s.handlePutChainRecord). - SetDeprecated(). - SetSummary("Create a new chain record"). - AddParamBody(example, "Record", "Chain record", true) - - adm.GET(routes.GetChainRecord(":chainID"), s.handleGetChainRecord). - SetDeprecated(). - SetSummary("Find the chain record for the given chain ID"). - AddParamPath("", "chainID", "ChainID (bech32)"). - AddResponse(http.StatusOK, "Chain Record", example, nil) - - adm.GET(routes.ListChainRecords(), s.handleGetChainRecordList). - SetDeprecated(). - SetSummary("Get the list of chain records in the node"). - AddResponse(http.StatusOK, "Chain Record", []model.ChainRecord{example}, nil) -} - -type chainRecordService struct { - chainRecordRegistryProvider registry.ChainRecordRegistryProvider - chainsProvider chains.Provider -} - -func (s *chainRecordService) handlePutChainRecord(c echo.Context) error { - var req model.ChainRecord - - if err := c.Bind(&req); err != nil { - return httperrors.BadRequest("Invalid request body") - } - - requestChainRec, err := req.Record() - if err != nil { - return httperrors.BadRequest("Error parsing chain record") - } - - storedChainRec, err := s.chainRecordRegistryProvider.ChainRecord(requestChainRec.ChainID()) - if err != nil { - return err - } - returnStatus := http.StatusAccepted - if storedChainRec != nil { - _, err = s.chainRecordRegistryProvider.UpdateChainRecord( - requestChainRec.ChainID(), - func(rec *registry.ChainRecord) bool { - rec.AccessNodes = requestChainRec.AccessNodes - rec.Active = requestChainRec.Active - return true - }, - ) - if err != nil { - return err - } - } else { - if err := s.chainRecordRegistryProvider.AddChainRecord(requestChainRec); err != nil { - return err - } - returnStatus = http.StatusCreated - } - - // Activate/deactivate the chain accordingly. - if requestChainRec.Active { - if err := s.chainsProvider().Activate(requestChainRec.ChainID()); err != nil { - return err - } - } else if storedChainRec != nil { - if err := s.chainsProvider().Deactivate(requestChainRec.ChainID()); err != nil { - return err - } - } - - return c.NoContent(returnStatus) -} - -func (s *chainRecordService) handleGetChainRecord(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - bd, err := s.chainRecordRegistryProvider.ChainRecord(chainID) - if err != nil { - return err - } - if bd == nil { - return httperrors.NotFound(fmt.Sprintf("Record not found: %s", chainID)) - } - return c.JSON(http.StatusOK, model.NewChainRecord(bd)) -} - -func (s *chainRecordService) handleGetChainRecordList(c echo.Context) error { - lst, err := s.chainRecordRegistryProvider.ChainRecords() - if err != nil { - return err - } - ret := make([]*model.ChainRecord, len(lst)) - for i := range ret { - ret[i] = model.NewChainRecord(lst[i]) - } - return c.JSON(http.StatusOK, ret) -} diff --git a/packages/webapi/v1/admapi/dkshares.go b/packages/webapi/v1/admapi/dkshares.go deleted file mode 100644 index 3ec51045cf..0000000000 --- a/packages/webapi/v1/admapi/dkshares.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package admapi - -// Endpoints for creating and getting Distributed key shares. - -import ( - "encoding/base64" - "fmt" - "net/http" - "time" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/dkg" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/tcrypto" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func addDKSharesEndpoints(adm echoswagger.ApiGroup, dkShareRegistryProvider registry.DKShareRegistryProvider, nodeProvider dkg.NodeProvider) { - requestExample := model.DKSharesPostRequest{ - PeerPubKeys: []string{base64.StdEncoding.EncodeToString([]byte("key"))}, - Threshold: 3, - TimeoutMS: 10000, - } - addr1 := isc.RandomChainID().AsAddress() - infoExample := model.DKSharesInfo{ - Address: addr1.Bech32(parameters.L1().Protocol.Bech32HRP), - SharedPubKey: base64.StdEncoding.EncodeToString([]byte("key")), - PubKeyShares: []string{base64.StdEncoding.EncodeToString([]byte("key"))}, - PeerPubKeys: []string{base64.StdEncoding.EncodeToString([]byte("key"))}, - Threshold: 3, - PeerIndex: nil, - } - - s := &dkSharesService{ - dkShareRegistryProvider: dkShareRegistryProvider, - dkgNode: nodeProvider, - } - - adm.POST(routes.DKSharesPost(), s.handleDKSharesPost). - SetDeprecated(). - AddParamBody(requestExample, "DKSharesPostRequest", "Request parameters", true). - AddResponse(http.StatusOK, "DK shares info", infoExample, nil). - SetSummary("Generate a new distributed key") - - adm.GET(routes.DKSharesGet(":sharedAddress"), s.handleDKSharesGet). - SetDeprecated(). - AddParamPath("", "sharedAddress", "Address of the DK share (hex)"). - AddResponse(http.StatusOK, "DK shares info", infoExample, nil). - SetSummary("Get distributed key properties") -} - -type dkSharesService struct { - dkShareRegistryProvider registry.DKShareRegistryProvider - dkgNode dkg.NodeProvider -} - -func (s *dkSharesService) handleDKSharesPost(c echo.Context) error { - var req model.DKSharesPostRequest - var err error - - if err = c.Bind(&req); err != nil { - return httperrors.BadRequest("Invalid request body.") - } - - if req.PeerPubKeys == nil || len(req.PeerPubKeys) < 1 { - return httperrors.BadRequest("PeerPubKeys are mandatory") - } - - var peerPubKeys []*cryptolib.PublicKey - if req.PeerPubKeys != nil { - peerPubKeys = make([]*cryptolib.PublicKey, len(req.PeerPubKeys)) - for i := range req.PeerPubKeys { - peerPubKey, err := cryptolib.NewPublicKeyFromString(req.PeerPubKeys[i]) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("Invalid PeerPubKeys[%v]=%v", i, req.PeerPubKeys[i])) - } - peerPubKeys[i] = peerPubKey - } - } - - dkShare, err := s.dkgNode().GenerateDistributedKey( - peerPubKeys, - req.Threshold, - 1*time.Second, - 3*time.Second, - time.Duration(req.TimeoutMS)*time.Millisecond, - ) - if err != nil { - if _, ok := err.(dkg.InvalidParamsError); ok { - return httperrors.BadRequest(err.Error()) - } - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - - var response *model.DKSharesInfo - if response, err = makeDKSharesInfo(dkShare); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - return c.JSON(http.StatusOK, response) -} - -func (s *dkSharesService) handleDKSharesGet(c echo.Context) error { - var err error - var dkShare tcrypto.DKShare - var sharedAddress iotago.Address - if _, sharedAddress, err = iotago.ParseBech32(c.Param("sharedAddress")); err != nil { - return echo.NewHTTPError(http.StatusBadRequest, err) - } - if dkShare, err = s.dkShareRegistryProvider.LoadDKShare(sharedAddress); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - var response *model.DKSharesInfo - if response, err = makeDKSharesInfo(dkShare); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - return c.JSON(http.StatusOK, response) -} - -func makeDKSharesInfo(dkShare tcrypto.DKShare) (*model.DKSharesInfo, error) { - var err error - - b, err := dkShare.DSSSharedPublic().MarshalBinary() - if err != nil { - return nil, err - } - sharedPubKey := base64.StdEncoding.EncodeToString(b) - - pubKeyShares := make([]string, len(dkShare.DSSPublicShares())) - for i := range dkShare.DSSPublicShares() { - b, err := dkShare.DSSPublicShares()[i].MarshalBinary() - if err != nil { - return nil, err - } - pubKeyShares[i] = base64.StdEncoding.EncodeToString(b) - } - - peerPubKeys := make([]string, len(dkShare.GetNodePubKeys())) - for i := range dkShare.GetNodePubKeys() { - peerPubKeys[i] = base64.StdEncoding.EncodeToString(dkShare.GetNodePubKeys()[i].AsBytes()) - } - - return &model.DKSharesInfo{ - Address: dkShare.GetAddress().Bech32(parameters.L1().Protocol.Bech32HRP), - SharedPubKey: sharedPubKey, - PubKeyShares: pubKeyShares, - PeerPubKeys: peerPubKeys, - Threshold: dkShare.GetT(), - PeerIndex: dkShare.GetIndex(), - }, nil -} diff --git a/packages/webapi/v1/admapi/endpoints.go b/packages/webapi/v1/admapi/endpoints.go deleted file mode 100644 index 39990d33f1..0000000000 --- a/packages/webapi/v1/admapi/endpoints.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package admapi - -import ( - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/authentication" - "github.com/iotaledger/wasp/packages/authentication/shared/permissions" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/dkg" - "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/users" -) - -func AddEndpoints( - adm echoswagger.ApiGroup, - network peering.NetworkProvider, - tnm peering.TrustedNetworkManager, - userManager *users.UserManager, - chainRecordRegistryProvider registry.ChainRecordRegistryProvider, - dkShareRegistryProvider registry.DKShareRegistryProvider, - nodeIdentityProvider registry.NodeIdentityProvider, - chainsProvider chains.Provider, - nodeProvider dkg.NodeProvider, - shutdownFunc ShutdownFunc, - nodeConnectionMetrics nodeconnmetrics.NodeConnectionMetrics, - authConfig authentication.AuthConfiguration, - nodeOwnerAddresses []string, -) { - claimValidator := func(claims *authentication.WaspClaims) bool { - // The API will be accessible if the token has an 'API' claim - return claims.HasPermission(permissions.API) - } - - authentication.AddV1Authentication(adm.EchoGroup(), userManager, nodeIdentityProvider, authConfig, claimValidator) - addShutdownEndpoint(adm, shutdownFunc) - addNodeOwnerEndpoints(adm, nodeIdentityProvider, nodeOwnerAddresses) - addChainRecordEndpoints(adm, chainRecordRegistryProvider, chainsProvider) - addChainMetricsEndpoints(adm, chainsProvider) - addChainEndpoints(adm, &chainWebAPI{ - chainRecordRegistryProvider: chainRecordRegistryProvider, - dkShareRegistryProvider: dkShareRegistryProvider, - nodeIdentityProvider: nodeIdentityProvider, - chains: chainsProvider, - network: network, - // TODO: what happened to the metrics? - nodeConnectionMetrics: nodeConnectionMetrics, - }) - addDKSharesEndpoints(adm, dkShareRegistryProvider, nodeProvider) - addPeeringEndpoints(adm, chainRecordRegistryProvider, network, tnm) - addAccessNodesEndpoints(adm, chainRecordRegistryProvider, tnm) -} diff --git a/packages/webapi/v1/admapi/node_owner.go b/packages/webapi/v1/admapi/node_owner.go deleted file mode 100644 index 8ce51c7987..0000000000 --- a/packages/webapi/v1/admapi/node_owner.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package admapi - -import ( - "bytes" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -func addNodeOwnerEndpoints(adm echoswagger.ApiGroup, nodeIdentityProvider registry.NodeIdentityProvider, nodeOwnerAddresses []string) { - nos := &nodeOwnerService{ - nodeOwnerAddresses: nodeOwnerAddresses, - } - addCtx := func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - c.Set("reg", nodeIdentityProvider) - return next(c) - } - } - reqExample := model.NodeOwnerCertificateRequest{ - NodePubKey: model.NewBytes([]byte{0, 1, 17}), - OwnerAddress: model.Address("any_address"), - } - resExample := model.NodeOwnerCertificateResponse{ - Certificate: model.NewBytes([]byte{0, 1, 17, 19}), - } - adm.POST(routes.AdmNodeOwnerCertificate(), nos.handleAdmNodeOwnerCertificate, addCtx). - SetDeprecated(). - AddParamBody(reqExample, "Request", "Certificate request", true). - AddResponse(http.StatusOK, "Generated certificate.", resExample, nil). - SetSummary("Provides a certificate, if the node recognizes the owner.") -} - -type nodeOwnerService struct { - nodeOwnerAddresses []string -} - -func (n *nodeOwnerService) handleAdmNodeOwnerCertificate(c echo.Context) error { - nodeIdentityProvider := c.Get("reg").(registry.NodeIdentityProvider) - - var req model.NodeOwnerCertificateRequest - if err := c.Bind(&req); err != nil { - return httperrors.BadRequest("Invalid request body") - } - reqOwnerAddress := req.OwnerAddress.Address() - reqNodePubKeyBytes := req.NodePubKey.Bytes() - - nodeIdentity := nodeIdentityProvider.NodeIdentity() - - // - // Check, if supplied node PubKey matches. - if !bytes.Equal(nodeIdentity.GetPublicKey().AsBytes(), reqNodePubKeyBytes) { - return &httperrors.HTTPError{Code: 400, Message: "Wrong NodePubKey"} - } - - // - // Check, if owner is presented in the configuration. - ownerAuthorized := false - for _, nodeOwnerAddressStr := range n.nodeOwnerAddresses { - _, nodeOwnerAddress, err := iotago.ParseBech32(nodeOwnerAddressStr) - if err != nil { - continue - } - if bytes.Equal(isc.BytesFromAddress(reqOwnerAddress), isc.BytesFromAddress(nodeOwnerAddress)) { - ownerAuthorized = true - break - } - } - if !ownerAuthorized { - return &httperrors.HTTPError{Code: 403, Message: "unauthorized"} - } - - // - // Create the certificate. It consists of signature only. The data is not included. - cert := governance.NewNodeOwnershipCertificate(nodeIdentity, reqOwnerAddress) - resp := model.NodeOwnerCertificateResponse{ - Certificate: model.NewBytes(cert.Bytes()), - } - - return c.JSON(http.StatusOK, resp) -} diff --git a/packages/webapi/v1/admapi/peering.go b/packages/webapi/v1/admapi/peering.go deleted file mode 100644 index ab334fbb6a..0000000000 --- a/packages/webapi/v1/admapi/peering.go +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package admapi - -import ( - "fmt" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - "github.com/samber/lo" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type peeringService struct { - chainRecordRegistryProvider registry.ChainRecordRegistryProvider - network peering.NetworkProvider - networkMgr peering.TrustedNetworkManager -} - -func addPeeringEndpoints(adm echoswagger.ApiGroup, chainRecordRegistryProvider registry.ChainRecordRegistryProvider, network peering.NetworkProvider, tnm peering.TrustedNetworkManager) { - listExample := []*model.PeeringTrustedNode{ - {PubKey: "8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ", NetID: "some-host:9081"}, - {PubKey: "8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiR", NetID: "some-host:9082"}, - } - peeringStatusExample := []*model.PeeringNodeStatus{ - {PubKey: "8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ", IsAlive: true, NumUsers: 1, NetID: "some-host:9081"}, - {PubKey: "8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiR", IsAlive: true, NumUsers: 1, NetID: "some-host:9082"}, - } - p := &peeringService{ - chainRecordRegistryProvider: chainRecordRegistryProvider, - network: network, - networkMgr: tnm, - } - - adm.GET(routes.PeeringSelfGet(), p.handlePeeringSelfGet). - SetDeprecated(). - AddResponse(http.StatusOK, "This node as a peer.", listExample[0], nil). - SetSummary("Basic peer info of the current node.") - - adm.GET(routes.PeeringTrustedList(), p.handlePeeringTrustedList). - SetDeprecated(). - AddResponse(http.StatusOK, "A list of trusted peers.", listExample, nil). - SetSummary("Get a list of trusted peers.") - - adm.GET(routes.PeeringTrustedGet(":pubKey"), p.handlePeeringTrustedGet). - SetDeprecated(). - AddParamPath(listExample[0].PubKey, "pubKey", "Public key of the trusted peer (hex)."). - AddResponse(http.StatusOK, "Trusted peer info.", listExample[0], nil). - SetSummary("Get details on a particular trusted peer.") - - adm.PUT(routes.PeeringTrustedPut(":pubKey"), p.handlePeeringTrustedPut). - SetDeprecated(). - AddParamPath(listExample[0].PubKey, "pubKey", "Public key of the trusted peer (hex)."). - AddParamBody(listExample[0], "PeeringTrustedNode", "Info of the peer to trust.", true). - AddResponse(http.StatusOK, "Trusted peer info.", listExample[0], nil). - SetSummary("Trust the specified peer, the pub key is passed via the path.") - - adm.GET(routes.PeeringGetStatus(), p.handlePeeringGetStatus). - SetDeprecated(). - AddResponse(http.StatusOK, "A list of all peers.", peeringStatusExample, nil). - SetSummary("Basic information about all configured peers.") - - adm.POST(routes.PeeringTrustedPost(), p.handlePeeringTrustedPost). - SetDeprecated(). - AddParamBody(listExample[0], "PeeringTrustedNode", "Info of the peer to trust.", true). - AddResponse(http.StatusOK, "Trusted peer info.", listExample[0], nil). - SetSummary("Trust the specified peer.") - - adm.DELETE(routes.PeeringTrustedDelete(":pubKey"), p.handlePeeringTrustedDelete). - SetDeprecated(). - AddParamPath(listExample[0].PubKey, "pubKey", "Public key of the trusted peer (hex)."). - SetSummary("Distrust the specified peer.") -} - -func (p *peeringService) handlePeeringSelfGet(c echo.Context) error { - resp := model.PeeringTrustedNode{ - PubKey: iotago.EncodeHex(p.network.Self().PubKey().AsBytes()), - NetID: p.network.Self().NetID(), - } - return c.JSON(http.StatusOK, resp) -} - -func (p *peeringService) handlePeeringGetStatus(c echo.Context) error { - peeringStatus := p.network.PeerStatus() - - peers := make([]model.PeeringNodeStatus, len(peeringStatus)) - - for k, v := range peeringStatus { - peers[k] = model.PeeringNodeStatus{ - PubKey: iotago.EncodeHex(v.PubKey().AsBytes()), - NetID: v.NetID(), - IsAlive: v.IsAlive(), - NumUsers: v.NumUsers(), - } - } - - return c.JSON(http.StatusOK, peers) -} - -func (p *peeringService) handlePeeringTrustedList(c echo.Context) error { - trustedPeers, err := p.networkMgr.TrustedPeers() - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - response := make([]*model.PeeringTrustedNode, len(trustedPeers)) - for i := range trustedPeers { - response[i] = model.NewPeeringTrustedNode(trustedPeers[i]) - } - return c.JSON(http.StatusOK, response) -} - -func (p *peeringService) handlePeeringTrustedPut(c echo.Context) error { - var err error - pubKeyStr := c.Param("pubKey") - req := model.PeeringTrustedNode{} - if err = c.Bind(&req); err != nil { - return httperrors.BadRequest("Invalid request body.") - } - if req.PubKey == "" { - req.PubKey = pubKeyStr - } - if req.PubKey != pubKeyStr { - return httperrors.BadRequest("Pub keys do not match.") - } - pubKey, err := cryptolib.NewPublicKeyFromString(req.PubKey) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - tp, err := p.networkMgr.TrustPeer(pubKey, req.NetID) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - return c.JSON(http.StatusOK, model.NewPeeringTrustedNode(tp)) -} - -func (p *peeringService) handlePeeringTrustedPost(c echo.Context) error { - var err error - req := model.PeeringTrustedNode{} - if err = c.Bind(&req); err != nil { - return httperrors.BadRequest("Invalid request body.") - } - pubKey, err := cryptolib.NewPublicKeyFromString(req.PubKey) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - tp, err := p.networkMgr.TrustPeer(pubKey, req.NetID) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - return c.JSON(http.StatusOK, model.NewPeeringTrustedNode(tp)) -} - -func (p *peeringService) handlePeeringTrustedGet(c echo.Context) error { - var err error - pubKeyStr := c.Param("pubKey") - pubKey, err := cryptolib.NewPublicKeyFromString(pubKeyStr) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - tps, err := p.networkMgr.TrustedPeers() - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - for _, tp := range tps { - if tp.PubKey().Equals(pubKey) { - return c.JSON(http.StatusOK, model.NewPeeringTrustedNode(tp)) - } - } - return httperrors.NotFound("peer not trusted") -} - -func (p *peeringService) handlePeeringTrustedDelete(c echo.Context) error { - var err error - pubKeyStr := c.Param("pubKey") - pubKey, err := cryptolib.NewPublicKeyFromString(pubKeyStr) - if err != nil { - return httperrors.BadRequest(err.Error()) - } - tp, err := p.networkMgr.DistrustPeer(pubKey) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err) - } - if tp == nil { - return c.NoContent(http.StatusOK) - } - // remove any access nodes for the distrusted peer - chainRecs, err := p.chainRecordRegistryProvider.ChainRecords() - if err != nil { - return httperrors.ServerError("Peer trust removed, but errored when trying to get chain list from registry") - } - chainRecsToModify := lo.Filter(chainRecs, func(r *registry.ChainRecord, _ int) bool { - return lo.ContainsBy(r.AccessNodes, func(p *cryptolib.PublicKey) bool { - return p.Equals(pubKey) - }) - }) - for _, r := range chainRecsToModify { - _, err = p.chainRecordRegistryProvider.UpdateChainRecord(r.ID(), func(rec *registry.ChainRecord) bool { - return rec.RemoveAccessNode(pubKey) - }) - if err != nil { - return httperrors.ServerError(fmt.Sprintf("Peer trust removed, but errored when trying to save chain record %s", r.ChainID())) - } - } - return c.JSON(http.StatusOK, model.NewPeeringTrustedNode(tp)) -} diff --git a/packages/webapi/v1/admapi/shutdown.go b/packages/webapi/v1/admapi/shutdown.go deleted file mode 100644 index 23bd35e33e..0000000000 --- a/packages/webapi/v1/admapi/shutdown.go +++ /dev/null @@ -1,32 +0,0 @@ -package admapi - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type ShutdownFunc func() - -type shutdownService struct { - shutdownFunc ShutdownFunc -} - -func addShutdownEndpoint(adm echoswagger.ApiGroup, shutdown ShutdownFunc) { - s := &shutdownService{shutdown} - - adm.GET(routes.Shutdown(), s.handleShutdown). - SetDeprecated(). - SetSummary("Shut down the node") -} - -// handleShutdown gracefully shuts down the server. -// This endpoint is needed for integration tests, because shutting down via an interrupt -// signal does not work on Windows. -func (s *shutdownService) handleShutdown(c echo.Context) error { - s.shutdownFunc() - return c.String(http.StatusOK, "Shutting down...") -} diff --git a/packages/webapi/v1/endpoints.go b/packages/webapi/v1/endpoints.go deleted file mode 100644 index 78d5193378..0000000000 --- a/packages/webapi/v1/endpoints.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package v1 - -import ( - "time" - - "github.com/pangpanglabs/echoswagger/v2" - - loggerpkg "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/wasp/packages/authentication" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/dkg" - "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/users" - "github.com/iotaledger/wasp/packages/webapi/v1/admapi" - "github.com/iotaledger/wasp/packages/webapi/v1/evm" - "github.com/iotaledger/wasp/packages/webapi/v1/info" - "github.com/iotaledger/wasp/packages/webapi/v1/reqstatus" - "github.com/iotaledger/wasp/packages/webapi/v1/request" - "github.com/iotaledger/wasp/packages/webapi/v1/state" -) - -func Init( - logger *loggerpkg.Logger, - server echoswagger.ApiRoot, - waspVersion string, - network peering.NetworkProvider, - tnm peering.TrustedNetworkManager, - userManager *users.UserManager, - chainRecordRegistryProvider registry.ChainRecordRegistryProvider, - dkShareRegistryProvider registry.DKShareRegistryProvider, - nodeIdentityProvider registry.NodeIdentityProvider, - chainsProvider chains.Provider, - dkgNodeProvider dkg.NodeProvider, - shutdownFunc admapi.ShutdownFunc, - nodeConnectionMetrics nodeconnmetrics.NodeConnectionMetrics, - authConfig authentication.AuthConfiguration, - nodeOwnerAddresses []string, - apiCacheTTL time.Duration, - publisherPort int, -) { - pub := server.Group("public", "").SetDescription("Public endpoints") - addWebSocketEndpoint(pub, logger) - - info.AddEndpoints(pub, waspVersion, network, publisherPort) - reqstatus.AddEndpoints(pub, chainsProvider.ChainProvider()) - state.AddEndpoints(pub, chainsProvider) - evm.AddEndpoints(pub, chainsProvider, network.Self().PubKey) - request.AddEndpoints( - pub, - chainsProvider.ChainProvider(), - network.Self().PubKey(), - apiCacheTTL, - ) - - adm := server.Group("admin", "").SetDescription("Admin endpoints") - - admapi.AddEndpoints( - adm, - network, - tnm, - userManager, - chainRecordRegistryProvider, - dkShareRegistryProvider, - nodeIdentityProvider, - chainsProvider, - dkgNodeProvider, - shutdownFunc, - nodeConnectionMetrics, - authConfig, - nodeOwnerAddresses, - ) - - logger.Infof("added web api endpoints") -} diff --git a/packages/webapi/v1/evm/jsonrpc.go b/packages/webapi/v1/evm/jsonrpc.go deleted file mode 100644 index d1f373bbcf..0000000000 --- a/packages/webapi/v1/evm/jsonrpc.go +++ /dev/null @@ -1,126 +0,0 @@ -package evm - -import ( - "errors" - "fmt" - "net/http" - "sync" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rpc" - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/evm/evmtypes" - "github.com/iotaledger/wasp/packages/evm/jsonrpc" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/packages/vm/core/evm" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type jsonRPCService struct { - chains chains.Provider - nodePubKey func() *cryptolib.PublicKey - chainServers map[isc.ChainID]*chainServer - chainServersMutex sync.Mutex -} - -type chainServer struct { - backend *jsonrpc.WaspEVMBackend - rpc *rpc.Server -} - -func AddEndpoints(server echoswagger.ApiGroup, allChains chains.Provider, nodePubKey func() *cryptolib.PublicKey) { - j := &jsonRPCService{ - chains: allChains, - nodePubKey: nodePubKey, - chainServers: make(map[isc.ChainID]*chainServer), - } - server.EchoGroup().Any(routes.EVMJSONRPC(":chainID"), j.handleJSONRPC) - - reqid := model.NewRequestID(isc.NewRequestID(iotago.TransactionID{}, 0)) - - server.GET(routes.RequestIDByEVMTransactionHash(":chainID", ":txHash"), j.handleRequestID). - SetDeprecated(). - SetSummary("Get the ISC request ID for the given Ethereum transaction hash"). - AddParamPath("", "chainID", "ChainID (bech32-encoded)"). - AddParamPath("", "txHash", "Transaction hash (hex-encoded)"). - AddResponse(http.StatusOK, "Request ID", "", nil). - AddResponse(http.StatusNotFound, "Request ID not found", reqid, nil) -} - -func (j *jsonRPCService) getChainServer(c echo.Context) (*chainServer, error) { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return nil, httperrors.BadRequest(fmt.Sprintf("Invalid chain ID: %+v", c.Param("chainID"))) - } - - j.chainServersMutex.Lock() - defer j.chainServersMutex.Unlock() - - if j.chainServers[chainID] == nil { - chain := j.chains().Get(chainID) - if chain == nil { - return nil, httperrors.NotFound(fmt.Sprintf("Chain not found: %+v", c.Param("chainID"))) - } - - nodePubKey := j.nodePubKey() - if nodePubKey == nil { - return nil, errors.New("node is not authenticated") - } - - backend := jsonrpc.NewWaspEVMBackend(chain, nodePubKey, parameters.L1().BaseToken) - - var evmChainID uint16 - { - r, err := backend.ISCCallView(backend.ISCLatestState(), evm.Contract.Name, evm.FuncGetChainID.Name, nil) - if err != nil { - return nil, err - } - evmChainID, err = evmtypes.DecodeChainID(r.MustGet(evm.FieldResult)) - if err != nil { - return nil, err - } - } - - j.chainServers[chainID] = &chainServer{ - backend: backend, - rpc: jsonrpc.NewServer( - jsonrpc.NewEVMChain(backend, evmChainID), - jsonrpc.NewAccountManager(nil), - ), - } - } - - return j.chainServers[chainID], nil -} - -func (j *jsonRPCService) handleJSONRPC(c echo.Context) error { - server, err := j.getChainServer(c) - if err != nil { - return err - } - server.rpc.ServeHTTP(c.Response(), c.Request()) - return nil -} - -func (j *jsonRPCService) handleRequestID(c echo.Context) error { - server, err := j.getChainServer(c) - if err != nil { - return err - } - - txHash := common.HexToHash(c.Param("txHash")) - - reqID, ok := server.backend.RequestIDByTransactionHash(txHash) - if !ok { - return httperrors.NotFound("not found") - } - return c.JSON(http.StatusOK, model.NewRequestID(reqID)) -} diff --git a/packages/webapi/v1/httperrors/errorhandler.go b/packages/webapi/v1/httperrors/errorhandler.go deleted file mode 100644 index aa8e73906a..0000000000 --- a/packages/webapi/v1/httperrors/errorhandler.go +++ /dev/null @@ -1,23 +0,0 @@ -package httperrors - -import ( - "net/http" - - "github.com/labstack/echo/v4" -) - -// HTTPErrorHandler must be hooked to an echo server to render instances -// of HTTPError as JSON -func HTTPErrorHandler(err error, c echo.Context) { - he, ok := err.(*HTTPError) - if ok { - if !c.Response().Committed { - if c.Request().Method == http.MethodHead { // Issue #608 - err = c.NoContent(he.Code) - } else { - err = c.JSON(he.Code, he) - } - } - } - c.Echo().DefaultHTTPErrorHandler(err, c) -} diff --git a/packages/webapi/v1/httperrors/errors.go b/packages/webapi/v1/httperrors/errors.go deleted file mode 100644 index 4288fd26c6..0000000000 --- a/packages/webapi/v1/httperrors/errors.go +++ /dev/null @@ -1,37 +0,0 @@ -package httperrors - -import ( - "net/http" -) - -// HTTPError implements the Go error interface, and includes an HTTP response code. -// Any webapi endpoint can return an instance of HTTPError, and it will be rendered -// as JSON in the response. -type HTTPError struct { - Code int - Message string -} - -func (he *HTTPError) Error() string { - return he.Message -} - -func BadRequest(message string) *HTTPError { - return &HTTPError{Code: http.StatusBadRequest, Message: message} -} - -func NotFound(message string) *HTTPError { - return &HTTPError{Code: http.StatusNotFound, Message: message} -} - -func Conflict(message string) *HTTPError { - return &HTTPError{Code: http.StatusConflict, Message: message} -} - -func Timeout(message string) *HTTPError { - return &HTTPError{Code: http.StatusRequestTimeout, Message: message} -} - -func ServerError(message string) *HTTPError { - return &HTTPError{Code: http.StatusInternalServerError, Message: message} -} diff --git a/packages/webapi/v1/info/info.go b/packages/webapi/v1/info/info.go deleted file mode 100644 index db3bba96c4..0000000000 --- a/packages/webapi/v1/info/info.go +++ /dev/null @@ -1,39 +0,0 @@ -package info - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type infoService struct { - waspVersion string - network peering.NetworkProvider - publisherPort int -} - -func AddEndpoints(server echoswagger.ApiRouter, waspVersion string, network peering.NetworkProvider, publisherPort int) { - s := &infoService{ - waspVersion: waspVersion, - network: network, - publisherPort: publisherPort, - } - - server.GET(routes.Info(), s.handleInfo). - SetDeprecated(). - SetSummary("Get information about the node"). - AddResponse(http.StatusOK, "Node properties", model.InfoResponse{}, nil) -} - -func (s *infoService) handleInfo(c echo.Context) error { - return c.JSON(http.StatusOK, model.InfoResponse{ - Version: s.waspVersion, - NetworkID: s.network.Self().NetID(), - PublisherPort: s.publisherPort, - }) -} diff --git a/packages/webapi/v1/model/address.go b/packages/webapi/v1/model/address.go deleted file mode 100644 index 9711b33281..0000000000 --- a/packages/webapi/v1/model/address.go +++ /dev/null @@ -1,42 +0,0 @@ -package model - -import ( - "encoding/json" - "fmt" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/parameters" -) - -// Address is the string representation of iotago.Address -type Address string - -func NewAddress(address iotago.Address) Address { - return Address(address.Bech32(parameters.L1().Protocol.Bech32HRP)) -} - -func (a Address) MarshalJSON() ([]byte, error) { - return json.Marshal(string(a)) -} - -func (a *Address) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - _, _, err := iotago.ParseBech32(s) - if err != nil { - *a = Address("") - return fmt.Errorf("input: %s, %w", s, err) - } - *a = Address(s) - return nil -} - -func (a Address) Address() iotago.Address { - _, addr, err := iotago.ParseBech32(string(a)) - if err != nil { - panic(err) - } - return addr -} diff --git a/packages/webapi/v1/model/blob.go b/packages/webapi/v1/model/blob.go deleted file mode 100644 index a9e9c729ae..0000000000 --- a/packages/webapi/v1/model/blob.go +++ /dev/null @@ -1,20 +0,0 @@ -package model - -import "github.com/iotaledger/wasp/packages/hashing" - -type BlobData struct { - Data Bytes `swagger:"desc(Blob content (base64))"` -} - -func NewBlobData(data []byte) *BlobData { - return &BlobData{Data: NewBytes(data)} -} - -type BlobInfo struct { - Exists bool `json:"exists" swagger:"desc(Whether or not the blob exists in the registry)"` - Hash HashValue `json:"hash" swagger:"desc(Hash of the blob)"` -} - -func NewBlobInfo(exists bool, hash hashing.HashValue) *BlobInfo { - return &BlobInfo{Exists: exists, Hash: NewHashValue(hash)} -} diff --git a/packages/webapi/v1/model/bytes.go b/packages/webapi/v1/model/bytes.go deleted file mode 100644 index 129dad3a37..0000000000 --- a/packages/webapi/v1/model/bytes.go +++ /dev/null @@ -1,45 +0,0 @@ -package model - -import ( - "encoding/base64" - "encoding/json" -) - -// Bytes is the base64 representation of a byte slice. -// It is intended to be a replacement for any []byte attribute in JSON models. -// Normally it shouldn't be necessary since the standard json package already -// handles []byte data, but this makes sure that the swagger documentation -// shows examples correctly (instead of as if a []byte was json-encoded as an -// array of ints). -type Bytes string - -func NewBytes(data []byte) Bytes { - return Bytes(base64.StdEncoding.EncodeToString(data)) -} - -func (b Bytes) MarshalJSON() ([]byte, error) { - return json.Marshal(string(b)) -} - -func (b *Bytes) UnmarshalJSON(data []byte) error { - var s string - if err := json.Unmarshal(data, &s); err != nil { - return err - } - // verify encoding - _, err := base64.StdEncoding.DecodeString(s) - if err != nil { - return err - } - *b = Bytes(s) - return err -} - -func (b Bytes) Bytes() []byte { - data, err := base64.StdEncoding.DecodeString(string(b)) - if err != nil { - // encoding should be already verified - panic(err) - } - return data -} diff --git a/packages/webapi/v1/model/chain_info.go b/packages/webapi/v1/model/chain_info.go deleted file mode 100644 index f62aa284da..0000000000 --- a/packages/webapi/v1/model/chain_info.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package model - -type ChainInfo struct { - ChainID ChainIDBech32 `json:"chainId" swagger:"desc(ChainID bech32)"` - Active bool `json:"active" swagger:"desc(Whether or not the chain is active)"` - StateAddress *Address `json:"stateAddress" swagger:"desc(State address, if we are part of it.)"` - CommitteeNodes []*ChainNodeStatus `json:"committeeNodes" swagger:"desc(Committee nodes and their peering info.)"` - AccessNodes []*ChainNodeStatus `json:"accessNodes" swagger:"desc(Access nodes and their peering info.)"` - CandidateNodes []*ChainNodeStatus `json:"candidateNodes" swagger:"desc(Candidate nodes and their peering info.)"` -} - -type ChainNodeStatus struct { - Node PeeringNodeStatus - ForCommittee bool - ForAccess bool - AccessAPI string -} diff --git a/packages/webapi/v1/model/chain_record.go b/packages/webapi/v1/model/chain_record.go deleted file mode 100644 index 8043b68a62..0000000000 --- a/packages/webapi/v1/model/chain_record.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package model - -import ( - "github.com/samber/lo" - - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/registry" -) - -type ChainRecord struct { - ChainID ChainIDBech32 `json:"chainId" swagger:"desc(ChainID (bech32))"` - Active bool `json:"active" swagger:"desc(Whether or not the chain is active)"` - AccessNodes []string `json:"accessNodes" swagger:"desc(list of access nodes public keys, hex encoded)"` -} - -func NewChainRecord(rec *registry.ChainRecord) *ChainRecord { - chainID := rec.ChainID() - return &ChainRecord{ - ChainID: NewChainIDBech32(chainID), - Active: rec.Active, - AccessNodes: lo.Map(rec.AccessNodes, func(accessNode *cryptolib.PublicKey, _ int) string { - return accessNode.String() - }), - } -} - -func (bd *ChainRecord) Record() (*registry.ChainRecord, error) { - accessNodes := make([]*cryptolib.PublicKey, len(bd.AccessNodes)) - - for i, pubKeyStr := range bd.AccessNodes { - pubKey, err := cryptolib.NewPublicKeyFromString(pubKeyStr) - if err != nil { - return nil, err - } - accessNodes[i] = pubKey - } - rec := registry.NewChainRecord(bd.ChainID.ChainID(), bd.Active, accessNodes) - return rec, nil -} diff --git a/packages/webapi/v1/model/chainid.go b/packages/webapi/v1/model/chainid.go deleted file mode 100644 index dcc75c0b71..0000000000 --- a/packages/webapi/v1/model/chainid.go +++ /dev/null @@ -1,41 +0,0 @@ -package model - -import ( - "encoding/json" - "fmt" - - "github.com/iotaledger/wasp/packages/isc" -) - -// ChainIDBech32 is the string representation of isc.ChainIDBech32 (bech32) -type ChainIDBech32 string - -func NewChainIDBech32(chainID isc.ChainID) ChainIDBech32 { - return ChainIDBech32(chainID.String()) -} - -func (ch ChainIDBech32) MarshalJSON() ([]byte, error) { - return json.Marshal(string(ch)) -} - -func (ch *ChainIDBech32) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - _, err := isc.ChainIDFromString(s) - if err != nil { - *ch = ChainIDBech32("") - return fmt.Errorf("input: %s, %w", s, err) - } - *ch = ChainIDBech32(s) - return nil -} - -func (ch ChainIDBech32) ChainID() isc.ChainID { - chainID, err := isc.ChainIDFromString(string(ch)) - if err != nil { - panic(err) - } - return chainID -} diff --git a/packages/webapi/v1/model/consensus_metrics.go b/packages/webapi/v1/model/consensus_metrics.go deleted file mode 100644 index c21afc4e8c..0000000000 --- a/packages/webapi/v1/model/consensus_metrics.go +++ /dev/null @@ -1,36 +0,0 @@ -package model - -import ( - "time" -) - -type ConsensusWorkflowStatus struct { - FlagStateReceived bool `json:"flagStateReceived" swagger:"desc(Shows if state output is received in current consensus iteration)"` - FlagBatchProposalSent bool `json:"flagBatchProposalSent" swagger:"desc(Shows if batch proposal is sent out in current consensus iteration)"` - FlagConsensusBatchKnown bool `json:"flagConsensusBatchKnown" swagger:"desc(Shows if consensus on batch is reached and known in current consensus iteration)"` - FlagVMStarted bool `json:"flagVMStarted" swagger:"desc(Shows if virtual machine is started in current consensus iteration)"` - FlagVMResultSigned bool `json:"flagVMResultSigned" swagger:"desc(Shows if virtual machine has returned its results in current consensus iteration)"` - FlagTransactionFinalized bool `json:"flagTransactionFinalized" swagger:"desc(Shows if consensus on transaction is reached in current consensus iteration)"` - FlagTransactionPosted bool `json:"flagTransactionPosted" swagger:"desc(Shows if transaction is posted to L1 in current consensus iteration)"` - FlagTransactionSeen bool `json:"flagTransactionSeen" swagger:"desc(Shows if L1 reported that it has seen the transaction of current consensus iteration)"` - FlagInProgress bool `json:"flagInProgress" swagger:"desc(Shows if consensus algorithm is still not completed in current consensus iteration)"` - - TimeBatchProposalSent time.Time `json:"timeBatchProposalSent" swagger:"desc(Shows when batch proposal was last sent out in current consensus iteration)"` - TimeConsensusBatchKnown time.Time `json:"timeConsensusBatchKnown" swagger:"desc(Shows when ACS results of consensus on batch was last received in current consensus iteration)"` - TimeVMStarted time.Time `json:"timeVMStarted" swagger:"desc(Shows when virtual machine was last started in current consensus iteration)"` - TimeVMResultSigned time.Time `json:"timeVMResultSigned" swagger:"desc(Shows when virtual machine results were last received and signed in current consensus iteration)"` - TimeTransactionFinalized time.Time `json:"timeTransactionFinalized" swagger:"desc(Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration)"` - TimeTransactionPosted time.Time `json:"timeTransactionPosted" swagger:"desc(Shows when transaction was last posted to L1 in current consensus iteration)"` - TimeTransactionSeen time.Time `json:"timeTransactionSeen" swagger:"desc(Shows when algorithm last noted that transaction hadd been seen by L1 in current consensus iteration)"` - TimeCompleted time.Time `json:"timeCompleted" swagger:"desc(Shows when algorithm was last completed in current consensus iteration)"` - - CurrentStateIndex uint32 `json:"currentStateIndex" swagger:"desc(Shows current state index of the consensus)"` -} - -type ConsensusPipeMetrics struct { - EventStateTransitionMsgPipeSize int - EventPeerLogIndexMsgPipeSize int - EventACSMsgPipeSize int - EventVMResultMsgPipeSize int - EventTimerMsgPipeSize int -} diff --git a/packages/webapi/v1/model/dkshares.go b/packages/webapi/v1/model/dkshares.go deleted file mode 100644 index 4e8388360b..0000000000 --- a/packages/webapi/v1/model/dkshares.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package model - -// DKSharesPostRequest is a POST request for creating new DKShare. -type DKSharesPostRequest struct { - PeerPubKeys []string `json:"peerPubKeys" swagger:"desc(Optional, base64 encoded public keys of the peers generating the DKS.)"` - Threshold uint16 `json:"threshold" swagger:"desc(Should be =< len(PeerPubKeys))"` - TimeoutMS uint32 `json:"timeoutMS" swagger:"desc(Timeout in milliseconds.)"` -} - -// DKSharesInfo stands for the DKShare representation, returned by the GET and POST methods. -type DKSharesInfo struct { - Address string `json:"address" swagger:"desc(New generated shared address.)"` - SharedPubKey string `json:"sharedPubKey" swagger:"desc(Shared public key (base64-encoded).)"` - PubKeyShares []string `json:"pubKeyShares" swagger:"desc(Public key shares for all the peers (base64-encoded).)"` - PeerPubKeys []string `json:"peerPubKeys" swagger:"desc(Public keys of the nodes sharing the key (base64-encoded).)"` - Threshold uint16 `json:"threshold"` - PeerIndex *uint16 `json:"peerIndex" swagger:"desc(Index of the node returning the share, if it is a member of the sharing group.)"` -} diff --git a/packages/webapi/v1/model/hash.go b/packages/webapi/v1/model/hash.go deleted file mode 100644 index c90ccca512..0000000000 --- a/packages/webapi/v1/model/hash.go +++ /dev/null @@ -1,41 +0,0 @@ -package model - -import ( - "encoding/json" - - "github.com/iotaledger/wasp/packages/hashing" -) - -// HashValue is the hex representation of a hashing.HashValue -type HashValue string - -func NewHashValue(h hashing.HashValue) HashValue { - return HashValue(h.String()) -} - -func (h HashValue) MarshalJSON() ([]byte, error) { - return json.Marshal(string(h)) -} - -func (h *HashValue) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - // verify encoding - _, err := hashing.HashValueFromHex(s) - if err != nil { - return err - } - *h = HashValue(s) - return nil -} - -func (h HashValue) HashValue() hashing.HashValue { - r, err := hashing.HashValueFromHex(string(h)) - if err != nil { - // encoding should be already verified - panic(err) - } - return r -} diff --git a/packages/webapi/v1/model/httperror.go b/packages/webapi/v1/model/httperror.go deleted file mode 100644 index fea47be998..0000000000 --- a/packages/webapi/v1/model/httperror.go +++ /dev/null @@ -1,34 +0,0 @@ -package model - -import ( - "errors" - "fmt" - "net/http" -) - -// HTTPError is the standard error response for all webapi endpoints, and also implements -// the Go error interface. -type HTTPError struct { - // StatusCode is the associated HTTP status code (default: htttp.StatusInternalServerError) - StatusCode int - - // Message is the error message - Message string -} - -// NewHTTPError creates a new HTTPError -func NewHTTPError(statusCode int, message string) *HTTPError { - return &HTTPError{Message: message, StatusCode: statusCode} -} - -// Error implements the Go error interface -func (e *HTTPError) Error() string { - return fmt.Sprintf("%d: %s", e.StatusCode, e.Message) -} - -// IsHTTPNotFound returns true if the error is an HTTPError with status code http.StatusNotFound -func IsHTTPNotFound(e error) bool { - var he *HTTPError - ok := errors.As(e, &he) - return ok && he.StatusCode == http.StatusNotFound -} diff --git a/packages/webapi/v1/model/info.go b/packages/webapi/v1/model/info.go deleted file mode 100644 index 79e851f386..0000000000 --- a/packages/webapi/v1/model/info.go +++ /dev/null @@ -1,7 +0,0 @@ -package model - -type InfoResponse struct { - Version string `json:"version" swagger:"desc(Wasp version)"` - NetworkID string `json:"networkId" swagger:"desc('hostname:port'; uniquely identifies the node)"` - PublisherPort int `json:"publisherPort" swagger:"desc(Nanomsg port that exposes publisher messages)"` -} diff --git a/packages/webapi/v1/model/node_connection_metrics.go b/packages/webapi/v1/model/node_connection_metrics.go deleted file mode 100644 index 96cde05c1e..0000000000 --- a/packages/webapi/v1/model/node_connection_metrics.go +++ /dev/null @@ -1,71 +0,0 @@ -package model - -import ( - "fmt" - "time" - - "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" -) - -type NodeConnectionMessageMetrics struct { - Total uint32 `json:"total" swagger:"desc(Total number of messages sent/received)"` - LastEvent time.Time `json:"lastEvent" swagger:"desc(Last time the message was sent/received)"` - LastMessage string `json:"lastMessage" swagger:"desc(The print out of the last message)"` -} - -type NodeConnectionMessagesMetrics struct { - OutPublishStateTransaction *NodeConnectionMessageMetrics `json:"outPublishStateTransaction" swagger:"desc(Stats of sent out PublishStateTransaction messages)"` - OutPublishGovernanceTransaction *NodeConnectionMessageMetrics `json:"outPublishGovernanceTransaction" swagger:"desc(Stats of sent out PublishGovernanceTransaction messages)"` - OutPullLatestOutput *NodeConnectionMessageMetrics `json:"outPullLatestOutput" swagger:"desc(Stats of sent out PullLatestOutput messages)"` - OutPullTxInclusionState *NodeConnectionMessageMetrics `json:"outPullTxInclusionState" swagger:"desc(Stats of sent out PullTxInclusionState messages)"` - OutPullOutputByID *NodeConnectionMessageMetrics `json:"outPullOutputByID" swagger:"desc(Stats of sent out PullOutputByID messages)"` - InStateOutput *NodeConnectionMessageMetrics `json:"inStateOutput" swagger:"desc(Stats of received State output messages)"` - InAliasOutput *NodeConnectionMessageMetrics `json:"inAliasOutput" swagger:"desc(Stats of received AliasOutput messages)"` - InOutput *NodeConnectionMessageMetrics `json:"inOutput" swagger:"desc(Stats of received Output messages)"` - InOnLedgerRequest *NodeConnectionMessageMetrics `json:"inOnLedgerRequest" swagger:"desc(Stats of received OnLedgerRequest messages)"` - InTxInclusionState *NodeConnectionMessageMetrics `json:"inTxInclusionState" swagger:"desc(Stats of received TxInclusionState messages)"` -} - -type NodeConnectionMetrics struct { - NodeConnectionMessagesMetrics `json:"nodeConnectionMessagesMetrics"` - InMilestone *NodeConnectionMessageMetrics `json:"inMilestone" swagger:"desc(Stats of received Milestone messages)"` - Registered []ChainIDBech32 `json:"registered" swagger:"desc(Chain IDs of the chains registered to receiving L1 events)"` -} - -func NewNodeConnectionMetrics(metrics nodeconnmetrics.NodeConnectionMetrics) *NodeConnectionMetrics { - ncmm := NewNodeConnectionMessagesMetrics(metrics) - registered := metrics.GetRegistered() - r := make([]ChainIDBech32, len(registered)) - for i := range r { - r[i] = NewChainIDBech32(registered[i]) - } - return &NodeConnectionMetrics{ - NodeConnectionMessagesMetrics: *ncmm, - InMilestone: NewNodeConnectionMessageMetrics(metrics.GetInMilestone()), - Registered: r, - } -} - -func NewNodeConnectionMessagesMetrics(metrics nodeconnmetrics.NodeConnectionMessagesMetrics) *NodeConnectionMessagesMetrics { - return &NodeConnectionMessagesMetrics{ - OutPublishStateTransaction: NewNodeConnectionMessageMetrics(metrics.GetOutPublishStateTransaction()), - OutPublishGovernanceTransaction: NewNodeConnectionMessageMetrics(metrics.GetOutPublishGovernanceTransaction()), - OutPullLatestOutput: NewNodeConnectionMessageMetrics(metrics.GetOutPullLatestOutput()), - OutPullTxInclusionState: NewNodeConnectionMessageMetrics(metrics.GetOutPullTxInclusionState()), - OutPullOutputByID: NewNodeConnectionMessageMetrics(metrics.GetOutPullOutputByID()), - - InStateOutput: NewNodeConnectionMessageMetrics(metrics.GetInStateOutput()), - InAliasOutput: NewNodeConnectionMessageMetrics(metrics.GetInAliasOutput()), - InOutput: NewNodeConnectionMessageMetrics(metrics.GetInOutput()), - InOnLedgerRequest: NewNodeConnectionMessageMetrics(metrics.GetInOnLedgerRequest()), - InTxInclusionState: NewNodeConnectionMessageMetrics(metrics.GetInTxInclusionState()), - } -} - -func NewNodeConnectionMessageMetrics[T any](metrics nodeconnmetrics.NodeConnectionMessageMetrics[T]) *NodeConnectionMessageMetrics { - return &NodeConnectionMessageMetrics{ - Total: metrics.GetMessageTotal(), - LastEvent: metrics.GetLastEvent(), - LastMessage: fmt.Sprintf("%v", metrics.GetLastMessage()), - } -} diff --git a/packages/webapi/v1/model/node_owner_certificate.go b/packages/webapi/v1/model/node_owner_certificate.go deleted file mode 100644 index 8ee4416c40..0000000000 --- a/packages/webapi/v1/model/node_owner_certificate.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package model - -type NodeOwnerCertificateRequest struct { - NodePubKey Bytes `json:"nodePubKey" swagger:"desc(Node pub key. (base64))"` - OwnerAddress Address `json:"ownerAddress" swagger:"desc(Node owner address. (bech32))"` -} - -type NodeOwnerCertificateResponse struct { - Certificate Bytes `json:"certificate" swagger:"desc(Certificate stating the ownership. (base64))"` -} diff --git a/packages/webapi/v1/model/offledger_request.go b/packages/webapi/v1/model/offledger_request.go deleted file mode 100644 index f0d342e92a..0000000000 --- a/packages/webapi/v1/model/offledger_request.go +++ /dev/null @@ -1,5 +0,0 @@ -package model - -type OffLedgerRequestBody struct { - Request Bytes `json:"request" swagger:"desc(Offledger Request (base64))"` -} diff --git a/packages/webapi/v1/model/peering.go b/packages/webapi/v1/model/peering.go deleted file mode 100644 index f72e02fb79..0000000000 --- a/packages/webapi/v1/model/peering.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package model - -import ( - "github.com/iotaledger/wasp/packages/peering" -) - -// PeeringTrustedNode describes single node in the list of trusted peering nodes. -type PeeringTrustedNode struct { - PubKey string `json:"pubKey" swagger:"desc(Public key of the NetID.)"` - NetID string `json:"netId" swagger:"desc(NetID of a peer to trust.)"` -} - -func NewPeeringTrustedNode(tp *peering.TrustedPeer) *PeeringTrustedNode { - return &PeeringTrustedNode{ - PubKey: tp.PubKey().String(), - NetID: tp.NetID, - } -} - -type PeeringNodeStatus struct { - PubKey string - NetID string - IsAlive bool - NumUsers int -} diff --git a/packages/webapi/v1/model/reqstatus.go b/packages/webapi/v1/model/reqstatus.go deleted file mode 100644 index f77fc3de59..0000000000 --- a/packages/webapi/v1/model/reqstatus.go +++ /dev/null @@ -1,15 +0,0 @@ -package model - -import ( - "time" -) - -type WaitRequestProcessedParams struct { - Timeout time.Duration `json:"timeout" swagger:"desc(Timeout in nanoseconds),default(30 seconds)"` -} - -type RequestReceiptResponse struct { - Receipt string `json:"receipt" swagger:"desc(Request receipt, empty if request was not processed)"` -} - -const WaitRequestProcessedDefaultTimeout = 30 * time.Second diff --git a/packages/webapi/v1/model/requestid.go b/packages/webapi/v1/model/requestid.go deleted file mode 100644 index b364d2560e..0000000000 --- a/packages/webapi/v1/model/requestid.go +++ /dev/null @@ -1,36 +0,0 @@ -package model - -import ( - "encoding/json" - - "github.com/iotaledger/wasp/packages/isc" -) - -// RequestID is the string representation of isc.RequestID -type RequestID string - -func NewRequestID(reqID isc.RequestID) RequestID { - return RequestID(reqID.String()) -} - -func (r RequestID) MarshalJSON() ([]byte, error) { - return json.Marshal(string(r)) -} - -func (r *RequestID) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - *r = RequestID(s) - _, err := isc.RequestIDFromString(s) - return err -} - -func (r RequestID) RequestID() isc.RequestID { - reqID, err := isc.RequestIDFromString(string(r)) - if err != nil { - panic(err) - } - return reqID -} diff --git a/packages/webapi/v1/reqstatus/reqstatus.go b/packages/webapi/v1/reqstatus/reqstatus.go deleted file mode 100644 index 37ca07a25f..0000000000 --- a/packages/webapi/v1/reqstatus/reqstatus.go +++ /dev/null @@ -1,155 +0,0 @@ -package reqstatus - -import ( - "encoding/json" - "fmt" - "net/http" - "time" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/chainutil" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type reqstatusWebAPI struct { - getChain func(chainID isc.ChainID) chain.Chain - getReceiptFromBlocklog func(ch chain.Chain, reqID isc.RequestID) (*blocklog.RequestReceipt, error) - resolveReceipt func(c echo.Context, ch chain.Chain, rec *blocklog.RequestReceipt) error -} - -// TODO add examples for receipt json -func AddEndpoints(server echoswagger.ApiRouter, getChain chains.ChainProvider) { - r := &reqstatusWebAPI{ - getChain: getChain, - getReceiptFromBlocklog: getReceiptFromBlocklog, - resolveReceipt: resolveReceipt, - } - - server.GET(routes.RequestReceipt(":chainID", ":reqID"), r.handleRequestReceipt). - SetDeprecated(). - SetSummary("Get the processing status of a given request in the node"). - AddParamPath("", "chainID", "ChainID (bech32)"). - AddParamPath("", "reqID", "Request ID"). - AddResponse(http.StatusOK, "Request Receipt", model.RequestReceiptResponse{}, nil) - - server.GET(routes.WaitRequestProcessed(":chainID", ":reqID"), r.handleWaitRequestProcessed). - SetDeprecated(). - SetSummary("Wait until the given request has been processed by the node"). - AddParamPath("", "chainID", "ChainID (bech32)"). - AddParamPath("", "reqID", "Request ID"). - AddParamBody(model.WaitRequestProcessedParams{}, "Params", "Optional parameters", false). - AddResponse(http.StatusOK, "Request Receipt", model.RequestReceiptResponse{}, nil) -} - -func (r *reqstatusWebAPI) handleRequestReceipt(c echo.Context) error { - ch, reqID, err := r.parseParams(c) - if err != nil { - return err - } - rec, err := r.getReceiptFromBlocklog(ch, reqID) - if err != nil { - return err - } - return r.resolveReceipt(c, ch, rec) -} - -const waitRequestProcessedDefaultTimeout = 30 * time.Second - -func (r *reqstatusWebAPI) handleWaitRequestProcessed(c echo.Context) error { - ch, reqID, err := r.parseParams(c) - if err != nil { - return err - } - - req := model.WaitRequestProcessedParams{ - Timeout: waitRequestProcessedDefaultTimeout, - } - if c.Request().Header.Get("Content-Type") == "application/json" { - if err := c.Bind(&req); err != nil { - return httperrors.BadRequest("Invalid request body") - } - } - - delay := time.NewTimer(req.Timeout) - select { - case rec := <-ch.AwaitRequestProcessed(c.Request().Context(), reqID, true): - if !delay.Stop() { - // empty the channel to avoid leak - <-delay.C - } - return r.resolveReceipt(c, ch, rec) - case <-delay.C: - return httperrors.Timeout("Timeout") - } -} - -func (r *reqstatusWebAPI) parseParams(c echo.Context) (chain.Chain, isc.RequestID, error) { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return nil, isc.RequestID{}, httperrors.BadRequest(fmt.Sprintf("Invalid Chain ID %+v: %s", c.Param("chainID"), err.Error())) - } - theChain := r.getChain(chainID) - if theChain == nil { - return nil, isc.RequestID{}, httperrors.NotFound(fmt.Sprintf("Chain not found: %s", chainID.String())) - } - reqID, err := isc.RequestIDFromString(c.Param("reqID")) - if err != nil { - return nil, isc.RequestID{}, httperrors.BadRequest(fmt.Sprintf("Invalid request id %+v: %s", c.Param("reqID"), err.Error())) - } - return theChain, reqID, nil -} - -func getReceiptFromBlocklog(ch chain.Chain, reqID isc.RequestID) (*blocklog.RequestReceipt, error) { - latestState, err := ch.LatestState(chain.ActiveOrCommittedState) - if err != nil { - return nil, httperrors.ServerError("error getting latest chain state") - } - ret, err := chainutil.CallView(latestState, ch, blocklog.Contract.Hname(), blocklog.ViewGetRequestReceipt.Hname(), - dict.Dict{ - blocklog.ParamRequestID: reqID.Bytes(), - }) - if err != nil { - return nil, httperrors.ServerError("error calling get receipt view") - } - if ret == nil { - return nil, nil // not processed yet - } - binRec, err := ret.Get(blocklog.ParamRequestRecord) - if err != nil { - return nil, httperrors.ServerError("error parsing getReceipt view call result") - } - rec, err := blocklog.RequestReceiptFromBytes(binRec) - if err != nil { - return nil, httperrors.ServerError("error decoding receipt from getReceipt view call result") - } - return rec, nil -} - -func resolveReceipt(c echo.Context, ch chain.Chain, rec *blocklog.RequestReceipt) error { - if rec == nil { - return httperrors.NotFound("receipt not found") - } - resolvedReceiptErr, err := chainutil.ResolveError(ch, rec.Error) - if err != nil { - return httperrors.ServerError("error resolving receipt error") - } - iscReceipt := rec.ToISCReceipt(resolvedReceiptErr) - receiptJSON, err := json.Marshal(iscReceipt) - if err != nil { - return httperrors.ServerError("error marshaling receipt into JSON") - } - return c.JSON(http.StatusOK, - &model.RequestReceiptResponse{ - Receipt: string(receiptJSON), - }, - ) -} diff --git a/packages/webapi/v1/reqstatus/reqstatus_test.go b/packages/webapi/v1/reqstatus/reqstatus_test.go deleted file mode 100644 index 7c34b7ce72..0000000000 --- a/packages/webapi/v1/reqstatus/reqstatus_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package reqstatus - -import ( - "encoding/json" - "net/http" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/require" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" - "github.com/iotaledger/wasp/packages/webapi/v1/testutil" -) - -const foo = "foo" - -func mockedGetReceiptFromBlocklog(_ chain.Chain, id isc.RequestID) (*blocklog.RequestReceipt, error) { - req := isc.NewOffLedgerRequest( - isc.ChainID{123}, - isc.Hn("some contract"), - isc.Hn("some entrypoint"), - dict.Dict{foo: []byte("bar")}, - 42, - ).Sign(cryptolib.NewKeyPair()) - - return &blocklog.RequestReceipt{ - Request: req, - Error: &isc.UnresolvedVMError{ - ErrorCode: isc.VMErrorCode{ - ContractID: isc.Hn("error contract"), - ID: 3, - }, - Params: []interface{}{}, - Hash: 0, - }, - GasBudget: 123, - GasBurned: 10, - GasFeeCharged: 100, - BlockIndex: 111, - RequestIndex: 222, - }, nil -} - -func mockedResolveReceipt(c echo.Context, ch chain.Chain, rec *blocklog.RequestReceipt) error { - iscReceipt := rec.ToISCReceipt(nil) - receiptJSON, _ := json.Marshal(iscReceipt) - return c.JSON(http.StatusOK, - &model.RequestReceiptResponse{ - Receipt: string(receiptJSON), - }, - ) -} - -func TestRequestReceipt(t *testing.T) { - r := &reqstatusWebAPI{ - getChain: func(chainID isc.ChainID) chain.Chain { - return &testutil.MockChain{} - }, - getReceiptFromBlocklog: mockedGetReceiptFromBlocklog, - resolveReceipt: mockedResolveReceipt, - } - - chainID := isc.RandomChainID() - reqID := isc.NewRequestID(iotago.TransactionID{}, 0) - - var res model.RequestReceiptResponse - testutil.CallWebAPIRequestHandler( - t, - r.handleRequestReceipt, - http.MethodGet, - routes.RequestReceipt(":chainID", ":reqID"), - map[string]string{ - "chainID": chainID.String(), - "reqID": reqID.String(), - }, - nil, - &res, - http.StatusOK, - ) - - require.NotEmpty(t, res) -} diff --git a/packages/webapi/v1/request/request.go b/packages/webapi/v1/request/request.go deleted file mode 100644 index 39aaeb9dfc..0000000000 --- a/packages/webapi/v1/request/request.go +++ /dev/null @@ -1,138 +0,0 @@ -package request - -import ( - "fmt" - "io" - "net/http" - "strings" - "time" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/hive.go/core/marshalutil" - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/util/expiringcache" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" - "github.com/iotaledger/wasp/packages/webapi/v2/services" -) - -type ( - shouldBeProcessedFn func(ch chain.ChainCore, req isc.OffLedgerRequest) error -) - -func AddEndpoints( - server echoswagger.ApiRouter, - getChain chains.ChainProvider, - nodePubKey *cryptolib.PublicKey, - cacheTTL time.Duration, -) { - instance := &offLedgerReqAPI{ - getChain: getChain, - shouldBeProcessed: services.ShouldBeProcessed, - requestsCache: expiringcache.New(cacheTTL), - nodePubKey: nodePubKey, - } - server.POST(routes.NewRequest(":chainID"), instance.handleNewRequest). - SetDeprecated(). - SetSummary("Post an off-ledger request"). - AddParamPath("", "chainID", "chainID"). - AddParamBody( - model.OffLedgerRequestBody{Request: "base64 string"}, - "Request", - "Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\"", - false). - AddResponse(http.StatusAccepted, "Request submitted", nil, nil) -} - -type offLedgerReqAPI struct { - getChain chains.ChainProvider - shouldBeProcessed shouldBeProcessedFn - requestsCache *expiringcache.ExpiringCache - nodePubKey *cryptolib.PublicKey -} - -func (o *offLedgerReqAPI) handleNewRequest(c echo.Context) error { - chainID, req, err := parseParams(c) - if err != nil { - return err - } - - reqID := req.ID() - - if o.requestsCache.Get(reqID) != nil { - return httperrors.BadRequest("request already processed") - } - o.requestsCache.Set(reqID, true) - - // check req signature - if err := req.VerifySignature(); err != nil { - o.requestsCache.Set(reqID, true) - return httperrors.BadRequest(fmt.Sprintf("could not verify: %s", err.Error())) - } - - // check req is for the correct chain - if !req.ChainID().Equals(chainID) { - // do not add to cache, it can still be sent to the correct chain - return httperrors.BadRequest("Request is for a different chain") - } - - // check chain exists - ch := o.getChain(chainID) - if ch == nil { - return httperrors.NotFound(fmt.Sprintf("Unknown chain: %s", chainID.String())) - } - - err = o.shouldBeProcessed(ch, req) - if err != nil { - return err - } - - ch.ReceiveOffLedgerRequest(req, o.nodePubKey) - - return c.NoContent(http.StatusAccepted) -} - -func parseParams(c echo.Context) (chainID isc.ChainID, req isc.OffLedgerRequest, err error) { - chainID, err = isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return isc.ChainID{}, nil, httperrors.BadRequest(fmt.Sprintf("Invalid Chain ID %+v: %s", c.Param("chainID"), err.Error())) - } - - contentType := c.Request().Header.Get("Content-Type") - if strings.Contains(strings.ToLower(contentType), "json") { - r := new(model.OffLedgerRequestBody) - if err = c.Bind(r); err != nil { - return isc.ChainID{}, nil, httperrors.BadRequest("error parsing request from payload") - } - rGeneric, err := isc.NewRequestFromMarshalUtil(marshalutil.New(r.Request.Bytes())) - if err != nil { - return isc.ChainID{}, nil, httperrors.BadRequest(fmt.Sprintf("cannot decode off-ledger request: %v", err)) - } - var ok bool - if req, ok = rGeneric.(isc.OffLedgerRequest); !ok { - return isc.ChainID{}, nil, httperrors.BadRequest("error parsing request: off-ledger request is expected") - } - return chainID, req, err - } - - // binary format - reqBytes, err := io.ReadAll(c.Request().Body) - if err != nil { - return isc.ChainID{}, nil, httperrors.BadRequest("error parsing request from payload") - } - rGeneric, err := isc.NewRequestFromMarshalUtil(marshalutil.New(reqBytes)) - if err != nil { - return isc.ChainID{}, nil, httperrors.BadRequest("error parsing request from payload") - } - req, ok := rGeneric.(isc.OffLedgerRequest) - if !ok { - return isc.ChainID{}, nil, httperrors.BadRequest("error parsing request: off-ledger request expected") - } - return chainID, req, err -} diff --git a/packages/webapi/v1/request/request_test.go b/packages/webapi/v1/request/request_test.go deleted file mode 100644 index 9f52e42e0d..0000000000 --- a/packages/webapi/v1/request/request_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package request - -import ( - "net/http" - "testing" - "time" - - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/isc" - util "github.com/iotaledger/wasp/packages/testutil" - "github.com/iotaledger/wasp/packages/util/expiringcache" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" - "github.com/iotaledger/wasp/packages/webapi/v1/testutil" -) - -func shouldBeProcessedMocked(ret error) shouldBeProcessedFn { - return func(_ chain.ChainCore, _ isc.OffLedgerRequest) error { - return ret - } -} - -func newMockedAPI() *offLedgerReqAPI { - return &offLedgerReqAPI{ - getChain: func(chainID isc.ChainID) chain.Chain { - return &testutil.MockChain{} - }, - shouldBeProcessed: shouldBeProcessedMocked(nil), - requestsCache: expiringcache.New(10 * time.Second), - } -} - -func testRequest(t *testing.T, instance *offLedgerReqAPI, chainID isc.ChainID, body interface{}, expectedStatus int) { - testutil.CallWebAPIRequestHandler( - t, - instance.handleNewRequest, - http.MethodPost, - routes.NewRequest(":chainID"), - map[string]string{"chainID": chainID.String()}, - body, - nil, - expectedStatus, - ) -} - -func TestNewRequestBase64(t *testing.T) { - instance := newMockedAPI() - chainID := isc.RandomChainID() - body := model.OffLedgerRequestBody{Request: model.NewBytes(util.DummyOffledgerRequest(chainID).Bytes())} - testRequest(t, instance, chainID, body, http.StatusAccepted) -} - -func TestNewRequestBinary(t *testing.T) { - instance := newMockedAPI() - chainID := isc.RandomChainID() - body := util.DummyOffledgerRequest(chainID).Bytes() - testRequest(t, instance, chainID, body, http.StatusAccepted) -} - -func TestRequestAlreadyProcessed(t *testing.T) { - instance := newMockedAPI() - instance.shouldBeProcessed = shouldBeProcessedMocked(httperrors.BadRequest("")) - - chainID := isc.RandomChainID() - body := util.DummyOffledgerRequest(chainID).Bytes() - testRequest(t, instance, chainID, body, http.StatusBadRequest) -} - -func TestWrongChainID(t *testing.T) { - instance := newMockedAPI() - body := util.DummyOffledgerRequest(isc.RandomChainID()).Bytes() - testRequest(t, instance, isc.RandomChainID(), body, http.StatusBadRequest) -} diff --git a/packages/webapi/v1/routes/routes.go b/packages/webapi/v1/routes/routes.go deleted file mode 100644 index efb0051f8a..0000000000 --- a/packages/webapi/v1/routes/routes.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package routes - -func Info() string { - return "/info" -} - -func NewRequest(chainIDBech32 string) string { - return "/chain/" + chainIDBech32 + "/request" -} - -func CallViewByName(chainIDBech32, contractHname, functionName string) string { - return "/chain/" + chainIDBech32 + "/contract/" + contractHname + "/callview/" + functionName -} - -func CallViewByHname(chainIDBech32, contractHname, functionHname string) string { - return "/chain/" + chainIDBech32 + "/contract/" + contractHname + "/callviewbyhname/" + functionHname -} - -func RequestReceipt(chainIDBech32, reqID string) string { - return "/chain/" + chainIDBech32 + "/request/" + reqID + "/receipt" -} - -func WaitRequestProcessed(chainIDBech32, reqID string) string { - return "/chain/" + chainIDBech32 + "/request/" + reqID + "/wait" -} - -func StateGet(chainIDBech32, key string) string { - return "/chain/" + chainIDBech32 + "/state/" + key -} - -func RequestIDByEVMTransactionHash(chainIDBech32, txHash string) string { - return "/chain/" + chainIDBech32 + "/evm/reqid/" + txHash -} - -func EVMJSONRPC(chainIDBech32 string) string { - return "/chain/" + chainIDBech32 + "/evm/jsonrpc" -} - -func ActivateChain(chainIDBech32 string) string { - return "/adm/chain/" + chainIDBech32 + "/activate" -} - -func DeactivateChain(chainIDBech32 string) string { - return "/adm/chain/" + chainIDBech32 + "/deactivate" -} - -func GetChainInfo(chainIDBech32 string) string { - return "/adm/chain/" + chainIDBech32 + "/info" -} - -func ListChainRecords() string { - return "/adm/chainrecords" -} - -func PutChainRecord() string { - return "/adm/chainrecord" -} - -func GetChainRecord(chainIDBech32 string) string { - return "/adm/chainrecord/" + chainIDBech32 -} - -func GetChainsNodeConnectionMetrics() string { - return "/adm/chain/nodeconn/metrics" -} - -func GetChainNodeConnectionMetrics(chainIDBech32 string) string { - return "/adm/chain/" + chainIDBech32 + "/nodeconn/metrics" -} - -func GetChainConsensusWorkflowStatus(chainIDBech32 string) string { - return "/adm/chain/" + chainIDBech32 + "/consensus/status" -} - -func GetChainConsensusPipeMetrics(chainIDBech32 string) string { - return "/adm/chain/" + chainIDBech32 + "/consensus/metrics/pipe" -} - -func DKSharesPost() string { - return "/adm/dks" -} - -func DKSharesGet(sharedAddress string) string { - return "/adm/dks/" + sharedAddress -} - -func PeeringSelfGet() string { - return "/adm/peering/self" -} - -func PeeringTrustedList() string { - return "/adm/peering/trusted" -} - -func PeeringGetStatus() string { - return "/adm/peering/established" -} - -func PeeringTrustedGet(pubKey string) string { - return "/adm/peering/trusted/" + pubKey -} - -func PeeringTrustedPost() string { - return PeeringTrustedList() -} - -func PeeringTrustedPut(pubKey string) string { - return PeeringTrustedGet(pubKey) -} - -func PeeringTrustedDelete(pubKey string) string { - return PeeringTrustedGet(pubKey) -} - -func AdmNodeOwnerCertificate() string { - return "/adm/node/owner/certificate" -} - -func AdmAccessNode(chainIDBech32 string, pubKey string) string { - return "/adm/chain/" + chainIDBech32 + "/access-node/" + pubKey -} - -func Shutdown() string { - return "/adm/shutdown" -} diff --git a/packages/webapi/v1/state/callview.go b/packages/webapi/v1/state/callview.go deleted file mode 100644 index 0e8e9b1b9b..0000000000 --- a/packages/webapi/v1/state/callview.go +++ /dev/null @@ -1,152 +0,0 @@ -package state - -import ( - "encoding/json" - "fmt" - "net/http" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/chains" - "github.com/iotaledger/wasp/packages/chainutil" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" -) - -type callViewService struct { - chains chains.Provider -} - -func AddEndpoints(server echoswagger.ApiRouter, allChains chains.Provider) { - dictExample := dict.Dict{ - "key1": []byte("value1"), - }.JSONDict() - - s := &callViewService{allChains} - - server.POST(routes.CallViewByName(":chainID", ":contractHname", ":fname"), s.handleCallViewByName). - SetDeprecated(). - SetSummary("Call a view function on a contract by name"). - AddParamPath("", "chainID", "ChainID"). - AddParamPath("", "contractHname", "Contract Hname"). - AddParamPath("getInfo", "fname", "Function name"). - AddParamBody(dictExample, "params", "Parameters", false). - AddResponse(http.StatusOK, "Result", dictExample, nil) - - server.GET(routes.CallViewByName(":chainID", ":contractHname", ":fname"), s.handleCallViewByName). - SetDeprecated(). - SetSummary("Call a view function on a contract by name"). - AddParamPath("", "chainID", "ChainID"). - AddParamPath("", "contractHname", "Contract Hname"). - AddParamPath("getInfo", "fname", "Function name"). - AddParamBody(dictExample, "params", "Parameters", false). - AddResponse(http.StatusOK, "Result", dictExample, nil) - - server.POST(routes.CallViewByHname(":chainID", ":contractHname", ":functionHname"), s.handleCallViewByHname). - SetDeprecated(). - SetSummary("Call a view function on a contract by Hname"). - AddParamPath("", "chainID", "ChainID"). - AddParamPath("", "contractHname", "Contract Hname"). - AddParamPath("getInfo", "functionHname", "Function Hname"). - AddParamBody(dictExample, "params", "Parameters", false). - AddResponse(http.StatusOK, "Result", dictExample, nil) - - server.GET(routes.CallViewByHname(":chainID", ":contractHname", ":functionHname"), s.handleCallViewByHname). - SetDeprecated(). - SetSummary("Call a view function on a contract by Hname"). - AddParamPath("", "chainID", "ChainID"). - AddParamPath("", "contractHname", "Contract Hname"). - AddParamPath("getInfo", "functionHname", "Function Hname"). - AddParamBody(dictExample, "params", "Parameters", false). - AddResponse(http.StatusOK, "Result", dictExample, nil) - - server.GET(routes.StateGet(":chainID", ":key"), s.handleStateGet). - SetDeprecated(). - SetSummary("Fetch the raw value associated with the given key in the chain state"). - AddParamPath("", "chainID", "ChainID"). - AddParamPath("", "key", "Key (hex-encoded)"). - AddResponse(http.StatusOK, "Result", []byte("value"), nil) -} - -func (s *callViewService) handleCallView(c echo.Context, functionHname isc.Hname) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("Invalid chain ID: %+v", c.Param("chainID"))) - } - contractHname, err := isc.HnameFromHexString(c.Param("contractHname")) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("Invalid contract ID: %+v", c.Param("contractHname"))) - } - - var params dict.Dict - if c.Request().Body != http.NoBody { - if err := json.NewDecoder(c.Request().Body).Decode(¶ms); err != nil { - return httperrors.BadRequest("Invalid request body") - } - } - theChain := s.chains().Get(chainID) - if theChain == nil { - return httperrors.NotFound(fmt.Sprintf("Chain not found: %s", chainID)) - } - // TODO should blockIndex be an optional parameter of this endpoint? - latestState, err := theChain.LatestState(chain.ActiveOrCommittedState) - if err != nil { - return httperrors.ServerError(fmt.Sprintf("View call failed: %v", err)) - } - ret, err := chainutil.CallView(latestState, theChain, contractHname, functionHname, params) - if err != nil { - return httperrors.ServerError(fmt.Sprintf("View call failed: %v", err)) - } - - return c.JSON(http.StatusOK, ret) -} - -func (s *callViewService) handleCallViewByName(c echo.Context) error { - fname := c.Param("fname") - return s.handleCallView(c, isc.Hn(fname)) -} - -func (s *callViewService) handleCallViewByHname(c echo.Context) error { - functionHname, err := isc.HnameFromHexString(c.Param("functionHname")) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("Invalid function ID: %+v", c.Param("functionHname"))) - } - return s.handleCallView(c, functionHname) -} - -func (s *callViewService) handleStateGet(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("Invalid chain ID: %+v", c.Param("chainID"))) - } - - key, err := iotago.DecodeHex(c.Param("key")) - if err != nil { - return httperrors.BadRequest(fmt.Sprintf("cannot parse hex-encoded key: %+v", c.Param("key"))) - } - - theChain := s.chains().Get(chainID) - if theChain == nil { - return httperrors.NotFound(fmt.Sprintf("Chain not found: %s", chainID)) - } - - state, err := theChain.LatestState(chain.ActiveOrCommittedState) - if err != nil { - reason := fmt.Sprintf("View call failed: %v", err) - return httperrors.ServerError(reason) - } - - ret, err := state.Get(kv.Key(key)) - if err != nil { - reason := fmt.Sprintf("View call failed: %v", err) - return httperrors.ServerError(reason) - } - - return c.JSON(http.StatusOK, ret) -} diff --git a/packages/webapi/v1/testutil/httptest.go b/packages/webapi/v1/testutil/httptest.go deleted file mode 100644 index 57dfeb1c96..0000000000 --- a/packages/webapi/v1/testutil/httptest.go +++ /dev/null @@ -1,119 +0,0 @@ -package testutil - -import ( - "bytes" - "encoding/json" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "testing" - - "github.com/PuerkitoBio/goquery" - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/require" - - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" -) - -func buildRequest(t *testing.T, method string, body interface{}) *http.Request { - if body == nil { - httptest.NewRequest(method, "/", nil) - } - - if bodybytes, ok := body.([]byte); ok { - req := httptest.NewRequest(method, "/", bytes.NewReader(bodybytes)) - req.Header.Set(echo.HeaderContentType, echo.MIMEOctetStream) - return req - } - - if bodymap, ok := body.(map[string]string); ok { - f := make(url.Values) - for k, v := range bodymap { - f.Set(k, v) - } - req := httptest.NewRequest(method, "/", strings.NewReader(f.Encode())) - req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationForm) - return req - } - - dataJSON, err := json.Marshal(body) - require.NoError(t, err) - req := httptest.NewRequest(method, "/", bytes.NewReader(dataJSON)) - req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationJSON) - return req -} - -func CallWebAPIRequestHandler( - t *testing.T, - handler echo.HandlerFunc, - method string, - route string, - params map[string]string, - body interface{}, - res interface{}, - exptectedStatus int, -) { - e := echo.New() - - req := buildRequest(t, method, body) - - rec := httptest.NewRecorder() - - c := e.NewContext(req, rec) - c.SetPath(route) - - paramNames := make([]string, 0) - paramValues := make([]string, 0) - for k, v := range params { - paramNames = append(paramNames, k) - paramValues = append(paramValues, v) - } - c.SetParamNames(paramNames...) - c.SetParamValues(paramValues...) - - err := handler(c) - if exptectedStatus >= 400 { - require.Error(t, err) - require.Equal(t, exptectedStatus, err.(*httperrors.HTTPError).Code) - } else { - require.NoError(t, err) - require.Equal(t, exptectedStatus, rec.Code) - } - - if res != nil { - err = json.Unmarshal(rec.Body.Bytes(), res) - require.NoError(t, err) - } -} - -func CallHTMLRequestHandler(t *testing.T, e *echo.Echo, handler echo.HandlerFunc, route string, params map[string]string) *goquery.Document { - req := httptest.NewRequest(http.MethodGet, "/", nil) - - rec := httptest.NewRecorder() - - c := e.NewContext(req, rec) - c.SetPath(route) - - paramNames := make([]string, 0) - paramValues := make([]string, 0) - for k, v := range params { - paramNames = append(paramNames, k) - paramValues = append(paramValues, v) - } - c.SetParamNames(paramNames...) - c.SetParamValues(paramValues...) - - err := handler(c) - require.NoError(t, err) - - require.Equal(t, http.StatusOK, rec.Code) - - doc, err := goquery.NewDocumentFromReader(rec.Body) - require.NoError(t, err) - - _, err = doc.Html() - require.NoError(t, err) - - return doc -} diff --git a/packages/webapi/v1/testutil/mockchain.go b/packages/webapi/v1/testutil/mockchain.go deleted file mode 100644 index bc79f1da90..0000000000 --- a/packages/webapi/v1/testutil/mockchain.go +++ /dev/null @@ -1,100 +0,0 @@ -package testutil - -import ( - "context" - - "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/wasp/packages/chain" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" - "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/packages/state" - "github.com/iotaledger/wasp/packages/testutil/testlogger" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/vm/processors" -) - -type MockChain struct{} - -var _ chain.Chain = &MockChain{} - -// LatestAliasOutput implements chain.Chain -func (*MockChain) LatestAliasOutput() (confirmed *isc.AliasOutputWithID, active *isc.AliasOutputWithID) { - panic("unimplemented") -} - -// LatestState implements chain.Chain -func (*MockChain) LatestState(freshness chain.StateFreshness) (state.State, error) { - panic("unimplemented") -} - -// GetCandidateNodes implements chain.Chain -func (*MockChain) GetCandidateNodes() []*governance.AccessNodeInfo { - panic("unimplemented") -} - -// GetChainNodes implements chain.Chain -func (*MockChain) GetChainNodes() []peering.PeerStatusProvider { - panic("unimplemented") -} - -// GetCommitteeInfo implements chain.Chain -func (*MockChain) GetCommitteeInfo() *chain.CommitteeInfo { - panic("unimplemented") -} - -// Store implements chain.Chain -func (*MockChain) Store() state.Store { - panic("unimplemented") -} - -// ID implements chain.Chain -func (*MockChain) ID() isc.ChainID { - panic("unimplemented") -} - -// Log implements chain.Chain -func (*MockChain) Log() *logger.Logger { - return testlogger.NewSilentLogger("", true) -} - -// Processors implements chain.Chain -func (*MockChain) Processors() *processors.Cache { - return new(processors.Cache) -} - -// AwaitRequestProcessed implements chain.Chain -func (*MockChain) AwaitRequestProcessed(ctx context.Context, requestID isc.RequestID, confirmed bool) <-chan *blocklog.RequestReceipt { - panic("unimplemented") -} - -// ReceiveOffLedgerRequest implements chain.Chain -func (*MockChain) ReceiveOffLedgerRequest(request isc.OffLedgerRequest, sender *cryptolib.PublicKey) { -} - -// ConfigUpdated implements chain.Chain -func (*MockChain) ConfigUpdated(accessNodes []*cryptolib.PublicKey) { - panic("unimplemented") -} - -// ServersUpdated implements chain.Chain -func (*MockChain) ServersUpdated(serverNodes []*cryptolib.PublicKey) { - panic("unimplemented") -} - -// GetConsensusPipeMetrics implements chain.Chain -func (*MockChain) GetConsensusPipeMetrics() chain.ConsensusPipeMetrics { - panic("unimplemented") -} - -// GetConsensusWorkflowStatus implements chain.Chain -func (*MockChain) GetConsensusWorkflowStatus() chain.ConsensusWorkflowStatus { - panic("unimplemented") -} - -// GetNodeConnectionMetrics implements chain.Chain -func (*MockChain) GetNodeConnectionMetrics() nodeconnmetrics.NodeConnectionMetrics { - panic("unimplemented") -} diff --git a/packages/webapi/v1/websocket.go b/packages/webapi/v1/websocket.go deleted file mode 100644 index df34fedea9..0000000000 --- a/packages/webapi/v1/websocket.go +++ /dev/null @@ -1,36 +0,0 @@ -package v1 - -import ( - _ "embed" - - "github.com/labstack/echo/v4" - "github.com/pangpanglabs/echoswagger/v2" - - "github.com/iotaledger/hive.go/core/logger" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/publisher/publisherws" -) - -type webSocketAPI struct { - pws *publisherws.PublisherWebSocket -} - -func addWebSocketEndpoint(e echoswagger.ApiGroup, log *logger.Logger) *webSocketAPI { - api := &webSocketAPI{ - pws: publisherws.New(log, []string{"state", "contract"}), - } - - e.GET("/chain/:chainID/ws", api.handleWebSocket). - SetDeprecated(). - AddParamPath("", "chainID", "ChainID (bech32-encoded)") - - return api -} - -func (w *webSocketAPI) handleWebSocket(c echo.Context) error { - chainID, err := isc.ChainIDFromString(c.Param("chainID")) - if err != nil { - return err - } - return w.pws.ServeHTTP(chainID, c.Response(), c.Request()) -} diff --git a/plugins/webapi/component.go b/plugins/webapi/component.go index 874cd92060..70408f9f41 100644 --- a/plugins/webapi/component.go +++ b/plugins/webapi/component.go @@ -25,8 +25,6 @@ import ( "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/users" "github.com/iotaledger/wasp/packages/webapi" - v1 "github.com/iotaledger/wasp/packages/webapi/v1" - v2 "github.com/iotaledger/wasp/packages/webapi/v2" ) func init() { @@ -153,33 +151,7 @@ func provide(c *dig.Container) error { echoSwagger := CreateEchoSwagger(e, deps.AppInfo.Version) - v1.Init( - Plugin.App().NewLogger("WebAPI/v1"), - echoSwagger, - deps.AppInfo.Version, - deps.NetworkProvider, - deps.TrustedNetworkManager, - deps.UserManager, - deps.ChainRecordRegistryProvider, - deps.DKShareRegistryProvider, - deps.NodeIdentityProvider, - func() *chains.Chains { - return deps.Chains - }, - func() *dkg.Node { - return deps.Node - }, - func() { - deps.ShutdownHandler.SelfShutdown("wasp was shutdown via API", false) - }, - deps.NodeConnectionMetrics, - ParamsWebAPI.Auth, - ParamsWebAPI.NodeOwnerAddresses, - deps.APICacheTTL, - deps.PublisherPort, - ) - - v2.Init( + webapi.Init( Plugin.App().NewLogger("WebAPI/v2"), echoSwagger, deps.AppInfo.Version, From f828cbfdfa36e885ce92e83f51464f041e9e5fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 1 Feb 2023 19:13:08 +0100 Subject: [PATCH 02/39] Update API client --- client/.openapi-generator/VERSION | 1 - client/go.mod | 7 - client/model_block_info_response.go | 548 ----- client/model_chain_info_response.go | 411 ---- client/model_chain_metrics.go | 403 ---- client/model_consensus_pipe_metrics.go | 259 --- client/model_consensus_workflow_metrics.go | 746 ------ client/model_contract_call_view_request.go | 300 --- client/model_dk_shares_info.go | 299 --- client/model_gov_chain_info_response.go | 337 --- client/model_protocol_parameters.go | 337 --- client/model_receipt_error.go | 295 --- client/model_receipt_response.go | 367 --- client/model_request_detail.go | 475 ---- client/model_request_receipt_response.go | 367 --- {client => clients/apiclient}/.gitignore | 0 .../apiclient}/.openapi-generator-ignore | 4 +- .../apiclient}/.openapi-generator/FILES | 3 +- clients/apiclient/.openapi-generator/VERSION | 1 + {client => clients/apiclient}/.travis.yml | 0 {client => clients/apiclient}/README.md | 0 .../apiclient}/api/openapi.yaml | 2071 ++++++++++------- {client => clients/apiclient}/api_chains.go | 82 +- .../apiclient}/api_corecontracts.go | 248 +- {client => clients/apiclient}/api_metrics.go | 26 +- {client => clients/apiclient}/api_node.go | 52 +- {client => clients/apiclient}/api_requests.go | 26 +- {client => clients/apiclient}/api_users.go | 36 +- clients/apiclient/client.go | 670 ++++++ .../apiclient}/configuration.go | 16 +- .../apiclient}/docs/AccountListResponse.md | 9 +- .../apiclient}/docs/AccountNFTsResponse.md | 9 +- .../apiclient}/docs/AccountNonceResponse.md | 9 +- .../apiclient}/docs/AddUserRequest.md | 23 +- .../apiclient}/docs/AliasOutputMetricItem.md | 29 +- .../apiclient}/docs/Allowance.md | 16 +- .../apiclient}/docs/AssetsResponse.md | 16 +- .../apiclient}/docs/BaseToken.md | 0 {client => clients/apiclient}/docs/Blob.md | 0 .../apiclient}/docs/BlobInfoResponse.md | 0 .../apiclient}/docs/BlobListResponse.md | 0 .../apiclient}/docs/BlobValueResponse.md | 0 .../apiclient}/docs/BlockInfoResponse.md | 117 +- .../apiclient}/docs/BlockReceiptError.md | 16 +- .../apiclient}/docs/BlockReceiptsResponse.md | 9 +- {client => clients/apiclient}/docs/BurnLog.md | 0 .../apiclient}/docs/BurnRecord.md | 0 .../apiclient}/docs/CallTarget.md | 16 +- .../apiclient}/docs/ChainInfoResponse.md | 82 +- .../apiclient}/docs/ChainMetrics.md | 65 +- .../apiclient}/docs/ChainsApi.md | 12 +- .../apiclient}/docs/CommitteeInfoResponse.md | 44 +- .../apiclient}/docs/CommitteeNode.md | 16 +- .../apiclient}/docs/ConsensusPipeMetrics.md | 37 +- .../docs/ConsensusWorkflowMetrics.md | 129 +- .../docs/ContractCallViewRequest.md | 44 +- .../apiclient}/docs/ContractInfoResponse.md | 30 +- .../docs/ControlAddressesResponse.md | 29 +- .../apiclient}/docs/CorecontractsApi.md | 52 +- .../apiclient}/docs/DKSharesInfo.md | 56 +- .../apiclient}/docs/DKSharesPostRequest.md | 35 +- .../docs/ErrorMessageFormatResponse.md | 9 +- .../apiclient}/docs/EventsResponse.md | 9 +- .../apiclient}/docs/FoundryOutputResponse.md | 16 +- .../apiclient}/docs/FungibleTokens.md | 16 +- .../apiclient}/docs/GasFeePolicy.md | 23 +- .../apiclient}/docs/GovChainInfoResponse.md | 51 +- .../apiclient}/docs/InOutput.md | 16 +- .../apiclient}/docs/InOutputMetricItem.md | 29 +- .../apiclient}/docs/InStateOutput.md | 16 +- .../docs/InStateOutputMetricItem.md | 29 +- .../apiclient}/docs/InfoResponse.md | 30 +- .../apiclient}/docs/InterfaceMetricItem.md | 29 +- {client => clients/apiclient}/docs/Item.md | 16 +- .../apiclient}/docs/JSONDict.md | 0 .../apiclient}/docs/L1Params.md | 23 +- .../apiclient}/docs/MetricsApi.md | 0 .../apiclient}/docs/NFTDataResponse.md | 30 +- .../apiclient}/docs/NativeToken.md | 16 +- .../docs/NativeTokenIDRegistryResponse.md | 9 +- {client => clients/apiclient}/docs/NodeApi.md | 10 +- .../docs/NodeOwnerCertificateRequest.md | 16 +- .../apiclient}/docs/OffLedgerRequest.md | 16 +- .../apiclient}/docs/OnLedgerRequest.md | 30 +- .../docs/OnLedgerRequestMetricItem.md | 29 +- {client => clients/apiclient}/docs/Output.md | 16 +- .../apiclient}/docs/OutputID.md | 9 +- .../docs/PeeringNodeIdentityResponse.md | 23 +- .../docs/PeeringNodeStatusResponse.md | 37 +- .../apiclient}/docs/PeeringTrustRequest.md | 16 +- .../apiclient}/docs/ProtocolParameters.md | 63 +- .../apiclient}/docs/ReceiptError.md | 50 +- .../apiclient}/docs/ReceiptResponse.md | 63 +- .../apiclient}/docs/RentStructure.md | 29 +- .../apiclient}/docs/RequestDetail.md | 79 +- .../apiclient}/docs/RequestIDsResponse.md | 9 +- .../docs/RequestProcessedResponse.md | 23 +- .../apiclient}/docs/RequestReceiptResponse.md | 70 +- .../apiclient}/docs/RequestsApi.md | 12 +- clients/apiclient/docs/StateResponse.md | 51 + .../apiclient}/docs/Transaction.md | 9 +- .../docs/TransactionIDMetricItem.md | 29 +- .../apiclient}/docs/TransactionMetricItem.md | 29 +- .../apiclient}/docs/TxInclusionStateMsg.md | 16 +- .../docs/TxInclusionStateMsgMetricItem.md | 29 +- .../apiclient}/docs/UTXOInputMetricItem.md | 29 +- .../docs/UpdateUserPasswordRequest.md | 9 +- .../docs/UpdateUserPermissionsRequest.md | 9 +- {client => clients/apiclient}/docs/User.md | 16 +- .../apiclient}/docs/UsersApi.md | 6 +- .../apiclient}/docs/ValidationError.md | 16 +- clients/apiclient/generate_client.sh | 6 + {client => clients/apiclient}/git_push.sh | 0 clients/apiclient/go.mod | 6 + {client => clients/apiclient}/go.sum | 2 - .../apiclient}/model_account_list_response.go | 46 +- .../apiclient}/model_account_nfts_response.go | 46 +- .../model_account_nonce_response.go | 52 +- .../apiclient}/model_add_user_request.go | 116 +- .../model_alias_output_metric_item.go | 130 +- .../apiclient}/model_allowance.go | 81 +- .../apiclient}/model_assets_response.go | 81 +- .../apiclient}/model_base_token.go | 29 +- {client => clients/apiclient}/model_blob.go | 21 +- .../apiclient}/model_blob_info_response.go | 19 +- .../apiclient}/model_blob_list_response.go | 19 +- .../apiclient}/model_blob_value_response.go | 19 +- .../apiclient/model_block_info_response.go | 442 ++++ .../apiclient}/model_block_receipt_error.go | 87 +- .../model_block_receipts_response.go | 46 +- .../apiclient}/model_burn_log.go | 19 +- .../apiclient}/model_burn_record.go | 21 +- .../apiclient}/model_call_target.go | 87 +- .../apiclient/model_chain_info_response.go | 350 +++ clients/apiclient/model_chain_metrics.go | 333 +++ .../model_committee_info_response.go | 209 +- .../apiclient}/model_committee_node.go | 87 +- .../apiclient/model_consensus_pipe_metrics.go | 225 ++ .../model_consensus_workflow_metrics.go | 604 +++++ .../model_contract_call_view_request.go | 257 ++ .../model_contract_info_response.go | 151 +- .../model_control_addresses_response.go | 130 +- clients/apiclient/model_dk_shares_info.go | 256 ++ .../model_dk_shares_post_request.go | 132 +- .../model_error_message_format_response.go | 52 +- .../apiclient}/model_events_response.go | 46 +- .../model_foundry_output_response.go | 87 +- .../apiclient}/model_fungible_tokens.go | 81 +- .../apiclient}/model_gas_fee_policy.go | 122 +- .../model_gov_chain_info_response.go | 285 +++ .../apiclient}/model_in_output.go | 87 +- .../apiclient}/model_in_output_metric_item.go | 130 +- .../apiclient}/model_in_state_output.go | 87 +- .../model_in_state_output_metric_item.go | 130 +- .../apiclient}/model_info_response.go | 157 +- .../apiclient}/model_interface_metric_item.go | 130 +- {client => clients/apiclient}/model_item.go | 87 +- .../apiclient}/model_json_dict.go | 19 +- .../apiclient}/model_l1_params.go | 122 +- .../apiclient}/model_native_token.go | 87 +- ...model_native_token_id_registry_response.go | 46 +- .../apiclient}/model_nft_data_response.go | 157 +- .../model_node_owner_certificate_request.go | 87 +- .../apiclient}/model_off_ledger_request.go | 87 +- .../apiclient}/model_on_ledger_request.go | 157 +- .../model_on_ledger_request_metric_item.go | 130 +- {client => clients/apiclient}/model_output.go | 87 +- .../apiclient}/model_output_id.go | 52 +- .../model_peering_node_identity_response.go | 122 +- .../model_peering_node_status_response.go | 192 +- .../apiclient}/model_peering_trust_request.go | 87 +- .../apiclient/model_protocol_parameters.go | 285 +++ clients/apiclient/model_receipt_error.go | 252 ++ clients/apiclient/model_receipt_response.go | 315 +++ .../apiclient}/model_rent_structure.go | 130 +- clients/apiclient/model_request_detail.go | 387 +++ .../apiclient}/model_request_ids_response.go | 46 +- .../model_request_processed_response.go | 122 +- .../model_request_receipt_response.go | 306 +++ clients/apiclient/model_state_response.go | 118 + .../apiclient}/model_transaction.go | 52 +- .../model_transaction_id_metric_item.go | 130 +- .../model_transaction_metric_item.go | 130 +- .../model_tx_inclusion_state_msg.go | 87 +- ...odel_tx_inclusion_state_msg_metric_item.go | 130 +- .../model_update_user_password_request.go | 52 +- .../model_update_user_permissions_request.go | 46 +- {client => clients/apiclient}/model_user.go | 81 +- .../model_utxo_input_metric_item.go | 130 +- .../apiclient}/model_validation_error.go | 87 +- {client => clients/apiclient}/response.go | 4 +- .../apiclient}/test/api_chains_test.go | 0 .../apiclient}/test/api_corecontracts_test.go | 0 .../apiclient}/test/api_metrics_test.go | 0 .../apiclient}/test/api_node_test.go | 0 .../apiclient}/test/api_requests_test.go | 0 .../apiclient}/test/api_users_test.go | 0 {client => clients/apiclient}/utils.go | 32 +- clients/apiutils.go | 1 + clients/auth/auth.go | 1 + clients/chainclient/callview.go | 30 + clients/chainclient/chainclient.go | 245 ++ clients/chainclient/chainrecord.go | 14 + clients/chainclient/checkrequest.go | 33 + clients/chainclient/evm.go | 11 + clients/chainclient/stateget.go | 6 + clients/chainclient/uploadblob.go | 29 + clients/scclient/postrequest.go | 19 + clients/scclient/scclient.go | 23 + clients/scclient/stateget.go | 6 + tools/wasp-cli/cli/cliclients/clients.go | 36 + .../{ => cli}/config/checkversions.go | 3 +- tools/wasp-cli/{ => cli}/config/config.go | 31 +- tools/wasp-cli/cli/config/init.go | 1 + 214 files changed, 10056 insertions(+), 10879 deletions(-) delete mode 100644 client/.openapi-generator/VERSION delete mode 100644 client/go.mod delete mode 100644 client/model_block_info_response.go delete mode 100644 client/model_chain_info_response.go delete mode 100644 client/model_chain_metrics.go delete mode 100644 client/model_consensus_pipe_metrics.go delete mode 100644 client/model_consensus_workflow_metrics.go delete mode 100644 client/model_contract_call_view_request.go delete mode 100644 client/model_dk_shares_info.go delete mode 100644 client/model_gov_chain_info_response.go delete mode 100644 client/model_protocol_parameters.go delete mode 100644 client/model_receipt_error.go delete mode 100644 client/model_receipt_response.go delete mode 100644 client/model_request_detail.go delete mode 100644 client/model_request_receipt_response.go rename {client => clients/apiclient}/.gitignore (100%) rename {client => clients/apiclient}/.openapi-generator-ignore (96%) rename {client => clients/apiclient}/.openapi-generator/FILES (98%) create mode 100644 clients/apiclient/.openapi-generator/VERSION rename {client => clients/apiclient}/.travis.yml (100%) rename {client => clients/apiclient}/README.md (100%) rename {client => clients/apiclient}/api/openapi.yaml (91%) rename {client => clients/apiclient}/api_chains.go (94%) rename {client => clients/apiclient}/api_corecontracts.go (92%) rename {client => clients/apiclient}/api_metrics.go (95%) rename {client => clients/apiclient}/api_node.go (96%) rename {client => clients/apiclient}/api_requests.go (93%) rename {client => clients/apiclient}/api_users.go (95%) create mode 100644 clients/apiclient/client.go rename {client => clients/apiclient}/configuration.go (91%) rename {client => clients/apiclient}/docs/AccountListResponse.md (86%) rename {client => clients/apiclient}/docs/AccountNFTsResponse.md (86%) rename {client => clients/apiclient}/docs/AccountNonceResponse.md (86%) rename {client => clients/apiclient}/docs/AddUserRequest.md (80%) rename {client => clients/apiclient}/docs/AliasOutputMetricItem.md (74%) rename {client => clients/apiclient}/docs/Allowance.md (81%) rename {client => clients/apiclient}/docs/AssetsResponse.md (81%) rename {client => clients/apiclient}/docs/BaseToken.md (100%) rename {client => clients/apiclient}/docs/Blob.md (100%) rename {client => clients/apiclient}/docs/BlobInfoResponse.md (100%) rename {client => clients/apiclient}/docs/BlobListResponse.md (100%) rename {client => clients/apiclient}/docs/BlobValueResponse.md (100%) rename {client => clients/apiclient}/docs/BlockInfoResponse.md (69%) rename {client => clients/apiclient}/docs/BlockReceiptError.md (82%) rename {client => clients/apiclient}/docs/BlockReceiptsResponse.md (84%) rename {client => clients/apiclient}/docs/BurnLog.md (100%) rename {client => clients/apiclient}/docs/BurnRecord.md (100%) rename {client => clients/apiclient}/docs/CallTarget.md (82%) rename {client => clients/apiclient}/docs/ChainInfoResponse.md (67%) rename {client => clients/apiclient}/docs/ChainMetrics.md (73%) rename {client => clients/apiclient}/docs/ChainsApi.md (97%) rename {client => clients/apiclient}/docs/CommitteeInfoResponse.md (73%) rename {client => clients/apiclient}/docs/CommitteeNode.md (81%) rename {client => clients/apiclient}/docs/ConsensusPipeMetrics.md (77%) rename {client => clients/apiclient}/docs/ConsensusWorkflowMetrics.md (68%) rename {client => clients/apiclient}/docs/ContractCallViewRequest.md (75%) rename {client => clients/apiclient}/docs/ContractInfoResponse.md (76%) rename {client => clients/apiclient}/docs/ControlAddressesResponse.md (74%) rename {client => clients/apiclient}/docs/CorecontractsApi.md (94%) rename {client => clients/apiclient}/docs/DKSharesInfo.md (69%) rename {client => clients/apiclient}/docs/DKSharesPostRequest.md (68%) rename {client => clients/apiclient}/docs/ErrorMessageFormatResponse.md (85%) rename {client => clients/apiclient}/docs/EventsResponse.md (86%) rename {client => clients/apiclient}/docs/FoundryOutputResponse.md (81%) rename {client => clients/apiclient}/docs/FungibleTokens.md (81%) rename {client => clients/apiclient}/docs/GasFeePolicy.md (77%) rename {client => clients/apiclient}/docs/GovChainInfoResponse.md (74%) rename {client => clients/apiclient}/docs/InOutput.md (82%) rename {client => clients/apiclient}/docs/InOutputMetricItem.md (74%) rename {client => clients/apiclient}/docs/InStateOutput.md (82%) rename {client => clients/apiclient}/docs/InStateOutputMetricItem.md (74%) rename {client => clients/apiclient}/docs/InfoResponse.md (77%) rename {client => clients/apiclient}/docs/InterfaceMetricItem.md (75%) rename {client => clients/apiclient}/docs/Item.md (82%) rename {client => clients/apiclient}/docs/JSONDict.md (100%) rename {client => clients/apiclient}/docs/L1Params.md (78%) rename {client => clients/apiclient}/docs/MetricsApi.md (100%) rename {client => clients/apiclient}/docs/NFTDataResponse.md (79%) rename {client => clients/apiclient}/docs/NativeToken.md (83%) rename {client => clients/apiclient}/docs/NativeTokenIDRegistryResponse.md (84%) rename {client => clients/apiclient}/docs/NodeApi.md (97%) rename {client => clients/apiclient}/docs/NodeOwnerCertificateRequest.md (80%) rename {client => clients/apiclient}/docs/OffLedgerRequest.md (81%) rename {client => clients/apiclient}/docs/OnLedgerRequest.md (77%) rename {client => clients/apiclient}/docs/OnLedgerRequestMetricItem.md (74%) rename {client => clients/apiclient}/docs/Output.md (81%) rename {client => clients/apiclient}/docs/OutputID.md (86%) rename {client => clients/apiclient}/docs/PeeringNodeIdentityResponse.md (79%) rename {client => clients/apiclient}/docs/PeeringNodeStatusResponse.md (76%) rename {client => clients/apiclient}/docs/PeeringTrustRequest.md (80%) rename {client => clients/apiclient}/docs/ProtocolParameters.md (69%) rename {client => clients/apiclient}/docs/ReceiptError.md (74%) rename {client => clients/apiclient}/docs/ReceiptResponse.md (74%) rename {client => clients/apiclient}/docs/RentStructure.md (72%) rename {client => clients/apiclient}/docs/RequestDetail.md (75%) rename {client => clients/apiclient}/docs/RequestIDsResponse.md (86%) rename {client => clients/apiclient}/docs/RequestProcessedResponse.md (80%) rename {client => clients/apiclient}/docs/RequestReceiptResponse.md (70%) rename {client => clients/apiclient}/docs/RequestsApi.md (89%) create mode 100644 clients/apiclient/docs/StateResponse.md rename {client => clients/apiclient}/docs/Transaction.md (86%) rename {client => clients/apiclient}/docs/TransactionIDMetricItem.md (74%) rename {client => clients/apiclient}/docs/TransactionMetricItem.md (74%) rename {client => clients/apiclient}/docs/TxInclusionStateMsg.md (81%) rename {client => clients/apiclient}/docs/TxInclusionStateMsgMetricItem.md (73%) rename {client => clients/apiclient}/docs/UTXOInputMetricItem.md (74%) rename {client => clients/apiclient}/docs/UpdateUserPasswordRequest.md (85%) rename {client => clients/apiclient}/docs/UpdateUserPermissionsRequest.md (85%) rename {client => clients/apiclient}/docs/User.md (82%) rename {client => clients/apiclient}/docs/UsersApi.md (96%) rename {client => clients/apiclient}/docs/ValidationError.md (82%) create mode 100644 clients/apiclient/generate_client.sh rename {client => clients/apiclient}/git_push.sh (100%) create mode 100644 clients/apiclient/go.mod rename {client => clients/apiclient}/go.sum (82%) rename {client => clients/apiclient}/model_account_list_response.go (75%) rename {client => clients/apiclient}/model_account_nfts_response.go (75%) rename {client => clients/apiclient}/model_account_nonce_response.go (74%) rename {client => clients/apiclient}/model_add_user_request.go (56%) rename {client => clients/apiclient}/model_alias_output_metric_item.go (53%) rename {client => clients/apiclient}/model_allowance.go (61%) rename {client => clients/apiclient}/model_assets_response.go (64%) rename {client => clients/apiclient}/model_base_token.go (94%) rename {client => clients/apiclient}/model_blob.go (89%) rename {client => clients/apiclient}/model_blob_info_response.go (87%) rename {client => clients/apiclient}/model_blob_list_response.go (87%) rename {client => clients/apiclient}/model_blob_value_response.go (88%) create mode 100644 clients/apiclient/model_block_info_response.go rename {client => clients/apiclient}/model_block_receipt_error.go (63%) rename {client => clients/apiclient}/model_block_receipts_response.go (75%) rename {client => clients/apiclient}/model_burn_log.go (87%) rename {client => clients/apiclient}/model_burn_record.go (89%) rename {client => clients/apiclient}/model_call_target.go (60%) create mode 100644 clients/apiclient/model_chain_info_response.go create mode 100644 clients/apiclient/model_chain_metrics.go rename {client => clients/apiclient}/model_committee_info_response.go (51%) rename {client => clients/apiclient}/model_committee_node.go (63%) create mode 100644 clients/apiclient/model_consensus_pipe_metrics.go create mode 100644 clients/apiclient/model_consensus_workflow_metrics.go create mode 100644 clients/apiclient/model_contract_call_view_request.go rename {client => clients/apiclient}/model_contract_info_response.go (55%) rename {client => clients/apiclient}/model_control_addresses_response.go (52%) create mode 100644 clients/apiclient/model_dk_shares_info.go rename {client => clients/apiclient}/model_dk_shares_post_request.go (52%) rename {client => clients/apiclient}/model_error_message_format_response.go (74%) rename {client => clients/apiclient}/model_events_response.go (74%) rename {client => clients/apiclient}/model_foundry_output_response.go (64%) rename {client => clients/apiclient}/model_fungible_tokens.go (64%) rename {client => clients/apiclient}/model_gas_fee_policy.go (56%) create mode 100644 clients/apiclient/model_gov_chain_info_response.go rename {client => clients/apiclient}/model_in_output.go (59%) rename {client => clients/apiclient}/model_in_output_metric_item.go (53%) rename {client => clients/apiclient}/model_in_state_output.go (61%) rename {client => clients/apiclient}/model_in_state_output_metric_item.go (54%) rename {client => clients/apiclient}/model_info_response.go (51%) rename {client => clients/apiclient}/model_interface_metric_item.go (53%) rename {client => clients/apiclient}/model_item.go (60%) rename {client => clients/apiclient}/model_json_dict.go (87%) rename {client => clients/apiclient}/model_l1_params.go (54%) rename {client => clients/apiclient}/model_native_token.go (62%) rename {client => clients/apiclient}/model_native_token_id_registry_response.go (75%) rename {client => clients/apiclient}/model_nft_data_response.go (51%) rename {client => clients/apiclient}/model_node_owner_certificate_request.go (65%) rename {client => clients/apiclient}/model_off_ledger_request.go (62%) rename {client => clients/apiclient}/model_on_ledger_request.go (52%) rename {client => clients/apiclient}/model_on_ledger_request_metric_item.go (54%) rename {client => clients/apiclient}/model_output.go (61%) rename {client => clients/apiclient}/model_output_id.go (70%) rename {client => clients/apiclient}/model_peering_node_identity_response.go (60%) rename {client => clients/apiclient}/model_peering_node_status_response.go (51%) rename {client => clients/apiclient}/model_peering_trust_request.go (64%) create mode 100644 clients/apiclient/model_protocol_parameters.go create mode 100644 clients/apiclient/model_receipt_error.go create mode 100644 clients/apiclient/model_receipt_response.go rename {client => clients/apiclient}/model_rent_structure.go (52%) create mode 100644 clients/apiclient/model_request_detail.go rename {client => clients/apiclient}/model_request_ids_response.go (76%) rename {client => clients/apiclient}/model_request_processed_response.go (58%) create mode 100644 clients/apiclient/model_request_receipt_response.go create mode 100644 clients/apiclient/model_state_response.go rename {client => clients/apiclient}/model_transaction.go (73%) rename {client => clients/apiclient}/model_transaction_id_metric_item.go (54%) rename {client => clients/apiclient}/model_transaction_metric_item.go (53%) rename {client => clients/apiclient}/model_tx_inclusion_state_msg.go (64%) rename {client => clients/apiclient}/model_tx_inclusion_state_msg_metric_item.go (55%) rename {client => clients/apiclient}/model_update_user_password_request.go (74%) rename {client => clients/apiclient}/model_update_user_permissions_request.go (77%) rename {client => clients/apiclient}/model_user.go (60%) rename {client => clients/apiclient}/model_utxo_input_metric_item.go (53%) rename {client => clients/apiclient}/model_validation_error.go (62%) rename {client => clients/apiclient}/response.go (95%) rename {client => clients/apiclient}/test/api_chains_test.go (100%) rename {client => clients/apiclient}/test/api_corecontracts_test.go (100%) rename {client => clients/apiclient}/test/api_metrics_test.go (100%) rename {client => clients/apiclient}/test/api_node_test.go (100%) rename {client => clients/apiclient}/test/api_requests_test.go (100%) rename {client => clients/apiclient}/test/api_users_test.go (100%) rename {client => clients/apiclient}/utils.go (93%) create mode 100644 clients/apiutils.go create mode 100644 clients/auth/auth.go create mode 100644 clients/chainclient/callview.go create mode 100644 clients/chainclient/chainclient.go create mode 100644 clients/chainclient/chainrecord.go create mode 100644 clients/chainclient/checkrequest.go create mode 100644 clients/chainclient/evm.go create mode 100644 clients/chainclient/stateget.go create mode 100644 clients/chainclient/uploadblob.go create mode 100644 clients/scclient/postrequest.go create mode 100644 clients/scclient/scclient.go create mode 100644 clients/scclient/stateget.go create mode 100644 tools/wasp-cli/cli/cliclients/clients.go rename tools/wasp-cli/{ => cli}/config/checkversions.go (88%) rename tools/wasp-cli/{ => cli}/config/config.go (88%) create mode 100644 tools/wasp-cli/cli/config/init.go diff --git a/client/.openapi-generator/VERSION b/client/.openapi-generator/VERSION deleted file mode 100644 index 0df17dd0f6..0000000000 --- a/client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.2.1 \ No newline at end of file diff --git a/client/go.mod b/client/go.mod deleted file mode 100644 index ead32606c7..0000000000 --- a/client/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/GIT_USER_ID/GIT_REPO_ID - -go 1.13 - -require ( - golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 -) diff --git a/client/model_block_info_response.go b/client/model_block_info_response.go deleted file mode 100644 index 042c295c5c..0000000000 --- a/client/model_block_info_response.go +++ /dev/null @@ -1,548 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" - "time" -) - -// BlockInfoResponse struct for BlockInfoResponse -type BlockInfoResponse struct { - AnchorTransactionId *string `json:"anchorTransactionId,omitempty"` - BlockIndex *int32 `json:"blockIndex,omitempty"` - GasBurned *int64 `json:"gasBurned,omitempty"` - GasFeeCharged *int64 `json:"gasFeeCharged,omitempty"` - L1CommitmentHash *string `json:"l1CommitmentHash,omitempty"` - NumOffLedgerRequests *int32 `json:"numOffLedgerRequests,omitempty"` - NumSuccessfulRequests *int32 `json:"numSuccessfulRequests,omitempty"` - PreviousL1CommitmentHash *string `json:"previousL1CommitmentHash,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` - TotalBaseTokensInL2Accounts *int64 `json:"totalBaseTokensInL2Accounts,omitempty"` - TotalRequests *int32 `json:"totalRequests,omitempty"` - TotalStorageDeposit *int64 `json:"totalStorageDeposit,omitempty"` - TransactionSubEssenceHash *string `json:"transactionSubEssenceHash,omitempty"` -} - -// NewBlockInfoResponse instantiates a new BlockInfoResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBlockInfoResponse() *BlockInfoResponse { - this := BlockInfoResponse{} - return &this -} - -// NewBlockInfoResponseWithDefaults instantiates a new BlockInfoResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBlockInfoResponseWithDefaults() *BlockInfoResponse { - this := BlockInfoResponse{} - return &this -} - -// GetAnchorTransactionId returns the AnchorTransactionId field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetAnchorTransactionId() string { - if o == nil || isNil(o.AnchorTransactionId) { - var ret string - return ret - } - return *o.AnchorTransactionId -} - -// GetAnchorTransactionIdOk returns a tuple with the AnchorTransactionId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetAnchorTransactionIdOk() (*string, bool) { - if o == nil || isNil(o.AnchorTransactionId) { - return nil, false - } - return o.AnchorTransactionId, true -} - -// HasAnchorTransactionId returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasAnchorTransactionId() bool { - if o != nil && !isNil(o.AnchorTransactionId) { - return true - } - - return false -} - -// SetAnchorTransactionId gets a reference to the given string and assigns it to the AnchorTransactionId field. -func (o *BlockInfoResponse) SetAnchorTransactionId(v string) { - o.AnchorTransactionId = &v -} - -// GetBlockIndex returns the BlockIndex field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetBlockIndex() int32 { - if o == nil || isNil(o.BlockIndex) { - var ret int32 - return ret - } - return *o.BlockIndex -} - -// GetBlockIndexOk returns a tuple with the BlockIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetBlockIndexOk() (*int32, bool) { - if o == nil || isNil(o.BlockIndex) { - return nil, false - } - return o.BlockIndex, true -} - -// HasBlockIndex returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasBlockIndex() bool { - if o != nil && !isNil(o.BlockIndex) { - return true - } - - return false -} - -// SetBlockIndex gets a reference to the given int32 and assigns it to the BlockIndex field. -func (o *BlockInfoResponse) SetBlockIndex(v int32) { - o.BlockIndex = &v -} - -// GetGasBurned returns the GasBurned field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetGasBurned() int64 { - if o == nil || isNil(o.GasBurned) { - var ret int64 - return ret - } - return *o.GasBurned -} - -// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool) { - if o == nil || isNil(o.GasBurned) { - return nil, false - } - return o.GasBurned, true -} - -// HasGasBurned returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasGasBurned() bool { - if o != nil && !isNil(o.GasBurned) { - return true - } - - return false -} - -// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. -func (o *BlockInfoResponse) SetGasBurned(v int64) { - o.GasBurned = &v -} - -// GetGasFeeCharged returns the GasFeeCharged field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetGasFeeCharged() int64 { - if o == nil || isNil(o.GasFeeCharged) { - var ret int64 - return ret - } - return *o.GasFeeCharged -} - -// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool) { - if o == nil || isNil(o.GasFeeCharged) { - return nil, false - } - return o.GasFeeCharged, true -} - -// HasGasFeeCharged returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasGasFeeCharged() bool { - if o != nil && !isNil(o.GasFeeCharged) { - return true - } - - return false -} - -// SetGasFeeCharged gets a reference to the given int64 and assigns it to the GasFeeCharged field. -func (o *BlockInfoResponse) SetGasFeeCharged(v int64) { - o.GasFeeCharged = &v -} - -// GetL1CommitmentHash returns the L1CommitmentHash field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetL1CommitmentHash() string { - if o == nil || isNil(o.L1CommitmentHash) { - var ret string - return ret - } - return *o.L1CommitmentHash -} - -// GetL1CommitmentHashOk returns a tuple with the L1CommitmentHash field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetL1CommitmentHashOk() (*string, bool) { - if o == nil || isNil(o.L1CommitmentHash) { - return nil, false - } - return o.L1CommitmentHash, true -} - -// HasL1CommitmentHash returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasL1CommitmentHash() bool { - if o != nil && !isNil(o.L1CommitmentHash) { - return true - } - - return false -} - -// SetL1CommitmentHash gets a reference to the given string and assigns it to the L1CommitmentHash field. -func (o *BlockInfoResponse) SetL1CommitmentHash(v string) { - o.L1CommitmentHash = &v -} - -// GetNumOffLedgerRequests returns the NumOffLedgerRequests field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetNumOffLedgerRequests() int32 { - if o == nil || isNil(o.NumOffLedgerRequests) { - var ret int32 - return ret - } - return *o.NumOffLedgerRequests -} - -// GetNumOffLedgerRequestsOk returns a tuple with the NumOffLedgerRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetNumOffLedgerRequestsOk() (*int32, bool) { - if o == nil || isNil(o.NumOffLedgerRequests) { - return nil, false - } - return o.NumOffLedgerRequests, true -} - -// HasNumOffLedgerRequests returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasNumOffLedgerRequests() bool { - if o != nil && !isNil(o.NumOffLedgerRequests) { - return true - } - - return false -} - -// SetNumOffLedgerRequests gets a reference to the given int32 and assigns it to the NumOffLedgerRequests field. -func (o *BlockInfoResponse) SetNumOffLedgerRequests(v int32) { - o.NumOffLedgerRequests = &v -} - -// GetNumSuccessfulRequests returns the NumSuccessfulRequests field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetNumSuccessfulRequests() int32 { - if o == nil || isNil(o.NumSuccessfulRequests) { - var ret int32 - return ret - } - return *o.NumSuccessfulRequests -} - -// GetNumSuccessfulRequestsOk returns a tuple with the NumSuccessfulRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetNumSuccessfulRequestsOk() (*int32, bool) { - if o == nil || isNil(o.NumSuccessfulRequests) { - return nil, false - } - return o.NumSuccessfulRequests, true -} - -// HasNumSuccessfulRequests returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasNumSuccessfulRequests() bool { - if o != nil && !isNil(o.NumSuccessfulRequests) { - return true - } - - return false -} - -// SetNumSuccessfulRequests gets a reference to the given int32 and assigns it to the NumSuccessfulRequests field. -func (o *BlockInfoResponse) SetNumSuccessfulRequests(v int32) { - o.NumSuccessfulRequests = &v -} - -// GetPreviousL1CommitmentHash returns the PreviousL1CommitmentHash field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetPreviousL1CommitmentHash() string { - if o == nil || isNil(o.PreviousL1CommitmentHash) { - var ret string - return ret - } - return *o.PreviousL1CommitmentHash -} - -// GetPreviousL1CommitmentHashOk returns a tuple with the PreviousL1CommitmentHash field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetPreviousL1CommitmentHashOk() (*string, bool) { - if o == nil || isNil(o.PreviousL1CommitmentHash) { - return nil, false - } - return o.PreviousL1CommitmentHash, true -} - -// HasPreviousL1CommitmentHash returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasPreviousL1CommitmentHash() bool { - if o != nil && !isNil(o.PreviousL1CommitmentHash) { - return true - } - - return false -} - -// SetPreviousL1CommitmentHash gets a reference to the given string and assigns it to the PreviousL1CommitmentHash field. -func (o *BlockInfoResponse) SetPreviousL1CommitmentHash(v string) { - o.PreviousL1CommitmentHash = &v -} - -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { - var ret time.Time - return ret - } - return *o.Timestamp -} - -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true - } - - return false -} - -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. -func (o *BlockInfoResponse) SetTimestamp(v time.Time) { - o.Timestamp = &v -} - -// GetTotalBaseTokensInL2Accounts returns the TotalBaseTokensInL2Accounts field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64 { - if o == nil || isNil(o.TotalBaseTokensInL2Accounts) { - var ret int64 - return ret - } - return *o.TotalBaseTokensInL2Accounts -} - -// GetTotalBaseTokensInL2AccountsOk returns a tuple with the TotalBaseTokensInL2Accounts field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool) { - if o == nil || isNil(o.TotalBaseTokensInL2Accounts) { - return nil, false - } - return o.TotalBaseTokensInL2Accounts, true -} - -// HasTotalBaseTokensInL2Accounts returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasTotalBaseTokensInL2Accounts() bool { - if o != nil && !isNil(o.TotalBaseTokensInL2Accounts) { - return true - } - - return false -} - -// SetTotalBaseTokensInL2Accounts gets a reference to the given int64 and assigns it to the TotalBaseTokensInL2Accounts field. -func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v int64) { - o.TotalBaseTokensInL2Accounts = &v -} - -// GetTotalRequests returns the TotalRequests field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetTotalRequests() int32 { - if o == nil || isNil(o.TotalRequests) { - var ret int32 - return ret - } - return *o.TotalRequests -} - -// GetTotalRequestsOk returns a tuple with the TotalRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTotalRequestsOk() (*int32, bool) { - if o == nil || isNil(o.TotalRequests) { - return nil, false - } - return o.TotalRequests, true -} - -// HasTotalRequests returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasTotalRequests() bool { - if o != nil && !isNil(o.TotalRequests) { - return true - } - - return false -} - -// SetTotalRequests gets a reference to the given int32 and assigns it to the TotalRequests field. -func (o *BlockInfoResponse) SetTotalRequests(v int32) { - o.TotalRequests = &v -} - -// GetTotalStorageDeposit returns the TotalStorageDeposit field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetTotalStorageDeposit() int64 { - if o == nil || isNil(o.TotalStorageDeposit) { - var ret int64 - return ret - } - return *o.TotalStorageDeposit -} - -// GetTotalStorageDepositOk returns a tuple with the TotalStorageDeposit field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool) { - if o == nil || isNil(o.TotalStorageDeposit) { - return nil, false - } - return o.TotalStorageDeposit, true -} - -// HasTotalStorageDeposit returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasTotalStorageDeposit() bool { - if o != nil && !isNil(o.TotalStorageDeposit) { - return true - } - - return false -} - -// SetTotalStorageDeposit gets a reference to the given int64 and assigns it to the TotalStorageDeposit field. -func (o *BlockInfoResponse) SetTotalStorageDeposit(v int64) { - o.TotalStorageDeposit = &v -} - -// GetTransactionSubEssenceHash returns the TransactionSubEssenceHash field value if set, zero value otherwise. -func (o *BlockInfoResponse) GetTransactionSubEssenceHash() string { - if o == nil || isNil(o.TransactionSubEssenceHash) { - var ret string - return ret - } - return *o.TransactionSubEssenceHash -} - -// GetTransactionSubEssenceHashOk returns a tuple with the TransactionSubEssenceHash field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTransactionSubEssenceHashOk() (*string, bool) { - if o == nil || isNil(o.TransactionSubEssenceHash) { - return nil, false - } - return o.TransactionSubEssenceHash, true -} - -// HasTransactionSubEssenceHash returns a boolean if a field has been set. -func (o *BlockInfoResponse) HasTransactionSubEssenceHash() bool { - if o != nil && !isNil(o.TransactionSubEssenceHash) { - return true - } - - return false -} - -// SetTransactionSubEssenceHash gets a reference to the given string and assigns it to the TransactionSubEssenceHash field. -func (o *BlockInfoResponse) SetTransactionSubEssenceHash(v string) { - o.TransactionSubEssenceHash = &v -} - -func (o BlockInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.AnchorTransactionId) { - toSerialize["anchorTransactionId"] = o.AnchorTransactionId - } - if !isNil(o.BlockIndex) { - toSerialize["blockIndex"] = o.BlockIndex - } - if !isNil(o.GasBurned) { - toSerialize["gasBurned"] = o.GasBurned - } - if !isNil(o.GasFeeCharged) { - toSerialize["gasFeeCharged"] = o.GasFeeCharged - } - if !isNil(o.L1CommitmentHash) { - toSerialize["l1CommitmentHash"] = o.L1CommitmentHash - } - if !isNil(o.NumOffLedgerRequests) { - toSerialize["numOffLedgerRequests"] = o.NumOffLedgerRequests - } - if !isNil(o.NumSuccessfulRequests) { - toSerialize["numSuccessfulRequests"] = o.NumSuccessfulRequests - } - if !isNil(o.PreviousL1CommitmentHash) { - toSerialize["previousL1CommitmentHash"] = o.PreviousL1CommitmentHash - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp - } - if !isNil(o.TotalBaseTokensInL2Accounts) { - toSerialize["totalBaseTokensInL2Accounts"] = o.TotalBaseTokensInL2Accounts - } - if !isNil(o.TotalRequests) { - toSerialize["totalRequests"] = o.TotalRequests - } - if !isNil(o.TotalStorageDeposit) { - toSerialize["totalStorageDeposit"] = o.TotalStorageDeposit - } - if !isNil(o.TransactionSubEssenceHash) { - toSerialize["transactionSubEssenceHash"] = o.TransactionSubEssenceHash - } - return json.Marshal(toSerialize) -} - -type NullableBlockInfoResponse struct { - value *BlockInfoResponse - isSet bool -} - -func (v NullableBlockInfoResponse) Get() *BlockInfoResponse { - return v.value -} - -func (v *NullableBlockInfoResponse) Set(val *BlockInfoResponse) { - v.value = val - v.isSet = true -} - -func (v NullableBlockInfoResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableBlockInfoResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBlockInfoResponse(val *BlockInfoResponse) *NullableBlockInfoResponse { - return &NullableBlockInfoResponse{value: val, isSet: true} -} - -func (v NullableBlockInfoResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBlockInfoResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_chain_info_response.go b/client/model_chain_info_response.go deleted file mode 100644 index 6a138aa9ca..0000000000 --- a/client/model_chain_info_response.go +++ /dev/null @@ -1,411 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ChainInfoResponse struct for ChainInfoResponse -type ChainInfoResponse struct { - // ChainID (Bech32-encoded). - ChainID *string `json:"chainID,omitempty"` - // The chain owner address (Bech32-encoded). - ChainOwnerId *string `json:"chainOwnerId,omitempty"` - // The description of the chain. - Description *string `json:"description,omitempty"` - // The EVM chain ID - EvmChainId *int32 `json:"evmChainId,omitempty"` - GasFeePolicy *GasFeePolicy `json:"gasFeePolicy,omitempty"` - // Whether or not the chain is active. - IsActive *bool `json:"isActive,omitempty"` - // The maximum contract blob size. - MaxBlobSize *int32 `json:"maxBlobSize,omitempty"` - // The maximum event size. - MaxEventSize *int32 `json:"maxEventSize,omitempty"` - // The maximum amount of events per request. - MaxEventsPerReq *int32 `json:"maxEventsPerReq,omitempty"` -} - -// NewChainInfoResponse instantiates a new ChainInfoResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewChainInfoResponse() *ChainInfoResponse { - this := ChainInfoResponse{} - return &this -} - -// NewChainInfoResponseWithDefaults instantiates a new ChainInfoResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewChainInfoResponseWithDefaults() *ChainInfoResponse { - this := ChainInfoResponse{} - return &this -} - -// GetChainID returns the ChainID field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetChainID() string { - if o == nil || isNil(o.ChainID) { - var ret string - return ret - } - return *o.ChainID -} - -// GetChainIDOk returns a tuple with the ChainID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetChainIDOk() (*string, bool) { - if o == nil || isNil(o.ChainID) { - return nil, false - } - return o.ChainID, true -} - -// HasChainID returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasChainID() bool { - if o != nil && !isNil(o.ChainID) { - return true - } - - return false -} - -// SetChainID gets a reference to the given string and assigns it to the ChainID field. -func (o *ChainInfoResponse) SetChainID(v string) { - o.ChainID = &v -} - -// GetChainOwnerId returns the ChainOwnerId field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetChainOwnerId() string { - if o == nil || isNil(o.ChainOwnerId) { - var ret string - return ret - } - return *o.ChainOwnerId -} - -// GetChainOwnerIdOk returns a tuple with the ChainOwnerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetChainOwnerIdOk() (*string, bool) { - if o == nil || isNil(o.ChainOwnerId) { - return nil, false - } - return o.ChainOwnerId, true -} - -// HasChainOwnerId returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasChainOwnerId() bool { - if o != nil && !isNil(o.ChainOwnerId) { - return true - } - - return false -} - -// SetChainOwnerId gets a reference to the given string and assigns it to the ChainOwnerId field. -func (o *ChainInfoResponse) SetChainOwnerId(v string) { - o.ChainOwnerId = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetDescription() string { - if o == nil || isNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetDescriptionOk() (*string, bool) { - if o == nil || isNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasDescription() bool { - if o != nil && !isNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *ChainInfoResponse) SetDescription(v string) { - o.Description = &v -} - -// GetEvmChainId returns the EvmChainId field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetEvmChainId() int32 { - if o == nil || isNil(o.EvmChainId) { - var ret int32 - return ret - } - return *o.EvmChainId -} - -// GetEvmChainIdOk returns a tuple with the EvmChainId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetEvmChainIdOk() (*int32, bool) { - if o == nil || isNil(o.EvmChainId) { - return nil, false - } - return o.EvmChainId, true -} - -// HasEvmChainId returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasEvmChainId() bool { - if o != nil && !isNil(o.EvmChainId) { - return true - } - - return false -} - -// SetEvmChainId gets a reference to the given int32 and assigns it to the EvmChainId field. -func (o *ChainInfoResponse) SetEvmChainId(v int32) { - o.EvmChainId = &v -} - -// GetGasFeePolicy returns the GasFeePolicy field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetGasFeePolicy() GasFeePolicy { - if o == nil || isNil(o.GasFeePolicy) { - var ret GasFeePolicy - return ret - } - return *o.GasFeePolicy -} - -// GetGasFeePolicyOk returns a tuple with the GasFeePolicy field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool) { - if o == nil || isNil(o.GasFeePolicy) { - return nil, false - } - return o.GasFeePolicy, true -} - -// HasGasFeePolicy returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasGasFeePolicy() bool { - if o != nil && !isNil(o.GasFeePolicy) { - return true - } - - return false -} - -// SetGasFeePolicy gets a reference to the given GasFeePolicy and assigns it to the GasFeePolicy field. -func (o *ChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { - o.GasFeePolicy = &v -} - -// GetIsActive returns the IsActive field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetIsActive() bool { - if o == nil || isNil(o.IsActive) { - var ret bool - return ret - } - return *o.IsActive -} - -// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetIsActiveOk() (*bool, bool) { - if o == nil || isNil(o.IsActive) { - return nil, false - } - return o.IsActive, true -} - -// HasIsActive returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasIsActive() bool { - if o != nil && !isNil(o.IsActive) { - return true - } - - return false -} - -// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. -func (o *ChainInfoResponse) SetIsActive(v bool) { - o.IsActive = &v -} - -// GetMaxBlobSize returns the MaxBlobSize field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetMaxBlobSize() int32 { - if o == nil || isNil(o.MaxBlobSize) { - var ret int32 - return ret - } - return *o.MaxBlobSize -} - -// GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { - if o == nil || isNil(o.MaxBlobSize) { - return nil, false - } - return o.MaxBlobSize, true -} - -// HasMaxBlobSize returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasMaxBlobSize() bool { - if o != nil && !isNil(o.MaxBlobSize) { - return true - } - - return false -} - -// SetMaxBlobSize gets a reference to the given int32 and assigns it to the MaxBlobSize field. -func (o *ChainInfoResponse) SetMaxBlobSize(v int32) { - o.MaxBlobSize = &v -} - -// GetMaxEventSize returns the MaxEventSize field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetMaxEventSize() int32 { - if o == nil || isNil(o.MaxEventSize) { - var ret int32 - return ret - } - return *o.MaxEventSize -} - -// GetMaxEventSizeOk returns a tuple with the MaxEventSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { - if o == nil || isNil(o.MaxEventSize) { - return nil, false - } - return o.MaxEventSize, true -} - -// HasMaxEventSize returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasMaxEventSize() bool { - if o != nil && !isNil(o.MaxEventSize) { - return true - } - - return false -} - -// SetMaxEventSize gets a reference to the given int32 and assigns it to the MaxEventSize field. -func (o *ChainInfoResponse) SetMaxEventSize(v int32) { - o.MaxEventSize = &v -} - -// GetMaxEventsPerReq returns the MaxEventsPerReq field value if set, zero value otherwise. -func (o *ChainInfoResponse) GetMaxEventsPerReq() int32 { - if o == nil || isNil(o.MaxEventsPerReq) { - var ret int32 - return ret - } - return *o.MaxEventsPerReq -} - -// GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { - if o == nil || isNil(o.MaxEventsPerReq) { - return nil, false - } - return o.MaxEventsPerReq, true -} - -// HasMaxEventsPerReq returns a boolean if a field has been set. -func (o *ChainInfoResponse) HasMaxEventsPerReq() bool { - if o != nil && !isNil(o.MaxEventsPerReq) { - return true - } - - return false -} - -// SetMaxEventsPerReq gets a reference to the given int32 and assigns it to the MaxEventsPerReq field. -func (o *ChainInfoResponse) SetMaxEventsPerReq(v int32) { - o.MaxEventsPerReq = &v -} - -func (o ChainInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.ChainID) { - toSerialize["chainID"] = o.ChainID - } - if !isNil(o.ChainOwnerId) { - toSerialize["chainOwnerId"] = o.ChainOwnerId - } - if !isNil(o.Description) { - toSerialize["description"] = o.Description - } - if !isNil(o.EvmChainId) { - toSerialize["evmChainId"] = o.EvmChainId - } - if !isNil(o.GasFeePolicy) { - toSerialize["gasFeePolicy"] = o.GasFeePolicy - } - if !isNil(o.IsActive) { - toSerialize["isActive"] = o.IsActive - } - if !isNil(o.MaxBlobSize) { - toSerialize["maxBlobSize"] = o.MaxBlobSize - } - if !isNil(o.MaxEventSize) { - toSerialize["maxEventSize"] = o.MaxEventSize - } - if !isNil(o.MaxEventsPerReq) { - toSerialize["maxEventsPerReq"] = o.MaxEventsPerReq - } - return json.Marshal(toSerialize) -} - -type NullableChainInfoResponse struct { - value *ChainInfoResponse - isSet bool -} - -func (v NullableChainInfoResponse) Get() *ChainInfoResponse { - return v.value -} - -func (v *NullableChainInfoResponse) Set(val *ChainInfoResponse) { - v.value = val - v.isSet = true -} - -func (v NullableChainInfoResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableChainInfoResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableChainInfoResponse(val *ChainInfoResponse) *NullableChainInfoResponse { - return &NullableChainInfoResponse{value: val, isSet: true} -} - -func (v NullableChainInfoResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableChainInfoResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_chain_metrics.go b/client/model_chain_metrics.go deleted file mode 100644 index de00a7baa3..0000000000 --- a/client/model_chain_metrics.go +++ /dev/null @@ -1,403 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ChainMetrics struct for ChainMetrics -type ChainMetrics struct { - InAliasOutput *AliasOutputMetricItem `json:"inAliasOutput,omitempty"` - InOnLedgerRequest *OnLedgerRequestMetricItem `json:"inOnLedgerRequest,omitempty"` - InOutput *InOutputMetricItem `json:"inOutput,omitempty"` - InStateOutput *InStateOutputMetricItem `json:"inStateOutput,omitempty"` - InTxInclusionState *TxInclusionStateMsgMetricItem `json:"inTxInclusionState,omitempty"` - OutPublishGovernanceTransaction *TransactionMetricItem `json:"outPublishGovernanceTransaction,omitempty"` - OutPullLatestOutput *InterfaceMetricItem `json:"outPullLatestOutput,omitempty"` - OutPullOutputByID *UTXOInputMetricItem `json:"outPullOutputByID,omitempty"` - OutPullTxInclusionState *TransactionIDMetricItem `json:"outPullTxInclusionState,omitempty"` -} - -// NewChainMetrics instantiates a new ChainMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewChainMetrics() *ChainMetrics { - this := ChainMetrics{} - return &this -} - -// NewChainMetricsWithDefaults instantiates a new ChainMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewChainMetricsWithDefaults() *ChainMetrics { - this := ChainMetrics{} - return &this -} - -// GetInAliasOutput returns the InAliasOutput field value if set, zero value otherwise. -func (o *ChainMetrics) GetInAliasOutput() AliasOutputMetricItem { - if o == nil || isNil(o.InAliasOutput) { - var ret AliasOutputMetricItem - return ret - } - return *o.InAliasOutput -} - -// GetInAliasOutputOk returns a tuple with the InAliasOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetInAliasOutputOk() (*AliasOutputMetricItem, bool) { - if o == nil || isNil(o.InAliasOutput) { - return nil, false - } - return o.InAliasOutput, true -} - -// HasInAliasOutput returns a boolean if a field has been set. -func (o *ChainMetrics) HasInAliasOutput() bool { - if o != nil && !isNil(o.InAliasOutput) { - return true - } - - return false -} - -// SetInAliasOutput gets a reference to the given AliasOutputMetricItem and assigns it to the InAliasOutput field. -func (o *ChainMetrics) SetInAliasOutput(v AliasOutputMetricItem) { - o.InAliasOutput = &v -} - -// GetInOnLedgerRequest returns the InOnLedgerRequest field value if set, zero value otherwise. -func (o *ChainMetrics) GetInOnLedgerRequest() OnLedgerRequestMetricItem { - if o == nil || isNil(o.InOnLedgerRequest) { - var ret OnLedgerRequestMetricItem - return ret - } - return *o.InOnLedgerRequest -} - -// GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetInOnLedgerRequestOk() (*OnLedgerRequestMetricItem, bool) { - if o == nil || isNil(o.InOnLedgerRequest) { - return nil, false - } - return o.InOnLedgerRequest, true -} - -// HasInOnLedgerRequest returns a boolean if a field has been set. -func (o *ChainMetrics) HasInOnLedgerRequest() bool { - if o != nil && !isNil(o.InOnLedgerRequest) { - return true - } - - return false -} - -// SetInOnLedgerRequest gets a reference to the given OnLedgerRequestMetricItem and assigns it to the InOnLedgerRequest field. -func (o *ChainMetrics) SetInOnLedgerRequest(v OnLedgerRequestMetricItem) { - o.InOnLedgerRequest = &v -} - -// GetInOutput returns the InOutput field value if set, zero value otherwise. -func (o *ChainMetrics) GetInOutput() InOutputMetricItem { - if o == nil || isNil(o.InOutput) { - var ret InOutputMetricItem - return ret - } - return *o.InOutput -} - -// GetInOutputOk returns a tuple with the InOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetInOutputOk() (*InOutputMetricItem, bool) { - if o == nil || isNil(o.InOutput) { - return nil, false - } - return o.InOutput, true -} - -// HasInOutput returns a boolean if a field has been set. -func (o *ChainMetrics) HasInOutput() bool { - if o != nil && !isNil(o.InOutput) { - return true - } - - return false -} - -// SetInOutput gets a reference to the given InOutputMetricItem and assigns it to the InOutput field. -func (o *ChainMetrics) SetInOutput(v InOutputMetricItem) { - o.InOutput = &v -} - -// GetInStateOutput returns the InStateOutput field value if set, zero value otherwise. -func (o *ChainMetrics) GetInStateOutput() InStateOutputMetricItem { - if o == nil || isNil(o.InStateOutput) { - var ret InStateOutputMetricItem - return ret - } - return *o.InStateOutput -} - -// GetInStateOutputOk returns a tuple with the InStateOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetInStateOutputOk() (*InStateOutputMetricItem, bool) { - if o == nil || isNil(o.InStateOutput) { - return nil, false - } - return o.InStateOutput, true -} - -// HasInStateOutput returns a boolean if a field has been set. -func (o *ChainMetrics) HasInStateOutput() bool { - if o != nil && !isNil(o.InStateOutput) { - return true - } - - return false -} - -// SetInStateOutput gets a reference to the given InStateOutputMetricItem and assigns it to the InStateOutput field. -func (o *ChainMetrics) SetInStateOutput(v InStateOutputMetricItem) { - o.InStateOutput = &v -} - -// GetInTxInclusionState returns the InTxInclusionState field value if set, zero value otherwise. -func (o *ChainMetrics) GetInTxInclusionState() TxInclusionStateMsgMetricItem { - if o == nil || isNil(o.InTxInclusionState) { - var ret TxInclusionStateMsgMetricItem - return ret - } - return *o.InTxInclusionState -} - -// GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetInTxInclusionStateOk() (*TxInclusionStateMsgMetricItem, bool) { - if o == nil || isNil(o.InTxInclusionState) { - return nil, false - } - return o.InTxInclusionState, true -} - -// HasInTxInclusionState returns a boolean if a field has been set. -func (o *ChainMetrics) HasInTxInclusionState() bool { - if o != nil && !isNil(o.InTxInclusionState) { - return true - } - - return false -} - -// SetInTxInclusionState gets a reference to the given TxInclusionStateMsgMetricItem and assigns it to the InTxInclusionState field. -func (o *ChainMetrics) SetInTxInclusionState(v TxInclusionStateMsgMetricItem) { - o.InTxInclusionState = &v -} - -// GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field value if set, zero value otherwise. -func (o *ChainMetrics) GetOutPublishGovernanceTransaction() TransactionMetricItem { - if o == nil || isNil(o.OutPublishGovernanceTransaction) { - var ret TransactionMetricItem - return ret - } - return *o.OutPublishGovernanceTransaction -} - -// GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetOutPublishGovernanceTransactionOk() (*TransactionMetricItem, bool) { - if o == nil || isNil(o.OutPublishGovernanceTransaction) { - return nil, false - } - return o.OutPublishGovernanceTransaction, true -} - -// HasOutPublishGovernanceTransaction returns a boolean if a field has been set. -func (o *ChainMetrics) HasOutPublishGovernanceTransaction() bool { - if o != nil && !isNil(o.OutPublishGovernanceTransaction) { - return true - } - - return false -} - -// SetOutPublishGovernanceTransaction gets a reference to the given TransactionMetricItem and assigns it to the OutPublishGovernanceTransaction field. -func (o *ChainMetrics) SetOutPublishGovernanceTransaction(v TransactionMetricItem) { - o.OutPublishGovernanceTransaction = &v -} - -// GetOutPullLatestOutput returns the OutPullLatestOutput field value if set, zero value otherwise. -func (o *ChainMetrics) GetOutPullLatestOutput() InterfaceMetricItem { - if o == nil || isNil(o.OutPullLatestOutput) { - var ret InterfaceMetricItem - return ret - } - return *o.OutPullLatestOutput -} - -// GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetOutPullLatestOutputOk() (*InterfaceMetricItem, bool) { - if o == nil || isNil(o.OutPullLatestOutput) { - return nil, false - } - return o.OutPullLatestOutput, true -} - -// HasOutPullLatestOutput returns a boolean if a field has been set. -func (o *ChainMetrics) HasOutPullLatestOutput() bool { - if o != nil && !isNil(o.OutPullLatestOutput) { - return true - } - - return false -} - -// SetOutPullLatestOutput gets a reference to the given InterfaceMetricItem and assigns it to the OutPullLatestOutput field. -func (o *ChainMetrics) SetOutPullLatestOutput(v InterfaceMetricItem) { - o.OutPullLatestOutput = &v -} - -// GetOutPullOutputByID returns the OutPullOutputByID field value if set, zero value otherwise. -func (o *ChainMetrics) GetOutPullOutputByID() UTXOInputMetricItem { - if o == nil || isNil(o.OutPullOutputByID) { - var ret UTXOInputMetricItem - return ret - } - return *o.OutPullOutputByID -} - -// GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetOutPullOutputByIDOk() (*UTXOInputMetricItem, bool) { - if o == nil || isNil(o.OutPullOutputByID) { - return nil, false - } - return o.OutPullOutputByID, true -} - -// HasOutPullOutputByID returns a boolean if a field has been set. -func (o *ChainMetrics) HasOutPullOutputByID() bool { - if o != nil && !isNil(o.OutPullOutputByID) { - return true - } - - return false -} - -// SetOutPullOutputByID gets a reference to the given UTXOInputMetricItem and assigns it to the OutPullOutputByID field. -func (o *ChainMetrics) SetOutPullOutputByID(v UTXOInputMetricItem) { - o.OutPullOutputByID = &v -} - -// GetOutPullTxInclusionState returns the OutPullTxInclusionState field value if set, zero value otherwise. -func (o *ChainMetrics) GetOutPullTxInclusionState() TransactionIDMetricItem { - if o == nil || isNil(o.OutPullTxInclusionState) { - var ret TransactionIDMetricItem - return ret - } - return *o.OutPullTxInclusionState -} - -// GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainMetrics) GetOutPullTxInclusionStateOk() (*TransactionIDMetricItem, bool) { - if o == nil || isNil(o.OutPullTxInclusionState) { - return nil, false - } - return o.OutPullTxInclusionState, true -} - -// HasOutPullTxInclusionState returns a boolean if a field has been set. -func (o *ChainMetrics) HasOutPullTxInclusionState() bool { - if o != nil && !isNil(o.OutPullTxInclusionState) { - return true - } - - return false -} - -// SetOutPullTxInclusionState gets a reference to the given TransactionIDMetricItem and assigns it to the OutPullTxInclusionState field. -func (o *ChainMetrics) SetOutPullTxInclusionState(v TransactionIDMetricItem) { - o.OutPullTxInclusionState = &v -} - -func (o ChainMetrics) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.InAliasOutput) { - toSerialize["inAliasOutput"] = o.InAliasOutput - } - if !isNil(o.InOnLedgerRequest) { - toSerialize["inOnLedgerRequest"] = o.InOnLedgerRequest - } - if !isNil(o.InOutput) { - toSerialize["inOutput"] = o.InOutput - } - if !isNil(o.InStateOutput) { - toSerialize["inStateOutput"] = o.InStateOutput - } - if !isNil(o.InTxInclusionState) { - toSerialize["inTxInclusionState"] = o.InTxInclusionState - } - if !isNil(o.OutPublishGovernanceTransaction) { - toSerialize["outPublishGovernanceTransaction"] = o.OutPublishGovernanceTransaction - } - if !isNil(o.OutPullLatestOutput) { - toSerialize["outPullLatestOutput"] = o.OutPullLatestOutput - } - if !isNil(o.OutPullOutputByID) { - toSerialize["outPullOutputByID"] = o.OutPullOutputByID - } - if !isNil(o.OutPullTxInclusionState) { - toSerialize["outPullTxInclusionState"] = o.OutPullTxInclusionState - } - return json.Marshal(toSerialize) -} - -type NullableChainMetrics struct { - value *ChainMetrics - isSet bool -} - -func (v NullableChainMetrics) Get() *ChainMetrics { - return v.value -} - -func (v *NullableChainMetrics) Set(val *ChainMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableChainMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableChainMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableChainMetrics(val *ChainMetrics) *NullableChainMetrics { - return &NullableChainMetrics{value: val, isSet: true} -} - -func (v NullableChainMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableChainMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_consensus_pipe_metrics.go b/client/model_consensus_pipe_metrics.go deleted file mode 100644 index 16e6c0c14c..0000000000 --- a/client/model_consensus_pipe_metrics.go +++ /dev/null @@ -1,259 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ConsensusPipeMetrics struct for ConsensusPipeMetrics -type ConsensusPipeMetrics struct { - EventACSMsgPipeSize *int32 `json:"eventACSMsgPipeSize,omitempty"` - EventPeerLogIndexMsgPipeSize *int32 `json:"eventPeerLogIndexMsgPipeSize,omitempty"` - EventStateTransitionMsgPipeSize *int32 `json:"eventStateTransitionMsgPipeSize,omitempty"` - EventTimerMsgPipeSize *int32 `json:"eventTimerMsgPipeSize,omitempty"` - EventVMResultMsgPipeSize *int32 `json:"eventVMResultMsgPipeSize,omitempty"` -} - -// NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewConsensusPipeMetrics() *ConsensusPipeMetrics { - this := ConsensusPipeMetrics{} - return &this -} - -// NewConsensusPipeMetricsWithDefaults instantiates a new ConsensusPipeMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewConsensusPipeMetricsWithDefaults() *ConsensusPipeMetrics { - this := ConsensusPipeMetrics{} - return &this -} - -// GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field value if set, zero value otherwise. -func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32 { - if o == nil || isNil(o.EventACSMsgPipeSize) { - var ret int32 - return ret - } - return *o.EventACSMsgPipeSize -} - -// GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool) { - if o == nil || isNil(o.EventACSMsgPipeSize) { - return nil, false - } - return o.EventACSMsgPipeSize, true -} - -// HasEventACSMsgPipeSize returns a boolean if a field has been set. -func (o *ConsensusPipeMetrics) HasEventACSMsgPipeSize() bool { - if o != nil && !isNil(o.EventACSMsgPipeSize) { - return true - } - - return false -} - -// SetEventACSMsgPipeSize gets a reference to the given int32 and assigns it to the EventACSMsgPipeSize field. -func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32) { - o.EventACSMsgPipeSize = &v -} - -// GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field value if set, zero value otherwise. -func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32 { - if o == nil || isNil(o.EventPeerLogIndexMsgPipeSize) { - var ret int32 - return ret - } - return *o.EventPeerLogIndexMsgPipeSize -} - -// GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool) { - if o == nil || isNil(o.EventPeerLogIndexMsgPipeSize) { - return nil, false - } - return o.EventPeerLogIndexMsgPipeSize, true -} - -// HasEventPeerLogIndexMsgPipeSize returns a boolean if a field has been set. -func (o *ConsensusPipeMetrics) HasEventPeerLogIndexMsgPipeSize() bool { - if o != nil && !isNil(o.EventPeerLogIndexMsgPipeSize) { - return true - } - - return false -} - -// SetEventPeerLogIndexMsgPipeSize gets a reference to the given int32 and assigns it to the EventPeerLogIndexMsgPipeSize field. -func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32) { - o.EventPeerLogIndexMsgPipeSize = &v -} - -// GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field value if set, zero value otherwise. -func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32 { - if o == nil || isNil(o.EventStateTransitionMsgPipeSize) { - var ret int32 - return ret - } - return *o.EventStateTransitionMsgPipeSize -} - -// GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool) { - if o == nil || isNil(o.EventStateTransitionMsgPipeSize) { - return nil, false - } - return o.EventStateTransitionMsgPipeSize, true -} - -// HasEventStateTransitionMsgPipeSize returns a boolean if a field has been set. -func (o *ConsensusPipeMetrics) HasEventStateTransitionMsgPipeSize() bool { - if o != nil && !isNil(o.EventStateTransitionMsgPipeSize) { - return true - } - - return false -} - -// SetEventStateTransitionMsgPipeSize gets a reference to the given int32 and assigns it to the EventStateTransitionMsgPipeSize field. -func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32) { - o.EventStateTransitionMsgPipeSize = &v -} - -// GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field value if set, zero value otherwise. -func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32 { - if o == nil || isNil(o.EventTimerMsgPipeSize) { - var ret int32 - return ret - } - return *o.EventTimerMsgPipeSize -} - -// GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool) { - if o == nil || isNil(o.EventTimerMsgPipeSize) { - return nil, false - } - return o.EventTimerMsgPipeSize, true -} - -// HasEventTimerMsgPipeSize returns a boolean if a field has been set. -func (o *ConsensusPipeMetrics) HasEventTimerMsgPipeSize() bool { - if o != nil && !isNil(o.EventTimerMsgPipeSize) { - return true - } - - return false -} - -// SetEventTimerMsgPipeSize gets a reference to the given int32 and assigns it to the EventTimerMsgPipeSize field. -func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32) { - o.EventTimerMsgPipeSize = &v -} - -// GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field value if set, zero value otherwise. -func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32 { - if o == nil || isNil(o.EventVMResultMsgPipeSize) { - var ret int32 - return ret - } - return *o.EventVMResultMsgPipeSize -} - -// GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool) { - if o == nil || isNil(o.EventVMResultMsgPipeSize) { - return nil, false - } - return o.EventVMResultMsgPipeSize, true -} - -// HasEventVMResultMsgPipeSize returns a boolean if a field has been set. -func (o *ConsensusPipeMetrics) HasEventVMResultMsgPipeSize() bool { - if o != nil && !isNil(o.EventVMResultMsgPipeSize) { - return true - } - - return false -} - -// SetEventVMResultMsgPipeSize gets a reference to the given int32 and assigns it to the EventVMResultMsgPipeSize field. -func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32) { - o.EventVMResultMsgPipeSize = &v -} - -func (o ConsensusPipeMetrics) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.EventACSMsgPipeSize) { - toSerialize["eventACSMsgPipeSize"] = o.EventACSMsgPipeSize - } - if !isNil(o.EventPeerLogIndexMsgPipeSize) { - toSerialize["eventPeerLogIndexMsgPipeSize"] = o.EventPeerLogIndexMsgPipeSize - } - if !isNil(o.EventStateTransitionMsgPipeSize) { - toSerialize["eventStateTransitionMsgPipeSize"] = o.EventStateTransitionMsgPipeSize - } - if !isNil(o.EventTimerMsgPipeSize) { - toSerialize["eventTimerMsgPipeSize"] = o.EventTimerMsgPipeSize - } - if !isNil(o.EventVMResultMsgPipeSize) { - toSerialize["eventVMResultMsgPipeSize"] = o.EventVMResultMsgPipeSize - } - return json.Marshal(toSerialize) -} - -type NullableConsensusPipeMetrics struct { - value *ConsensusPipeMetrics - isSet bool -} - -func (v NullableConsensusPipeMetrics) Get() *ConsensusPipeMetrics { - return v.value -} - -func (v *NullableConsensusPipeMetrics) Set(val *ConsensusPipeMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableConsensusPipeMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableConsensusPipeMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConsensusPipeMetrics(val *ConsensusPipeMetrics) *NullableConsensusPipeMetrics { - return &NullableConsensusPipeMetrics{value: val, isSet: true} -} - -func (v NullableConsensusPipeMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConsensusPipeMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_consensus_workflow_metrics.go b/client/model_consensus_workflow_metrics.go deleted file mode 100644 index 222fe9222b..0000000000 --- a/client/model_consensus_workflow_metrics.go +++ /dev/null @@ -1,746 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" - "time" -) - -// ConsensusWorkflowMetrics struct for ConsensusWorkflowMetrics -type ConsensusWorkflowMetrics struct { - // Shows current state index of the consensus - CurrentStateIndex *int32 `json:"currentStateIndex,omitempty"` - // Shows if batch proposal is sent out in current consensus iteration - FlagBatchProposalSent *bool `json:"flagBatchProposalSent,omitempty"` - // Shows if consensus on batch is reached and known in current consensus iteration - FlagConsensusBatchKnown *bool `json:"flagConsensusBatchKnown,omitempty"` - // Shows if consensus algorithm is still not completed in current consensus iteration - FlagInProgress *bool `json:"flagInProgress,omitempty"` - // Shows if state output is received in current consensus iteration - FlagStateReceived *bool `json:"flagStateReceived,omitempty"` - // Shows if consensus on transaction is reached in current consensus iteration - FlagTransactionFinalized *bool `json:"flagTransactionFinalized,omitempty"` - // Shows if transaction is posted to L1 in current consensus iteration - FlagTransactionPosted *bool `json:"flagTransactionPosted,omitempty"` - // Shows if L1 reported that it has seen the transaction of current consensus iteration - FlagTransactionSeen *bool `json:"flagTransactionSeen,omitempty"` - // Shows if virtual machine has returned its results in current consensus iteration - FlagVMResultSigned *bool `json:"flagVMResultSigned,omitempty"` - // Shows if virtual machine is started in current consensus iteration - FlagVMStarted *bool `json:"flagVMStarted,omitempty"` - // Shows when batch proposal was last sent out in current consensus iteration - TimeBatchProposalSent *time.Time `json:"timeBatchProposalSent,omitempty"` - // Shows when algorithm was last completed in current consensus iteration - TimeCompleted *time.Time `json:"timeCompleted,omitempty"` - // Shows when ACS results of consensus on batch was last received in current consensus iteration - TimeConsensusBatchKnown *time.Time `json:"timeConsensusBatchKnown,omitempty"` - // Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration - TimeTransactionFinalized *time.Time `json:"timeTransactionFinalized,omitempty"` - // Shows when transaction was last posted to L1 in current consensus iteration - TimeTransactionPosted *time.Time `json:"timeTransactionPosted,omitempty"` - // Shows when algorithm last noted that transaction had been seen by L1 in current consensus iteration - TimeTransactionSeen *time.Time `json:"timeTransactionSeen,omitempty"` - // Shows when virtual machine results were last received and signed in current consensus iteration - TimeVMResultSigned *time.Time `json:"timeVMResultSigned,omitempty"` - // Shows when virtual machine was last started in current consensus iteration - TimeVMStarted *time.Time `json:"timeVMStarted,omitempty"` -} - -// NewConsensusWorkflowMetrics instantiates a new ConsensusWorkflowMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewConsensusWorkflowMetrics() *ConsensusWorkflowMetrics { - this := ConsensusWorkflowMetrics{} - return &this -} - -// NewConsensusWorkflowMetricsWithDefaults instantiates a new ConsensusWorkflowMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewConsensusWorkflowMetricsWithDefaults() *ConsensusWorkflowMetrics { - this := ConsensusWorkflowMetrics{} - return &this -} - -// GetCurrentStateIndex returns the CurrentStateIndex field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetCurrentStateIndex() int32 { - if o == nil || isNil(o.CurrentStateIndex) { - var ret int32 - return ret - } - return *o.CurrentStateIndex -} - -// GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetCurrentStateIndexOk() (*int32, bool) { - if o == nil || isNil(o.CurrentStateIndex) { - return nil, false - } - return o.CurrentStateIndex, true -} - -// HasCurrentStateIndex returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasCurrentStateIndex() bool { - if o != nil && !isNil(o.CurrentStateIndex) { - return true - } - - return false -} - -// SetCurrentStateIndex gets a reference to the given int32 and assigns it to the CurrentStateIndex field. -func (o *ConsensusWorkflowMetrics) SetCurrentStateIndex(v int32) { - o.CurrentStateIndex = &v -} - -// GetFlagBatchProposalSent returns the FlagBatchProposalSent field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSent() bool { - if o == nil || isNil(o.FlagBatchProposalSent) { - var ret bool - return ret - } - return *o.FlagBatchProposalSent -} - -// GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSentOk() (*bool, bool) { - if o == nil || isNil(o.FlagBatchProposalSent) { - return nil, false - } - return o.FlagBatchProposalSent, true -} - -// HasFlagBatchProposalSent returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagBatchProposalSent() bool { - if o != nil && !isNil(o.FlagBatchProposalSent) { - return true - } - - return false -} - -// SetFlagBatchProposalSent gets a reference to the given bool and assigns it to the FlagBatchProposalSent field. -func (o *ConsensusWorkflowMetrics) SetFlagBatchProposalSent(v bool) { - o.FlagBatchProposalSent = &v -} - -// GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnown() bool { - if o == nil || isNil(o.FlagConsensusBatchKnown) { - var ret bool - return ret - } - return *o.FlagConsensusBatchKnown -} - -// GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnownOk() (*bool, bool) { - if o == nil || isNil(o.FlagConsensusBatchKnown) { - return nil, false - } - return o.FlagConsensusBatchKnown, true -} - -// HasFlagConsensusBatchKnown returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagConsensusBatchKnown() bool { - if o != nil && !isNil(o.FlagConsensusBatchKnown) { - return true - } - - return false -} - -// SetFlagConsensusBatchKnown gets a reference to the given bool and assigns it to the FlagConsensusBatchKnown field. -func (o *ConsensusWorkflowMetrics) SetFlagConsensusBatchKnown(v bool) { - o.FlagConsensusBatchKnown = &v -} - -// GetFlagInProgress returns the FlagInProgress field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagInProgress() bool { - if o == nil || isNil(o.FlagInProgress) { - var ret bool - return ret - } - return *o.FlagInProgress -} - -// GetFlagInProgressOk returns a tuple with the FlagInProgress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagInProgressOk() (*bool, bool) { - if o == nil || isNil(o.FlagInProgress) { - return nil, false - } - return o.FlagInProgress, true -} - -// HasFlagInProgress returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagInProgress() bool { - if o != nil && !isNil(o.FlagInProgress) { - return true - } - - return false -} - -// SetFlagInProgress gets a reference to the given bool and assigns it to the FlagInProgress field. -func (o *ConsensusWorkflowMetrics) SetFlagInProgress(v bool) { - o.FlagInProgress = &v -} - -// GetFlagStateReceived returns the FlagStateReceived field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagStateReceived() bool { - if o == nil || isNil(o.FlagStateReceived) { - var ret bool - return ret - } - return *o.FlagStateReceived -} - -// GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagStateReceivedOk() (*bool, bool) { - if o == nil || isNil(o.FlagStateReceived) { - return nil, false - } - return o.FlagStateReceived, true -} - -// HasFlagStateReceived returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagStateReceived() bool { - if o != nil && !isNil(o.FlagStateReceived) { - return true - } - - return false -} - -// SetFlagStateReceived gets a reference to the given bool and assigns it to the FlagStateReceived field. -func (o *ConsensusWorkflowMetrics) SetFlagStateReceived(v bool) { - o.FlagStateReceived = &v -} - -// GetFlagTransactionFinalized returns the FlagTransactionFinalized field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalized() bool { - if o == nil || isNil(o.FlagTransactionFinalized) { - var ret bool - return ret - } - return *o.FlagTransactionFinalized -} - -// GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalizedOk() (*bool, bool) { - if o == nil || isNil(o.FlagTransactionFinalized) { - return nil, false - } - return o.FlagTransactionFinalized, true -} - -// HasFlagTransactionFinalized returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagTransactionFinalized() bool { - if o != nil && !isNil(o.FlagTransactionFinalized) { - return true - } - - return false -} - -// SetFlagTransactionFinalized gets a reference to the given bool and assigns it to the FlagTransactionFinalized field. -func (o *ConsensusWorkflowMetrics) SetFlagTransactionFinalized(v bool) { - o.FlagTransactionFinalized = &v -} - -// GetFlagTransactionPosted returns the FlagTransactionPosted field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagTransactionPosted() bool { - if o == nil || isNil(o.FlagTransactionPosted) { - var ret bool - return ret - } - return *o.FlagTransactionPosted -} - -// GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagTransactionPostedOk() (*bool, bool) { - if o == nil || isNil(o.FlagTransactionPosted) { - return nil, false - } - return o.FlagTransactionPosted, true -} - -// HasFlagTransactionPosted returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagTransactionPosted() bool { - if o != nil && !isNil(o.FlagTransactionPosted) { - return true - } - - return false -} - -// SetFlagTransactionPosted gets a reference to the given bool and assigns it to the FlagTransactionPosted field. -func (o *ConsensusWorkflowMetrics) SetFlagTransactionPosted(v bool) { - o.FlagTransactionPosted = &v -} - -// GetFlagTransactionSeen returns the FlagTransactionSeen field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeen() bool { - if o == nil || isNil(o.FlagTransactionSeen) { - var ret bool - return ret - } - return *o.FlagTransactionSeen -} - -// GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeenOk() (*bool, bool) { - if o == nil || isNil(o.FlagTransactionSeen) { - return nil, false - } - return o.FlagTransactionSeen, true -} - -// HasFlagTransactionSeen returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagTransactionSeen() bool { - if o != nil && !isNil(o.FlagTransactionSeen) { - return true - } - - return false -} - -// SetFlagTransactionSeen gets a reference to the given bool and assigns it to the FlagTransactionSeen field. -func (o *ConsensusWorkflowMetrics) SetFlagTransactionSeen(v bool) { - o.FlagTransactionSeen = &v -} - -// GetFlagVMResultSigned returns the FlagVMResultSigned field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagVMResultSigned() bool { - if o == nil || isNil(o.FlagVMResultSigned) { - var ret bool - return ret - } - return *o.FlagVMResultSigned -} - -// GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagVMResultSignedOk() (*bool, bool) { - if o == nil || isNil(o.FlagVMResultSigned) { - return nil, false - } - return o.FlagVMResultSigned, true -} - -// HasFlagVMResultSigned returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagVMResultSigned() bool { - if o != nil && !isNil(o.FlagVMResultSigned) { - return true - } - - return false -} - -// SetFlagVMResultSigned gets a reference to the given bool and assigns it to the FlagVMResultSigned field. -func (o *ConsensusWorkflowMetrics) SetFlagVMResultSigned(v bool) { - o.FlagVMResultSigned = &v -} - -// GetFlagVMStarted returns the FlagVMStarted field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetFlagVMStarted() bool { - if o == nil || isNil(o.FlagVMStarted) { - var ret bool - return ret - } - return *o.FlagVMStarted -} - -// GetFlagVMStartedOk returns a tuple with the FlagVMStarted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetFlagVMStartedOk() (*bool, bool) { - if o == nil || isNil(o.FlagVMStarted) { - return nil, false - } - return o.FlagVMStarted, true -} - -// HasFlagVMStarted returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasFlagVMStarted() bool { - if o != nil && !isNil(o.FlagVMStarted) { - return true - } - - return false -} - -// SetFlagVMStarted gets a reference to the given bool and assigns it to the FlagVMStarted field. -func (o *ConsensusWorkflowMetrics) SetFlagVMStarted(v bool) { - o.FlagVMStarted = &v -} - -// GetTimeBatchProposalSent returns the TimeBatchProposalSent field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSent() time.Time { - if o == nil || isNil(o.TimeBatchProposalSent) { - var ret time.Time - return ret - } - return *o.TimeBatchProposalSent -} - -// GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSentOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeBatchProposalSent) { - return nil, false - } - return o.TimeBatchProposalSent, true -} - -// HasTimeBatchProposalSent returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeBatchProposalSent() bool { - if o != nil && !isNil(o.TimeBatchProposalSent) { - return true - } - - return false -} - -// SetTimeBatchProposalSent gets a reference to the given time.Time and assigns it to the TimeBatchProposalSent field. -func (o *ConsensusWorkflowMetrics) SetTimeBatchProposalSent(v time.Time) { - o.TimeBatchProposalSent = &v -} - -// GetTimeCompleted returns the TimeCompleted field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeCompleted() time.Time { - if o == nil || isNil(o.TimeCompleted) { - var ret time.Time - return ret - } - return *o.TimeCompleted -} - -// GetTimeCompletedOk returns a tuple with the TimeCompleted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeCompletedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeCompleted) { - return nil, false - } - return o.TimeCompleted, true -} - -// HasTimeCompleted returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeCompleted() bool { - if o != nil && !isNil(o.TimeCompleted) { - return true - } - - return false -} - -// SetTimeCompleted gets a reference to the given time.Time and assigns it to the TimeCompleted field. -func (o *ConsensusWorkflowMetrics) SetTimeCompleted(v time.Time) { - o.TimeCompleted = &v -} - -// GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnown() time.Time { - if o == nil || isNil(o.TimeConsensusBatchKnown) { - var ret time.Time - return ret - } - return *o.TimeConsensusBatchKnown -} - -// GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnownOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeConsensusBatchKnown) { - return nil, false - } - return o.TimeConsensusBatchKnown, true -} - -// HasTimeConsensusBatchKnown returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeConsensusBatchKnown() bool { - if o != nil && !isNil(o.TimeConsensusBatchKnown) { - return true - } - - return false -} - -// SetTimeConsensusBatchKnown gets a reference to the given time.Time and assigns it to the TimeConsensusBatchKnown field. -func (o *ConsensusWorkflowMetrics) SetTimeConsensusBatchKnown(v time.Time) { - o.TimeConsensusBatchKnown = &v -} - -// GetTimeTransactionFinalized returns the TimeTransactionFinalized field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalized() time.Time { - if o == nil || isNil(o.TimeTransactionFinalized) { - var ret time.Time - return ret - } - return *o.TimeTransactionFinalized -} - -// GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalizedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeTransactionFinalized) { - return nil, false - } - return o.TimeTransactionFinalized, true -} - -// HasTimeTransactionFinalized returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeTransactionFinalized() bool { - if o != nil && !isNil(o.TimeTransactionFinalized) { - return true - } - - return false -} - -// SetTimeTransactionFinalized gets a reference to the given time.Time and assigns it to the TimeTransactionFinalized field. -func (o *ConsensusWorkflowMetrics) SetTimeTransactionFinalized(v time.Time) { - o.TimeTransactionFinalized = &v -} - -// GetTimeTransactionPosted returns the TimeTransactionPosted field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeTransactionPosted() time.Time { - if o == nil || isNil(o.TimeTransactionPosted) { - var ret time.Time - return ret - } - return *o.TimeTransactionPosted -} - -// GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeTransactionPostedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeTransactionPosted) { - return nil, false - } - return o.TimeTransactionPosted, true -} - -// HasTimeTransactionPosted returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeTransactionPosted() bool { - if o != nil && !isNil(o.TimeTransactionPosted) { - return true - } - - return false -} - -// SetTimeTransactionPosted gets a reference to the given time.Time and assigns it to the TimeTransactionPosted field. -func (o *ConsensusWorkflowMetrics) SetTimeTransactionPosted(v time.Time) { - o.TimeTransactionPosted = &v -} - -// GetTimeTransactionSeen returns the TimeTransactionSeen field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeen() time.Time { - if o == nil || isNil(o.TimeTransactionSeen) { - var ret time.Time - return ret - } - return *o.TimeTransactionSeen -} - -// GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeenOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeTransactionSeen) { - return nil, false - } - return o.TimeTransactionSeen, true -} - -// HasTimeTransactionSeen returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeTransactionSeen() bool { - if o != nil && !isNil(o.TimeTransactionSeen) { - return true - } - - return false -} - -// SetTimeTransactionSeen gets a reference to the given time.Time and assigns it to the TimeTransactionSeen field. -func (o *ConsensusWorkflowMetrics) SetTimeTransactionSeen(v time.Time) { - o.TimeTransactionSeen = &v -} - -// GetTimeVMResultSigned returns the TimeVMResultSigned field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeVMResultSigned() time.Time { - if o == nil || isNil(o.TimeVMResultSigned) { - var ret time.Time - return ret - } - return *o.TimeVMResultSigned -} - -// GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeVMResultSignedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeVMResultSigned) { - return nil, false - } - return o.TimeVMResultSigned, true -} - -// HasTimeVMResultSigned returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeVMResultSigned() bool { - if o != nil && !isNil(o.TimeVMResultSigned) { - return true - } - - return false -} - -// SetTimeVMResultSigned gets a reference to the given time.Time and assigns it to the TimeVMResultSigned field. -func (o *ConsensusWorkflowMetrics) SetTimeVMResultSigned(v time.Time) { - o.TimeVMResultSigned = &v -} - -// GetTimeVMStarted returns the TimeVMStarted field value if set, zero value otherwise. -func (o *ConsensusWorkflowMetrics) GetTimeVMStarted() time.Time { - if o == nil || isNil(o.TimeVMStarted) { - var ret time.Time - return ret - } - return *o.TimeVMStarted -} - -// GetTimeVMStartedOk returns a tuple with the TimeVMStarted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowMetrics) GetTimeVMStartedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeVMStarted) { - return nil, false - } - return o.TimeVMStarted, true -} - -// HasTimeVMStarted returns a boolean if a field has been set. -func (o *ConsensusWorkflowMetrics) HasTimeVMStarted() bool { - if o != nil && !isNil(o.TimeVMStarted) { - return true - } - - return false -} - -// SetTimeVMStarted gets a reference to the given time.Time and assigns it to the TimeVMStarted field. -func (o *ConsensusWorkflowMetrics) SetTimeVMStarted(v time.Time) { - o.TimeVMStarted = &v -} - -func (o ConsensusWorkflowMetrics) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.CurrentStateIndex) { - toSerialize["currentStateIndex"] = o.CurrentStateIndex - } - if !isNil(o.FlagBatchProposalSent) { - toSerialize["flagBatchProposalSent"] = o.FlagBatchProposalSent - } - if !isNil(o.FlagConsensusBatchKnown) { - toSerialize["flagConsensusBatchKnown"] = o.FlagConsensusBatchKnown - } - if !isNil(o.FlagInProgress) { - toSerialize["flagInProgress"] = o.FlagInProgress - } - if !isNil(o.FlagStateReceived) { - toSerialize["flagStateReceived"] = o.FlagStateReceived - } - if !isNil(o.FlagTransactionFinalized) { - toSerialize["flagTransactionFinalized"] = o.FlagTransactionFinalized - } - if !isNil(o.FlagTransactionPosted) { - toSerialize["flagTransactionPosted"] = o.FlagTransactionPosted - } - if !isNil(o.FlagTransactionSeen) { - toSerialize["flagTransactionSeen"] = o.FlagTransactionSeen - } - if !isNil(o.FlagVMResultSigned) { - toSerialize["flagVMResultSigned"] = o.FlagVMResultSigned - } - if !isNil(o.FlagVMStarted) { - toSerialize["flagVMStarted"] = o.FlagVMStarted - } - if !isNil(o.TimeBatchProposalSent) { - toSerialize["timeBatchProposalSent"] = o.TimeBatchProposalSent - } - if !isNil(o.TimeCompleted) { - toSerialize["timeCompleted"] = o.TimeCompleted - } - if !isNil(o.TimeConsensusBatchKnown) { - toSerialize["timeConsensusBatchKnown"] = o.TimeConsensusBatchKnown - } - if !isNil(o.TimeTransactionFinalized) { - toSerialize["timeTransactionFinalized"] = o.TimeTransactionFinalized - } - if !isNil(o.TimeTransactionPosted) { - toSerialize["timeTransactionPosted"] = o.TimeTransactionPosted - } - if !isNil(o.TimeTransactionSeen) { - toSerialize["timeTransactionSeen"] = o.TimeTransactionSeen - } - if !isNil(o.TimeVMResultSigned) { - toSerialize["timeVMResultSigned"] = o.TimeVMResultSigned - } - if !isNil(o.TimeVMStarted) { - toSerialize["timeVMStarted"] = o.TimeVMStarted - } - return json.Marshal(toSerialize) -} - -type NullableConsensusWorkflowMetrics struct { - value *ConsensusWorkflowMetrics - isSet bool -} - -func (v NullableConsensusWorkflowMetrics) Get() *ConsensusWorkflowMetrics { - return v.value -} - -func (v *NullableConsensusWorkflowMetrics) Set(val *ConsensusWorkflowMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableConsensusWorkflowMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableConsensusWorkflowMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConsensusWorkflowMetrics(val *ConsensusWorkflowMetrics) *NullableConsensusWorkflowMetrics { - return &NullableConsensusWorkflowMetrics{value: val, isSet: true} -} - -func (v NullableConsensusWorkflowMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConsensusWorkflowMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_contract_call_view_request.go b/client/model_contract_call_view_request.go deleted file mode 100644 index 97878ce7be..0000000000 --- a/client/model_contract_call_view_request.go +++ /dev/null @@ -1,300 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ContractCallViewRequest struct for ContractCallViewRequest -type ContractCallViewRequest struct { - Arguments *JSONDict `json:"arguments,omitempty"` - // The chain id - ChainId *string `json:"chainId,omitempty"` - // The contract name as HName (Hex) - ContractHName *string `json:"contractHName,omitempty"` - // The contract name - ContractName *string `json:"contractName,omitempty"` - // The function name as HName (Hex) - FunctionHName *string `json:"functionHName,omitempty"` - // The function name - FunctionName *string `json:"functionName,omitempty"` -} - -// NewContractCallViewRequest instantiates a new ContractCallViewRequest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewContractCallViewRequest() *ContractCallViewRequest { - this := ContractCallViewRequest{} - return &this -} - -// NewContractCallViewRequestWithDefaults instantiates a new ContractCallViewRequest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewContractCallViewRequestWithDefaults() *ContractCallViewRequest { - this := ContractCallViewRequest{} - return &this -} - -// GetArguments returns the Arguments field value if set, zero value otherwise. -func (o *ContractCallViewRequest) GetArguments() JSONDict { - if o == nil || isNil(o.Arguments) { - var ret JSONDict - return ret - } - return *o.Arguments -} - -// GetArgumentsOk returns a tuple with the Arguments field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ContractCallViewRequest) GetArgumentsOk() (*JSONDict, bool) { - if o == nil || isNil(o.Arguments) { - return nil, false - } - return o.Arguments, true -} - -// HasArguments returns a boolean if a field has been set. -func (o *ContractCallViewRequest) HasArguments() bool { - if o != nil && !isNil(o.Arguments) { - return true - } - - return false -} - -// SetArguments gets a reference to the given JSONDict and assigns it to the Arguments field. -func (o *ContractCallViewRequest) SetArguments(v JSONDict) { - o.Arguments = &v -} - -// GetChainId returns the ChainId field value if set, zero value otherwise. -func (o *ContractCallViewRequest) GetChainId() string { - if o == nil || isNil(o.ChainId) { - var ret string - return ret - } - return *o.ChainId -} - -// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ContractCallViewRequest) GetChainIdOk() (*string, bool) { - if o == nil || isNil(o.ChainId) { - return nil, false - } - return o.ChainId, true -} - -// HasChainId returns a boolean if a field has been set. -func (o *ContractCallViewRequest) HasChainId() bool { - if o != nil && !isNil(o.ChainId) { - return true - } - - return false -} - -// SetChainId gets a reference to the given string and assigns it to the ChainId field. -func (o *ContractCallViewRequest) SetChainId(v string) { - o.ChainId = &v -} - -// GetContractHName returns the ContractHName field value if set, zero value otherwise. -func (o *ContractCallViewRequest) GetContractHName() string { - if o == nil || isNil(o.ContractHName) { - var ret string - return ret - } - return *o.ContractHName -} - -// GetContractHNameOk returns a tuple with the ContractHName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ContractCallViewRequest) GetContractHNameOk() (*string, bool) { - if o == nil || isNil(o.ContractHName) { - return nil, false - } - return o.ContractHName, true -} - -// HasContractHName returns a boolean if a field has been set. -func (o *ContractCallViewRequest) HasContractHName() bool { - if o != nil && !isNil(o.ContractHName) { - return true - } - - return false -} - -// SetContractHName gets a reference to the given string and assigns it to the ContractHName field. -func (o *ContractCallViewRequest) SetContractHName(v string) { - o.ContractHName = &v -} - -// GetContractName returns the ContractName field value if set, zero value otherwise. -func (o *ContractCallViewRequest) GetContractName() string { - if o == nil || isNil(o.ContractName) { - var ret string - return ret - } - return *o.ContractName -} - -// GetContractNameOk returns a tuple with the ContractName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ContractCallViewRequest) GetContractNameOk() (*string, bool) { - if o == nil || isNil(o.ContractName) { - return nil, false - } - return o.ContractName, true -} - -// HasContractName returns a boolean if a field has been set. -func (o *ContractCallViewRequest) HasContractName() bool { - if o != nil && !isNil(o.ContractName) { - return true - } - - return false -} - -// SetContractName gets a reference to the given string and assigns it to the ContractName field. -func (o *ContractCallViewRequest) SetContractName(v string) { - o.ContractName = &v -} - -// GetFunctionHName returns the FunctionHName field value if set, zero value otherwise. -func (o *ContractCallViewRequest) GetFunctionHName() string { - if o == nil || isNil(o.FunctionHName) { - var ret string - return ret - } - return *o.FunctionHName -} - -// GetFunctionHNameOk returns a tuple with the FunctionHName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ContractCallViewRequest) GetFunctionHNameOk() (*string, bool) { - if o == nil || isNil(o.FunctionHName) { - return nil, false - } - return o.FunctionHName, true -} - -// HasFunctionHName returns a boolean if a field has been set. -func (o *ContractCallViewRequest) HasFunctionHName() bool { - if o != nil && !isNil(o.FunctionHName) { - return true - } - - return false -} - -// SetFunctionHName gets a reference to the given string and assigns it to the FunctionHName field. -func (o *ContractCallViewRequest) SetFunctionHName(v string) { - o.FunctionHName = &v -} - -// GetFunctionName returns the FunctionName field value if set, zero value otherwise. -func (o *ContractCallViewRequest) GetFunctionName() string { - if o == nil || isNil(o.FunctionName) { - var ret string - return ret - } - return *o.FunctionName -} - -// GetFunctionNameOk returns a tuple with the FunctionName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ContractCallViewRequest) GetFunctionNameOk() (*string, bool) { - if o == nil || isNil(o.FunctionName) { - return nil, false - } - return o.FunctionName, true -} - -// HasFunctionName returns a boolean if a field has been set. -func (o *ContractCallViewRequest) HasFunctionName() bool { - if o != nil && !isNil(o.FunctionName) { - return true - } - - return false -} - -// SetFunctionName gets a reference to the given string and assigns it to the FunctionName field. -func (o *ContractCallViewRequest) SetFunctionName(v string) { - o.FunctionName = &v -} - -func (o ContractCallViewRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Arguments) { - toSerialize["arguments"] = o.Arguments - } - if !isNil(o.ChainId) { - toSerialize["chainId"] = o.ChainId - } - if !isNil(o.ContractHName) { - toSerialize["contractHName"] = o.ContractHName - } - if !isNil(o.ContractName) { - toSerialize["contractName"] = o.ContractName - } - if !isNil(o.FunctionHName) { - toSerialize["functionHName"] = o.FunctionHName - } - if !isNil(o.FunctionName) { - toSerialize["functionName"] = o.FunctionName - } - return json.Marshal(toSerialize) -} - -type NullableContractCallViewRequest struct { - value *ContractCallViewRequest - isSet bool -} - -func (v NullableContractCallViewRequest) Get() *ContractCallViewRequest { - return v.value -} - -func (v *NullableContractCallViewRequest) Set(val *ContractCallViewRequest) { - v.value = val - v.isSet = true -} - -func (v NullableContractCallViewRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableContractCallViewRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableContractCallViewRequest(val *ContractCallViewRequest) *NullableContractCallViewRequest { - return &NullableContractCallViewRequest{value: val, isSet: true} -} - -func (v NullableContractCallViewRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableContractCallViewRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_dk_shares_info.go b/client/model_dk_shares_info.go deleted file mode 100644 index 11bc4a75e8..0000000000 --- a/client/model_dk_shares_info.go +++ /dev/null @@ -1,299 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// DKSharesInfo struct for DKSharesInfo -type DKSharesInfo struct { - // New generated shared address. - Address *string `json:"address,omitempty"` - // Identities of the nodes sharing the key. (Hex) - PeerIdentities []string `json:"peerIdentities,omitempty"` - PeerIndex *int32 `json:"peerIndex,omitempty"` - // Used public key. (Hex) - PublicKey *string `json:"publicKey,omitempty"` - // Public key shares for all the peers. (Hex) - PublicKeyShares []string `json:"publicKeyShares,omitempty"` - Threshold *int32 `json:"threshold,omitempty"` -} - -// NewDKSharesInfo instantiates a new DKSharesInfo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDKSharesInfo() *DKSharesInfo { - this := DKSharesInfo{} - return &this -} - -// NewDKSharesInfoWithDefaults instantiates a new DKSharesInfo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDKSharesInfoWithDefaults() *DKSharesInfo { - this := DKSharesInfo{} - return &this -} - -// GetAddress returns the Address field value if set, zero value otherwise. -func (o *DKSharesInfo) GetAddress() string { - if o == nil || isNil(o.Address) { - var ret string - return ret - } - return *o.Address -} - -// GetAddressOk returns a tuple with the Address field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesInfo) GetAddressOk() (*string, bool) { - if o == nil || isNil(o.Address) { - return nil, false - } - return o.Address, true -} - -// HasAddress returns a boolean if a field has been set. -func (o *DKSharesInfo) HasAddress() bool { - if o != nil && !isNil(o.Address) { - return true - } - - return false -} - -// SetAddress gets a reference to the given string and assigns it to the Address field. -func (o *DKSharesInfo) SetAddress(v string) { - o.Address = &v -} - -// GetPeerIdentities returns the PeerIdentities field value if set, zero value otherwise. -func (o *DKSharesInfo) GetPeerIdentities() []string { - if o == nil || isNil(o.PeerIdentities) { - var ret []string - return ret - } - return o.PeerIdentities -} - -// GetPeerIdentitiesOk returns a tuple with the PeerIdentities field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesInfo) GetPeerIdentitiesOk() ([]string, bool) { - if o == nil || isNil(o.PeerIdentities) { - return nil, false - } - return o.PeerIdentities, true -} - -// HasPeerIdentities returns a boolean if a field has been set. -func (o *DKSharesInfo) HasPeerIdentities() bool { - if o != nil && !isNil(o.PeerIdentities) { - return true - } - - return false -} - -// SetPeerIdentities gets a reference to the given []string and assigns it to the PeerIdentities field. -func (o *DKSharesInfo) SetPeerIdentities(v []string) { - o.PeerIdentities = v -} - -// GetPeerIndex returns the PeerIndex field value if set, zero value otherwise. -func (o *DKSharesInfo) GetPeerIndex() int32 { - if o == nil || isNil(o.PeerIndex) { - var ret int32 - return ret - } - return *o.PeerIndex -} - -// GetPeerIndexOk returns a tuple with the PeerIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesInfo) GetPeerIndexOk() (*int32, bool) { - if o == nil || isNil(o.PeerIndex) { - return nil, false - } - return o.PeerIndex, true -} - -// HasPeerIndex returns a boolean if a field has been set. -func (o *DKSharesInfo) HasPeerIndex() bool { - if o != nil && !isNil(o.PeerIndex) { - return true - } - - return false -} - -// SetPeerIndex gets a reference to the given int32 and assigns it to the PeerIndex field. -func (o *DKSharesInfo) SetPeerIndex(v int32) { - o.PeerIndex = &v -} - -// GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *DKSharesInfo) GetPublicKey() string { - if o == nil || isNil(o.PublicKey) { - var ret string - return ret - } - return *o.PublicKey -} - -// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesInfo) GetPublicKeyOk() (*string, bool) { - if o == nil || isNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true -} - -// HasPublicKey returns a boolean if a field has been set. -func (o *DKSharesInfo) HasPublicKey() bool { - if o != nil && !isNil(o.PublicKey) { - return true - } - - return false -} - -// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. -func (o *DKSharesInfo) SetPublicKey(v string) { - o.PublicKey = &v -} - -// GetPublicKeyShares returns the PublicKeyShares field value if set, zero value otherwise. -func (o *DKSharesInfo) GetPublicKeyShares() []string { - if o == nil || isNil(o.PublicKeyShares) { - var ret []string - return ret - } - return o.PublicKeyShares -} - -// GetPublicKeySharesOk returns a tuple with the PublicKeyShares field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesInfo) GetPublicKeySharesOk() ([]string, bool) { - if o == nil || isNil(o.PublicKeyShares) { - return nil, false - } - return o.PublicKeyShares, true -} - -// HasPublicKeyShares returns a boolean if a field has been set. -func (o *DKSharesInfo) HasPublicKeyShares() bool { - if o != nil && !isNil(o.PublicKeyShares) { - return true - } - - return false -} - -// SetPublicKeyShares gets a reference to the given []string and assigns it to the PublicKeyShares field. -func (o *DKSharesInfo) SetPublicKeyShares(v []string) { - o.PublicKeyShares = v -} - -// GetThreshold returns the Threshold field value if set, zero value otherwise. -func (o *DKSharesInfo) GetThreshold() int32 { - if o == nil || isNil(o.Threshold) { - var ret int32 - return ret - } - return *o.Threshold -} - -// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesInfo) GetThresholdOk() (*int32, bool) { - if o == nil || isNil(o.Threshold) { - return nil, false - } - return o.Threshold, true -} - -// HasThreshold returns a boolean if a field has been set. -func (o *DKSharesInfo) HasThreshold() bool { - if o != nil && !isNil(o.Threshold) { - return true - } - - return false -} - -// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. -func (o *DKSharesInfo) SetThreshold(v int32) { - o.Threshold = &v -} - -func (o DKSharesInfo) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Address) { - toSerialize["address"] = o.Address - } - if !isNil(o.PeerIdentities) { - toSerialize["peerIdentities"] = o.PeerIdentities - } - if !isNil(o.PeerIndex) { - toSerialize["peerIndex"] = o.PeerIndex - } - if !isNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey - } - if !isNil(o.PublicKeyShares) { - toSerialize["publicKeyShares"] = o.PublicKeyShares - } - if !isNil(o.Threshold) { - toSerialize["threshold"] = o.Threshold - } - return json.Marshal(toSerialize) -} - -type NullableDKSharesInfo struct { - value *DKSharesInfo - isSet bool -} - -func (v NullableDKSharesInfo) Get() *DKSharesInfo { - return v.value -} - -func (v *NullableDKSharesInfo) Set(val *DKSharesInfo) { - v.value = val - v.isSet = true -} - -func (v NullableDKSharesInfo) IsSet() bool { - return v.isSet -} - -func (v *NullableDKSharesInfo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDKSharesInfo(val *DKSharesInfo) *NullableDKSharesInfo { - return &NullableDKSharesInfo{value: val, isSet: true} -} - -func (v NullableDKSharesInfo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDKSharesInfo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_gov_chain_info_response.go b/client/model_gov_chain_info_response.go deleted file mode 100644 index 8db80617f3..0000000000 --- a/client/model_gov_chain_info_response.go +++ /dev/null @@ -1,337 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// GovChainInfoResponse struct for GovChainInfoResponse -type GovChainInfoResponse struct { - // ChainID (Bech32-encoded). - ChainID *string `json:"chainID,omitempty"` - // The chain owner address (Bech32-encoded). - ChainOwnerId *string `json:"chainOwnerId,omitempty"` - // The description of the chain. - Description *string `json:"description,omitempty"` - GasFeePolicy *GasFeePolicy `json:"gasFeePolicy,omitempty"` - // The maximum contract blob size. - MaxBlobSize *int32 `json:"maxBlobSize,omitempty"` - // The maximum event size. - MaxEventSize *int32 `json:"maxEventSize,omitempty"` - // The maximum amount of events per request. - MaxEventsPerReq *int32 `json:"maxEventsPerReq,omitempty"` -} - -// NewGovChainInfoResponse instantiates a new GovChainInfoResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGovChainInfoResponse() *GovChainInfoResponse { - this := GovChainInfoResponse{} - return &this -} - -// NewGovChainInfoResponseWithDefaults instantiates a new GovChainInfoResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGovChainInfoResponseWithDefaults() *GovChainInfoResponse { - this := GovChainInfoResponse{} - return &this -} - -// GetChainID returns the ChainID field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetChainID() string { - if o == nil || isNil(o.ChainID) { - var ret string - return ret - } - return *o.ChainID -} - -// GetChainIDOk returns a tuple with the ChainID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetChainIDOk() (*string, bool) { - if o == nil || isNil(o.ChainID) { - return nil, false - } - return o.ChainID, true -} - -// HasChainID returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasChainID() bool { - if o != nil && !isNil(o.ChainID) { - return true - } - - return false -} - -// SetChainID gets a reference to the given string and assigns it to the ChainID field. -func (o *GovChainInfoResponse) SetChainID(v string) { - o.ChainID = &v -} - -// GetChainOwnerId returns the ChainOwnerId field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetChainOwnerId() string { - if o == nil || isNil(o.ChainOwnerId) { - var ret string - return ret - } - return *o.ChainOwnerId -} - -// GetChainOwnerIdOk returns a tuple with the ChainOwnerId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetChainOwnerIdOk() (*string, bool) { - if o == nil || isNil(o.ChainOwnerId) { - return nil, false - } - return o.ChainOwnerId, true -} - -// HasChainOwnerId returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasChainOwnerId() bool { - if o != nil && !isNil(o.ChainOwnerId) { - return true - } - - return false -} - -// SetChainOwnerId gets a reference to the given string and assigns it to the ChainOwnerId field. -func (o *GovChainInfoResponse) SetChainOwnerId(v string) { - o.ChainOwnerId = &v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetDescription() string { - if o == nil || isNil(o.Description) { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetDescriptionOk() (*string, bool) { - if o == nil || isNil(o.Description) { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasDescription() bool { - if o != nil && !isNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *GovChainInfoResponse) SetDescription(v string) { - o.Description = &v -} - -// GetGasFeePolicy returns the GasFeePolicy field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetGasFeePolicy() GasFeePolicy { - if o == nil || isNil(o.GasFeePolicy) { - var ret GasFeePolicy - return ret - } - return *o.GasFeePolicy -} - -// GetGasFeePolicyOk returns a tuple with the GasFeePolicy field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool) { - if o == nil || isNil(o.GasFeePolicy) { - return nil, false - } - return o.GasFeePolicy, true -} - -// HasGasFeePolicy returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasGasFeePolicy() bool { - if o != nil && !isNil(o.GasFeePolicy) { - return true - } - - return false -} - -// SetGasFeePolicy gets a reference to the given GasFeePolicy and assigns it to the GasFeePolicy field. -func (o *GovChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { - o.GasFeePolicy = &v -} - -// GetMaxBlobSize returns the MaxBlobSize field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetMaxBlobSize() int32 { - if o == nil || isNil(o.MaxBlobSize) { - var ret int32 - return ret - } - return *o.MaxBlobSize -} - -// GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { - if o == nil || isNil(o.MaxBlobSize) { - return nil, false - } - return o.MaxBlobSize, true -} - -// HasMaxBlobSize returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasMaxBlobSize() bool { - if o != nil && !isNil(o.MaxBlobSize) { - return true - } - - return false -} - -// SetMaxBlobSize gets a reference to the given int32 and assigns it to the MaxBlobSize field. -func (o *GovChainInfoResponse) SetMaxBlobSize(v int32) { - o.MaxBlobSize = &v -} - -// GetMaxEventSize returns the MaxEventSize field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetMaxEventSize() int32 { - if o == nil || isNil(o.MaxEventSize) { - var ret int32 - return ret - } - return *o.MaxEventSize -} - -// GetMaxEventSizeOk returns a tuple with the MaxEventSize field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { - if o == nil || isNil(o.MaxEventSize) { - return nil, false - } - return o.MaxEventSize, true -} - -// HasMaxEventSize returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasMaxEventSize() bool { - if o != nil && !isNil(o.MaxEventSize) { - return true - } - - return false -} - -// SetMaxEventSize gets a reference to the given int32 and assigns it to the MaxEventSize field. -func (o *GovChainInfoResponse) SetMaxEventSize(v int32) { - o.MaxEventSize = &v -} - -// GetMaxEventsPerReq returns the MaxEventsPerReq field value if set, zero value otherwise. -func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32 { - if o == nil || isNil(o.MaxEventsPerReq) { - var ret int32 - return ret - } - return *o.MaxEventsPerReq -} - -// GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { - if o == nil || isNil(o.MaxEventsPerReq) { - return nil, false - } - return o.MaxEventsPerReq, true -} - -// HasMaxEventsPerReq returns a boolean if a field has been set. -func (o *GovChainInfoResponse) HasMaxEventsPerReq() bool { - if o != nil && !isNil(o.MaxEventsPerReq) { - return true - } - - return false -} - -// SetMaxEventsPerReq gets a reference to the given int32 and assigns it to the MaxEventsPerReq field. -func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32) { - o.MaxEventsPerReq = &v -} - -func (o GovChainInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.ChainID) { - toSerialize["chainID"] = o.ChainID - } - if !isNil(o.ChainOwnerId) { - toSerialize["chainOwnerId"] = o.ChainOwnerId - } - if !isNil(o.Description) { - toSerialize["description"] = o.Description - } - if !isNil(o.GasFeePolicy) { - toSerialize["gasFeePolicy"] = o.GasFeePolicy - } - if !isNil(o.MaxBlobSize) { - toSerialize["maxBlobSize"] = o.MaxBlobSize - } - if !isNil(o.MaxEventSize) { - toSerialize["maxEventSize"] = o.MaxEventSize - } - if !isNil(o.MaxEventsPerReq) { - toSerialize["maxEventsPerReq"] = o.MaxEventsPerReq - } - return json.Marshal(toSerialize) -} - -type NullableGovChainInfoResponse struct { - value *GovChainInfoResponse - isSet bool -} - -func (v NullableGovChainInfoResponse) Get() *GovChainInfoResponse { - return v.value -} - -func (v *NullableGovChainInfoResponse) Set(val *GovChainInfoResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGovChainInfoResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGovChainInfoResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGovChainInfoResponse(val *GovChainInfoResponse) *NullableGovChainInfoResponse { - return &NullableGovChainInfoResponse{value: val, isSet: true} -} - -func (v NullableGovChainInfoResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGovChainInfoResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_protocol_parameters.go b/client/model_protocol_parameters.go deleted file mode 100644 index 58611d0e76..0000000000 --- a/client/model_protocol_parameters.go +++ /dev/null @@ -1,337 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ProtocolParameters struct for ProtocolParameters -type ProtocolParameters struct { - // The human readable network prefix - Bech32Hrp *string `json:"bech32Hrp,omitempty"` - // The networks max depth - BelowMaxDepth *int32 `json:"belowMaxDepth,omitempty"` - // The minimal PoW score - MinPowScore *int32 `json:"minPowScore,omitempty"` - // The network name - NetworkName *string `json:"networkName,omitempty"` - RentStructure *RentStructure `json:"rentStructure,omitempty"` - // The token supply - TokenSupply *string `json:"tokenSupply,omitempty"` - // The protocol version - Version *int32 `json:"version,omitempty"` -} - -// NewProtocolParameters instantiates a new ProtocolParameters object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewProtocolParameters() *ProtocolParameters { - this := ProtocolParameters{} - return &this -} - -// NewProtocolParametersWithDefaults instantiates a new ProtocolParameters object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewProtocolParametersWithDefaults() *ProtocolParameters { - this := ProtocolParameters{} - return &this -} - -// GetBech32Hrp returns the Bech32Hrp field value if set, zero value otherwise. -func (o *ProtocolParameters) GetBech32Hrp() string { - if o == nil || isNil(o.Bech32Hrp) { - var ret string - return ret - } - return *o.Bech32Hrp -} - -// GetBech32HrpOk returns a tuple with the Bech32Hrp field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetBech32HrpOk() (*string, bool) { - if o == nil || isNil(o.Bech32Hrp) { - return nil, false - } - return o.Bech32Hrp, true -} - -// HasBech32Hrp returns a boolean if a field has been set. -func (o *ProtocolParameters) HasBech32Hrp() bool { - if o != nil && !isNil(o.Bech32Hrp) { - return true - } - - return false -} - -// SetBech32Hrp gets a reference to the given string and assigns it to the Bech32Hrp field. -func (o *ProtocolParameters) SetBech32Hrp(v string) { - o.Bech32Hrp = &v -} - -// GetBelowMaxDepth returns the BelowMaxDepth field value if set, zero value otherwise. -func (o *ProtocolParameters) GetBelowMaxDepth() int32 { - if o == nil || isNil(o.BelowMaxDepth) { - var ret int32 - return ret - } - return *o.BelowMaxDepth -} - -// GetBelowMaxDepthOk returns a tuple with the BelowMaxDepth field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetBelowMaxDepthOk() (*int32, bool) { - if o == nil || isNil(o.BelowMaxDepth) { - return nil, false - } - return o.BelowMaxDepth, true -} - -// HasBelowMaxDepth returns a boolean if a field has been set. -func (o *ProtocolParameters) HasBelowMaxDepth() bool { - if o != nil && !isNil(o.BelowMaxDepth) { - return true - } - - return false -} - -// SetBelowMaxDepth gets a reference to the given int32 and assigns it to the BelowMaxDepth field. -func (o *ProtocolParameters) SetBelowMaxDepth(v int32) { - o.BelowMaxDepth = &v -} - -// GetMinPowScore returns the MinPowScore field value if set, zero value otherwise. -func (o *ProtocolParameters) GetMinPowScore() int32 { - if o == nil || isNil(o.MinPowScore) { - var ret int32 - return ret - } - return *o.MinPowScore -} - -// GetMinPowScoreOk returns a tuple with the MinPowScore field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetMinPowScoreOk() (*int32, bool) { - if o == nil || isNil(o.MinPowScore) { - return nil, false - } - return o.MinPowScore, true -} - -// HasMinPowScore returns a boolean if a field has been set. -func (o *ProtocolParameters) HasMinPowScore() bool { - if o != nil && !isNil(o.MinPowScore) { - return true - } - - return false -} - -// SetMinPowScore gets a reference to the given int32 and assigns it to the MinPowScore field. -func (o *ProtocolParameters) SetMinPowScore(v int32) { - o.MinPowScore = &v -} - -// GetNetworkName returns the NetworkName field value if set, zero value otherwise. -func (o *ProtocolParameters) GetNetworkName() string { - if o == nil || isNil(o.NetworkName) { - var ret string - return ret - } - return *o.NetworkName -} - -// GetNetworkNameOk returns a tuple with the NetworkName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetNetworkNameOk() (*string, bool) { - if o == nil || isNil(o.NetworkName) { - return nil, false - } - return o.NetworkName, true -} - -// HasNetworkName returns a boolean if a field has been set. -func (o *ProtocolParameters) HasNetworkName() bool { - if o != nil && !isNil(o.NetworkName) { - return true - } - - return false -} - -// SetNetworkName gets a reference to the given string and assigns it to the NetworkName field. -func (o *ProtocolParameters) SetNetworkName(v string) { - o.NetworkName = &v -} - -// GetRentStructure returns the RentStructure field value if set, zero value otherwise. -func (o *ProtocolParameters) GetRentStructure() RentStructure { - if o == nil || isNil(o.RentStructure) { - var ret RentStructure - return ret - } - return *o.RentStructure -} - -// GetRentStructureOk returns a tuple with the RentStructure field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetRentStructureOk() (*RentStructure, bool) { - if o == nil || isNil(o.RentStructure) { - return nil, false - } - return o.RentStructure, true -} - -// HasRentStructure returns a boolean if a field has been set. -func (o *ProtocolParameters) HasRentStructure() bool { - if o != nil && !isNil(o.RentStructure) { - return true - } - - return false -} - -// SetRentStructure gets a reference to the given RentStructure and assigns it to the RentStructure field. -func (o *ProtocolParameters) SetRentStructure(v RentStructure) { - o.RentStructure = &v -} - -// GetTokenSupply returns the TokenSupply field value if set, zero value otherwise. -func (o *ProtocolParameters) GetTokenSupply() string { - if o == nil || isNil(o.TokenSupply) { - var ret string - return ret - } - return *o.TokenSupply -} - -// GetTokenSupplyOk returns a tuple with the TokenSupply field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetTokenSupplyOk() (*string, bool) { - if o == nil || isNil(o.TokenSupply) { - return nil, false - } - return o.TokenSupply, true -} - -// HasTokenSupply returns a boolean if a field has been set. -func (o *ProtocolParameters) HasTokenSupply() bool { - if o != nil && !isNil(o.TokenSupply) { - return true - } - - return false -} - -// SetTokenSupply gets a reference to the given string and assigns it to the TokenSupply field. -func (o *ProtocolParameters) SetTokenSupply(v string) { - o.TokenSupply = &v -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *ProtocolParameters) GetVersion() int32 { - if o == nil || isNil(o.Version) { - var ret int32 - return ret - } - return *o.Version -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetVersionOk() (*int32, bool) { - if o == nil || isNil(o.Version) { - return nil, false - } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *ProtocolParameters) HasVersion() bool { - if o != nil && !isNil(o.Version) { - return true - } - - return false -} - -// SetVersion gets a reference to the given int32 and assigns it to the Version field. -func (o *ProtocolParameters) SetVersion(v int32) { - o.Version = &v -} - -func (o ProtocolParameters) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Bech32Hrp) { - toSerialize["bech32Hrp"] = o.Bech32Hrp - } - if !isNil(o.BelowMaxDepth) { - toSerialize["belowMaxDepth"] = o.BelowMaxDepth - } - if !isNil(o.MinPowScore) { - toSerialize["minPowScore"] = o.MinPowScore - } - if !isNil(o.NetworkName) { - toSerialize["networkName"] = o.NetworkName - } - if !isNil(o.RentStructure) { - toSerialize["rentStructure"] = o.RentStructure - } - if !isNil(o.TokenSupply) { - toSerialize["tokenSupply"] = o.TokenSupply - } - if !isNil(o.Version) { - toSerialize["version"] = o.Version - } - return json.Marshal(toSerialize) -} - -type NullableProtocolParameters struct { - value *ProtocolParameters - isSet bool -} - -func (v NullableProtocolParameters) Get() *ProtocolParameters { - return v.value -} - -func (v *NullableProtocolParameters) Set(val *ProtocolParameters) { - v.value = val - v.isSet = true -} - -func (v NullableProtocolParameters) IsSet() bool { - return v.isSet -} - -func (v *NullableProtocolParameters) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableProtocolParameters(val *ProtocolParameters) *NullableProtocolParameters { - return &NullableProtocolParameters{value: val, isSet: true} -} - -func (v NullableProtocolParameters) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableProtocolParameters) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_receipt_error.go b/client/model_receipt_error.go deleted file mode 100644 index 097005693a..0000000000 --- a/client/model_receipt_error.go +++ /dev/null @@ -1,295 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ReceiptError struct for ReceiptError -type ReceiptError struct { - ContractId *int32 `json:"contractId,omitempty"` - ErrorCode *string `json:"errorCode,omitempty"` - ErrorId *int32 `json:"errorId,omitempty"` - Message *string `json:"message,omitempty"` - MessageFormat *string `json:"messageFormat,omitempty"` - Parameters []string `json:"parameters,omitempty"` -} - -// NewReceiptError instantiates a new ReceiptError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewReceiptError() *ReceiptError { - this := ReceiptError{} - return &this -} - -// NewReceiptErrorWithDefaults instantiates a new ReceiptError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewReceiptErrorWithDefaults() *ReceiptError { - this := ReceiptError{} - return &this -} - -// GetContractId returns the ContractId field value if set, zero value otherwise. -func (o *ReceiptError) GetContractId() int32 { - if o == nil || isNil(o.ContractId) { - var ret int32 - return ret - } - return *o.ContractId -} - -// GetContractIdOk returns a tuple with the ContractId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptError) GetContractIdOk() (*int32, bool) { - if o == nil || isNil(o.ContractId) { - return nil, false - } - return o.ContractId, true -} - -// HasContractId returns a boolean if a field has been set. -func (o *ReceiptError) HasContractId() bool { - if o != nil && !isNil(o.ContractId) { - return true - } - - return false -} - -// SetContractId gets a reference to the given int32 and assigns it to the ContractId field. -func (o *ReceiptError) SetContractId(v int32) { - o.ContractId = &v -} - -// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. -func (o *ReceiptError) GetErrorCode() string { - if o == nil || isNil(o.ErrorCode) { - var ret string - return ret - } - return *o.ErrorCode -} - -// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptError) GetErrorCodeOk() (*string, bool) { - if o == nil || isNil(o.ErrorCode) { - return nil, false - } - return o.ErrorCode, true -} - -// HasErrorCode returns a boolean if a field has been set. -func (o *ReceiptError) HasErrorCode() bool { - if o != nil && !isNil(o.ErrorCode) { - return true - } - - return false -} - -// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. -func (o *ReceiptError) SetErrorCode(v string) { - o.ErrorCode = &v -} - -// GetErrorId returns the ErrorId field value if set, zero value otherwise. -func (o *ReceiptError) GetErrorId() int32 { - if o == nil || isNil(o.ErrorId) { - var ret int32 - return ret - } - return *o.ErrorId -} - -// GetErrorIdOk returns a tuple with the ErrorId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptError) GetErrorIdOk() (*int32, bool) { - if o == nil || isNil(o.ErrorId) { - return nil, false - } - return o.ErrorId, true -} - -// HasErrorId returns a boolean if a field has been set. -func (o *ReceiptError) HasErrorId() bool { - if o != nil && !isNil(o.ErrorId) { - return true - } - - return false -} - -// SetErrorId gets a reference to the given int32 and assigns it to the ErrorId field. -func (o *ReceiptError) SetErrorId(v int32) { - o.ErrorId = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ReceiptError) GetMessage() string { - if o == nil || isNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptError) GetMessageOk() (*string, bool) { - if o == nil || isNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ReceiptError) HasMessage() bool { - if o != nil && !isNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ReceiptError) SetMessage(v string) { - o.Message = &v -} - -// GetMessageFormat returns the MessageFormat field value if set, zero value otherwise. -func (o *ReceiptError) GetMessageFormat() string { - if o == nil || isNil(o.MessageFormat) { - var ret string - return ret - } - return *o.MessageFormat -} - -// GetMessageFormatOk returns a tuple with the MessageFormat field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptError) GetMessageFormatOk() (*string, bool) { - if o == nil || isNil(o.MessageFormat) { - return nil, false - } - return o.MessageFormat, true -} - -// HasMessageFormat returns a boolean if a field has been set. -func (o *ReceiptError) HasMessageFormat() bool { - if o != nil && !isNil(o.MessageFormat) { - return true - } - - return false -} - -// SetMessageFormat gets a reference to the given string and assigns it to the MessageFormat field. -func (o *ReceiptError) SetMessageFormat(v string) { - o.MessageFormat = &v -} - -// GetParameters returns the Parameters field value if set, zero value otherwise. -func (o *ReceiptError) GetParameters() []string { - if o == nil || isNil(o.Parameters) { - var ret []string - return ret - } - return o.Parameters -} - -// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptError) GetParametersOk() ([]string, bool) { - if o == nil || isNil(o.Parameters) { - return nil, false - } - return o.Parameters, true -} - -// HasParameters returns a boolean if a field has been set. -func (o *ReceiptError) HasParameters() bool { - if o != nil && !isNil(o.Parameters) { - return true - } - - return false -} - -// SetParameters gets a reference to the given []string and assigns it to the Parameters field. -func (o *ReceiptError) SetParameters(v []string) { - o.Parameters = v -} - -func (o ReceiptError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.ContractId) { - toSerialize["contractId"] = o.ContractId - } - if !isNil(o.ErrorCode) { - toSerialize["errorCode"] = o.ErrorCode - } - if !isNil(o.ErrorId) { - toSerialize["errorId"] = o.ErrorId - } - if !isNil(o.Message) { - toSerialize["message"] = o.Message - } - if !isNil(o.MessageFormat) { - toSerialize["messageFormat"] = o.MessageFormat - } - if !isNil(o.Parameters) { - toSerialize["parameters"] = o.Parameters - } - return json.Marshal(toSerialize) -} - -type NullableReceiptError struct { - value *ReceiptError - isSet bool -} - -func (v NullableReceiptError) Get() *ReceiptError { - return v.value -} - -func (v *NullableReceiptError) Set(val *ReceiptError) { - v.value = val - v.isSet = true -} - -func (v NullableReceiptError) IsSet() bool { - return v.isSet -} - -func (v *NullableReceiptError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableReceiptError(val *ReceiptError) *NullableReceiptError { - return &NullableReceiptError{value: val, isSet: true} -} - -func (v NullableReceiptError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableReceiptError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_receipt_response.go b/client/model_receipt_response.go deleted file mode 100644 index dbe61b3ec6..0000000000 --- a/client/model_receipt_response.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ReceiptResponse struct for ReceiptResponse -type ReceiptResponse struct { - BlockIndex *int32 `json:"blockIndex,omitempty"` - Error *ReceiptError `json:"error,omitempty"` - GasBudget *int64 `json:"gasBudget,omitempty"` - GasBurnLog []BurnRecord `json:"gasBurnLog,omitempty"` - GasBurned *int64 `json:"gasBurned,omitempty"` - GasFeeCharged *int64 `json:"gasFeeCharged,omitempty"` - Request *string `json:"request,omitempty"` - RequestIndex *int32 `json:"requestIndex,omitempty"` -} - -// NewReceiptResponse instantiates a new ReceiptResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewReceiptResponse() *ReceiptResponse { - this := ReceiptResponse{} - return &this -} - -// NewReceiptResponseWithDefaults instantiates a new ReceiptResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewReceiptResponseWithDefaults() *ReceiptResponse { - this := ReceiptResponse{} - return &this -} - -// GetBlockIndex returns the BlockIndex field value if set, zero value otherwise. -func (o *ReceiptResponse) GetBlockIndex() int32 { - if o == nil || isNil(o.BlockIndex) { - var ret int32 - return ret - } - return *o.BlockIndex -} - -// GetBlockIndexOk returns a tuple with the BlockIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetBlockIndexOk() (*int32, bool) { - if o == nil || isNil(o.BlockIndex) { - return nil, false - } - return o.BlockIndex, true -} - -// HasBlockIndex returns a boolean if a field has been set. -func (o *ReceiptResponse) HasBlockIndex() bool { - if o != nil && !isNil(o.BlockIndex) { - return true - } - - return false -} - -// SetBlockIndex gets a reference to the given int32 and assigns it to the BlockIndex field. -func (o *ReceiptResponse) SetBlockIndex(v int32) { - o.BlockIndex = &v -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *ReceiptResponse) GetError() ReceiptError { - if o == nil || isNil(o.Error) { - var ret ReceiptError - return ret - } - return *o.Error -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetErrorOk() (*ReceiptError, bool) { - if o == nil || isNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *ReceiptResponse) HasError() bool { - if o != nil && !isNil(o.Error) { - return true - } - - return false -} - -// SetError gets a reference to the given ReceiptError and assigns it to the Error field. -func (o *ReceiptResponse) SetError(v ReceiptError) { - o.Error = &v -} - -// GetGasBudget returns the GasBudget field value if set, zero value otherwise. -func (o *ReceiptResponse) GetGasBudget() int64 { - if o == nil || isNil(o.GasBudget) { - var ret int64 - return ret - } - return *o.GasBudget -} - -// GetGasBudgetOk returns a tuple with the GasBudget field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool) { - if o == nil || isNil(o.GasBudget) { - return nil, false - } - return o.GasBudget, true -} - -// HasGasBudget returns a boolean if a field has been set. -func (o *ReceiptResponse) HasGasBudget() bool { - if o != nil && !isNil(o.GasBudget) { - return true - } - - return false -} - -// SetGasBudget gets a reference to the given int64 and assigns it to the GasBudget field. -func (o *ReceiptResponse) SetGasBudget(v int64) { - o.GasBudget = &v -} - -// GetGasBurnLog returns the GasBurnLog field value if set, zero value otherwise. -func (o *ReceiptResponse) GetGasBurnLog() []BurnRecord { - if o == nil || isNil(o.GasBurnLog) { - var ret []BurnRecord - return ret - } - return o.GasBurnLog -} - -// GetGasBurnLogOk returns a tuple with the GasBurnLog field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasBurnLogOk() ([]BurnRecord, bool) { - if o == nil || isNil(o.GasBurnLog) { - return nil, false - } - return o.GasBurnLog, true -} - -// HasGasBurnLog returns a boolean if a field has been set. -func (o *ReceiptResponse) HasGasBurnLog() bool { - if o != nil && !isNil(o.GasBurnLog) { - return true - } - - return false -} - -// SetGasBurnLog gets a reference to the given []BurnRecord and assigns it to the GasBurnLog field. -func (o *ReceiptResponse) SetGasBurnLog(v []BurnRecord) { - o.GasBurnLog = v -} - -// GetGasBurned returns the GasBurned field value if set, zero value otherwise. -func (o *ReceiptResponse) GetGasBurned() int64 { - if o == nil || isNil(o.GasBurned) { - var ret int64 - return ret - } - return *o.GasBurned -} - -// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool) { - if o == nil || isNil(o.GasBurned) { - return nil, false - } - return o.GasBurned, true -} - -// HasGasBurned returns a boolean if a field has been set. -func (o *ReceiptResponse) HasGasBurned() bool { - if o != nil && !isNil(o.GasBurned) { - return true - } - - return false -} - -// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. -func (o *ReceiptResponse) SetGasBurned(v int64) { - o.GasBurned = &v -} - -// GetGasFeeCharged returns the GasFeeCharged field value if set, zero value otherwise. -func (o *ReceiptResponse) GetGasFeeCharged() int64 { - if o == nil || isNil(o.GasFeeCharged) { - var ret int64 - return ret - } - return *o.GasFeeCharged -} - -// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { - if o == nil || isNil(o.GasFeeCharged) { - return nil, false - } - return o.GasFeeCharged, true -} - -// HasGasFeeCharged returns a boolean if a field has been set. -func (o *ReceiptResponse) HasGasFeeCharged() bool { - if o != nil && !isNil(o.GasFeeCharged) { - return true - } - - return false -} - -// SetGasFeeCharged gets a reference to the given int64 and assigns it to the GasFeeCharged field. -func (o *ReceiptResponse) SetGasFeeCharged(v int64) { - o.GasFeeCharged = &v -} - -// GetRequest returns the Request field value if set, zero value otherwise. -func (o *ReceiptResponse) GetRequest() string { - if o == nil || isNil(o.Request) { - var ret string - return ret - } - return *o.Request -} - -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetRequestOk() (*string, bool) { - if o == nil || isNil(o.Request) { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *ReceiptResponse) HasRequest() bool { - if o != nil && !isNil(o.Request) { - return true - } - - return false -} - -// SetRequest gets a reference to the given string and assigns it to the Request field. -func (o *ReceiptResponse) SetRequest(v string) { - o.Request = &v -} - -// GetRequestIndex returns the RequestIndex field value if set, zero value otherwise. -func (o *ReceiptResponse) GetRequestIndex() int32 { - if o == nil || isNil(o.RequestIndex) { - var ret int32 - return ret - } - return *o.RequestIndex -} - -// GetRequestIndexOk returns a tuple with the RequestIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetRequestIndexOk() (*int32, bool) { - if o == nil || isNil(o.RequestIndex) { - return nil, false - } - return o.RequestIndex, true -} - -// HasRequestIndex returns a boolean if a field has been set. -func (o *ReceiptResponse) HasRequestIndex() bool { - if o != nil && !isNil(o.RequestIndex) { - return true - } - - return false -} - -// SetRequestIndex gets a reference to the given int32 and assigns it to the RequestIndex field. -func (o *ReceiptResponse) SetRequestIndex(v int32) { - o.RequestIndex = &v -} - -func (o ReceiptResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.BlockIndex) { - toSerialize["blockIndex"] = o.BlockIndex - } - if !isNil(o.Error) { - toSerialize["error"] = o.Error - } - if !isNil(o.GasBudget) { - toSerialize["gasBudget"] = o.GasBudget - } - if !isNil(o.GasBurnLog) { - toSerialize["gasBurnLog"] = o.GasBurnLog - } - if !isNil(o.GasBurned) { - toSerialize["gasBurned"] = o.GasBurned - } - if !isNil(o.GasFeeCharged) { - toSerialize["gasFeeCharged"] = o.GasFeeCharged - } - if !isNil(o.Request) { - toSerialize["request"] = o.Request - } - if !isNil(o.RequestIndex) { - toSerialize["requestIndex"] = o.RequestIndex - } - return json.Marshal(toSerialize) -} - -type NullableReceiptResponse struct { - value *ReceiptResponse - isSet bool -} - -func (v NullableReceiptResponse) Get() *ReceiptResponse { - return v.value -} - -func (v *NullableReceiptResponse) Set(val *ReceiptResponse) { - v.value = val - v.isSet = true -} - -func (v NullableReceiptResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableReceiptResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableReceiptResponse(val *ReceiptResponse) *NullableReceiptResponse { - return &NullableReceiptResponse{value: val, isSet: true} -} - -func (v NullableReceiptResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableReceiptResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_request_detail.go b/client/model_request_detail.go deleted file mode 100644 index c0827f8ce4..0000000000 --- a/client/model_request_detail.go +++ /dev/null @@ -1,475 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// RequestDetail struct for RequestDetail -type RequestDetail struct { - Allowance *Allowance `json:"allowance,omitempty"` - CallTarget *CallTarget `json:"callTarget,omitempty"` - FungibleTokens *FungibleTokens `json:"fungibleTokens,omitempty"` - GasGudget *int64 `json:"gasGudget,omitempty"` - IsEVM *bool `json:"isEVM,omitempty"` - IsOffLedger *bool `json:"isOffLedger,omitempty"` - Nft *NFTDataResponse `json:"nft,omitempty"` - Params *JSONDict `json:"params,omitempty"` - RequestId *string `json:"requestId,omitempty"` - SenderAccount *string `json:"senderAccount,omitempty"` - TargetAddress *string `json:"targetAddress,omitempty"` -} - -// NewRequestDetail instantiates a new RequestDetail object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestDetail() *RequestDetail { - this := RequestDetail{} - return &this -} - -// NewRequestDetailWithDefaults instantiates a new RequestDetail object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestDetailWithDefaults() *RequestDetail { - this := RequestDetail{} - return &this -} - -// GetAllowance returns the Allowance field value if set, zero value otherwise. -func (o *RequestDetail) GetAllowance() Allowance { - if o == nil || isNil(o.Allowance) { - var ret Allowance - return ret - } - return *o.Allowance -} - -// GetAllowanceOk returns a tuple with the Allowance field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool) { - if o == nil || isNil(o.Allowance) { - return nil, false - } - return o.Allowance, true -} - -// HasAllowance returns a boolean if a field has been set. -func (o *RequestDetail) HasAllowance() bool { - if o != nil && !isNil(o.Allowance) { - return true - } - - return false -} - -// SetAllowance gets a reference to the given Allowance and assigns it to the Allowance field. -func (o *RequestDetail) SetAllowance(v Allowance) { - o.Allowance = &v -} - -// GetCallTarget returns the CallTarget field value if set, zero value otherwise. -func (o *RequestDetail) GetCallTarget() CallTarget { - if o == nil || isNil(o.CallTarget) { - var ret CallTarget - return ret - } - return *o.CallTarget -} - -// GetCallTargetOk returns a tuple with the CallTarget field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetCallTargetOk() (*CallTarget, bool) { - if o == nil || isNil(o.CallTarget) { - return nil, false - } - return o.CallTarget, true -} - -// HasCallTarget returns a boolean if a field has been set. -func (o *RequestDetail) HasCallTarget() bool { - if o != nil && !isNil(o.CallTarget) { - return true - } - - return false -} - -// SetCallTarget gets a reference to the given CallTarget and assigns it to the CallTarget field. -func (o *RequestDetail) SetCallTarget(v CallTarget) { - o.CallTarget = &v -} - -// GetFungibleTokens returns the FungibleTokens field value if set, zero value otherwise. -func (o *RequestDetail) GetFungibleTokens() FungibleTokens { - if o == nil || isNil(o.FungibleTokens) { - var ret FungibleTokens - return ret - } - return *o.FungibleTokens -} - -// GetFungibleTokensOk returns a tuple with the FungibleTokens field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool) { - if o == nil || isNil(o.FungibleTokens) { - return nil, false - } - return o.FungibleTokens, true -} - -// HasFungibleTokens returns a boolean if a field has been set. -func (o *RequestDetail) HasFungibleTokens() bool { - if o != nil && !isNil(o.FungibleTokens) { - return true - } - - return false -} - -// SetFungibleTokens gets a reference to the given FungibleTokens and assigns it to the FungibleTokens field. -func (o *RequestDetail) SetFungibleTokens(v FungibleTokens) { - o.FungibleTokens = &v -} - -// GetGasGudget returns the GasGudget field value if set, zero value otherwise. -func (o *RequestDetail) GetGasGudget() int64 { - if o == nil || isNil(o.GasGudget) { - var ret int64 - return ret - } - return *o.GasGudget -} - -// GetGasGudgetOk returns a tuple with the GasGudget field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetGasGudgetOk() (*int64, bool) { - if o == nil || isNil(o.GasGudget) { - return nil, false - } - return o.GasGudget, true -} - -// HasGasGudget returns a boolean if a field has been set. -func (o *RequestDetail) HasGasGudget() bool { - if o != nil && !isNil(o.GasGudget) { - return true - } - - return false -} - -// SetGasGudget gets a reference to the given int64 and assigns it to the GasGudget field. -func (o *RequestDetail) SetGasGudget(v int64) { - o.GasGudget = &v -} - -// GetIsEVM returns the IsEVM field value if set, zero value otherwise. -func (o *RequestDetail) GetIsEVM() bool { - if o == nil || isNil(o.IsEVM) { - var ret bool - return ret - } - return *o.IsEVM -} - -// GetIsEVMOk returns a tuple with the IsEVM field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetIsEVMOk() (*bool, bool) { - if o == nil || isNil(o.IsEVM) { - return nil, false - } - return o.IsEVM, true -} - -// HasIsEVM returns a boolean if a field has been set. -func (o *RequestDetail) HasIsEVM() bool { - if o != nil && !isNil(o.IsEVM) { - return true - } - - return false -} - -// SetIsEVM gets a reference to the given bool and assigns it to the IsEVM field. -func (o *RequestDetail) SetIsEVM(v bool) { - o.IsEVM = &v -} - -// GetIsOffLedger returns the IsOffLedger field value if set, zero value otherwise. -func (o *RequestDetail) GetIsOffLedger() bool { - if o == nil || isNil(o.IsOffLedger) { - var ret bool - return ret - } - return *o.IsOffLedger -} - -// GetIsOffLedgerOk returns a tuple with the IsOffLedger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetIsOffLedgerOk() (*bool, bool) { - if o == nil || isNil(o.IsOffLedger) { - return nil, false - } - return o.IsOffLedger, true -} - -// HasIsOffLedger returns a boolean if a field has been set. -func (o *RequestDetail) HasIsOffLedger() bool { - if o != nil && !isNil(o.IsOffLedger) { - return true - } - - return false -} - -// SetIsOffLedger gets a reference to the given bool and assigns it to the IsOffLedger field. -func (o *RequestDetail) SetIsOffLedger(v bool) { - o.IsOffLedger = &v -} - -// GetNft returns the Nft field value if set, zero value otherwise. -func (o *RequestDetail) GetNft() NFTDataResponse { - if o == nil || isNil(o.Nft) { - var ret NFTDataResponse - return ret - } - return *o.Nft -} - -// GetNftOk returns a tuple with the Nft field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetNftOk() (*NFTDataResponse, bool) { - if o == nil || isNil(o.Nft) { - return nil, false - } - return o.Nft, true -} - -// HasNft returns a boolean if a field has been set. -func (o *RequestDetail) HasNft() bool { - if o != nil && !isNil(o.Nft) { - return true - } - - return false -} - -// SetNft gets a reference to the given NFTDataResponse and assigns it to the Nft field. -func (o *RequestDetail) SetNft(v NFTDataResponse) { - o.Nft = &v -} - -// GetParams returns the Params field value if set, zero value otherwise. -func (o *RequestDetail) GetParams() JSONDict { - if o == nil || isNil(o.Params) { - var ret JSONDict - return ret - } - return *o.Params -} - -// GetParamsOk returns a tuple with the Params field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetParamsOk() (*JSONDict, bool) { - if o == nil || isNil(o.Params) { - return nil, false - } - return o.Params, true -} - -// HasParams returns a boolean if a field has been set. -func (o *RequestDetail) HasParams() bool { - if o != nil && !isNil(o.Params) { - return true - } - - return false -} - -// SetParams gets a reference to the given JSONDict and assigns it to the Params field. -func (o *RequestDetail) SetParams(v JSONDict) { - o.Params = &v -} - -// GetRequestId returns the RequestId field value if set, zero value otherwise. -func (o *RequestDetail) GetRequestId() string { - if o == nil || isNil(o.RequestId) { - var ret string - return ret - } - return *o.RequestId -} - -// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetRequestIdOk() (*string, bool) { - if o == nil || isNil(o.RequestId) { - return nil, false - } - return o.RequestId, true -} - -// HasRequestId returns a boolean if a field has been set. -func (o *RequestDetail) HasRequestId() bool { - if o != nil && !isNil(o.RequestId) { - return true - } - - return false -} - -// SetRequestId gets a reference to the given string and assigns it to the RequestId field. -func (o *RequestDetail) SetRequestId(v string) { - o.RequestId = &v -} - -// GetSenderAccount returns the SenderAccount field value if set, zero value otherwise. -func (o *RequestDetail) GetSenderAccount() string { - if o == nil || isNil(o.SenderAccount) { - var ret string - return ret - } - return *o.SenderAccount -} - -// GetSenderAccountOk returns a tuple with the SenderAccount field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetSenderAccountOk() (*string, bool) { - if o == nil || isNil(o.SenderAccount) { - return nil, false - } - return o.SenderAccount, true -} - -// HasSenderAccount returns a boolean if a field has been set. -func (o *RequestDetail) HasSenderAccount() bool { - if o != nil && !isNil(o.SenderAccount) { - return true - } - - return false -} - -// SetSenderAccount gets a reference to the given string and assigns it to the SenderAccount field. -func (o *RequestDetail) SetSenderAccount(v string) { - o.SenderAccount = &v -} - -// GetTargetAddress returns the TargetAddress field value if set, zero value otherwise. -func (o *RequestDetail) GetTargetAddress() string { - if o == nil || isNil(o.TargetAddress) { - var ret string - return ret - } - return *o.TargetAddress -} - -// GetTargetAddressOk returns a tuple with the TargetAddress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestDetail) GetTargetAddressOk() (*string, bool) { - if o == nil || isNil(o.TargetAddress) { - return nil, false - } - return o.TargetAddress, true -} - -// HasTargetAddress returns a boolean if a field has been set. -func (o *RequestDetail) HasTargetAddress() bool { - if o != nil && !isNil(o.TargetAddress) { - return true - } - - return false -} - -// SetTargetAddress gets a reference to the given string and assigns it to the TargetAddress field. -func (o *RequestDetail) SetTargetAddress(v string) { - o.TargetAddress = &v -} - -func (o RequestDetail) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Allowance) { - toSerialize["allowance"] = o.Allowance - } - if !isNil(o.CallTarget) { - toSerialize["callTarget"] = o.CallTarget - } - if !isNil(o.FungibleTokens) { - toSerialize["fungibleTokens"] = o.FungibleTokens - } - if !isNil(o.GasGudget) { - toSerialize["gasGudget"] = o.GasGudget - } - if !isNil(o.IsEVM) { - toSerialize["isEVM"] = o.IsEVM - } - if !isNil(o.IsOffLedger) { - toSerialize["isOffLedger"] = o.IsOffLedger - } - if !isNil(o.Nft) { - toSerialize["nft"] = o.Nft - } - if !isNil(o.Params) { - toSerialize["params"] = o.Params - } - if !isNil(o.RequestId) { - toSerialize["requestId"] = o.RequestId - } - if !isNil(o.SenderAccount) { - toSerialize["senderAccount"] = o.SenderAccount - } - if !isNil(o.TargetAddress) { - toSerialize["targetAddress"] = o.TargetAddress - } - return json.Marshal(toSerialize) -} - -type NullableRequestDetail struct { - value *RequestDetail - isSet bool -} - -func (v NullableRequestDetail) Get() *RequestDetail { - return v.value -} - -func (v *NullableRequestDetail) Set(val *RequestDetail) { - v.value = val - v.isSet = true -} - -func (v NullableRequestDetail) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestDetail) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestDetail(val *RequestDetail) *NullableRequestDetail { - return &NullableRequestDetail{value: val, isSet: true} -} - -func (v NullableRequestDetail) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestDetail) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/model_request_receipt_response.go b/client/model_request_receipt_response.go deleted file mode 100644 index dc63955cba..0000000000 --- a/client/model_request_receipt_response.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 0.4.0-alpha.2-402-g2adcf666b -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// RequestReceiptResponse struct for RequestReceiptResponse -type RequestReceiptResponse struct { - BlockIndex *int32 `json:"blockIndex,omitempty"` - Error *BlockReceiptError `json:"error,omitempty"` - GasBudget *int64 `json:"gasBudget,omitempty"` - GasBurnLog *BurnLog `json:"gasBurnLog,omitempty"` - GasBurned *int64 `json:"gasBurned,omitempty"` - GasFeeCharged *int64 `json:"gasFeeCharged,omitempty"` - Request *RequestDetail `json:"request,omitempty"` - RequestIndex *int32 `json:"requestIndex,omitempty"` -} - -// NewRequestReceiptResponse instantiates a new RequestReceiptResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRequestReceiptResponse() *RequestReceiptResponse { - this := RequestReceiptResponse{} - return &this -} - -// NewRequestReceiptResponseWithDefaults instantiates a new RequestReceiptResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRequestReceiptResponseWithDefaults() *RequestReceiptResponse { - this := RequestReceiptResponse{} - return &this -} - -// GetBlockIndex returns the BlockIndex field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetBlockIndex() int32 { - if o == nil || isNil(o.BlockIndex) { - var ret int32 - return ret - } - return *o.BlockIndex -} - -// GetBlockIndexOk returns a tuple with the BlockIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetBlockIndexOk() (*int32, bool) { - if o == nil || isNil(o.BlockIndex) { - return nil, false - } - return o.BlockIndex, true -} - -// HasBlockIndex returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasBlockIndex() bool { - if o != nil && !isNil(o.BlockIndex) { - return true - } - - return false -} - -// SetBlockIndex gets a reference to the given int32 and assigns it to the BlockIndex field. -func (o *RequestReceiptResponse) SetBlockIndex(v int32) { - o.BlockIndex = &v -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetError() BlockReceiptError { - if o == nil || isNil(o.Error) { - var ret BlockReceiptError - return ret - } - return *o.Error -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetErrorOk() (*BlockReceiptError, bool) { - if o == nil || isNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasError() bool { - if o != nil && !isNil(o.Error) { - return true - } - - return false -} - -// SetError gets a reference to the given BlockReceiptError and assigns it to the Error field. -func (o *RequestReceiptResponse) SetError(v BlockReceiptError) { - o.Error = &v -} - -// GetGasBudget returns the GasBudget field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetGasBudget() int64 { - if o == nil || isNil(o.GasBudget) { - var ret int64 - return ret - } - return *o.GasBudget -} - -// GetGasBudgetOk returns a tuple with the GasBudget field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool) { - if o == nil || isNil(o.GasBudget) { - return nil, false - } - return o.GasBudget, true -} - -// HasGasBudget returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasGasBudget() bool { - if o != nil && !isNil(o.GasBudget) { - return true - } - - return false -} - -// SetGasBudget gets a reference to the given int64 and assigns it to the GasBudget field. -func (o *RequestReceiptResponse) SetGasBudget(v int64) { - o.GasBudget = &v -} - -// GetGasBurnLog returns the GasBurnLog field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetGasBurnLog() BurnLog { - if o == nil || isNil(o.GasBurnLog) { - var ret BurnLog - return ret - } - return *o.GasBurnLog -} - -// GetGasBurnLogOk returns a tuple with the GasBurnLog field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasBurnLogOk() (*BurnLog, bool) { - if o == nil || isNil(o.GasBurnLog) { - return nil, false - } - return o.GasBurnLog, true -} - -// HasGasBurnLog returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasGasBurnLog() bool { - if o != nil && !isNil(o.GasBurnLog) { - return true - } - - return false -} - -// SetGasBurnLog gets a reference to the given BurnLog and assigns it to the GasBurnLog field. -func (o *RequestReceiptResponse) SetGasBurnLog(v BurnLog) { - o.GasBurnLog = &v -} - -// GetGasBurned returns the GasBurned field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetGasBurned() int64 { - if o == nil || isNil(o.GasBurned) { - var ret int64 - return ret - } - return *o.GasBurned -} - -// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool) { - if o == nil || isNil(o.GasBurned) { - return nil, false - } - return o.GasBurned, true -} - -// HasGasBurned returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasGasBurned() bool { - if o != nil && !isNil(o.GasBurned) { - return true - } - - return false -} - -// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. -func (o *RequestReceiptResponse) SetGasBurned(v int64) { - o.GasBurned = &v -} - -// GetGasFeeCharged returns the GasFeeCharged field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetGasFeeCharged() int64 { - if o == nil || isNil(o.GasFeeCharged) { - var ret int64 - return ret - } - return *o.GasFeeCharged -} - -// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { - if o == nil || isNil(o.GasFeeCharged) { - return nil, false - } - return o.GasFeeCharged, true -} - -// HasGasFeeCharged returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasGasFeeCharged() bool { - if o != nil && !isNil(o.GasFeeCharged) { - return true - } - - return false -} - -// SetGasFeeCharged gets a reference to the given int64 and assigns it to the GasFeeCharged field. -func (o *RequestReceiptResponse) SetGasFeeCharged(v int64) { - o.GasFeeCharged = &v -} - -// GetRequest returns the Request field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetRequest() RequestDetail { - if o == nil || isNil(o.Request) { - var ret RequestDetail - return ret - } - return *o.Request -} - -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetRequestOk() (*RequestDetail, bool) { - if o == nil || isNil(o.Request) { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasRequest() bool { - if o != nil && !isNil(o.Request) { - return true - } - - return false -} - -// SetRequest gets a reference to the given RequestDetail and assigns it to the Request field. -func (o *RequestReceiptResponse) SetRequest(v RequestDetail) { - o.Request = &v -} - -// GetRequestIndex returns the RequestIndex field value if set, zero value otherwise. -func (o *RequestReceiptResponse) GetRequestIndex() int32 { - if o == nil || isNil(o.RequestIndex) { - var ret int32 - return ret - } - return *o.RequestIndex -} - -// GetRequestIndexOk returns a tuple with the RequestIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetRequestIndexOk() (*int32, bool) { - if o == nil || isNil(o.RequestIndex) { - return nil, false - } - return o.RequestIndex, true -} - -// HasRequestIndex returns a boolean if a field has been set. -func (o *RequestReceiptResponse) HasRequestIndex() bool { - if o != nil && !isNil(o.RequestIndex) { - return true - } - - return false -} - -// SetRequestIndex gets a reference to the given int32 and assigns it to the RequestIndex field. -func (o *RequestReceiptResponse) SetRequestIndex(v int32) { - o.RequestIndex = &v -} - -func (o RequestReceiptResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.BlockIndex) { - toSerialize["blockIndex"] = o.BlockIndex - } - if !isNil(o.Error) { - toSerialize["error"] = o.Error - } - if !isNil(o.GasBudget) { - toSerialize["gasBudget"] = o.GasBudget - } - if !isNil(o.GasBurnLog) { - toSerialize["gasBurnLog"] = o.GasBurnLog - } - if !isNil(o.GasBurned) { - toSerialize["gasBurned"] = o.GasBurned - } - if !isNil(o.GasFeeCharged) { - toSerialize["gasFeeCharged"] = o.GasFeeCharged - } - if !isNil(o.Request) { - toSerialize["request"] = o.Request - } - if !isNil(o.RequestIndex) { - toSerialize["requestIndex"] = o.RequestIndex - } - return json.Marshal(toSerialize) -} - -type NullableRequestReceiptResponse struct { - value *RequestReceiptResponse - isSet bool -} - -func (v NullableRequestReceiptResponse) Get() *RequestReceiptResponse { - return v.value -} - -func (v *NullableRequestReceiptResponse) Set(val *RequestReceiptResponse) { - v.value = val - v.isSet = true -} - -func (v NullableRequestReceiptResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableRequestReceiptResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRequestReceiptResponse(val *RequestReceiptResponse) *NullableRequestReceiptResponse { - return &NullableRequestReceiptResponse{value: val, isSet: true} -} - -func (v NullableRequestReceiptResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRequestReceiptResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/client/.gitignore b/clients/apiclient/.gitignore similarity index 100% rename from client/.gitignore rename to clients/apiclient/.gitignore diff --git a/client/.openapi-generator-ignore b/clients/apiclient/.openapi-generator-ignore similarity index 96% rename from client/.openapi-generator-ignore rename to clients/apiclient/.openapi-generator-ignore index 52e532f2f9..3155096701 100644 --- a/client/.openapi-generator-ignore +++ b/clients/apiclient/.openapi-generator-ignore @@ -22,4 +22,6 @@ # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -README.md \ No newline at end of file +README.md +generate_client.sh +go.mod \ No newline at end of file diff --git a/client/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES similarity index 98% rename from client/.openapi-generator/FILES rename to clients/apiclient/.openapi-generator/FILES index f3406924ff..3750ea12bb 100644 --- a/client/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -78,6 +78,7 @@ docs/RequestIDsResponse.md docs/RequestProcessedResponse.md docs/RequestReceiptResponse.md docs/RequestsApi.md +docs/StateResponse.md docs/Transaction.md docs/TransactionIDMetricItem.md docs/TransactionMetricItem.md @@ -90,7 +91,6 @@ docs/User.md docs/UsersApi.md docs/ValidationError.md git_push.sh -go.mod go.sum model_account_list_response.go model_account_nfts_response.go @@ -156,6 +156,7 @@ model_request_detail.go model_request_ids_response.go model_request_processed_response.go model_request_receipt_response.go +model_state_response.go model_transaction.go model_transaction_id_metric_item.go model_transaction_metric_item.go diff --git a/clients/apiclient/.openapi-generator/VERSION b/clients/apiclient/.openapi-generator/VERSION new file mode 100644 index 0000000000..d6b4ec4aa7 --- /dev/null +++ b/clients/apiclient/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/client/.travis.yml b/clients/apiclient/.travis.yml similarity index 100% rename from client/.travis.yml rename to clients/apiclient/.travis.yml diff --git a/client/README.md b/clients/apiclient/README.md similarity index 100% rename from client/README.md rename to clients/apiclient/README.md diff --git a/client/api/openapi.yaml b/clients/apiclient/api/openapi.yaml similarity index 91% rename from client/api/openapi.yaml rename to clients/apiclient/api/openapi.yaml index 7828926c41..add47bb1c2 100644 --- a/client/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.1 info: description: REST API for the Wasp node title: Wasp API - version: 0.4.0-alpha.2-402-g2adcf666b + version: 0.4.0-alpha.2-403-g907bc6c54 externalDocs: description: Find out more about Wasp url: https://wiki.iota.org/smart-contracts/overview @@ -229,9 +229,9 @@ paths: summary: Get all available chain contracts tags: - chains - /chains/{chainID}/deactivate: - post: - operationId: deactivateChain + /chains/{chainID}/core/accounts: + get: + operationId: accountsGetAccounts parameters: - description: ChainID (Bech32) in: path @@ -242,25 +242,23 @@ paths: type: string responses: "200": - content: {} - description: Chain was successfully deactivated - "304": - content: {} - description: Chain was not deactivated + content: + application/json: + schema: + $ref: '#/components/schemas/AccountListResponse' + description: A list of all accounts "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Deactivate a chain + summary: Get a list of all accounts tags: - - chains - /metrics/chain/{chainID}: + - corecontracts + /chains/{chainID}/core/accounts/account/{agentID}/balance: get: - operationId: getChainMetrics + operationId: accountsGetAccountBalance parameters: - description: ChainID (Bech32) in: path @@ -269,27 +267,32 @@ paths: schema: format: string type: string + - description: AgentID (Bech32 for WasmVM | Hex for EVM) + in: path + name: agentID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ChainMetrics' - description: A list of all available metrics. + $ref: '#/components/schemas/AssetsResponse' + description: All assets belonging to an account "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get chain specific metrics. + summary: Get all assets belonging to an account tags: - - metrics - /metrics/chain/{chainID}/pipe: + - corecontracts + /chains/{chainID}/core/accounts/account/{agentID}/nfts: get: - operationId: getChainPipeMetrics + operationId: accountsGetAccountNFTIDs parameters: - description: ChainID (Bech32) in: path @@ -298,27 +301,32 @@ paths: schema: format: string type: string + - description: AgentID (Bech32 for WasmVM | Hex for EVM) + in: path + name: agentID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ConsensusPipeMetrics' - description: A list of all available metrics. + $ref: '#/components/schemas/AccountNFTsResponse' + description: All NFT ids belonging to an account "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get chain pipe event metrics. + summary: Get all NFT ids belonging to an account tags: - - metrics - /metrics/chain/{chainID}/workflow: + - corecontracts + /chains/{chainID}/core/accounts/account/{agentID}/nonce: get: - operationId: getChainWorkflowMetrics + operationId: accountsGetAccountNonce parameters: - description: ChainID (Bech32) in: path @@ -327,106 +335,132 @@ paths: schema: format: string type: string + - description: AgentID (Bech32 for WasmVM | Hex for EVM | '000000@Bech32' Addresses + require urlencode) + in: path + name: agentID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ConsensusWorkflowMetrics' - description: A list of all available metrics. + $ref: '#/components/schemas/AccountNonceResponse' + description: The current nonce of an account "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get chain workflow metrics. + summary: Get the current nonce of an account tags: - - metrics - /metrics/l1: + - corecontracts + /chains/{chainID}/core/accounts/foundry_output: get: - operationId: getL1Metrics + operationId: accountsGetFoundryOutput + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Serial Number (uint32) + in: path + name: chainID_ + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ChainMetrics' - description: A list of all available metrics. + $ref: '#/components/schemas/FoundryOutputResponse' + description: The foundry output "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get accumulated metrics. + summary: Get the foundry output tags: - - metrics - /node/config: + - corecontracts + /chains/{chainID}/core/accounts/nftdata: get: - operationId: getConfiguration + operationId: accountsGetNFTData + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: NFT ID (Hex) + in: path + name: nftID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - additionalProperties: - example: "true" - format: string - type: string - type: object - description: Dumped configuration + $ref: '#/components/schemas/NFTDataResponse' + description: The NFT data "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Return the Wasp configuration + summary: Get the NFT data by an ID tags: - - node - /node/dks: - post: - operationId: generateDKS - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DKSharesPostRequest' - description: Request parameters + - corecontracts + /chains/{chainID}/core/accounts/token_registry: + get: + operationId: accountsGetNativeTokenIDRegistry + parameters: + - description: ChainID (Bech32) + in: path + name: chainID required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/DKSharesPostRequest' - description: DK shares info + $ref: '#/components/schemas/NativeTokenIDRegistryResponse' + description: A list of all registries "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Generate a new distributed key + summary: Get a list of all registries tags: - - node - x-codegen-request-body-name: DKSharesPostRequest - /node/dks/{sharedAddress}: + - corecontracts + /chains/{chainID}/core/accounts/total_assets: get: - operationId: getDKSInfo + operationId: accountsGetTotalAssets parameters: - - description: SharedAddress (Bech32) + - description: ChainID (Bech32) in: path - name: sharedAddress + name: chainID required: true schema: format: string @@ -436,389 +470,332 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesInfo' - description: DK shares info + $ref: '#/components/schemas/AssetsResponse' + description: All stored assets "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get information about the shared address DKS configuration + summary: Get all stored assets tags: - - node - /node/info: + - corecontracts + /chains/{chainID}/core/blobs: get: - operationId: getInfo + operationId: blobsGetAllBlobs + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/InfoResponse' - description: Returns information about this node. + $ref: '#/components/schemas/BlobListResponse' + description: All stored blobs "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Returns private information about this node. + summary: Get all stored blobs tags: - - node - /node/owner/certificate: - post: - operationId: setNodeOwner - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NodeOwnerCertificateRequest' - description: The node owner certificate + - corecontracts + /chains/{chainID}/core/blobs/{blobHash}: + get: + operationId: blobsGetBlobInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID required: true + schema: + format: string + type: string + - description: BlobHash (Hex) + in: path + name: blobHash + required: true + schema: + format: string + type: string responses: "200": - content: {} - description: Node owner was successfully changed + content: + application/json: + schema: + $ref: '#/components/schemas/BlobInfoResponse' + description: All blob fields and their values "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Sets the node owner + summary: Get all fields of a blob tags: - - node - x-codegen-request-body-name: "" - /node/peers: + - corecontracts + /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: get: - operationId: getAllPeers - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/PeeringNodeStatusResponse_' - type: array - description: A list of all peers - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get basic information about all configured peers - tags: - - node - /node/peers/identity: - get: - operationId: getPeeringIdentity + operationId: blobsGetBlobValue + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: BlobHash (Hex) + in: path + name: blobHash + required: true + schema: + format: string + type: string + - description: FieldKey (String) + in: path + name: fieldKey + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/PeeringNodeIdentityResponse' - description: This node peering identity + $ref: '#/components/schemas/BlobValueResponse' + description: The value of the supplied field (key) "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get basic peer info of the current node + summary: Get the value of the supplied field (key) tags: - - node - /node/peers/trusted: - delete: - operationId: distrustPeer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustRequest' - description: Info of the peer to distrust + - corecontracts + /chains/{chainID}/core/blocklog/blocks/latest: + get: + operationId: blocklogGetLatestBlockInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID required: true + schema: + format: string + type: string responses: "200": - content: {} - description: Peer was successfully distrusted + content: + application/json: + schema: + $ref: '#/components/schemas/BlockInfoResponse' + description: The block info "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Distrust a peering node + summary: Get the block info of the latest block tags: - - node - x-codegen-request-body-name: "" + - corecontracts + /chains/{chainID}/core/blocklog/blocks/latest/receipts: get: - operationId: getTrustedPeers + operationId: blocklogGetRequestReceiptsOfLatestBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - items: - $ref: '#/components/schemas/PeeringNodeIdentityResponse' - type: array - description: A list of trusted peers + $ref: '#/components/schemas/BlockReceiptsResponse' + description: The receipts "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get trusted peers + summary: Get all receipts of the latest block tags: - - node - post: - operationId: trustPeer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustRequest' - description: Info of the peer to trust + - corecontracts + /chains/{chainID}/core/blocklog/blocks/latest/requestids: + get: + operationId: blocklogGetRequestIDsForLatestBlock + parameters: + - description: ChainID (Bech32) + in: path + name: chainID required: true + schema: + format: string + type: string responses: "200": - content: {} - description: Peer was successfully trusted - "401": content: application/json: schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Trust a peering node - tags: - - node - x-codegen-request-body-name: "" - /node/shutdown: - post: - operationId: shutdownNode - responses: - "200": - content: {} - description: The node has been shut down + $ref: '#/components/schemas/RequestIDsResponse' + description: "A list of request ids (ISCRequestID[])" "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Shut down the node + summary: Get the request ids for the latest block tags: - - node - /users: + - corecontracts + /chains/{chainID}/core/blocklog/blocks/{blockIndex}: get: - operationId: getUsers + operationId: blocklogGetBlockInfo + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer responses: "200": content: application/json: schema: - items: - $ref: '#/components/schemas/User' - type: array - description: A list of all users - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Get a list of all users - tags: - - users - post: - operationId: addUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddUserRequest' - description: The user data - required: true - responses: - "201": - content: {} - description: User successfully added - "400": - content: {} - description: Invalid request + $ref: '#/components/schemas/BlockInfoResponse' + description: The block info "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Add a user + summary: Get the block info of a certain block index tags: - - users - x-codegen-request-body-name: "" - /users/{username}: - delete: - operationId: deleteUser + - corecontracts + /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + get: + operationId: blocklogGetRequestReceiptsOfBlock parameters: - - description: The username + - description: ChainID (Bech32) in: path - name: username + name: chainID required: true schema: format: string type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer responses: "200": - content: {} - description: Deletes a specific user + content: + application/json: + schema: + $ref: '#/components/schemas/BlockReceiptsResponse' + description: The receipts "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - "404": - content: {} - description: User not found - security: - - Authorization: [] - summary: Deletes a user + summary: Get all receipts of a certain block tags: - - users + - corecontracts + /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: get: - operationId: getUser + operationId: blocklogGetRequestIDsForBlock parameters: - - description: The username + - description: ChainID (Bech32) in: path - name: username + name: chainID required: true schema: format: string type: string + - description: Block Index (uint32) + in: path + name: blockIndex + required: true + schema: + format: int32 + type: integer responses: "200": content: application/json: schema: - $ref: '#/components/schemas/User' - description: Returns a specific user + $ref: '#/components/schemas/RequestIDsResponse' + description: "A list of request ids (ISCRequestID[])" "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - "404": - content: {} - description: User not found - security: - - Authorization: [] - summary: Get a user + summary: Get the request ids for a certain block index tags: - - users - /users/{username}/password: - put: - operationId: changeUserPassword + - corecontracts + /chains/{chainID}/core/blocklog/controladdresses: + get: + operationId: blocklogGetControlAddresses parameters: - - description: The username. + - description: ChainID (Bech32) in: path - name: username + name: chainID required: true schema: format: string type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserPasswordRequest' - description: The users new password - required: true responses: "200": - content: {} - description: User successfully updated - "400": - content: {} - description: Invalid request - "401": content: application/json: schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Change user password - tags: - - users - x-codegen-request-body-name: "" - /users/{username}/permissions: - put: - operationId: changeUserPermissions - parameters: - - description: The username. - in: path - name: username - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateUserPermissionsRequest' - description: The users new permissions - required: true - responses: - "200": - content: {} - description: User successfully updated - "400": - content: {} - description: Invalid request + $ref: '#/components/schemas/ControlAddressesResponse' + description: The chain info "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - security: - - Authorization: [] - summary: Change user permissions + summary: Get the control addresses tags: - - users - x-codegen-request-body-name: "" - /v2/chains/{chainID}/core/accounts: + - corecontracts + /chains/{chainID}/core/blocklog/events/block/latest: get: - operationId: accountsGetAccounts + operationId: blocklogGetEventsOfLatestBlock parameters: - description: ChainID (Bech32) in: path @@ -832,20 +809,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AccountListResponse' - description: A list of all accounts + $ref: '#/components/schemas/EventsResponse' + description: The receipts "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get a list of all accounts + summary: Get events of the latest block tags: - corecontracts - /v2/chains/{chainID}/core/accounts/account/{agentID}/balance: + /chains/{chainID}/core/blocklog/events/block/{blockIndex}: get: - operationId: accountsGetAccountBalance + operationId: blocklogGetEventsOfBlock parameters: - description: ChainID (Bech32) in: path @@ -854,32 +831,32 @@ paths: schema: format: string type: string - - description: AgentID (Bech32 for WasmVM | Hex for EVM) + - description: Block Index (uint32) in: path - name: agentID + name: blockIndex required: true schema: - format: string - type: string + format: int32 + type: integer responses: "200": content: application/json: schema: - $ref: '#/components/schemas/AssetsResponse' - description: All assets belonging to an account + $ref: '#/components/schemas/EventsResponse' + description: The events "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all assets belonging to an account + summary: Get events of a block tags: - corecontracts - /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts: + /chains/{chainID}/core/blocklog/events/contract/{contractHname}: get: - operationId: accountsGetAccountNFTIDs + operationId: blocklogGetEventsOfContract parameters: - description: ChainID (Bech32) in: path @@ -888,9 +865,9 @@ paths: schema: format: string type: string - - description: AgentID (Bech32 for WasmVM | Hex for EVM) + - description: Contract (Hname) in: path - name: agentID + name: contractHname required: true schema: format: string @@ -900,20 +877,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AccountNFTsResponse' - description: All NFT ids belonging to an account + $ref: '#/components/schemas/EventsResponse' + description: The events "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all NFT ids belonging to an account + summary: Get events of a contract tags: - corecontracts - /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce: + /chains/{chainID}/core/blocklog/events/request/{requestID}: get: - operationId: accountsGetAccountNonce + operationId: blocklogGetEventsOfRequest parameters: - description: ChainID (Bech32) in: path @@ -922,10 +899,9 @@ paths: schema: format: string type: string - - description: AgentID (Bech32 for WasmVM | Hex for EVM | '000000@Bech32' Addresses - require urlencode) + - description: Request ID (ISCRequestID) in: path - name: agentID + name: requestID required: true schema: format: string @@ -935,20 +911,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AccountNonceResponse' - description: The current nonce of an account + $ref: '#/components/schemas/EventsResponse' + description: The events "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the current nonce of an account + summary: Get events of a request tags: - corecontracts - /v2/chains/{chainID}/core/accounts/foundry_output: + /chains/{chainID}/core/blocklog/requests/{requestID}: get: - operationId: accountsGetFoundryOutput + operationId: blocklogGetRequestReceipt parameters: - description: ChainID (Bech32) in: path @@ -957,9 +933,9 @@ paths: schema: format: string type: string - - description: Serial Number (uint32) + - description: Request ID (ISCRequestID) in: path - name: chainID_ + name: requestID required: true schema: format: string @@ -969,20 +945,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FoundryOutputResponse' - description: The foundry output + $ref: '#/components/schemas/RequestReceiptResponse' + description: The receipt "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the foundry output + summary: Get the receipt of a certain request id tags: - corecontracts - /v2/chains/{chainID}/core/accounts/nftdata: + /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: get: - operationId: accountsGetNFTData + operationId: blocklogGetRequestIsProcessed parameters: - description: ChainID (Bech32) in: path @@ -991,9 +967,9 @@ paths: schema: format: string type: string - - description: NFT ID (Hex) + - description: Request ID (ISCRequestID) in: path - name: nftID + name: requestID required: true schema: format: string @@ -1003,20 +979,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NFTDataResponse' - description: The NFT data + $ref: '#/components/schemas/RequestProcessedResponse' + description: The processing result "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the NFT data by an ID + summary: Get the request processing status tags: - corecontracts - /v2/chains/{chainID}/core/accounts/token_registry: + /chains/{chainID}/core/errors/{contractHname}/message/{errorID}: get: - operationId: accountsGetNativeTokenIDRegistry + operationId: errorsGetErrorMessageFormat parameters: - description: ChainID (Bech32) in: path @@ -1025,25 +1001,41 @@ paths: schema: format: string type: string + - description: Contract (Hname as Hex) + in: path + name: contractHname + required: true + schema: + format: string + type: string + - description: Error Id (uint16) + in: path + name: errorID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/NativeTokenIDRegistryResponse' - description: A list of all registries + $ref: '#/components/schemas/ErrorMessageFormatResponse' + description: The error message format "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get a list of all registries + summary: Get the error message format of a specific error id tags: - corecontracts - /v2/chains/{chainID}/core/accounts/total_assets: + /chains/{chainID}/core/governance/chaininfo: get: - operationId: accountsGetTotalAssets + description: "If you are using the common API functions, you most likely rather\ + \ want to use '/chains/:chainID' to get information about a chain." + operationId: governanceGetChainInfo parameters: - description: ChainID (Bech32) in: path @@ -1057,20 +1049,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AssetsResponse' - description: All stored assets + $ref: '#/components/schemas/GovChainInfoResponse' + description: The chain info "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all stored assets + summary: Get the chain info tags: - corecontracts - /v2/chains/{chainID}/core/blobs: - get: - operationId: blobsGetAllBlobs + /chains/{chainID}/deactivate: + post: + operationId: deactivateChain parameters: - description: ChainID (Bech32) in: path @@ -1081,23 +1073,25 @@ paths: type: string responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/BlobListResponse' - description: All stored blobs + content: {} + description: Chain was successfully deactivated + "304": + content: {} + description: Chain was not deactivated "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all stored blobs + security: + - Authorization: [] + summary: Deactivate a chain tags: - - corecontracts - /v2/chains/{chainID}/core/blobs/{blobHash}: + - chains + /chains/{chainID}/evm/tx/{txHash}: get: - operationId: blobsGetBlobInfo + operationId: getRequestIDFromEVMTransactionID parameters: - description: ChainID (Bech32) in: path @@ -1106,9 +1100,9 @@ paths: schema: format: string type: string - - description: BlobHash (Hex) + - description: Transaction hash (Hex-encoded) in: path - name: blobHash + name: txHash required: true schema: format: string @@ -1118,20 +1112,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BlobInfoResponse' - description: All blob fields and their values - "401": + format: string + type: string + description: Request ID + "404": content: application/json: schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all fields of a blob + format: string + type: string + description: Request ID not found + summary: Get the ISC request ID for the given Ethereum transaction hash tags: - - corecontracts - /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: + - chains + /chains/{chainID}/receipts/{requestID}: get: - operationId: blobsGetBlobValue + operationId: getReceipt parameters: - description: ChainID (Bech32) in: path @@ -1140,16 +1136,9 @@ paths: schema: format: string type: string - - description: BlobHash (Hex) - in: path - name: blobHash - required: true - schema: - format: string - type: string - - description: FieldKey (String) + - description: RequestID (Hex) in: path - name: fieldKey + name: requestID required: true schema: format: string @@ -1159,20 +1148,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BlobValueResponse' - description: The value of the supplied field (key) - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the value of the supplied field (key) + $ref: '#/components/schemas/ReceiptResponse' + description: ReceiptResponse + summary: Get a receipt from a request ID tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/latest: + - requests + /chains/{chainID}/requests/{requestID}/wait: get: - operationId: blocklogGetLatestBlockInfo + operationId: waitForTransaction parameters: - description: ChainID (Bech32) in: path @@ -1181,25 +1164,32 @@ paths: schema: format: string type: string + - description: RequestID (Hex) + in: path + name: requestID + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/BlockInfoResponse' - description: The block info - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the block info of the latest block + $ref: '#/components/schemas/ReceiptResponse' + description: The request receipt + "404": + content: {} + description: The chain or request id is invalid + "408": + content: {} + description: The waiting time has reached the defined limit + summary: Wait until the given request has been processed by the node tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts: + - requests + /chains/{chainID}/state/{stateKey}: get: - operationId: blocklogGetRequestReceiptsOfLatestBlock + operationId: getStateValue parameters: - description: ChainID (Bech32) in: path @@ -1208,27 +1198,28 @@ paths: schema: format: string type: string + - description: Key (Hex-encoded) + in: path + name: stateKey + required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/BlockReceiptsResponse' - description: The receipts - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all receipts of the latest block + $ref: '#/components/schemas/StateResponse' + description: Result + summary: Fetch the raw value associated with the given key in the chain state tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids: + - chains + /chains/{chainID}/ws: get: - operationId: blocklogGetRequestIDsForLatestBlock + operationId: attachToWebsocket parameters: - - description: ChainID (Bech32) + - description: ChainID (Bech32-encoded) in: path name: chainID required: true @@ -1236,24 +1227,14 @@ paths: format: string type: string responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/RequestIDsResponse' - description: "A list of request ids (ISCRequestID[])" - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/ValidationError' - description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the request ids for the latest block + default: + content: {} + description: successful operation tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}: + - chains + /metrics/chain/{chainID}: get: - operationId: blocklogGetBlockInfo + operationId: getChainMetrics parameters: - description: ChainID (Bech32) in: path @@ -1262,32 +1243,27 @@ paths: schema: format: string type: string - - description: Block Index (uint32) - in: path - name: blockIndex - required: true - schema: - format: int32 - type: integer responses: "200": content: application/json: schema: - $ref: '#/components/schemas/BlockInfoResponse' - description: The block info + $ref: '#/components/schemas/ChainMetrics' + description: A list of all available metrics. "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the block info of a certain block index + security: + - Authorization: [] + summary: Get chain specific metrics. tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + - metrics + /metrics/chain/{chainID}/pipe: get: - operationId: blocklogGetRequestReceiptsOfBlock + operationId: getChainPipeMetrics parameters: - description: ChainID (Bech32) in: path @@ -1296,32 +1272,27 @@ paths: schema: format: string type: string - - description: Block Index (uint32) - in: path - name: blockIndex - required: true - schema: - format: int32 - type: integer responses: "200": content: application/json: schema: - $ref: '#/components/schemas/BlockReceiptsResponse' - description: The receipts + $ref: '#/components/schemas/ConsensusPipeMetrics' + description: A list of all available metrics. "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get all receipts of a certain block + security: + - Authorization: [] + summary: Get chain pipe event metrics. tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: + - metrics + /metrics/chain/{chainID}/workflow: get: - operationId: blocklogGetRequestIDsForBlock + operationId: getChainWorkflowMetrics parameters: - description: ChainID (Bech32) in: path @@ -1330,131 +1301,106 @@ paths: schema: format: string type: string - - description: Block Index (uint32) - in: path - name: blockIndex - required: true - schema: - format: int32 - type: integer responses: "200": content: application/json: schema: - $ref: '#/components/schemas/RequestIDsResponse' - description: "A list of request ids (ISCRequestID[])" + $ref: '#/components/schemas/ConsensusWorkflowMetrics' + description: A list of all available metrics. "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the request ids for a certain block index + security: + - Authorization: [] + summary: Get chain workflow metrics. tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/controladdresses: + - metrics + /metrics/l1: get: - operationId: blocklogGetControlAddresses - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string + operationId: getL1Metrics responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ControlAddressesResponse' - description: The chain info + $ref: '#/components/schemas/ChainMetrics' + description: A list of all available metrics. "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the control addresses + security: + - Authorization: [] + summary: Get accumulated metrics. tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/events/block/latest: + - metrics + /node/config: get: - operationId: blocklogGetEventsOfLatestBlock - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string + operationId: getConfiguration responses: "200": content: application/json: schema: - $ref: '#/components/schemas/EventsResponse' - description: The receipts + additionalProperties: + example: "true" + format: string + type: string + type: object + description: Dumped configuration "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get events of the latest block + security: + - Authorization: [] + summary: Return the Wasp configuration tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}: - get: - operationId: blocklogGetEventsOfBlock - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Block Index (uint32) - in: path - name: blockIndex + - node + /node/dks: + post: + operationId: generateDKS + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesPostRequest' + description: Request parameters required: true - schema: - format: int32 - type: integer responses: "200": content: application/json: schema: - $ref: '#/components/schemas/EventsResponse' - description: The events + $ref: '#/components/schemas/DKSharesPostRequest' + description: DK shares info "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get events of a block + security: + - Authorization: [] + summary: Generate a new distributed key tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}: + - node + x-codegen-request-body-name: DKSharesPostRequest + /node/dks/{sharedAddress}: get: - operationId: blocklogGetEventsOfContract + operationId: getDKSInfo parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Contract (Hname) + - description: SharedAddress (Bech32) in: path - name: contractHname + name: sharedAddress required: true schema: format: string @@ -1464,239 +1410,342 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EventsResponse' - description: The events + $ref: '#/components/schemas/DKSharesInfo' + description: DK shares info "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get events of a contract + security: + - Authorization: [] + summary: Get information about the shared address DKS configuration tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/events/request/{requestID}: + - node + /node/info: get: - operationId: blocklogGetEventsOfRequest - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Request ID (ISCRequestID) - in: path - name: requestID - required: true - schema: - format: string - type: string + operationId: getInfo responses: "200": content: application/json: schema: - $ref: '#/components/schemas/EventsResponse' - description: The events + $ref: '#/components/schemas/InfoResponse' + description: Returns information about this node. "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get events of a request + security: + - Authorization: [] + summary: Returns private information about this node. tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/requests/{requestID}: - get: - operationId: blocklogGetRequestReceipt - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Request ID (ISCRequestID) - in: path - name: requestID + - node + /node/owner/certificate: + post: + operationId: setNodeOwner + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NodeOwnerCertificateRequest' + description: The node owner certificate required: true - schema: - format: string - type: string responses: "200": + content: {} + description: Node owner was successfully changed + "401": content: application/json: schema: - $ref: '#/components/schemas/RequestReceiptResponse' - description: The receipt + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Sets the node owner + tags: + - node + x-codegen-request-body-name: "" + /node/peers: + get: + operationId: getAllPeers + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PeeringNodeStatusResponse_' + type: array + description: A list of all peers "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the receipt of a certain request id + security: + - Authorization: [] + summary: Get basic information about all configured peers tags: - - corecontracts - /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: + - node + /node/peers/identity: get: - operationId: blocklogGetRequestIsProcessed - parameters: - - description: ChainID (Bech32) - in: path - name: chainID + operationId: getPeeringIdentity + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringNodeIdentityResponse' + description: This node peering identity + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get basic peer info of the current node + tags: + - node + /node/peers/trusted: + delete: + operationId: distrustPeer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustRequest' + description: Info of the peer to distrust required: true - schema: - format: string - type: string - - description: Request ID (ISCRequestID) - in: path - name: requestID + responses: + "200": + content: {} + description: Peer was successfully distrusted + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Distrust a peering node + tags: + - node + x-codegen-request-body-name: "" + get: + operationId: getTrustedPeers + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PeeringNodeIdentityResponse' + type: array + description: A list of trusted peers + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get trusted peers + tags: + - node + post: + operationId: trustPeer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustRequest' + description: Info of the peer to trust required: true - schema: - format: string - type: string responses: "200": + content: {} + description: Peer was successfully trusted + "401": content: application/json: schema: - $ref: '#/components/schemas/RequestProcessedResponse' - description: The processing result + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Trust a peering node + tags: + - node + x-codegen-request-body-name: "" + /node/shutdown: + post: + operationId: shutdownNode + responses: + "200": + content: {} + description: The node has been shut down "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the request processing status + security: + - Authorization: [] + summary: Shut down the node tags: - - corecontracts - /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}: + - node + /node/version: get: - operationId: errorsGetErrorMessageFormat - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Contract (Hname as Hex) - in: path - name: contractHname + operationId: getVersion + responses: + "200": + content: + application/json: + schema: + format: string + type: string + description: Returns the version of the node. + summary: Returns the node version. + tags: + - node + /requests/callview: + post: + description: "Execute a view call. Either use HName or Name properties. If both\ + \ are supplied, HName are used." + operationId: callView + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ContractCallViewRequest' + description: Parameters required: true - schema: - format: string - type: string - - description: Error Id (uint16) - in: path - name: errorID + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict_' + description: Result + summary: Call a view function on a contract by Hname + tags: + - requests + x-codegen-request-body-name: "" + /requests/offledger: + post: + operationId: offLedger + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OffLedgerRequest' + description: Offledger request as JSON. Request encoded in Hex required: true - schema: - format: string - type: string + responses: + "202": + content: {} + description: Request submitted + summary: Post an off-ledger request + tags: + - requests + x-codegen-request-body-name: "" + /users: + get: + operationId: getUsers responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ErrorMessageFormatResponse' - description: The error message format + items: + $ref: '#/components/schemas/User' + type: array + description: A list of all users "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the error message format of a specific error id + security: + - Authorization: [] + summary: Get a list of all users tags: - - corecontracts - /v2/chains/{chainID}/core/governance/chaininfo: - get: - description: "If you are using the common API functions, you most likely rather\ - \ want to use '/chains/:chainID' to get information about a chain." - operationId: governanceGetChainInfo - parameters: - - description: ChainID (Bech32) - in: path - name: chainID + - users + post: + operationId: addUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddUserRequest' + description: The user data required: true - schema: - format: string - type: string responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GovChainInfoResponse' - description: The chain info + "201": + content: {} + description: User successfully added + "400": + content: {} + description: Invalid request "401": content: application/json: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" - summary: Get the chain info + security: + - Authorization: [] + summary: Add a user tags: - - corecontracts - /v2/chains/{chainID}/evm/tx/{txHash}: - get: - operationId: getRequestIDFromEVMTransactionID + - users + x-codegen-request-body-name: "" + /users/{username}: + delete: + operationId: deleteUser parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Transaction hash (Hex-encoded) + - description: The username in: path - name: txHash + name: username required: true schema: format: string type: string responses: "200": + content: {} + description: Deletes a specific user + "401": content: application/json: schema: - format: string - type: string - description: Request ID + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" "404": - content: - application/json: - schema: - format: string - type: string - description: Request ID not found - summary: Get the ISC request ID for the given Ethereum transaction hash + content: {} + description: User not found + security: + - Authorization: [] + summary: Deletes a user tags: - - chains - /v2/chains/{chainID}/receipts/{requestID}: + - users get: - operationId: getReceipt + operationId: getUser parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: RequestID (Hex) + - description: The username in: path - name: requestID + name: username required: true schema: format: string @@ -1706,148 +1755,95 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ReceiptResponse' - description: ReceiptResponse - summary: Get a receipt from a request ID - tags: - - requests - /v2/chains/{chainID}/requests/{requestID}/wait: - get: - operationId: waitForTransaction - parameters: - - description: ChainID (Bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: RequestID (Hex) - in: path - name: requestID - required: true - schema: - format: string - type: string - responses: - "200": + $ref: '#/components/schemas/User' + description: Returns a specific user + "401": content: application/json: schema: - $ref: '#/components/schemas/ReceiptResponse' - description: The request receipt + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" "404": content: {} - description: The chain or request id is invalid - "408": - content: {} - description: The waiting time has reached the defined limit - summary: Wait until the given request has been processed by the node + description: User not found + security: + - Authorization: [] + summary: Get a user tags: - - requests - /v2/chains/{chainID}/state/{stateKey}: - get: - operationId: getStateValue + - users + /users/{username}/password: + put: + operationId: changeUserPassword parameters: - - description: ChainID (Bech32) + - description: The username. in: path - name: chainID + name: username required: true schema: format: string type: string - - description: Key (Hex-encoded) - in: path - name: stateKey + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserPasswordRequest' + description: The users new password required: true - schema: - format: string - type: string responses: "200": + content: {} + description: User successfully updated + "400": + content: {} + description: Invalid request + "401": content: application/json: schema: - items: - example: 118 - format: int32 - type: integer - type: array - description: Result - summary: Fetch the raw value associated with the given key in the chain state + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Change user password tags: - - chains - /v2/chains/{chainID}/ws: - get: - operationId: attachToWebsocket + - users + x-codegen-request-body-name: "" + /users/{username}/permissions: + put: + operationId: changeUserPermissions parameters: - - description: ChainID (Bech32-encoded) + - description: The username. in: path - name: chainID + name: username required: true schema: format: string type: string - responses: - default: - content: {} - description: successful operation - tags: - - chains - /v2/node/version: - get: - operationId: getVersion - responses: - "200": - content: - application/json: - schema: - format: string - type: string - description: Returns the version of the node. - summary: Returns the node version. - tags: - - node - /v2/requests/callview: - post: - description: "Execute a view call. Either use HName or Name properties. If both\ - \ are supplied, HName are used." - operationId: callView requestBody: content: application/json: schema: - $ref: '#/components/schemas/ContractCallViewRequest' - description: Parameters - required: false + $ref: '#/components/schemas/UpdateUserPermissionsRequest' + description: The users new permissions + required: true responses: "200": + content: {} + description: User successfully updated + "400": + content: {} + description: Invalid request + "401": content: application/json: schema: - $ref: '#/components/schemas/JSONDict_' - description: Result - summary: Call a view function on a contract by Hname - tags: - - requests - x-codegen-request-body-name: "" - /v2/requests/offledger: - post: - operationId: offLedger - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OffLedgerRequest' - description: Offledger request as JSON. Request encoded in Hex - required: false - responses: - "202": - content: {} - description: Request submitted - summary: Post an off-ledger request + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Change user permissions tags: - - requests + - users x-codegen-request-body-name: "" components: schemas: @@ -1865,6 +1861,8 @@ components: xml: name: Accounts wrapped: true + required: + - accounts type: object xml: name: AccountListResponse @@ -1882,6 +1880,8 @@ components: xml: name: NFTIDs wrapped: true + required: + - nftIds type: object xml: name: AccountNFTsResponse @@ -1894,6 +1894,8 @@ components: type: integer xml: name: Nonce + required: + - nonce type: object xml: name: AccountNonceResponse @@ -1923,6 +1925,10 @@ components: type: string xml: name: Username + required: + - password + - permissions + - username type: object xml: name: AddUserRequest @@ -1931,13 +1937,14 @@ components: lastMessage: outputType: 0 raw: raw - messages: 6 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/Output' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -1946,6 +1953,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: AliasOutputMetricItem @@ -1972,6 +1983,9 @@ components: xml: name: NFTs wrapped: true + required: + - fungibleTokens + - nfts type: object xml: name: Allowance @@ -1996,6 +2010,9 @@ components: xml: name: NativeTokens wrapped: true + required: + - baseTokens + - nativeTokens type: object xml: name: AssetsResponse @@ -2119,14 +2136,14 @@ components: example: anchorTransactionId: anchorTransactionId gasBurned: 6 - totalRequests: 7 + totalRequests: 1 l1CommitmentHash: l1CommitmentHash - blockIndex: 0 - numSuccessfulRequests: 5 + blockIndex: 1 + numSuccessfulRequests: 1 gasFeeCharged: 1 totalStorageDeposit: 9 transactionSubEssenceHash: transactionSubEssenceHash - numOffLedgerRequests: 5 + numOffLedgerRequests: 1 previousL1CommitmentHash: previousL1CommitmentHash timestamp: 2000-01-23T04:56:07.000+00:00 totalBaseTokensInL2Accounts: 2 @@ -2138,6 +2155,7 @@ components: name: AnchorTransactionID blockIndex: format: int32 + minimum: 1 type: integer xml: name: BlockIndex @@ -2158,11 +2176,13 @@ components: name: L1CommitmentHash numOffLedgerRequests: format: int32 + minimum: 1 type: integer xml: name: NumOffLedgerRequests numSuccessfulRequests: format: int32 + minimum: 1 type: integer xml: name: NumSuccessfulRequests @@ -2183,6 +2203,7 @@ components: name: TotalBaseTokensInL2Accounts totalRequests: format: int32 + minimum: 1 type: integer xml: name: TotalRequests @@ -2196,6 +2217,20 @@ components: type: string xml: name: TransactionSubEssenceHash + required: + - anchorTransactionId + - blockIndex + - gasBurned + - gasFeeCharged + - l1CommitmentHash + - numOffLedgerRequests + - numSuccessfulRequests + - previousL1CommitmentHash + - timestamp + - totalBaseTokensInL2Accounts + - totalRequests + - totalStorageDeposit + - transactionSubEssenceHash type: object xml: name: BlockInfoResponse @@ -2214,6 +2249,9 @@ components: type: string xml: name: Hash + required: + - errorMessage + - hash type: object xml: name: BlockReceiptError @@ -2239,8 +2277,8 @@ components: gasGudget: 2 requestId: requestId callTarget: - EntryPoint: 3 - Contract: 9 + contract: 9 + entryPoint: 3 targetAddress: targetAddress allowance: fungibleTokens: @@ -2265,8 +2303,8 @@ components: id: id issuer: issuer isEVM: true - blockIndex: 0 - requestIndex: 4 + blockIndex: 1 + requestIndex: 1 gasFeeCharged: 2 gasBudget: 6 gasBurned: 5 @@ -2292,8 +2330,8 @@ components: gasGudget: 2 requestId: requestId callTarget: - EntryPoint: 3 - Contract: 9 + contract: 9 + entryPoint: 3 targetAddress: targetAddress allowance: fungibleTokens: @@ -2318,8 +2356,8 @@ components: id: id issuer: issuer isEVM: true - blockIndex: 0 - requestIndex: 4 + blockIndex: 1 + requestIndex: 1 gasFeeCharged: 2 gasBudget: 6 gasBurned: 5 @@ -2334,6 +2372,8 @@ components: xml: name: Receipts wrapped: true + required: + - receipts type: object xml: name: BlockReceiptsResponse @@ -2375,19 +2415,22 @@ components: name: BurnRecord CallTarget: example: - EntryPoint: 3 - Contract: 9 + contract: 9 + entryPoint: 3 properties: - Contract: + contract: format: int32 type: integer xml: name: Contract - EntryPoint: + entryPoint: format: int32 type: integer xml: name: EntryPoint + required: + - contract + - entryPoint type: object xml: name: CallTarget @@ -2401,7 +2444,7 @@ components: gasFeePolicy: gasFeeTokenId: gasFeeTokenId gasPerToken: 100 - validatorFeeShare: 0 + validatorFeeShare: 1 isActive: true maxBlobSize: 2000000 maxEventSize: 2000 @@ -2430,6 +2473,7 @@ components: description: The EVM chain ID example: 1074 format: int32 + minimum: 1 type: integer xml: name: EVMChainID @@ -2445,6 +2489,7 @@ components: description: The maximum contract blob size. example: 2000000 format: int32 + minimum: 1 type: integer xml: name: MaxBlobSize @@ -2452,6 +2497,7 @@ components: description: The maximum event size. example: 2000 format: int32 + minimum: 1 type: integer xml: name: MaxEventSize @@ -2459,9 +2505,19 @@ components: description: The maximum amount of events per request. example: 50 format: int32 + minimum: 1 type: integer xml: name: MaxEventsPerReq + required: + - chainID + - chainOwnerId + - description + - evmChainId + - isActive + - maxBlobSize + - maxEventSize + - maxEventsPerReq type: object xml: name: ChainInfoResponse @@ -2470,13 +2526,13 @@ components: outPublishGovernanceTransaction: lastMessage: txId: txId - messages: 7 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 inTxInclusionState: lastMessage: txId: txId state: state - messages: 2 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 inOnLedgerRequest: lastMessage: @@ -2494,13 +2550,13 @@ components: outputType: 0 raw: raw outputId: outputId - messages: 5 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 inAliasOutput: lastMessage: outputType: 0 raw: raw - messages: 6 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 inStateOutput: lastMessage: @@ -2508,21 +2564,21 @@ components: outputType: 0 raw: raw outputId: outputId - messages: 5 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 outPullTxInclusionState: lastMessage: txId: txId - messages: 2 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 outPullLatestOutput: lastMessage: lastMessage - messages: 9 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 outPullOutputByID: lastMessage: outputId: outputId - messages: 3 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: inAliasOutput: @@ -2543,6 +2599,16 @@ components: $ref: '#/components/schemas/UTXOInputMetricItem' outPullTxInclusionState: $ref: '#/components/schemas/TransactionIDMetricItem' + required: + - inAliasOutput + - inOnLedgerRequest + - inOutput + - inStateOutput + - inTxInclusionState + - outPublishGovernanceTransaction + - outPullLatestOutput + - outPullOutputByID + - outPullTxInclusionState type: object xml: name: ChainMetrics @@ -2641,6 +2707,13 @@ components: type: string xml: name: StateAddress + required: + - accessNodes + - active + - candidateNodes + - chainId + - committeeNodes + - stateAddress type: object xml: name: CommitteeInfoResponse @@ -2661,6 +2734,9 @@ components: name: AccessAPI node: $ref: '#/components/schemas/PeeringNodeStatusResponse' + required: + - accessAPI + - node type: object xml: name: CommitteeNode @@ -2681,6 +2757,9 @@ components: name: AccessAPI node: $ref: '#/components/schemas/PeeringNodeStatusResponse_' + required: + - accessAPI + - node type: object xml: name: CommitteeNode @@ -2717,6 +2796,12 @@ components: type: integer xml: name: EventVMResultMsgPipeSize + required: + - eventACSMsgPipeSize + - eventPeerLogIndexMsgPipeSize + - eventStateTransitionMsgPipeSize + - eventTimerMsgPipeSize + - eventVMResultMsgPipeSize type: object xml: name: ConsensusPipeMetrics @@ -2736,7 +2821,7 @@ components: timeTransactionPosted: 2000-01-23T04:56:07.000+00:00 flagTransactionSeen: true timeConsensusBatchKnown: 2000-01-23T04:56:07.000+00:00 - currentStateIndex: 0 + currentStateIndex: 1 flagInProgress: true flagBatchProposalSent: true flagTransactionFinalized: true @@ -2744,6 +2829,7 @@ components: currentStateIndex: description: Shows current state index of the consensus format: int32 + minimum: 1 type: integer xml: name: CurrentStateIndex @@ -2862,6 +2948,24 @@ components: type: string xml: name: TimeVMStarted + required: + - flagBatchProposalSent + - flagConsensusBatchKnown + - flagInProgress + - flagStateReceived + - flagTransactionFinalized + - flagTransactionPosted + - flagTransactionSeen + - flagVMResultSigned + - flagVMStarted + - timeBatchProposalSent + - timeCompleted + - timeConsensusBatchKnown + - timeTransactionFinalized + - timeTransactionPosted + - timeTransactionSeen + - timeVMResultSigned + - timeVMStarted type: object xml: name: ConsensusWorkflowMetrics @@ -2911,6 +3015,13 @@ components: type: string xml: name: FunctionName + required: + - arguments + - chainId + - contractHName + - contractName + - functionHName + - functionName type: object xml: name: ContractCallViewRequest @@ -2954,13 +3065,18 @@ components: xml: name: ProgramHash wrapped: true + required: + - description + - hName + - name + - programHash type: object xml: name: ContractInfoResponse ControlAddressesResponse: example: governingAddress: governingAddress - sinceBlockIndex: 0 + sinceBlockIndex: 1 stateAddress: stateAddress properties: governingAddress: @@ -2970,6 +3086,7 @@ components: name: GoverningAddress sinceBlockIndex: format: int32 + minimum: 1 type: integer xml: name: SinceBlockIndex @@ -2978,6 +3095,10 @@ components: type: string xml: name: StateAddress + required: + - governingAddress + - sinceBlockIndex + - stateAddress type: object xml: name: ControlAddressesResponse @@ -2990,9 +3111,9 @@ components: peerIdentities: - peerIdentities - peerIdentities - threshold: 6 + threshold: 1 publicKey: publicKey - peerIndex: 0 + peerIndex: 1 properties: address: description: New generated shared address. @@ -3011,6 +3132,7 @@ components: wrapped: true peerIndex: format: int32 + minimum: 1 type: integer xml: name: PeerIndex @@ -3031,9 +3153,17 @@ components: wrapped: true threshold: format: int32 + minimum: 1 type: integer xml: name: Threshold + required: + - address + - peerIdentities + - peerIndex + - publicKey + - publicKeyShares + - threshold type: object xml: name: DKSharesInfo @@ -3042,8 +3172,8 @@ components: peerIdentities: - peerIdentities - peerIdentities - timeoutMS: 6 - threshold: 0 + timeoutMS: 1 + threshold: 1 properties: peerIdentities: items: @@ -3056,27 +3186,35 @@ components: threshold: description: Should be =< len(PeerPublicIdentities) format: int32 + minimum: 1 type: integer xml: name: Threshold timeoutMS: description: Timeout in milliseconds. format: int32 + minimum: 1 type: integer xml: name: TimeoutMS + required: + - peerIdentities + - threshold + - timeoutMS type: object xml: name: DKSharesPostRequest ErrorMessageFormatResponse: example: - MessageFormat: MessageFormat + messageFormat: messageFormat properties: - MessageFormat: + messageFormat: format: string type: string xml: name: MessageFormat + required: + - messageFormat type: object xml: name: ErrorMessageFormatResponse @@ -3094,6 +3232,8 @@ components: xml: name: Events wrapped: true + required: + - events type: object xml: name: EventsResponse @@ -3115,6 +3255,9 @@ components: type: string xml: name: FoundryID + required: + - assets + - foundryId type: object xml: name: FoundryOutputResponse @@ -3139,6 +3282,9 @@ components: xml: name: NativeTokens wrapped: true + required: + - baseTokens + - nativeTokens type: object xml: name: FungibleTokens @@ -3193,6 +3339,14 @@ components: type: integer xml: name: MaxEventsPerReq + required: + - chainID + - chainOwnerId + - description + - gasFeePolicy + - maxBlobSize + - maxEventSize + - maxEventsPerReq type: object xml: name: GovChainInfoResponse @@ -3211,6 +3365,9 @@ components: type: string xml: name: OutputID + required: + - output + - outputId type: object xml: name: InOutput @@ -3221,13 +3378,14 @@ components: outputType: 0 raw: raw outputId: outputId - messages: 5 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/InOutput' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -3236,6 +3394,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: InOutputMetricItem @@ -3254,6 +3416,9 @@ components: type: string xml: name: OutputID + required: + - output + - outputId type: object xml: name: InStateOutput @@ -3264,13 +3429,14 @@ components: outputType: 0 raw: raw outputId: outputId - messages: 5 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/InStateOutput' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -3279,6 +3445,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: InStateOutputMetricItem @@ -3291,7 +3461,7 @@ components: vByteFactorData: 1 vByteCost: 500 vByteFactorKey: 10 - minPowScore: 0 + minPowScore: 1 tokenSupply: "2779530283277761" networkName: private_tangle1 belowMaxDepth: 15 @@ -3331,13 +3501,18 @@ components: type: string xml: name: Version + required: + - l1Params + - netID + - publicKey + - version type: object xml: name: InfoResponse InterfaceMetricItem: example: lastMessage: lastMessage - messages: 9 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: @@ -3347,6 +3522,7 @@ components: name: LastMessage messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -3355,6 +3531,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: InterfaceMetricItem @@ -3375,6 +3555,9 @@ components: type: string xml: name: Value + required: + - key + - value type: object xml: name: Item @@ -3397,6 +3580,9 @@ components: type: string xml: name: Value + required: + - key + - value type: object xml: name: Item @@ -3443,7 +3629,7 @@ components: vByteFactorData: 1 vByteCost: 500 vByteFactorKey: 10 - minPowScore: 0 + minPowScore: 1 tokenSupply: "2779530283277761" networkName: private_tangle1 belowMaxDepth: 15 @@ -3469,6 +3655,10 @@ components: name: MaxPayloadSize protocol: $ref: '#/components/schemas/ProtocolParameters' + required: + - baseToken + - maxPayloadSize + - protocol type: object xml: name: L1Params @@ -3499,6 +3689,11 @@ components: type: string xml: name: Owner + required: + - id + - issuer + - metadata + - owner type: object xml: name: NFTDataResponse @@ -3517,6 +3712,9 @@ components: type: string xml: name: ID + required: + - amount + - id type: object xml: name: NativeToken @@ -3534,6 +3732,8 @@ components: xml: name: NativeTokenRegistryIDs wrapped: true + required: + - nativeTokenRegistryIds type: object xml: name: NativeTokenIDRegistryResponse @@ -3554,6 +3754,9 @@ components: type: string xml: name: PublicKey + required: + - ownerAddress + - publicKey type: object xml: name: NodeOwnerCertificateRequest @@ -3575,6 +3778,9 @@ components: type: string xml: name: Request + required: + - chainId + - request type: object xml: name: OffLedgerRequest @@ -3607,6 +3813,11 @@ components: type: string xml: name: Raw + required: + - id + - output + - outputId + - raw type: object xml: name: OnLedgerRequest @@ -3626,6 +3837,7 @@ components: $ref: '#/components/schemas/OnLedgerRequest' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -3634,6 +3846,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: OnLedgerRequestMetricItem @@ -3654,6 +3870,9 @@ components: type: string xml: name: Raw + required: + - outputType + - raw type: object xml: name: Output @@ -3667,6 +3886,8 @@ components: type: string xml: name: OutputID + required: + - outputId type: object xml: name: OutputID @@ -3696,6 +3917,10 @@ components: type: string xml: name: PublicKey + required: + - isTrusted + - netId + - publicKey type: object xml: name: PeeringNodeIdentityResponse @@ -3736,6 +3961,12 @@ components: type: string xml: name: PublicKey + required: + - isAlive + - isTrusted + - netId + - numUsers + - publicKey type: object xml: name: PeeringNodeStatusResponse @@ -3781,6 +4012,12 @@ components: type: string xml: name: PublicKey + required: + - isAlive + - isTrusted + - netId + - numUsers + - publicKey type: object xml: name: PeeringNodeStatusResponse @@ -3803,6 +4040,9 @@ components: type: string xml: name: PublicKey + required: + - netId + - publicKey type: object xml: name: PeeringTrustRequest @@ -3812,7 +4052,7 @@ components: vByteFactorData: 1 vByteCost: 500 vByteFactorKey: 10 - minPowScore: 0 + minPowScore: 1 tokenSupply: "2779530283277761" networkName: private_tangle1 belowMaxDepth: 15 @@ -3830,12 +4070,14 @@ components: description: The networks max depth example: 15 format: int32 + minimum: 1 type: integer xml: name: BelowMaxDepth minPowScore: description: The minimal PoW score format: int32 + minimum: 1 type: integer xml: name: MinPoWScore @@ -3862,6 +4104,14 @@ components: type: integer xml: name: Version + required: + - bech32Hrp + - belowMaxDepth + - minPowScore + - networkName + - rentStructure + - tokenSupply + - version type: object xml: name: ProtocolParameters @@ -3888,6 +4138,7 @@ components: name: ErrorCode errorId: format: int32 + minimum: 1 type: integer xml: name: ErrorID @@ -3909,6 +4160,13 @@ components: xml: name: Parameters wrapped: true + required: + - contractId + - errorCode + - errorId + - message + - messageFormat + - parameters type: object xml: name: ReceiptError @@ -3920,8 +4178,8 @@ components: - GasBurned: 5 Code: 1 request: request - blockIndex: 0 - requestIndex: 7 + blockIndex: 1 + requestIndex: 1 gasFeeCharged: 2 gasBudget: 5 gasBurned: 5 @@ -3937,6 +4195,7 @@ components: properties: blockIndex: format: int32 + minimum: 1 type: integer xml: name: BlockIndex @@ -3971,9 +4230,18 @@ components: name: Request requestIndex: format: int32 + minimum: 1 type: integer xml: name: RequestIndex + required: + - blockIndex + - gasBudget + - gasBurnLog + - gasBurned + - gasFeeCharged + - request + - requestIndex type: object xml: name: ReceiptResponse @@ -3987,6 +4255,7 @@ components: description: The virtual byte cost example: 500 format: int32 + minimum: 1 type: integer xml: name: VByteCost @@ -4004,6 +4273,10 @@ components: type: integer xml: name: VBFactorKey + required: + - vByteCost + - vByteFactorData + - vByteFactorKey type: object xml: name: RentStructure @@ -4021,8 +4294,8 @@ components: gasGudget: 2 requestId: requestId callTarget: - EntryPoint: 3 - Contract: 9 + contract: 9 + entryPoint: 3 targetAddress: targetAddress allowance: fungibleTokens: @@ -4088,6 +4361,18 @@ components: type: string xml: name: TargetAddress + required: + - allowance + - callTarget + - fungibleTokens + - gasGudget + - isEVM + - isOffLedger + - nft + - params + - requestId + - senderAccount + - targetAddress type: object xml: name: RequestDetail @@ -4105,6 +4390,8 @@ components: xml: name: RequestIDs wrapped: true + required: + - requestIds type: object xml: name: RequestIDsResponse @@ -4129,6 +4416,10 @@ components: type: string xml: name: RequestID + required: + - chainId + - isProcessed + - requestId type: object xml: name: RequestProcessedResponse @@ -4153,8 +4444,8 @@ components: gasGudget: 2 requestId: requestId callTarget: - EntryPoint: 3 - Contract: 9 + contract: 9 + entryPoint: 3 targetAddress: targetAddress allowance: fungibleTokens: @@ -4179,8 +4470,8 @@ components: id: id issuer: issuer isEVM: true - blockIndex: 0 - requestIndex: 4 + blockIndex: 1 + requestIndex: 1 gasFeeCharged: 2 gasBudget: 6 gasBurned: 5 @@ -4190,6 +4481,7 @@ components: properties: blockIndex: format: int32 + minimum: 1 type: integer xml: name: BlockIndex @@ -4216,12 +4508,37 @@ components: $ref: '#/components/schemas/RequestDetail' requestIndex: format: int32 + minimum: 1 type: integer xml: name: RequestIndex + required: + - blockIndex + - error + - gasBudget + - gasBurnLog + - gasBurned + - gasFeeCharged + - request + - requestIndex type: object xml: name: RequestReceiptResponse + StateResponse: + example: + state: state + properties: + state: + description: The state of the requested key (Hex-encoded) + format: string + type: string + xml: + name: State + required: + - state + type: object + xml: + name: StateResponse Transaction: example: txId: txId @@ -4232,6 +4549,8 @@ components: type: string xml: name: TransactionID + required: + - txId type: object xml: name: Transaction @@ -4239,13 +4558,14 @@ components: example: lastMessage: txId: txId - messages: 2 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/Transaction' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -4254,6 +4574,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: TransactionIDMetricItem @@ -4261,13 +4585,14 @@ components: example: lastMessage: txId: txId - messages: 7 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/Transaction' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -4276,6 +4601,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: TransactionMetricItem @@ -4296,6 +4625,9 @@ components: type: string xml: name: TransactionID + required: + - state + - txId type: object xml: name: TxInclusionStateMsg @@ -4304,13 +4636,14 @@ components: lastMessage: txId: txId state: state - messages: 2 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/TxInclusionStateMsg' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -4319,6 +4652,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: TxInclusionStateMsgMetricItem @@ -4326,13 +4663,14 @@ components: example: lastMessage: outputId: outputId - messages: 3 + messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: lastMessage: $ref: '#/components/schemas/OutputID' messages: format: int32 + minimum: 1 type: integer xml: name: Messages @@ -4341,6 +4679,10 @@ components: type: string xml: name: Timestamp + required: + - lastMessage + - messages + - timestamp type: object xml: name: UTXOInputMetricItem @@ -4353,6 +4695,8 @@ components: type: string xml: name: Password + required: + - password type: object xml: name: UpdateUserPasswordRequest @@ -4370,6 +4714,8 @@ components: xml: name: Permissions wrapped: true + required: + - permissions type: object xml: name: UpdateUserPermissionsRequest @@ -4393,21 +4739,27 @@ components: type: string xml: name: Username + required: + - permissions + - username type: object xml: name: User ValidationError: properties: - Error: + error: format: string type: string xml: name: Error - MissingPermission: + missingPermission: format: string type: string xml: name: MissingPermission + required: + - error + - missingPermission type: object xml: name: ValidationError @@ -4415,7 +4767,7 @@ components: example: gasFeeTokenId: gasFeeTokenId gasPerToken: 100 - validatorFeeShare: 0 + validatorFeeShare: 1 properties: gasFeeTokenId: description: The gas fee token id. Empty if base token. @@ -4433,9 +4785,14 @@ components: validatorFeeShare: description: The validator fee share. format: int32 + minimum: 1 type: integer xml: name: ValidatorFeeShare + required: + - gasFeeTokenId + - gasPerToken + - validatorFeeShare type: object xml: name: gasFeePolicy @@ -4463,6 +4820,10 @@ components: type: integer xml: name: ValidatorFeeShare + required: + - gasFeeTokenId + - gasPerToken + - validatorFeeShare type: object xml: name: gasFeePolicy diff --git a/client/api_chains.go b/clients/apiclient/api_chains.go similarity index 94% rename from client/api_chains.go rename to clients/apiclient/api_chains.go index d8b4a15f95..94831f2095 100644 --- a/client/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "bytes" @@ -62,7 +62,7 @@ func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*htt } localVarPath := localBasePath + "/chains/{chainID}/activate" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -128,8 +128,8 @@ func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*htt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -179,8 +179,8 @@ func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*htt } localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterToString(r.publicKey, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -246,8 +246,8 @@ func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*htt newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -293,8 +293,8 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/ws" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/ws" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -384,7 +384,7 @@ func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) ( } localVarPath := localBasePath + "/chains/{chainID}/deactivate" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -450,8 +450,8 @@ func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) ( newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -500,7 +500,7 @@ func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*Chain } localVarPath := localBasePath + "/chains/{chainID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -566,8 +566,8 @@ func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*Chain newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -687,8 +687,8 @@ func (a *ChainsApiService) GetChainsExecute(r ApiGetChainsRequest) ([]ChainInfoR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -746,7 +746,7 @@ func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) } localVarPath := localBasePath + "/chains/{chainID}/committee" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -812,8 +812,8 @@ func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -871,7 +871,7 @@ func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]Cont } localVarPath := localBasePath + "/chains/{chainID}/contracts" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -937,8 +937,8 @@ func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]Cont newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -998,9 +998,9 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/evm/tx/{txHash}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterToString(r.txHash, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/evm/tx/{txHash}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1052,8 +1052,8 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1077,7 +1077,7 @@ type ApiGetStateValueRequest struct { stateKey string } -func (r ApiGetStateValueRequest) Execute() ([]int32, *http.Response, error) { +func (r ApiGetStateValueRequest) Execute() (*StateResponse, *http.Response, error) { return r.ApiService.GetStateValueExecute(r) } @@ -1099,13 +1099,13 @@ func (a *ChainsApiService) GetStateValue(ctx context.Context, chainID string, st } // Execute executes the request -// @return []int32 -func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) ([]int32, *http.Response, error) { +// @return StateResponse +func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) (*StateResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue []int32 + localVarReturnValue *StateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetStateValue") @@ -1113,9 +1113,9 @@ func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) ([]in return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/state/{stateKey}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterToString(r.stateKey, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/state/{stateKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterValueToString(r.stateKey, "stateKey")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1217,8 +1217,8 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) } localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterToString(r.publicKey, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1284,8 +1284,8 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/client/api_corecontracts.go b/clients/apiclient/api_corecontracts.go similarity index 92% rename from client/api_corecontracts.go rename to clients/apiclient/api_corecontracts.go index fa6d2ce916..ce07e36354 100644 --- a/client/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "bytes" @@ -66,9 +66,9 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/balance" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterToString(r.agentID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/balance" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -120,8 +120,8 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -181,9 +181,9 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nfts" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterToString(r.agentID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nfts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -235,8 +235,8 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -296,9 +296,9 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nonce" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterToString(r.agentID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nonce" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -350,8 +350,8 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -408,8 +408,8 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -461,8 +461,8 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -522,9 +522,9 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/foundry_output" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"chainID_"+"}", url.PathEscape(parameterToString(r.chainID2, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/foundry_output" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID_"+"}", url.PathEscape(parameterValueToString(r.chainID2, "chainID2")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -576,8 +576,8 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -637,9 +637,9 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/nftdata" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterToString(r.nftID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/nftdata" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterValueToString(r.nftID, "nftID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -691,8 +691,8 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -749,8 +749,8 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/token_registry" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/token_registry" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -802,8 +802,8 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -860,8 +860,8 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/total_assets" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/total_assets" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -913,8 +913,8 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -971,8 +971,8 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blobs" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1024,8 +1024,8 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1085,9 +1085,9 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterToString(r.blobHash, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1139,8 +1139,8 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1203,10 +1203,10 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterToString(r.blobHash, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterToString(r.fieldKey, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterValueToString(r.fieldKey, "fieldKey")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1258,8 +1258,8 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1319,9 +1319,9 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1373,8 +1373,8 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1431,8 +1431,8 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/controladdresses" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/controladdresses" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1484,8 +1484,8 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1545,9 +1545,9 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/{blockIndex}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1599,8 +1599,8 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1660,9 +1660,9 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterToString(r.contractHname, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/contract/{contractHname}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1714,8 +1714,8 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1772,8 +1772,8 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/latest" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/latest" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1825,8 +1825,8 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1886,9 +1886,9 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/request/{requestID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/request/{requestID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1940,8 +1940,8 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1998,8 +1998,8 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2051,8 +2051,8 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2112,9 +2112,9 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2166,8 +2166,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2224,8 +2224,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/requestids" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/requestids" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2277,8 +2277,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2338,9 +2338,9 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2392,8 +2392,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2453,9 +2453,9 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2507,8 +2507,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2568,9 +2568,9 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterToString(r.blockIndex, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2622,8 +2622,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2680,8 +2680,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/receipts" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/receipts" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2733,8 +2733,8 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2797,10 +2797,10 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterToString(r.contractHname, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterToString(r.errorID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterValueToString(r.errorID, "errorID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2852,8 +2852,8 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -2912,8 +2912,8 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/chaininfo" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/core/governance/chaininfo" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2965,8 +2965,8 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/client/api_metrics.go b/clients/apiclient/api_metrics.go similarity index 95% rename from client/api_metrics.go rename to clients/apiclient/api_metrics.go index e6bba4fc99..0e17605fce 100644 --- a/client/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "bytes" @@ -64,7 +64,7 @@ func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) } localVarPath := localBasePath + "/metrics/chain/{chainID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -130,8 +130,8 @@ func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -189,7 +189,7 @@ func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsR } localVarPath := localBasePath + "/metrics/chain/{chainID}/pipe" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -255,8 +255,8 @@ func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -314,7 +314,7 @@ func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflow } localVarPath := localBasePath + "/metrics/chain/{chainID}/workflow" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -380,8 +380,8 @@ func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflow newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -501,8 +501,8 @@ func (a *MetricsApiService) GetL1MetricsExecute(r ApiGetL1MetricsRequest) (*Chai newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/client/api_node.go b/clients/apiclient/api_node.go similarity index 96% rename from client/api_node.go rename to clients/apiclient/api_node.go index e1ff44f296..b742160200 100644 --- a/client/api_node.go +++ b/clients/apiclient/api_node.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "bytes" @@ -136,8 +136,8 @@ func (a *NodeApiService) DistrustPeerExecute(r ApiDistrustPeerRequest) (*http.Re newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -260,8 +260,8 @@ func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesP newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -381,8 +381,8 @@ func (a *NodeApiService) GetAllPeersExecute(r ApiGetAllPeersRequest) ([]PeeringN newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -502,8 +502,8 @@ func (a *NodeApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) ( newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -561,7 +561,7 @@ func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInf } localVarPath := localBasePath + "/node/dks/{sharedAddress}" - localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterToString(r.sharedAddress, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -627,8 +627,8 @@ func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInf newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -748,8 +748,8 @@ func (a *NodeApiService) GetInfoExecute(r ApiGetInfoRequest) (*InfoResponse, *ht newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -869,8 +869,8 @@ func (a *NodeApiService) GetPeeringIdentityExecute(r ApiGetPeeringIdentityReques newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -990,8 +990,8 @@ func (a *NodeApiService) GetTrustedPeersExecute(r ApiGetTrustedPeersRequest) ([] newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1045,7 +1045,7 @@ func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (string, *htt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/version" + localVarPath := localBasePath + "/node/version" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1218,8 +1218,8 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Re newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1328,8 +1328,8 @@ func (a *NodeApiService) ShutdownNodeExecute(r ApiShutdownNodeRequest) (*http.Re newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -1450,8 +1450,8 @@ func (a *NodeApiService) TrustPeerExecute(r ApiTrustPeerRequest) (*http.Response newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } diff --git a/client/api_requests.go b/clients/apiclient/api_requests.go similarity index 93% rename from client/api_requests.go rename to clients/apiclient/api_requests.go index 47767d55fa..f19d85a6d9 100644 --- a/client/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "bytes" @@ -69,11 +69,14 @@ func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, * return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/requests/callview" + localVarPath := localBasePath + "/requests/callview" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.contractCallViewRequest == nil { + return localVarReturnValue, nil, reportError("contractCallViewRequest is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -174,9 +177,9 @@ func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*Receipt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/receipts/{requestID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/receipts/{requestID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -278,11 +281,14 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/requests/offledger" + localVarPath := localBasePath + "/requests/offledger" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.offLedgerRequest == nil { + return nil, reportError("offLedgerRequest is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -374,9 +380,9 @@ func (a *RequestsApiService) WaitForTransactionExecute(r ApiWaitForTransactionRe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/requests/{requestID}/wait" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterToString(r.chainID, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterToString(r.requestID, "")), -1) + localVarPath := localBasePath + "/chains/{chainID}/requests/{requestID}/wait" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/client/api_users.go b/clients/apiclient/api_users.go similarity index 95% rename from client/api_users.go rename to clients/apiclient/api_users.go index 2e08fefdee..168e6cfd63 100644 --- a/client/api_users.go +++ b/clients/apiclient/api_users.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "bytes" @@ -136,8 +136,8 @@ func (a *UsersApiService) AddUserExecute(r ApiAddUserRequest) (*http.Response, e newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -191,7 +191,7 @@ func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordReque } localVarPath := localBasePath + "/users/{username}/password" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -262,8 +262,8 @@ func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordReque newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -317,7 +317,7 @@ func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermission } localVarPath := localBasePath + "/users/{username}/permissions" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -388,8 +388,8 @@ func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermission newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -436,7 +436,7 @@ func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respo } localVarPath := localBasePath + "/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -502,8 +502,8 @@ func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respo newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } return localVarHTTPResponse, newErr @@ -553,7 +553,7 @@ func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Resp } localVarPath := localBasePath + "/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -619,8 +619,8 @@ func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Resp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } return localVarReturnValue, localVarHTTPResponse, newErr @@ -741,8 +741,8 @@ func (a *UsersApiService) GetUsersExecute(r ApiGetUsersRequest) ([]User, *http.R newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go new file mode 100644 index 0000000000..49560be886 --- /dev/null +++ b/clients/apiclient/client.go @@ -0,0 +1,670 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Wasp API API v0.4.0-alpha.2-403-g907bc6c54 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + ChainsApi *ChainsApiService + + CorecontractsApi *CorecontractsApiService + + MetricsApi *MetricsApiService + + NodeApi *NodeApiService + + RequestsApi *RequestsApiService + + UsersApi *UsersApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ChainsApi = (*ChainsApiService)(&c.common) + c.CorecontractsApi = (*CorecontractsApiService)(&c.common) + c.MetricsApi = (*MetricsApiService)(&c.common) + c.NodeApi = (*NodeApiService)(&c.common) + c.RequestsApi = (*RequestsApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToQuery adds the provided object to the url query supporting deep object syntax +func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/client/configuration.go b/clients/apiclient/configuration.go similarity index 91% rename from client/configuration.go rename to clients/apiclient/configuration.go index 8d3da82167..3d39f8019e 100644 --- a/client/configuration.go +++ b/clients/apiclient/configuration.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "context" @@ -28,21 +28,9 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - // ContextAPIKeys takes a string apikey as authentication for the request ContextAPIKeys = contextKey("apiKeys") - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") diff --git a/client/docs/AccountListResponse.md b/clients/apiclient/docs/AccountListResponse.md similarity index 86% rename from client/docs/AccountListResponse.md rename to clients/apiclient/docs/AccountListResponse.md index d6590e916a..66097fb424 100644 --- a/client/docs/AccountListResponse.md +++ b/clients/apiclient/docs/AccountListResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Accounts** | Pointer to **[]string** | | [optional] +**Accounts** | **[]string** | | ## Methods ### NewAccountListResponse -`func NewAccountListResponse() *AccountListResponse` +`func NewAccountListResponse(accounts []string, ) *AccountListResponse` NewAccountListResponse instantiates a new AccountListResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetAccounts sets Accounts field to given value. -### HasAccounts - -`func (o *AccountListResponse) HasAccounts() bool` - -HasAccounts returns a boolean if a field has been set. [[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/client/docs/AccountNFTsResponse.md b/clients/apiclient/docs/AccountNFTsResponse.md similarity index 86% rename from client/docs/AccountNFTsResponse.md rename to clients/apiclient/docs/AccountNFTsResponse.md index beb8d43119..7453d48a7f 100644 --- a/client/docs/AccountNFTsResponse.md +++ b/clients/apiclient/docs/AccountNFTsResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NftIds** | Pointer to **[]string** | | [optional] +**NftIds** | **[]string** | | ## Methods ### NewAccountNFTsResponse -`func NewAccountNFTsResponse() *AccountNFTsResponse` +`func NewAccountNFTsResponse(nftIds []string, ) *AccountNFTsResponse` NewAccountNFTsResponse instantiates a new AccountNFTsResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetNftIds sets NftIds field to given value. -### HasNftIds - -`func (o *AccountNFTsResponse) HasNftIds() bool` - -HasNftIds returns a boolean if a field has been set. [[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/client/docs/AccountNonceResponse.md b/clients/apiclient/docs/AccountNonceResponse.md similarity index 86% rename from client/docs/AccountNonceResponse.md rename to clients/apiclient/docs/AccountNonceResponse.md index 1d45c3c5c0..389338b59d 100644 --- a/client/docs/AccountNonceResponse.md +++ b/clients/apiclient/docs/AccountNonceResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Nonce** | Pointer to **int64** | | [optional] +**Nonce** | **int64** | | ## Methods ### NewAccountNonceResponse -`func NewAccountNonceResponse() *AccountNonceResponse` +`func NewAccountNonceResponse(nonce int64, ) *AccountNonceResponse` NewAccountNonceResponse instantiates a new AccountNonceResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetNonce sets Nonce field to given value. -### HasNonce - -`func (o *AccountNonceResponse) HasNonce() bool` - -HasNonce returns a boolean if a field has been set. [[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/client/docs/AddUserRequest.md b/clients/apiclient/docs/AddUserRequest.md similarity index 80% rename from client/docs/AddUserRequest.md rename to clients/apiclient/docs/AddUserRequest.md index 9d8c8ce6b5..41fe61baeb 100644 --- a/client/docs/AddUserRequest.md +++ b/clients/apiclient/docs/AddUserRequest.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Password** | Pointer to **string** | | [optional] -**Permissions** | Pointer to **[]string** | | [optional] -**Username** | Pointer to **string** | | [optional] +**Password** | **string** | | +**Permissions** | **[]string** | | +**Username** | **string** | | ## Methods ### NewAddUserRequest -`func NewAddUserRequest() *AddUserRequest` +`func NewAddUserRequest(password string, permissions []string, username string, ) *AddUserRequest` NewAddUserRequest instantiates a new AddUserRequest object This constructor will assign default values to properties that have it defined, @@ -46,11 +46,6 @@ and a boolean to check if the value has been set. SetPassword sets Password field to given value. -### HasPassword - -`func (o *AddUserRequest) HasPassword() bool` - -HasPassword returns a boolean if a field has been set. ### GetPermissions @@ -71,11 +66,6 @@ and a boolean to check if the value has been set. SetPermissions sets Permissions field to given value. -### HasPermissions - -`func (o *AddUserRequest) HasPermissions() bool` - -HasPermissions returns a boolean if a field has been set. ### GetUsername @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetUsername sets Username field to given value. -### HasUsername - -`func (o *AddUserRequest) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. [[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/client/docs/AliasOutputMetricItem.md b/clients/apiclient/docs/AliasOutputMetricItem.md similarity index 74% rename from client/docs/AliasOutputMetricItem.md rename to clients/apiclient/docs/AliasOutputMetricItem.md index 4044254ee3..2f5093a32a 100644 --- a/client/docs/AliasOutputMetricItem.md +++ b/clients/apiclient/docs/AliasOutputMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**Output**](Output.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**Output**](Output.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewAliasOutputMetricItem -`func NewAliasOutputMetricItem() *AliasOutputMetricItem` +`func NewAliasOutputMetricItem(lastMessage Output, messages uint32, timestamp time.Time, ) *AliasOutputMetricItem` NewAliasOutputMetricItem instantiates a new AliasOutputMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *AliasOutputMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *AliasOutputMetricItem) GetMessages() int32` +`func (o *AliasOutputMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *AliasOutputMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *AliasOutputMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *AliasOutputMetricItem) SetMessages(v int32)` +`func (o *AliasOutputMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *AliasOutputMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *AliasOutputMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/Allowance.md b/clients/apiclient/docs/Allowance.md similarity index 81% rename from client/docs/Allowance.md rename to clients/apiclient/docs/Allowance.md index 0cbb0b934a..afe478f6d6 100644 --- a/client/docs/Allowance.md +++ b/clients/apiclient/docs/Allowance.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FungibleTokens** | Pointer to [**FungibleTokens**](FungibleTokens.md) | | [optional] -**Nfts** | Pointer to **[]string** | | [optional] +**FungibleTokens** | [**FungibleTokens**](FungibleTokens.md) | | +**Nfts** | **[]string** | | ## Methods ### NewAllowance -`func NewAllowance() *Allowance` +`func NewAllowance(fungibleTokens FungibleTokens, nfts []string, ) *Allowance` NewAllowance instantiates a new Allowance object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetFungibleTokens sets FungibleTokens field to given value. -### HasFungibleTokens - -`func (o *Allowance) HasFungibleTokens() bool` - -HasFungibleTokens returns a boolean if a field has been set. ### GetNfts @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetNfts sets Nfts field to given value. -### HasNfts - -`func (o *Allowance) HasNfts() bool` - -HasNfts returns a boolean if a field has been set. [[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/client/docs/AssetsResponse.md b/clients/apiclient/docs/AssetsResponse.md similarity index 81% rename from client/docs/AssetsResponse.md rename to clients/apiclient/docs/AssetsResponse.md index 943a2bcbd0..c4e70f1eb5 100644 --- a/client/docs/AssetsResponse.md +++ b/clients/apiclient/docs/AssetsResponse.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BaseTokens** | Pointer to **int64** | | [optional] -**NativeTokens** | Pointer to [**[]NativeToken**](NativeToken.md) | | [optional] +**BaseTokens** | **int64** | | +**NativeTokens** | [**[]NativeToken**](NativeToken.md) | | ## Methods ### NewAssetsResponse -`func NewAssetsResponse() *AssetsResponse` +`func NewAssetsResponse(baseTokens int64, nativeTokens []NativeToken, ) *AssetsResponse` NewAssetsResponse instantiates a new AssetsResponse object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetBaseTokens sets BaseTokens field to given value. -### HasBaseTokens - -`func (o *AssetsResponse) HasBaseTokens() bool` - -HasBaseTokens returns a boolean if a field has been set. ### GetNativeTokens @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetNativeTokens sets NativeTokens field to given value. -### HasNativeTokens - -`func (o *AssetsResponse) HasNativeTokens() bool` - -HasNativeTokens returns a boolean if a field has been set. [[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/client/docs/BaseToken.md b/clients/apiclient/docs/BaseToken.md similarity index 100% rename from client/docs/BaseToken.md rename to clients/apiclient/docs/BaseToken.md diff --git a/client/docs/Blob.md b/clients/apiclient/docs/Blob.md similarity index 100% rename from client/docs/Blob.md rename to clients/apiclient/docs/Blob.md diff --git a/client/docs/BlobInfoResponse.md b/clients/apiclient/docs/BlobInfoResponse.md similarity index 100% rename from client/docs/BlobInfoResponse.md rename to clients/apiclient/docs/BlobInfoResponse.md diff --git a/client/docs/BlobListResponse.md b/clients/apiclient/docs/BlobListResponse.md similarity index 100% rename from client/docs/BlobListResponse.md rename to clients/apiclient/docs/BlobListResponse.md diff --git a/client/docs/BlobValueResponse.md b/clients/apiclient/docs/BlobValueResponse.md similarity index 100% rename from client/docs/BlobValueResponse.md rename to clients/apiclient/docs/BlobValueResponse.md diff --git a/client/docs/BlockInfoResponse.md b/clients/apiclient/docs/BlockInfoResponse.md similarity index 69% rename from client/docs/BlockInfoResponse.md rename to clients/apiclient/docs/BlockInfoResponse.md index f64ece5be9..2ceb8eb0f6 100644 --- a/client/docs/BlockInfoResponse.md +++ b/clients/apiclient/docs/BlockInfoResponse.md @@ -4,25 +4,25 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AnchorTransactionId** | Pointer to **string** | | [optional] -**BlockIndex** | Pointer to **int32** | | [optional] -**GasBurned** | Pointer to **int64** | | [optional] -**GasFeeCharged** | Pointer to **int64** | | [optional] -**L1CommitmentHash** | Pointer to **string** | | [optional] -**NumOffLedgerRequests** | Pointer to **int32** | | [optional] -**NumSuccessfulRequests** | Pointer to **int32** | | [optional] -**PreviousL1CommitmentHash** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] -**TotalBaseTokensInL2Accounts** | Pointer to **int64** | | [optional] -**TotalRequests** | Pointer to **int32** | | [optional] -**TotalStorageDeposit** | Pointer to **int64** | | [optional] -**TransactionSubEssenceHash** | Pointer to **string** | | [optional] +**AnchorTransactionId** | **string** | | +**BlockIndex** | **uint32** | | +**GasBurned** | **int64** | | +**GasFeeCharged** | **int64** | | +**L1CommitmentHash** | **string** | | +**NumOffLedgerRequests** | **uint32** | | +**NumSuccessfulRequests** | **uint32** | | +**PreviousL1CommitmentHash** | **string** | | +**Timestamp** | **time.Time** | | +**TotalBaseTokensInL2Accounts** | **int64** | | +**TotalRequests** | **uint32** | | +**TotalStorageDeposit** | **int64** | | +**TransactionSubEssenceHash** | **string** | | ## Methods ### NewBlockInfoResponse -`func NewBlockInfoResponse() *BlockInfoResponse` +`func NewBlockInfoResponse(anchorTransactionId string, blockIndex uint32, gasBurned int64, gasFeeCharged int64, l1CommitmentHash string, numOffLedgerRequests uint32, numSuccessfulRequests uint32, previousL1CommitmentHash string, timestamp time.Time, totalBaseTokensInL2Accounts int64, totalRequests uint32, totalStorageDeposit int64, transactionSubEssenceHash string, ) *BlockInfoResponse` NewBlockInfoResponse instantiates a new BlockInfoResponse object This constructor will assign default values to properties that have it defined, @@ -56,36 +56,26 @@ and a boolean to check if the value has been set. SetAnchorTransactionId sets AnchorTransactionId field to given value. -### HasAnchorTransactionId - -`func (o *BlockInfoResponse) HasAnchorTransactionId() bool` - -HasAnchorTransactionId returns a boolean if a field has been set. ### GetBlockIndex -`func (o *BlockInfoResponse) GetBlockIndex() int32` +`func (o *BlockInfoResponse) GetBlockIndex() uint32` GetBlockIndex returns the BlockIndex field if non-nil, zero value otherwise. ### GetBlockIndexOk -`func (o *BlockInfoResponse) GetBlockIndexOk() (*int32, bool)` +`func (o *BlockInfoResponse) GetBlockIndexOk() (*uint32, bool)` GetBlockIndexOk returns a tuple with the BlockIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBlockIndex -`func (o *BlockInfoResponse) SetBlockIndex(v int32)` +`func (o *BlockInfoResponse) SetBlockIndex(v uint32)` SetBlockIndex sets BlockIndex field to given value. -### HasBlockIndex - -`func (o *BlockInfoResponse) HasBlockIndex() bool` - -HasBlockIndex returns a boolean if a field has been set. ### GetGasBurned @@ -106,11 +96,6 @@ and a boolean to check if the value has been set. SetGasBurned sets GasBurned field to given value. -### HasGasBurned - -`func (o *BlockInfoResponse) HasGasBurned() bool` - -HasGasBurned returns a boolean if a field has been set. ### GetGasFeeCharged @@ -131,11 +116,6 @@ and a boolean to check if the value has been set. SetGasFeeCharged sets GasFeeCharged field to given value. -### HasGasFeeCharged - -`func (o *BlockInfoResponse) HasGasFeeCharged() bool` - -HasGasFeeCharged returns a boolean if a field has been set. ### GetL1CommitmentHash @@ -156,61 +136,46 @@ and a boolean to check if the value has been set. SetL1CommitmentHash sets L1CommitmentHash field to given value. -### HasL1CommitmentHash - -`func (o *BlockInfoResponse) HasL1CommitmentHash() bool` - -HasL1CommitmentHash returns a boolean if a field has been set. ### GetNumOffLedgerRequests -`func (o *BlockInfoResponse) GetNumOffLedgerRequests() int32` +`func (o *BlockInfoResponse) GetNumOffLedgerRequests() uint32` GetNumOffLedgerRequests returns the NumOffLedgerRequests field if non-nil, zero value otherwise. ### GetNumOffLedgerRequestsOk -`func (o *BlockInfoResponse) GetNumOffLedgerRequestsOk() (*int32, bool)` +`func (o *BlockInfoResponse) GetNumOffLedgerRequestsOk() (*uint32, bool)` GetNumOffLedgerRequestsOk returns a tuple with the NumOffLedgerRequests field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNumOffLedgerRequests -`func (o *BlockInfoResponse) SetNumOffLedgerRequests(v int32)` +`func (o *BlockInfoResponse) SetNumOffLedgerRequests(v uint32)` SetNumOffLedgerRequests sets NumOffLedgerRequests field to given value. -### HasNumOffLedgerRequests - -`func (o *BlockInfoResponse) HasNumOffLedgerRequests() bool` - -HasNumOffLedgerRequests returns a boolean if a field has been set. ### GetNumSuccessfulRequests -`func (o *BlockInfoResponse) GetNumSuccessfulRequests() int32` +`func (o *BlockInfoResponse) GetNumSuccessfulRequests() uint32` GetNumSuccessfulRequests returns the NumSuccessfulRequests field if non-nil, zero value otherwise. ### GetNumSuccessfulRequestsOk -`func (o *BlockInfoResponse) GetNumSuccessfulRequestsOk() (*int32, bool)` +`func (o *BlockInfoResponse) GetNumSuccessfulRequestsOk() (*uint32, bool)` GetNumSuccessfulRequestsOk returns a tuple with the NumSuccessfulRequests field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNumSuccessfulRequests -`func (o *BlockInfoResponse) SetNumSuccessfulRequests(v int32)` +`func (o *BlockInfoResponse) SetNumSuccessfulRequests(v uint32)` SetNumSuccessfulRequests sets NumSuccessfulRequests field to given value. -### HasNumSuccessfulRequests - -`func (o *BlockInfoResponse) HasNumSuccessfulRequests() bool` - -HasNumSuccessfulRequests returns a boolean if a field has been set. ### GetPreviousL1CommitmentHash @@ -231,11 +196,6 @@ and a boolean to check if the value has been set. SetPreviousL1CommitmentHash sets PreviousL1CommitmentHash field to given value. -### HasPreviousL1CommitmentHash - -`func (o *BlockInfoResponse) HasPreviousL1CommitmentHash() bool` - -HasPreviousL1CommitmentHash returns a boolean if a field has been set. ### GetTimestamp @@ -256,11 +216,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *BlockInfoResponse) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. ### GetTotalBaseTokensInL2Accounts @@ -281,36 +236,26 @@ and a boolean to check if the value has been set. SetTotalBaseTokensInL2Accounts sets TotalBaseTokensInL2Accounts field to given value. -### HasTotalBaseTokensInL2Accounts - -`func (o *BlockInfoResponse) HasTotalBaseTokensInL2Accounts() bool` - -HasTotalBaseTokensInL2Accounts returns a boolean if a field has been set. ### GetTotalRequests -`func (o *BlockInfoResponse) GetTotalRequests() int32` +`func (o *BlockInfoResponse) GetTotalRequests() uint32` GetTotalRequests returns the TotalRequests field if non-nil, zero value otherwise. ### GetTotalRequestsOk -`func (o *BlockInfoResponse) GetTotalRequestsOk() (*int32, bool)` +`func (o *BlockInfoResponse) GetTotalRequestsOk() (*uint32, bool)` GetTotalRequestsOk returns a tuple with the TotalRequests field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTotalRequests -`func (o *BlockInfoResponse) SetTotalRequests(v int32)` +`func (o *BlockInfoResponse) SetTotalRequests(v uint32)` SetTotalRequests sets TotalRequests field to given value. -### HasTotalRequests - -`func (o *BlockInfoResponse) HasTotalRequests() bool` - -HasTotalRequests returns a boolean if a field has been set. ### GetTotalStorageDeposit @@ -331,11 +276,6 @@ and a boolean to check if the value has been set. SetTotalStorageDeposit sets TotalStorageDeposit field to given value. -### HasTotalStorageDeposit - -`func (o *BlockInfoResponse) HasTotalStorageDeposit() bool` - -HasTotalStorageDeposit returns a boolean if a field has been set. ### GetTransactionSubEssenceHash @@ -356,11 +296,6 @@ and a boolean to check if the value has been set. SetTransactionSubEssenceHash sets TransactionSubEssenceHash field to given value. -### HasTransactionSubEssenceHash - -`func (o *BlockInfoResponse) HasTransactionSubEssenceHash() bool` - -HasTransactionSubEssenceHash returns a boolean if a field has been set. [[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/client/docs/BlockReceiptError.md b/clients/apiclient/docs/BlockReceiptError.md similarity index 82% rename from client/docs/BlockReceiptError.md rename to clients/apiclient/docs/BlockReceiptError.md index 90f64c331a..b827da6f7f 100644 --- a/client/docs/BlockReceiptError.md +++ b/clients/apiclient/docs/BlockReceiptError.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ErrorMessage** | Pointer to **string** | | [optional] -**Hash** | Pointer to **string** | | [optional] +**ErrorMessage** | **string** | | +**Hash** | **string** | | ## Methods ### NewBlockReceiptError -`func NewBlockReceiptError() *BlockReceiptError` +`func NewBlockReceiptError(errorMessage string, hash string, ) *BlockReceiptError` NewBlockReceiptError instantiates a new BlockReceiptError object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetErrorMessage sets ErrorMessage field to given value. -### HasErrorMessage - -`func (o *BlockReceiptError) HasErrorMessage() bool` - -HasErrorMessage returns a boolean if a field has been set. ### GetHash @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetHash sets Hash field to given value. -### HasHash - -`func (o *BlockReceiptError) HasHash() bool` - -HasHash returns a boolean if a field has been set. [[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/client/docs/BlockReceiptsResponse.md b/clients/apiclient/docs/BlockReceiptsResponse.md similarity index 84% rename from client/docs/BlockReceiptsResponse.md rename to clients/apiclient/docs/BlockReceiptsResponse.md index 8594b36bcf..538591dec8 100644 --- a/client/docs/BlockReceiptsResponse.md +++ b/clients/apiclient/docs/BlockReceiptsResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Receipts** | Pointer to [**[]RequestReceiptResponse**](RequestReceiptResponse.md) | | [optional] +**Receipts** | [**[]RequestReceiptResponse**](RequestReceiptResponse.md) | | ## Methods ### NewBlockReceiptsResponse -`func NewBlockReceiptsResponse() *BlockReceiptsResponse` +`func NewBlockReceiptsResponse(receipts []RequestReceiptResponse, ) *BlockReceiptsResponse` NewBlockReceiptsResponse instantiates a new BlockReceiptsResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetReceipts sets Receipts field to given value. -### HasReceipts - -`func (o *BlockReceiptsResponse) HasReceipts() bool` - -HasReceipts returns a boolean if a field has been set. [[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/client/docs/BurnLog.md b/clients/apiclient/docs/BurnLog.md similarity index 100% rename from client/docs/BurnLog.md rename to clients/apiclient/docs/BurnLog.md diff --git a/client/docs/BurnRecord.md b/clients/apiclient/docs/BurnRecord.md similarity index 100% rename from client/docs/BurnRecord.md rename to clients/apiclient/docs/BurnRecord.md diff --git a/client/docs/CallTarget.md b/clients/apiclient/docs/CallTarget.md similarity index 82% rename from client/docs/CallTarget.md rename to clients/apiclient/docs/CallTarget.md index 1217c31165..ded8ac46dd 100644 --- a/client/docs/CallTarget.md +++ b/clients/apiclient/docs/CallTarget.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Contract** | Pointer to **int32** | | [optional] -**EntryPoint** | Pointer to **int32** | | [optional] +**Contract** | **int32** | | +**EntryPoint** | **int32** | | ## Methods ### NewCallTarget -`func NewCallTarget() *CallTarget` +`func NewCallTarget(contract int32, entryPoint int32, ) *CallTarget` NewCallTarget instantiates a new CallTarget object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetContract sets Contract field to given value. -### HasContract - -`func (o *CallTarget) HasContract() bool` - -HasContract returns a boolean if a field has been set. ### GetEntryPoint @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetEntryPoint sets EntryPoint field to given value. -### HasEntryPoint - -`func (o *CallTarget) HasEntryPoint() bool` - -HasEntryPoint returns a boolean if a field has been set. [[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/client/docs/ChainInfoResponse.md b/clients/apiclient/docs/ChainInfoResponse.md similarity index 67% rename from client/docs/ChainInfoResponse.md rename to clients/apiclient/docs/ChainInfoResponse.md index c43ad3fcbb..8bf23b128f 100644 --- a/client/docs/ChainInfoResponse.md +++ b/clients/apiclient/docs/ChainInfoResponse.md @@ -4,21 +4,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ChainID** | Pointer to **string** | ChainID (Bech32-encoded). | [optional] -**ChainOwnerId** | Pointer to **string** | The chain owner address (Bech32-encoded). | [optional] -**Description** | Pointer to **string** | The description of the chain. | [optional] -**EvmChainId** | Pointer to **int32** | The EVM chain ID | [optional] +**ChainID** | **string** | ChainID (Bech32-encoded). | +**ChainOwnerId** | **string** | The chain owner address (Bech32-encoded). | +**Description** | **string** | The description of the chain. | +**EvmChainId** | **uint32** | The EVM chain ID | **GasFeePolicy** | Pointer to [**GasFeePolicy**](GasFeePolicy.md) | | [optional] -**IsActive** | Pointer to **bool** | Whether or not the chain is active. | [optional] -**MaxBlobSize** | Pointer to **int32** | The maximum contract blob size. | [optional] -**MaxEventSize** | Pointer to **int32** | The maximum event size. | [optional] -**MaxEventsPerReq** | Pointer to **int32** | The maximum amount of events per request. | [optional] +**IsActive** | **bool** | Whether or not the chain is active. | +**MaxBlobSize** | **uint32** | The maximum contract blob size. | +**MaxEventSize** | **uint32** | The maximum event size. | +**MaxEventsPerReq** | **uint32** | The maximum amount of events per request. | ## Methods ### NewChainInfoResponse -`func NewChainInfoResponse() *ChainInfoResponse` +`func NewChainInfoResponse(chainID string, chainOwnerId string, description string, evmChainId uint32, isActive bool, maxBlobSize uint32, maxEventSize uint32, maxEventsPerReq uint32, ) *ChainInfoResponse` NewChainInfoResponse instantiates a new ChainInfoResponse object This constructor will assign default values to properties that have it defined, @@ -52,11 +52,6 @@ and a boolean to check if the value has been set. SetChainID sets ChainID field to given value. -### HasChainID - -`func (o *ChainInfoResponse) HasChainID() bool` - -HasChainID returns a boolean if a field has been set. ### GetChainOwnerId @@ -77,11 +72,6 @@ and a boolean to check if the value has been set. SetChainOwnerId sets ChainOwnerId field to given value. -### HasChainOwnerId - -`func (o *ChainInfoResponse) HasChainOwnerId() bool` - -HasChainOwnerId returns a boolean if a field has been set. ### GetDescription @@ -102,36 +92,26 @@ and a boolean to check if the value has been set. SetDescription sets Description field to given value. -### HasDescription - -`func (o *ChainInfoResponse) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. ### GetEvmChainId -`func (o *ChainInfoResponse) GetEvmChainId() int32` +`func (o *ChainInfoResponse) GetEvmChainId() uint32` GetEvmChainId returns the EvmChainId field if non-nil, zero value otherwise. ### GetEvmChainIdOk -`func (o *ChainInfoResponse) GetEvmChainIdOk() (*int32, bool)` +`func (o *ChainInfoResponse) GetEvmChainIdOk() (*uint32, bool)` GetEvmChainIdOk returns a tuple with the EvmChainId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEvmChainId -`func (o *ChainInfoResponse) SetEvmChainId(v int32)` +`func (o *ChainInfoResponse) SetEvmChainId(v uint32)` SetEvmChainId sets EvmChainId field to given value. -### HasEvmChainId - -`func (o *ChainInfoResponse) HasEvmChainId() bool` - -HasEvmChainId returns a boolean if a field has been set. ### GetGasFeePolicy @@ -177,86 +157,66 @@ and a boolean to check if the value has been set. SetIsActive sets IsActive field to given value. -### HasIsActive - -`func (o *ChainInfoResponse) HasIsActive() bool` - -HasIsActive returns a boolean if a field has been set. ### GetMaxBlobSize -`func (o *ChainInfoResponse) GetMaxBlobSize() int32` +`func (o *ChainInfoResponse) GetMaxBlobSize() uint32` GetMaxBlobSize returns the MaxBlobSize field if non-nil, zero value otherwise. ### GetMaxBlobSizeOk -`func (o *ChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool)` +`func (o *ChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool)` GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxBlobSize -`func (o *ChainInfoResponse) SetMaxBlobSize(v int32)` +`func (o *ChainInfoResponse) SetMaxBlobSize(v uint32)` SetMaxBlobSize sets MaxBlobSize field to given value. -### HasMaxBlobSize - -`func (o *ChainInfoResponse) HasMaxBlobSize() bool` - -HasMaxBlobSize returns a boolean if a field has been set. ### GetMaxEventSize -`func (o *ChainInfoResponse) GetMaxEventSize() int32` +`func (o *ChainInfoResponse) GetMaxEventSize() uint32` GetMaxEventSize returns the MaxEventSize field if non-nil, zero value otherwise. ### GetMaxEventSizeOk -`func (o *ChainInfoResponse) GetMaxEventSizeOk() (*int32, bool)` +`func (o *ChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool)` GetMaxEventSizeOk returns a tuple with the MaxEventSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxEventSize -`func (o *ChainInfoResponse) SetMaxEventSize(v int32)` +`func (o *ChainInfoResponse) SetMaxEventSize(v uint32)` SetMaxEventSize sets MaxEventSize field to given value. -### HasMaxEventSize - -`func (o *ChainInfoResponse) HasMaxEventSize() bool` - -HasMaxEventSize returns a boolean if a field has been set. ### GetMaxEventsPerReq -`func (o *ChainInfoResponse) GetMaxEventsPerReq() int32` +`func (o *ChainInfoResponse) GetMaxEventsPerReq() uint32` GetMaxEventsPerReq returns the MaxEventsPerReq field if non-nil, zero value otherwise. ### GetMaxEventsPerReqOk -`func (o *ChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool)` +`func (o *ChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool)` GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxEventsPerReq -`func (o *ChainInfoResponse) SetMaxEventsPerReq(v int32)` +`func (o *ChainInfoResponse) SetMaxEventsPerReq(v uint32)` SetMaxEventsPerReq sets MaxEventsPerReq field to given value. -### HasMaxEventsPerReq - -`func (o *ChainInfoResponse) HasMaxEventsPerReq() bool` - -HasMaxEventsPerReq returns a boolean if a field has been set. [[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/client/docs/ChainMetrics.md b/clients/apiclient/docs/ChainMetrics.md similarity index 73% rename from client/docs/ChainMetrics.md rename to clients/apiclient/docs/ChainMetrics.md index a624de47a4..c29f2bdcc3 100644 --- a/client/docs/ChainMetrics.md +++ b/clients/apiclient/docs/ChainMetrics.md @@ -4,21 +4,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**InAliasOutput** | Pointer to [**AliasOutputMetricItem**](AliasOutputMetricItem.md) | | [optional] -**InOnLedgerRequest** | Pointer to [**OnLedgerRequestMetricItem**](OnLedgerRequestMetricItem.md) | | [optional] -**InOutput** | Pointer to [**InOutputMetricItem**](InOutputMetricItem.md) | | [optional] -**InStateOutput** | Pointer to [**InStateOutputMetricItem**](InStateOutputMetricItem.md) | | [optional] -**InTxInclusionState** | Pointer to [**TxInclusionStateMsgMetricItem**](TxInclusionStateMsgMetricItem.md) | | [optional] -**OutPublishGovernanceTransaction** | Pointer to [**TransactionMetricItem**](TransactionMetricItem.md) | | [optional] -**OutPullLatestOutput** | Pointer to [**InterfaceMetricItem**](InterfaceMetricItem.md) | | [optional] -**OutPullOutputByID** | Pointer to [**UTXOInputMetricItem**](UTXOInputMetricItem.md) | | [optional] -**OutPullTxInclusionState** | Pointer to [**TransactionIDMetricItem**](TransactionIDMetricItem.md) | | [optional] +**InAliasOutput** | [**AliasOutputMetricItem**](AliasOutputMetricItem.md) | | +**InOnLedgerRequest** | [**OnLedgerRequestMetricItem**](OnLedgerRequestMetricItem.md) | | +**InOutput** | [**InOutputMetricItem**](InOutputMetricItem.md) | | +**InStateOutput** | [**InStateOutputMetricItem**](InStateOutputMetricItem.md) | | +**InTxInclusionState** | [**TxInclusionStateMsgMetricItem**](TxInclusionStateMsgMetricItem.md) | | +**OutPublishGovernanceTransaction** | [**TransactionMetricItem**](TransactionMetricItem.md) | | +**OutPullLatestOutput** | [**InterfaceMetricItem**](InterfaceMetricItem.md) | | +**OutPullOutputByID** | [**UTXOInputMetricItem**](UTXOInputMetricItem.md) | | +**OutPullTxInclusionState** | [**TransactionIDMetricItem**](TransactionIDMetricItem.md) | | ## Methods ### NewChainMetrics -`func NewChainMetrics() *ChainMetrics` +`func NewChainMetrics(inAliasOutput AliasOutputMetricItem, inOnLedgerRequest OnLedgerRequestMetricItem, inOutput InOutputMetricItem, inStateOutput InStateOutputMetricItem, inTxInclusionState TxInclusionStateMsgMetricItem, outPublishGovernanceTransaction TransactionMetricItem, outPullLatestOutput InterfaceMetricItem, outPullOutputByID UTXOInputMetricItem, outPullTxInclusionState TransactionIDMetricItem, ) *ChainMetrics` NewChainMetrics instantiates a new ChainMetrics object This constructor will assign default values to properties that have it defined, @@ -52,11 +52,6 @@ and a boolean to check if the value has been set. SetInAliasOutput sets InAliasOutput field to given value. -### HasInAliasOutput - -`func (o *ChainMetrics) HasInAliasOutput() bool` - -HasInAliasOutput returns a boolean if a field has been set. ### GetInOnLedgerRequest @@ -77,11 +72,6 @@ and a boolean to check if the value has been set. SetInOnLedgerRequest sets InOnLedgerRequest field to given value. -### HasInOnLedgerRequest - -`func (o *ChainMetrics) HasInOnLedgerRequest() bool` - -HasInOnLedgerRequest returns a boolean if a field has been set. ### GetInOutput @@ -102,11 +92,6 @@ and a boolean to check if the value has been set. SetInOutput sets InOutput field to given value. -### HasInOutput - -`func (o *ChainMetrics) HasInOutput() bool` - -HasInOutput returns a boolean if a field has been set. ### GetInStateOutput @@ -127,11 +112,6 @@ and a boolean to check if the value has been set. SetInStateOutput sets InStateOutput field to given value. -### HasInStateOutput - -`func (o *ChainMetrics) HasInStateOutput() bool` - -HasInStateOutput returns a boolean if a field has been set. ### GetInTxInclusionState @@ -152,11 +132,6 @@ and a boolean to check if the value has been set. SetInTxInclusionState sets InTxInclusionState field to given value. -### HasInTxInclusionState - -`func (o *ChainMetrics) HasInTxInclusionState() bool` - -HasInTxInclusionState returns a boolean if a field has been set. ### GetOutPublishGovernanceTransaction @@ -177,11 +152,6 @@ and a boolean to check if the value has been set. SetOutPublishGovernanceTransaction sets OutPublishGovernanceTransaction field to given value. -### HasOutPublishGovernanceTransaction - -`func (o *ChainMetrics) HasOutPublishGovernanceTransaction() bool` - -HasOutPublishGovernanceTransaction returns a boolean if a field has been set. ### GetOutPullLatestOutput @@ -202,11 +172,6 @@ and a boolean to check if the value has been set. SetOutPullLatestOutput sets OutPullLatestOutput field to given value. -### HasOutPullLatestOutput - -`func (o *ChainMetrics) HasOutPullLatestOutput() bool` - -HasOutPullLatestOutput returns a boolean if a field has been set. ### GetOutPullOutputByID @@ -227,11 +192,6 @@ and a boolean to check if the value has been set. SetOutPullOutputByID sets OutPullOutputByID field to given value. -### HasOutPullOutputByID - -`func (o *ChainMetrics) HasOutPullOutputByID() bool` - -HasOutPullOutputByID returns a boolean if a field has been set. ### GetOutPullTxInclusionState @@ -252,11 +212,6 @@ and a boolean to check if the value has been set. SetOutPullTxInclusionState sets OutPullTxInclusionState field to given value. -### HasOutPullTxInclusionState - -`func (o *ChainMetrics) HasOutPullTxInclusionState() bool` - -HasOutPullTxInclusionState returns a boolean if a field has been set. [[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/client/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md similarity index 97% rename from client/docs/ChainsApi.md rename to clients/apiclient/docs/ChainsApi.md index 05f05260dd..1aa5915187 100644 --- a/client/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -6,14 +6,14 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /chains/{chainID}/activate | Activate a chain [**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. -[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /v2/chains/{chainID}/ws | +[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /chains/{chainID}/ws | [**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain [**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /chains/{chainID} | Get information about a specific chain [**GetChains**](ChainsApi.md#GetChains) | **Get** /chains | Get a list of all chains [**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee [**GetContracts**](ChainsApi.md#GetContracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts -[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /v2/chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash -[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2/chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state [**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. @@ -621,7 +621,7 @@ No authorization required ## GetStateValue -> []int32 GetStateValue(ctx, chainID, stateKey).Execute() +> StateResponse GetStateValue(ctx, chainID, stateKey).Execute() Fetch the raw value associated with the given key in the chain state @@ -648,7 +648,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetStateValue``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetStateValue`: []int32 + // response from `GetStateValue`: StateResponse fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetStateValue`: %v\n", resp) } ``` @@ -674,7 +674,7 @@ Name | Type | Description | Notes ### Return type -**[]int32** +[**StateResponse**](StateResponse.md) ### Authorization diff --git a/client/docs/CommitteeInfoResponse.md b/clients/apiclient/docs/CommitteeInfoResponse.md similarity index 73% rename from client/docs/CommitteeInfoResponse.md rename to clients/apiclient/docs/CommitteeInfoResponse.md index 8a698a8160..4afcfd3db0 100644 --- a/client/docs/CommitteeInfoResponse.md +++ b/clients/apiclient/docs/CommitteeInfoResponse.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccessNodes** | Pointer to [**[]CommitteeNode**](CommitteeNode.md) | A list of all access nodes and their peering info. | [optional] -**Active** | Pointer to **bool** | Whether or not the chain is active. | [optional] -**CandidateNodes** | Pointer to [**[]CommitteeNode**](CommitteeNode.md) | A list of all candidate nodes and their peering info. | [optional] -**ChainId** | Pointer to **string** | ChainID (Bech32-encoded). | [optional] -**CommitteeNodes** | Pointer to [**[]CommitteeNode**](CommitteeNode.md) | A list of all committee nodes and their peering info. | [optional] -**StateAddress** | Pointer to **string** | | [optional] +**AccessNodes** | [**[]CommitteeNode**](CommitteeNode.md) | A list of all access nodes and their peering info. | +**Active** | **bool** | Whether or not the chain is active. | +**CandidateNodes** | [**[]CommitteeNode**](CommitteeNode.md) | A list of all candidate nodes and their peering info. | +**ChainId** | **string** | ChainID (Bech32-encoded). | +**CommitteeNodes** | [**[]CommitteeNode**](CommitteeNode.md) | A list of all committee nodes and their peering info. | +**StateAddress** | **string** | | ## Methods ### NewCommitteeInfoResponse -`func NewCommitteeInfoResponse() *CommitteeInfoResponse` +`func NewCommitteeInfoResponse(accessNodes []CommitteeNode, active bool, candidateNodes []CommitteeNode, chainId string, committeeNodes []CommitteeNode, stateAddress string, ) *CommitteeInfoResponse` NewCommitteeInfoResponse instantiates a new CommitteeInfoResponse object This constructor will assign default values to properties that have it defined, @@ -49,11 +49,6 @@ and a boolean to check if the value has been set. SetAccessNodes sets AccessNodes field to given value. -### HasAccessNodes - -`func (o *CommitteeInfoResponse) HasAccessNodes() bool` - -HasAccessNodes returns a boolean if a field has been set. ### GetActive @@ -74,11 +69,6 @@ and a boolean to check if the value has been set. SetActive sets Active field to given value. -### HasActive - -`func (o *CommitteeInfoResponse) HasActive() bool` - -HasActive returns a boolean if a field has been set. ### GetCandidateNodes @@ -99,11 +89,6 @@ and a boolean to check if the value has been set. SetCandidateNodes sets CandidateNodes field to given value. -### HasCandidateNodes - -`func (o *CommitteeInfoResponse) HasCandidateNodes() bool` - -HasCandidateNodes returns a boolean if a field has been set. ### GetChainId @@ -124,11 +109,6 @@ and a boolean to check if the value has been set. SetChainId sets ChainId field to given value. -### HasChainId - -`func (o *CommitteeInfoResponse) HasChainId() bool` - -HasChainId returns a boolean if a field has been set. ### GetCommitteeNodes @@ -149,11 +129,6 @@ and a boolean to check if the value has been set. SetCommitteeNodes sets CommitteeNodes field to given value. -### HasCommitteeNodes - -`func (o *CommitteeInfoResponse) HasCommitteeNodes() bool` - -HasCommitteeNodes returns a boolean if a field has been set. ### GetStateAddress @@ -174,11 +149,6 @@ and a boolean to check if the value has been set. SetStateAddress sets StateAddress field to given value. -### HasStateAddress - -`func (o *CommitteeInfoResponse) HasStateAddress() bool` - -HasStateAddress returns a boolean if a field has been set. [[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/client/docs/CommitteeNode.md b/clients/apiclient/docs/CommitteeNode.md similarity index 81% rename from client/docs/CommitteeNode.md rename to clients/apiclient/docs/CommitteeNode.md index 45fc14b823..20e0af1e2f 100644 --- a/client/docs/CommitteeNode.md +++ b/clients/apiclient/docs/CommitteeNode.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccessAPI** | Pointer to **string** | | [optional] -**Node** | Pointer to [**PeeringNodeStatusResponse**](PeeringNodeStatusResponse.md) | | [optional] +**AccessAPI** | **string** | | +**Node** | [**PeeringNodeStatusResponse**](PeeringNodeStatusResponse.md) | | ## Methods ### NewCommitteeNode -`func NewCommitteeNode() *CommitteeNode` +`func NewCommitteeNode(accessAPI string, node PeeringNodeStatusResponse, ) *CommitteeNode` NewCommitteeNode instantiates a new CommitteeNode object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetAccessAPI sets AccessAPI field to given value. -### HasAccessAPI - -`func (o *CommitteeNode) HasAccessAPI() bool` - -HasAccessAPI returns a boolean if a field has been set. ### GetNode @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetNode sets Node field to given value. -### HasNode - -`func (o *CommitteeNode) HasNode() bool` - -HasNode returns a boolean if a field has been set. [[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/client/docs/ConsensusPipeMetrics.md b/clients/apiclient/docs/ConsensusPipeMetrics.md similarity index 77% rename from client/docs/ConsensusPipeMetrics.md rename to clients/apiclient/docs/ConsensusPipeMetrics.md index 388d1273ee..d2db03e462 100644 --- a/client/docs/ConsensusPipeMetrics.md +++ b/clients/apiclient/docs/ConsensusPipeMetrics.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EventACSMsgPipeSize** | Pointer to **int32** | | [optional] -**EventPeerLogIndexMsgPipeSize** | Pointer to **int32** | | [optional] -**EventStateTransitionMsgPipeSize** | Pointer to **int32** | | [optional] -**EventTimerMsgPipeSize** | Pointer to **int32** | | [optional] -**EventVMResultMsgPipeSize** | Pointer to **int32** | | [optional] +**EventACSMsgPipeSize** | **int32** | | +**EventPeerLogIndexMsgPipeSize** | **int32** | | +**EventStateTransitionMsgPipeSize** | **int32** | | +**EventTimerMsgPipeSize** | **int32** | | +**EventVMResultMsgPipeSize** | **int32** | | ## Methods ### NewConsensusPipeMetrics -`func NewConsensusPipeMetrics() *ConsensusPipeMetrics` +`func NewConsensusPipeMetrics(eventACSMsgPipeSize int32, eventPeerLogIndexMsgPipeSize int32, eventStateTransitionMsgPipeSize int32, eventTimerMsgPipeSize int32, eventVMResultMsgPipeSize int32, ) *ConsensusPipeMetrics` NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object This constructor will assign default values to properties that have it defined, @@ -48,11 +48,6 @@ and a boolean to check if the value has been set. SetEventACSMsgPipeSize sets EventACSMsgPipeSize field to given value. -### HasEventACSMsgPipeSize - -`func (o *ConsensusPipeMetrics) HasEventACSMsgPipeSize() bool` - -HasEventACSMsgPipeSize returns a boolean if a field has been set. ### GetEventPeerLogIndexMsgPipeSize @@ -73,11 +68,6 @@ and a boolean to check if the value has been set. SetEventPeerLogIndexMsgPipeSize sets EventPeerLogIndexMsgPipeSize field to given value. -### HasEventPeerLogIndexMsgPipeSize - -`func (o *ConsensusPipeMetrics) HasEventPeerLogIndexMsgPipeSize() bool` - -HasEventPeerLogIndexMsgPipeSize returns a boolean if a field has been set. ### GetEventStateTransitionMsgPipeSize @@ -98,11 +88,6 @@ and a boolean to check if the value has been set. SetEventStateTransitionMsgPipeSize sets EventStateTransitionMsgPipeSize field to given value. -### HasEventStateTransitionMsgPipeSize - -`func (o *ConsensusPipeMetrics) HasEventStateTransitionMsgPipeSize() bool` - -HasEventStateTransitionMsgPipeSize returns a boolean if a field has been set. ### GetEventTimerMsgPipeSize @@ -123,11 +108,6 @@ and a boolean to check if the value has been set. SetEventTimerMsgPipeSize sets EventTimerMsgPipeSize field to given value. -### HasEventTimerMsgPipeSize - -`func (o *ConsensusPipeMetrics) HasEventTimerMsgPipeSize() bool` - -HasEventTimerMsgPipeSize returns a boolean if a field has been set. ### GetEventVMResultMsgPipeSize @@ -148,11 +128,6 @@ and a boolean to check if the value has been set. SetEventVMResultMsgPipeSize sets EventVMResultMsgPipeSize field to given value. -### HasEventVMResultMsgPipeSize - -`func (o *ConsensusPipeMetrics) HasEventVMResultMsgPipeSize() bool` - -HasEventVMResultMsgPipeSize returns a boolean if a field has been set. [[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/client/docs/ConsensusWorkflowMetrics.md b/clients/apiclient/docs/ConsensusWorkflowMetrics.md similarity index 68% rename from client/docs/ConsensusWorkflowMetrics.md rename to clients/apiclient/docs/ConsensusWorkflowMetrics.md index c34912faa6..87e6acb219 100644 --- a/client/docs/ConsensusWorkflowMetrics.md +++ b/clients/apiclient/docs/ConsensusWorkflowMetrics.md @@ -4,30 +4,30 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CurrentStateIndex** | Pointer to **int32** | Shows current state index of the consensus | [optional] -**FlagBatchProposalSent** | Pointer to **bool** | Shows if batch proposal is sent out in current consensus iteration | [optional] -**FlagConsensusBatchKnown** | Pointer to **bool** | Shows if consensus on batch is reached and known in current consensus iteration | [optional] -**FlagInProgress** | Pointer to **bool** | Shows if consensus algorithm is still not completed in current consensus iteration | [optional] -**FlagStateReceived** | Pointer to **bool** | Shows if state output is received in current consensus iteration | [optional] -**FlagTransactionFinalized** | Pointer to **bool** | Shows if consensus on transaction is reached in current consensus iteration | [optional] -**FlagTransactionPosted** | Pointer to **bool** | Shows if transaction is posted to L1 in current consensus iteration | [optional] -**FlagTransactionSeen** | Pointer to **bool** | Shows if L1 reported that it has seen the transaction of current consensus iteration | [optional] -**FlagVMResultSigned** | Pointer to **bool** | Shows if virtual machine has returned its results in current consensus iteration | [optional] -**FlagVMStarted** | Pointer to **bool** | Shows if virtual machine is started in current consensus iteration | [optional] -**TimeBatchProposalSent** | Pointer to **time.Time** | Shows when batch proposal was last sent out in current consensus iteration | [optional] -**TimeCompleted** | Pointer to **time.Time** | Shows when algorithm was last completed in current consensus iteration | [optional] -**TimeConsensusBatchKnown** | Pointer to **time.Time** | Shows when ACS results of consensus on batch was last received in current consensus iteration | [optional] -**TimeTransactionFinalized** | Pointer to **time.Time** | Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration | [optional] -**TimeTransactionPosted** | Pointer to **time.Time** | Shows when transaction was last posted to L1 in current consensus iteration | [optional] -**TimeTransactionSeen** | Pointer to **time.Time** | Shows when algorithm last noted that transaction had been seen by L1 in current consensus iteration | [optional] -**TimeVMResultSigned** | Pointer to **time.Time** | Shows when virtual machine results were last received and signed in current consensus iteration | [optional] -**TimeVMStarted** | Pointer to **time.Time** | Shows when virtual machine was last started in current consensus iteration | [optional] +**CurrentStateIndex** | Pointer to **uint32** | Shows current state index of the consensus | [optional] +**FlagBatchProposalSent** | **bool** | Shows if batch proposal is sent out in current consensus iteration | +**FlagConsensusBatchKnown** | **bool** | Shows if consensus on batch is reached and known in current consensus iteration | +**FlagInProgress** | **bool** | Shows if consensus algorithm is still not completed in current consensus iteration | +**FlagStateReceived** | **bool** | Shows if state output is received in current consensus iteration | +**FlagTransactionFinalized** | **bool** | Shows if consensus on transaction is reached in current consensus iteration | +**FlagTransactionPosted** | **bool** | Shows if transaction is posted to L1 in current consensus iteration | +**FlagTransactionSeen** | **bool** | Shows if L1 reported that it has seen the transaction of current consensus iteration | +**FlagVMResultSigned** | **bool** | Shows if virtual machine has returned its results in current consensus iteration | +**FlagVMStarted** | **bool** | Shows if virtual machine is started in current consensus iteration | +**TimeBatchProposalSent** | **time.Time** | Shows when batch proposal was last sent out in current consensus iteration | +**TimeCompleted** | **time.Time** | Shows when algorithm was last completed in current consensus iteration | +**TimeConsensusBatchKnown** | **time.Time** | Shows when ACS results of consensus on batch was last received in current consensus iteration | +**TimeTransactionFinalized** | **time.Time** | Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration | +**TimeTransactionPosted** | **time.Time** | Shows when transaction was last posted to L1 in current consensus iteration | +**TimeTransactionSeen** | **time.Time** | Shows when algorithm last noted that transaction had been seen by L1 in current consensus iteration | +**TimeVMResultSigned** | **time.Time** | Shows when virtual machine results were last received and signed in current consensus iteration | +**TimeVMStarted** | **time.Time** | Shows when virtual machine was last started in current consensus iteration | ## Methods ### NewConsensusWorkflowMetrics -`func NewConsensusWorkflowMetrics() *ConsensusWorkflowMetrics` +`func NewConsensusWorkflowMetrics(flagBatchProposalSent bool, flagConsensusBatchKnown bool, flagInProgress bool, flagStateReceived bool, flagTransactionFinalized bool, flagTransactionPosted bool, flagTransactionSeen bool, flagVMResultSigned bool, flagVMStarted bool, timeBatchProposalSent time.Time, timeCompleted time.Time, timeConsensusBatchKnown time.Time, timeTransactionFinalized time.Time, timeTransactionPosted time.Time, timeTransactionSeen time.Time, timeVMResultSigned time.Time, timeVMStarted time.Time, ) *ConsensusWorkflowMetrics` NewConsensusWorkflowMetrics instantiates a new ConsensusWorkflowMetrics object This constructor will assign default values to properties that have it defined, @@ -44,20 +44,20 @@ but it doesn't guarantee that properties required by API are set ### GetCurrentStateIndex -`func (o *ConsensusWorkflowMetrics) GetCurrentStateIndex() int32` +`func (o *ConsensusWorkflowMetrics) GetCurrentStateIndex() uint32` GetCurrentStateIndex returns the CurrentStateIndex field if non-nil, zero value otherwise. ### GetCurrentStateIndexOk -`func (o *ConsensusWorkflowMetrics) GetCurrentStateIndexOk() (*int32, bool)` +`func (o *ConsensusWorkflowMetrics) GetCurrentStateIndexOk() (*uint32, bool)` GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCurrentStateIndex -`func (o *ConsensusWorkflowMetrics) SetCurrentStateIndex(v int32)` +`func (o *ConsensusWorkflowMetrics) SetCurrentStateIndex(v uint32)` SetCurrentStateIndex sets CurrentStateIndex field to given value. @@ -86,11 +86,6 @@ and a boolean to check if the value has been set. SetFlagBatchProposalSent sets FlagBatchProposalSent field to given value. -### HasFlagBatchProposalSent - -`func (o *ConsensusWorkflowMetrics) HasFlagBatchProposalSent() bool` - -HasFlagBatchProposalSent returns a boolean if a field has been set. ### GetFlagConsensusBatchKnown @@ -111,11 +106,6 @@ and a boolean to check if the value has been set. SetFlagConsensusBatchKnown sets FlagConsensusBatchKnown field to given value. -### HasFlagConsensusBatchKnown - -`func (o *ConsensusWorkflowMetrics) HasFlagConsensusBatchKnown() bool` - -HasFlagConsensusBatchKnown returns a boolean if a field has been set. ### GetFlagInProgress @@ -136,11 +126,6 @@ and a boolean to check if the value has been set. SetFlagInProgress sets FlagInProgress field to given value. -### HasFlagInProgress - -`func (o *ConsensusWorkflowMetrics) HasFlagInProgress() bool` - -HasFlagInProgress returns a boolean if a field has been set. ### GetFlagStateReceived @@ -161,11 +146,6 @@ and a boolean to check if the value has been set. SetFlagStateReceived sets FlagStateReceived field to given value. -### HasFlagStateReceived - -`func (o *ConsensusWorkflowMetrics) HasFlagStateReceived() bool` - -HasFlagStateReceived returns a boolean if a field has been set. ### GetFlagTransactionFinalized @@ -186,11 +166,6 @@ and a boolean to check if the value has been set. SetFlagTransactionFinalized sets FlagTransactionFinalized field to given value. -### HasFlagTransactionFinalized - -`func (o *ConsensusWorkflowMetrics) HasFlagTransactionFinalized() bool` - -HasFlagTransactionFinalized returns a boolean if a field has been set. ### GetFlagTransactionPosted @@ -211,11 +186,6 @@ and a boolean to check if the value has been set. SetFlagTransactionPosted sets FlagTransactionPosted field to given value. -### HasFlagTransactionPosted - -`func (o *ConsensusWorkflowMetrics) HasFlagTransactionPosted() bool` - -HasFlagTransactionPosted returns a boolean if a field has been set. ### GetFlagTransactionSeen @@ -236,11 +206,6 @@ and a boolean to check if the value has been set. SetFlagTransactionSeen sets FlagTransactionSeen field to given value. -### HasFlagTransactionSeen - -`func (o *ConsensusWorkflowMetrics) HasFlagTransactionSeen() bool` - -HasFlagTransactionSeen returns a boolean if a field has been set. ### GetFlagVMResultSigned @@ -261,11 +226,6 @@ and a boolean to check if the value has been set. SetFlagVMResultSigned sets FlagVMResultSigned field to given value. -### HasFlagVMResultSigned - -`func (o *ConsensusWorkflowMetrics) HasFlagVMResultSigned() bool` - -HasFlagVMResultSigned returns a boolean if a field has been set. ### GetFlagVMStarted @@ -286,11 +246,6 @@ and a boolean to check if the value has been set. SetFlagVMStarted sets FlagVMStarted field to given value. -### HasFlagVMStarted - -`func (o *ConsensusWorkflowMetrics) HasFlagVMStarted() bool` - -HasFlagVMStarted returns a boolean if a field has been set. ### GetTimeBatchProposalSent @@ -311,11 +266,6 @@ and a boolean to check if the value has been set. SetTimeBatchProposalSent sets TimeBatchProposalSent field to given value. -### HasTimeBatchProposalSent - -`func (o *ConsensusWorkflowMetrics) HasTimeBatchProposalSent() bool` - -HasTimeBatchProposalSent returns a boolean if a field has been set. ### GetTimeCompleted @@ -336,11 +286,6 @@ and a boolean to check if the value has been set. SetTimeCompleted sets TimeCompleted field to given value. -### HasTimeCompleted - -`func (o *ConsensusWorkflowMetrics) HasTimeCompleted() bool` - -HasTimeCompleted returns a boolean if a field has been set. ### GetTimeConsensusBatchKnown @@ -361,11 +306,6 @@ and a boolean to check if the value has been set. SetTimeConsensusBatchKnown sets TimeConsensusBatchKnown field to given value. -### HasTimeConsensusBatchKnown - -`func (o *ConsensusWorkflowMetrics) HasTimeConsensusBatchKnown() bool` - -HasTimeConsensusBatchKnown returns a boolean if a field has been set. ### GetTimeTransactionFinalized @@ -386,11 +326,6 @@ and a boolean to check if the value has been set. SetTimeTransactionFinalized sets TimeTransactionFinalized field to given value. -### HasTimeTransactionFinalized - -`func (o *ConsensusWorkflowMetrics) HasTimeTransactionFinalized() bool` - -HasTimeTransactionFinalized returns a boolean if a field has been set. ### GetTimeTransactionPosted @@ -411,11 +346,6 @@ and a boolean to check if the value has been set. SetTimeTransactionPosted sets TimeTransactionPosted field to given value. -### HasTimeTransactionPosted - -`func (o *ConsensusWorkflowMetrics) HasTimeTransactionPosted() bool` - -HasTimeTransactionPosted returns a boolean if a field has been set. ### GetTimeTransactionSeen @@ -436,11 +366,6 @@ and a boolean to check if the value has been set. SetTimeTransactionSeen sets TimeTransactionSeen field to given value. -### HasTimeTransactionSeen - -`func (o *ConsensusWorkflowMetrics) HasTimeTransactionSeen() bool` - -HasTimeTransactionSeen returns a boolean if a field has been set. ### GetTimeVMResultSigned @@ -461,11 +386,6 @@ and a boolean to check if the value has been set. SetTimeVMResultSigned sets TimeVMResultSigned field to given value. -### HasTimeVMResultSigned - -`func (o *ConsensusWorkflowMetrics) HasTimeVMResultSigned() bool` - -HasTimeVMResultSigned returns a boolean if a field has been set. ### GetTimeVMStarted @@ -486,11 +406,6 @@ and a boolean to check if the value has been set. SetTimeVMStarted sets TimeVMStarted field to given value. -### HasTimeVMStarted - -`func (o *ConsensusWorkflowMetrics) HasTimeVMStarted() bool` - -HasTimeVMStarted returns a boolean if a field has been set. [[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/client/docs/ContractCallViewRequest.md b/clients/apiclient/docs/ContractCallViewRequest.md similarity index 75% rename from client/docs/ContractCallViewRequest.md rename to clients/apiclient/docs/ContractCallViewRequest.md index b53217bd4f..ffe1abe336 100644 --- a/client/docs/ContractCallViewRequest.md +++ b/clients/apiclient/docs/ContractCallViewRequest.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Arguments** | Pointer to [**JSONDict**](JSONDict.md) | | [optional] -**ChainId** | Pointer to **string** | The chain id | [optional] -**ContractHName** | Pointer to **string** | The contract name as HName (Hex) | [optional] -**ContractName** | Pointer to **string** | The contract name | [optional] -**FunctionHName** | Pointer to **string** | The function name as HName (Hex) | [optional] -**FunctionName** | Pointer to **string** | The function name | [optional] +**Arguments** | [**JSONDict**](JSONDict.md) | | +**ChainId** | **string** | The chain id | +**ContractHName** | **string** | The contract name as HName (Hex) | +**ContractName** | **string** | The contract name | +**FunctionHName** | **string** | The function name as HName (Hex) | +**FunctionName** | **string** | The function name | ## Methods ### NewContractCallViewRequest -`func NewContractCallViewRequest() *ContractCallViewRequest` +`func NewContractCallViewRequest(arguments JSONDict, chainId string, contractHName string, contractName string, functionHName string, functionName string, ) *ContractCallViewRequest` NewContractCallViewRequest instantiates a new ContractCallViewRequest object This constructor will assign default values to properties that have it defined, @@ -49,11 +49,6 @@ and a boolean to check if the value has been set. SetArguments sets Arguments field to given value. -### HasArguments - -`func (o *ContractCallViewRequest) HasArguments() bool` - -HasArguments returns a boolean if a field has been set. ### GetChainId @@ -74,11 +69,6 @@ and a boolean to check if the value has been set. SetChainId sets ChainId field to given value. -### HasChainId - -`func (o *ContractCallViewRequest) HasChainId() bool` - -HasChainId returns a boolean if a field has been set. ### GetContractHName @@ -99,11 +89,6 @@ and a boolean to check if the value has been set. SetContractHName sets ContractHName field to given value. -### HasContractHName - -`func (o *ContractCallViewRequest) HasContractHName() bool` - -HasContractHName returns a boolean if a field has been set. ### GetContractName @@ -124,11 +109,6 @@ and a boolean to check if the value has been set. SetContractName sets ContractName field to given value. -### HasContractName - -`func (o *ContractCallViewRequest) HasContractName() bool` - -HasContractName returns a boolean if a field has been set. ### GetFunctionHName @@ -149,11 +129,6 @@ and a boolean to check if the value has been set. SetFunctionHName sets FunctionHName field to given value. -### HasFunctionHName - -`func (o *ContractCallViewRequest) HasFunctionHName() bool` - -HasFunctionHName returns a boolean if a field has been set. ### GetFunctionName @@ -174,11 +149,6 @@ and a boolean to check if the value has been set. SetFunctionName sets FunctionName field to given value. -### HasFunctionName - -`func (o *ContractCallViewRequest) HasFunctionName() bool` - -HasFunctionName returns a boolean if a field has been set. [[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/client/docs/ContractInfoResponse.md b/clients/apiclient/docs/ContractInfoResponse.md similarity index 76% rename from client/docs/ContractInfoResponse.md rename to clients/apiclient/docs/ContractInfoResponse.md index 5198c20239..9588713489 100644 --- a/client/docs/ContractInfoResponse.md +++ b/clients/apiclient/docs/ContractInfoResponse.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Description** | Pointer to **string** | The description of the contract. | [optional] -**HName** | Pointer to **string** | The id (HName as Hex)) of the contract. | [optional] -**Name** | Pointer to **string** | The name of the contract. | [optional] -**ProgramHash** | Pointer to **[]int32** | The hash of the contract. | [optional] +**Description** | **string** | The description of the contract. | +**HName** | **string** | The id (HName as Hex)) of the contract. | +**Name** | **string** | The name of the contract. | +**ProgramHash** | **[]int32** | The hash of the contract. | ## Methods ### NewContractInfoResponse -`func NewContractInfoResponse() *ContractInfoResponse` +`func NewContractInfoResponse(description string, hName string, name string, programHash []int32, ) *ContractInfoResponse` NewContractInfoResponse instantiates a new ContractInfoResponse object This constructor will assign default values to properties that have it defined, @@ -47,11 +47,6 @@ and a boolean to check if the value has been set. SetDescription sets Description field to given value. -### HasDescription - -`func (o *ContractInfoResponse) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. ### GetHName @@ -72,11 +67,6 @@ and a boolean to check if the value has been set. SetHName sets HName field to given value. -### HasHName - -`func (o *ContractInfoResponse) HasHName() bool` - -HasHName returns a boolean if a field has been set. ### GetName @@ -97,11 +87,6 @@ and a boolean to check if the value has been set. SetName sets Name field to given value. -### HasName - -`func (o *ContractInfoResponse) HasName() bool` - -HasName returns a boolean if a field has been set. ### GetProgramHash @@ -122,11 +107,6 @@ and a boolean to check if the value has been set. SetProgramHash sets ProgramHash field to given value. -### HasProgramHash - -`func (o *ContractInfoResponse) HasProgramHash() bool` - -HasProgramHash returns a boolean if a field has been set. [[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/client/docs/ControlAddressesResponse.md b/clients/apiclient/docs/ControlAddressesResponse.md similarity index 74% rename from client/docs/ControlAddressesResponse.md rename to clients/apiclient/docs/ControlAddressesResponse.md index cc5c78e2ee..b948f47f2d 100644 --- a/client/docs/ControlAddressesResponse.md +++ b/clients/apiclient/docs/ControlAddressesResponse.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GoverningAddress** | Pointer to **string** | | [optional] -**SinceBlockIndex** | Pointer to **int32** | | [optional] -**StateAddress** | Pointer to **string** | | [optional] +**GoverningAddress** | **string** | | +**SinceBlockIndex** | **uint32** | | +**StateAddress** | **string** | | ## Methods ### NewControlAddressesResponse -`func NewControlAddressesResponse() *ControlAddressesResponse` +`func NewControlAddressesResponse(governingAddress string, sinceBlockIndex uint32, stateAddress string, ) *ControlAddressesResponse` NewControlAddressesResponse instantiates a new ControlAddressesResponse object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetGoverningAddress sets GoverningAddress field to given value. -### HasGoverningAddress - -`func (o *ControlAddressesResponse) HasGoverningAddress() bool` - -HasGoverningAddress returns a boolean if a field has been set. ### GetSinceBlockIndex -`func (o *ControlAddressesResponse) GetSinceBlockIndex() int32` +`func (o *ControlAddressesResponse) GetSinceBlockIndex() uint32` GetSinceBlockIndex returns the SinceBlockIndex field if non-nil, zero value otherwise. ### GetSinceBlockIndexOk -`func (o *ControlAddressesResponse) GetSinceBlockIndexOk() (*int32, bool)` +`func (o *ControlAddressesResponse) GetSinceBlockIndexOk() (*uint32, bool)` GetSinceBlockIndexOk returns a tuple with the SinceBlockIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSinceBlockIndex -`func (o *ControlAddressesResponse) SetSinceBlockIndex(v int32)` +`func (o *ControlAddressesResponse) SetSinceBlockIndex(v uint32)` SetSinceBlockIndex sets SinceBlockIndex field to given value. -### HasSinceBlockIndex - -`func (o *ControlAddressesResponse) HasSinceBlockIndex() bool` - -HasSinceBlockIndex returns a boolean if a field has been set. ### GetStateAddress @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetStateAddress sets StateAddress field to given value. -### HasStateAddress - -`func (o *ControlAddressesResponse) HasStateAddress() bool` - -HasStateAddress returns a boolean if a field has been set. [[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/client/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md similarity index 94% rename from client/docs/CorecontractsApi.md rename to clients/apiclient/docs/CorecontractsApi.md index d8d7bdfee7..ed217e9dd4 100644 --- a/client/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -4,32 +4,32 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account -[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account -[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account -[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /v2/chains/{chainID}/core/accounts | Get a list of all accounts -[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /v2/chains/{chainID}/core/accounts/foundry_output | Get the foundry output -[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /v2/chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID -[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /v2/chains/{chainID}/core/accounts/token_registry | Get a list of all registries -[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /v2/chains/{chainID}/core/accounts/total_assets | Get all stored assets -[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /v2/chains/{chainID}/core/blobs | Get all stored blobs -[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob -[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) -[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index -[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /v2/chains/{chainID}/core/blocklog/controladdresses | Get the control addresses -[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block -[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract -[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block -[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /v2/chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request -[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block -[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index -[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block -[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status -[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id -[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block -[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block -[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id -[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2/chains/{chainID}/core/governance/chaininfo | Get the chain info +[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /chains/{chainID}/core/accounts | Get a list of all accounts +[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /chains/{chainID}/core/accounts/foundry_output | Get the foundry output +[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /chains/{chainID}/core/accounts/token_registry | Get a list of all registries +[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /chains/{chainID}/core/accounts/total_assets | Get all stored assets +[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /chains/{chainID}/core/blobs | Get all stored blobs +[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /chains/{chainID}/core/governance/chaininfo | Get the chain info diff --git a/client/docs/DKSharesInfo.md b/clients/apiclient/docs/DKSharesInfo.md similarity index 69% rename from client/docs/DKSharesInfo.md rename to clients/apiclient/docs/DKSharesInfo.md index e3835ee767..23906df7c0 100644 --- a/client/docs/DKSharesInfo.md +++ b/clients/apiclient/docs/DKSharesInfo.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Address** | Pointer to **string** | New generated shared address. | [optional] -**PeerIdentities** | Pointer to **[]string** | Identities of the nodes sharing the key. (Hex) | [optional] -**PeerIndex** | Pointer to **int32** | | [optional] -**PublicKey** | Pointer to **string** | Used public key. (Hex) | [optional] -**PublicKeyShares** | Pointer to **[]string** | Public key shares for all the peers. (Hex) | [optional] -**Threshold** | Pointer to **int32** | | [optional] +**Address** | **string** | New generated shared address. | +**PeerIdentities** | **[]string** | Identities of the nodes sharing the key. (Hex) | +**PeerIndex** | **uint32** | | +**PublicKey** | **string** | Used public key. (Hex) | +**PublicKeyShares** | **[]string** | Public key shares for all the peers. (Hex) | +**Threshold** | **uint32** | | ## Methods ### NewDKSharesInfo -`func NewDKSharesInfo() *DKSharesInfo` +`func NewDKSharesInfo(address string, peerIdentities []string, peerIndex uint32, publicKey string, publicKeyShares []string, threshold uint32, ) *DKSharesInfo` NewDKSharesInfo instantiates a new DKSharesInfo object This constructor will assign default values to properties that have it defined, @@ -49,11 +49,6 @@ and a boolean to check if the value has been set. SetAddress sets Address field to given value. -### HasAddress - -`func (o *DKSharesInfo) HasAddress() bool` - -HasAddress returns a boolean if a field has been set. ### GetPeerIdentities @@ -74,36 +69,26 @@ and a boolean to check if the value has been set. SetPeerIdentities sets PeerIdentities field to given value. -### HasPeerIdentities - -`func (o *DKSharesInfo) HasPeerIdentities() bool` - -HasPeerIdentities returns a boolean if a field has been set. ### GetPeerIndex -`func (o *DKSharesInfo) GetPeerIndex() int32` +`func (o *DKSharesInfo) GetPeerIndex() uint32` GetPeerIndex returns the PeerIndex field if non-nil, zero value otherwise. ### GetPeerIndexOk -`func (o *DKSharesInfo) GetPeerIndexOk() (*int32, bool)` +`func (o *DKSharesInfo) GetPeerIndexOk() (*uint32, bool)` GetPeerIndexOk returns a tuple with the PeerIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPeerIndex -`func (o *DKSharesInfo) SetPeerIndex(v int32)` +`func (o *DKSharesInfo) SetPeerIndex(v uint32)` SetPeerIndex sets PeerIndex field to given value. -### HasPeerIndex - -`func (o *DKSharesInfo) HasPeerIndex() bool` - -HasPeerIndex returns a boolean if a field has been set. ### GetPublicKey @@ -124,11 +109,6 @@ and a boolean to check if the value has been set. SetPublicKey sets PublicKey field to given value. -### HasPublicKey - -`func (o *DKSharesInfo) HasPublicKey() bool` - -HasPublicKey returns a boolean if a field has been set. ### GetPublicKeyShares @@ -149,36 +129,26 @@ and a boolean to check if the value has been set. SetPublicKeyShares sets PublicKeyShares field to given value. -### HasPublicKeyShares - -`func (o *DKSharesInfo) HasPublicKeyShares() bool` - -HasPublicKeyShares returns a boolean if a field has been set. ### GetThreshold -`func (o *DKSharesInfo) GetThreshold() int32` +`func (o *DKSharesInfo) GetThreshold() uint32` GetThreshold returns the Threshold field if non-nil, zero value otherwise. ### GetThresholdOk -`func (o *DKSharesInfo) GetThresholdOk() (*int32, bool)` +`func (o *DKSharesInfo) GetThresholdOk() (*uint32, bool)` GetThresholdOk returns a tuple with the Threshold field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetThreshold -`func (o *DKSharesInfo) SetThreshold(v int32)` +`func (o *DKSharesInfo) SetThreshold(v uint32)` SetThreshold sets Threshold field to given value. -### HasThreshold - -`func (o *DKSharesInfo) HasThreshold() bool` - -HasThreshold returns a boolean if a field has been set. [[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/client/docs/DKSharesPostRequest.md b/clients/apiclient/docs/DKSharesPostRequest.md similarity index 68% rename from client/docs/DKSharesPostRequest.md rename to clients/apiclient/docs/DKSharesPostRequest.md index cea858afff..625f9c4b62 100644 --- a/client/docs/DKSharesPostRequest.md +++ b/clients/apiclient/docs/DKSharesPostRequest.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**PeerIdentities** | Pointer to **[]string** | | [optional] -**Threshold** | Pointer to **int32** | Should be =< len(PeerPublicIdentities) | [optional] -**TimeoutMS** | Pointer to **int32** | Timeout in milliseconds. | [optional] +**PeerIdentities** | **[]string** | | +**Threshold** | **uint32** | Should be =< len(PeerPublicIdentities) | +**TimeoutMS** | **uint32** | Timeout in milliseconds. | ## Methods ### NewDKSharesPostRequest -`func NewDKSharesPostRequest() *DKSharesPostRequest` +`func NewDKSharesPostRequest(peerIdentities []string, threshold uint32, timeoutMS uint32, ) *DKSharesPostRequest` NewDKSharesPostRequest instantiates a new DKSharesPostRequest object This constructor will assign default values to properties that have it defined, @@ -46,61 +46,46 @@ and a boolean to check if the value has been set. SetPeerIdentities sets PeerIdentities field to given value. -### HasPeerIdentities - -`func (o *DKSharesPostRequest) HasPeerIdentities() bool` - -HasPeerIdentities returns a boolean if a field has been set. ### GetThreshold -`func (o *DKSharesPostRequest) GetThreshold() int32` +`func (o *DKSharesPostRequest) GetThreshold() uint32` GetThreshold returns the Threshold field if non-nil, zero value otherwise. ### GetThresholdOk -`func (o *DKSharesPostRequest) GetThresholdOk() (*int32, bool)` +`func (o *DKSharesPostRequest) GetThresholdOk() (*uint32, bool)` GetThresholdOk returns a tuple with the Threshold field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetThreshold -`func (o *DKSharesPostRequest) SetThreshold(v int32)` +`func (o *DKSharesPostRequest) SetThreshold(v uint32)` SetThreshold sets Threshold field to given value. -### HasThreshold - -`func (o *DKSharesPostRequest) HasThreshold() bool` - -HasThreshold returns a boolean if a field has been set. ### GetTimeoutMS -`func (o *DKSharesPostRequest) GetTimeoutMS() int32` +`func (o *DKSharesPostRequest) GetTimeoutMS() uint32` GetTimeoutMS returns the TimeoutMS field if non-nil, zero value otherwise. ### GetTimeoutMSOk -`func (o *DKSharesPostRequest) GetTimeoutMSOk() (*int32, bool)` +`func (o *DKSharesPostRequest) GetTimeoutMSOk() (*uint32, bool)` GetTimeoutMSOk returns a tuple with the TimeoutMS field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimeoutMS -`func (o *DKSharesPostRequest) SetTimeoutMS(v int32)` +`func (o *DKSharesPostRequest) SetTimeoutMS(v uint32)` SetTimeoutMS sets TimeoutMS field to given value. -### HasTimeoutMS - -`func (o *DKSharesPostRequest) HasTimeoutMS() bool` - -HasTimeoutMS returns a boolean if a field has been set. [[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/client/docs/ErrorMessageFormatResponse.md b/clients/apiclient/docs/ErrorMessageFormatResponse.md similarity index 85% rename from client/docs/ErrorMessageFormatResponse.md rename to clients/apiclient/docs/ErrorMessageFormatResponse.md index 20e81b815b..b7a41a1121 100644 --- a/client/docs/ErrorMessageFormatResponse.md +++ b/clients/apiclient/docs/ErrorMessageFormatResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MessageFormat** | Pointer to **string** | | [optional] +**MessageFormat** | **string** | | ## Methods ### NewErrorMessageFormatResponse -`func NewErrorMessageFormatResponse() *ErrorMessageFormatResponse` +`func NewErrorMessageFormatResponse(messageFormat string, ) *ErrorMessageFormatResponse` NewErrorMessageFormatResponse instantiates a new ErrorMessageFormatResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetMessageFormat sets MessageFormat field to given value. -### HasMessageFormat - -`func (o *ErrorMessageFormatResponse) HasMessageFormat() bool` - -HasMessageFormat returns a boolean if a field has been set. [[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/client/docs/EventsResponse.md b/clients/apiclient/docs/EventsResponse.md similarity index 86% rename from client/docs/EventsResponse.md rename to clients/apiclient/docs/EventsResponse.md index 66ab8b0962..5b47062940 100644 --- a/client/docs/EventsResponse.md +++ b/clients/apiclient/docs/EventsResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Events** | Pointer to **[]string** | | [optional] +**Events** | **[]string** | | ## Methods ### NewEventsResponse -`func NewEventsResponse() *EventsResponse` +`func NewEventsResponse(events []string, ) *EventsResponse` NewEventsResponse instantiates a new EventsResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetEvents sets Events field to given value. -### HasEvents - -`func (o *EventsResponse) HasEvents() bool` - -HasEvents returns a boolean if a field has been set. [[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/client/docs/FoundryOutputResponse.md b/clients/apiclient/docs/FoundryOutputResponse.md similarity index 81% rename from client/docs/FoundryOutputResponse.md rename to clients/apiclient/docs/FoundryOutputResponse.md index 2660450f5a..70df0bdade 100644 --- a/client/docs/FoundryOutputResponse.md +++ b/clients/apiclient/docs/FoundryOutputResponse.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Assets** | Pointer to [**AssetsResponse**](AssetsResponse.md) | | [optional] -**FoundryId** | Pointer to **string** | | [optional] +**Assets** | [**AssetsResponse**](AssetsResponse.md) | | +**FoundryId** | **string** | | ## Methods ### NewFoundryOutputResponse -`func NewFoundryOutputResponse() *FoundryOutputResponse` +`func NewFoundryOutputResponse(assets AssetsResponse, foundryId string, ) *FoundryOutputResponse` NewFoundryOutputResponse instantiates a new FoundryOutputResponse object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetAssets sets Assets field to given value. -### HasAssets - -`func (o *FoundryOutputResponse) HasAssets() bool` - -HasAssets returns a boolean if a field has been set. ### GetFoundryId @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetFoundryId sets FoundryId field to given value. -### HasFoundryId - -`func (o *FoundryOutputResponse) HasFoundryId() bool` - -HasFoundryId returns a boolean if a field has been set. [[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/client/docs/FungibleTokens.md b/clients/apiclient/docs/FungibleTokens.md similarity index 81% rename from client/docs/FungibleTokens.md rename to clients/apiclient/docs/FungibleTokens.md index 2f585b3385..6ed74faa17 100644 --- a/client/docs/FungibleTokens.md +++ b/clients/apiclient/docs/FungibleTokens.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BaseTokens** | Pointer to **int64** | | [optional] -**NativeTokens** | Pointer to [**[]NativeToken**](NativeToken.md) | | [optional] +**BaseTokens** | **int64** | | +**NativeTokens** | [**[]NativeToken**](NativeToken.md) | | ## Methods ### NewFungibleTokens -`func NewFungibleTokens() *FungibleTokens` +`func NewFungibleTokens(baseTokens int64, nativeTokens []NativeToken, ) *FungibleTokens` NewFungibleTokens instantiates a new FungibleTokens object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetBaseTokens sets BaseTokens field to given value. -### HasBaseTokens - -`func (o *FungibleTokens) HasBaseTokens() bool` - -HasBaseTokens returns a boolean if a field has been set. ### GetNativeTokens @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetNativeTokens sets NativeTokens field to given value. -### HasNativeTokens - -`func (o *FungibleTokens) HasNativeTokens() bool` - -HasNativeTokens returns a boolean if a field has been set. [[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/client/docs/GasFeePolicy.md b/clients/apiclient/docs/GasFeePolicy.md similarity index 77% rename from client/docs/GasFeePolicy.md rename to clients/apiclient/docs/GasFeePolicy.md index 67bc77b9fc..e5338a955e 100644 --- a/client/docs/GasFeePolicy.md +++ b/clients/apiclient/docs/GasFeePolicy.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GasFeeTokenId** | Pointer to **string** | The gas fee token id. Empty if base token. | [optional] -**GasPerToken** | Pointer to **int64** | The amount of gas per token. | [optional] -**ValidatorFeeShare** | Pointer to **int32** | The validator fee share. | [optional] +**GasFeeTokenId** | **string** | The gas fee token id. Empty if base token. | +**GasPerToken** | **int64** | The amount of gas per token. | +**ValidatorFeeShare** | **int32** | The validator fee share. | ## Methods ### NewGasFeePolicy -`func NewGasFeePolicy() *GasFeePolicy` +`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32, ) *GasFeePolicy` NewGasFeePolicy instantiates a new GasFeePolicy object This constructor will assign default values to properties that have it defined, @@ -46,11 +46,6 @@ and a boolean to check if the value has been set. SetGasFeeTokenId sets GasFeeTokenId field to given value. -### HasGasFeeTokenId - -`func (o *GasFeePolicy) HasGasFeeTokenId() bool` - -HasGasFeeTokenId returns a boolean if a field has been set. ### GetGasPerToken @@ -71,11 +66,6 @@ and a boolean to check if the value has been set. SetGasPerToken sets GasPerToken field to given value. -### HasGasPerToken - -`func (o *GasFeePolicy) HasGasPerToken() bool` - -HasGasPerToken returns a boolean if a field has been set. ### GetValidatorFeeShare @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetValidatorFeeShare sets ValidatorFeeShare field to given value. -### HasValidatorFeeShare - -`func (o *GasFeePolicy) HasValidatorFeeShare() bool` - -HasValidatorFeeShare returns a boolean if a field has been set. [[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/client/docs/GovChainInfoResponse.md b/clients/apiclient/docs/GovChainInfoResponse.md similarity index 74% rename from client/docs/GovChainInfoResponse.md rename to clients/apiclient/docs/GovChainInfoResponse.md index 08ba74347f..6da5bf797e 100644 --- a/client/docs/GovChainInfoResponse.md +++ b/clients/apiclient/docs/GovChainInfoResponse.md @@ -4,19 +4,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ChainID** | Pointer to **string** | ChainID (Bech32-encoded). | [optional] -**ChainOwnerId** | Pointer to **string** | The chain owner address (Bech32-encoded). | [optional] -**Description** | Pointer to **string** | The description of the chain. | [optional] -**GasFeePolicy** | Pointer to [**GasFeePolicy**](GasFeePolicy.md) | | [optional] -**MaxBlobSize** | Pointer to **int32** | The maximum contract blob size. | [optional] -**MaxEventSize** | Pointer to **int32** | The maximum event size. | [optional] -**MaxEventsPerReq** | Pointer to **int32** | The maximum amount of events per request. | [optional] +**ChainID** | **string** | ChainID (Bech32-encoded). | +**ChainOwnerId** | **string** | The chain owner address (Bech32-encoded). | +**Description** | **string** | The description of the chain. | +**GasFeePolicy** | [**GasFeePolicy**](GasFeePolicy.md) | | +**MaxBlobSize** | **int32** | The maximum contract blob size. | +**MaxEventSize** | **int32** | The maximum event size. | +**MaxEventsPerReq** | **int32** | The maximum amount of events per request. | ## Methods ### NewGovChainInfoResponse -`func NewGovChainInfoResponse() *GovChainInfoResponse` +`func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize int32, maxEventSize int32, maxEventsPerReq int32, ) *GovChainInfoResponse` NewGovChainInfoResponse instantiates a new GovChainInfoResponse object This constructor will assign default values to properties that have it defined, @@ -50,11 +50,6 @@ and a boolean to check if the value has been set. SetChainID sets ChainID field to given value. -### HasChainID - -`func (o *GovChainInfoResponse) HasChainID() bool` - -HasChainID returns a boolean if a field has been set. ### GetChainOwnerId @@ -75,11 +70,6 @@ and a boolean to check if the value has been set. SetChainOwnerId sets ChainOwnerId field to given value. -### HasChainOwnerId - -`func (o *GovChainInfoResponse) HasChainOwnerId() bool` - -HasChainOwnerId returns a boolean if a field has been set. ### GetDescription @@ -100,11 +90,6 @@ and a boolean to check if the value has been set. SetDescription sets Description field to given value. -### HasDescription - -`func (o *GovChainInfoResponse) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. ### GetGasFeePolicy @@ -125,11 +110,6 @@ and a boolean to check if the value has been set. SetGasFeePolicy sets GasFeePolicy field to given value. -### HasGasFeePolicy - -`func (o *GovChainInfoResponse) HasGasFeePolicy() bool` - -HasGasFeePolicy returns a boolean if a field has been set. ### GetMaxBlobSize @@ -150,11 +130,6 @@ and a boolean to check if the value has been set. SetMaxBlobSize sets MaxBlobSize field to given value. -### HasMaxBlobSize - -`func (o *GovChainInfoResponse) HasMaxBlobSize() bool` - -HasMaxBlobSize returns a boolean if a field has been set. ### GetMaxEventSize @@ -175,11 +150,6 @@ and a boolean to check if the value has been set. SetMaxEventSize sets MaxEventSize field to given value. -### HasMaxEventSize - -`func (o *GovChainInfoResponse) HasMaxEventSize() bool` - -HasMaxEventSize returns a boolean if a field has been set. ### GetMaxEventsPerReq @@ -200,11 +170,6 @@ and a boolean to check if the value has been set. SetMaxEventsPerReq sets MaxEventsPerReq field to given value. -### HasMaxEventsPerReq - -`func (o *GovChainInfoResponse) HasMaxEventsPerReq() bool` - -HasMaxEventsPerReq returns a boolean if a field has been set. [[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/client/docs/InOutput.md b/clients/apiclient/docs/InOutput.md similarity index 82% rename from client/docs/InOutput.md rename to clients/apiclient/docs/InOutput.md index ad85fb3f5a..9862d21537 100644 --- a/client/docs/InOutput.md +++ b/clients/apiclient/docs/InOutput.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Output** | Pointer to [**Output**](Output.md) | | [optional] -**OutputId** | Pointer to **string** | The output ID | [optional] +**Output** | [**Output**](Output.md) | | +**OutputId** | **string** | The output ID | ## Methods ### NewInOutput -`func NewInOutput() *InOutput` +`func NewInOutput(output Output, outputId string, ) *InOutput` NewInOutput instantiates a new InOutput object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetOutput sets Output field to given value. -### HasOutput - -`func (o *InOutput) HasOutput() bool` - -HasOutput returns a boolean if a field has been set. ### GetOutputId @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetOutputId sets OutputId field to given value. -### HasOutputId - -`func (o *InOutput) HasOutputId() bool` - -HasOutputId returns a boolean if a field has been set. [[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/client/docs/InOutputMetricItem.md b/clients/apiclient/docs/InOutputMetricItem.md similarity index 74% rename from client/docs/InOutputMetricItem.md rename to clients/apiclient/docs/InOutputMetricItem.md index 8f20f099cb..6ddf39686d 100644 --- a/client/docs/InOutputMetricItem.md +++ b/clients/apiclient/docs/InOutputMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**InOutput**](InOutput.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**InOutput**](InOutput.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewInOutputMetricItem -`func NewInOutputMetricItem() *InOutputMetricItem` +`func NewInOutputMetricItem(lastMessage InOutput, messages uint32, timestamp time.Time, ) *InOutputMetricItem` NewInOutputMetricItem instantiates a new InOutputMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *InOutputMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *InOutputMetricItem) GetMessages() int32` +`func (o *InOutputMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *InOutputMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *InOutputMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *InOutputMetricItem) SetMessages(v int32)` +`func (o *InOutputMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *InOutputMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *InOutputMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/InStateOutput.md b/clients/apiclient/docs/InStateOutput.md similarity index 82% rename from client/docs/InStateOutput.md rename to clients/apiclient/docs/InStateOutput.md index f03fe3924b..b69fc47d3c 100644 --- a/client/docs/InStateOutput.md +++ b/clients/apiclient/docs/InStateOutput.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Output** | Pointer to [**Output**](Output.md) | | [optional] -**OutputId** | Pointer to **string** | The output ID | [optional] +**Output** | [**Output**](Output.md) | | +**OutputId** | **string** | The output ID | ## Methods ### NewInStateOutput -`func NewInStateOutput() *InStateOutput` +`func NewInStateOutput(output Output, outputId string, ) *InStateOutput` NewInStateOutput instantiates a new InStateOutput object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetOutput sets Output field to given value. -### HasOutput - -`func (o *InStateOutput) HasOutput() bool` - -HasOutput returns a boolean if a field has been set. ### GetOutputId @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetOutputId sets OutputId field to given value. -### HasOutputId - -`func (o *InStateOutput) HasOutputId() bool` - -HasOutputId returns a boolean if a field has been set. [[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/client/docs/InStateOutputMetricItem.md b/clients/apiclient/docs/InStateOutputMetricItem.md similarity index 74% rename from client/docs/InStateOutputMetricItem.md rename to clients/apiclient/docs/InStateOutputMetricItem.md index 3686b02a56..16d3f732bf 100644 --- a/client/docs/InStateOutputMetricItem.md +++ b/clients/apiclient/docs/InStateOutputMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**InStateOutput**](InStateOutput.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**InStateOutput**](InStateOutput.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewInStateOutputMetricItem -`func NewInStateOutputMetricItem() *InStateOutputMetricItem` +`func NewInStateOutputMetricItem(lastMessage InStateOutput, messages uint32, timestamp time.Time, ) *InStateOutputMetricItem` NewInStateOutputMetricItem instantiates a new InStateOutputMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *InStateOutputMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *InStateOutputMetricItem) GetMessages() int32` +`func (o *InStateOutputMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *InStateOutputMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *InStateOutputMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *InStateOutputMetricItem) SetMessages(v int32)` +`func (o *InStateOutputMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *InStateOutputMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *InStateOutputMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/InfoResponse.md b/clients/apiclient/docs/InfoResponse.md similarity index 77% rename from client/docs/InfoResponse.md rename to clients/apiclient/docs/InfoResponse.md index dcdc906a11..d1f10f5d3e 100644 --- a/client/docs/InfoResponse.md +++ b/clients/apiclient/docs/InfoResponse.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**L1Params** | Pointer to [**L1Params**](L1Params.md) | | [optional] -**NetID** | Pointer to **string** | The net id of the node | [optional] -**PublicKey** | Pointer to **string** | The public key of the node (Hex) | [optional] -**Version** | Pointer to **string** | The version of the node | [optional] +**L1Params** | [**L1Params**](L1Params.md) | | +**NetID** | **string** | The net id of the node | +**PublicKey** | **string** | The public key of the node (Hex) | +**Version** | **string** | The version of the node | ## Methods ### NewInfoResponse -`func NewInfoResponse() *InfoResponse` +`func NewInfoResponse(l1Params L1Params, netID string, publicKey string, version string, ) *InfoResponse` NewInfoResponse instantiates a new InfoResponse object This constructor will assign default values to properties that have it defined, @@ -47,11 +47,6 @@ and a boolean to check if the value has been set. SetL1Params sets L1Params field to given value. -### HasL1Params - -`func (o *InfoResponse) HasL1Params() bool` - -HasL1Params returns a boolean if a field has been set. ### GetNetID @@ -72,11 +67,6 @@ and a boolean to check if the value has been set. SetNetID sets NetID field to given value. -### HasNetID - -`func (o *InfoResponse) HasNetID() bool` - -HasNetID returns a boolean if a field has been set. ### GetPublicKey @@ -97,11 +87,6 @@ and a boolean to check if the value has been set. SetPublicKey sets PublicKey field to given value. -### HasPublicKey - -`func (o *InfoResponse) HasPublicKey() bool` - -HasPublicKey returns a boolean if a field has been set. ### GetVersion @@ -122,11 +107,6 @@ and a boolean to check if the value has been set. SetVersion sets Version field to given value. -### HasVersion - -`func (o *InfoResponse) HasVersion() bool` - -HasVersion returns a boolean if a field has been set. [[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/client/docs/InterfaceMetricItem.md b/clients/apiclient/docs/InterfaceMetricItem.md similarity index 75% rename from client/docs/InterfaceMetricItem.md rename to clients/apiclient/docs/InterfaceMetricItem.md index f9bff7fe8b..f09df97915 100644 --- a/client/docs/InterfaceMetricItem.md +++ b/clients/apiclient/docs/InterfaceMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to **string** | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | **string** | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewInterfaceMetricItem -`func NewInterfaceMetricItem() *InterfaceMetricItem` +`func NewInterfaceMetricItem(lastMessage string, messages uint32, timestamp time.Time, ) *InterfaceMetricItem` NewInterfaceMetricItem instantiates a new InterfaceMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *InterfaceMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *InterfaceMetricItem) GetMessages() int32` +`func (o *InterfaceMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *InterfaceMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *InterfaceMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *InterfaceMetricItem) SetMessages(v int32)` +`func (o *InterfaceMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *InterfaceMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *InterfaceMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/Item.md b/clients/apiclient/docs/Item.md similarity index 82% rename from client/docs/Item.md rename to clients/apiclient/docs/Item.md index d0f1e27795..ede0c93f98 100644 --- a/client/docs/Item.md +++ b/clients/apiclient/docs/Item.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Key** | Pointer to **string** | key (hex-encoded) | [optional] -**Value** | Pointer to **string** | value (hex-encoded) | [optional] +**Key** | **string** | key (hex-encoded) | +**Value** | **string** | value (hex-encoded) | ## Methods ### NewItem -`func NewItem() *Item` +`func NewItem(key string, value string, ) *Item` NewItem instantiates a new Item object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetKey sets Key field to given value. -### HasKey - -`func (o *Item) HasKey() bool` - -HasKey returns a boolean if a field has been set. ### GetValue @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetValue sets Value field to given value. -### HasValue - -`func (o *Item) HasValue() bool` - -HasValue returns a boolean if a field has been set. [[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/client/docs/JSONDict.md b/clients/apiclient/docs/JSONDict.md similarity index 100% rename from client/docs/JSONDict.md rename to clients/apiclient/docs/JSONDict.md diff --git a/client/docs/L1Params.md b/clients/apiclient/docs/L1Params.md similarity index 78% rename from client/docs/L1Params.md rename to clients/apiclient/docs/L1Params.md index d6e9fe84ae..021891ba0b 100644 --- a/client/docs/L1Params.md +++ b/clients/apiclient/docs/L1Params.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BaseToken** | Pointer to [**BaseToken**](BaseToken.md) | | [optional] -**MaxPayloadSize** | Pointer to **int32** | The max payload size | [optional] -**Protocol** | Pointer to [**ProtocolParameters**](ProtocolParameters.md) | | [optional] +**BaseToken** | [**BaseToken**](BaseToken.md) | | +**MaxPayloadSize** | **int32** | The max payload size | +**Protocol** | [**ProtocolParameters**](ProtocolParameters.md) | | ## Methods ### NewL1Params -`func NewL1Params() *L1Params` +`func NewL1Params(baseToken BaseToken, maxPayloadSize int32, protocol ProtocolParameters, ) *L1Params` NewL1Params instantiates a new L1Params object This constructor will assign default values to properties that have it defined, @@ -46,11 +46,6 @@ and a boolean to check if the value has been set. SetBaseToken sets BaseToken field to given value. -### HasBaseToken - -`func (o *L1Params) HasBaseToken() bool` - -HasBaseToken returns a boolean if a field has been set. ### GetMaxPayloadSize @@ -71,11 +66,6 @@ and a boolean to check if the value has been set. SetMaxPayloadSize sets MaxPayloadSize field to given value. -### HasMaxPayloadSize - -`func (o *L1Params) HasMaxPayloadSize() bool` - -HasMaxPayloadSize returns a boolean if a field has been set. ### GetProtocol @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetProtocol sets Protocol field to given value. -### HasProtocol - -`func (o *L1Params) HasProtocol() bool` - -HasProtocol returns a boolean if a field has been set. [[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/client/docs/MetricsApi.md b/clients/apiclient/docs/MetricsApi.md similarity index 100% rename from client/docs/MetricsApi.md rename to clients/apiclient/docs/MetricsApi.md diff --git a/client/docs/NFTDataResponse.md b/clients/apiclient/docs/NFTDataResponse.md similarity index 79% rename from client/docs/NFTDataResponse.md rename to clients/apiclient/docs/NFTDataResponse.md index 955a30e330..8a5f6a9f89 100644 --- a/client/docs/NFTDataResponse.md +++ b/clients/apiclient/docs/NFTDataResponse.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Issuer** | Pointer to **string** | | [optional] -**Metadata** | Pointer to **string** | | [optional] -**Owner** | Pointer to **string** | | [optional] +**Id** | **string** | | +**Issuer** | **string** | | +**Metadata** | **string** | | +**Owner** | **string** | | ## Methods ### NewNFTDataResponse -`func NewNFTDataResponse() *NFTDataResponse` +`func NewNFTDataResponse(id string, issuer string, metadata string, owner string, ) *NFTDataResponse` NewNFTDataResponse instantiates a new NFTDataResponse object This constructor will assign default values to properties that have it defined, @@ -47,11 +47,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *NFTDataResponse) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetIssuer @@ -72,11 +67,6 @@ and a boolean to check if the value has been set. SetIssuer sets Issuer field to given value. -### HasIssuer - -`func (o *NFTDataResponse) HasIssuer() bool` - -HasIssuer returns a boolean if a field has been set. ### GetMetadata @@ -97,11 +87,6 @@ and a boolean to check if the value has been set. SetMetadata sets Metadata field to given value. -### HasMetadata - -`func (o *NFTDataResponse) HasMetadata() bool` - -HasMetadata returns a boolean if a field has been set. ### GetOwner @@ -122,11 +107,6 @@ and a boolean to check if the value has been set. SetOwner sets Owner field to given value. -### HasOwner - -`func (o *NFTDataResponse) HasOwner() bool` - -HasOwner returns a boolean if a field has been set. [[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/client/docs/NativeToken.md b/clients/apiclient/docs/NativeToken.md similarity index 83% rename from client/docs/NativeToken.md rename to clients/apiclient/docs/NativeToken.md index 4f59f05156..a7a919947c 100644 --- a/client/docs/NativeToken.md +++ b/clients/apiclient/docs/NativeToken.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Amount** | Pointer to **string** | | [optional] -**Id** | Pointer to **string** | | [optional] +**Amount** | **string** | | +**Id** | **string** | | ## Methods ### NewNativeToken -`func NewNativeToken() *NativeToken` +`func NewNativeToken(amount string, id string, ) *NativeToken` NewNativeToken instantiates a new NativeToken object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetAmount sets Amount field to given value. -### HasAmount - -`func (o *NativeToken) HasAmount() bool` - -HasAmount returns a boolean if a field has been set. ### GetId @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *NativeToken) HasId() bool` - -HasId returns a boolean if a field has been set. [[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/client/docs/NativeTokenIDRegistryResponse.md b/clients/apiclient/docs/NativeTokenIDRegistryResponse.md similarity index 84% rename from client/docs/NativeTokenIDRegistryResponse.md rename to clients/apiclient/docs/NativeTokenIDRegistryResponse.md index 1892b72bc7..75d8c6171e 100644 --- a/client/docs/NativeTokenIDRegistryResponse.md +++ b/clients/apiclient/docs/NativeTokenIDRegistryResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NativeTokenRegistryIds** | Pointer to **[]string** | | [optional] +**NativeTokenRegistryIds** | **[]string** | | ## Methods ### NewNativeTokenIDRegistryResponse -`func NewNativeTokenIDRegistryResponse() *NativeTokenIDRegistryResponse` +`func NewNativeTokenIDRegistryResponse(nativeTokenRegistryIds []string, ) *NativeTokenIDRegistryResponse` NewNativeTokenIDRegistryResponse instantiates a new NativeTokenIDRegistryResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetNativeTokenRegistryIds sets NativeTokenRegistryIds field to given value. -### HasNativeTokenRegistryIds - -`func (o *NativeTokenIDRegistryResponse) HasNativeTokenRegistryIds() bool` - -HasNativeTokenRegistryIds returns a boolean if a field has been set. [[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/client/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md similarity index 97% rename from client/docs/NodeApi.md rename to clients/apiclient/docs/NodeApi.md index 5120b95e99..fa3d29dab5 100644 --- a/client/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**GetInfo**](NodeApi.md#GetInfo) | **Get** /node/info | Returns private information about this node. [**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /node/peers/identity | Get basic peer info of the current node [**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /node/peers/trusted | Get trusted peers -[**GetVersion**](NodeApi.md#GetVersion) | **Get** /v2/node/version | Returns the node version. +[**GetVersion**](NodeApi.md#GetVersion) | **Get** /node/version | Returns the node version. [**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /node/owner/certificate | Sets the node owner [**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /node/shutdown | Shut down the node [**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /node/peers/trusted | Trust a peering node @@ -38,7 +38,7 @@ import ( ) func main() { - peeringTrustRequest := *openapiclient.NewPeeringTrustRequest() // PeeringTrustRequest | Info of the peer to distrust + peeringTrustRequest := *openapiclient.NewPeeringTrustRequest("localhost:4000", "0x0000") // PeeringTrustRequest | Info of the peer to distrust configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -100,7 +100,7 @@ import ( ) func main() { - dKSharesPostRequest := *openapiclient.NewDKSharesPostRequest() // DKSharesPostRequest | Request parameters + dKSharesPostRequest := *openapiclient.NewDKSharesPostRequest([]string{"PeerIdentities_example"}, uint32(123), uint32(123)) // DKSharesPostRequest | Request parameters configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -586,7 +586,7 @@ import ( ) func main() { - nodeOwnerCertificateRequest := *openapiclient.NewNodeOwnerCertificateRequest() // NodeOwnerCertificateRequest | The node owner certificate + nodeOwnerCertificateRequest := *openapiclient.NewNodeOwnerCertificateRequest("OwnerAddress_example", "PublicKey_example") // NodeOwnerCertificateRequest | The node owner certificate configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -705,7 +705,7 @@ import ( ) func main() { - peeringTrustRequest := *openapiclient.NewPeeringTrustRequest() // PeeringTrustRequest | Info of the peer to trust + peeringTrustRequest := *openapiclient.NewPeeringTrustRequest("localhost:4000", "0x0000") // PeeringTrustRequest | Info of the peer to trust configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/client/docs/NodeOwnerCertificateRequest.md b/clients/apiclient/docs/NodeOwnerCertificateRequest.md similarity index 80% rename from client/docs/NodeOwnerCertificateRequest.md rename to clients/apiclient/docs/NodeOwnerCertificateRequest.md index 5a492cffe4..9e14a49176 100644 --- a/client/docs/NodeOwnerCertificateRequest.md +++ b/clients/apiclient/docs/NodeOwnerCertificateRequest.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**OwnerAddress** | Pointer to **string** | Node owner address. (Bech32) | [optional] -**PublicKey** | Pointer to **string** | The public key of the node (Hex) | [optional] +**OwnerAddress** | **string** | Node owner address. (Bech32) | +**PublicKey** | **string** | The public key of the node (Hex) | ## Methods ### NewNodeOwnerCertificateRequest -`func NewNodeOwnerCertificateRequest() *NodeOwnerCertificateRequest` +`func NewNodeOwnerCertificateRequest(ownerAddress string, publicKey string, ) *NodeOwnerCertificateRequest` NewNodeOwnerCertificateRequest instantiates a new NodeOwnerCertificateRequest object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetOwnerAddress sets OwnerAddress field to given value. -### HasOwnerAddress - -`func (o *NodeOwnerCertificateRequest) HasOwnerAddress() bool` - -HasOwnerAddress returns a boolean if a field has been set. ### GetPublicKey @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetPublicKey sets PublicKey field to given value. -### HasPublicKey - -`func (o *NodeOwnerCertificateRequest) HasPublicKey() bool` - -HasPublicKey returns a boolean if a field has been set. [[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/client/docs/OffLedgerRequest.md b/clients/apiclient/docs/OffLedgerRequest.md similarity index 81% rename from client/docs/OffLedgerRequest.md rename to clients/apiclient/docs/OffLedgerRequest.md index 2201b4f84b..4550dc5102 100644 --- a/client/docs/OffLedgerRequest.md +++ b/clients/apiclient/docs/OffLedgerRequest.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ChainId** | Pointer to **string** | The chain id | [optional] -**Request** | Pointer to **string** | Offledger Request (Hex) | [optional] +**ChainId** | **string** | The chain id | +**Request** | **string** | Offledger Request (Hex) | ## Methods ### NewOffLedgerRequest -`func NewOffLedgerRequest() *OffLedgerRequest` +`func NewOffLedgerRequest(chainId string, request string, ) *OffLedgerRequest` NewOffLedgerRequest instantiates a new OffLedgerRequest object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetChainId sets ChainId field to given value. -### HasChainId - -`func (o *OffLedgerRequest) HasChainId() bool` - -HasChainId returns a boolean if a field has been set. ### GetRequest @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetRequest sets Request field to given value. -### HasRequest - -`func (o *OffLedgerRequest) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. [[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/client/docs/OnLedgerRequest.md b/clients/apiclient/docs/OnLedgerRequest.md similarity index 77% rename from client/docs/OnLedgerRequest.md rename to clients/apiclient/docs/OnLedgerRequest.md index c72a990c37..3cbafa62d6 100644 --- a/client/docs/OnLedgerRequest.md +++ b/clients/apiclient/docs/OnLedgerRequest.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | The request ID | [optional] -**Output** | Pointer to [**Output**](Output.md) | | [optional] -**OutputId** | Pointer to **string** | The output ID | [optional] -**Raw** | Pointer to **string** | The raw data of the request (Hex) | [optional] +**Id** | **string** | The request ID | +**Output** | [**Output**](Output.md) | | +**OutputId** | **string** | The output ID | +**Raw** | **string** | The raw data of the request (Hex) | ## Methods ### NewOnLedgerRequest -`func NewOnLedgerRequest() *OnLedgerRequest` +`func NewOnLedgerRequest(id string, output Output, outputId string, raw string, ) *OnLedgerRequest` NewOnLedgerRequest instantiates a new OnLedgerRequest object This constructor will assign default values to properties that have it defined, @@ -47,11 +47,6 @@ and a boolean to check if the value has been set. SetId sets Id field to given value. -### HasId - -`func (o *OnLedgerRequest) HasId() bool` - -HasId returns a boolean if a field has been set. ### GetOutput @@ -72,11 +67,6 @@ and a boolean to check if the value has been set. SetOutput sets Output field to given value. -### HasOutput - -`func (o *OnLedgerRequest) HasOutput() bool` - -HasOutput returns a boolean if a field has been set. ### GetOutputId @@ -97,11 +87,6 @@ and a boolean to check if the value has been set. SetOutputId sets OutputId field to given value. -### HasOutputId - -`func (o *OnLedgerRequest) HasOutputId() bool` - -HasOutputId returns a boolean if a field has been set. ### GetRaw @@ -122,11 +107,6 @@ and a boolean to check if the value has been set. SetRaw sets Raw field to given value. -### HasRaw - -`func (o *OnLedgerRequest) HasRaw() bool` - -HasRaw returns a boolean if a field has been set. [[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/client/docs/OnLedgerRequestMetricItem.md b/clients/apiclient/docs/OnLedgerRequestMetricItem.md similarity index 74% rename from client/docs/OnLedgerRequestMetricItem.md rename to clients/apiclient/docs/OnLedgerRequestMetricItem.md index e892b23699..a2c39fa285 100644 --- a/client/docs/OnLedgerRequestMetricItem.md +++ b/clients/apiclient/docs/OnLedgerRequestMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**OnLedgerRequest**](OnLedgerRequest.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**OnLedgerRequest**](OnLedgerRequest.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewOnLedgerRequestMetricItem -`func NewOnLedgerRequestMetricItem() *OnLedgerRequestMetricItem` +`func NewOnLedgerRequestMetricItem(lastMessage OnLedgerRequest, messages uint32, timestamp time.Time, ) *OnLedgerRequestMetricItem` NewOnLedgerRequestMetricItem instantiates a new OnLedgerRequestMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *OnLedgerRequestMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *OnLedgerRequestMetricItem) GetMessages() int32` +`func (o *OnLedgerRequestMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *OnLedgerRequestMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *OnLedgerRequestMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *OnLedgerRequestMetricItem) SetMessages(v int32)` +`func (o *OnLedgerRequestMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *OnLedgerRequestMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *OnLedgerRequestMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/Output.md b/clients/apiclient/docs/Output.md similarity index 81% rename from client/docs/Output.md rename to clients/apiclient/docs/Output.md index 0af603c808..669acce103 100644 --- a/client/docs/Output.md +++ b/clients/apiclient/docs/Output.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**OutputType** | Pointer to **int32** | The output type | [optional] -**Raw** | Pointer to **string** | The raw data of the output (Hex) | [optional] +**OutputType** | **int32** | The output type | +**Raw** | **string** | The raw data of the output (Hex) | ## Methods ### NewOutput -`func NewOutput() *Output` +`func NewOutput(outputType int32, raw string, ) *Output` NewOutput instantiates a new Output object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetOutputType sets OutputType field to given value. -### HasOutputType - -`func (o *Output) HasOutputType() bool` - -HasOutputType returns a boolean if a field has been set. ### GetRaw @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetRaw sets Raw field to given value. -### HasRaw - -`func (o *Output) HasRaw() bool` - -HasRaw returns a boolean if a field has been set. [[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/client/docs/OutputID.md b/clients/apiclient/docs/OutputID.md similarity index 86% rename from client/docs/OutputID.md rename to clients/apiclient/docs/OutputID.md index b40bbd1b3b..6e64156ca4 100644 --- a/client/docs/OutputID.md +++ b/clients/apiclient/docs/OutputID.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**OutputId** | Pointer to **string** | The output ID | [optional] +**OutputId** | **string** | The output ID | ## Methods ### NewOutputID -`func NewOutputID() *OutputID` +`func NewOutputID(outputId string, ) *OutputID` NewOutputID instantiates a new OutputID object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetOutputId sets OutputId field to given value. -### HasOutputId - -`func (o *OutputID) HasOutputId() bool` - -HasOutputId returns a boolean if a field has been set. [[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/client/docs/PeeringNodeIdentityResponse.md b/clients/apiclient/docs/PeeringNodeIdentityResponse.md similarity index 79% rename from client/docs/PeeringNodeIdentityResponse.md rename to clients/apiclient/docs/PeeringNodeIdentityResponse.md index 09f83128ab..4378e55c1d 100644 --- a/client/docs/PeeringNodeIdentityResponse.md +++ b/clients/apiclient/docs/PeeringNodeIdentityResponse.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**IsTrusted** | Pointer to **bool** | | [optional] -**NetId** | Pointer to **string** | The NetID of the peer | [optional] -**PublicKey** | Pointer to **string** | The peers public key encoded in Hex | [optional] +**IsTrusted** | **bool** | | +**NetId** | **string** | The NetID of the peer | +**PublicKey** | **string** | The peers public key encoded in Hex | ## Methods ### NewPeeringNodeIdentityResponse -`func NewPeeringNodeIdentityResponse() *PeeringNodeIdentityResponse` +`func NewPeeringNodeIdentityResponse(isTrusted bool, netId string, publicKey string, ) *PeeringNodeIdentityResponse` NewPeeringNodeIdentityResponse instantiates a new PeeringNodeIdentityResponse object This constructor will assign default values to properties that have it defined, @@ -46,11 +46,6 @@ and a boolean to check if the value has been set. SetIsTrusted sets IsTrusted field to given value. -### HasIsTrusted - -`func (o *PeeringNodeIdentityResponse) HasIsTrusted() bool` - -HasIsTrusted returns a boolean if a field has been set. ### GetNetId @@ -71,11 +66,6 @@ and a boolean to check if the value has been set. SetNetId sets NetId field to given value. -### HasNetId - -`func (o *PeeringNodeIdentityResponse) HasNetId() bool` - -HasNetId returns a boolean if a field has been set. ### GetPublicKey @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetPublicKey sets PublicKey field to given value. -### HasPublicKey - -`func (o *PeeringNodeIdentityResponse) HasPublicKey() bool` - -HasPublicKey returns a boolean if a field has been set. [[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/client/docs/PeeringNodeStatusResponse.md b/clients/apiclient/docs/PeeringNodeStatusResponse.md similarity index 76% rename from client/docs/PeeringNodeStatusResponse.md rename to clients/apiclient/docs/PeeringNodeStatusResponse.md index a82d5c3109..69423b3092 100644 --- a/client/docs/PeeringNodeStatusResponse.md +++ b/clients/apiclient/docs/PeeringNodeStatusResponse.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**IsAlive** | Pointer to **bool** | Whether or not the peer is activated | [optional] -**IsTrusted** | Pointer to **bool** | | [optional] -**NetId** | Pointer to **string** | The NetID of the peer | [optional] -**NumUsers** | Pointer to **int32** | The amount of users attached to the peer | [optional] -**PublicKey** | Pointer to **string** | The peers public key encoded in Hex | [optional] +**IsAlive** | **bool** | Whether or not the peer is activated | +**IsTrusted** | **bool** | | +**NetId** | **string** | The NetID of the peer | +**NumUsers** | **int32** | The amount of users attached to the peer | +**PublicKey** | **string** | The peers public key encoded in Hex | ## Methods ### NewPeeringNodeStatusResponse -`func NewPeeringNodeStatusResponse() *PeeringNodeStatusResponse` +`func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers int32, publicKey string, ) *PeeringNodeStatusResponse` NewPeeringNodeStatusResponse instantiates a new PeeringNodeStatusResponse object This constructor will assign default values to properties that have it defined, @@ -48,11 +48,6 @@ and a boolean to check if the value has been set. SetIsAlive sets IsAlive field to given value. -### HasIsAlive - -`func (o *PeeringNodeStatusResponse) HasIsAlive() bool` - -HasIsAlive returns a boolean if a field has been set. ### GetIsTrusted @@ -73,11 +68,6 @@ and a boolean to check if the value has been set. SetIsTrusted sets IsTrusted field to given value. -### HasIsTrusted - -`func (o *PeeringNodeStatusResponse) HasIsTrusted() bool` - -HasIsTrusted returns a boolean if a field has been set. ### GetNetId @@ -98,11 +88,6 @@ and a boolean to check if the value has been set. SetNetId sets NetId field to given value. -### HasNetId - -`func (o *PeeringNodeStatusResponse) HasNetId() bool` - -HasNetId returns a boolean if a field has been set. ### GetNumUsers @@ -123,11 +108,6 @@ and a boolean to check if the value has been set. SetNumUsers sets NumUsers field to given value. -### HasNumUsers - -`func (o *PeeringNodeStatusResponse) HasNumUsers() bool` - -HasNumUsers returns a boolean if a field has been set. ### GetPublicKey @@ -148,11 +128,6 @@ and a boolean to check if the value has been set. SetPublicKey sets PublicKey field to given value. -### HasPublicKey - -`func (o *PeeringNodeStatusResponse) HasPublicKey() bool` - -HasPublicKey returns a boolean if a field has been set. [[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/client/docs/PeeringTrustRequest.md b/clients/apiclient/docs/PeeringTrustRequest.md similarity index 80% rename from client/docs/PeeringTrustRequest.md rename to clients/apiclient/docs/PeeringTrustRequest.md index a3a3d93311..de60f9c99f 100644 --- a/client/docs/PeeringTrustRequest.md +++ b/clients/apiclient/docs/PeeringTrustRequest.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NetId** | Pointer to **string** | The NetID of the peer | [optional] -**PublicKey** | Pointer to **string** | The peers public key encoded in Hex | [optional] +**NetId** | **string** | The NetID of the peer | +**PublicKey** | **string** | The peers public key encoded in Hex | ## Methods ### NewPeeringTrustRequest -`func NewPeeringTrustRequest() *PeeringTrustRequest` +`func NewPeeringTrustRequest(netId string, publicKey string, ) *PeeringTrustRequest` NewPeeringTrustRequest instantiates a new PeeringTrustRequest object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetNetId sets NetId field to given value. -### HasNetId - -`func (o *PeeringTrustRequest) HasNetId() bool` - -HasNetId returns a boolean if a field has been set. ### GetPublicKey @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetPublicKey sets PublicKey field to given value. -### HasPublicKey - -`func (o *PeeringTrustRequest) HasPublicKey() bool` - -HasPublicKey returns a boolean if a field has been set. [[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/client/docs/ProtocolParameters.md b/clients/apiclient/docs/ProtocolParameters.md similarity index 69% rename from client/docs/ProtocolParameters.md rename to clients/apiclient/docs/ProtocolParameters.md index 6bbe1a11c1..14141e5189 100644 --- a/client/docs/ProtocolParameters.md +++ b/clients/apiclient/docs/ProtocolParameters.md @@ -4,19 +4,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bech32Hrp** | Pointer to **string** | The human readable network prefix | [optional] -**BelowMaxDepth** | Pointer to **int32** | The networks max depth | [optional] -**MinPowScore** | Pointer to **int32** | The minimal PoW score | [optional] -**NetworkName** | Pointer to **string** | The network name | [optional] -**RentStructure** | Pointer to [**RentStructure**](RentStructure.md) | | [optional] -**TokenSupply** | Pointer to **string** | The token supply | [optional] -**Version** | Pointer to **int32** | The protocol version | [optional] +**Bech32Hrp** | **string** | The human readable network prefix | +**BelowMaxDepth** | **uint32** | The networks max depth | +**MinPowScore** | **uint32** | The minimal PoW score | +**NetworkName** | **string** | The network name | +**RentStructure** | [**RentStructure**](RentStructure.md) | | +**TokenSupply** | **string** | The token supply | +**Version** | **int32** | The protocol version | ## Methods ### NewProtocolParameters -`func NewProtocolParameters() *ProtocolParameters` +`func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version int32, ) *ProtocolParameters` NewProtocolParameters instantiates a new ProtocolParameters object This constructor will assign default values to properties that have it defined, @@ -50,61 +50,46 @@ and a boolean to check if the value has been set. SetBech32Hrp sets Bech32Hrp field to given value. -### HasBech32Hrp - -`func (o *ProtocolParameters) HasBech32Hrp() bool` - -HasBech32Hrp returns a boolean if a field has been set. ### GetBelowMaxDepth -`func (o *ProtocolParameters) GetBelowMaxDepth() int32` +`func (o *ProtocolParameters) GetBelowMaxDepth() uint32` GetBelowMaxDepth returns the BelowMaxDepth field if non-nil, zero value otherwise. ### GetBelowMaxDepthOk -`func (o *ProtocolParameters) GetBelowMaxDepthOk() (*int32, bool)` +`func (o *ProtocolParameters) GetBelowMaxDepthOk() (*uint32, bool)` GetBelowMaxDepthOk returns a tuple with the BelowMaxDepth field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBelowMaxDepth -`func (o *ProtocolParameters) SetBelowMaxDepth(v int32)` +`func (o *ProtocolParameters) SetBelowMaxDepth(v uint32)` SetBelowMaxDepth sets BelowMaxDepth field to given value. -### HasBelowMaxDepth - -`func (o *ProtocolParameters) HasBelowMaxDepth() bool` - -HasBelowMaxDepth returns a boolean if a field has been set. ### GetMinPowScore -`func (o *ProtocolParameters) GetMinPowScore() int32` +`func (o *ProtocolParameters) GetMinPowScore() uint32` GetMinPowScore returns the MinPowScore field if non-nil, zero value otherwise. ### GetMinPowScoreOk -`func (o *ProtocolParameters) GetMinPowScoreOk() (*int32, bool)` +`func (o *ProtocolParameters) GetMinPowScoreOk() (*uint32, bool)` GetMinPowScoreOk returns a tuple with the MinPowScore field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMinPowScore -`func (o *ProtocolParameters) SetMinPowScore(v int32)` +`func (o *ProtocolParameters) SetMinPowScore(v uint32)` SetMinPowScore sets MinPowScore field to given value. -### HasMinPowScore - -`func (o *ProtocolParameters) HasMinPowScore() bool` - -HasMinPowScore returns a boolean if a field has been set. ### GetNetworkName @@ -125,11 +110,6 @@ and a boolean to check if the value has been set. SetNetworkName sets NetworkName field to given value. -### HasNetworkName - -`func (o *ProtocolParameters) HasNetworkName() bool` - -HasNetworkName returns a boolean if a field has been set. ### GetRentStructure @@ -150,11 +130,6 @@ and a boolean to check if the value has been set. SetRentStructure sets RentStructure field to given value. -### HasRentStructure - -`func (o *ProtocolParameters) HasRentStructure() bool` - -HasRentStructure returns a boolean if a field has been set. ### GetTokenSupply @@ -175,11 +150,6 @@ and a boolean to check if the value has been set. SetTokenSupply sets TokenSupply field to given value. -### HasTokenSupply - -`func (o *ProtocolParameters) HasTokenSupply() bool` - -HasTokenSupply returns a boolean if a field has been set. ### GetVersion @@ -200,11 +170,6 @@ and a boolean to check if the value has been set. SetVersion sets Version field to given value. -### HasVersion - -`func (o *ProtocolParameters) HasVersion() bool` - -HasVersion returns a boolean if a field has been set. [[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/client/docs/ReceiptError.md b/clients/apiclient/docs/ReceiptError.md similarity index 74% rename from client/docs/ReceiptError.md rename to clients/apiclient/docs/ReceiptError.md index 2b0f3cbad3..960d58339d 100644 --- a/client/docs/ReceiptError.md +++ b/clients/apiclient/docs/ReceiptError.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ContractId** | Pointer to **int32** | | [optional] -**ErrorCode** | Pointer to **string** | | [optional] -**ErrorId** | Pointer to **int32** | | [optional] -**Message** | Pointer to **string** | | [optional] -**MessageFormat** | Pointer to **string** | | [optional] -**Parameters** | Pointer to **[]string** | | [optional] +**ContractId** | **int32** | | +**ErrorCode** | **string** | | +**ErrorId** | **uint32** | | +**Message** | **string** | | +**MessageFormat** | **string** | | +**Parameters** | **[]string** | | ## Methods ### NewReceiptError -`func NewReceiptError() *ReceiptError` +`func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` NewReceiptError instantiates a new ReceiptError object This constructor will assign default values to properties that have it defined, @@ -49,11 +49,6 @@ and a boolean to check if the value has been set. SetContractId sets ContractId field to given value. -### HasContractId - -`func (o *ReceiptError) HasContractId() bool` - -HasContractId returns a boolean if a field has been set. ### GetErrorCode @@ -74,36 +69,26 @@ and a boolean to check if the value has been set. SetErrorCode sets ErrorCode field to given value. -### HasErrorCode - -`func (o *ReceiptError) HasErrorCode() bool` - -HasErrorCode returns a boolean if a field has been set. ### GetErrorId -`func (o *ReceiptError) GetErrorId() int32` +`func (o *ReceiptError) GetErrorId() uint32` GetErrorId returns the ErrorId field if non-nil, zero value otherwise. ### GetErrorIdOk -`func (o *ReceiptError) GetErrorIdOk() (*int32, bool)` +`func (o *ReceiptError) GetErrorIdOk() (*uint32, bool)` GetErrorIdOk returns a tuple with the ErrorId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetErrorId -`func (o *ReceiptError) SetErrorId(v int32)` +`func (o *ReceiptError) SetErrorId(v uint32)` SetErrorId sets ErrorId field to given value. -### HasErrorId - -`func (o *ReceiptError) HasErrorId() bool` - -HasErrorId returns a boolean if a field has been set. ### GetMessage @@ -124,11 +109,6 @@ and a boolean to check if the value has been set. SetMessage sets Message field to given value. -### HasMessage - -`func (o *ReceiptError) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. ### GetMessageFormat @@ -149,11 +129,6 @@ and a boolean to check if the value has been set. SetMessageFormat sets MessageFormat field to given value. -### HasMessageFormat - -`func (o *ReceiptError) HasMessageFormat() bool` - -HasMessageFormat returns a boolean if a field has been set. ### GetParameters @@ -174,11 +149,6 @@ and a boolean to check if the value has been set. SetParameters sets Parameters field to given value. -### HasParameters - -`func (o *ReceiptError) HasParameters() bool` - -HasParameters returns a boolean if a field has been set. [[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/client/docs/ReceiptResponse.md b/clients/apiclient/docs/ReceiptResponse.md similarity index 74% rename from client/docs/ReceiptResponse.md rename to clients/apiclient/docs/ReceiptResponse.md index 8987ab13fa..e6e45e455f 100644 --- a/client/docs/ReceiptResponse.md +++ b/clients/apiclient/docs/ReceiptResponse.md @@ -4,20 +4,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BlockIndex** | Pointer to **int32** | | [optional] +**BlockIndex** | **uint32** | | **Error** | Pointer to [**ReceiptError**](ReceiptError.md) | | [optional] -**GasBudget** | Pointer to **int64** | | [optional] -**GasBurnLog** | Pointer to [**[]BurnRecord**](BurnRecord.md) | | [optional] -**GasBurned** | Pointer to **int64** | | [optional] -**GasFeeCharged** | Pointer to **int64** | | [optional] -**Request** | Pointer to **string** | | [optional] -**RequestIndex** | Pointer to **int32** | | [optional] +**GasBudget** | **int64** | | +**GasBurnLog** | [**[]BurnRecord**](BurnRecord.md) | | +**GasBurned** | **int64** | | +**GasFeeCharged** | **int64** | | +**Request** | **string** | | +**RequestIndex** | **uint32** | | ## Methods ### NewReceiptResponse -`func NewReceiptResponse() *ReceiptResponse` +`func NewReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog []BurnRecord, gasBurned int64, gasFeeCharged int64, request string, requestIndex uint32, ) *ReceiptResponse` NewReceiptResponse instantiates a new ReceiptResponse object This constructor will assign default values to properties that have it defined, @@ -34,28 +34,23 @@ but it doesn't guarantee that properties required by API are set ### GetBlockIndex -`func (o *ReceiptResponse) GetBlockIndex() int32` +`func (o *ReceiptResponse) GetBlockIndex() uint32` GetBlockIndex returns the BlockIndex field if non-nil, zero value otherwise. ### GetBlockIndexOk -`func (o *ReceiptResponse) GetBlockIndexOk() (*int32, bool)` +`func (o *ReceiptResponse) GetBlockIndexOk() (*uint32, bool)` GetBlockIndexOk returns a tuple with the BlockIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBlockIndex -`func (o *ReceiptResponse) SetBlockIndex(v int32)` +`func (o *ReceiptResponse) SetBlockIndex(v uint32)` SetBlockIndex sets BlockIndex field to given value. -### HasBlockIndex - -`func (o *ReceiptResponse) HasBlockIndex() bool` - -HasBlockIndex returns a boolean if a field has been set. ### GetError @@ -101,11 +96,6 @@ and a boolean to check if the value has been set. SetGasBudget sets GasBudget field to given value. -### HasGasBudget - -`func (o *ReceiptResponse) HasGasBudget() bool` - -HasGasBudget returns a boolean if a field has been set. ### GetGasBurnLog @@ -126,11 +116,6 @@ and a boolean to check if the value has been set. SetGasBurnLog sets GasBurnLog field to given value. -### HasGasBurnLog - -`func (o *ReceiptResponse) HasGasBurnLog() bool` - -HasGasBurnLog returns a boolean if a field has been set. ### GetGasBurned @@ -151,11 +136,6 @@ and a boolean to check if the value has been set. SetGasBurned sets GasBurned field to given value. -### HasGasBurned - -`func (o *ReceiptResponse) HasGasBurned() bool` - -HasGasBurned returns a boolean if a field has been set. ### GetGasFeeCharged @@ -176,11 +156,6 @@ and a boolean to check if the value has been set. SetGasFeeCharged sets GasFeeCharged field to given value. -### HasGasFeeCharged - -`func (o *ReceiptResponse) HasGasFeeCharged() bool` - -HasGasFeeCharged returns a boolean if a field has been set. ### GetRequest @@ -201,36 +176,26 @@ and a boolean to check if the value has been set. SetRequest sets Request field to given value. -### HasRequest - -`func (o *ReceiptResponse) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. ### GetRequestIndex -`func (o *ReceiptResponse) GetRequestIndex() int32` +`func (o *ReceiptResponse) GetRequestIndex() uint32` GetRequestIndex returns the RequestIndex field if non-nil, zero value otherwise. ### GetRequestIndexOk -`func (o *ReceiptResponse) GetRequestIndexOk() (*int32, bool)` +`func (o *ReceiptResponse) GetRequestIndexOk() (*uint32, bool)` GetRequestIndexOk returns a tuple with the RequestIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRequestIndex -`func (o *ReceiptResponse) SetRequestIndex(v int32)` +`func (o *ReceiptResponse) SetRequestIndex(v uint32)` SetRequestIndex sets RequestIndex field to given value. -### HasRequestIndex - -`func (o *ReceiptResponse) HasRequestIndex() bool` - -HasRequestIndex returns a boolean if a field has been set. [[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/client/docs/RentStructure.md b/clients/apiclient/docs/RentStructure.md similarity index 72% rename from client/docs/RentStructure.md rename to clients/apiclient/docs/RentStructure.md index 6e418f9e08..6c15d4dc9d 100644 --- a/client/docs/RentStructure.md +++ b/clients/apiclient/docs/RentStructure.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**VByteCost** | Pointer to **int32** | The virtual byte cost | [optional] -**VByteFactorData** | Pointer to **int32** | The virtual byte factor for data fields | [optional] -**VByteFactorKey** | Pointer to **int32** | The virtual byte factor for key/lookup generating fields | [optional] +**VByteCost** | **uint32** | The virtual byte cost | +**VByteFactorData** | **int32** | The virtual byte factor for data fields | +**VByteFactorKey** | **int32** | The virtual byte factor for key/lookup generating fields | ## Methods ### NewRentStructure -`func NewRentStructure() *RentStructure` +`func NewRentStructure(vByteCost uint32, vByteFactorData int32, vByteFactorKey int32, ) *RentStructure` NewRentStructure instantiates a new RentStructure object This constructor will assign default values to properties that have it defined, @@ -29,28 +29,23 @@ but it doesn't guarantee that properties required by API are set ### GetVByteCost -`func (o *RentStructure) GetVByteCost() int32` +`func (o *RentStructure) GetVByteCost() uint32` GetVByteCost returns the VByteCost field if non-nil, zero value otherwise. ### GetVByteCostOk -`func (o *RentStructure) GetVByteCostOk() (*int32, bool)` +`func (o *RentStructure) GetVByteCostOk() (*uint32, bool)` GetVByteCostOk returns a tuple with the VByteCost field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVByteCost -`func (o *RentStructure) SetVByteCost(v int32)` +`func (o *RentStructure) SetVByteCost(v uint32)` SetVByteCost sets VByteCost field to given value. -### HasVByteCost - -`func (o *RentStructure) HasVByteCost() bool` - -HasVByteCost returns a boolean if a field has been set. ### GetVByteFactorData @@ -71,11 +66,6 @@ and a boolean to check if the value has been set. SetVByteFactorData sets VByteFactorData field to given value. -### HasVByteFactorData - -`func (o *RentStructure) HasVByteFactorData() bool` - -HasVByteFactorData returns a boolean if a field has been set. ### GetVByteFactorKey @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetVByteFactorKey sets VByteFactorKey field to given value. -### HasVByteFactorKey - -`func (o *RentStructure) HasVByteFactorKey() bool` - -HasVByteFactorKey returns a boolean if a field has been set. [[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/client/docs/RequestDetail.md b/clients/apiclient/docs/RequestDetail.md similarity index 75% rename from client/docs/RequestDetail.md rename to clients/apiclient/docs/RequestDetail.md index 95f3fd5b18..a5e145ae60 100644 --- a/client/docs/RequestDetail.md +++ b/clients/apiclient/docs/RequestDetail.md @@ -4,23 +4,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Allowance** | Pointer to [**Allowance**](Allowance.md) | | [optional] -**CallTarget** | Pointer to [**CallTarget**](CallTarget.md) | | [optional] -**FungibleTokens** | Pointer to [**FungibleTokens**](FungibleTokens.md) | | [optional] -**GasGudget** | Pointer to **int64** | | [optional] -**IsEVM** | Pointer to **bool** | | [optional] -**IsOffLedger** | Pointer to **bool** | | [optional] -**Nft** | Pointer to [**NFTDataResponse**](NFTDataResponse.md) | | [optional] -**Params** | Pointer to [**JSONDict**](JSONDict.md) | | [optional] -**RequestId** | Pointer to **string** | | [optional] -**SenderAccount** | Pointer to **string** | | [optional] -**TargetAddress** | Pointer to **string** | | [optional] +**Allowance** | [**Allowance**](Allowance.md) | | +**CallTarget** | [**CallTarget**](CallTarget.md) | | +**FungibleTokens** | [**FungibleTokens**](FungibleTokens.md) | | +**GasGudget** | **int64** | | +**IsEVM** | **bool** | | +**IsOffLedger** | **bool** | | +**Nft** | [**NFTDataResponse**](NFTDataResponse.md) | | +**Params** | [**JSONDict**](JSONDict.md) | | +**RequestId** | **string** | | +**SenderAccount** | **string** | | +**TargetAddress** | **string** | | ## Methods ### NewRequestDetail -`func NewRequestDetail() *RequestDetail` +`func NewRequestDetail(allowance Allowance, callTarget CallTarget, fungibleTokens FungibleTokens, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string, ) *RequestDetail` NewRequestDetail instantiates a new RequestDetail object This constructor will assign default values to properties that have it defined, @@ -54,11 +54,6 @@ and a boolean to check if the value has been set. SetAllowance sets Allowance field to given value. -### HasAllowance - -`func (o *RequestDetail) HasAllowance() bool` - -HasAllowance returns a boolean if a field has been set. ### GetCallTarget @@ -79,11 +74,6 @@ and a boolean to check if the value has been set. SetCallTarget sets CallTarget field to given value. -### HasCallTarget - -`func (o *RequestDetail) HasCallTarget() bool` - -HasCallTarget returns a boolean if a field has been set. ### GetFungibleTokens @@ -104,11 +94,6 @@ and a boolean to check if the value has been set. SetFungibleTokens sets FungibleTokens field to given value. -### HasFungibleTokens - -`func (o *RequestDetail) HasFungibleTokens() bool` - -HasFungibleTokens returns a boolean if a field has been set. ### GetGasGudget @@ -129,11 +114,6 @@ and a boolean to check if the value has been set. SetGasGudget sets GasGudget field to given value. -### HasGasGudget - -`func (o *RequestDetail) HasGasGudget() bool` - -HasGasGudget returns a boolean if a field has been set. ### GetIsEVM @@ -154,11 +134,6 @@ and a boolean to check if the value has been set. SetIsEVM sets IsEVM field to given value. -### HasIsEVM - -`func (o *RequestDetail) HasIsEVM() bool` - -HasIsEVM returns a boolean if a field has been set. ### GetIsOffLedger @@ -179,11 +154,6 @@ and a boolean to check if the value has been set. SetIsOffLedger sets IsOffLedger field to given value. -### HasIsOffLedger - -`func (o *RequestDetail) HasIsOffLedger() bool` - -HasIsOffLedger returns a boolean if a field has been set. ### GetNft @@ -204,11 +174,6 @@ and a boolean to check if the value has been set. SetNft sets Nft field to given value. -### HasNft - -`func (o *RequestDetail) HasNft() bool` - -HasNft returns a boolean if a field has been set. ### GetParams @@ -229,11 +194,6 @@ and a boolean to check if the value has been set. SetParams sets Params field to given value. -### HasParams - -`func (o *RequestDetail) HasParams() bool` - -HasParams returns a boolean if a field has been set. ### GetRequestId @@ -254,11 +214,6 @@ and a boolean to check if the value has been set. SetRequestId sets RequestId field to given value. -### HasRequestId - -`func (o *RequestDetail) HasRequestId() bool` - -HasRequestId returns a boolean if a field has been set. ### GetSenderAccount @@ -279,11 +234,6 @@ and a boolean to check if the value has been set. SetSenderAccount sets SenderAccount field to given value. -### HasSenderAccount - -`func (o *RequestDetail) HasSenderAccount() bool` - -HasSenderAccount returns a boolean if a field has been set. ### GetTargetAddress @@ -304,11 +254,6 @@ and a boolean to check if the value has been set. SetTargetAddress sets TargetAddress field to given value. -### HasTargetAddress - -`func (o *RequestDetail) HasTargetAddress() bool` - -HasTargetAddress returns a boolean if a field has been set. [[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/client/docs/RequestIDsResponse.md b/clients/apiclient/docs/RequestIDsResponse.md similarity index 86% rename from client/docs/RequestIDsResponse.md rename to clients/apiclient/docs/RequestIDsResponse.md index b4eb209f58..dd172564a0 100644 --- a/client/docs/RequestIDsResponse.md +++ b/clients/apiclient/docs/RequestIDsResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**RequestIds** | Pointer to **[]string** | | [optional] +**RequestIds** | **[]string** | | ## Methods ### NewRequestIDsResponse -`func NewRequestIDsResponse() *RequestIDsResponse` +`func NewRequestIDsResponse(requestIds []string, ) *RequestIDsResponse` NewRequestIDsResponse instantiates a new RequestIDsResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetRequestIds sets RequestIds field to given value. -### HasRequestIds - -`func (o *RequestIDsResponse) HasRequestIds() bool` - -HasRequestIds returns a boolean if a field has been set. [[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/client/docs/RequestProcessedResponse.md b/clients/apiclient/docs/RequestProcessedResponse.md similarity index 80% rename from client/docs/RequestProcessedResponse.md rename to clients/apiclient/docs/RequestProcessedResponse.md index 8359a6140e..13b524fc52 100644 --- a/client/docs/RequestProcessedResponse.md +++ b/clients/apiclient/docs/RequestProcessedResponse.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ChainId** | Pointer to **string** | | [optional] -**IsProcessed** | Pointer to **bool** | | [optional] -**RequestId** | Pointer to **string** | | [optional] +**ChainId** | **string** | | +**IsProcessed** | **bool** | | +**RequestId** | **string** | | ## Methods ### NewRequestProcessedResponse -`func NewRequestProcessedResponse() *RequestProcessedResponse` +`func NewRequestProcessedResponse(chainId string, isProcessed bool, requestId string, ) *RequestProcessedResponse` NewRequestProcessedResponse instantiates a new RequestProcessedResponse object This constructor will assign default values to properties that have it defined, @@ -46,11 +46,6 @@ and a boolean to check if the value has been set. SetChainId sets ChainId field to given value. -### HasChainId - -`func (o *RequestProcessedResponse) HasChainId() bool` - -HasChainId returns a boolean if a field has been set. ### GetIsProcessed @@ -71,11 +66,6 @@ and a boolean to check if the value has been set. SetIsProcessed sets IsProcessed field to given value. -### HasIsProcessed - -`func (o *RequestProcessedResponse) HasIsProcessed() bool` - -HasIsProcessed returns a boolean if a field has been set. ### GetRequestId @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetRequestId sets RequestId field to given value. -### HasRequestId - -`func (o *RequestProcessedResponse) HasRequestId() bool` - -HasRequestId returns a boolean if a field has been set. [[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/client/docs/RequestReceiptResponse.md b/clients/apiclient/docs/RequestReceiptResponse.md similarity index 70% rename from client/docs/RequestReceiptResponse.md rename to clients/apiclient/docs/RequestReceiptResponse.md index 9861909e7f..a4eafa043f 100644 --- a/client/docs/RequestReceiptResponse.md +++ b/clients/apiclient/docs/RequestReceiptResponse.md @@ -4,20 +4,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BlockIndex** | Pointer to **int32** | | [optional] -**Error** | Pointer to [**BlockReceiptError**](BlockReceiptError.md) | | [optional] -**GasBudget** | Pointer to **int64** | | [optional] -**GasBurnLog** | Pointer to [**BurnLog**](BurnLog.md) | | [optional] -**GasBurned** | Pointer to **int64** | | [optional] -**GasFeeCharged** | Pointer to **int64** | | [optional] -**Request** | Pointer to [**RequestDetail**](RequestDetail.md) | | [optional] -**RequestIndex** | Pointer to **int32** | | [optional] +**BlockIndex** | **uint32** | | +**Error** | [**BlockReceiptError**](BlockReceiptError.md) | | +**GasBudget** | **int64** | | +**GasBurnLog** | [**BurnLog**](BurnLog.md) | | +**GasBurned** | **int64** | | +**GasFeeCharged** | **int64** | | +**Request** | [**RequestDetail**](RequestDetail.md) | | +**RequestIndex** | **uint32** | | ## Methods ### NewRequestReceiptResponse -`func NewRequestReceiptResponse() *RequestReceiptResponse` +`func NewRequestReceiptResponse(blockIndex uint32, error_ BlockReceiptError, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32, ) *RequestReceiptResponse` NewRequestReceiptResponse instantiates a new RequestReceiptResponse object This constructor will assign default values to properties that have it defined, @@ -34,28 +34,23 @@ but it doesn't guarantee that properties required by API are set ### GetBlockIndex -`func (o *RequestReceiptResponse) GetBlockIndex() int32` +`func (o *RequestReceiptResponse) GetBlockIndex() uint32` GetBlockIndex returns the BlockIndex field if non-nil, zero value otherwise. ### GetBlockIndexOk -`func (o *RequestReceiptResponse) GetBlockIndexOk() (*int32, bool)` +`func (o *RequestReceiptResponse) GetBlockIndexOk() (*uint32, bool)` GetBlockIndexOk returns a tuple with the BlockIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBlockIndex -`func (o *RequestReceiptResponse) SetBlockIndex(v int32)` +`func (o *RequestReceiptResponse) SetBlockIndex(v uint32)` SetBlockIndex sets BlockIndex field to given value. -### HasBlockIndex - -`func (o *RequestReceiptResponse) HasBlockIndex() bool` - -HasBlockIndex returns a boolean if a field has been set. ### GetError @@ -76,11 +71,6 @@ and a boolean to check if the value has been set. SetError sets Error field to given value. -### HasError - -`func (o *RequestReceiptResponse) HasError() bool` - -HasError returns a boolean if a field has been set. ### GetGasBudget @@ -101,11 +91,6 @@ and a boolean to check if the value has been set. SetGasBudget sets GasBudget field to given value. -### HasGasBudget - -`func (o *RequestReceiptResponse) HasGasBudget() bool` - -HasGasBudget returns a boolean if a field has been set. ### GetGasBurnLog @@ -126,11 +111,6 @@ and a boolean to check if the value has been set. SetGasBurnLog sets GasBurnLog field to given value. -### HasGasBurnLog - -`func (o *RequestReceiptResponse) HasGasBurnLog() bool` - -HasGasBurnLog returns a boolean if a field has been set. ### GetGasBurned @@ -151,11 +131,6 @@ and a boolean to check if the value has been set. SetGasBurned sets GasBurned field to given value. -### HasGasBurned - -`func (o *RequestReceiptResponse) HasGasBurned() bool` - -HasGasBurned returns a boolean if a field has been set. ### GetGasFeeCharged @@ -176,11 +151,6 @@ and a boolean to check if the value has been set. SetGasFeeCharged sets GasFeeCharged field to given value. -### HasGasFeeCharged - -`func (o *RequestReceiptResponse) HasGasFeeCharged() bool` - -HasGasFeeCharged returns a boolean if a field has been set. ### GetRequest @@ -201,36 +171,26 @@ and a boolean to check if the value has been set. SetRequest sets Request field to given value. -### HasRequest - -`func (o *RequestReceiptResponse) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. ### GetRequestIndex -`func (o *RequestReceiptResponse) GetRequestIndex() int32` +`func (o *RequestReceiptResponse) GetRequestIndex() uint32` GetRequestIndex returns the RequestIndex field if non-nil, zero value otherwise. ### GetRequestIndexOk -`func (o *RequestReceiptResponse) GetRequestIndexOk() (*int32, bool)` +`func (o *RequestReceiptResponse) GetRequestIndexOk() (*uint32, bool)` GetRequestIndexOk returns a tuple with the RequestIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRequestIndex -`func (o *RequestReceiptResponse) SetRequestIndex(v int32)` +`func (o *RequestReceiptResponse) SetRequestIndex(v uint32)` SetRequestIndex sets RequestIndex field to given value. -### HasRequestIndex - -`func (o *RequestReceiptResponse) HasRequestIndex() bool` - -HasRequestIndex returns a boolean if a field has been set. [[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/client/docs/RequestsApi.md b/clients/apiclient/docs/RequestsApi.md similarity index 89% rename from client/docs/RequestsApi.md rename to clients/apiclient/docs/RequestsApi.md index b59ece6efc..39368df2fe 100644 --- a/client/docs/RequestsApi.md +++ b/clients/apiclient/docs/RequestsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CallView**](RequestsApi.md#CallView) | **Post** /v2/requests/callview | Call a view function on a contract by Hname -[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2/chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID -[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2/requests/offledger | Post an off-ledger request -[**WaitForTransaction**](RequestsApi.md#WaitForTransaction) | **Get** /v2/chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +[**CallView**](RequestsApi.md#CallView) | **Post** /requests/callview | Call a view function on a contract by Hname +[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /requests/offledger | Post an off-ledger request +[**WaitForTransaction**](RequestsApi.md#WaitForTransaction) | **Get** /chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node @@ -32,7 +32,7 @@ import ( ) func main() { - contractCallViewRequest := *openapiclient.NewContractCallViewRequest() // ContractCallViewRequest | Parameters (optional) + contractCallViewRequest := *openapiclient.NewContractCallViewRequest(*openapiclient.NewJSONDict(), "ChainId_example", "ContractHName_example", "ContractName_example", "FunctionHName_example", "FunctionName_example") // ContractCallViewRequest | Parameters configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -167,7 +167,7 @@ import ( ) func main() { - offLedgerRequest := *openapiclient.NewOffLedgerRequest() // OffLedgerRequest | Offledger request as JSON. Request encoded in Hex (optional) + offLedgerRequest := *openapiclient.NewOffLedgerRequest("ChainId_example", "Hex string") // OffLedgerRequest | Offledger request as JSON. Request encoded in Hex configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/clients/apiclient/docs/StateResponse.md b/clients/apiclient/docs/StateResponse.md new file mode 100644 index 0000000000..59055ebf7f --- /dev/null +++ b/clients/apiclient/docs/StateResponse.md @@ -0,0 +1,51 @@ +# StateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**State** | **string** | The state of the requested key (Hex-encoded) | + +## Methods + +### NewStateResponse + +`func NewStateResponse(state string, ) *StateResponse` + +NewStateResponse instantiates a new StateResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStateResponseWithDefaults + +`func NewStateResponseWithDefaults() *StateResponse` + +NewStateResponseWithDefaults instantiates a new StateResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetState + +`func (o *StateResponse) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *StateResponse) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *StateResponse) SetState(v string)` + +SetState sets State field to given value. + + + +[[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/client/docs/Transaction.md b/clients/apiclient/docs/Transaction.md similarity index 86% rename from client/docs/Transaction.md rename to clients/apiclient/docs/Transaction.md index af52a8a260..c3e4350af9 100644 --- a/client/docs/Transaction.md +++ b/clients/apiclient/docs/Transaction.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TxId** | Pointer to **string** | The transaction ID | [optional] +**TxId** | **string** | The transaction ID | ## Methods ### NewTransaction -`func NewTransaction() *Transaction` +`func NewTransaction(txId string, ) *Transaction` NewTransaction instantiates a new Transaction object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetTxId sets TxId field to given value. -### HasTxId - -`func (o *Transaction) HasTxId() bool` - -HasTxId returns a boolean if a field has been set. [[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/client/docs/TransactionIDMetricItem.md b/clients/apiclient/docs/TransactionIDMetricItem.md similarity index 74% rename from client/docs/TransactionIDMetricItem.md rename to clients/apiclient/docs/TransactionIDMetricItem.md index 7ab38d163e..d3ab06079f 100644 --- a/client/docs/TransactionIDMetricItem.md +++ b/clients/apiclient/docs/TransactionIDMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**Transaction**](Transaction.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**Transaction**](Transaction.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewTransactionIDMetricItem -`func NewTransactionIDMetricItem() *TransactionIDMetricItem` +`func NewTransactionIDMetricItem(lastMessage Transaction, messages uint32, timestamp time.Time, ) *TransactionIDMetricItem` NewTransactionIDMetricItem instantiates a new TransactionIDMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *TransactionIDMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *TransactionIDMetricItem) GetMessages() int32` +`func (o *TransactionIDMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *TransactionIDMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *TransactionIDMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *TransactionIDMetricItem) SetMessages(v int32)` +`func (o *TransactionIDMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *TransactionIDMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *TransactionIDMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/TransactionMetricItem.md b/clients/apiclient/docs/TransactionMetricItem.md similarity index 74% rename from client/docs/TransactionMetricItem.md rename to clients/apiclient/docs/TransactionMetricItem.md index 0a092291f3..52a6864a0a 100644 --- a/client/docs/TransactionMetricItem.md +++ b/clients/apiclient/docs/TransactionMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**Transaction**](Transaction.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**Transaction**](Transaction.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewTransactionMetricItem -`func NewTransactionMetricItem() *TransactionMetricItem` +`func NewTransactionMetricItem(lastMessage Transaction, messages uint32, timestamp time.Time, ) *TransactionMetricItem` NewTransactionMetricItem instantiates a new TransactionMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *TransactionMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *TransactionMetricItem) GetMessages() int32` +`func (o *TransactionMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *TransactionMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *TransactionMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *TransactionMetricItem) SetMessages(v int32)` +`func (o *TransactionMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *TransactionMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *TransactionMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/TxInclusionStateMsg.md b/clients/apiclient/docs/TxInclusionStateMsg.md similarity index 81% rename from client/docs/TxInclusionStateMsg.md rename to clients/apiclient/docs/TxInclusionStateMsg.md index da958e7bb9..5a8abdfbf9 100644 --- a/client/docs/TxInclusionStateMsg.md +++ b/clients/apiclient/docs/TxInclusionStateMsg.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**State** | Pointer to **string** | The inclusion state | [optional] -**TxId** | Pointer to **string** | The transaction ID | [optional] +**State** | **string** | The inclusion state | +**TxId** | **string** | The transaction ID | ## Methods ### NewTxInclusionStateMsg -`func NewTxInclusionStateMsg() *TxInclusionStateMsg` +`func NewTxInclusionStateMsg(state string, txId string, ) *TxInclusionStateMsg` NewTxInclusionStateMsg instantiates a new TxInclusionStateMsg object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetState sets State field to given value. -### HasState - -`func (o *TxInclusionStateMsg) HasState() bool` - -HasState returns a boolean if a field has been set. ### GetTxId @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetTxId sets TxId field to given value. -### HasTxId - -`func (o *TxInclusionStateMsg) HasTxId() bool` - -HasTxId returns a boolean if a field has been set. [[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/client/docs/TxInclusionStateMsgMetricItem.md b/clients/apiclient/docs/TxInclusionStateMsgMetricItem.md similarity index 73% rename from client/docs/TxInclusionStateMsgMetricItem.md rename to clients/apiclient/docs/TxInclusionStateMsgMetricItem.md index 694a68c6e6..7a93d347a3 100644 --- a/client/docs/TxInclusionStateMsgMetricItem.md +++ b/clients/apiclient/docs/TxInclusionStateMsgMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**TxInclusionStateMsg**](TxInclusionStateMsg.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**TxInclusionStateMsg**](TxInclusionStateMsg.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewTxInclusionStateMsgMetricItem -`func NewTxInclusionStateMsgMetricItem() *TxInclusionStateMsgMetricItem` +`func NewTxInclusionStateMsgMetricItem(lastMessage TxInclusionStateMsg, messages uint32, timestamp time.Time, ) *TxInclusionStateMsgMetricItem` NewTxInclusionStateMsgMetricItem instantiates a new TxInclusionStateMsgMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *TxInclusionStateMsgMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *TxInclusionStateMsgMetricItem) GetMessages() int32` +`func (o *TxInclusionStateMsgMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *TxInclusionStateMsgMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *TxInclusionStateMsgMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *TxInclusionStateMsgMetricItem) SetMessages(v int32)` +`func (o *TxInclusionStateMsgMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *TxInclusionStateMsgMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *TxInclusionStateMsgMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/UTXOInputMetricItem.md b/clients/apiclient/docs/UTXOInputMetricItem.md similarity index 74% rename from client/docs/UTXOInputMetricItem.md rename to clients/apiclient/docs/UTXOInputMetricItem.md index 415ead931e..7881ee67e7 100644 --- a/client/docs/UTXOInputMetricItem.md +++ b/clients/apiclient/docs/UTXOInputMetricItem.md @@ -4,15 +4,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastMessage** | Pointer to [**OutputID**](OutputID.md) | | [optional] -**Messages** | Pointer to **int32** | | [optional] -**Timestamp** | Pointer to **time.Time** | | [optional] +**LastMessage** | [**OutputID**](OutputID.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | ## Methods ### NewUTXOInputMetricItem -`func NewUTXOInputMetricItem() *UTXOInputMetricItem` +`func NewUTXOInputMetricItem(lastMessage OutputID, messages uint32, timestamp time.Time, ) *UTXOInputMetricItem` NewUTXOInputMetricItem instantiates a new UTXOInputMetricItem object This constructor will assign default values to properties that have it defined, @@ -46,36 +46,26 @@ and a boolean to check if the value has been set. SetLastMessage sets LastMessage field to given value. -### HasLastMessage - -`func (o *UTXOInputMetricItem) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. ### GetMessages -`func (o *UTXOInputMetricItem) GetMessages() int32` +`func (o *UTXOInputMetricItem) GetMessages() uint32` GetMessages returns the Messages field if non-nil, zero value otherwise. ### GetMessagesOk -`func (o *UTXOInputMetricItem) GetMessagesOk() (*int32, bool)` +`func (o *UTXOInputMetricItem) GetMessagesOk() (*uint32, bool)` GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMessages -`func (o *UTXOInputMetricItem) SetMessages(v int32)` +`func (o *UTXOInputMetricItem) SetMessages(v uint32)` SetMessages sets Messages field to given value. -### HasMessages - -`func (o *UTXOInputMetricItem) HasMessages() bool` - -HasMessages returns a boolean if a field has been set. ### GetTimestamp @@ -96,11 +86,6 @@ and a boolean to check if the value has been set. SetTimestamp sets Timestamp field to given value. -### HasTimestamp - -`func (o *UTXOInputMetricItem) HasTimestamp() bool` - -HasTimestamp returns a boolean if a field has been set. [[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/client/docs/UpdateUserPasswordRequest.md b/clients/apiclient/docs/UpdateUserPasswordRequest.md similarity index 85% rename from client/docs/UpdateUserPasswordRequest.md rename to clients/apiclient/docs/UpdateUserPasswordRequest.md index 1dc9099a0e..bc7fb2ee7b 100644 --- a/client/docs/UpdateUserPasswordRequest.md +++ b/clients/apiclient/docs/UpdateUserPasswordRequest.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Password** | Pointer to **string** | | [optional] +**Password** | **string** | | ## Methods ### NewUpdateUserPasswordRequest -`func NewUpdateUserPasswordRequest() *UpdateUserPasswordRequest` +`func NewUpdateUserPasswordRequest(password string, ) *UpdateUserPasswordRequest` NewUpdateUserPasswordRequest instantiates a new UpdateUserPasswordRequest object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetPassword sets Password field to given value. -### HasPassword - -`func (o *UpdateUserPasswordRequest) HasPassword() bool` - -HasPassword returns a boolean if a field has been set. [[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/client/docs/UpdateUserPermissionsRequest.md b/clients/apiclient/docs/UpdateUserPermissionsRequest.md similarity index 85% rename from client/docs/UpdateUserPermissionsRequest.md rename to clients/apiclient/docs/UpdateUserPermissionsRequest.md index de9b96c65e..02caa8931c 100644 --- a/client/docs/UpdateUserPermissionsRequest.md +++ b/clients/apiclient/docs/UpdateUserPermissionsRequest.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Permissions** | Pointer to **[]string** | | [optional] +**Permissions** | **[]string** | | ## Methods ### NewUpdateUserPermissionsRequest -`func NewUpdateUserPermissionsRequest() *UpdateUserPermissionsRequest` +`func NewUpdateUserPermissionsRequest(permissions []string, ) *UpdateUserPermissionsRequest` NewUpdateUserPermissionsRequest instantiates a new UpdateUserPermissionsRequest object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetPermissions sets Permissions field to given value. -### HasPermissions - -`func (o *UpdateUserPermissionsRequest) HasPermissions() bool` - -HasPermissions returns a boolean if a field has been set. [[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/client/docs/User.md b/clients/apiclient/docs/User.md similarity index 82% rename from client/docs/User.md rename to clients/apiclient/docs/User.md index a22f160795..3ac52a3937 100644 --- a/client/docs/User.md +++ b/clients/apiclient/docs/User.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Permissions** | Pointer to **[]string** | | [optional] -**Username** | Pointer to **string** | | [optional] +**Permissions** | **[]string** | | +**Username** | **string** | | ## Methods ### NewUser -`func NewUser() *User` +`func NewUser(permissions []string, username string, ) *User` NewUser instantiates a new User object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetPermissions sets Permissions field to given value. -### HasPermissions - -`func (o *User) HasPermissions() bool` - -HasPermissions returns a boolean if a field has been set. ### GetUsername @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetUsername sets Username field to given value. -### HasUsername - -`func (o *User) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. [[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/client/docs/UsersApi.md b/clients/apiclient/docs/UsersApi.md similarity index 96% rename from client/docs/UsersApi.md rename to clients/apiclient/docs/UsersApi.md index 8a0eb8c6de..f5ea3cc788 100644 --- a/client/docs/UsersApi.md +++ b/clients/apiclient/docs/UsersApi.md @@ -32,7 +32,7 @@ import ( ) func main() { - addUserRequest := *openapiclient.NewAddUserRequest() // AddUserRequest | The user data + addUserRequest := *openapiclient.NewAddUserRequest("Password_example", []string{"Permissions_example"}, "Username_example") // AddUserRequest | The user data configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -95,7 +95,7 @@ import ( func main() { username := "username_example" // string | The username. - updateUserPasswordRequest := *openapiclient.NewUpdateUserPasswordRequest() // UpdateUserPasswordRequest | The users new password + updateUserPasswordRequest := *openapiclient.NewUpdateUserPasswordRequest("Password_example") // UpdateUserPasswordRequest | The users new password configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -163,7 +163,7 @@ import ( func main() { username := "username_example" // string | The username. - updateUserPermissionsRequest := *openapiclient.NewUpdateUserPermissionsRequest() // UpdateUserPermissionsRequest | The users new permissions + updateUserPermissionsRequest := *openapiclient.NewUpdateUserPermissionsRequest([]string{"Permissions_example"}) // UpdateUserPermissionsRequest | The users new permissions configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/client/docs/ValidationError.md b/clients/apiclient/docs/ValidationError.md similarity index 82% rename from client/docs/ValidationError.md rename to clients/apiclient/docs/ValidationError.md index 5077844fdb..fa751268f4 100644 --- a/client/docs/ValidationError.md +++ b/clients/apiclient/docs/ValidationError.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Error** | Pointer to **string** | | [optional] -**MissingPermission** | Pointer to **string** | | [optional] +**Error** | **string** | | +**MissingPermission** | **string** | | ## Methods ### NewValidationError -`func NewValidationError() *ValidationError` +`func NewValidationError(error_ string, missingPermission string, ) *ValidationError` NewValidationError instantiates a new ValidationError object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetError sets Error field to given value. -### HasError - -`func (o *ValidationError) HasError() bool` - -HasError returns a boolean if a field has been set. ### GetMissingPermission @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetMissingPermission sets MissingPermission field to given value. -### HasMissingPermission - -`func (o *ValidationError) HasMissingPermission() bool` - -HasMissingPermission returns a boolean if a field has been set. [[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/clients/apiclient/generate_client.sh b/clients/apiclient/generate_client.sh new file mode 100644 index 0000000000..b8ce7fb8a5 --- /dev/null +++ b/clients/apiclient/generate_client.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +openapi-generator-cli generate -i http://localhost:9090/doc/swagger.json \ + -g go \ + --package-name=apiclient \ + --additional-properties preferUnsignedInt=TRUE diff --git a/client/git_push.sh b/clients/apiclient/git_push.sh similarity index 100% rename from client/git_push.sh rename to clients/apiclient/git_push.sh diff --git a/clients/apiclient/go.mod b/clients/apiclient/go.mod new file mode 100644 index 0000000000..f3f28feb33 --- /dev/null +++ b/clients/apiclient/go.mod @@ -0,0 +1,6 @@ +module github.com/iotaledger/wasp/clients/apiclient + +go 1.13 + +require ( +) diff --git a/client/go.sum b/clients/apiclient/go.sum similarity index 82% rename from client/go.sum rename to clients/apiclient/go.sum index 734252e681..c966c8ddfd 100644 --- a/client/go.sum +++ b/clients/apiclient/go.sum @@ -4,8 +4,6 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/client/model_account_list_response.go b/clients/apiclient/model_account_list_response.go similarity index 75% rename from client/model_account_list_response.go rename to clients/apiclient/model_account_list_response.go index ffc18cb075..93566ba8fd 100644 --- a/client/model_account_list_response.go +++ b/clients/apiclient/model_account_list_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the AccountListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountListResponse{} + // AccountListResponse struct for AccountListResponse type AccountListResponse struct { - Accounts []string `json:"accounts,omitempty"` + Accounts []string `json:"accounts"` } // NewAccountListResponse instantiates a new AccountListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAccountListResponse() *AccountListResponse { +func NewAccountListResponse(accounts []string) *AccountListResponse { this := AccountListResponse{} + this.Accounts = accounts return &this } @@ -36,46 +40,44 @@ func NewAccountListResponseWithDefaults() *AccountListResponse { return &this } -// GetAccounts returns the Accounts field value if set, zero value otherwise. +// GetAccounts returns the Accounts field value func (o *AccountListResponse) GetAccounts() []string { - if o == nil || isNil(o.Accounts) { + if o == nil { var ret []string return ret } + return o.Accounts } -// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise +// GetAccountsOk returns a tuple with the Accounts field value // and a boolean to check if the value has been set. func (o *AccountListResponse) GetAccountsOk() ([]string, bool) { - if o == nil || isNil(o.Accounts) { - return nil, false + if o == nil { + return nil, false } return o.Accounts, true } -// HasAccounts returns a boolean if a field has been set. -func (o *AccountListResponse) HasAccounts() bool { - if o != nil && !isNil(o.Accounts) { - return true - } - - return false -} - -// SetAccounts gets a reference to the given []string and assigns it to the Accounts field. +// SetAccounts sets field value func (o *AccountListResponse) SetAccounts(v []string) { o.Accounts = v } func (o AccountListResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Accounts) { - toSerialize["accounts"] = o.Accounts + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o AccountListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accounts"] = o.Accounts + return toSerialize, nil +} + type NullableAccountListResponse struct { value *AccountListResponse isSet bool diff --git a/client/model_account_nfts_response.go b/clients/apiclient/model_account_nfts_response.go similarity index 75% rename from client/model_account_nfts_response.go rename to clients/apiclient/model_account_nfts_response.go index ae3d339726..7195f78854 100644 --- a/client/model_account_nfts_response.go +++ b/clients/apiclient/model_account_nfts_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the AccountNFTsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountNFTsResponse{} + // AccountNFTsResponse struct for AccountNFTsResponse type AccountNFTsResponse struct { - NftIds []string `json:"nftIds,omitempty"` + NftIds []string `json:"nftIds"` } // NewAccountNFTsResponse instantiates a new AccountNFTsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAccountNFTsResponse() *AccountNFTsResponse { +func NewAccountNFTsResponse(nftIds []string) *AccountNFTsResponse { this := AccountNFTsResponse{} + this.NftIds = nftIds return &this } @@ -36,46 +40,44 @@ func NewAccountNFTsResponseWithDefaults() *AccountNFTsResponse { return &this } -// GetNftIds returns the NftIds field value if set, zero value otherwise. +// GetNftIds returns the NftIds field value func (o *AccountNFTsResponse) GetNftIds() []string { - if o == nil || isNil(o.NftIds) { + if o == nil { var ret []string return ret } + return o.NftIds } -// GetNftIdsOk returns a tuple with the NftIds field value if set, nil otherwise +// GetNftIdsOk returns a tuple with the NftIds field value // and a boolean to check if the value has been set. func (o *AccountNFTsResponse) GetNftIdsOk() ([]string, bool) { - if o == nil || isNil(o.NftIds) { - return nil, false + if o == nil { + return nil, false } return o.NftIds, true } -// HasNftIds returns a boolean if a field has been set. -func (o *AccountNFTsResponse) HasNftIds() bool { - if o != nil && !isNil(o.NftIds) { - return true - } - - return false -} - -// SetNftIds gets a reference to the given []string and assigns it to the NftIds field. +// SetNftIds sets field value func (o *AccountNFTsResponse) SetNftIds(v []string) { o.NftIds = v } func (o AccountNFTsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.NftIds) { - toSerialize["nftIds"] = o.NftIds + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o AccountNFTsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nftIds"] = o.NftIds + return toSerialize, nil +} + type NullableAccountNFTsResponse struct { value *AccountNFTsResponse isSet bool diff --git a/client/model_account_nonce_response.go b/clients/apiclient/model_account_nonce_response.go similarity index 74% rename from client/model_account_nonce_response.go rename to clients/apiclient/model_account_nonce_response.go index 9168ba0cc4..8752b703a9 100644 --- a/client/model_account_nonce_response.go +++ b/clients/apiclient/model_account_nonce_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the AccountNonceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccountNonceResponse{} + // AccountNonceResponse struct for AccountNonceResponse type AccountNonceResponse struct { - Nonce *int64 `json:"nonce,omitempty"` + Nonce int64 `json:"nonce"` } // NewAccountNonceResponse instantiates a new AccountNonceResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAccountNonceResponse() *AccountNonceResponse { +func NewAccountNonceResponse(nonce int64) *AccountNonceResponse { this := AccountNonceResponse{} + this.Nonce = nonce return &this } @@ -36,46 +40,44 @@ func NewAccountNonceResponseWithDefaults() *AccountNonceResponse { return &this } -// GetNonce returns the Nonce field value if set, zero value otherwise. +// GetNonce returns the Nonce field value func (o *AccountNonceResponse) GetNonce() int64 { - if o == nil || isNil(o.Nonce) { + if o == nil { var ret int64 return ret } - return *o.Nonce + + return o.Nonce } -// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// GetNonceOk returns a tuple with the Nonce field value // and a boolean to check if the value has been set. func (o *AccountNonceResponse) GetNonceOk() (*int64, bool) { - if o == nil || isNil(o.Nonce) { - return nil, false - } - return o.Nonce, true -} - -// HasNonce returns a boolean if a field has been set. -func (o *AccountNonceResponse) HasNonce() bool { - if o != nil && !isNil(o.Nonce) { - return true + if o == nil { + return nil, false } - - return false + return &o.Nonce, true } -// SetNonce gets a reference to the given int64 and assigns it to the Nonce field. +// SetNonce sets field value func (o *AccountNonceResponse) SetNonce(v int64) { - o.Nonce = &v + o.Nonce = v } func (o AccountNonceResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Nonce) { - toSerialize["nonce"] = o.Nonce + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o AccountNonceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nonce"] = o.Nonce + return toSerialize, nil +} + type NullableAccountNonceResponse struct { value *AccountNonceResponse isSet bool diff --git a/client/model_add_user_request.go b/clients/apiclient/model_add_user_request.go similarity index 56% rename from client/model_add_user_request.go rename to clients/apiclient/model_add_user_request.go index 0794964b64..6b85292ead 100644 --- a/client/model_add_user_request.go +++ b/clients/apiclient/model_add_user_request.go @@ -3,30 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the AddUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddUserRequest{} + // AddUserRequest struct for AddUserRequest type AddUserRequest struct { - Password *string `json:"password,omitempty"` - Permissions []string `json:"permissions,omitempty"` - Username *string `json:"username,omitempty"` + Password string `json:"password"` + Permissions []string `json:"permissions"` + Username string `json:"username"` } // NewAddUserRequest instantiates a new AddUserRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAddUserRequest() *AddUserRequest { +func NewAddUserRequest(password string, permissions []string, username string) *AddUserRequest { this := AddUserRequest{} + this.Password = password + this.Permissions = permissions + this.Username = username return &this } @@ -38,116 +44,94 @@ func NewAddUserRequestWithDefaults() *AddUserRequest { return &this } -// GetPassword returns the Password field value if set, zero value otherwise. +// GetPassword returns the Password field value func (o *AddUserRequest) GetPassword() string { - if o == nil || isNil(o.Password) { + if o == nil { var ret string return ret } - return *o.Password + + return o.Password } -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. func (o *AddUserRequest) GetPasswordOk() (*string, bool) { - if o == nil || isNil(o.Password) { - return nil, false - } - return o.Password, true -} - -// HasPassword returns a boolean if a field has been set. -func (o *AddUserRequest) HasPassword() bool { - if o != nil && !isNil(o.Password) { - return true + if o == nil { + return nil, false } - - return false + return &o.Password, true } -// SetPassword gets a reference to the given string and assigns it to the Password field. +// SetPassword sets field value func (o *AddUserRequest) SetPassword(v string) { - o.Password = &v + o.Password = v } -// GetPermissions returns the Permissions field value if set, zero value otherwise. +// GetPermissions returns the Permissions field value func (o *AddUserRequest) GetPermissions() []string { - if o == nil || isNil(o.Permissions) { + if o == nil { var ret []string return ret } + return o.Permissions } -// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. func (o *AddUserRequest) GetPermissionsOk() ([]string, bool) { - if o == nil || isNil(o.Permissions) { - return nil, false + if o == nil { + return nil, false } return o.Permissions, true } -// HasPermissions returns a boolean if a field has been set. -func (o *AddUserRequest) HasPermissions() bool { - if o != nil && !isNil(o.Permissions) { - return true - } - - return false -} - -// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +// SetPermissions sets field value func (o *AddUserRequest) SetPermissions(v []string) { o.Permissions = v } -// GetUsername returns the Username field value if set, zero value otherwise. +// GetUsername returns the Username field value func (o *AddUserRequest) GetUsername() string { - if o == nil || isNil(o.Username) { + if o == nil { var ret string return ret } - return *o.Username + + return o.Username } -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. func (o *AddUserRequest) GetUsernameOk() (*string, bool) { - if o == nil || isNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *AddUserRequest) HasUsername() bool { - if o != nil && !isNil(o.Username) { - return true + if o == nil { + return nil, false } - - return false + return &o.Username, true } -// SetUsername gets a reference to the given string and assigns it to the Username field. +// SetUsername sets field value func (o *AddUserRequest) SetUsername(v string) { - o.Username = &v + o.Username = v } func (o AddUserRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Password) { - toSerialize["password"] = o.Password - } - if !isNil(o.Permissions) { - toSerialize["permissions"] = o.Permissions - } - if !isNil(o.Username) { - toSerialize["username"] = o.Username + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o AddUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + toSerialize["permissions"] = o.Permissions + toSerialize["username"] = o.Username + return toSerialize, nil +} + type NullableAddUserRequest struct { value *AddUserRequest isSet bool diff --git a/client/model_alias_output_metric_item.go b/clients/apiclient/model_alias_output_metric_item.go similarity index 53% rename from client/model_alias_output_metric_item.go rename to clients/apiclient/model_alias_output_metric_item.go index 2de3747fa9..375417bbe8 100644 --- a/client/model_alias_output_metric_item.go +++ b/clients/apiclient/model_alias_output_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the AliasOutputMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AliasOutputMetricItem{} + // AliasOutputMetricItem struct for AliasOutputMetricItem type AliasOutputMetricItem struct { - LastMessage *Output `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage Output `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewAliasOutputMetricItem instantiates a new AliasOutputMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAliasOutputMetricItem() *AliasOutputMetricItem { +func NewAliasOutputMetricItem(lastMessage Output, messages uint32, timestamp time.Time) *AliasOutputMetricItem { this := AliasOutputMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewAliasOutputMetricItemWithDefaults() *AliasOutputMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *AliasOutputMetricItem) GetLastMessage() Output { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret Output return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *AliasOutputMetricItem) GetLastMessageOk() (*Output, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *AliasOutputMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given Output and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *AliasOutputMetricItem) SetLastMessage(v Output) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *AliasOutputMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *AliasOutputMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AliasOutputMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *AliasOutputMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *AliasOutputMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *AliasOutputMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *AliasOutputMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *AliasOutputMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *AliasOutputMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *AliasOutputMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *AliasOutputMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o AliasOutputMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o AliasOutputMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableAliasOutputMetricItem struct { value *AliasOutputMetricItem isSet bool diff --git a/client/model_allowance.go b/clients/apiclient/model_allowance.go similarity index 61% rename from client/model_allowance.go rename to clients/apiclient/model_allowance.go index 73ab685adb..e7b2150cca 100644 --- a/client/model_allowance.go +++ b/clients/apiclient/model_allowance.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the Allowance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Allowance{} + // Allowance struct for Allowance type Allowance struct { - FungibleTokens *FungibleTokens `json:"fungibleTokens,omitempty"` - Nfts []string `json:"nfts,omitempty"` + FungibleTokens FungibleTokens `json:"fungibleTokens"` + Nfts []string `json:"nfts"` } // NewAllowance instantiates a new Allowance object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAllowance() *Allowance { +func NewAllowance(fungibleTokens FungibleTokens, nfts []string) *Allowance { this := Allowance{} + this.FungibleTokens = fungibleTokens + this.Nfts = nfts return &this } @@ -37,81 +42,69 @@ func NewAllowanceWithDefaults() *Allowance { return &this } -// GetFungibleTokens returns the FungibleTokens field value if set, zero value otherwise. +// GetFungibleTokens returns the FungibleTokens field value func (o *Allowance) GetFungibleTokens() FungibleTokens { - if o == nil || isNil(o.FungibleTokens) { + if o == nil { var ret FungibleTokens return ret } - return *o.FungibleTokens + + return o.FungibleTokens } -// GetFungibleTokensOk returns a tuple with the FungibleTokens field value if set, nil otherwise +// GetFungibleTokensOk returns a tuple with the FungibleTokens field value // and a boolean to check if the value has been set. func (o *Allowance) GetFungibleTokensOk() (*FungibleTokens, bool) { - if o == nil || isNil(o.FungibleTokens) { - return nil, false - } - return o.FungibleTokens, true -} - -// HasFungibleTokens returns a boolean if a field has been set. -func (o *Allowance) HasFungibleTokens() bool { - if o != nil && !isNil(o.FungibleTokens) { - return true + if o == nil { + return nil, false } - - return false + return &o.FungibleTokens, true } -// SetFungibleTokens gets a reference to the given FungibleTokens and assigns it to the FungibleTokens field. +// SetFungibleTokens sets field value func (o *Allowance) SetFungibleTokens(v FungibleTokens) { - o.FungibleTokens = &v + o.FungibleTokens = v } -// GetNfts returns the Nfts field value if set, zero value otherwise. +// GetNfts returns the Nfts field value func (o *Allowance) GetNfts() []string { - if o == nil || isNil(o.Nfts) { + if o == nil { var ret []string return ret } + return o.Nfts } -// GetNftsOk returns a tuple with the Nfts field value if set, nil otherwise +// GetNftsOk returns a tuple with the Nfts field value // and a boolean to check if the value has been set. func (o *Allowance) GetNftsOk() ([]string, bool) { - if o == nil || isNil(o.Nfts) { - return nil, false + if o == nil { + return nil, false } return o.Nfts, true } -// HasNfts returns a boolean if a field has been set. -func (o *Allowance) HasNfts() bool { - if o != nil && !isNil(o.Nfts) { - return true - } - - return false -} - -// SetNfts gets a reference to the given []string and assigns it to the Nfts field. +// SetNfts sets field value func (o *Allowance) SetNfts(v []string) { o.Nfts = v } func (o Allowance) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.FungibleTokens) { - toSerialize["fungibleTokens"] = o.FungibleTokens - } - if !isNil(o.Nfts) { - toSerialize["nfts"] = o.Nfts + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o Allowance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["fungibleTokens"] = o.FungibleTokens + toSerialize["nfts"] = o.Nfts + return toSerialize, nil +} + type NullableAllowance struct { value *Allowance isSet bool diff --git a/client/model_assets_response.go b/clients/apiclient/model_assets_response.go similarity index 64% rename from client/model_assets_response.go rename to clients/apiclient/model_assets_response.go index 43dd7faa00..3c2610d651 100644 --- a/client/model_assets_response.go +++ b/clients/apiclient/model_assets_response.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the AssetsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AssetsResponse{} + // AssetsResponse struct for AssetsResponse type AssetsResponse struct { - BaseTokens *int64 `json:"baseTokens,omitempty"` - NativeTokens []NativeToken `json:"nativeTokens,omitempty"` + BaseTokens int64 `json:"baseTokens"` + NativeTokens []NativeToken `json:"nativeTokens"` } // NewAssetsResponse instantiates a new AssetsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAssetsResponse() *AssetsResponse { +func NewAssetsResponse(baseTokens int64, nativeTokens []NativeToken) *AssetsResponse { this := AssetsResponse{} + this.BaseTokens = baseTokens + this.NativeTokens = nativeTokens return &this } @@ -37,81 +42,69 @@ func NewAssetsResponseWithDefaults() *AssetsResponse { return &this } -// GetBaseTokens returns the BaseTokens field value if set, zero value otherwise. +// GetBaseTokens returns the BaseTokens field value func (o *AssetsResponse) GetBaseTokens() int64 { - if o == nil || isNil(o.BaseTokens) { + if o == nil { var ret int64 return ret } - return *o.BaseTokens + + return o.BaseTokens } -// GetBaseTokensOk returns a tuple with the BaseTokens field value if set, nil otherwise +// GetBaseTokensOk returns a tuple with the BaseTokens field value // and a boolean to check if the value has been set. func (o *AssetsResponse) GetBaseTokensOk() (*int64, bool) { - if o == nil || isNil(o.BaseTokens) { - return nil, false - } - return o.BaseTokens, true -} - -// HasBaseTokens returns a boolean if a field has been set. -func (o *AssetsResponse) HasBaseTokens() bool { - if o != nil && !isNil(o.BaseTokens) { - return true + if o == nil { + return nil, false } - - return false + return &o.BaseTokens, true } -// SetBaseTokens gets a reference to the given int64 and assigns it to the BaseTokens field. +// SetBaseTokens sets field value func (o *AssetsResponse) SetBaseTokens(v int64) { - o.BaseTokens = &v + o.BaseTokens = v } -// GetNativeTokens returns the NativeTokens field value if set, zero value otherwise. +// GetNativeTokens returns the NativeTokens field value func (o *AssetsResponse) GetNativeTokens() []NativeToken { - if o == nil || isNil(o.NativeTokens) { + if o == nil { var ret []NativeToken return ret } + return o.NativeTokens } -// GetNativeTokensOk returns a tuple with the NativeTokens field value if set, nil otherwise +// GetNativeTokensOk returns a tuple with the NativeTokens field value // and a boolean to check if the value has been set. func (o *AssetsResponse) GetNativeTokensOk() ([]NativeToken, bool) { - if o == nil || isNil(o.NativeTokens) { - return nil, false + if o == nil { + return nil, false } return o.NativeTokens, true } -// HasNativeTokens returns a boolean if a field has been set. -func (o *AssetsResponse) HasNativeTokens() bool { - if o != nil && !isNil(o.NativeTokens) { - return true - } - - return false -} - -// SetNativeTokens gets a reference to the given []NativeToken and assigns it to the NativeTokens field. +// SetNativeTokens sets field value func (o *AssetsResponse) SetNativeTokens(v []NativeToken) { o.NativeTokens = v } func (o AssetsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.BaseTokens) { - toSerialize["baseTokens"] = o.BaseTokens - } - if !isNil(o.NativeTokens) { - toSerialize["nativeTokens"] = o.NativeTokens + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o AssetsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["baseTokens"] = o.BaseTokens + toSerialize["nativeTokens"] = o.NativeTokens + return toSerialize, nil +} + type NullableAssetsResponse struct { value *AssetsResponse isSet bool diff --git a/client/model_base_token.go b/clients/apiclient/model_base_token.go similarity index 94% rename from client/model_base_token.go rename to clients/apiclient/model_base_token.go index 82223b1b92..a827d85521 100644 --- a/client/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BaseToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseToken{} + // BaseToken struct for BaseToken type BaseToken struct { // The token decimals @@ -60,7 +63,7 @@ func (o *BaseToken) GetDecimals() int32 { // and a boolean to check if the value has been set. func (o *BaseToken) GetDecimalsOk() (*int32, bool) { if o == nil || isNil(o.Decimals) { - return nil, false + return nil, false } return o.Decimals, true } @@ -92,7 +95,7 @@ func (o *BaseToken) GetName() string { // and a boolean to check if the value has been set. func (o *BaseToken) GetNameOk() (*string, bool) { if o == nil || isNil(o.Name) { - return nil, false + return nil, false } return o.Name, true } @@ -124,7 +127,7 @@ func (o *BaseToken) GetSubunit() string { // and a boolean to check if the value has been set. func (o *BaseToken) GetSubunitOk() (*string, bool) { if o == nil || isNil(o.Subunit) { - return nil, false + return nil, false } return o.Subunit, true } @@ -156,7 +159,7 @@ func (o *BaseToken) GetTickerSymbol() string { // and a boolean to check if the value has been set. func (o *BaseToken) GetTickerSymbolOk() (*string, bool) { if o == nil || isNil(o.TickerSymbol) { - return nil, false + return nil, false } return o.TickerSymbol, true } @@ -188,7 +191,7 @@ func (o *BaseToken) GetUnit() string { // and a boolean to check if the value has been set. func (o *BaseToken) GetUnitOk() (*string, bool) { if o == nil || isNil(o.Unit) { - return nil, false + return nil, false } return o.Unit, true } @@ -220,7 +223,7 @@ func (o *BaseToken) GetUseMetricPrefix() bool { // and a boolean to check if the value has been set. func (o *BaseToken) GetUseMetricPrefixOk() (*bool, bool) { if o == nil || isNil(o.UseMetricPrefix) { - return nil, false + return nil, false } return o.UseMetricPrefix, true } @@ -240,6 +243,14 @@ func (o *BaseToken) SetUseMetricPrefix(v bool) { } func (o BaseToken) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BaseToken) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Decimals) { toSerialize["decimals"] = o.Decimals @@ -259,7 +270,7 @@ func (o BaseToken) MarshalJSON() ([]byte, error) { if !isNil(o.UseMetricPrefix) { toSerialize["useMetricPrefix"] = o.UseMetricPrefix } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBaseToken struct { diff --git a/client/model_blob.go b/clients/apiclient/model_blob.go similarity index 89% rename from client/model_blob.go rename to clients/apiclient/model_blob.go index 29a9ce4bd9..131fb5b8cc 100644 --- a/client/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the Blob type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Blob{} + // Blob struct for Blob type Blob struct { Hash *string `json:"Hash,omitempty"` @@ -50,7 +53,7 @@ func (o *Blob) GetHash() string { // and a boolean to check if the value has been set. func (o *Blob) GetHashOk() (*string, bool) { if o == nil || isNil(o.Hash) { - return nil, false + return nil, false } return o.Hash, true } @@ -82,7 +85,7 @@ func (o *Blob) GetSize() int32 { // and a boolean to check if the value has been set. func (o *Blob) GetSizeOk() (*int32, bool) { if o == nil || isNil(o.Size) { - return nil, false + return nil, false } return o.Size, true } @@ -102,6 +105,14 @@ func (o *Blob) SetSize(v int32) { } func (o Blob) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Blob) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Hash) { toSerialize["Hash"] = o.Hash @@ -109,7 +120,7 @@ func (o Blob) MarshalJSON() ([]byte, error) { if !isNil(o.Size) { toSerialize["Size"] = o.Size } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBlob struct { diff --git a/client/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go similarity index 87% rename from client/model_blob_info_response.go rename to clients/apiclient/model_blob_info_response.go index 9f60150420..c11bb778ea 100644 --- a/client/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BlobInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlobInfoResponse{} + // BlobInfoResponse struct for BlobInfoResponse type BlobInfoResponse struct { Fields *map[string]int32 `json:"Fields,omitempty"` @@ -49,7 +52,7 @@ func (o *BlobInfoResponse) GetFields() map[string]int32 { // and a boolean to check if the value has been set. func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool) { if o == nil || isNil(o.Fields) { - return nil, false + return nil, false } return o.Fields, true } @@ -69,11 +72,19 @@ func (o *BlobInfoResponse) SetFields(v map[string]int32) { } func (o BlobInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlobInfoResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Fields) { toSerialize["Fields"] = o.Fields } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBlobInfoResponse struct { diff --git a/client/model_blob_list_response.go b/clients/apiclient/model_blob_list_response.go similarity index 87% rename from client/model_blob_list_response.go rename to clients/apiclient/model_blob_list_response.go index 8ddc0d0ac8..e6c44d1d7c 100644 --- a/client/model_blob_list_response.go +++ b/clients/apiclient/model_blob_list_response.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BlobListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlobListResponse{} + // BlobListResponse struct for BlobListResponse type BlobListResponse struct { Blobs []Blob `json:"Blobs,omitempty"` @@ -49,7 +52,7 @@ func (o *BlobListResponse) GetBlobs() []Blob { // and a boolean to check if the value has been set. func (o *BlobListResponse) GetBlobsOk() ([]Blob, bool) { if o == nil || isNil(o.Blobs) { - return nil, false + return nil, false } return o.Blobs, true } @@ -69,11 +72,19 @@ func (o *BlobListResponse) SetBlobs(v []Blob) { } func (o BlobListResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlobListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Blobs) { toSerialize["Blobs"] = o.Blobs } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBlobListResponse struct { diff --git a/client/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go similarity index 88% rename from client/model_blob_value_response.go rename to clients/apiclient/model_blob_value_response.go index 484d8848c7..61003c9b4c 100644 --- a/client/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BlobValueResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlobValueResponse{} + // BlobValueResponse struct for BlobValueResponse type BlobValueResponse struct { ValueData *string `json:"ValueData,omitempty"` @@ -49,7 +52,7 @@ func (o *BlobValueResponse) GetValueData() string { // and a boolean to check if the value has been set. func (o *BlobValueResponse) GetValueDataOk() (*string, bool) { if o == nil || isNil(o.ValueData) { - return nil, false + return nil, false } return o.ValueData, true } @@ -69,11 +72,19 @@ func (o *BlobValueResponse) SetValueData(v string) { } func (o BlobValueResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlobValueResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.ValueData) { toSerialize["ValueData"] = o.ValueData } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBlobValueResponse struct { diff --git a/clients/apiclient/model_block_info_response.go b/clients/apiclient/model_block_info_response.go new file mode 100644 index 0000000000..036b451677 --- /dev/null +++ b/clients/apiclient/model_block_info_response.go @@ -0,0 +1,442 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" + "time" +) + +// checks if the BlockInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlockInfoResponse{} + +// BlockInfoResponse struct for BlockInfoResponse +type BlockInfoResponse struct { + AnchorTransactionId string `json:"anchorTransactionId"` + BlockIndex uint32 `json:"blockIndex"` + GasBurned int64 `json:"gasBurned"` + GasFeeCharged int64 `json:"gasFeeCharged"` + L1CommitmentHash string `json:"l1CommitmentHash"` + NumOffLedgerRequests uint32 `json:"numOffLedgerRequests"` + NumSuccessfulRequests uint32 `json:"numSuccessfulRequests"` + PreviousL1CommitmentHash string `json:"previousL1CommitmentHash"` + Timestamp time.Time `json:"timestamp"` + TotalBaseTokensInL2Accounts int64 `json:"totalBaseTokensInL2Accounts"` + TotalRequests uint32 `json:"totalRequests"` + TotalStorageDeposit int64 `json:"totalStorageDeposit"` + TransactionSubEssenceHash string `json:"transactionSubEssenceHash"` +} + +// NewBlockInfoResponse instantiates a new BlockInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlockInfoResponse(anchorTransactionId string, blockIndex uint32, gasBurned int64, gasFeeCharged int64, l1CommitmentHash string, numOffLedgerRequests uint32, numSuccessfulRequests uint32, previousL1CommitmentHash string, timestamp time.Time, totalBaseTokensInL2Accounts int64, totalRequests uint32, totalStorageDeposit int64, transactionSubEssenceHash string) *BlockInfoResponse { + this := BlockInfoResponse{} + this.AnchorTransactionId = anchorTransactionId + this.BlockIndex = blockIndex + this.GasBurned = gasBurned + this.GasFeeCharged = gasFeeCharged + this.L1CommitmentHash = l1CommitmentHash + this.NumOffLedgerRequests = numOffLedgerRequests + this.NumSuccessfulRequests = numSuccessfulRequests + this.PreviousL1CommitmentHash = previousL1CommitmentHash + this.Timestamp = timestamp + this.TotalBaseTokensInL2Accounts = totalBaseTokensInL2Accounts + this.TotalRequests = totalRequests + this.TotalStorageDeposit = totalStorageDeposit + this.TransactionSubEssenceHash = transactionSubEssenceHash + return &this +} + +// NewBlockInfoResponseWithDefaults instantiates a new BlockInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlockInfoResponseWithDefaults() *BlockInfoResponse { + this := BlockInfoResponse{} + return &this +} + +// GetAnchorTransactionId returns the AnchorTransactionId field value +func (o *BlockInfoResponse) GetAnchorTransactionId() string { + if o == nil { + var ret string + return ret + } + + return o.AnchorTransactionId +} + +// GetAnchorTransactionIdOk returns a tuple with the AnchorTransactionId field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetAnchorTransactionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AnchorTransactionId, true +} + +// SetAnchorTransactionId sets field value +func (o *BlockInfoResponse) SetAnchorTransactionId(v string) { + o.AnchorTransactionId = v +} + +// GetBlockIndex returns the BlockIndex field value +func (o *BlockInfoResponse) GetBlockIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.BlockIndex +} + +// GetBlockIndexOk returns a tuple with the BlockIndex field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetBlockIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.BlockIndex, true +} + +// SetBlockIndex sets field value +func (o *BlockInfoResponse) SetBlockIndex(v uint32) { + o.BlockIndex = v +} + +// GetGasBurned returns the GasBurned field value +func (o *BlockInfoResponse) GetGasBurned() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasBurned, true +} + +// SetGasBurned sets field value +func (o *BlockInfoResponse) SetGasBurned(v int64) { + o.GasBurned = v +} + +// GetGasFeeCharged returns the GasFeeCharged field value +func (o *BlockInfoResponse) GetGasFeeCharged() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasFeeCharged +} + +// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasFeeCharged, true +} + +// SetGasFeeCharged sets field value +func (o *BlockInfoResponse) SetGasFeeCharged(v int64) { + o.GasFeeCharged = v +} + +// GetL1CommitmentHash returns the L1CommitmentHash field value +func (o *BlockInfoResponse) GetL1CommitmentHash() string { + if o == nil { + var ret string + return ret + } + + return o.L1CommitmentHash +} + +// GetL1CommitmentHashOk returns a tuple with the L1CommitmentHash field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetL1CommitmentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.L1CommitmentHash, true +} + +// SetL1CommitmentHash sets field value +func (o *BlockInfoResponse) SetL1CommitmentHash(v string) { + o.L1CommitmentHash = v +} + +// GetNumOffLedgerRequests returns the NumOffLedgerRequests field value +func (o *BlockInfoResponse) GetNumOffLedgerRequests() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.NumOffLedgerRequests +} + +// GetNumOffLedgerRequestsOk returns a tuple with the NumOffLedgerRequests field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetNumOffLedgerRequestsOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.NumOffLedgerRequests, true +} + +// SetNumOffLedgerRequests sets field value +func (o *BlockInfoResponse) SetNumOffLedgerRequests(v uint32) { + o.NumOffLedgerRequests = v +} + +// GetNumSuccessfulRequests returns the NumSuccessfulRequests field value +func (o *BlockInfoResponse) GetNumSuccessfulRequests() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.NumSuccessfulRequests +} + +// GetNumSuccessfulRequestsOk returns a tuple with the NumSuccessfulRequests field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetNumSuccessfulRequestsOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.NumSuccessfulRequests, true +} + +// SetNumSuccessfulRequests sets field value +func (o *BlockInfoResponse) SetNumSuccessfulRequests(v uint32) { + o.NumSuccessfulRequests = v +} + +// GetPreviousL1CommitmentHash returns the PreviousL1CommitmentHash field value +func (o *BlockInfoResponse) GetPreviousL1CommitmentHash() string { + if o == nil { + var ret string + return ret + } + + return o.PreviousL1CommitmentHash +} + +// GetPreviousL1CommitmentHashOk returns a tuple with the PreviousL1CommitmentHash field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetPreviousL1CommitmentHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreviousL1CommitmentHash, true +} + +// SetPreviousL1CommitmentHash sets field value +func (o *BlockInfoResponse) SetPreviousL1CommitmentHash(v string) { + o.PreviousL1CommitmentHash = v +} + +// GetTimestamp returns the Timestamp field value +func (o *BlockInfoResponse) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *BlockInfoResponse) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetTotalBaseTokensInL2Accounts returns the TotalBaseTokensInL2Accounts field value +func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalBaseTokensInL2Accounts +} + +// GetTotalBaseTokensInL2AccountsOk returns a tuple with the TotalBaseTokensInL2Accounts field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalBaseTokensInL2Accounts, true +} + +// SetTotalBaseTokensInL2Accounts sets field value +func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v int64) { + o.TotalBaseTokensInL2Accounts = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *BlockInfoResponse) GetTotalRequests() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTotalRequestsOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *BlockInfoResponse) SetTotalRequests(v uint32) { + o.TotalRequests = v +} + +// GetTotalStorageDeposit returns the TotalStorageDeposit field value +func (o *BlockInfoResponse) GetTotalStorageDeposit() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalStorageDeposit +} + +// GetTotalStorageDepositOk returns a tuple with the TotalStorageDeposit field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalStorageDeposit, true +} + +// SetTotalStorageDeposit sets field value +func (o *BlockInfoResponse) SetTotalStorageDeposit(v int64) { + o.TotalStorageDeposit = v +} + +// GetTransactionSubEssenceHash returns the TransactionSubEssenceHash field value +func (o *BlockInfoResponse) GetTransactionSubEssenceHash() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionSubEssenceHash +} + +// GetTransactionSubEssenceHashOk returns a tuple with the TransactionSubEssenceHash field value +// and a boolean to check if the value has been set. +func (o *BlockInfoResponse) GetTransactionSubEssenceHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionSubEssenceHash, true +} + +// SetTransactionSubEssenceHash sets field value +func (o *BlockInfoResponse) SetTransactionSubEssenceHash(v string) { + o.TransactionSubEssenceHash = v +} + +func (o BlockInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlockInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["anchorTransactionId"] = o.AnchorTransactionId + toSerialize["blockIndex"] = o.BlockIndex + toSerialize["gasBurned"] = o.GasBurned + toSerialize["gasFeeCharged"] = o.GasFeeCharged + toSerialize["l1CommitmentHash"] = o.L1CommitmentHash + toSerialize["numOffLedgerRequests"] = o.NumOffLedgerRequests + toSerialize["numSuccessfulRequests"] = o.NumSuccessfulRequests + toSerialize["previousL1CommitmentHash"] = o.PreviousL1CommitmentHash + toSerialize["timestamp"] = o.Timestamp + toSerialize["totalBaseTokensInL2Accounts"] = o.TotalBaseTokensInL2Accounts + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalStorageDeposit"] = o.TotalStorageDeposit + toSerialize["transactionSubEssenceHash"] = o.TransactionSubEssenceHash + return toSerialize, nil +} + +type NullableBlockInfoResponse struct { + value *BlockInfoResponse + isSet bool +} + +func (v NullableBlockInfoResponse) Get() *BlockInfoResponse { + return v.value +} + +func (v *NullableBlockInfoResponse) Set(val *BlockInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBlockInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBlockInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlockInfoResponse(val *BlockInfoResponse) *NullableBlockInfoResponse { + return &NullableBlockInfoResponse{value: val, isSet: true} +} + +func (v NullableBlockInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlockInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_block_receipt_error.go b/clients/apiclient/model_block_receipt_error.go similarity index 63% rename from client/model_block_receipt_error.go rename to clients/apiclient/model_block_receipt_error.go index ac743f5bdb..5dbf03e2c2 100644 --- a/client/model_block_receipt_error.go +++ b/clients/apiclient/model_block_receipt_error.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BlockReceiptError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlockReceiptError{} + // BlockReceiptError struct for BlockReceiptError type BlockReceiptError struct { - ErrorMessage *string `json:"errorMessage,omitempty"` - Hash *string `json:"hash,omitempty"` + ErrorMessage string `json:"errorMessage"` + Hash string `json:"hash"` } // NewBlockReceiptError instantiates a new BlockReceiptError object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlockReceiptError() *BlockReceiptError { +func NewBlockReceiptError(errorMessage string, hash string) *BlockReceiptError { this := BlockReceiptError{} + this.ErrorMessage = errorMessage + this.Hash = hash return &this } @@ -37,81 +42,69 @@ func NewBlockReceiptErrorWithDefaults() *BlockReceiptError { return &this } -// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +// GetErrorMessage returns the ErrorMessage field value func (o *BlockReceiptError) GetErrorMessage() string { - if o == nil || isNil(o.ErrorMessage) { + if o == nil { var ret string return ret } - return *o.ErrorMessage + + return o.ErrorMessage } -// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// GetErrorMessageOk returns a tuple with the ErrorMessage field value // and a boolean to check if the value has been set. func (o *BlockReceiptError) GetErrorMessageOk() (*string, bool) { - if o == nil || isNil(o.ErrorMessage) { - return nil, false - } - return o.ErrorMessage, true -} - -// HasErrorMessage returns a boolean if a field has been set. -func (o *BlockReceiptError) HasErrorMessage() bool { - if o != nil && !isNil(o.ErrorMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.ErrorMessage, true } -// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +// SetErrorMessage sets field value func (o *BlockReceiptError) SetErrorMessage(v string) { - o.ErrorMessage = &v + o.ErrorMessage = v } -// GetHash returns the Hash field value if set, zero value otherwise. +// GetHash returns the Hash field value func (o *BlockReceiptError) GetHash() string { - if o == nil || isNil(o.Hash) { + if o == nil { var ret string return ret } - return *o.Hash + + return o.Hash } -// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// GetHashOk returns a tuple with the Hash field value // and a boolean to check if the value has been set. func (o *BlockReceiptError) GetHashOk() (*string, bool) { - if o == nil || isNil(o.Hash) { - return nil, false - } - return o.Hash, true -} - -// HasHash returns a boolean if a field has been set. -func (o *BlockReceiptError) HasHash() bool { - if o != nil && !isNil(o.Hash) { - return true + if o == nil { + return nil, false } - - return false + return &o.Hash, true } -// SetHash gets a reference to the given string and assigns it to the Hash field. +// SetHash sets field value func (o *BlockReceiptError) SetHash(v string) { - o.Hash = &v + o.Hash = v } func (o BlockReceiptError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.ErrorMessage) { - toSerialize["errorMessage"] = o.ErrorMessage - } - if !isNil(o.Hash) { - toSerialize["hash"] = o.Hash + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o BlockReceiptError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["errorMessage"] = o.ErrorMessage + toSerialize["hash"] = o.Hash + return toSerialize, nil +} + type NullableBlockReceiptError struct { value *BlockReceiptError isSet bool diff --git a/client/model_block_receipts_response.go b/clients/apiclient/model_block_receipts_response.go similarity index 75% rename from client/model_block_receipts_response.go rename to clients/apiclient/model_block_receipts_response.go index c987770251..4c784d9ec8 100644 --- a/client/model_block_receipts_response.go +++ b/clients/apiclient/model_block_receipts_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BlockReceiptsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlockReceiptsResponse{} + // BlockReceiptsResponse struct for BlockReceiptsResponse type BlockReceiptsResponse struct { - Receipts []RequestReceiptResponse `json:"receipts,omitempty"` + Receipts []RequestReceiptResponse `json:"receipts"` } // NewBlockReceiptsResponse instantiates a new BlockReceiptsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlockReceiptsResponse() *BlockReceiptsResponse { +func NewBlockReceiptsResponse(receipts []RequestReceiptResponse) *BlockReceiptsResponse { this := BlockReceiptsResponse{} + this.Receipts = receipts return &this } @@ -36,46 +40,44 @@ func NewBlockReceiptsResponseWithDefaults() *BlockReceiptsResponse { return &this } -// GetReceipts returns the Receipts field value if set, zero value otherwise. +// GetReceipts returns the Receipts field value func (o *BlockReceiptsResponse) GetReceipts() []RequestReceiptResponse { - if o == nil || isNil(o.Receipts) { + if o == nil { var ret []RequestReceiptResponse return ret } + return o.Receipts } -// GetReceiptsOk returns a tuple with the Receipts field value if set, nil otherwise +// GetReceiptsOk returns a tuple with the Receipts field value // and a boolean to check if the value has been set. func (o *BlockReceiptsResponse) GetReceiptsOk() ([]RequestReceiptResponse, bool) { - if o == nil || isNil(o.Receipts) { - return nil, false + if o == nil { + return nil, false } return o.Receipts, true } -// HasReceipts returns a boolean if a field has been set. -func (o *BlockReceiptsResponse) HasReceipts() bool { - if o != nil && !isNil(o.Receipts) { - return true - } - - return false -} - -// SetReceipts gets a reference to the given []RequestReceiptResponse and assigns it to the Receipts field. +// SetReceipts sets field value func (o *BlockReceiptsResponse) SetReceipts(v []RequestReceiptResponse) { o.Receipts = v } func (o BlockReceiptsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Receipts) { - toSerialize["receipts"] = o.Receipts + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o BlockReceiptsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["receipts"] = o.Receipts + return toSerialize, nil +} + type NullableBlockReceiptsResponse struct { value *BlockReceiptsResponse isSet bool diff --git a/client/model_burn_log.go b/clients/apiclient/model_burn_log.go similarity index 87% rename from client/model_burn_log.go rename to clients/apiclient/model_burn_log.go index 44535089c4..d3fa7beed7 100644 --- a/client/model_burn_log.go +++ b/clients/apiclient/model_burn_log.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BurnLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BurnLog{} + // BurnLog struct for BurnLog type BurnLog struct { Records []BurnRecord `json:"Records,omitempty"` @@ -49,7 +52,7 @@ func (o *BurnLog) GetRecords() []BurnRecord { // and a boolean to check if the value has been set. func (o *BurnLog) GetRecordsOk() ([]BurnRecord, bool) { if o == nil || isNil(o.Records) { - return nil, false + return nil, false } return o.Records, true } @@ -69,11 +72,19 @@ func (o *BurnLog) SetRecords(v []BurnRecord) { } func (o BurnLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BurnLog) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Records) { toSerialize["Records"] = o.Records } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBurnLog struct { diff --git a/client/model_burn_record.go b/clients/apiclient/model_burn_record.go similarity index 89% rename from client/model_burn_record.go rename to clients/apiclient/model_burn_record.go index fff5ef025a..700ea6b265 100644 --- a/client/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the BurnRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BurnRecord{} + // BurnRecord struct for BurnRecord type BurnRecord struct { Code *int32 `json:"Code,omitempty"` @@ -50,7 +53,7 @@ func (o *BurnRecord) GetCode() int32 { // and a boolean to check if the value has been set. func (o *BurnRecord) GetCodeOk() (*int32, bool) { if o == nil || isNil(o.Code) { - return nil, false + return nil, false } return o.Code, true } @@ -82,7 +85,7 @@ func (o *BurnRecord) GetGasBurned() int64 { // and a boolean to check if the value has been set. func (o *BurnRecord) GetGasBurnedOk() (*int64, bool) { if o == nil || isNil(o.GasBurned) { - return nil, false + return nil, false } return o.GasBurned, true } @@ -102,6 +105,14 @@ func (o *BurnRecord) SetGasBurned(v int64) { } func (o BurnRecord) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BurnRecord) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Code) { toSerialize["Code"] = o.Code @@ -109,7 +120,7 @@ func (o BurnRecord) MarshalJSON() ([]byte, error) { if !isNil(o.GasBurned) { toSerialize["GasBurned"] = o.GasBurned } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBurnRecord struct { diff --git a/client/model_call_target.go b/clients/apiclient/model_call_target.go similarity index 60% rename from client/model_call_target.go rename to clients/apiclient/model_call_target.go index 71fb6c4b11..8de988f778 100644 --- a/client/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the CallTarget type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CallTarget{} + // CallTarget struct for CallTarget type CallTarget struct { - Contract *int32 `json:"Contract,omitempty"` - EntryPoint *int32 `json:"EntryPoint,omitempty"` + Contract int32 `json:"contract"` + EntryPoint int32 `json:"entryPoint"` } // NewCallTarget instantiates a new CallTarget object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCallTarget() *CallTarget { +func NewCallTarget(contract int32, entryPoint int32) *CallTarget { this := CallTarget{} + this.Contract = contract + this.EntryPoint = entryPoint return &this } @@ -37,81 +42,69 @@ func NewCallTargetWithDefaults() *CallTarget { return &this } -// GetContract returns the Contract field value if set, zero value otherwise. +// GetContract returns the Contract field value func (o *CallTarget) GetContract() int32 { - if o == nil || isNil(o.Contract) { + if o == nil { var ret int32 return ret } - return *o.Contract + + return o.Contract } -// GetContractOk returns a tuple with the Contract field value if set, nil otherwise +// GetContractOk returns a tuple with the Contract field value // and a boolean to check if the value has been set. func (o *CallTarget) GetContractOk() (*int32, bool) { - if o == nil || isNil(o.Contract) { - return nil, false - } - return o.Contract, true -} - -// HasContract returns a boolean if a field has been set. -func (o *CallTarget) HasContract() bool { - if o != nil && !isNil(o.Contract) { - return true + if o == nil { + return nil, false } - - return false + return &o.Contract, true } -// SetContract gets a reference to the given int32 and assigns it to the Contract field. +// SetContract sets field value func (o *CallTarget) SetContract(v int32) { - o.Contract = &v + o.Contract = v } -// GetEntryPoint returns the EntryPoint field value if set, zero value otherwise. +// GetEntryPoint returns the EntryPoint field value func (o *CallTarget) GetEntryPoint() int32 { - if o == nil || isNil(o.EntryPoint) { + if o == nil { var ret int32 return ret } - return *o.EntryPoint + + return o.EntryPoint } -// GetEntryPointOk returns a tuple with the EntryPoint field value if set, nil otherwise +// GetEntryPointOk returns a tuple with the EntryPoint field value // and a boolean to check if the value has been set. func (o *CallTarget) GetEntryPointOk() (*int32, bool) { - if o == nil || isNil(o.EntryPoint) { - return nil, false - } - return o.EntryPoint, true -} - -// HasEntryPoint returns a boolean if a field has been set. -func (o *CallTarget) HasEntryPoint() bool { - if o != nil && !isNil(o.EntryPoint) { - return true + if o == nil { + return nil, false } - - return false + return &o.EntryPoint, true } -// SetEntryPoint gets a reference to the given int32 and assigns it to the EntryPoint field. +// SetEntryPoint sets field value func (o *CallTarget) SetEntryPoint(v int32) { - o.EntryPoint = &v + o.EntryPoint = v } func (o CallTarget) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Contract) { - toSerialize["Contract"] = o.Contract - } - if !isNil(o.EntryPoint) { - toSerialize["EntryPoint"] = o.EntryPoint + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o CallTarget) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contract"] = o.Contract + toSerialize["entryPoint"] = o.EntryPoint + return toSerialize, nil +} + type NullableCallTarget struct { value *CallTarget isSet bool diff --git a/clients/apiclient/model_chain_info_response.go b/clients/apiclient/model_chain_info_response.go new file mode 100644 index 0000000000..556c5796ba --- /dev/null +++ b/clients/apiclient/model_chain_info_response.go @@ -0,0 +1,350 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ChainInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChainInfoResponse{} + +// ChainInfoResponse struct for ChainInfoResponse +type ChainInfoResponse struct { + // ChainID (Bech32-encoded). + ChainID string `json:"chainID"` + // The chain owner address (Bech32-encoded). + ChainOwnerId string `json:"chainOwnerId"` + // The description of the chain. + Description string `json:"description"` + // The EVM chain ID + EvmChainId uint32 `json:"evmChainId"` + GasFeePolicy *GasFeePolicy `json:"gasFeePolicy,omitempty"` + // Whether or not the chain is active. + IsActive bool `json:"isActive"` + // The maximum contract blob size. + MaxBlobSize uint32 `json:"maxBlobSize"` + // The maximum event size. + MaxEventSize uint32 `json:"maxEventSize"` + // The maximum amount of events per request. + MaxEventsPerReq uint32 `json:"maxEventsPerReq"` +} + +// NewChainInfoResponse instantiates a new ChainInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChainInfoResponse(chainID string, chainOwnerId string, description string, evmChainId uint32, isActive bool, maxBlobSize uint32, maxEventSize uint32, maxEventsPerReq uint32) *ChainInfoResponse { + this := ChainInfoResponse{} + this.ChainID = chainID + this.ChainOwnerId = chainOwnerId + this.Description = description + this.EvmChainId = evmChainId + this.IsActive = isActive + this.MaxBlobSize = maxBlobSize + this.MaxEventSize = maxEventSize + this.MaxEventsPerReq = maxEventsPerReq + return &this +} + +// NewChainInfoResponseWithDefaults instantiates a new ChainInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainInfoResponseWithDefaults() *ChainInfoResponse { + this := ChainInfoResponse{} + return &this +} + +// GetChainID returns the ChainID field value +func (o *ChainInfoResponse) GetChainID() string { + if o == nil { + var ret string + return ret + } + + return o.ChainID +} + +// GetChainIDOk returns a tuple with the ChainID field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetChainIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainID, true +} + +// SetChainID sets field value +func (o *ChainInfoResponse) SetChainID(v string) { + o.ChainID = v +} + +// GetChainOwnerId returns the ChainOwnerId field value +func (o *ChainInfoResponse) GetChainOwnerId() string { + if o == nil { + var ret string + return ret + } + + return o.ChainOwnerId +} + +// GetChainOwnerIdOk returns a tuple with the ChainOwnerId field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetChainOwnerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainOwnerId, true +} + +// SetChainOwnerId sets field value +func (o *ChainInfoResponse) SetChainOwnerId(v string) { + o.ChainOwnerId = v +} + +// GetDescription returns the Description field value +func (o *ChainInfoResponse) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *ChainInfoResponse) SetDescription(v string) { + o.Description = v +} + +// GetEvmChainId returns the EvmChainId field value +func (o *ChainInfoResponse) GetEvmChainId() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.EvmChainId +} + +// GetEvmChainIdOk returns a tuple with the EvmChainId field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetEvmChainIdOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.EvmChainId, true +} + +// SetEvmChainId sets field value +func (o *ChainInfoResponse) SetEvmChainId(v uint32) { + o.EvmChainId = v +} + +// GetGasFeePolicy returns the GasFeePolicy field value if set, zero value otherwise. +func (o *ChainInfoResponse) GetGasFeePolicy() GasFeePolicy { + if o == nil || isNil(o.GasFeePolicy) { + var ret GasFeePolicy + return ret + } + return *o.GasFeePolicy +} + +// GetGasFeePolicyOk returns a tuple with the GasFeePolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool) { + if o == nil || isNil(o.GasFeePolicy) { + return nil, false + } + return o.GasFeePolicy, true +} + +// HasGasFeePolicy returns a boolean if a field has been set. +func (o *ChainInfoResponse) HasGasFeePolicy() bool { + if o != nil && !isNil(o.GasFeePolicy) { + return true + } + + return false +} + +// SetGasFeePolicy gets a reference to the given GasFeePolicy and assigns it to the GasFeePolicy field. +func (o *ChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { + o.GasFeePolicy = &v +} + +// GetIsActive returns the IsActive field value +func (o *ChainInfoResponse) GetIsActive() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetIsActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsActive, true +} + +// SetIsActive sets field value +func (o *ChainInfoResponse) SetIsActive(v bool) { + o.IsActive = v +} + +// GetMaxBlobSize returns the MaxBlobSize field value +func (o *ChainInfoResponse) GetMaxBlobSize() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.MaxBlobSize +} + +// GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.MaxBlobSize, true +} + +// SetMaxBlobSize sets field value +func (o *ChainInfoResponse) SetMaxBlobSize(v uint32) { + o.MaxBlobSize = v +} + +// GetMaxEventSize returns the MaxEventSize field value +func (o *ChainInfoResponse) GetMaxEventSize() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.MaxEventSize +} + +// GetMaxEventSizeOk returns a tuple with the MaxEventSize field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.MaxEventSize, true +} + +// SetMaxEventSize sets field value +func (o *ChainInfoResponse) SetMaxEventSize(v uint32) { + o.MaxEventSize = v +} + +// GetMaxEventsPerReq returns the MaxEventsPerReq field value +func (o *ChainInfoResponse) GetMaxEventsPerReq() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.MaxEventsPerReq +} + +// GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value +// and a boolean to check if the value has been set. +func (o *ChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.MaxEventsPerReq, true +} + +// SetMaxEventsPerReq sets field value +func (o *ChainInfoResponse) SetMaxEventsPerReq(v uint32) { + o.MaxEventsPerReq = v +} + +func (o ChainInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChainInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["chainID"] = o.ChainID + toSerialize["chainOwnerId"] = o.ChainOwnerId + toSerialize["description"] = o.Description + toSerialize["evmChainId"] = o.EvmChainId + if !isNil(o.GasFeePolicy) { + toSerialize["gasFeePolicy"] = o.GasFeePolicy + } + toSerialize["isActive"] = o.IsActive + toSerialize["maxBlobSize"] = o.MaxBlobSize + toSerialize["maxEventSize"] = o.MaxEventSize + toSerialize["maxEventsPerReq"] = o.MaxEventsPerReq + return toSerialize, nil +} + +type NullableChainInfoResponse struct { + value *ChainInfoResponse + isSet bool +} + +func (v NullableChainInfoResponse) Get() *ChainInfoResponse { + return v.value +} + +func (v *NullableChainInfoResponse) Set(val *ChainInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableChainInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableChainInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainInfoResponse(val *ChainInfoResponse) *NullableChainInfoResponse { + return &NullableChainInfoResponse{value: val, isSet: true} +} + +func (v NullableChainInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go new file mode 100644 index 0000000000..1a4b83c507 --- /dev/null +++ b/clients/apiclient/model_chain_metrics.go @@ -0,0 +1,333 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ChainMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChainMetrics{} + +// ChainMetrics struct for ChainMetrics +type ChainMetrics struct { + InAliasOutput AliasOutputMetricItem `json:"inAliasOutput"` + InOnLedgerRequest OnLedgerRequestMetricItem `json:"inOnLedgerRequest"` + InOutput InOutputMetricItem `json:"inOutput"` + InStateOutput InStateOutputMetricItem `json:"inStateOutput"` + InTxInclusionState TxInclusionStateMsgMetricItem `json:"inTxInclusionState"` + OutPublishGovernanceTransaction TransactionMetricItem `json:"outPublishGovernanceTransaction"` + OutPullLatestOutput InterfaceMetricItem `json:"outPullLatestOutput"` + OutPullOutputByID UTXOInputMetricItem `json:"outPullOutputByID"` + OutPullTxInclusionState TransactionIDMetricItem `json:"outPullTxInclusionState"` +} + +// NewChainMetrics instantiates a new ChainMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChainMetrics(inAliasOutput AliasOutputMetricItem, inOnLedgerRequest OnLedgerRequestMetricItem, inOutput InOutputMetricItem, inStateOutput InStateOutputMetricItem, inTxInclusionState TxInclusionStateMsgMetricItem, outPublishGovernanceTransaction TransactionMetricItem, outPullLatestOutput InterfaceMetricItem, outPullOutputByID UTXOInputMetricItem, outPullTxInclusionState TransactionIDMetricItem) *ChainMetrics { + this := ChainMetrics{} + this.InAliasOutput = inAliasOutput + this.InOnLedgerRequest = inOnLedgerRequest + this.InOutput = inOutput + this.InStateOutput = inStateOutput + this.InTxInclusionState = inTxInclusionState + this.OutPublishGovernanceTransaction = outPublishGovernanceTransaction + this.OutPullLatestOutput = outPullLatestOutput + this.OutPullOutputByID = outPullOutputByID + this.OutPullTxInclusionState = outPullTxInclusionState + return &this +} + +// NewChainMetricsWithDefaults instantiates a new ChainMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainMetricsWithDefaults() *ChainMetrics { + this := ChainMetrics{} + return &this +} + +// GetInAliasOutput returns the InAliasOutput field value +func (o *ChainMetrics) GetInAliasOutput() AliasOutputMetricItem { + if o == nil { + var ret AliasOutputMetricItem + return ret + } + + return o.InAliasOutput +} + +// GetInAliasOutputOk returns a tuple with the InAliasOutput field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInAliasOutputOk() (*AliasOutputMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.InAliasOutput, true +} + +// SetInAliasOutput sets field value +func (o *ChainMetrics) SetInAliasOutput(v AliasOutputMetricItem) { + o.InAliasOutput = v +} + +// GetInOnLedgerRequest returns the InOnLedgerRequest field value +func (o *ChainMetrics) GetInOnLedgerRequest() OnLedgerRequestMetricItem { + if o == nil { + var ret OnLedgerRequestMetricItem + return ret + } + + return o.InOnLedgerRequest +} + +// GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInOnLedgerRequestOk() (*OnLedgerRequestMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.InOnLedgerRequest, true +} + +// SetInOnLedgerRequest sets field value +func (o *ChainMetrics) SetInOnLedgerRequest(v OnLedgerRequestMetricItem) { + o.InOnLedgerRequest = v +} + +// GetInOutput returns the InOutput field value +func (o *ChainMetrics) GetInOutput() InOutputMetricItem { + if o == nil { + var ret InOutputMetricItem + return ret + } + + return o.InOutput +} + +// GetInOutputOk returns a tuple with the InOutput field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInOutputOk() (*InOutputMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.InOutput, true +} + +// SetInOutput sets field value +func (o *ChainMetrics) SetInOutput(v InOutputMetricItem) { + o.InOutput = v +} + +// GetInStateOutput returns the InStateOutput field value +func (o *ChainMetrics) GetInStateOutput() InStateOutputMetricItem { + if o == nil { + var ret InStateOutputMetricItem + return ret + } + + return o.InStateOutput +} + +// GetInStateOutputOk returns a tuple with the InStateOutput field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInStateOutputOk() (*InStateOutputMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.InStateOutput, true +} + +// SetInStateOutput sets field value +func (o *ChainMetrics) SetInStateOutput(v InStateOutputMetricItem) { + o.InStateOutput = v +} + +// GetInTxInclusionState returns the InTxInclusionState field value +func (o *ChainMetrics) GetInTxInclusionState() TxInclusionStateMsgMetricItem { + if o == nil { + var ret TxInclusionStateMsgMetricItem + return ret + } + + return o.InTxInclusionState +} + +// GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInTxInclusionStateOk() (*TxInclusionStateMsgMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.InTxInclusionState, true +} + +// SetInTxInclusionState sets field value +func (o *ChainMetrics) SetInTxInclusionState(v TxInclusionStateMsgMetricItem) { + o.InTxInclusionState = v +} + +// GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field value +func (o *ChainMetrics) GetOutPublishGovernanceTransaction() TransactionMetricItem { + if o == nil { + var ret TransactionMetricItem + return ret + } + + return o.OutPublishGovernanceTransaction +} + +// GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPublishGovernanceTransactionOk() (*TransactionMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.OutPublishGovernanceTransaction, true +} + +// SetOutPublishGovernanceTransaction sets field value +func (o *ChainMetrics) SetOutPublishGovernanceTransaction(v TransactionMetricItem) { + o.OutPublishGovernanceTransaction = v +} + +// GetOutPullLatestOutput returns the OutPullLatestOutput field value +func (o *ChainMetrics) GetOutPullLatestOutput() InterfaceMetricItem { + if o == nil { + var ret InterfaceMetricItem + return ret + } + + return o.OutPullLatestOutput +} + +// GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPullLatestOutputOk() (*InterfaceMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.OutPullLatestOutput, true +} + +// SetOutPullLatestOutput sets field value +func (o *ChainMetrics) SetOutPullLatestOutput(v InterfaceMetricItem) { + o.OutPullLatestOutput = v +} + +// GetOutPullOutputByID returns the OutPullOutputByID field value +func (o *ChainMetrics) GetOutPullOutputByID() UTXOInputMetricItem { + if o == nil { + var ret UTXOInputMetricItem + return ret + } + + return o.OutPullOutputByID +} + +// GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPullOutputByIDOk() (*UTXOInputMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.OutPullOutputByID, true +} + +// SetOutPullOutputByID sets field value +func (o *ChainMetrics) SetOutPullOutputByID(v UTXOInputMetricItem) { + o.OutPullOutputByID = v +} + +// GetOutPullTxInclusionState returns the OutPullTxInclusionState field value +func (o *ChainMetrics) GetOutPullTxInclusionState() TransactionIDMetricItem { + if o == nil { + var ret TransactionIDMetricItem + return ret + } + + return o.OutPullTxInclusionState +} + +// GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPullTxInclusionStateOk() (*TransactionIDMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.OutPullTxInclusionState, true +} + +// SetOutPullTxInclusionState sets field value +func (o *ChainMetrics) SetOutPullTxInclusionState(v TransactionIDMetricItem) { + o.OutPullTxInclusionState = v +} + +func (o ChainMetrics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChainMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["inAliasOutput"] = o.InAliasOutput + toSerialize["inOnLedgerRequest"] = o.InOnLedgerRequest + toSerialize["inOutput"] = o.InOutput + toSerialize["inStateOutput"] = o.InStateOutput + toSerialize["inTxInclusionState"] = o.InTxInclusionState + toSerialize["outPublishGovernanceTransaction"] = o.OutPublishGovernanceTransaction + toSerialize["outPullLatestOutput"] = o.OutPullLatestOutput + toSerialize["outPullOutputByID"] = o.OutPullOutputByID + toSerialize["outPullTxInclusionState"] = o.OutPullTxInclusionState + return toSerialize, nil +} + +type NullableChainMetrics struct { + value *ChainMetrics + isSet bool +} + +func (v NullableChainMetrics) Get() *ChainMetrics { + return v.value +} + +func (v *NullableChainMetrics) Set(val *ChainMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableChainMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableChainMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainMetrics(val *ChainMetrics) *NullableChainMetrics { + return &NullableChainMetrics{value: val, isSet: true} +} + +func (v NullableChainMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_committee_info_response.go b/clients/apiclient/model_committee_info_response.go similarity index 51% rename from client/model_committee_info_response.go rename to clients/apiclient/model_committee_info_response.go index c9a34780df..99a1493b4d 100644 --- a/client/model_committee_info_response.go +++ b/clients/apiclient/model_committee_info_response.go @@ -3,38 +3,47 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the CommitteeInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitteeInfoResponse{} + // CommitteeInfoResponse struct for CommitteeInfoResponse type CommitteeInfoResponse struct { // A list of all access nodes and their peering info. - AccessNodes []CommitteeNode `json:"accessNodes,omitempty"` + AccessNodes []CommitteeNode `json:"accessNodes"` // Whether or not the chain is active. - Active *bool `json:"active,omitempty"` + Active bool `json:"active"` // A list of all candidate nodes and their peering info. - CandidateNodes []CommitteeNode `json:"candidateNodes,omitempty"` + CandidateNodes []CommitteeNode `json:"candidateNodes"` // ChainID (Bech32-encoded). - ChainId *string `json:"chainId,omitempty"` + ChainId string `json:"chainId"` // A list of all committee nodes and their peering info. - CommitteeNodes []CommitteeNode `json:"committeeNodes,omitempty"` - StateAddress *string `json:"stateAddress,omitempty"` + CommitteeNodes []CommitteeNode `json:"committeeNodes"` + StateAddress string `json:"stateAddress"` } // NewCommitteeInfoResponse instantiates a new CommitteeInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCommitteeInfoResponse() *CommitteeInfoResponse { +func NewCommitteeInfoResponse(accessNodes []CommitteeNode, active bool, candidateNodes []CommitteeNode, chainId string, committeeNodes []CommitteeNode, stateAddress string) *CommitteeInfoResponse { this := CommitteeInfoResponse{} + this.AccessNodes = accessNodes + this.Active = active + this.CandidateNodes = candidateNodes + this.ChainId = chainId + this.CommitteeNodes = committeeNodes + this.StateAddress = stateAddress return &this } @@ -46,221 +55,169 @@ func NewCommitteeInfoResponseWithDefaults() *CommitteeInfoResponse { return &this } -// GetAccessNodes returns the AccessNodes field value if set, zero value otherwise. +// GetAccessNodes returns the AccessNodes field value func (o *CommitteeInfoResponse) GetAccessNodes() []CommitteeNode { - if o == nil || isNil(o.AccessNodes) { + if o == nil { var ret []CommitteeNode return ret } + return o.AccessNodes } -// GetAccessNodesOk returns a tuple with the AccessNodes field value if set, nil otherwise +// GetAccessNodesOk returns a tuple with the AccessNodes field value // and a boolean to check if the value has been set. func (o *CommitteeInfoResponse) GetAccessNodesOk() ([]CommitteeNode, bool) { - if o == nil || isNil(o.AccessNodes) { - return nil, false + if o == nil { + return nil, false } return o.AccessNodes, true } -// HasAccessNodes returns a boolean if a field has been set. -func (o *CommitteeInfoResponse) HasAccessNodes() bool { - if o != nil && !isNil(o.AccessNodes) { - return true - } - - return false -} - -// SetAccessNodes gets a reference to the given []CommitteeNode and assigns it to the AccessNodes field. +// SetAccessNodes sets field value func (o *CommitteeInfoResponse) SetAccessNodes(v []CommitteeNode) { o.AccessNodes = v } -// GetActive returns the Active field value if set, zero value otherwise. +// GetActive returns the Active field value func (o *CommitteeInfoResponse) GetActive() bool { - if o == nil || isNil(o.Active) { + if o == nil { var ret bool return ret } - return *o.Active + + return o.Active } -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// GetActiveOk returns a tuple with the Active field value // and a boolean to check if the value has been set. func (o *CommitteeInfoResponse) GetActiveOk() (*bool, bool) { - if o == nil || isNil(o.Active) { - return nil, false - } - return o.Active, true -} - -// HasActive returns a boolean if a field has been set. -func (o *CommitteeInfoResponse) HasActive() bool { - if o != nil && !isNil(o.Active) { - return true + if o == nil { + return nil, false } - - return false + return &o.Active, true } -// SetActive gets a reference to the given bool and assigns it to the Active field. +// SetActive sets field value func (o *CommitteeInfoResponse) SetActive(v bool) { - o.Active = &v + o.Active = v } -// GetCandidateNodes returns the CandidateNodes field value if set, zero value otherwise. +// GetCandidateNodes returns the CandidateNodes field value func (o *CommitteeInfoResponse) GetCandidateNodes() []CommitteeNode { - if o == nil || isNil(o.CandidateNodes) { + if o == nil { var ret []CommitteeNode return ret } + return o.CandidateNodes } -// GetCandidateNodesOk returns a tuple with the CandidateNodes field value if set, nil otherwise +// GetCandidateNodesOk returns a tuple with the CandidateNodes field value // and a boolean to check if the value has been set. func (o *CommitteeInfoResponse) GetCandidateNodesOk() ([]CommitteeNode, bool) { - if o == nil || isNil(o.CandidateNodes) { - return nil, false + if o == nil { + return nil, false } return o.CandidateNodes, true } -// HasCandidateNodes returns a boolean if a field has been set. -func (o *CommitteeInfoResponse) HasCandidateNodes() bool { - if o != nil && !isNil(o.CandidateNodes) { - return true - } - - return false -} - -// SetCandidateNodes gets a reference to the given []CommitteeNode and assigns it to the CandidateNodes field. +// SetCandidateNodes sets field value func (o *CommitteeInfoResponse) SetCandidateNodes(v []CommitteeNode) { o.CandidateNodes = v } -// GetChainId returns the ChainId field value if set, zero value otherwise. +// GetChainId returns the ChainId field value func (o *CommitteeInfoResponse) GetChainId() string { - if o == nil || isNil(o.ChainId) { + if o == nil { var ret string return ret } - return *o.ChainId + + return o.ChainId } -// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// GetChainIdOk returns a tuple with the ChainId field value // and a boolean to check if the value has been set. func (o *CommitteeInfoResponse) GetChainIdOk() (*string, bool) { - if o == nil || isNil(o.ChainId) { - return nil, false - } - return o.ChainId, true -} - -// HasChainId returns a boolean if a field has been set. -func (o *CommitteeInfoResponse) HasChainId() bool { - if o != nil && !isNil(o.ChainId) { - return true + if o == nil { + return nil, false } - - return false + return &o.ChainId, true } -// SetChainId gets a reference to the given string and assigns it to the ChainId field. +// SetChainId sets field value func (o *CommitteeInfoResponse) SetChainId(v string) { - o.ChainId = &v + o.ChainId = v } -// GetCommitteeNodes returns the CommitteeNodes field value if set, zero value otherwise. +// GetCommitteeNodes returns the CommitteeNodes field value func (o *CommitteeInfoResponse) GetCommitteeNodes() []CommitteeNode { - if o == nil || isNil(o.CommitteeNodes) { + if o == nil { var ret []CommitteeNode return ret } + return o.CommitteeNodes } -// GetCommitteeNodesOk returns a tuple with the CommitteeNodes field value if set, nil otherwise +// GetCommitteeNodesOk returns a tuple with the CommitteeNodes field value // and a boolean to check if the value has been set. func (o *CommitteeInfoResponse) GetCommitteeNodesOk() ([]CommitteeNode, bool) { - if o == nil || isNil(o.CommitteeNodes) { - return nil, false + if o == nil { + return nil, false } return o.CommitteeNodes, true } -// HasCommitteeNodes returns a boolean if a field has been set. -func (o *CommitteeInfoResponse) HasCommitteeNodes() bool { - if o != nil && !isNil(o.CommitteeNodes) { - return true - } - - return false -} - -// SetCommitteeNodes gets a reference to the given []CommitteeNode and assigns it to the CommitteeNodes field. +// SetCommitteeNodes sets field value func (o *CommitteeInfoResponse) SetCommitteeNodes(v []CommitteeNode) { o.CommitteeNodes = v } -// GetStateAddress returns the StateAddress field value if set, zero value otherwise. +// GetStateAddress returns the StateAddress field value func (o *CommitteeInfoResponse) GetStateAddress() string { - if o == nil || isNil(o.StateAddress) { + if o == nil { var ret string return ret } - return *o.StateAddress + + return o.StateAddress } -// GetStateAddressOk returns a tuple with the StateAddress field value if set, nil otherwise +// GetStateAddressOk returns a tuple with the StateAddress field value // and a boolean to check if the value has been set. func (o *CommitteeInfoResponse) GetStateAddressOk() (*string, bool) { - if o == nil || isNil(o.StateAddress) { - return nil, false - } - return o.StateAddress, true -} - -// HasStateAddress returns a boolean if a field has been set. -func (o *CommitteeInfoResponse) HasStateAddress() bool { - if o != nil && !isNil(o.StateAddress) { - return true + if o == nil { + return nil, false } - - return false + return &o.StateAddress, true } -// SetStateAddress gets a reference to the given string and assigns it to the StateAddress field. +// SetStateAddress sets field value func (o *CommitteeInfoResponse) SetStateAddress(v string) { - o.StateAddress = &v + o.StateAddress = v } func (o CommitteeInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.AccessNodes) { - toSerialize["accessNodes"] = o.AccessNodes - } - if !isNil(o.Active) { - toSerialize["active"] = o.Active - } - if !isNil(o.CandidateNodes) { - toSerialize["candidateNodes"] = o.CandidateNodes - } - if !isNil(o.ChainId) { - toSerialize["chainId"] = o.ChainId - } - if !isNil(o.CommitteeNodes) { - toSerialize["committeeNodes"] = o.CommitteeNodes - } - if !isNil(o.StateAddress) { - toSerialize["stateAddress"] = o.StateAddress + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o CommitteeInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accessNodes"] = o.AccessNodes + toSerialize["active"] = o.Active + toSerialize["candidateNodes"] = o.CandidateNodes + toSerialize["chainId"] = o.ChainId + toSerialize["committeeNodes"] = o.CommitteeNodes + toSerialize["stateAddress"] = o.StateAddress + return toSerialize, nil +} + type NullableCommitteeInfoResponse struct { value *CommitteeInfoResponse isSet bool diff --git a/client/model_committee_node.go b/clients/apiclient/model_committee_node.go similarity index 63% rename from client/model_committee_node.go rename to clients/apiclient/model_committee_node.go index 6c244ec2dd..7f1949395f 100644 --- a/client/model_committee_node.go +++ b/clients/apiclient/model_committee_node.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the CommitteeNode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CommitteeNode{} + // CommitteeNode struct for CommitteeNode type CommitteeNode struct { - AccessAPI *string `json:"accessAPI,omitempty"` - Node *PeeringNodeStatusResponse `json:"node,omitempty"` + AccessAPI string `json:"accessAPI"` + Node PeeringNodeStatusResponse `json:"node"` } // NewCommitteeNode instantiates a new CommitteeNode object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCommitteeNode() *CommitteeNode { +func NewCommitteeNode(accessAPI string, node PeeringNodeStatusResponse) *CommitteeNode { this := CommitteeNode{} + this.AccessAPI = accessAPI + this.Node = node return &this } @@ -37,81 +42,69 @@ func NewCommitteeNodeWithDefaults() *CommitteeNode { return &this } -// GetAccessAPI returns the AccessAPI field value if set, zero value otherwise. +// GetAccessAPI returns the AccessAPI field value func (o *CommitteeNode) GetAccessAPI() string { - if o == nil || isNil(o.AccessAPI) { + if o == nil { var ret string return ret } - return *o.AccessAPI + + return o.AccessAPI } -// GetAccessAPIOk returns a tuple with the AccessAPI field value if set, nil otherwise +// GetAccessAPIOk returns a tuple with the AccessAPI field value // and a boolean to check if the value has been set. func (o *CommitteeNode) GetAccessAPIOk() (*string, bool) { - if o == nil || isNil(o.AccessAPI) { - return nil, false - } - return o.AccessAPI, true -} - -// HasAccessAPI returns a boolean if a field has been set. -func (o *CommitteeNode) HasAccessAPI() bool { - if o != nil && !isNil(o.AccessAPI) { - return true + if o == nil { + return nil, false } - - return false + return &o.AccessAPI, true } -// SetAccessAPI gets a reference to the given string and assigns it to the AccessAPI field. +// SetAccessAPI sets field value func (o *CommitteeNode) SetAccessAPI(v string) { - o.AccessAPI = &v + o.AccessAPI = v } -// GetNode returns the Node field value if set, zero value otherwise. +// GetNode returns the Node field value func (o *CommitteeNode) GetNode() PeeringNodeStatusResponse { - if o == nil || isNil(o.Node) { + if o == nil { var ret PeeringNodeStatusResponse return ret } - return *o.Node + + return o.Node } -// GetNodeOk returns a tuple with the Node field value if set, nil otherwise +// GetNodeOk returns a tuple with the Node field value // and a boolean to check if the value has been set. func (o *CommitteeNode) GetNodeOk() (*PeeringNodeStatusResponse, bool) { - if o == nil || isNil(o.Node) { - return nil, false - } - return o.Node, true -} - -// HasNode returns a boolean if a field has been set. -func (o *CommitteeNode) HasNode() bool { - if o != nil && !isNil(o.Node) { - return true + if o == nil { + return nil, false } - - return false + return &o.Node, true } -// SetNode gets a reference to the given PeeringNodeStatusResponse and assigns it to the Node field. +// SetNode sets field value func (o *CommitteeNode) SetNode(v PeeringNodeStatusResponse) { - o.Node = &v + o.Node = v } func (o CommitteeNode) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.AccessAPI) { - toSerialize["accessAPI"] = o.AccessAPI - } - if !isNil(o.Node) { - toSerialize["node"] = o.Node + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o CommitteeNode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accessAPI"] = o.AccessAPI + toSerialize["node"] = o.Node + return toSerialize, nil +} + type NullableCommitteeNode struct { value *CommitteeNode isSet bool diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go new file mode 100644 index 0000000000..ba6888811c --- /dev/null +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -0,0 +1,225 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ConsensusPipeMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsensusPipeMetrics{} + +// ConsensusPipeMetrics struct for ConsensusPipeMetrics +type ConsensusPipeMetrics struct { + EventACSMsgPipeSize int32 `json:"eventACSMsgPipeSize"` + EventPeerLogIndexMsgPipeSize int32 `json:"eventPeerLogIndexMsgPipeSize"` + EventStateTransitionMsgPipeSize int32 `json:"eventStateTransitionMsgPipeSize"` + EventTimerMsgPipeSize int32 `json:"eventTimerMsgPipeSize"` + EventVMResultMsgPipeSize int32 `json:"eventVMResultMsgPipeSize"` +} + +// NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsensusPipeMetrics(eventACSMsgPipeSize int32, eventPeerLogIndexMsgPipeSize int32, eventStateTransitionMsgPipeSize int32, eventTimerMsgPipeSize int32, eventVMResultMsgPipeSize int32) *ConsensusPipeMetrics { + this := ConsensusPipeMetrics{} + this.EventACSMsgPipeSize = eventACSMsgPipeSize + this.EventPeerLogIndexMsgPipeSize = eventPeerLogIndexMsgPipeSize + this.EventStateTransitionMsgPipeSize = eventStateTransitionMsgPipeSize + this.EventTimerMsgPipeSize = eventTimerMsgPipeSize + this.EventVMResultMsgPipeSize = eventVMResultMsgPipeSize + return &this +} + +// NewConsensusPipeMetricsWithDefaults instantiates a new ConsensusPipeMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsensusPipeMetricsWithDefaults() *ConsensusPipeMetrics { + this := ConsensusPipeMetrics{} + return &this +} + +// GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field value +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.EventACSMsgPipeSize +} + +// GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field value +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.EventACSMsgPipeSize, true +} + +// SetEventACSMsgPipeSize sets field value +func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32) { + o.EventACSMsgPipeSize = v +} + +// GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field value +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.EventPeerLogIndexMsgPipeSize +} + +// GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field value +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.EventPeerLogIndexMsgPipeSize, true +} + +// SetEventPeerLogIndexMsgPipeSize sets field value +func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32) { + o.EventPeerLogIndexMsgPipeSize = v +} + +// GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field value +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.EventStateTransitionMsgPipeSize +} + +// GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field value +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.EventStateTransitionMsgPipeSize, true +} + +// SetEventStateTransitionMsgPipeSize sets field value +func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32) { + o.EventStateTransitionMsgPipeSize = v +} + +// GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field value +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.EventTimerMsgPipeSize +} + +// GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field value +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.EventTimerMsgPipeSize, true +} + +// SetEventTimerMsgPipeSize sets field value +func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32) { + o.EventTimerMsgPipeSize = v +} + +// GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field value +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.EventVMResultMsgPipeSize +} + +// GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field value +// and a boolean to check if the value has been set. +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.EventVMResultMsgPipeSize, true +} + +// SetEventVMResultMsgPipeSize sets field value +func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32) { + o.EventVMResultMsgPipeSize = v +} + +func (o ConsensusPipeMetrics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsensusPipeMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["eventACSMsgPipeSize"] = o.EventACSMsgPipeSize + toSerialize["eventPeerLogIndexMsgPipeSize"] = o.EventPeerLogIndexMsgPipeSize + toSerialize["eventStateTransitionMsgPipeSize"] = o.EventStateTransitionMsgPipeSize + toSerialize["eventTimerMsgPipeSize"] = o.EventTimerMsgPipeSize + toSerialize["eventVMResultMsgPipeSize"] = o.EventVMResultMsgPipeSize + return toSerialize, nil +} + +type NullableConsensusPipeMetrics struct { + value *ConsensusPipeMetrics + isSet bool +} + +func (v NullableConsensusPipeMetrics) Get() *ConsensusPipeMetrics { + return v.value +} + +func (v *NullableConsensusPipeMetrics) Set(val *ConsensusPipeMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusPipeMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusPipeMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusPipeMetrics(val *ConsensusPipeMetrics) *NullableConsensusPipeMetrics { + return &NullableConsensusPipeMetrics{value: val, isSet: true} +} + +func (v NullableConsensusPipeMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusPipeMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_consensus_workflow_metrics.go b/clients/apiclient/model_consensus_workflow_metrics.go new file mode 100644 index 0000000000..705c49e2db --- /dev/null +++ b/clients/apiclient/model_consensus_workflow_metrics.go @@ -0,0 +1,604 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" + "time" +) + +// checks if the ConsensusWorkflowMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsensusWorkflowMetrics{} + +// ConsensusWorkflowMetrics struct for ConsensusWorkflowMetrics +type ConsensusWorkflowMetrics struct { + // Shows current state index of the consensus + CurrentStateIndex *uint32 `json:"currentStateIndex,omitempty"` + // Shows if batch proposal is sent out in current consensus iteration + FlagBatchProposalSent bool `json:"flagBatchProposalSent"` + // Shows if consensus on batch is reached and known in current consensus iteration + FlagConsensusBatchKnown bool `json:"flagConsensusBatchKnown"` + // Shows if consensus algorithm is still not completed in current consensus iteration + FlagInProgress bool `json:"flagInProgress"` + // Shows if state output is received in current consensus iteration + FlagStateReceived bool `json:"flagStateReceived"` + // Shows if consensus on transaction is reached in current consensus iteration + FlagTransactionFinalized bool `json:"flagTransactionFinalized"` + // Shows if transaction is posted to L1 in current consensus iteration + FlagTransactionPosted bool `json:"flagTransactionPosted"` + // Shows if L1 reported that it has seen the transaction of current consensus iteration + FlagTransactionSeen bool `json:"flagTransactionSeen"` + // Shows if virtual machine has returned its results in current consensus iteration + FlagVMResultSigned bool `json:"flagVMResultSigned"` + // Shows if virtual machine is started in current consensus iteration + FlagVMStarted bool `json:"flagVMStarted"` + // Shows when batch proposal was last sent out in current consensus iteration + TimeBatchProposalSent time.Time `json:"timeBatchProposalSent"` + // Shows when algorithm was last completed in current consensus iteration + TimeCompleted time.Time `json:"timeCompleted"` + // Shows when ACS results of consensus on batch was last received in current consensus iteration + TimeConsensusBatchKnown time.Time `json:"timeConsensusBatchKnown"` + // Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration + TimeTransactionFinalized time.Time `json:"timeTransactionFinalized"` + // Shows when transaction was last posted to L1 in current consensus iteration + TimeTransactionPosted time.Time `json:"timeTransactionPosted"` + // Shows when algorithm last noted that transaction had been seen by L1 in current consensus iteration + TimeTransactionSeen time.Time `json:"timeTransactionSeen"` + // Shows when virtual machine results were last received and signed in current consensus iteration + TimeVMResultSigned time.Time `json:"timeVMResultSigned"` + // Shows when virtual machine was last started in current consensus iteration + TimeVMStarted time.Time `json:"timeVMStarted"` +} + +// NewConsensusWorkflowMetrics instantiates a new ConsensusWorkflowMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsensusWorkflowMetrics(flagBatchProposalSent bool, flagConsensusBatchKnown bool, flagInProgress bool, flagStateReceived bool, flagTransactionFinalized bool, flagTransactionPosted bool, flagTransactionSeen bool, flagVMResultSigned bool, flagVMStarted bool, timeBatchProposalSent time.Time, timeCompleted time.Time, timeConsensusBatchKnown time.Time, timeTransactionFinalized time.Time, timeTransactionPosted time.Time, timeTransactionSeen time.Time, timeVMResultSigned time.Time, timeVMStarted time.Time) *ConsensusWorkflowMetrics { + this := ConsensusWorkflowMetrics{} + this.FlagBatchProposalSent = flagBatchProposalSent + this.FlagConsensusBatchKnown = flagConsensusBatchKnown + this.FlagInProgress = flagInProgress + this.FlagStateReceived = flagStateReceived + this.FlagTransactionFinalized = flagTransactionFinalized + this.FlagTransactionPosted = flagTransactionPosted + this.FlagTransactionSeen = flagTransactionSeen + this.FlagVMResultSigned = flagVMResultSigned + this.FlagVMStarted = flagVMStarted + this.TimeBatchProposalSent = timeBatchProposalSent + this.TimeCompleted = timeCompleted + this.TimeConsensusBatchKnown = timeConsensusBatchKnown + this.TimeTransactionFinalized = timeTransactionFinalized + this.TimeTransactionPosted = timeTransactionPosted + this.TimeTransactionSeen = timeTransactionSeen + this.TimeVMResultSigned = timeVMResultSigned + this.TimeVMStarted = timeVMStarted + return &this +} + +// NewConsensusWorkflowMetricsWithDefaults instantiates a new ConsensusWorkflowMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsensusWorkflowMetricsWithDefaults() *ConsensusWorkflowMetrics { + this := ConsensusWorkflowMetrics{} + return &this +} + +// GetCurrentStateIndex returns the CurrentStateIndex field value if set, zero value otherwise. +func (o *ConsensusWorkflowMetrics) GetCurrentStateIndex() uint32 { + if o == nil || isNil(o.CurrentStateIndex) { + var ret uint32 + return ret + } + return *o.CurrentStateIndex +} + +// GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetCurrentStateIndexOk() (*uint32, bool) { + if o == nil || isNil(o.CurrentStateIndex) { + return nil, false + } + return o.CurrentStateIndex, true +} + +// HasCurrentStateIndex returns a boolean if a field has been set. +func (o *ConsensusWorkflowMetrics) HasCurrentStateIndex() bool { + if o != nil && !isNil(o.CurrentStateIndex) { + return true + } + + return false +} + +// SetCurrentStateIndex gets a reference to the given uint32 and assigns it to the CurrentStateIndex field. +func (o *ConsensusWorkflowMetrics) SetCurrentStateIndex(v uint32) { + o.CurrentStateIndex = &v +} + +// GetFlagBatchProposalSent returns the FlagBatchProposalSent field value +func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSent() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagBatchProposalSent +} + +// GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagBatchProposalSentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagBatchProposalSent, true +} + +// SetFlagBatchProposalSent sets field value +func (o *ConsensusWorkflowMetrics) SetFlagBatchProposalSent(v bool) { + o.FlagBatchProposalSent = v +} + +// GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field value +func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnown() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagConsensusBatchKnown +} + +// GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagConsensusBatchKnownOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagConsensusBatchKnown, true +} + +// SetFlagConsensusBatchKnown sets field value +func (o *ConsensusWorkflowMetrics) SetFlagConsensusBatchKnown(v bool) { + o.FlagConsensusBatchKnown = v +} + +// GetFlagInProgress returns the FlagInProgress field value +func (o *ConsensusWorkflowMetrics) GetFlagInProgress() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagInProgress +} + +// GetFlagInProgressOk returns a tuple with the FlagInProgress field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagInProgressOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagInProgress, true +} + +// SetFlagInProgress sets field value +func (o *ConsensusWorkflowMetrics) SetFlagInProgress(v bool) { + o.FlagInProgress = v +} + +// GetFlagStateReceived returns the FlagStateReceived field value +func (o *ConsensusWorkflowMetrics) GetFlagStateReceived() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagStateReceived +} + +// GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagStateReceivedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagStateReceived, true +} + +// SetFlagStateReceived sets field value +func (o *ConsensusWorkflowMetrics) SetFlagStateReceived(v bool) { + o.FlagStateReceived = v +} + +// GetFlagTransactionFinalized returns the FlagTransactionFinalized field value +func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalized() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagTransactionFinalized +} + +// GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionFinalizedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagTransactionFinalized, true +} + +// SetFlagTransactionFinalized sets field value +func (o *ConsensusWorkflowMetrics) SetFlagTransactionFinalized(v bool) { + o.FlagTransactionFinalized = v +} + +// GetFlagTransactionPosted returns the FlagTransactionPosted field value +func (o *ConsensusWorkflowMetrics) GetFlagTransactionPosted() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagTransactionPosted +} + +// GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionPostedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagTransactionPosted, true +} + +// SetFlagTransactionPosted sets field value +func (o *ConsensusWorkflowMetrics) SetFlagTransactionPosted(v bool) { + o.FlagTransactionPosted = v +} + +// GetFlagTransactionSeen returns the FlagTransactionSeen field value +func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeen() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagTransactionSeen +} + +// GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagTransactionSeenOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagTransactionSeen, true +} + +// SetFlagTransactionSeen sets field value +func (o *ConsensusWorkflowMetrics) SetFlagTransactionSeen(v bool) { + o.FlagTransactionSeen = v +} + +// GetFlagVMResultSigned returns the FlagVMResultSigned field value +func (o *ConsensusWorkflowMetrics) GetFlagVMResultSigned() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagVMResultSigned +} + +// GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagVMResultSignedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagVMResultSigned, true +} + +// SetFlagVMResultSigned sets field value +func (o *ConsensusWorkflowMetrics) SetFlagVMResultSigned(v bool) { + o.FlagVMResultSigned = v +} + +// GetFlagVMStarted returns the FlagVMStarted field value +func (o *ConsensusWorkflowMetrics) GetFlagVMStarted() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlagVMStarted +} + +// GetFlagVMStartedOk returns a tuple with the FlagVMStarted field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetFlagVMStartedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlagVMStarted, true +} + +// SetFlagVMStarted sets field value +func (o *ConsensusWorkflowMetrics) SetFlagVMStarted(v bool) { + o.FlagVMStarted = v +} + +// GetTimeBatchProposalSent returns the TimeBatchProposalSent field value +func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSent() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeBatchProposalSent +} + +// GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeBatchProposalSentOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeBatchProposalSent, true +} + +// SetTimeBatchProposalSent sets field value +func (o *ConsensusWorkflowMetrics) SetTimeBatchProposalSent(v time.Time) { + o.TimeBatchProposalSent = v +} + +// GetTimeCompleted returns the TimeCompleted field value +func (o *ConsensusWorkflowMetrics) GetTimeCompleted() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeCompleted +} + +// GetTimeCompletedOk returns a tuple with the TimeCompleted field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeCompletedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeCompleted, true +} + +// SetTimeCompleted sets field value +func (o *ConsensusWorkflowMetrics) SetTimeCompleted(v time.Time) { + o.TimeCompleted = v +} + +// GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field value +func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnown() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeConsensusBatchKnown +} + +// GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeConsensusBatchKnownOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeConsensusBatchKnown, true +} + +// SetTimeConsensusBatchKnown sets field value +func (o *ConsensusWorkflowMetrics) SetTimeConsensusBatchKnown(v time.Time) { + o.TimeConsensusBatchKnown = v +} + +// GetTimeTransactionFinalized returns the TimeTransactionFinalized field value +func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalized() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeTransactionFinalized +} + +// GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionFinalizedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeTransactionFinalized, true +} + +// SetTimeTransactionFinalized sets field value +func (o *ConsensusWorkflowMetrics) SetTimeTransactionFinalized(v time.Time) { + o.TimeTransactionFinalized = v +} + +// GetTimeTransactionPosted returns the TimeTransactionPosted field value +func (o *ConsensusWorkflowMetrics) GetTimeTransactionPosted() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeTransactionPosted +} + +// GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionPostedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeTransactionPosted, true +} + +// SetTimeTransactionPosted sets field value +func (o *ConsensusWorkflowMetrics) SetTimeTransactionPosted(v time.Time) { + o.TimeTransactionPosted = v +} + +// GetTimeTransactionSeen returns the TimeTransactionSeen field value +func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeen() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeTransactionSeen +} + +// GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeTransactionSeenOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeTransactionSeen, true +} + +// SetTimeTransactionSeen sets field value +func (o *ConsensusWorkflowMetrics) SetTimeTransactionSeen(v time.Time) { + o.TimeTransactionSeen = v +} + +// GetTimeVMResultSigned returns the TimeVMResultSigned field value +func (o *ConsensusWorkflowMetrics) GetTimeVMResultSigned() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeVMResultSigned +} + +// GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeVMResultSignedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeVMResultSigned, true +} + +// SetTimeVMResultSigned sets field value +func (o *ConsensusWorkflowMetrics) SetTimeVMResultSigned(v time.Time) { + o.TimeVMResultSigned = v +} + +// GetTimeVMStarted returns the TimeVMStarted field value +func (o *ConsensusWorkflowMetrics) GetTimeVMStarted() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.TimeVMStarted +} + +// GetTimeVMStartedOk returns a tuple with the TimeVMStarted field value +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowMetrics) GetTimeVMStartedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.TimeVMStarted, true +} + +// SetTimeVMStarted sets field value +func (o *ConsensusWorkflowMetrics) SetTimeVMStarted(v time.Time) { + o.TimeVMStarted = v +} + +func (o ConsensusWorkflowMetrics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsensusWorkflowMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CurrentStateIndex) { + toSerialize["currentStateIndex"] = o.CurrentStateIndex + } + toSerialize["flagBatchProposalSent"] = o.FlagBatchProposalSent + toSerialize["flagConsensusBatchKnown"] = o.FlagConsensusBatchKnown + toSerialize["flagInProgress"] = o.FlagInProgress + toSerialize["flagStateReceived"] = o.FlagStateReceived + toSerialize["flagTransactionFinalized"] = o.FlagTransactionFinalized + toSerialize["flagTransactionPosted"] = o.FlagTransactionPosted + toSerialize["flagTransactionSeen"] = o.FlagTransactionSeen + toSerialize["flagVMResultSigned"] = o.FlagVMResultSigned + toSerialize["flagVMStarted"] = o.FlagVMStarted + toSerialize["timeBatchProposalSent"] = o.TimeBatchProposalSent + toSerialize["timeCompleted"] = o.TimeCompleted + toSerialize["timeConsensusBatchKnown"] = o.TimeConsensusBatchKnown + toSerialize["timeTransactionFinalized"] = o.TimeTransactionFinalized + toSerialize["timeTransactionPosted"] = o.TimeTransactionPosted + toSerialize["timeTransactionSeen"] = o.TimeTransactionSeen + toSerialize["timeVMResultSigned"] = o.TimeVMResultSigned + toSerialize["timeVMStarted"] = o.TimeVMStarted + return toSerialize, nil +} + +type NullableConsensusWorkflowMetrics struct { + value *ConsensusWorkflowMetrics + isSet bool +} + +func (v NullableConsensusWorkflowMetrics) Get() *ConsensusWorkflowMetrics { + return v.value +} + +func (v *NullableConsensusWorkflowMetrics) Set(val *ConsensusWorkflowMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusWorkflowMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusWorkflowMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusWorkflowMetrics(val *ConsensusWorkflowMetrics) *NullableConsensusWorkflowMetrics { + return &NullableConsensusWorkflowMetrics{value: val, isSet: true} +} + +func (v NullableConsensusWorkflowMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusWorkflowMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_contract_call_view_request.go b/clients/apiclient/model_contract_call_view_request.go new file mode 100644 index 0000000000..eae124ebc0 --- /dev/null +++ b/clients/apiclient/model_contract_call_view_request.go @@ -0,0 +1,257 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ContractCallViewRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractCallViewRequest{} + +// ContractCallViewRequest struct for ContractCallViewRequest +type ContractCallViewRequest struct { + Arguments JSONDict `json:"arguments"` + // The chain id + ChainId string `json:"chainId"` + // The contract name as HName (Hex) + ContractHName string `json:"contractHName"` + // The contract name + ContractName string `json:"contractName"` + // The function name as HName (Hex) + FunctionHName string `json:"functionHName"` + // The function name + FunctionName string `json:"functionName"` +} + +// NewContractCallViewRequest instantiates a new ContractCallViewRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContractCallViewRequest(arguments JSONDict, chainId string, contractHName string, contractName string, functionHName string, functionName string) *ContractCallViewRequest { + this := ContractCallViewRequest{} + this.Arguments = arguments + this.ChainId = chainId + this.ContractHName = contractHName + this.ContractName = contractName + this.FunctionHName = functionHName + this.FunctionName = functionName + return &this +} + +// NewContractCallViewRequestWithDefaults instantiates a new ContractCallViewRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContractCallViewRequestWithDefaults() *ContractCallViewRequest { + this := ContractCallViewRequest{} + return &this +} + +// GetArguments returns the Arguments field value +func (o *ContractCallViewRequest) GetArguments() JSONDict { + if o == nil { + var ret JSONDict + return ret + } + + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetArgumentsOk() (*JSONDict, bool) { + if o == nil { + return nil, false + } + return &o.Arguments, true +} + +// SetArguments sets field value +func (o *ContractCallViewRequest) SetArguments(v JSONDict) { + o.Arguments = v +} + +// GetChainId returns the ChainId field value +func (o *ContractCallViewRequest) GetChainId() string { + if o == nil { + var ret string + return ret + } + + return o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetChainIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainId, true +} + +// SetChainId sets field value +func (o *ContractCallViewRequest) SetChainId(v string) { + o.ChainId = v +} + +// GetContractHName returns the ContractHName field value +func (o *ContractCallViewRequest) GetContractHName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractHName +} + +// GetContractHNameOk returns a tuple with the ContractHName field value +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetContractHNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractHName, true +} + +// SetContractHName sets field value +func (o *ContractCallViewRequest) SetContractHName(v string) { + o.ContractHName = v +} + +// GetContractName returns the ContractName field value +func (o *ContractCallViewRequest) GetContractName() string { + if o == nil { + var ret string + return ret + } + + return o.ContractName +} + +// GetContractNameOk returns a tuple with the ContractName field value +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *ContractCallViewRequest) SetContractName(v string) { + o.ContractName = v +} + +// GetFunctionHName returns the FunctionHName field value +func (o *ContractCallViewRequest) GetFunctionHName() string { + if o == nil { + var ret string + return ret + } + + return o.FunctionHName +} + +// GetFunctionHNameOk returns a tuple with the FunctionHName field value +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetFunctionHNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionHName, true +} + +// SetFunctionHName sets field value +func (o *ContractCallViewRequest) SetFunctionHName(v string) { + o.FunctionHName = v +} + +// GetFunctionName returns the FunctionName field value +func (o *ContractCallViewRequest) GetFunctionName() string { + if o == nil { + var ret string + return ret + } + + return o.FunctionName +} + +// GetFunctionNameOk returns a tuple with the FunctionName field value +// and a boolean to check if the value has been set. +func (o *ContractCallViewRequest) GetFunctionNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionName, true +} + +// SetFunctionName sets field value +func (o *ContractCallViewRequest) SetFunctionName(v string) { + o.FunctionName = v +} + +func (o ContractCallViewRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContractCallViewRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["arguments"] = o.Arguments + toSerialize["chainId"] = o.ChainId + toSerialize["contractHName"] = o.ContractHName + toSerialize["contractName"] = o.ContractName + toSerialize["functionHName"] = o.FunctionHName + toSerialize["functionName"] = o.FunctionName + return toSerialize, nil +} + +type NullableContractCallViewRequest struct { + value *ContractCallViewRequest + isSet bool +} + +func (v NullableContractCallViewRequest) Get() *ContractCallViewRequest { + return v.value +} + +func (v *NullableContractCallViewRequest) Set(val *ContractCallViewRequest) { + v.value = val + v.isSet = true +} + +func (v NullableContractCallViewRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableContractCallViewRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContractCallViewRequest(val *ContractCallViewRequest) *NullableContractCallViewRequest { + return &NullableContractCallViewRequest{value: val, isSet: true} +} + +func (v NullableContractCallViewRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContractCallViewRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_contract_info_response.go b/clients/apiclient/model_contract_info_response.go similarity index 55% rename from client/model_contract_info_response.go rename to clients/apiclient/model_contract_info_response.go index 86bf4507b0..e30a9cdd36 100644 --- a/client/model_contract_info_response.go +++ b/clients/apiclient/model_contract_info_response.go @@ -3,35 +3,42 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the ContractInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContractInfoResponse{} + // ContractInfoResponse struct for ContractInfoResponse type ContractInfoResponse struct { // The description of the contract. - Description *string `json:"description,omitempty"` + Description string `json:"description"` // The id (HName as Hex)) of the contract. - HName *string `json:"hName,omitempty"` + HName string `json:"hName"` // The name of the contract. - Name *string `json:"name,omitempty"` + Name string `json:"name"` // The hash of the contract. - ProgramHash []int32 `json:"programHash,omitempty"` + ProgramHash []int32 `json:"programHash"` } // NewContractInfoResponse instantiates a new ContractInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewContractInfoResponse() *ContractInfoResponse { +func NewContractInfoResponse(description string, hName string, name string, programHash []int32) *ContractInfoResponse { this := ContractInfoResponse{} + this.Description = description + this.HName = hName + this.Name = name + this.ProgramHash = programHash return &this } @@ -43,151 +50,119 @@ func NewContractInfoResponseWithDefaults() *ContractInfoResponse { return &this } -// GetDescription returns the Description field value if set, zero value otherwise. +// GetDescription returns the Description field value func (o *ContractInfoResponse) GetDescription() string { - if o == nil || isNil(o.Description) { + if o == nil { var ret string return ret } - return *o.Description + + return o.Description } -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. func (o *ContractInfoResponse) GetDescriptionOk() (*string, bool) { - if o == nil || isNil(o.Description) { - return nil, false + if o == nil { + return nil, false } - return o.Description, true + return &o.Description, true } -// HasDescription returns a boolean if a field has been set. -func (o *ContractInfoResponse) HasDescription() bool { - if o != nil && !isNil(o.Description) { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. +// SetDescription sets field value func (o *ContractInfoResponse) SetDescription(v string) { - o.Description = &v + o.Description = v } -// GetHName returns the HName field value if set, zero value otherwise. +// GetHName returns the HName field value func (o *ContractInfoResponse) GetHName() string { - if o == nil || isNil(o.HName) { + if o == nil { var ret string return ret } - return *o.HName + + return o.HName } -// GetHNameOk returns a tuple with the HName field value if set, nil otherwise +// GetHNameOk returns a tuple with the HName field value // and a boolean to check if the value has been set. func (o *ContractInfoResponse) GetHNameOk() (*string, bool) { - if o == nil || isNil(o.HName) { - return nil, false + if o == nil { + return nil, false } - return o.HName, true + return &o.HName, true } -// HasHName returns a boolean if a field has been set. -func (o *ContractInfoResponse) HasHName() bool { - if o != nil && !isNil(o.HName) { - return true - } - - return false -} - -// SetHName gets a reference to the given string and assigns it to the HName field. +// SetHName sets field value func (o *ContractInfoResponse) SetHName(v string) { - o.HName = &v + o.HName = v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *ContractInfoResponse) GetName() string { - if o == nil || isNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *ContractInfoResponse) GetNameOk() (*string, bool) { - if o == nil || isNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *ContractInfoResponse) HasName() bool { - if o != nil && !isNil(o.Name) { - return true + if o == nil { + return nil, false } - - return false + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *ContractInfoResponse) SetName(v string) { - o.Name = &v + o.Name = v } -// GetProgramHash returns the ProgramHash field value if set, zero value otherwise. +// GetProgramHash returns the ProgramHash field value func (o *ContractInfoResponse) GetProgramHash() []int32 { - if o == nil || isNil(o.ProgramHash) { + if o == nil { var ret []int32 return ret } + return o.ProgramHash } -// GetProgramHashOk returns a tuple with the ProgramHash field value if set, nil otherwise +// GetProgramHashOk returns a tuple with the ProgramHash field value // and a boolean to check if the value has been set. func (o *ContractInfoResponse) GetProgramHashOk() ([]int32, bool) { - if o == nil || isNil(o.ProgramHash) { - return nil, false + if o == nil { + return nil, false } return o.ProgramHash, true } -// HasProgramHash returns a boolean if a field has been set. -func (o *ContractInfoResponse) HasProgramHash() bool { - if o != nil && !isNil(o.ProgramHash) { - return true - } - - return false -} - -// SetProgramHash gets a reference to the given []int32 and assigns it to the ProgramHash field. +// SetProgramHash sets field value func (o *ContractInfoResponse) SetProgramHash(v []int32) { o.ProgramHash = v } func (o ContractInfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Description) { - toSerialize["description"] = o.Description - } - if !isNil(o.HName) { - toSerialize["hName"] = o.HName - } - if !isNil(o.Name) { - toSerialize["name"] = o.Name - } - if !isNil(o.ProgramHash) { - toSerialize["programHash"] = o.ProgramHash + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o ContractInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["hName"] = o.HName + toSerialize["name"] = o.Name + toSerialize["programHash"] = o.ProgramHash + return toSerialize, nil +} + type NullableContractInfoResponse struct { value *ContractInfoResponse isSet bool diff --git a/client/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go similarity index 52% rename from client/model_control_addresses_response.go rename to clients/apiclient/model_control_addresses_response.go index 5996c3c83c..28c5ec4e27 100644 --- a/client/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -3,30 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the ControlAddressesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ControlAddressesResponse{} + // ControlAddressesResponse struct for ControlAddressesResponse type ControlAddressesResponse struct { - GoverningAddress *string `json:"governingAddress,omitempty"` - SinceBlockIndex *int32 `json:"sinceBlockIndex,omitempty"` - StateAddress *string `json:"stateAddress,omitempty"` + GoverningAddress string `json:"governingAddress"` + SinceBlockIndex uint32 `json:"sinceBlockIndex"` + StateAddress string `json:"stateAddress"` } // NewControlAddressesResponse instantiates a new ControlAddressesResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewControlAddressesResponse() *ControlAddressesResponse { +func NewControlAddressesResponse(governingAddress string, sinceBlockIndex uint32, stateAddress string) *ControlAddressesResponse { this := ControlAddressesResponse{} + this.GoverningAddress = governingAddress + this.SinceBlockIndex = sinceBlockIndex + this.StateAddress = stateAddress return &this } @@ -38,116 +44,94 @@ func NewControlAddressesResponseWithDefaults() *ControlAddressesResponse { return &this } -// GetGoverningAddress returns the GoverningAddress field value if set, zero value otherwise. +// GetGoverningAddress returns the GoverningAddress field value func (o *ControlAddressesResponse) GetGoverningAddress() string { - if o == nil || isNil(o.GoverningAddress) { + if o == nil { var ret string return ret } - return *o.GoverningAddress + + return o.GoverningAddress } -// GetGoverningAddressOk returns a tuple with the GoverningAddress field value if set, nil otherwise +// GetGoverningAddressOk returns a tuple with the GoverningAddress field value // and a boolean to check if the value has been set. func (o *ControlAddressesResponse) GetGoverningAddressOk() (*string, bool) { - if o == nil || isNil(o.GoverningAddress) { - return nil, false - } - return o.GoverningAddress, true -} - -// HasGoverningAddress returns a boolean if a field has been set. -func (o *ControlAddressesResponse) HasGoverningAddress() bool { - if o != nil && !isNil(o.GoverningAddress) { - return true + if o == nil { + return nil, false } - - return false + return &o.GoverningAddress, true } -// SetGoverningAddress gets a reference to the given string and assigns it to the GoverningAddress field. +// SetGoverningAddress sets field value func (o *ControlAddressesResponse) SetGoverningAddress(v string) { - o.GoverningAddress = &v + o.GoverningAddress = v } -// GetSinceBlockIndex returns the SinceBlockIndex field value if set, zero value otherwise. -func (o *ControlAddressesResponse) GetSinceBlockIndex() int32 { - if o == nil || isNil(o.SinceBlockIndex) { - var ret int32 +// GetSinceBlockIndex returns the SinceBlockIndex field value +func (o *ControlAddressesResponse) GetSinceBlockIndex() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.SinceBlockIndex -} -// GetSinceBlockIndexOk returns a tuple with the SinceBlockIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ControlAddressesResponse) GetSinceBlockIndexOk() (*int32, bool) { - if o == nil || isNil(o.SinceBlockIndex) { - return nil, false - } - return o.SinceBlockIndex, true + return o.SinceBlockIndex } -// HasSinceBlockIndex returns a boolean if a field has been set. -func (o *ControlAddressesResponse) HasSinceBlockIndex() bool { - if o != nil && !isNil(o.SinceBlockIndex) { - return true +// GetSinceBlockIndexOk returns a tuple with the SinceBlockIndex field value +// and a boolean to check if the value has been set. +func (o *ControlAddressesResponse) GetSinceBlockIndexOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.SinceBlockIndex, true } -// SetSinceBlockIndex gets a reference to the given int32 and assigns it to the SinceBlockIndex field. -func (o *ControlAddressesResponse) SetSinceBlockIndex(v int32) { - o.SinceBlockIndex = &v +// SetSinceBlockIndex sets field value +func (o *ControlAddressesResponse) SetSinceBlockIndex(v uint32) { + o.SinceBlockIndex = v } -// GetStateAddress returns the StateAddress field value if set, zero value otherwise. +// GetStateAddress returns the StateAddress field value func (o *ControlAddressesResponse) GetStateAddress() string { - if o == nil || isNil(o.StateAddress) { + if o == nil { var ret string return ret } - return *o.StateAddress + + return o.StateAddress } -// GetStateAddressOk returns a tuple with the StateAddress field value if set, nil otherwise +// GetStateAddressOk returns a tuple with the StateAddress field value // and a boolean to check if the value has been set. func (o *ControlAddressesResponse) GetStateAddressOk() (*string, bool) { - if o == nil || isNil(o.StateAddress) { - return nil, false - } - return o.StateAddress, true -} - -// HasStateAddress returns a boolean if a field has been set. -func (o *ControlAddressesResponse) HasStateAddress() bool { - if o != nil && !isNil(o.StateAddress) { - return true + if o == nil { + return nil, false } - - return false + return &o.StateAddress, true } -// SetStateAddress gets a reference to the given string and assigns it to the StateAddress field. +// SetStateAddress sets field value func (o *ControlAddressesResponse) SetStateAddress(v string) { - o.StateAddress = &v + o.StateAddress = v } func (o ControlAddressesResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.GoverningAddress) { - toSerialize["governingAddress"] = o.GoverningAddress - } - if !isNil(o.SinceBlockIndex) { - toSerialize["sinceBlockIndex"] = o.SinceBlockIndex - } - if !isNil(o.StateAddress) { - toSerialize["stateAddress"] = o.StateAddress + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o ControlAddressesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["governingAddress"] = o.GoverningAddress + toSerialize["sinceBlockIndex"] = o.SinceBlockIndex + toSerialize["stateAddress"] = o.StateAddress + return toSerialize, nil +} + type NullableControlAddressesResponse struct { value *ControlAddressesResponse isSet bool diff --git a/clients/apiclient/model_dk_shares_info.go b/clients/apiclient/model_dk_shares_info.go new file mode 100644 index 0000000000..2926232f5f --- /dev/null +++ b/clients/apiclient/model_dk_shares_info.go @@ -0,0 +1,256 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the DKSharesInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DKSharesInfo{} + +// DKSharesInfo struct for DKSharesInfo +type DKSharesInfo struct { + // New generated shared address. + Address string `json:"address"` + // Identities of the nodes sharing the key. (Hex) + PeerIdentities []string `json:"peerIdentities"` + PeerIndex uint32 `json:"peerIndex"` + // Used public key. (Hex) + PublicKey string `json:"publicKey"` + // Public key shares for all the peers. (Hex) + PublicKeyShares []string `json:"publicKeyShares"` + Threshold uint32 `json:"threshold"` +} + +// NewDKSharesInfo instantiates a new DKSharesInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDKSharesInfo(address string, peerIdentities []string, peerIndex uint32, publicKey string, publicKeyShares []string, threshold uint32) *DKSharesInfo { + this := DKSharesInfo{} + this.Address = address + this.PeerIdentities = peerIdentities + this.PeerIndex = peerIndex + this.PublicKey = publicKey + this.PublicKeyShares = publicKeyShares + this.Threshold = threshold + return &this +} + +// NewDKSharesInfoWithDefaults instantiates a new DKSharesInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDKSharesInfoWithDefaults() *DKSharesInfo { + this := DKSharesInfo{} + return &this +} + +// GetAddress returns the Address field value +func (o *DKSharesInfo) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *DKSharesInfo) SetAddress(v string) { + o.Address = v +} + +// GetPeerIdentities returns the PeerIdentities field value +func (o *DKSharesInfo) GetPeerIdentities() []string { + if o == nil { + var ret []string + return ret + } + + return o.PeerIdentities +} + +// GetPeerIdentitiesOk returns a tuple with the PeerIdentities field value +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPeerIdentitiesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PeerIdentities, true +} + +// SetPeerIdentities sets field value +func (o *DKSharesInfo) SetPeerIdentities(v []string) { + o.PeerIdentities = v +} + +// GetPeerIndex returns the PeerIndex field value +func (o *DKSharesInfo) GetPeerIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.PeerIndex +} + +// GetPeerIndexOk returns a tuple with the PeerIndex field value +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPeerIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.PeerIndex, true +} + +// SetPeerIndex sets field value +func (o *DKSharesInfo) SetPeerIndex(v uint32) { + o.PeerIndex = v +} + +// GetPublicKey returns the PublicKey field value +func (o *DKSharesInfo) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *DKSharesInfo) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetPublicKeyShares returns the PublicKeyShares field value +func (o *DKSharesInfo) GetPublicKeyShares() []string { + if o == nil { + var ret []string + return ret + } + + return o.PublicKeyShares +} + +// GetPublicKeySharesOk returns a tuple with the PublicKeyShares field value +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetPublicKeySharesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.PublicKeyShares, true +} + +// SetPublicKeyShares sets field value +func (o *DKSharesInfo) SetPublicKeyShares(v []string) { + o.PublicKeyShares = v +} + +// GetThreshold returns the Threshold field value +func (o *DKSharesInfo) GetThreshold() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.Threshold +} + +// GetThresholdOk returns a tuple with the Threshold field value +// and a boolean to check if the value has been set. +func (o *DKSharesInfo) GetThresholdOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.Threshold, true +} + +// SetThreshold sets field value +func (o *DKSharesInfo) SetThreshold(v uint32) { + o.Threshold = v +} + +func (o DKSharesInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DKSharesInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["peerIdentities"] = o.PeerIdentities + toSerialize["peerIndex"] = o.PeerIndex + toSerialize["publicKey"] = o.PublicKey + toSerialize["publicKeyShares"] = o.PublicKeyShares + toSerialize["threshold"] = o.Threshold + return toSerialize, nil +} + +type NullableDKSharesInfo struct { + value *DKSharesInfo + isSet bool +} + +func (v NullableDKSharesInfo) Get() *DKSharesInfo { + return v.value +} + +func (v *NullableDKSharesInfo) Set(val *DKSharesInfo) { + v.value = val + v.isSet = true +} + +func (v NullableDKSharesInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableDKSharesInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDKSharesInfo(val *DKSharesInfo) *NullableDKSharesInfo { + return &NullableDKSharesInfo{value: val, isSet: true} +} + +func (v NullableDKSharesInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDKSharesInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_dk_shares_post_request.go b/clients/apiclient/model_dk_shares_post_request.go similarity index 52% rename from client/model_dk_shares_post_request.go rename to clients/apiclient/model_dk_shares_post_request.go index cdb20efed8..459e91221d 100644 --- a/client/model_dk_shares_post_request.go +++ b/clients/apiclient/model_dk_shares_post_request.go @@ -3,32 +3,38 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the DKSharesPostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DKSharesPostRequest{} + // DKSharesPostRequest struct for DKSharesPostRequest type DKSharesPostRequest struct { - PeerIdentities []string `json:"peerIdentities,omitempty"` + PeerIdentities []string `json:"peerIdentities"` // Should be =< len(PeerPublicIdentities) - Threshold *int32 `json:"threshold,omitempty"` + Threshold uint32 `json:"threshold"` // Timeout in milliseconds. - TimeoutMS *int32 `json:"timeoutMS,omitempty"` + TimeoutMS uint32 `json:"timeoutMS"` } // NewDKSharesPostRequest instantiates a new DKSharesPostRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDKSharesPostRequest() *DKSharesPostRequest { +func NewDKSharesPostRequest(peerIdentities []string, threshold uint32, timeoutMS uint32) *DKSharesPostRequest { this := DKSharesPostRequest{} + this.PeerIdentities = peerIdentities + this.Threshold = threshold + this.TimeoutMS = timeoutMS return &this } @@ -40,116 +46,94 @@ func NewDKSharesPostRequestWithDefaults() *DKSharesPostRequest { return &this } -// GetPeerIdentities returns the PeerIdentities field value if set, zero value otherwise. +// GetPeerIdentities returns the PeerIdentities field value func (o *DKSharesPostRequest) GetPeerIdentities() []string { - if o == nil || isNil(o.PeerIdentities) { + if o == nil { var ret []string return ret } + return o.PeerIdentities } -// GetPeerIdentitiesOk returns a tuple with the PeerIdentities field value if set, nil otherwise +// GetPeerIdentitiesOk returns a tuple with the PeerIdentities field value // and a boolean to check if the value has been set. func (o *DKSharesPostRequest) GetPeerIdentitiesOk() ([]string, bool) { - if o == nil || isNil(o.PeerIdentities) { - return nil, false + if o == nil { + return nil, false } return o.PeerIdentities, true } -// HasPeerIdentities returns a boolean if a field has been set. -func (o *DKSharesPostRequest) HasPeerIdentities() bool { - if o != nil && !isNil(o.PeerIdentities) { - return true - } - - return false -} - -// SetPeerIdentities gets a reference to the given []string and assigns it to the PeerIdentities field. +// SetPeerIdentities sets field value func (o *DKSharesPostRequest) SetPeerIdentities(v []string) { o.PeerIdentities = v } -// GetThreshold returns the Threshold field value if set, zero value otherwise. -func (o *DKSharesPostRequest) GetThreshold() int32 { - if o == nil || isNil(o.Threshold) { - var ret int32 +// GetThreshold returns the Threshold field value +func (o *DKSharesPostRequest) GetThreshold() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Threshold -} -// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesPostRequest) GetThresholdOk() (*int32, bool) { - if o == nil || isNil(o.Threshold) { - return nil, false - } - return o.Threshold, true + return o.Threshold } -// HasThreshold returns a boolean if a field has been set. -func (o *DKSharesPostRequest) HasThreshold() bool { - if o != nil && !isNil(o.Threshold) { - return true +// GetThresholdOk returns a tuple with the Threshold field value +// and a boolean to check if the value has been set. +func (o *DKSharesPostRequest) GetThresholdOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Threshold, true } -// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. -func (o *DKSharesPostRequest) SetThreshold(v int32) { - o.Threshold = &v +// SetThreshold sets field value +func (o *DKSharesPostRequest) SetThreshold(v uint32) { + o.Threshold = v } -// GetTimeoutMS returns the TimeoutMS field value if set, zero value otherwise. -func (o *DKSharesPostRequest) GetTimeoutMS() int32 { - if o == nil || isNil(o.TimeoutMS) { - var ret int32 +// GetTimeoutMS returns the TimeoutMS field value +func (o *DKSharesPostRequest) GetTimeoutMS() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.TimeoutMS -} -// GetTimeoutMSOk returns a tuple with the TimeoutMS field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DKSharesPostRequest) GetTimeoutMSOk() (*int32, bool) { - if o == nil || isNil(o.TimeoutMS) { - return nil, false - } - return o.TimeoutMS, true + return o.TimeoutMS } -// HasTimeoutMS returns a boolean if a field has been set. -func (o *DKSharesPostRequest) HasTimeoutMS() bool { - if o != nil && !isNil(o.TimeoutMS) { - return true +// GetTimeoutMSOk returns a tuple with the TimeoutMS field value +// and a boolean to check if the value has been set. +func (o *DKSharesPostRequest) GetTimeoutMSOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.TimeoutMS, true } -// SetTimeoutMS gets a reference to the given int32 and assigns it to the TimeoutMS field. -func (o *DKSharesPostRequest) SetTimeoutMS(v int32) { - o.TimeoutMS = &v +// SetTimeoutMS sets field value +func (o *DKSharesPostRequest) SetTimeoutMS(v uint32) { + o.TimeoutMS = v } func (o DKSharesPostRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.PeerIdentities) { - toSerialize["peerIdentities"] = o.PeerIdentities - } - if !isNil(o.Threshold) { - toSerialize["threshold"] = o.Threshold - } - if !isNil(o.TimeoutMS) { - toSerialize["timeoutMS"] = o.TimeoutMS + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o DKSharesPostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["peerIdentities"] = o.PeerIdentities + toSerialize["threshold"] = o.Threshold + toSerialize["timeoutMS"] = o.TimeoutMS + return toSerialize, nil +} + type NullableDKSharesPostRequest struct { value *DKSharesPostRequest isSet bool diff --git a/client/model_error_message_format_response.go b/clients/apiclient/model_error_message_format_response.go similarity index 74% rename from client/model_error_message_format_response.go rename to clients/apiclient/model_error_message_format_response.go index 7b401f691a..709188c93b 100644 --- a/client/model_error_message_format_response.go +++ b/clients/apiclient/model_error_message_format_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the ErrorMessageFormatResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorMessageFormatResponse{} + // ErrorMessageFormatResponse struct for ErrorMessageFormatResponse type ErrorMessageFormatResponse struct { - MessageFormat *string `json:"MessageFormat,omitempty"` + MessageFormat string `json:"messageFormat"` } // NewErrorMessageFormatResponse instantiates a new ErrorMessageFormatResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewErrorMessageFormatResponse() *ErrorMessageFormatResponse { +func NewErrorMessageFormatResponse(messageFormat string) *ErrorMessageFormatResponse { this := ErrorMessageFormatResponse{} + this.MessageFormat = messageFormat return &this } @@ -36,46 +40,44 @@ func NewErrorMessageFormatResponseWithDefaults() *ErrorMessageFormatResponse { return &this } -// GetMessageFormat returns the MessageFormat field value if set, zero value otherwise. +// GetMessageFormat returns the MessageFormat field value func (o *ErrorMessageFormatResponse) GetMessageFormat() string { - if o == nil || isNil(o.MessageFormat) { + if o == nil { var ret string return ret } - return *o.MessageFormat + + return o.MessageFormat } -// GetMessageFormatOk returns a tuple with the MessageFormat field value if set, nil otherwise +// GetMessageFormatOk returns a tuple with the MessageFormat field value // and a boolean to check if the value has been set. func (o *ErrorMessageFormatResponse) GetMessageFormatOk() (*string, bool) { - if o == nil || isNil(o.MessageFormat) { - return nil, false - } - return o.MessageFormat, true -} - -// HasMessageFormat returns a boolean if a field has been set. -func (o *ErrorMessageFormatResponse) HasMessageFormat() bool { - if o != nil && !isNil(o.MessageFormat) { - return true + if o == nil { + return nil, false } - - return false + return &o.MessageFormat, true } -// SetMessageFormat gets a reference to the given string and assigns it to the MessageFormat field. +// SetMessageFormat sets field value func (o *ErrorMessageFormatResponse) SetMessageFormat(v string) { - o.MessageFormat = &v + o.MessageFormat = v } func (o ErrorMessageFormatResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.MessageFormat) { - toSerialize["MessageFormat"] = o.MessageFormat + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o ErrorMessageFormatResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messageFormat"] = o.MessageFormat + return toSerialize, nil +} + type NullableErrorMessageFormatResponse struct { value *ErrorMessageFormatResponse isSet bool diff --git a/client/model_events_response.go b/clients/apiclient/model_events_response.go similarity index 74% rename from client/model_events_response.go rename to clients/apiclient/model_events_response.go index dc35d6ed19..133b5e7128 100644 --- a/client/model_events_response.go +++ b/clients/apiclient/model_events_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the EventsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventsResponse{} + // EventsResponse struct for EventsResponse type EventsResponse struct { - Events []string `json:"events,omitempty"` + Events []string `json:"events"` } // NewEventsResponse instantiates a new EventsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewEventsResponse() *EventsResponse { +func NewEventsResponse(events []string) *EventsResponse { this := EventsResponse{} + this.Events = events return &this } @@ -36,46 +40,44 @@ func NewEventsResponseWithDefaults() *EventsResponse { return &this } -// GetEvents returns the Events field value if set, zero value otherwise. +// GetEvents returns the Events field value func (o *EventsResponse) GetEvents() []string { - if o == nil || isNil(o.Events) { + if o == nil { var ret []string return ret } + return o.Events } -// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// GetEventsOk returns a tuple with the Events field value // and a boolean to check if the value has been set. func (o *EventsResponse) GetEventsOk() ([]string, bool) { - if o == nil || isNil(o.Events) { - return nil, false + if o == nil { + return nil, false } return o.Events, true } -// HasEvents returns a boolean if a field has been set. -func (o *EventsResponse) HasEvents() bool { - if o != nil && !isNil(o.Events) { - return true - } - - return false -} - -// SetEvents gets a reference to the given []string and assigns it to the Events field. +// SetEvents sets field value func (o *EventsResponse) SetEvents(v []string) { o.Events = v } func (o EventsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Events) { - toSerialize["events"] = o.Events + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o EventsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["events"] = o.Events + return toSerialize, nil +} + type NullableEventsResponse struct { value *EventsResponse isSet bool diff --git a/client/model_foundry_output_response.go b/clients/apiclient/model_foundry_output_response.go similarity index 64% rename from client/model_foundry_output_response.go rename to clients/apiclient/model_foundry_output_response.go index 76ae082692..c6d288f6c4 100644 --- a/client/model_foundry_output_response.go +++ b/clients/apiclient/model_foundry_output_response.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the FoundryOutputResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FoundryOutputResponse{} + // FoundryOutputResponse struct for FoundryOutputResponse type FoundryOutputResponse struct { - Assets *AssetsResponse `json:"assets,omitempty"` - FoundryId *string `json:"foundryId,omitempty"` + Assets AssetsResponse `json:"assets"` + FoundryId string `json:"foundryId"` } // NewFoundryOutputResponse instantiates a new FoundryOutputResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFoundryOutputResponse() *FoundryOutputResponse { +func NewFoundryOutputResponse(assets AssetsResponse, foundryId string) *FoundryOutputResponse { this := FoundryOutputResponse{} + this.Assets = assets + this.FoundryId = foundryId return &this } @@ -37,81 +42,69 @@ func NewFoundryOutputResponseWithDefaults() *FoundryOutputResponse { return &this } -// GetAssets returns the Assets field value if set, zero value otherwise. +// GetAssets returns the Assets field value func (o *FoundryOutputResponse) GetAssets() AssetsResponse { - if o == nil || isNil(o.Assets) { + if o == nil { var ret AssetsResponse return ret } - return *o.Assets + + return o.Assets } -// GetAssetsOk returns a tuple with the Assets field value if set, nil otherwise +// GetAssetsOk returns a tuple with the Assets field value // and a boolean to check if the value has been set. func (o *FoundryOutputResponse) GetAssetsOk() (*AssetsResponse, bool) { - if o == nil || isNil(o.Assets) { - return nil, false - } - return o.Assets, true -} - -// HasAssets returns a boolean if a field has been set. -func (o *FoundryOutputResponse) HasAssets() bool { - if o != nil && !isNil(o.Assets) { - return true + if o == nil { + return nil, false } - - return false + return &o.Assets, true } -// SetAssets gets a reference to the given AssetsResponse and assigns it to the Assets field. +// SetAssets sets field value func (o *FoundryOutputResponse) SetAssets(v AssetsResponse) { - o.Assets = &v + o.Assets = v } -// GetFoundryId returns the FoundryId field value if set, zero value otherwise. +// GetFoundryId returns the FoundryId field value func (o *FoundryOutputResponse) GetFoundryId() string { - if o == nil || isNil(o.FoundryId) { + if o == nil { var ret string return ret } - return *o.FoundryId + + return o.FoundryId } -// GetFoundryIdOk returns a tuple with the FoundryId field value if set, nil otherwise +// GetFoundryIdOk returns a tuple with the FoundryId field value // and a boolean to check if the value has been set. func (o *FoundryOutputResponse) GetFoundryIdOk() (*string, bool) { - if o == nil || isNil(o.FoundryId) { - return nil, false - } - return o.FoundryId, true -} - -// HasFoundryId returns a boolean if a field has been set. -func (o *FoundryOutputResponse) HasFoundryId() bool { - if o != nil && !isNil(o.FoundryId) { - return true + if o == nil { + return nil, false } - - return false + return &o.FoundryId, true } -// SetFoundryId gets a reference to the given string and assigns it to the FoundryId field. +// SetFoundryId sets field value func (o *FoundryOutputResponse) SetFoundryId(v string) { - o.FoundryId = &v + o.FoundryId = v } func (o FoundryOutputResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Assets) { - toSerialize["assets"] = o.Assets - } - if !isNil(o.FoundryId) { - toSerialize["foundryId"] = o.FoundryId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o FoundryOutputResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["assets"] = o.Assets + toSerialize["foundryId"] = o.FoundryId + return toSerialize, nil +} + type NullableFoundryOutputResponse struct { value *FoundryOutputResponse isSet bool diff --git a/client/model_fungible_tokens.go b/clients/apiclient/model_fungible_tokens.go similarity index 64% rename from client/model_fungible_tokens.go rename to clients/apiclient/model_fungible_tokens.go index 65c2907a08..6781eacdd8 100644 --- a/client/model_fungible_tokens.go +++ b/clients/apiclient/model_fungible_tokens.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the FungibleTokens type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FungibleTokens{} + // FungibleTokens struct for FungibleTokens type FungibleTokens struct { - BaseTokens *int64 `json:"baseTokens,omitempty"` - NativeTokens []NativeToken `json:"nativeTokens,omitempty"` + BaseTokens int64 `json:"baseTokens"` + NativeTokens []NativeToken `json:"nativeTokens"` } // NewFungibleTokens instantiates a new FungibleTokens object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFungibleTokens() *FungibleTokens { +func NewFungibleTokens(baseTokens int64, nativeTokens []NativeToken) *FungibleTokens { this := FungibleTokens{} + this.BaseTokens = baseTokens + this.NativeTokens = nativeTokens return &this } @@ -37,81 +42,69 @@ func NewFungibleTokensWithDefaults() *FungibleTokens { return &this } -// GetBaseTokens returns the BaseTokens field value if set, zero value otherwise. +// GetBaseTokens returns the BaseTokens field value func (o *FungibleTokens) GetBaseTokens() int64 { - if o == nil || isNil(o.BaseTokens) { + if o == nil { var ret int64 return ret } - return *o.BaseTokens + + return o.BaseTokens } -// GetBaseTokensOk returns a tuple with the BaseTokens field value if set, nil otherwise +// GetBaseTokensOk returns a tuple with the BaseTokens field value // and a boolean to check if the value has been set. func (o *FungibleTokens) GetBaseTokensOk() (*int64, bool) { - if o == nil || isNil(o.BaseTokens) { - return nil, false - } - return o.BaseTokens, true -} - -// HasBaseTokens returns a boolean if a field has been set. -func (o *FungibleTokens) HasBaseTokens() bool { - if o != nil && !isNil(o.BaseTokens) { - return true + if o == nil { + return nil, false } - - return false + return &o.BaseTokens, true } -// SetBaseTokens gets a reference to the given int64 and assigns it to the BaseTokens field. +// SetBaseTokens sets field value func (o *FungibleTokens) SetBaseTokens(v int64) { - o.BaseTokens = &v + o.BaseTokens = v } -// GetNativeTokens returns the NativeTokens field value if set, zero value otherwise. +// GetNativeTokens returns the NativeTokens field value func (o *FungibleTokens) GetNativeTokens() []NativeToken { - if o == nil || isNil(o.NativeTokens) { + if o == nil { var ret []NativeToken return ret } + return o.NativeTokens } -// GetNativeTokensOk returns a tuple with the NativeTokens field value if set, nil otherwise +// GetNativeTokensOk returns a tuple with the NativeTokens field value // and a boolean to check if the value has been set. func (o *FungibleTokens) GetNativeTokensOk() ([]NativeToken, bool) { - if o == nil || isNil(o.NativeTokens) { - return nil, false + if o == nil { + return nil, false } return o.NativeTokens, true } -// HasNativeTokens returns a boolean if a field has been set. -func (o *FungibleTokens) HasNativeTokens() bool { - if o != nil && !isNil(o.NativeTokens) { - return true - } - - return false -} - -// SetNativeTokens gets a reference to the given []NativeToken and assigns it to the NativeTokens field. +// SetNativeTokens sets field value func (o *FungibleTokens) SetNativeTokens(v []NativeToken) { o.NativeTokens = v } func (o FungibleTokens) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.BaseTokens) { - toSerialize["baseTokens"] = o.BaseTokens - } - if !isNil(o.NativeTokens) { - toSerialize["nativeTokens"] = o.NativeTokens + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o FungibleTokens) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["baseTokens"] = o.BaseTokens + toSerialize["nativeTokens"] = o.NativeTokens + return toSerialize, nil +} + type NullableFungibleTokens struct { value *FungibleTokens isSet bool diff --git a/client/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go similarity index 56% rename from client/model_gas_fee_policy.go rename to clients/apiclient/model_gas_fee_policy.go index 86edf9ffb5..f5d8a6c273 100644 --- a/client/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -3,33 +3,39 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the GasFeePolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GasFeePolicy{} + // GasFeePolicy struct for GasFeePolicy type GasFeePolicy struct { // The gas fee token id. Empty if base token. - GasFeeTokenId *string `json:"gasFeeTokenId,omitempty"` + GasFeeTokenId string `json:"gasFeeTokenId"` // The amount of gas per token. - GasPerToken *int64 `json:"gasPerToken,omitempty"` + GasPerToken int64 `json:"gasPerToken"` // The validator fee share. - ValidatorFeeShare *int32 `json:"validatorFeeShare,omitempty"` + ValidatorFeeShare int32 `json:"validatorFeeShare"` } // NewGasFeePolicy instantiates a new GasFeePolicy object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGasFeePolicy() *GasFeePolicy { +func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32) *GasFeePolicy { this := GasFeePolicy{} + this.GasFeeTokenId = gasFeeTokenId + this.GasPerToken = gasPerToken + this.ValidatorFeeShare = validatorFeeShare return &this } @@ -41,116 +47,94 @@ func NewGasFeePolicyWithDefaults() *GasFeePolicy { return &this } -// GetGasFeeTokenId returns the GasFeeTokenId field value if set, zero value otherwise. +// GetGasFeeTokenId returns the GasFeeTokenId field value func (o *GasFeePolicy) GetGasFeeTokenId() string { - if o == nil || isNil(o.GasFeeTokenId) { + if o == nil { var ret string return ret } - return *o.GasFeeTokenId + + return o.GasFeeTokenId } -// GetGasFeeTokenIdOk returns a tuple with the GasFeeTokenId field value if set, nil otherwise +// GetGasFeeTokenIdOk returns a tuple with the GasFeeTokenId field value // and a boolean to check if the value has been set. func (o *GasFeePolicy) GetGasFeeTokenIdOk() (*string, bool) { - if o == nil || isNil(o.GasFeeTokenId) { - return nil, false - } - return o.GasFeeTokenId, true -} - -// HasGasFeeTokenId returns a boolean if a field has been set. -func (o *GasFeePolicy) HasGasFeeTokenId() bool { - if o != nil && !isNil(o.GasFeeTokenId) { - return true + if o == nil { + return nil, false } - - return false + return &o.GasFeeTokenId, true } -// SetGasFeeTokenId gets a reference to the given string and assigns it to the GasFeeTokenId field. +// SetGasFeeTokenId sets field value func (o *GasFeePolicy) SetGasFeeTokenId(v string) { - o.GasFeeTokenId = &v + o.GasFeeTokenId = v } -// GetGasPerToken returns the GasPerToken field value if set, zero value otherwise. +// GetGasPerToken returns the GasPerToken field value func (o *GasFeePolicy) GetGasPerToken() int64 { - if o == nil || isNil(o.GasPerToken) { + if o == nil { var ret int64 return ret } - return *o.GasPerToken + + return o.GasPerToken } -// GetGasPerTokenOk returns a tuple with the GasPerToken field value if set, nil otherwise +// GetGasPerTokenOk returns a tuple with the GasPerToken field value // and a boolean to check if the value has been set. func (o *GasFeePolicy) GetGasPerTokenOk() (*int64, bool) { - if o == nil || isNil(o.GasPerToken) { - return nil, false + if o == nil { + return nil, false } - return o.GasPerToken, true -} - -// HasGasPerToken returns a boolean if a field has been set. -func (o *GasFeePolicy) HasGasPerToken() bool { - if o != nil && !isNil(o.GasPerToken) { - return true - } - - return false + return &o.GasPerToken, true } -// SetGasPerToken gets a reference to the given int64 and assigns it to the GasPerToken field. +// SetGasPerToken sets field value func (o *GasFeePolicy) SetGasPerToken(v int64) { - o.GasPerToken = &v + o.GasPerToken = v } -// GetValidatorFeeShare returns the ValidatorFeeShare field value if set, zero value otherwise. +// GetValidatorFeeShare returns the ValidatorFeeShare field value func (o *GasFeePolicy) GetValidatorFeeShare() int32 { - if o == nil || isNil(o.ValidatorFeeShare) { + if o == nil { var ret int32 return ret } - return *o.ValidatorFeeShare + + return o.ValidatorFeeShare } -// GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field value if set, nil otherwise +// GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field value // and a boolean to check if the value has been set. func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool) { - if o == nil || isNil(o.ValidatorFeeShare) { - return nil, false - } - return o.ValidatorFeeShare, true -} - -// HasValidatorFeeShare returns a boolean if a field has been set. -func (o *GasFeePolicy) HasValidatorFeeShare() bool { - if o != nil && !isNil(o.ValidatorFeeShare) { - return true + if o == nil { + return nil, false } - - return false + return &o.ValidatorFeeShare, true } -// SetValidatorFeeShare gets a reference to the given int32 and assigns it to the ValidatorFeeShare field. +// SetValidatorFeeShare sets field value func (o *GasFeePolicy) SetValidatorFeeShare(v int32) { - o.ValidatorFeeShare = &v + o.ValidatorFeeShare = v } func (o GasFeePolicy) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.GasFeeTokenId) { - toSerialize["gasFeeTokenId"] = o.GasFeeTokenId - } - if !isNil(o.GasPerToken) { - toSerialize["gasPerToken"] = o.GasPerToken - } - if !isNil(o.ValidatorFeeShare) { - toSerialize["validatorFeeShare"] = o.ValidatorFeeShare + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o GasFeePolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["gasFeeTokenId"] = o.GasFeeTokenId + toSerialize["gasPerToken"] = o.GasPerToken + toSerialize["validatorFeeShare"] = o.ValidatorFeeShare + return toSerialize, nil +} + type NullableGasFeePolicy struct { value *GasFeePolicy isSet bool diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go new file mode 100644 index 0000000000..82bed4ad9a --- /dev/null +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -0,0 +1,285 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the GovChainInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GovChainInfoResponse{} + +// GovChainInfoResponse struct for GovChainInfoResponse +type GovChainInfoResponse struct { + // ChainID (Bech32-encoded). + ChainID string `json:"chainID"` + // The chain owner address (Bech32-encoded). + ChainOwnerId string `json:"chainOwnerId"` + // The description of the chain. + Description string `json:"description"` + GasFeePolicy GasFeePolicy `json:"gasFeePolicy"` + // The maximum contract blob size. + MaxBlobSize int32 `json:"maxBlobSize"` + // The maximum event size. + MaxEventSize int32 `json:"maxEventSize"` + // The maximum amount of events per request. + MaxEventsPerReq int32 `json:"maxEventsPerReq"` +} + +// NewGovChainInfoResponse instantiates a new GovChainInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize int32, maxEventSize int32, maxEventsPerReq int32) *GovChainInfoResponse { + this := GovChainInfoResponse{} + this.ChainID = chainID + this.ChainOwnerId = chainOwnerId + this.Description = description + this.GasFeePolicy = gasFeePolicy + this.MaxBlobSize = maxBlobSize + this.MaxEventSize = maxEventSize + this.MaxEventsPerReq = maxEventsPerReq + return &this +} + +// NewGovChainInfoResponseWithDefaults instantiates a new GovChainInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGovChainInfoResponseWithDefaults() *GovChainInfoResponse { + this := GovChainInfoResponse{} + return &this +} + +// GetChainID returns the ChainID field value +func (o *GovChainInfoResponse) GetChainID() string { + if o == nil { + var ret string + return ret + } + + return o.ChainID +} + +// GetChainIDOk returns a tuple with the ChainID field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetChainIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainID, true +} + +// SetChainID sets field value +func (o *GovChainInfoResponse) SetChainID(v string) { + o.ChainID = v +} + +// GetChainOwnerId returns the ChainOwnerId field value +func (o *GovChainInfoResponse) GetChainOwnerId() string { + if o == nil { + var ret string + return ret + } + + return o.ChainOwnerId +} + +// GetChainOwnerIdOk returns a tuple with the ChainOwnerId field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetChainOwnerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChainOwnerId, true +} + +// SetChainOwnerId sets field value +func (o *GovChainInfoResponse) SetChainOwnerId(v string) { + o.ChainOwnerId = v +} + +// GetDescription returns the Description field value +func (o *GovChainInfoResponse) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *GovChainInfoResponse) SetDescription(v string) { + o.Description = v +} + +// GetGasFeePolicy returns the GasFeePolicy field value +func (o *GovChainInfoResponse) GetGasFeePolicy() GasFeePolicy { + if o == nil { + var ret GasFeePolicy + return ret + } + + return o.GasFeePolicy +} + +// GetGasFeePolicyOk returns a tuple with the GasFeePolicy field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetGasFeePolicyOk() (*GasFeePolicy, bool) { + if o == nil { + return nil, false + } + return &o.GasFeePolicy, true +} + +// SetGasFeePolicy sets field value +func (o *GovChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { + o.GasFeePolicy = v +} + +// GetMaxBlobSize returns the MaxBlobSize field value +func (o *GovChainInfoResponse) GetMaxBlobSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxBlobSize +} + +// GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxBlobSize, true +} + +// SetMaxBlobSize sets field value +func (o *GovChainInfoResponse) SetMaxBlobSize(v int32) { + o.MaxBlobSize = v +} + +// GetMaxEventSize returns the MaxEventSize field value +func (o *GovChainInfoResponse) GetMaxEventSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxEventSize +} + +// GetMaxEventSizeOk returns a tuple with the MaxEventSize field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxEventSize, true +} + +// SetMaxEventSize sets field value +func (o *GovChainInfoResponse) SetMaxEventSize(v int32) { + o.MaxEventSize = v +} + +// GetMaxEventsPerReq returns the MaxEventsPerReq field value +func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MaxEventsPerReq +} + +// GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value +// and a boolean to check if the value has been set. +func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MaxEventsPerReq, true +} + +// SetMaxEventsPerReq sets field value +func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32) { + o.MaxEventsPerReq = v +} + +func (o GovChainInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GovChainInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["chainID"] = o.ChainID + toSerialize["chainOwnerId"] = o.ChainOwnerId + toSerialize["description"] = o.Description + toSerialize["gasFeePolicy"] = o.GasFeePolicy + toSerialize["maxBlobSize"] = o.MaxBlobSize + toSerialize["maxEventSize"] = o.MaxEventSize + toSerialize["maxEventsPerReq"] = o.MaxEventsPerReq + return toSerialize, nil +} + +type NullableGovChainInfoResponse struct { + value *GovChainInfoResponse + isSet bool +} + +func (v NullableGovChainInfoResponse) Get() *GovChainInfoResponse { + return v.value +} + +func (v *NullableGovChainInfoResponse) Set(val *GovChainInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGovChainInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGovChainInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGovChainInfoResponse(val *GovChainInfoResponse) *NullableGovChainInfoResponse { + return &NullableGovChainInfoResponse{value: val, isSet: true} +} + +func (v NullableGovChainInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGovChainInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_in_output.go b/clients/apiclient/model_in_output.go similarity index 59% rename from client/model_in_output.go rename to clients/apiclient/model_in_output.go index 24d8e97bd7..617a56210d 100644 --- a/client/model_in_output.go +++ b/clients/apiclient/model_in_output.go @@ -3,30 +3,35 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the InOutput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InOutput{} + // InOutput struct for InOutput type InOutput struct { - Output *Output `json:"output,omitempty"` + Output Output `json:"output"` // The output ID - OutputId *string `json:"outputId,omitempty"` + OutputId string `json:"outputId"` } // NewInOutput instantiates a new InOutput object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInOutput() *InOutput { +func NewInOutput(output Output, outputId string) *InOutput { this := InOutput{} + this.Output = output + this.OutputId = outputId return &this } @@ -38,81 +43,69 @@ func NewInOutputWithDefaults() *InOutput { return &this } -// GetOutput returns the Output field value if set, zero value otherwise. +// GetOutput returns the Output field value func (o *InOutput) GetOutput() Output { - if o == nil || isNil(o.Output) { + if o == nil { var ret Output return ret } - return *o.Output + + return o.Output } -// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// GetOutputOk returns a tuple with the Output field value // and a boolean to check if the value has been set. func (o *InOutput) GetOutputOk() (*Output, bool) { - if o == nil || isNil(o.Output) { - return nil, false - } - return o.Output, true -} - -// HasOutput returns a boolean if a field has been set. -func (o *InOutput) HasOutput() bool { - if o != nil && !isNil(o.Output) { - return true + if o == nil { + return nil, false } - - return false + return &o.Output, true } -// SetOutput gets a reference to the given Output and assigns it to the Output field. +// SetOutput sets field value func (o *InOutput) SetOutput(v Output) { - o.Output = &v + o.Output = v } -// GetOutputId returns the OutputId field value if set, zero value otherwise. +// GetOutputId returns the OutputId field value func (o *InOutput) GetOutputId() string { - if o == nil || isNil(o.OutputId) { + if o == nil { var ret string return ret } - return *o.OutputId + + return o.OutputId } -// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// GetOutputIdOk returns a tuple with the OutputId field value // and a boolean to check if the value has been set. func (o *InOutput) GetOutputIdOk() (*string, bool) { - if o == nil || isNil(o.OutputId) { - return nil, false - } - return o.OutputId, true -} - -// HasOutputId returns a boolean if a field has been set. -func (o *InOutput) HasOutputId() bool { - if o != nil && !isNil(o.OutputId) { - return true + if o == nil { + return nil, false } - - return false + return &o.OutputId, true } -// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +// SetOutputId sets field value func (o *InOutput) SetOutputId(v string) { - o.OutputId = &v + o.OutputId = v } func (o InOutput) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Output) { - toSerialize["output"] = o.Output - } - if !isNil(o.OutputId) { - toSerialize["outputId"] = o.OutputId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o InOutput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["output"] = o.Output + toSerialize["outputId"] = o.OutputId + return toSerialize, nil +} + type NullableInOutput struct { value *InOutput isSet bool diff --git a/client/model_in_output_metric_item.go b/clients/apiclient/model_in_output_metric_item.go similarity index 53% rename from client/model_in_output_metric_item.go rename to clients/apiclient/model_in_output_metric_item.go index ce44810f8b..d8b4d8cb38 100644 --- a/client/model_in_output_metric_item.go +++ b/clients/apiclient/model_in_output_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the InOutputMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InOutputMetricItem{} + // InOutputMetricItem struct for InOutputMetricItem type InOutputMetricItem struct { - LastMessage *InOutput `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage InOutput `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewInOutputMetricItem instantiates a new InOutputMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInOutputMetricItem() *InOutputMetricItem { +func NewInOutputMetricItem(lastMessage InOutput, messages uint32, timestamp time.Time) *InOutputMetricItem { this := InOutputMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewInOutputMetricItemWithDefaults() *InOutputMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *InOutputMetricItem) GetLastMessage() InOutput { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret InOutput return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *InOutputMetricItem) GetLastMessageOk() (*InOutput, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *InOutputMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given InOutput and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *InOutputMetricItem) SetLastMessage(v InOutput) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *InOutputMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *InOutputMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InOutputMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *InOutputMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *InOutputMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *InOutputMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *InOutputMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *InOutputMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *InOutputMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *InOutputMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *InOutputMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o InOutputMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o InOutputMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableInOutputMetricItem struct { value *InOutputMetricItem isSet bool diff --git a/client/model_in_state_output.go b/clients/apiclient/model_in_state_output.go similarity index 61% rename from client/model_in_state_output.go rename to clients/apiclient/model_in_state_output.go index 100be4fb99..066abae4e2 100644 --- a/client/model_in_state_output.go +++ b/clients/apiclient/model_in_state_output.go @@ -3,30 +3,35 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the InStateOutput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InStateOutput{} + // InStateOutput struct for InStateOutput type InStateOutput struct { - Output *Output `json:"output,omitempty"` + Output Output `json:"output"` // The output ID - OutputId *string `json:"outputId,omitempty"` + OutputId string `json:"outputId"` } // NewInStateOutput instantiates a new InStateOutput object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInStateOutput() *InStateOutput { +func NewInStateOutput(output Output, outputId string) *InStateOutput { this := InStateOutput{} + this.Output = output + this.OutputId = outputId return &this } @@ -38,81 +43,69 @@ func NewInStateOutputWithDefaults() *InStateOutput { return &this } -// GetOutput returns the Output field value if set, zero value otherwise. +// GetOutput returns the Output field value func (o *InStateOutput) GetOutput() Output { - if o == nil || isNil(o.Output) { + if o == nil { var ret Output return ret } - return *o.Output + + return o.Output } -// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// GetOutputOk returns a tuple with the Output field value // and a boolean to check if the value has been set. func (o *InStateOutput) GetOutputOk() (*Output, bool) { - if o == nil || isNil(o.Output) { - return nil, false - } - return o.Output, true -} - -// HasOutput returns a boolean if a field has been set. -func (o *InStateOutput) HasOutput() bool { - if o != nil && !isNil(o.Output) { - return true + if o == nil { + return nil, false } - - return false + return &o.Output, true } -// SetOutput gets a reference to the given Output and assigns it to the Output field. +// SetOutput sets field value func (o *InStateOutput) SetOutput(v Output) { - o.Output = &v + o.Output = v } -// GetOutputId returns the OutputId field value if set, zero value otherwise. +// GetOutputId returns the OutputId field value func (o *InStateOutput) GetOutputId() string { - if o == nil || isNil(o.OutputId) { + if o == nil { var ret string return ret } - return *o.OutputId + + return o.OutputId } -// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// GetOutputIdOk returns a tuple with the OutputId field value // and a boolean to check if the value has been set. func (o *InStateOutput) GetOutputIdOk() (*string, bool) { - if o == nil || isNil(o.OutputId) { - return nil, false - } - return o.OutputId, true -} - -// HasOutputId returns a boolean if a field has been set. -func (o *InStateOutput) HasOutputId() bool { - if o != nil && !isNil(o.OutputId) { - return true + if o == nil { + return nil, false } - - return false + return &o.OutputId, true } -// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +// SetOutputId sets field value func (o *InStateOutput) SetOutputId(v string) { - o.OutputId = &v + o.OutputId = v } func (o InStateOutput) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Output) { - toSerialize["output"] = o.Output - } - if !isNil(o.OutputId) { - toSerialize["outputId"] = o.OutputId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o InStateOutput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["output"] = o.Output + toSerialize["outputId"] = o.OutputId + return toSerialize, nil +} + type NullableInStateOutput struct { value *InStateOutput isSet bool diff --git a/client/model_in_state_output_metric_item.go b/clients/apiclient/model_in_state_output_metric_item.go similarity index 54% rename from client/model_in_state_output_metric_item.go rename to clients/apiclient/model_in_state_output_metric_item.go index a0a46c4aa5..bb40774358 100644 --- a/client/model_in_state_output_metric_item.go +++ b/clients/apiclient/model_in_state_output_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the InStateOutputMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InStateOutputMetricItem{} + // InStateOutputMetricItem struct for InStateOutputMetricItem type InStateOutputMetricItem struct { - LastMessage *InStateOutput `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage InStateOutput `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewInStateOutputMetricItem instantiates a new InStateOutputMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInStateOutputMetricItem() *InStateOutputMetricItem { +func NewInStateOutputMetricItem(lastMessage InStateOutput, messages uint32, timestamp time.Time) *InStateOutputMetricItem { this := InStateOutputMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewInStateOutputMetricItemWithDefaults() *InStateOutputMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *InStateOutputMetricItem) GetLastMessage() InStateOutput { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret InStateOutput return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *InStateOutputMetricItem) GetLastMessageOk() (*InStateOutput, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *InStateOutputMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given InStateOutput and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *InStateOutputMetricItem) SetLastMessage(v InStateOutput) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *InStateOutputMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *InStateOutputMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InStateOutputMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *InStateOutputMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *InStateOutputMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *InStateOutputMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *InStateOutputMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *InStateOutputMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *InStateOutputMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *InStateOutputMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *InStateOutputMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o InStateOutputMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o InStateOutputMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableInStateOutputMetricItem struct { value *InStateOutputMetricItem isSet bool diff --git a/client/model_info_response.go b/clients/apiclient/model_info_response.go similarity index 51% rename from client/model_info_response.go rename to clients/apiclient/model_info_response.go index 222b04e4cd..70ce120dd8 100644 --- a/client/model_info_response.go +++ b/clients/apiclient/model_info_response.go @@ -3,34 +3,41 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the InfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InfoResponse{} + // InfoResponse struct for InfoResponse type InfoResponse struct { - L1Params *L1Params `json:"l1Params,omitempty"` + L1Params L1Params `json:"l1Params"` // The net id of the node - NetID *string `json:"netID,omitempty"` + NetID string `json:"netID"` // The public key of the node (Hex) - PublicKey *string `json:"publicKey,omitempty"` + PublicKey string `json:"publicKey"` // The version of the node - Version *string `json:"version,omitempty"` + Version string `json:"version"` } // NewInfoResponse instantiates a new InfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInfoResponse() *InfoResponse { +func NewInfoResponse(l1Params L1Params, netID string, publicKey string, version string) *InfoResponse { this := InfoResponse{} + this.L1Params = l1Params + this.NetID = netID + this.PublicKey = publicKey + this.Version = version return &this } @@ -42,151 +49,119 @@ func NewInfoResponseWithDefaults() *InfoResponse { return &this } -// GetL1Params returns the L1Params field value if set, zero value otherwise. +// GetL1Params returns the L1Params field value func (o *InfoResponse) GetL1Params() L1Params { - if o == nil || isNil(o.L1Params) { + if o == nil { var ret L1Params return ret } - return *o.L1Params + + return o.L1Params } -// GetL1ParamsOk returns a tuple with the L1Params field value if set, nil otherwise +// GetL1ParamsOk returns a tuple with the L1Params field value // and a boolean to check if the value has been set. func (o *InfoResponse) GetL1ParamsOk() (*L1Params, bool) { - if o == nil || isNil(o.L1Params) { - return nil, false + if o == nil { + return nil, false } - return o.L1Params, true + return &o.L1Params, true } -// HasL1Params returns a boolean if a field has been set. -func (o *InfoResponse) HasL1Params() bool { - if o != nil && !isNil(o.L1Params) { - return true - } - - return false -} - -// SetL1Params gets a reference to the given L1Params and assigns it to the L1Params field. +// SetL1Params sets field value func (o *InfoResponse) SetL1Params(v L1Params) { - o.L1Params = &v + o.L1Params = v } -// GetNetID returns the NetID field value if set, zero value otherwise. +// GetNetID returns the NetID field value func (o *InfoResponse) GetNetID() string { - if o == nil || isNil(o.NetID) { + if o == nil { var ret string return ret } - return *o.NetID + + return o.NetID } -// GetNetIDOk returns a tuple with the NetID field value if set, nil otherwise +// GetNetIDOk returns a tuple with the NetID field value // and a boolean to check if the value has been set. func (o *InfoResponse) GetNetIDOk() (*string, bool) { - if o == nil || isNil(o.NetID) { - return nil, false + if o == nil { + return nil, false } - return o.NetID, true + return &o.NetID, true } -// HasNetID returns a boolean if a field has been set. -func (o *InfoResponse) HasNetID() bool { - if o != nil && !isNil(o.NetID) { - return true - } - - return false -} - -// SetNetID gets a reference to the given string and assigns it to the NetID field. +// SetNetID sets field value func (o *InfoResponse) SetNetID(v string) { - o.NetID = &v + o.NetID = v } -// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +// GetPublicKey returns the PublicKey field value func (o *InfoResponse) GetPublicKey() string { - if o == nil || isNil(o.PublicKey) { + if o == nil { var ret string return ret } - return *o.PublicKey + + return o.PublicKey } -// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. func (o *InfoResponse) GetPublicKeyOk() (*string, bool) { - if o == nil || isNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true -} - -// HasPublicKey returns a boolean if a field has been set. -func (o *InfoResponse) HasPublicKey() bool { - if o != nil && !isNil(o.PublicKey) { - return true + if o == nil { + return nil, false } - - return false + return &o.PublicKey, true } -// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +// SetPublicKey sets field value func (o *InfoResponse) SetPublicKey(v string) { - o.PublicKey = &v + o.PublicKey = v } -// GetVersion returns the Version field value if set, zero value otherwise. +// GetVersion returns the Version field value func (o *InfoResponse) GetVersion() string { - if o == nil || isNil(o.Version) { + if o == nil { var ret string return ret } - return *o.Version + + return o.Version } -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. func (o *InfoResponse) GetVersionOk() (*string, bool) { - if o == nil || isNil(o.Version) { - return nil, false + if o == nil { + return nil, false } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *InfoResponse) HasVersion() bool { - if o != nil && !isNil(o.Version) { - return true - } - - return false + return &o.Version, true } -// SetVersion gets a reference to the given string and assigns it to the Version field. +// SetVersion sets field value func (o *InfoResponse) SetVersion(v string) { - o.Version = &v + o.Version = v } func (o InfoResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.L1Params) { - toSerialize["l1Params"] = o.L1Params - } - if !isNil(o.NetID) { - toSerialize["netID"] = o.NetID - } - if !isNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey - } - if !isNil(o.Version) { - toSerialize["version"] = o.Version + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o InfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["l1Params"] = o.L1Params + toSerialize["netID"] = o.NetID + toSerialize["publicKey"] = o.PublicKey + toSerialize["version"] = o.Version + return toSerialize, nil +} + type NullableInfoResponse struct { value *InfoResponse isSet bool diff --git a/client/model_interface_metric_item.go b/clients/apiclient/model_interface_metric_item.go similarity index 53% rename from client/model_interface_metric_item.go rename to clients/apiclient/model_interface_metric_item.go index 1513b8d53f..c32feb20e1 100644 --- a/client/model_interface_metric_item.go +++ b/clients/apiclient/model_interface_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the InterfaceMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterfaceMetricItem{} + // InterfaceMetricItem struct for InterfaceMetricItem type InterfaceMetricItem struct { - LastMessage *string `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage string `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewInterfaceMetricItem instantiates a new InterfaceMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInterfaceMetricItem() *InterfaceMetricItem { +func NewInterfaceMetricItem(lastMessage string, messages uint32, timestamp time.Time) *InterfaceMetricItem { this := InterfaceMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewInterfaceMetricItemWithDefaults() *InterfaceMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *InterfaceMetricItem) GetLastMessage() string { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret string return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *InterfaceMetricItem) GetLastMessageOk() (*string, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *InterfaceMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given string and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *InterfaceMetricItem) SetLastMessage(v string) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *InterfaceMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *InterfaceMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InterfaceMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *InterfaceMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *InterfaceMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *InterfaceMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *InterfaceMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *InterfaceMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *InterfaceMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *InterfaceMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *InterfaceMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o InterfaceMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o InterfaceMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableInterfaceMetricItem struct { value *InterfaceMetricItem isSet bool diff --git a/client/model_item.go b/clients/apiclient/model_item.go similarity index 60% rename from client/model_item.go rename to clients/apiclient/model_item.go index 90758df729..1ee86b28c6 100644 --- a/client/model_item.go +++ b/clients/apiclient/model_item.go @@ -3,31 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the Item type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Item{} + // Item struct for Item type Item struct { // key (hex-encoded) - Key *string `json:"key,omitempty"` + Key string `json:"key"` // value (hex-encoded) - Value *string `json:"value,omitempty"` + Value string `json:"value"` } // NewItem instantiates a new Item object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewItem() *Item { +func NewItem(key string, value string) *Item { this := Item{} + this.Key = key + this.Value = value return &this } @@ -39,81 +44,69 @@ func NewItemWithDefaults() *Item { return &this } -// GetKey returns the Key field value if set, zero value otherwise. +// GetKey returns the Key field value func (o *Item) GetKey() string { - if o == nil || isNil(o.Key) { + if o == nil { var ret string return ret } - return *o.Key + + return o.Key } -// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. func (o *Item) GetKeyOk() (*string, bool) { - if o == nil || isNil(o.Key) { - return nil, false - } - return o.Key, true -} - -// HasKey returns a boolean if a field has been set. -func (o *Item) HasKey() bool { - if o != nil && !isNil(o.Key) { - return true + if o == nil { + return nil, false } - - return false + return &o.Key, true } -// SetKey gets a reference to the given string and assigns it to the Key field. +// SetKey sets field value func (o *Item) SetKey(v string) { - o.Key = &v + o.Key = v } -// GetValue returns the Value field value if set, zero value otherwise. +// GetValue returns the Value field value func (o *Item) GetValue() string { - if o == nil || isNil(o.Value) { + if o == nil { var ret string return ret } - return *o.Value + + return o.Value } -// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. func (o *Item) GetValueOk() (*string, bool) { - if o == nil || isNil(o.Value) { - return nil, false - } - return o.Value, true -} - -// HasValue returns a boolean if a field has been set. -func (o *Item) HasValue() bool { - if o != nil && !isNil(o.Value) { - return true + if o == nil { + return nil, false } - - return false + return &o.Value, true } -// SetValue gets a reference to the given string and assigns it to the Value field. +// SetValue sets field value func (o *Item) SetValue(v string) { - o.Value = &v + o.Value = v } func (o Item) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Key) { - toSerialize["key"] = o.Key - } - if !isNil(o.Value) { - toSerialize["value"] = o.Value + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o Item) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + toSerialize["value"] = o.Value + return toSerialize, nil +} + type NullableItem struct { value *Item isSet bool diff --git a/client/model_json_dict.go b/clients/apiclient/model_json_dict.go similarity index 87% rename from client/model_json_dict.go rename to clients/apiclient/model_json_dict.go index b01df57703..cd26e94c57 100644 --- a/client/model_json_dict.go +++ b/clients/apiclient/model_json_dict.go @@ -3,17 +3,20 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the JSONDict type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &JSONDict{} + // JSONDict struct for JSONDict type JSONDict struct { Items []Item `json:"Items,omitempty"` @@ -49,7 +52,7 @@ func (o *JSONDict) GetItems() []Item { // and a boolean to check if the value has been set. func (o *JSONDict) GetItemsOk() ([]Item, bool) { if o == nil || isNil(o.Items) { - return nil, false + return nil, false } return o.Items, true } @@ -69,11 +72,19 @@ func (o *JSONDict) SetItems(v []Item) { } func (o JSONDict) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o JSONDict) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !isNil(o.Items) { toSerialize["Items"] = o.Items } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableJSONDict struct { diff --git a/client/model_l1_params.go b/clients/apiclient/model_l1_params.go similarity index 54% rename from client/model_l1_params.go rename to clients/apiclient/model_l1_params.go index ead347d672..23ec9c460b 100644 --- a/client/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the L1Params type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &L1Params{} + // L1Params struct for L1Params type L1Params struct { - BaseToken *BaseToken `json:"baseToken,omitempty"` + BaseToken BaseToken `json:"baseToken"` // The max payload size - MaxPayloadSize *int32 `json:"maxPayloadSize,omitempty"` - Protocol *ProtocolParameters `json:"protocol,omitempty"` + MaxPayloadSize int32 `json:"maxPayloadSize"` + Protocol ProtocolParameters `json:"protocol"` } // NewL1Params instantiates a new L1Params object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewL1Params() *L1Params { +func NewL1Params(baseToken BaseToken, maxPayloadSize int32, protocol ProtocolParameters) *L1Params { this := L1Params{} + this.BaseToken = baseToken + this.MaxPayloadSize = maxPayloadSize + this.Protocol = protocol return &this } @@ -39,116 +45,94 @@ func NewL1ParamsWithDefaults() *L1Params { return &this } -// GetBaseToken returns the BaseToken field value if set, zero value otherwise. +// GetBaseToken returns the BaseToken field value func (o *L1Params) GetBaseToken() BaseToken { - if o == nil || isNil(o.BaseToken) { + if o == nil { var ret BaseToken return ret } - return *o.BaseToken + + return o.BaseToken } -// GetBaseTokenOk returns a tuple with the BaseToken field value if set, nil otherwise +// GetBaseTokenOk returns a tuple with the BaseToken field value // and a boolean to check if the value has been set. func (o *L1Params) GetBaseTokenOk() (*BaseToken, bool) { - if o == nil || isNil(o.BaseToken) { - return nil, false - } - return o.BaseToken, true -} - -// HasBaseToken returns a boolean if a field has been set. -func (o *L1Params) HasBaseToken() bool { - if o != nil && !isNil(o.BaseToken) { - return true + if o == nil { + return nil, false } - - return false + return &o.BaseToken, true } -// SetBaseToken gets a reference to the given BaseToken and assigns it to the BaseToken field. +// SetBaseToken sets field value func (o *L1Params) SetBaseToken(v BaseToken) { - o.BaseToken = &v + o.BaseToken = v } -// GetMaxPayloadSize returns the MaxPayloadSize field value if set, zero value otherwise. +// GetMaxPayloadSize returns the MaxPayloadSize field value func (o *L1Params) GetMaxPayloadSize() int32 { - if o == nil || isNil(o.MaxPayloadSize) { + if o == nil { var ret int32 return ret } - return *o.MaxPayloadSize + + return o.MaxPayloadSize } -// GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field value if set, nil otherwise +// GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field value // and a boolean to check if the value has been set. func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool) { - if o == nil || isNil(o.MaxPayloadSize) { - return nil, false + if o == nil { + return nil, false } - return o.MaxPayloadSize, true -} - -// HasMaxPayloadSize returns a boolean if a field has been set. -func (o *L1Params) HasMaxPayloadSize() bool { - if o != nil && !isNil(o.MaxPayloadSize) { - return true - } - - return false + return &o.MaxPayloadSize, true } -// SetMaxPayloadSize gets a reference to the given int32 and assigns it to the MaxPayloadSize field. +// SetMaxPayloadSize sets field value func (o *L1Params) SetMaxPayloadSize(v int32) { - o.MaxPayloadSize = &v + o.MaxPayloadSize = v } -// GetProtocol returns the Protocol field value if set, zero value otherwise. +// GetProtocol returns the Protocol field value func (o *L1Params) GetProtocol() ProtocolParameters { - if o == nil || isNil(o.Protocol) { + if o == nil { var ret ProtocolParameters return ret } - return *o.Protocol + + return o.Protocol } -// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// GetProtocolOk returns a tuple with the Protocol field value // and a boolean to check if the value has been set. func (o *L1Params) GetProtocolOk() (*ProtocolParameters, bool) { - if o == nil || isNil(o.Protocol) { - return nil, false - } - return o.Protocol, true -} - -// HasProtocol returns a boolean if a field has been set. -func (o *L1Params) HasProtocol() bool { - if o != nil && !isNil(o.Protocol) { - return true + if o == nil { + return nil, false } - - return false + return &o.Protocol, true } -// SetProtocol gets a reference to the given ProtocolParameters and assigns it to the Protocol field. +// SetProtocol sets field value func (o *L1Params) SetProtocol(v ProtocolParameters) { - o.Protocol = &v + o.Protocol = v } func (o L1Params) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.BaseToken) { - toSerialize["baseToken"] = o.BaseToken - } - if !isNil(o.MaxPayloadSize) { - toSerialize["maxPayloadSize"] = o.MaxPayloadSize - } - if !isNil(o.Protocol) { - toSerialize["protocol"] = o.Protocol + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o L1Params) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["baseToken"] = o.BaseToken + toSerialize["maxPayloadSize"] = o.MaxPayloadSize + toSerialize["protocol"] = o.Protocol + return toSerialize, nil +} + type NullableL1Params struct { value *L1Params isSet bool diff --git a/client/model_native_token.go b/clients/apiclient/model_native_token.go similarity index 62% rename from client/model_native_token.go rename to clients/apiclient/model_native_token.go index c2a419cc0a..7e2a321087 100644 --- a/client/model_native_token.go +++ b/clients/apiclient/model_native_token.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the NativeToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NativeToken{} + // NativeToken struct for NativeToken type NativeToken struct { - Amount *string `json:"amount,omitempty"` - Id *string `json:"id,omitempty"` + Amount string `json:"amount"` + Id string `json:"id"` } // NewNativeToken instantiates a new NativeToken object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNativeToken() *NativeToken { +func NewNativeToken(amount string, id string) *NativeToken { this := NativeToken{} + this.Amount = amount + this.Id = id return &this } @@ -37,81 +42,69 @@ func NewNativeTokenWithDefaults() *NativeToken { return &this } -// GetAmount returns the Amount field value if set, zero value otherwise. +// GetAmount returns the Amount field value func (o *NativeToken) GetAmount() string { - if o == nil || isNil(o.Amount) { + if o == nil { var ret string return ret } - return *o.Amount + + return o.Amount } -// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// GetAmountOk returns a tuple with the Amount field value // and a boolean to check if the value has been set. func (o *NativeToken) GetAmountOk() (*string, bool) { - if o == nil || isNil(o.Amount) { - return nil, false - } - return o.Amount, true -} - -// HasAmount returns a boolean if a field has been set. -func (o *NativeToken) HasAmount() bool { - if o != nil && !isNil(o.Amount) { - return true + if o == nil { + return nil, false } - - return false + return &o.Amount, true } -// SetAmount gets a reference to the given string and assigns it to the Amount field. +// SetAmount sets field value func (o *NativeToken) SetAmount(v string) { - o.Amount = &v + o.Amount = v } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *NativeToken) GetId() string { - if o == nil || isNil(o.Id) { + if o == nil { var ret string return ret } - return *o.Id + + return o.Id } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *NativeToken) GetIdOk() (*string, bool) { - if o == nil || isNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *NativeToken) HasId() bool { - if o != nil && !isNil(o.Id) { - return true + if o == nil { + return nil, false } - - return false + return &o.Id, true } -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *NativeToken) SetId(v string) { - o.Id = &v + o.Id = v } func (o NativeToken) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Amount) { - toSerialize["amount"] = o.Amount - } - if !isNil(o.Id) { - toSerialize["id"] = o.Id + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o NativeToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["amount"] = o.Amount + toSerialize["id"] = o.Id + return toSerialize, nil +} + type NullableNativeToken struct { value *NativeToken isSet bool diff --git a/client/model_native_token_id_registry_response.go b/clients/apiclient/model_native_token_id_registry_response.go similarity index 75% rename from client/model_native_token_id_registry_response.go rename to clients/apiclient/model_native_token_id_registry_response.go index f42c6d2a65..7790ac6ed3 100644 --- a/client/model_native_token_id_registry_response.go +++ b/clients/apiclient/model_native_token_id_registry_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the NativeTokenIDRegistryResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NativeTokenIDRegistryResponse{} + // NativeTokenIDRegistryResponse struct for NativeTokenIDRegistryResponse type NativeTokenIDRegistryResponse struct { - NativeTokenRegistryIds []string `json:"nativeTokenRegistryIds,omitempty"` + NativeTokenRegistryIds []string `json:"nativeTokenRegistryIds"` } // NewNativeTokenIDRegistryResponse instantiates a new NativeTokenIDRegistryResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNativeTokenIDRegistryResponse() *NativeTokenIDRegistryResponse { +func NewNativeTokenIDRegistryResponse(nativeTokenRegistryIds []string) *NativeTokenIDRegistryResponse { this := NativeTokenIDRegistryResponse{} + this.NativeTokenRegistryIds = nativeTokenRegistryIds return &this } @@ -36,46 +40,44 @@ func NewNativeTokenIDRegistryResponseWithDefaults() *NativeTokenIDRegistryRespon return &this } -// GetNativeTokenRegistryIds returns the NativeTokenRegistryIds field value if set, zero value otherwise. +// GetNativeTokenRegistryIds returns the NativeTokenRegistryIds field value func (o *NativeTokenIDRegistryResponse) GetNativeTokenRegistryIds() []string { - if o == nil || isNil(o.NativeTokenRegistryIds) { + if o == nil { var ret []string return ret } + return o.NativeTokenRegistryIds } -// GetNativeTokenRegistryIdsOk returns a tuple with the NativeTokenRegistryIds field value if set, nil otherwise +// GetNativeTokenRegistryIdsOk returns a tuple with the NativeTokenRegistryIds field value // and a boolean to check if the value has been set. func (o *NativeTokenIDRegistryResponse) GetNativeTokenRegistryIdsOk() ([]string, bool) { - if o == nil || isNil(o.NativeTokenRegistryIds) { - return nil, false + if o == nil { + return nil, false } return o.NativeTokenRegistryIds, true } -// HasNativeTokenRegistryIds returns a boolean if a field has been set. -func (o *NativeTokenIDRegistryResponse) HasNativeTokenRegistryIds() bool { - if o != nil && !isNil(o.NativeTokenRegistryIds) { - return true - } - - return false -} - -// SetNativeTokenRegistryIds gets a reference to the given []string and assigns it to the NativeTokenRegistryIds field. +// SetNativeTokenRegistryIds sets field value func (o *NativeTokenIDRegistryResponse) SetNativeTokenRegistryIds(v []string) { o.NativeTokenRegistryIds = v } func (o NativeTokenIDRegistryResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.NativeTokenRegistryIds) { - toSerialize["nativeTokenRegistryIds"] = o.NativeTokenRegistryIds + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o NativeTokenIDRegistryResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nativeTokenRegistryIds"] = o.NativeTokenRegistryIds + return toSerialize, nil +} + type NullableNativeTokenIDRegistryResponse struct { value *NativeTokenIDRegistryResponse isSet bool diff --git a/client/model_nft_data_response.go b/clients/apiclient/model_nft_data_response.go similarity index 51% rename from client/model_nft_data_response.go rename to clients/apiclient/model_nft_data_response.go index 5ccf22fd8d..db3b9fd8c6 100644 --- a/client/model_nft_data_response.go +++ b/clients/apiclient/model_nft_data_response.go @@ -3,31 +3,38 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the NFTDataResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NFTDataResponse{} + // NFTDataResponse struct for NFTDataResponse type NFTDataResponse struct { - Id *string `json:"id,omitempty"` - Issuer *string `json:"issuer,omitempty"` - Metadata *string `json:"metadata,omitempty"` - Owner *string `json:"owner,omitempty"` + Id string `json:"id"` + Issuer string `json:"issuer"` + Metadata string `json:"metadata"` + Owner string `json:"owner"` } // NewNFTDataResponse instantiates a new NFTDataResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNFTDataResponse() *NFTDataResponse { +func NewNFTDataResponse(id string, issuer string, metadata string, owner string) *NFTDataResponse { this := NFTDataResponse{} + this.Id = id + this.Issuer = issuer + this.Metadata = metadata + this.Owner = owner return &this } @@ -39,151 +46,119 @@ func NewNFTDataResponseWithDefaults() *NFTDataResponse { return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *NFTDataResponse) GetId() string { - if o == nil || isNil(o.Id) { + if o == nil { var ret string return ret } - return *o.Id + + return o.Id } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *NFTDataResponse) GetIdOk() (*string, bool) { - if o == nil || isNil(o.Id) { - return nil, false + if o == nil { + return nil, false } - return o.Id, true + return &o.Id, true } -// HasId returns a boolean if a field has been set. -func (o *NFTDataResponse) HasId() bool { - if o != nil && !isNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *NFTDataResponse) SetId(v string) { - o.Id = &v + o.Id = v } -// GetIssuer returns the Issuer field value if set, zero value otherwise. +// GetIssuer returns the Issuer field value func (o *NFTDataResponse) GetIssuer() string { - if o == nil || isNil(o.Issuer) { + if o == nil { var ret string return ret } - return *o.Issuer + + return o.Issuer } -// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// GetIssuerOk returns a tuple with the Issuer field value // and a boolean to check if the value has been set. func (o *NFTDataResponse) GetIssuerOk() (*string, bool) { - if o == nil || isNil(o.Issuer) { - return nil, false + if o == nil { + return nil, false } - return o.Issuer, true + return &o.Issuer, true } -// HasIssuer returns a boolean if a field has been set. -func (o *NFTDataResponse) HasIssuer() bool { - if o != nil && !isNil(o.Issuer) { - return true - } - - return false -} - -// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +// SetIssuer sets field value func (o *NFTDataResponse) SetIssuer(v string) { - o.Issuer = &v + o.Issuer = v } -// GetMetadata returns the Metadata field value if set, zero value otherwise. +// GetMetadata returns the Metadata field value func (o *NFTDataResponse) GetMetadata() string { - if o == nil || isNil(o.Metadata) { + if o == nil { var ret string return ret } - return *o.Metadata + + return o.Metadata } -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// GetMetadataOk returns a tuple with the Metadata field value // and a boolean to check if the value has been set. func (o *NFTDataResponse) GetMetadataOk() (*string, bool) { - if o == nil || isNil(o.Metadata) { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *NFTDataResponse) HasMetadata() bool { - if o != nil && !isNil(o.Metadata) { - return true + if o == nil { + return nil, false } - - return false + return &o.Metadata, true } -// SetMetadata gets a reference to the given string and assigns it to the Metadata field. +// SetMetadata sets field value func (o *NFTDataResponse) SetMetadata(v string) { - o.Metadata = &v + o.Metadata = v } -// GetOwner returns the Owner field value if set, zero value otherwise. +// GetOwner returns the Owner field value func (o *NFTDataResponse) GetOwner() string { - if o == nil || isNil(o.Owner) { + if o == nil { var ret string return ret } - return *o.Owner + + return o.Owner } -// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value // and a boolean to check if the value has been set. func (o *NFTDataResponse) GetOwnerOk() (*string, bool) { - if o == nil || isNil(o.Owner) { - return nil, false + if o == nil { + return nil, false } - return o.Owner, true -} - -// HasOwner returns a boolean if a field has been set. -func (o *NFTDataResponse) HasOwner() bool { - if o != nil && !isNil(o.Owner) { - return true - } - - return false + return &o.Owner, true } -// SetOwner gets a reference to the given string and assigns it to the Owner field. +// SetOwner sets field value func (o *NFTDataResponse) SetOwner(v string) { - o.Owner = &v + o.Owner = v } func (o NFTDataResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Id) { - toSerialize["id"] = o.Id - } - if !isNil(o.Issuer) { - toSerialize["issuer"] = o.Issuer - } - if !isNil(o.Metadata) { - toSerialize["metadata"] = o.Metadata - } - if !isNil(o.Owner) { - toSerialize["owner"] = o.Owner + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o NFTDataResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["issuer"] = o.Issuer + toSerialize["metadata"] = o.Metadata + toSerialize["owner"] = o.Owner + return toSerialize, nil +} + type NullableNFTDataResponse struct { value *NFTDataResponse isSet bool diff --git a/client/model_node_owner_certificate_request.go b/clients/apiclient/model_node_owner_certificate_request.go similarity index 65% rename from client/model_node_owner_certificate_request.go rename to clients/apiclient/model_node_owner_certificate_request.go index e9a998e839..6fc1abad66 100644 --- a/client/model_node_owner_certificate_request.go +++ b/clients/apiclient/model_node_owner_certificate_request.go @@ -3,31 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the NodeOwnerCertificateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeOwnerCertificateRequest{} + // NodeOwnerCertificateRequest struct for NodeOwnerCertificateRequest type NodeOwnerCertificateRequest struct { // Node owner address. (Bech32) - OwnerAddress *string `json:"ownerAddress,omitempty"` + OwnerAddress string `json:"ownerAddress"` // The public key of the node (Hex) - PublicKey *string `json:"publicKey,omitempty"` + PublicKey string `json:"publicKey"` } // NewNodeOwnerCertificateRequest instantiates a new NodeOwnerCertificateRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNodeOwnerCertificateRequest() *NodeOwnerCertificateRequest { +func NewNodeOwnerCertificateRequest(ownerAddress string, publicKey string) *NodeOwnerCertificateRequest { this := NodeOwnerCertificateRequest{} + this.OwnerAddress = ownerAddress + this.PublicKey = publicKey return &this } @@ -39,81 +44,69 @@ func NewNodeOwnerCertificateRequestWithDefaults() *NodeOwnerCertificateRequest { return &this } -// GetOwnerAddress returns the OwnerAddress field value if set, zero value otherwise. +// GetOwnerAddress returns the OwnerAddress field value func (o *NodeOwnerCertificateRequest) GetOwnerAddress() string { - if o == nil || isNil(o.OwnerAddress) { + if o == nil { var ret string return ret } - return *o.OwnerAddress + + return o.OwnerAddress } -// GetOwnerAddressOk returns a tuple with the OwnerAddress field value if set, nil otherwise +// GetOwnerAddressOk returns a tuple with the OwnerAddress field value // and a boolean to check if the value has been set. func (o *NodeOwnerCertificateRequest) GetOwnerAddressOk() (*string, bool) { - if o == nil || isNil(o.OwnerAddress) { - return nil, false - } - return o.OwnerAddress, true -} - -// HasOwnerAddress returns a boolean if a field has been set. -func (o *NodeOwnerCertificateRequest) HasOwnerAddress() bool { - if o != nil && !isNil(o.OwnerAddress) { - return true + if o == nil { + return nil, false } - - return false + return &o.OwnerAddress, true } -// SetOwnerAddress gets a reference to the given string and assigns it to the OwnerAddress field. +// SetOwnerAddress sets field value func (o *NodeOwnerCertificateRequest) SetOwnerAddress(v string) { - o.OwnerAddress = &v + o.OwnerAddress = v } -// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +// GetPublicKey returns the PublicKey field value func (o *NodeOwnerCertificateRequest) GetPublicKey() string { - if o == nil || isNil(o.PublicKey) { + if o == nil { var ret string return ret } - return *o.PublicKey + + return o.PublicKey } -// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. func (o *NodeOwnerCertificateRequest) GetPublicKeyOk() (*string, bool) { - if o == nil || isNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true -} - -// HasPublicKey returns a boolean if a field has been set. -func (o *NodeOwnerCertificateRequest) HasPublicKey() bool { - if o != nil && !isNil(o.PublicKey) { - return true + if o == nil { + return nil, false } - - return false + return &o.PublicKey, true } -// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +// SetPublicKey sets field value func (o *NodeOwnerCertificateRequest) SetPublicKey(v string) { - o.PublicKey = &v + o.PublicKey = v } func (o NodeOwnerCertificateRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.OwnerAddress) { - toSerialize["ownerAddress"] = o.OwnerAddress - } - if !isNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o NodeOwnerCertificateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ownerAddress"] = o.OwnerAddress + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + type NullableNodeOwnerCertificateRequest struct { value *NodeOwnerCertificateRequest isSet bool diff --git a/client/model_off_ledger_request.go b/clients/apiclient/model_off_ledger_request.go similarity index 62% rename from client/model_off_ledger_request.go rename to clients/apiclient/model_off_ledger_request.go index e2ad571682..8c7e1381f1 100644 --- a/client/model_off_ledger_request.go +++ b/clients/apiclient/model_off_ledger_request.go @@ -3,31 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the OffLedgerRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OffLedgerRequest{} + // OffLedgerRequest struct for OffLedgerRequest type OffLedgerRequest struct { // The chain id - ChainId *string `json:"chainId,omitempty"` + ChainId string `json:"chainId"` // Offledger Request (Hex) - Request *string `json:"request,omitempty"` + Request string `json:"request"` } // NewOffLedgerRequest instantiates a new OffLedgerRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOffLedgerRequest() *OffLedgerRequest { +func NewOffLedgerRequest(chainId string, request string) *OffLedgerRequest { this := OffLedgerRequest{} + this.ChainId = chainId + this.Request = request return &this } @@ -39,81 +44,69 @@ func NewOffLedgerRequestWithDefaults() *OffLedgerRequest { return &this } -// GetChainId returns the ChainId field value if set, zero value otherwise. +// GetChainId returns the ChainId field value func (o *OffLedgerRequest) GetChainId() string { - if o == nil || isNil(o.ChainId) { + if o == nil { var ret string return ret } - return *o.ChainId + + return o.ChainId } -// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// GetChainIdOk returns a tuple with the ChainId field value // and a boolean to check if the value has been set. func (o *OffLedgerRequest) GetChainIdOk() (*string, bool) { - if o == nil || isNil(o.ChainId) { - return nil, false - } - return o.ChainId, true -} - -// HasChainId returns a boolean if a field has been set. -func (o *OffLedgerRequest) HasChainId() bool { - if o != nil && !isNil(o.ChainId) { - return true + if o == nil { + return nil, false } - - return false + return &o.ChainId, true } -// SetChainId gets a reference to the given string and assigns it to the ChainId field. +// SetChainId sets field value func (o *OffLedgerRequest) SetChainId(v string) { - o.ChainId = &v + o.ChainId = v } -// GetRequest returns the Request field value if set, zero value otherwise. +// GetRequest returns the Request field value func (o *OffLedgerRequest) GetRequest() string { - if o == nil || isNil(o.Request) { + if o == nil { var ret string return ret } - return *o.Request + + return o.Request } -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// GetRequestOk returns a tuple with the Request field value // and a boolean to check if the value has been set. func (o *OffLedgerRequest) GetRequestOk() (*string, bool) { - if o == nil || isNil(o.Request) { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *OffLedgerRequest) HasRequest() bool { - if o != nil && !isNil(o.Request) { - return true + if o == nil { + return nil, false } - - return false + return &o.Request, true } -// SetRequest gets a reference to the given string and assigns it to the Request field. +// SetRequest sets field value func (o *OffLedgerRequest) SetRequest(v string) { - o.Request = &v + o.Request = v } func (o OffLedgerRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.ChainId) { - toSerialize["chainId"] = o.ChainId - } - if !isNil(o.Request) { - toSerialize["request"] = o.Request + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o OffLedgerRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["chainId"] = o.ChainId + toSerialize["request"] = o.Request + return toSerialize, nil +} + type NullableOffLedgerRequest struct { value *OffLedgerRequest isSet bool diff --git a/client/model_on_ledger_request.go b/clients/apiclient/model_on_ledger_request.go similarity index 52% rename from client/model_on_ledger_request.go rename to clients/apiclient/model_on_ledger_request.go index bf196ec673..2b6dcc0917 100644 --- a/client/model_on_ledger_request.go +++ b/clients/apiclient/model_on_ledger_request.go @@ -3,34 +3,41 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the OnLedgerRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OnLedgerRequest{} + // OnLedgerRequest struct for OnLedgerRequest type OnLedgerRequest struct { // The request ID - Id *string `json:"id,omitempty"` - Output *Output `json:"output,omitempty"` + Id string `json:"id"` + Output Output `json:"output"` // The output ID - OutputId *string `json:"outputId,omitempty"` + OutputId string `json:"outputId"` // The raw data of the request (Hex) - Raw *string `json:"raw,omitempty"` + Raw string `json:"raw"` } // NewOnLedgerRequest instantiates a new OnLedgerRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOnLedgerRequest() *OnLedgerRequest { +func NewOnLedgerRequest(id string, output Output, outputId string, raw string) *OnLedgerRequest { this := OnLedgerRequest{} + this.Id = id + this.Output = output + this.OutputId = outputId + this.Raw = raw return &this } @@ -42,151 +49,119 @@ func NewOnLedgerRequestWithDefaults() *OnLedgerRequest { return &this } -// GetId returns the Id field value if set, zero value otherwise. +// GetId returns the Id field value func (o *OnLedgerRequest) GetId() string { - if o == nil || isNil(o.Id) { + if o == nil { var ret string return ret } - return *o.Id + + return o.Id } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *OnLedgerRequest) GetIdOk() (*string, bool) { - if o == nil || isNil(o.Id) { - return nil, false + if o == nil { + return nil, false } - return o.Id, true + return &o.Id, true } -// HasId returns a boolean if a field has been set. -func (o *OnLedgerRequest) HasId() bool { - if o != nil && !isNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. +// SetId sets field value func (o *OnLedgerRequest) SetId(v string) { - o.Id = &v + o.Id = v } -// GetOutput returns the Output field value if set, zero value otherwise. +// GetOutput returns the Output field value func (o *OnLedgerRequest) GetOutput() Output { - if o == nil || isNil(o.Output) { + if o == nil { var ret Output return ret } - return *o.Output + + return o.Output } -// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// GetOutputOk returns a tuple with the Output field value // and a boolean to check if the value has been set. func (o *OnLedgerRequest) GetOutputOk() (*Output, bool) { - if o == nil || isNil(o.Output) { - return nil, false + if o == nil { + return nil, false } - return o.Output, true + return &o.Output, true } -// HasOutput returns a boolean if a field has been set. -func (o *OnLedgerRequest) HasOutput() bool { - if o != nil && !isNil(o.Output) { - return true - } - - return false -} - -// SetOutput gets a reference to the given Output and assigns it to the Output field. +// SetOutput sets field value func (o *OnLedgerRequest) SetOutput(v Output) { - o.Output = &v + o.Output = v } -// GetOutputId returns the OutputId field value if set, zero value otherwise. +// GetOutputId returns the OutputId field value func (o *OnLedgerRequest) GetOutputId() string { - if o == nil || isNil(o.OutputId) { + if o == nil { var ret string return ret } - return *o.OutputId + + return o.OutputId } -// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// GetOutputIdOk returns a tuple with the OutputId field value // and a boolean to check if the value has been set. func (o *OnLedgerRequest) GetOutputIdOk() (*string, bool) { - if o == nil || isNil(o.OutputId) { - return nil, false - } - return o.OutputId, true -} - -// HasOutputId returns a boolean if a field has been set. -func (o *OnLedgerRequest) HasOutputId() bool { - if o != nil && !isNil(o.OutputId) { - return true + if o == nil { + return nil, false } - - return false + return &o.OutputId, true } -// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +// SetOutputId sets field value func (o *OnLedgerRequest) SetOutputId(v string) { - o.OutputId = &v + o.OutputId = v } -// GetRaw returns the Raw field value if set, zero value otherwise. +// GetRaw returns the Raw field value func (o *OnLedgerRequest) GetRaw() string { - if o == nil || isNil(o.Raw) { + if o == nil { var ret string return ret } - return *o.Raw + + return o.Raw } -// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// GetRawOk returns a tuple with the Raw field value // and a boolean to check if the value has been set. func (o *OnLedgerRequest) GetRawOk() (*string, bool) { - if o == nil || isNil(o.Raw) { - return nil, false + if o == nil { + return nil, false } - return o.Raw, true -} - -// HasRaw returns a boolean if a field has been set. -func (o *OnLedgerRequest) HasRaw() bool { - if o != nil && !isNil(o.Raw) { - return true - } - - return false + return &o.Raw, true } -// SetRaw gets a reference to the given string and assigns it to the Raw field. +// SetRaw sets field value func (o *OnLedgerRequest) SetRaw(v string) { - o.Raw = &v + o.Raw = v } func (o OnLedgerRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Id) { - toSerialize["id"] = o.Id - } - if !isNil(o.Output) { - toSerialize["output"] = o.Output - } - if !isNil(o.OutputId) { - toSerialize["outputId"] = o.OutputId - } - if !isNil(o.Raw) { - toSerialize["raw"] = o.Raw + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o OnLedgerRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["output"] = o.Output + toSerialize["outputId"] = o.OutputId + toSerialize["raw"] = o.Raw + return toSerialize, nil +} + type NullableOnLedgerRequest struct { value *OnLedgerRequest isSet bool diff --git a/client/model_on_ledger_request_metric_item.go b/clients/apiclient/model_on_ledger_request_metric_item.go similarity index 54% rename from client/model_on_ledger_request_metric_item.go rename to clients/apiclient/model_on_ledger_request_metric_item.go index c52287836b..eb0bf6751c 100644 --- a/client/model_on_ledger_request_metric_item.go +++ b/clients/apiclient/model_on_ledger_request_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the OnLedgerRequestMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OnLedgerRequestMetricItem{} + // OnLedgerRequestMetricItem struct for OnLedgerRequestMetricItem type OnLedgerRequestMetricItem struct { - LastMessage *OnLedgerRequest `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage OnLedgerRequest `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewOnLedgerRequestMetricItem instantiates a new OnLedgerRequestMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOnLedgerRequestMetricItem() *OnLedgerRequestMetricItem { +func NewOnLedgerRequestMetricItem(lastMessage OnLedgerRequest, messages uint32, timestamp time.Time) *OnLedgerRequestMetricItem { this := OnLedgerRequestMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewOnLedgerRequestMetricItemWithDefaults() *OnLedgerRequestMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *OnLedgerRequestMetricItem) GetLastMessage() OnLedgerRequest { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret OnLedgerRequest return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *OnLedgerRequestMetricItem) GetLastMessageOk() (*OnLedgerRequest, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *OnLedgerRequestMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given OnLedgerRequest and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *OnLedgerRequestMetricItem) SetLastMessage(v OnLedgerRequest) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *OnLedgerRequestMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *OnLedgerRequestMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OnLedgerRequestMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *OnLedgerRequestMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *OnLedgerRequestMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *OnLedgerRequestMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *OnLedgerRequestMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *OnLedgerRequestMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *OnLedgerRequestMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *OnLedgerRequestMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *OnLedgerRequestMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o OnLedgerRequestMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o OnLedgerRequestMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableOnLedgerRequestMetricItem struct { value *OnLedgerRequestMetricItem isSet bool diff --git a/client/model_output.go b/clients/apiclient/model_output.go similarity index 61% rename from client/model_output.go rename to clients/apiclient/model_output.go index 5667a94e50..586af1a55e 100644 --- a/client/model_output.go +++ b/clients/apiclient/model_output.go @@ -3,31 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the Output type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Output{} + // Output struct for Output type Output struct { // The output type - OutputType *int32 `json:"outputType,omitempty"` + OutputType int32 `json:"outputType"` // The raw data of the output (Hex) - Raw *string `json:"raw,omitempty"` + Raw string `json:"raw"` } // NewOutput instantiates a new Output object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOutput() *Output { +func NewOutput(outputType int32, raw string) *Output { this := Output{} + this.OutputType = outputType + this.Raw = raw return &this } @@ -39,81 +44,69 @@ func NewOutputWithDefaults() *Output { return &this } -// GetOutputType returns the OutputType field value if set, zero value otherwise. +// GetOutputType returns the OutputType field value func (o *Output) GetOutputType() int32 { - if o == nil || isNil(o.OutputType) { + if o == nil { var ret int32 return ret } - return *o.OutputType + + return o.OutputType } -// GetOutputTypeOk returns a tuple with the OutputType field value if set, nil otherwise +// GetOutputTypeOk returns a tuple with the OutputType field value // and a boolean to check if the value has been set. func (o *Output) GetOutputTypeOk() (*int32, bool) { - if o == nil || isNil(o.OutputType) { - return nil, false - } - return o.OutputType, true -} - -// HasOutputType returns a boolean if a field has been set. -func (o *Output) HasOutputType() bool { - if o != nil && !isNil(o.OutputType) { - return true + if o == nil { + return nil, false } - - return false + return &o.OutputType, true } -// SetOutputType gets a reference to the given int32 and assigns it to the OutputType field. +// SetOutputType sets field value func (o *Output) SetOutputType(v int32) { - o.OutputType = &v + o.OutputType = v } -// GetRaw returns the Raw field value if set, zero value otherwise. +// GetRaw returns the Raw field value func (o *Output) GetRaw() string { - if o == nil || isNil(o.Raw) { + if o == nil { var ret string return ret } - return *o.Raw + + return o.Raw } -// GetRawOk returns a tuple with the Raw field value if set, nil otherwise +// GetRawOk returns a tuple with the Raw field value // and a boolean to check if the value has been set. func (o *Output) GetRawOk() (*string, bool) { - if o == nil || isNil(o.Raw) { - return nil, false - } - return o.Raw, true -} - -// HasRaw returns a boolean if a field has been set. -func (o *Output) HasRaw() bool { - if o != nil && !isNil(o.Raw) { - return true + if o == nil { + return nil, false } - - return false + return &o.Raw, true } -// SetRaw gets a reference to the given string and assigns it to the Raw field. +// SetRaw sets field value func (o *Output) SetRaw(v string) { - o.Raw = &v + o.Raw = v } func (o Output) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.OutputType) { - toSerialize["outputType"] = o.OutputType - } - if !isNil(o.Raw) { - toSerialize["raw"] = o.Raw + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o Output) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["outputType"] = o.OutputType + toSerialize["raw"] = o.Raw + return toSerialize, nil +} + type NullableOutput struct { value *Output isSet bool diff --git a/client/model_output_id.go b/clients/apiclient/model_output_id.go similarity index 70% rename from client/model_output_id.go rename to clients/apiclient/model_output_id.go index f7fdadf605..22ae7a0f6e 100644 --- a/client/model_output_id.go +++ b/clients/apiclient/model_output_id.go @@ -3,29 +3,33 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the OutputID type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OutputID{} + // OutputID struct for OutputID type OutputID struct { // The output ID - OutputId *string `json:"outputId,omitempty"` + OutputId string `json:"outputId"` } // NewOutputID instantiates a new OutputID object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOutputID() *OutputID { +func NewOutputID(outputId string) *OutputID { this := OutputID{} + this.OutputId = outputId return &this } @@ -37,46 +41,44 @@ func NewOutputIDWithDefaults() *OutputID { return &this } -// GetOutputId returns the OutputId field value if set, zero value otherwise. +// GetOutputId returns the OutputId field value func (o *OutputID) GetOutputId() string { - if o == nil || isNil(o.OutputId) { + if o == nil { var ret string return ret } - return *o.OutputId + + return o.OutputId } -// GetOutputIdOk returns a tuple with the OutputId field value if set, nil otherwise +// GetOutputIdOk returns a tuple with the OutputId field value // and a boolean to check if the value has been set. func (o *OutputID) GetOutputIdOk() (*string, bool) { - if o == nil || isNil(o.OutputId) { - return nil, false - } - return o.OutputId, true -} - -// HasOutputId returns a boolean if a field has been set. -func (o *OutputID) HasOutputId() bool { - if o != nil && !isNil(o.OutputId) { - return true + if o == nil { + return nil, false } - - return false + return &o.OutputId, true } -// SetOutputId gets a reference to the given string and assigns it to the OutputId field. +// SetOutputId sets field value func (o *OutputID) SetOutputId(v string) { - o.OutputId = &v + o.OutputId = v } func (o OutputID) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.OutputId) { - toSerialize["outputId"] = o.OutputId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o OutputID) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["outputId"] = o.OutputId + return toSerialize, nil +} + type NullableOutputID struct { value *OutputID isSet bool diff --git a/client/model_peering_node_identity_response.go b/clients/apiclient/model_peering_node_identity_response.go similarity index 60% rename from client/model_peering_node_identity_response.go rename to clients/apiclient/model_peering_node_identity_response.go index e4b57947ec..14572fc574 100644 --- a/client/model_peering_node_identity_response.go +++ b/clients/apiclient/model_peering_node_identity_response.go @@ -3,32 +3,38 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the PeeringNodeIdentityResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PeeringNodeIdentityResponse{} + // PeeringNodeIdentityResponse struct for PeeringNodeIdentityResponse type PeeringNodeIdentityResponse struct { - IsTrusted *bool `json:"isTrusted,omitempty"` + IsTrusted bool `json:"isTrusted"` // The NetID of the peer - NetId *string `json:"netId,omitempty"` + NetId string `json:"netId"` // The peers public key encoded in Hex - PublicKey *string `json:"publicKey,omitempty"` + PublicKey string `json:"publicKey"` } // NewPeeringNodeIdentityResponse instantiates a new PeeringNodeIdentityResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPeeringNodeIdentityResponse() *PeeringNodeIdentityResponse { +func NewPeeringNodeIdentityResponse(isTrusted bool, netId string, publicKey string) *PeeringNodeIdentityResponse { this := PeeringNodeIdentityResponse{} + this.IsTrusted = isTrusted + this.NetId = netId + this.PublicKey = publicKey return &this } @@ -40,116 +46,94 @@ func NewPeeringNodeIdentityResponseWithDefaults() *PeeringNodeIdentityResponse { return &this } -// GetIsTrusted returns the IsTrusted field value if set, zero value otherwise. +// GetIsTrusted returns the IsTrusted field value func (o *PeeringNodeIdentityResponse) GetIsTrusted() bool { - if o == nil || isNil(o.IsTrusted) { + if o == nil { var ret bool return ret } - return *o.IsTrusted + + return o.IsTrusted } -// GetIsTrustedOk returns a tuple with the IsTrusted field value if set, nil otherwise +// GetIsTrustedOk returns a tuple with the IsTrusted field value // and a boolean to check if the value has been set. func (o *PeeringNodeIdentityResponse) GetIsTrustedOk() (*bool, bool) { - if o == nil || isNil(o.IsTrusted) { - return nil, false - } - return o.IsTrusted, true -} - -// HasIsTrusted returns a boolean if a field has been set. -func (o *PeeringNodeIdentityResponse) HasIsTrusted() bool { - if o != nil && !isNil(o.IsTrusted) { - return true + if o == nil { + return nil, false } - - return false + return &o.IsTrusted, true } -// SetIsTrusted gets a reference to the given bool and assigns it to the IsTrusted field. +// SetIsTrusted sets field value func (o *PeeringNodeIdentityResponse) SetIsTrusted(v bool) { - o.IsTrusted = &v + o.IsTrusted = v } -// GetNetId returns the NetId field value if set, zero value otherwise. +// GetNetId returns the NetId field value func (o *PeeringNodeIdentityResponse) GetNetId() string { - if o == nil || isNil(o.NetId) { + if o == nil { var ret string return ret } - return *o.NetId + + return o.NetId } -// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// GetNetIdOk returns a tuple with the NetId field value // and a boolean to check if the value has been set. func (o *PeeringNodeIdentityResponse) GetNetIdOk() (*string, bool) { - if o == nil || isNil(o.NetId) { - return nil, false + if o == nil { + return nil, false } - return o.NetId, true -} - -// HasNetId returns a boolean if a field has been set. -func (o *PeeringNodeIdentityResponse) HasNetId() bool { - if o != nil && !isNil(o.NetId) { - return true - } - - return false + return &o.NetId, true } -// SetNetId gets a reference to the given string and assigns it to the NetId field. +// SetNetId sets field value func (o *PeeringNodeIdentityResponse) SetNetId(v string) { - o.NetId = &v + o.NetId = v } -// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +// GetPublicKey returns the PublicKey field value func (o *PeeringNodeIdentityResponse) GetPublicKey() string { - if o == nil || isNil(o.PublicKey) { + if o == nil { var ret string return ret } - return *o.PublicKey + + return o.PublicKey } -// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. func (o *PeeringNodeIdentityResponse) GetPublicKeyOk() (*string, bool) { - if o == nil || isNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true -} - -// HasPublicKey returns a boolean if a field has been set. -func (o *PeeringNodeIdentityResponse) HasPublicKey() bool { - if o != nil && !isNil(o.PublicKey) { - return true + if o == nil { + return nil, false } - - return false + return &o.PublicKey, true } -// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +// SetPublicKey sets field value func (o *PeeringNodeIdentityResponse) SetPublicKey(v string) { - o.PublicKey = &v + o.PublicKey = v } func (o PeeringNodeIdentityResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.IsTrusted) { - toSerialize["isTrusted"] = o.IsTrusted - } - if !isNil(o.NetId) { - toSerialize["netId"] = o.NetId - } - if !isNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o PeeringNodeIdentityResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isTrusted"] = o.IsTrusted + toSerialize["netId"] = o.NetId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + type NullablePeeringNodeIdentityResponse struct { value *PeeringNodeIdentityResponse isSet bool diff --git a/client/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go similarity index 51% rename from client/model_peering_node_status_response.go rename to clients/apiclient/model_peering_node_status_response.go index 2bdaeee480..a2f96e1bdf 100644 --- a/client/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -3,36 +3,44 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the PeeringNodeStatusResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PeeringNodeStatusResponse{} + // PeeringNodeStatusResponse struct for PeeringNodeStatusResponse type PeeringNodeStatusResponse struct { // Whether or not the peer is activated - IsAlive *bool `json:"isAlive,omitempty"` - IsTrusted *bool `json:"isTrusted,omitempty"` + IsAlive bool `json:"isAlive"` + IsTrusted bool `json:"isTrusted"` // The NetID of the peer - NetId *string `json:"netId,omitempty"` + NetId string `json:"netId"` // The amount of users attached to the peer - NumUsers *int32 `json:"numUsers,omitempty"` + NumUsers int32 `json:"numUsers"` // The peers public key encoded in Hex - PublicKey *string `json:"publicKey,omitempty"` + PublicKey string `json:"publicKey"` } // NewPeeringNodeStatusResponse instantiates a new PeeringNodeStatusResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPeeringNodeStatusResponse() *PeeringNodeStatusResponse { +func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers int32, publicKey string) *PeeringNodeStatusResponse { this := PeeringNodeStatusResponse{} + this.IsAlive = isAlive + this.IsTrusted = isTrusted + this.NetId = netId + this.NumUsers = numUsers + this.PublicKey = publicKey return &this } @@ -44,186 +52,144 @@ func NewPeeringNodeStatusResponseWithDefaults() *PeeringNodeStatusResponse { return &this } -// GetIsAlive returns the IsAlive field value if set, zero value otherwise. +// GetIsAlive returns the IsAlive field value func (o *PeeringNodeStatusResponse) GetIsAlive() bool { - if o == nil || isNil(o.IsAlive) { + if o == nil { var ret bool return ret } - return *o.IsAlive + + return o.IsAlive } -// GetIsAliveOk returns a tuple with the IsAlive field value if set, nil otherwise +// GetIsAliveOk returns a tuple with the IsAlive field value // and a boolean to check if the value has been set. func (o *PeeringNodeStatusResponse) GetIsAliveOk() (*bool, bool) { - if o == nil || isNil(o.IsAlive) { - return nil, false + if o == nil { + return nil, false } - return o.IsAlive, true + return &o.IsAlive, true } -// HasIsAlive returns a boolean if a field has been set. -func (o *PeeringNodeStatusResponse) HasIsAlive() bool { - if o != nil && !isNil(o.IsAlive) { - return true - } - - return false -} - -// SetIsAlive gets a reference to the given bool and assigns it to the IsAlive field. +// SetIsAlive sets field value func (o *PeeringNodeStatusResponse) SetIsAlive(v bool) { - o.IsAlive = &v + o.IsAlive = v } -// GetIsTrusted returns the IsTrusted field value if set, zero value otherwise. +// GetIsTrusted returns the IsTrusted field value func (o *PeeringNodeStatusResponse) GetIsTrusted() bool { - if o == nil || isNil(o.IsTrusted) { + if o == nil { var ret bool return ret } - return *o.IsTrusted + + return o.IsTrusted } -// GetIsTrustedOk returns a tuple with the IsTrusted field value if set, nil otherwise +// GetIsTrustedOk returns a tuple with the IsTrusted field value // and a boolean to check if the value has been set. func (o *PeeringNodeStatusResponse) GetIsTrustedOk() (*bool, bool) { - if o == nil || isNil(o.IsTrusted) { - return nil, false + if o == nil { + return nil, false } - return o.IsTrusted, true + return &o.IsTrusted, true } -// HasIsTrusted returns a boolean if a field has been set. -func (o *PeeringNodeStatusResponse) HasIsTrusted() bool { - if o != nil && !isNil(o.IsTrusted) { - return true - } - - return false -} - -// SetIsTrusted gets a reference to the given bool and assigns it to the IsTrusted field. +// SetIsTrusted sets field value func (o *PeeringNodeStatusResponse) SetIsTrusted(v bool) { - o.IsTrusted = &v + o.IsTrusted = v } -// GetNetId returns the NetId field value if set, zero value otherwise. +// GetNetId returns the NetId field value func (o *PeeringNodeStatusResponse) GetNetId() string { - if o == nil || isNil(o.NetId) { + if o == nil { var ret string return ret } - return *o.NetId + + return o.NetId } -// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// GetNetIdOk returns a tuple with the NetId field value // and a boolean to check if the value has been set. func (o *PeeringNodeStatusResponse) GetNetIdOk() (*string, bool) { - if o == nil || isNil(o.NetId) { - return nil, false - } - return o.NetId, true -} - -// HasNetId returns a boolean if a field has been set. -func (o *PeeringNodeStatusResponse) HasNetId() bool { - if o != nil && !isNil(o.NetId) { - return true + if o == nil { + return nil, false } - - return false + return &o.NetId, true } -// SetNetId gets a reference to the given string and assigns it to the NetId field. +// SetNetId sets field value func (o *PeeringNodeStatusResponse) SetNetId(v string) { - o.NetId = &v + o.NetId = v } -// GetNumUsers returns the NumUsers field value if set, zero value otherwise. +// GetNumUsers returns the NumUsers field value func (o *PeeringNodeStatusResponse) GetNumUsers() int32 { - if o == nil || isNil(o.NumUsers) { + if o == nil { var ret int32 return ret } - return *o.NumUsers + + return o.NumUsers } -// GetNumUsersOk returns a tuple with the NumUsers field value if set, nil otherwise +// GetNumUsersOk returns a tuple with the NumUsers field value // and a boolean to check if the value has been set. func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool) { - if o == nil || isNil(o.NumUsers) { - return nil, false + if o == nil { + return nil, false } - return o.NumUsers, true + return &o.NumUsers, true } -// HasNumUsers returns a boolean if a field has been set. -func (o *PeeringNodeStatusResponse) HasNumUsers() bool { - if o != nil && !isNil(o.NumUsers) { - return true - } - - return false -} - -// SetNumUsers gets a reference to the given int32 and assigns it to the NumUsers field. +// SetNumUsers sets field value func (o *PeeringNodeStatusResponse) SetNumUsers(v int32) { - o.NumUsers = &v + o.NumUsers = v } -// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +// GetPublicKey returns the PublicKey field value func (o *PeeringNodeStatusResponse) GetPublicKey() string { - if o == nil || isNil(o.PublicKey) { + if o == nil { var ret string return ret } - return *o.PublicKey + + return o.PublicKey } -// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. func (o *PeeringNodeStatusResponse) GetPublicKeyOk() (*string, bool) { - if o == nil || isNil(o.PublicKey) { - return nil, false + if o == nil { + return nil, false } - return o.PublicKey, true -} - -// HasPublicKey returns a boolean if a field has been set. -func (o *PeeringNodeStatusResponse) HasPublicKey() bool { - if o != nil && !isNil(o.PublicKey) { - return true - } - - return false + return &o.PublicKey, true } -// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +// SetPublicKey sets field value func (o *PeeringNodeStatusResponse) SetPublicKey(v string) { - o.PublicKey = &v + o.PublicKey = v } func (o PeeringNodeStatusResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.IsAlive) { - toSerialize["isAlive"] = o.IsAlive - } - if !isNil(o.IsTrusted) { - toSerialize["isTrusted"] = o.IsTrusted - } - if !isNil(o.NetId) { - toSerialize["netId"] = o.NetId - } - if !isNil(o.NumUsers) { - toSerialize["numUsers"] = o.NumUsers - } - if !isNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o PeeringNodeStatusResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["isAlive"] = o.IsAlive + toSerialize["isTrusted"] = o.IsTrusted + toSerialize["netId"] = o.NetId + toSerialize["numUsers"] = o.NumUsers + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + type NullablePeeringNodeStatusResponse struct { value *PeeringNodeStatusResponse isSet bool diff --git a/client/model_peering_trust_request.go b/clients/apiclient/model_peering_trust_request.go similarity index 64% rename from client/model_peering_trust_request.go rename to clients/apiclient/model_peering_trust_request.go index 7573739aab..5a1c229bcc 100644 --- a/client/model_peering_trust_request.go +++ b/clients/apiclient/model_peering_trust_request.go @@ -3,31 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the PeeringTrustRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PeeringTrustRequest{} + // PeeringTrustRequest struct for PeeringTrustRequest type PeeringTrustRequest struct { // The NetID of the peer - NetId *string `json:"netId,omitempty"` + NetId string `json:"netId"` // The peers public key encoded in Hex - PublicKey *string `json:"publicKey,omitempty"` + PublicKey string `json:"publicKey"` } // NewPeeringTrustRequest instantiates a new PeeringTrustRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPeeringTrustRequest() *PeeringTrustRequest { +func NewPeeringTrustRequest(netId string, publicKey string) *PeeringTrustRequest { this := PeeringTrustRequest{} + this.NetId = netId + this.PublicKey = publicKey return &this } @@ -39,81 +44,69 @@ func NewPeeringTrustRequestWithDefaults() *PeeringTrustRequest { return &this } -// GetNetId returns the NetId field value if set, zero value otherwise. +// GetNetId returns the NetId field value func (o *PeeringTrustRequest) GetNetId() string { - if o == nil || isNil(o.NetId) { + if o == nil { var ret string return ret } - return *o.NetId + + return o.NetId } -// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// GetNetIdOk returns a tuple with the NetId field value // and a boolean to check if the value has been set. func (o *PeeringTrustRequest) GetNetIdOk() (*string, bool) { - if o == nil || isNil(o.NetId) { - return nil, false - } - return o.NetId, true -} - -// HasNetId returns a boolean if a field has been set. -func (o *PeeringTrustRequest) HasNetId() bool { - if o != nil && !isNil(o.NetId) { - return true + if o == nil { + return nil, false } - - return false + return &o.NetId, true } -// SetNetId gets a reference to the given string and assigns it to the NetId field. +// SetNetId sets field value func (o *PeeringTrustRequest) SetNetId(v string) { - o.NetId = &v + o.NetId = v } -// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +// GetPublicKey returns the PublicKey field value func (o *PeeringTrustRequest) GetPublicKey() string { - if o == nil || isNil(o.PublicKey) { + if o == nil { var ret string return ret } - return *o.PublicKey + + return o.PublicKey } -// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. func (o *PeeringTrustRequest) GetPublicKeyOk() (*string, bool) { - if o == nil || isNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true -} - -// HasPublicKey returns a boolean if a field has been set. -func (o *PeeringTrustRequest) HasPublicKey() bool { - if o != nil && !isNil(o.PublicKey) { - return true + if o == nil { + return nil, false } - - return false + return &o.PublicKey, true } -// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +// SetPublicKey sets field value func (o *PeeringTrustRequest) SetPublicKey(v string) { - o.PublicKey = &v + o.PublicKey = v } func (o PeeringTrustRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.NetId) { - toSerialize["netId"] = o.NetId - } - if !isNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o PeeringTrustRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["netId"] = o.NetId + toSerialize["publicKey"] = o.PublicKey + return toSerialize, nil +} + type NullablePeeringTrustRequest struct { value *PeeringTrustRequest isSet bool diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go new file mode 100644 index 0000000000..6e607437a9 --- /dev/null +++ b/clients/apiclient/model_protocol_parameters.go @@ -0,0 +1,285 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ProtocolParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProtocolParameters{} + +// ProtocolParameters struct for ProtocolParameters +type ProtocolParameters struct { + // The human readable network prefix + Bech32Hrp string `json:"bech32Hrp"` + // The networks max depth + BelowMaxDepth uint32 `json:"belowMaxDepth"` + // The minimal PoW score + MinPowScore uint32 `json:"minPowScore"` + // The network name + NetworkName string `json:"networkName"` + RentStructure RentStructure `json:"rentStructure"` + // The token supply + TokenSupply string `json:"tokenSupply"` + // The protocol version + Version int32 `json:"version"` +} + +// NewProtocolParameters instantiates a new ProtocolParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version int32) *ProtocolParameters { + this := ProtocolParameters{} + this.Bech32Hrp = bech32Hrp + this.BelowMaxDepth = belowMaxDepth + this.MinPowScore = minPowScore + this.NetworkName = networkName + this.RentStructure = rentStructure + this.TokenSupply = tokenSupply + this.Version = version + return &this +} + +// NewProtocolParametersWithDefaults instantiates a new ProtocolParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtocolParametersWithDefaults() *ProtocolParameters { + this := ProtocolParameters{} + return &this +} + +// GetBech32Hrp returns the Bech32Hrp field value +func (o *ProtocolParameters) GetBech32Hrp() string { + if o == nil { + var ret string + return ret + } + + return o.Bech32Hrp +} + +// GetBech32HrpOk returns a tuple with the Bech32Hrp field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetBech32HrpOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bech32Hrp, true +} + +// SetBech32Hrp sets field value +func (o *ProtocolParameters) SetBech32Hrp(v string) { + o.Bech32Hrp = v +} + +// GetBelowMaxDepth returns the BelowMaxDepth field value +func (o *ProtocolParameters) GetBelowMaxDepth() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.BelowMaxDepth +} + +// GetBelowMaxDepthOk returns a tuple with the BelowMaxDepth field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetBelowMaxDepthOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.BelowMaxDepth, true +} + +// SetBelowMaxDepth sets field value +func (o *ProtocolParameters) SetBelowMaxDepth(v uint32) { + o.BelowMaxDepth = v +} + +// GetMinPowScore returns the MinPowScore field value +func (o *ProtocolParameters) GetMinPowScore() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.MinPowScore +} + +// GetMinPowScoreOk returns a tuple with the MinPowScore field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetMinPowScoreOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.MinPowScore, true +} + +// SetMinPowScore sets field value +func (o *ProtocolParameters) SetMinPowScore(v uint32) { + o.MinPowScore = v +} + +// GetNetworkName returns the NetworkName field value +func (o *ProtocolParameters) GetNetworkName() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkName +} + +// GetNetworkNameOk returns a tuple with the NetworkName field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetNetworkNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkName, true +} + +// SetNetworkName sets field value +func (o *ProtocolParameters) SetNetworkName(v string) { + o.NetworkName = v +} + +// GetRentStructure returns the RentStructure field value +func (o *ProtocolParameters) GetRentStructure() RentStructure { + if o == nil { + var ret RentStructure + return ret + } + + return o.RentStructure +} + +// GetRentStructureOk returns a tuple with the RentStructure field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetRentStructureOk() (*RentStructure, bool) { + if o == nil { + return nil, false + } + return &o.RentStructure, true +} + +// SetRentStructure sets field value +func (o *ProtocolParameters) SetRentStructure(v RentStructure) { + o.RentStructure = v +} + +// GetTokenSupply returns the TokenSupply field value +func (o *ProtocolParameters) GetTokenSupply() string { + if o == nil { + var ret string + return ret + } + + return o.TokenSupply +} + +// GetTokenSupplyOk returns a tuple with the TokenSupply field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetTokenSupplyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenSupply, true +} + +// SetTokenSupply sets field value +func (o *ProtocolParameters) SetTokenSupply(v string) { + o.TokenSupply = v +} + +// GetVersion returns the Version field value +func (o *ProtocolParameters) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ProtocolParameters) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ProtocolParameters) SetVersion(v int32) { + o.Version = v +} + +func (o ProtocolParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProtocolParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bech32Hrp"] = o.Bech32Hrp + toSerialize["belowMaxDepth"] = o.BelowMaxDepth + toSerialize["minPowScore"] = o.MinPowScore + toSerialize["networkName"] = o.NetworkName + toSerialize["rentStructure"] = o.RentStructure + toSerialize["tokenSupply"] = o.TokenSupply + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableProtocolParameters struct { + value *ProtocolParameters + isSet bool +} + +func (v NullableProtocolParameters) Get() *ProtocolParameters { + return v.value +} + +func (v *NullableProtocolParameters) Set(val *ProtocolParameters) { + v.value = val + v.isSet = true +} + +func (v NullableProtocolParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocolParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocolParameters(val *ProtocolParameters) *NullableProtocolParameters { + return &NullableProtocolParameters{value: val, isSet: true} +} + +func (v NullableProtocolParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocolParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go new file mode 100644 index 0000000000..4de2863860 --- /dev/null +++ b/clients/apiclient/model_receipt_error.go @@ -0,0 +1,252 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ReceiptError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReceiptError{} + +// ReceiptError struct for ReceiptError +type ReceiptError struct { + ContractId int32 `json:"contractId"` + ErrorCode string `json:"errorCode"` + ErrorId uint32 `json:"errorId"` + Message string `json:"message"` + MessageFormat string `json:"messageFormat"` + Parameters []string `json:"parameters"` +} + +// NewReceiptError instantiates a new ReceiptError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { + this := ReceiptError{} + this.ContractId = contractId + this.ErrorCode = errorCode + this.ErrorId = errorId + this.Message = message + this.MessageFormat = messageFormat + this.Parameters = parameters + return &this +} + +// NewReceiptErrorWithDefaults instantiates a new ReceiptError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReceiptErrorWithDefaults() *ReceiptError { + this := ReceiptError{} + return &this +} + +// GetContractId returns the ContractId field value +func (o *ReceiptError) GetContractId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ContractId +} + +// GetContractIdOk returns a tuple with the ContractId field value +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetContractIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ContractId, true +} + +// SetContractId sets field value +func (o *ReceiptError) SetContractId(v int32) { + o.ContractId = v +} + +// GetErrorCode returns the ErrorCode field value +func (o *ReceiptError) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *ReceiptError) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetErrorId returns the ErrorId field value +func (o *ReceiptError) GetErrorId() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.ErrorId +} + +// GetErrorIdOk returns a tuple with the ErrorId field value +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetErrorIdOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.ErrorId, true +} + +// SetErrorId sets field value +func (o *ReceiptError) SetErrorId(v uint32) { + o.ErrorId = v +} + +// GetMessage returns the Message field value +func (o *ReceiptError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ReceiptError) SetMessage(v string) { + o.Message = v +} + +// GetMessageFormat returns the MessageFormat field value +func (o *ReceiptError) GetMessageFormat() string { + if o == nil { + var ret string + return ret + } + + return o.MessageFormat +} + +// GetMessageFormatOk returns a tuple with the MessageFormat field value +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetMessageFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MessageFormat, true +} + +// SetMessageFormat sets field value +func (o *ReceiptError) SetMessageFormat(v string) { + o.MessageFormat = v +} + +// GetParameters returns the Parameters field value +func (o *ReceiptError) GetParameters() []string { + if o == nil { + var ret []string + return ret + } + + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value +// and a boolean to check if the value has been set. +func (o *ReceiptError) GetParametersOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Parameters, true +} + +// SetParameters sets field value +func (o *ReceiptError) SetParameters(v []string) { + o.Parameters = v +} + +func (o ReceiptError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReceiptError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractId"] = o.ContractId + toSerialize["errorCode"] = o.ErrorCode + toSerialize["errorId"] = o.ErrorId + toSerialize["message"] = o.Message + toSerialize["messageFormat"] = o.MessageFormat + toSerialize["parameters"] = o.Parameters + return toSerialize, nil +} + +type NullableReceiptError struct { + value *ReceiptError + isSet bool +} + +func (v NullableReceiptError) Get() *ReceiptError { + return v.value +} + +func (v *NullableReceiptError) Set(val *ReceiptError) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptError) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptError(val *ReceiptError) *NullableReceiptError { + return &NullableReceiptError{value: val, isSet: true} +} + +func (v NullableReceiptError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_receipt_response.go b/clients/apiclient/model_receipt_response.go new file mode 100644 index 0000000000..27734b3c5b --- /dev/null +++ b/clients/apiclient/model_receipt_response.go @@ -0,0 +1,315 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ReceiptResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReceiptResponse{} + +// ReceiptResponse struct for ReceiptResponse +type ReceiptResponse struct { + BlockIndex uint32 `json:"blockIndex"` + Error *ReceiptError `json:"error,omitempty"` + GasBudget int64 `json:"gasBudget"` + GasBurnLog []BurnRecord `json:"gasBurnLog"` + GasBurned int64 `json:"gasBurned"` + GasFeeCharged int64 `json:"gasFeeCharged"` + Request string `json:"request"` + RequestIndex uint32 `json:"requestIndex"` +} + +// NewReceiptResponse instantiates a new ReceiptResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog []BurnRecord, gasBurned int64, gasFeeCharged int64, request string, requestIndex uint32) *ReceiptResponse { + this := ReceiptResponse{} + this.BlockIndex = blockIndex + this.GasBudget = gasBudget + this.GasBurnLog = gasBurnLog + this.GasBurned = gasBurned + this.GasFeeCharged = gasFeeCharged + this.Request = request + this.RequestIndex = requestIndex + return &this +} + +// NewReceiptResponseWithDefaults instantiates a new ReceiptResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReceiptResponseWithDefaults() *ReceiptResponse { + this := ReceiptResponse{} + return &this +} + +// GetBlockIndex returns the BlockIndex field value +func (o *ReceiptResponse) GetBlockIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.BlockIndex +} + +// GetBlockIndexOk returns a tuple with the BlockIndex field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetBlockIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.BlockIndex, true +} + +// SetBlockIndex sets field value +func (o *ReceiptResponse) SetBlockIndex(v uint32) { + o.BlockIndex = v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ReceiptResponse) GetError() ReceiptError { + if o == nil || isNil(o.Error) { + var ret ReceiptError + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetErrorOk() (*ReceiptError, bool) { + if o == nil || isNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ReceiptResponse) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given ReceiptError and assigns it to the Error field. +func (o *ReceiptResponse) SetError(v ReceiptError) { + o.Error = &v +} + +// GetGasBudget returns the GasBudget field value +func (o *ReceiptResponse) GetGasBudget() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasBudget +} + +// GetGasBudgetOk returns a tuple with the GasBudget field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasBudget, true +} + +// SetGasBudget sets field value +func (o *ReceiptResponse) SetGasBudget(v int64) { + o.GasBudget = v +} + +// GetGasBurnLog returns the GasBurnLog field value +func (o *ReceiptResponse) GetGasBurnLog() []BurnRecord { + if o == nil { + var ret []BurnRecord + return ret + } + + return o.GasBurnLog +} + +// GetGasBurnLogOk returns a tuple with the GasBurnLog field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasBurnLogOk() ([]BurnRecord, bool) { + if o == nil { + return nil, false + } + return o.GasBurnLog, true +} + +// SetGasBurnLog sets field value +func (o *ReceiptResponse) SetGasBurnLog(v []BurnRecord) { + o.GasBurnLog = v +} + +// GetGasBurned returns the GasBurned field value +func (o *ReceiptResponse) GetGasBurned() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasBurned, true +} + +// SetGasBurned sets field value +func (o *ReceiptResponse) SetGasBurned(v int64) { + o.GasBurned = v +} + +// GetGasFeeCharged returns the GasFeeCharged field value +func (o *ReceiptResponse) GetGasFeeCharged() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasFeeCharged +} + +// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasFeeCharged, true +} + +// SetGasFeeCharged sets field value +func (o *ReceiptResponse) SetGasFeeCharged(v int64) { + o.GasFeeCharged = v +} + +// GetRequest returns the Request field value +func (o *ReceiptResponse) GetRequest() string { + if o == nil { + var ret string + return ret + } + + return o.Request +} + +// GetRequestOk returns a tuple with the Request field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Request, true +} + +// SetRequest sets field value +func (o *ReceiptResponse) SetRequest(v string) { + o.Request = v +} + +// GetRequestIndex returns the RequestIndex field value +func (o *ReceiptResponse) GetRequestIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.RequestIndex +} + +// GetRequestIndexOk returns a tuple with the RequestIndex field value +// and a boolean to check if the value has been set. +func (o *ReceiptResponse) GetRequestIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.RequestIndex, true +} + +// SetRequestIndex sets field value +func (o *ReceiptResponse) SetRequestIndex(v uint32) { + o.RequestIndex = v +} + +func (o ReceiptResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReceiptResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockIndex"] = o.BlockIndex + if !isNil(o.Error) { + toSerialize["error"] = o.Error + } + toSerialize["gasBudget"] = o.GasBudget + toSerialize["gasBurnLog"] = o.GasBurnLog + toSerialize["gasBurned"] = o.GasBurned + toSerialize["gasFeeCharged"] = o.GasFeeCharged + toSerialize["request"] = o.Request + toSerialize["requestIndex"] = o.RequestIndex + return toSerialize, nil +} + +type NullableReceiptResponse struct { + value *ReceiptResponse + isSet bool +} + +func (v NullableReceiptResponse) Get() *ReceiptResponse { + return v.value +} + +func (v *NullableReceiptResponse) Set(val *ReceiptResponse) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptResponse(val *ReceiptResponse) *NullableReceiptResponse { + return &NullableReceiptResponse{value: val, isSet: true} +} + +func (v NullableReceiptResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_rent_structure.go b/clients/apiclient/model_rent_structure.go similarity index 52% rename from client/model_rent_structure.go rename to clients/apiclient/model_rent_structure.go index edc21a2413..154e9db53a 100644 --- a/client/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -3,33 +3,39 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the RentStructure type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RentStructure{} + // RentStructure struct for RentStructure type RentStructure struct { // The virtual byte cost - VByteCost *int32 `json:"vByteCost,omitempty"` + VByteCost uint32 `json:"vByteCost"` // The virtual byte factor for data fields - VByteFactorData *int32 `json:"vByteFactorData,omitempty"` + VByteFactorData int32 `json:"vByteFactorData"` // The virtual byte factor for key/lookup generating fields - VByteFactorKey *int32 `json:"vByteFactorKey,omitempty"` + VByteFactorKey int32 `json:"vByteFactorKey"` } // NewRentStructure instantiates a new RentStructure object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRentStructure() *RentStructure { +func NewRentStructure(vByteCost uint32, vByteFactorData int32, vByteFactorKey int32) *RentStructure { this := RentStructure{} + this.VByteCost = vByteCost + this.VByteFactorData = vByteFactorData + this.VByteFactorKey = vByteFactorKey return &this } @@ -41,116 +47,94 @@ func NewRentStructureWithDefaults() *RentStructure { return &this } -// GetVByteCost returns the VByteCost field value if set, zero value otherwise. -func (o *RentStructure) GetVByteCost() int32 { - if o == nil || isNil(o.VByteCost) { - var ret int32 +// GetVByteCost returns the VByteCost field value +func (o *RentStructure) GetVByteCost() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.VByteCost -} -// GetVByteCostOk returns a tuple with the VByteCost field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RentStructure) GetVByteCostOk() (*int32, bool) { - if o == nil || isNil(o.VByteCost) { - return nil, false - } - return o.VByteCost, true + return o.VByteCost } -// HasVByteCost returns a boolean if a field has been set. -func (o *RentStructure) HasVByteCost() bool { - if o != nil && !isNil(o.VByteCost) { - return true +// GetVByteCostOk returns a tuple with the VByteCost field value +// and a boolean to check if the value has been set. +func (o *RentStructure) GetVByteCostOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.VByteCost, true } -// SetVByteCost gets a reference to the given int32 and assigns it to the VByteCost field. -func (o *RentStructure) SetVByteCost(v int32) { - o.VByteCost = &v +// SetVByteCost sets field value +func (o *RentStructure) SetVByteCost(v uint32) { + o.VByteCost = v } -// GetVByteFactorData returns the VByteFactorData field value if set, zero value otherwise. +// GetVByteFactorData returns the VByteFactorData field value func (o *RentStructure) GetVByteFactorData() int32 { - if o == nil || isNil(o.VByteFactorData) { + if o == nil { var ret int32 return ret } - return *o.VByteFactorData + + return o.VByteFactorData } -// GetVByteFactorDataOk returns a tuple with the VByteFactorData field value if set, nil otherwise +// GetVByteFactorDataOk returns a tuple with the VByteFactorData field value // and a boolean to check if the value has been set. func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool) { - if o == nil || isNil(o.VByteFactorData) { - return nil, false - } - return o.VByteFactorData, true -} - -// HasVByteFactorData returns a boolean if a field has been set. -func (o *RentStructure) HasVByteFactorData() bool { - if o != nil && !isNil(o.VByteFactorData) { - return true + if o == nil { + return nil, false } - - return false + return &o.VByteFactorData, true } -// SetVByteFactorData gets a reference to the given int32 and assigns it to the VByteFactorData field. +// SetVByteFactorData sets field value func (o *RentStructure) SetVByteFactorData(v int32) { - o.VByteFactorData = &v + o.VByteFactorData = v } -// GetVByteFactorKey returns the VByteFactorKey field value if set, zero value otherwise. +// GetVByteFactorKey returns the VByteFactorKey field value func (o *RentStructure) GetVByteFactorKey() int32 { - if o == nil || isNil(o.VByteFactorKey) { + if o == nil { var ret int32 return ret } - return *o.VByteFactorKey + + return o.VByteFactorKey } -// GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field value if set, nil otherwise +// GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field value // and a boolean to check if the value has been set. func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool) { - if o == nil || isNil(o.VByteFactorKey) { - return nil, false - } - return o.VByteFactorKey, true -} - -// HasVByteFactorKey returns a boolean if a field has been set. -func (o *RentStructure) HasVByteFactorKey() bool { - if o != nil && !isNil(o.VByteFactorKey) { - return true + if o == nil { + return nil, false } - - return false + return &o.VByteFactorKey, true } -// SetVByteFactorKey gets a reference to the given int32 and assigns it to the VByteFactorKey field. +// SetVByteFactorKey sets field value func (o *RentStructure) SetVByteFactorKey(v int32) { - o.VByteFactorKey = &v + o.VByteFactorKey = v } func (o RentStructure) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.VByteCost) { - toSerialize["vByteCost"] = o.VByteCost - } - if !isNil(o.VByteFactorData) { - toSerialize["vByteFactorData"] = o.VByteFactorData - } - if !isNil(o.VByteFactorKey) { - toSerialize["vByteFactorKey"] = o.VByteFactorKey + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o RentStructure) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["vByteCost"] = o.VByteCost + toSerialize["vByteFactorData"] = o.VByteFactorData + toSerialize["vByteFactorKey"] = o.VByteFactorKey + return toSerialize, nil +} + type NullableRentStructure struct { value *RentStructure isSet bool diff --git a/clients/apiclient/model_request_detail.go b/clients/apiclient/model_request_detail.go new file mode 100644 index 0000000000..9b728cd2f1 --- /dev/null +++ b/clients/apiclient/model_request_detail.go @@ -0,0 +1,387 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the RequestDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestDetail{} + +// RequestDetail struct for RequestDetail +type RequestDetail struct { + Allowance Allowance `json:"allowance"` + CallTarget CallTarget `json:"callTarget"` + FungibleTokens FungibleTokens `json:"fungibleTokens"` + GasGudget int64 `json:"gasGudget"` + IsEVM bool `json:"isEVM"` + IsOffLedger bool `json:"isOffLedger"` + Nft NFTDataResponse `json:"nft"` + Params JSONDict `json:"params"` + RequestId string `json:"requestId"` + SenderAccount string `json:"senderAccount"` + TargetAddress string `json:"targetAddress"` +} + +// NewRequestDetail instantiates a new RequestDetail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestDetail(allowance Allowance, callTarget CallTarget, fungibleTokens FungibleTokens, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string) *RequestDetail { + this := RequestDetail{} + this.Allowance = allowance + this.CallTarget = callTarget + this.FungibleTokens = fungibleTokens + this.GasGudget = gasGudget + this.IsEVM = isEVM + this.IsOffLedger = isOffLedger + this.Nft = nft + this.Params = params + this.RequestId = requestId + this.SenderAccount = senderAccount + this.TargetAddress = targetAddress + return &this +} + +// NewRequestDetailWithDefaults instantiates a new RequestDetail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestDetailWithDefaults() *RequestDetail { + this := RequestDetail{} + return &this +} + +// GetAllowance returns the Allowance field value +func (o *RequestDetail) GetAllowance() Allowance { + if o == nil { + var ret Allowance + return ret + } + + return o.Allowance +} + +// GetAllowanceOk returns a tuple with the Allowance field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool) { + if o == nil { + return nil, false + } + return &o.Allowance, true +} + +// SetAllowance sets field value +func (o *RequestDetail) SetAllowance(v Allowance) { + o.Allowance = v +} + +// GetCallTarget returns the CallTarget field value +func (o *RequestDetail) GetCallTarget() CallTarget { + if o == nil { + var ret CallTarget + return ret + } + + return o.CallTarget +} + +// GetCallTargetOk returns a tuple with the CallTarget field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetCallTargetOk() (*CallTarget, bool) { + if o == nil { + return nil, false + } + return &o.CallTarget, true +} + +// SetCallTarget sets field value +func (o *RequestDetail) SetCallTarget(v CallTarget) { + o.CallTarget = v +} + +// GetFungibleTokens returns the FungibleTokens field value +func (o *RequestDetail) GetFungibleTokens() FungibleTokens { + if o == nil { + var ret FungibleTokens + return ret + } + + return o.FungibleTokens +} + +// GetFungibleTokensOk returns a tuple with the FungibleTokens field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool) { + if o == nil { + return nil, false + } + return &o.FungibleTokens, true +} + +// SetFungibleTokens sets field value +func (o *RequestDetail) SetFungibleTokens(v FungibleTokens) { + o.FungibleTokens = v +} + +// GetGasGudget returns the GasGudget field value +func (o *RequestDetail) GetGasGudget() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasGudget +} + +// GetGasGudgetOk returns a tuple with the GasGudget field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetGasGudgetOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasGudget, true +} + +// SetGasGudget sets field value +func (o *RequestDetail) SetGasGudget(v int64) { + o.GasGudget = v +} + +// GetIsEVM returns the IsEVM field value +func (o *RequestDetail) GetIsEVM() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsEVM +} + +// GetIsEVMOk returns a tuple with the IsEVM field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetIsEVMOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsEVM, true +} + +// SetIsEVM sets field value +func (o *RequestDetail) SetIsEVM(v bool) { + o.IsEVM = v +} + +// GetIsOffLedger returns the IsOffLedger field value +func (o *RequestDetail) GetIsOffLedger() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsOffLedger +} + +// GetIsOffLedgerOk returns a tuple with the IsOffLedger field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetIsOffLedgerOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsOffLedger, true +} + +// SetIsOffLedger sets field value +func (o *RequestDetail) SetIsOffLedger(v bool) { + o.IsOffLedger = v +} + +// GetNft returns the Nft field value +func (o *RequestDetail) GetNft() NFTDataResponse { + if o == nil { + var ret NFTDataResponse + return ret + } + + return o.Nft +} + +// GetNftOk returns a tuple with the Nft field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetNftOk() (*NFTDataResponse, bool) { + if o == nil { + return nil, false + } + return &o.Nft, true +} + +// SetNft sets field value +func (o *RequestDetail) SetNft(v NFTDataResponse) { + o.Nft = v +} + +// GetParams returns the Params field value +func (o *RequestDetail) GetParams() JSONDict { + if o == nil { + var ret JSONDict + return ret + } + + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetParamsOk() (*JSONDict, bool) { + if o == nil { + return nil, false + } + return &o.Params, true +} + +// SetParams sets field value +func (o *RequestDetail) SetParams(v JSONDict) { + o.Params = v +} + +// GetRequestId returns the RequestId field value +func (o *RequestDetail) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *RequestDetail) SetRequestId(v string) { + o.RequestId = v +} + +// GetSenderAccount returns the SenderAccount field value +func (o *RequestDetail) GetSenderAccount() string { + if o == nil { + var ret string + return ret + } + + return o.SenderAccount +} + +// GetSenderAccountOk returns a tuple with the SenderAccount field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetSenderAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SenderAccount, true +} + +// SetSenderAccount sets field value +func (o *RequestDetail) SetSenderAccount(v string) { + o.SenderAccount = v +} + +// GetTargetAddress returns the TargetAddress field value +func (o *RequestDetail) GetTargetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.TargetAddress +} + +// GetTargetAddressOk returns a tuple with the TargetAddress field value +// and a boolean to check if the value has been set. +func (o *RequestDetail) GetTargetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TargetAddress, true +} + +// SetTargetAddress sets field value +func (o *RequestDetail) SetTargetAddress(v string) { + o.TargetAddress = v +} + +func (o RequestDetail) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["allowance"] = o.Allowance + toSerialize["callTarget"] = o.CallTarget + toSerialize["fungibleTokens"] = o.FungibleTokens + toSerialize["gasGudget"] = o.GasGudget + toSerialize["isEVM"] = o.IsEVM + toSerialize["isOffLedger"] = o.IsOffLedger + toSerialize["nft"] = o.Nft + toSerialize["params"] = o.Params + toSerialize["requestId"] = o.RequestId + toSerialize["senderAccount"] = o.SenderAccount + toSerialize["targetAddress"] = o.TargetAddress + return toSerialize, nil +} + +type NullableRequestDetail struct { + value *RequestDetail + isSet bool +} + +func (v NullableRequestDetail) Get() *RequestDetail { + return v.value +} + +func (v *NullableRequestDetail) Set(val *RequestDetail) { + v.value = val + v.isSet = true +} + +func (v NullableRequestDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestDetail(val *RequestDetail) *NullableRequestDetail { + return &NullableRequestDetail{value: val, isSet: true} +} + +func (v NullableRequestDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_request_ids_response.go b/clients/apiclient/model_request_ids_response.go similarity index 76% rename from client/model_request_ids_response.go rename to clients/apiclient/model_request_ids_response.go index fbafa774ae..e5ae935999 100644 --- a/client/model_request_ids_response.go +++ b/clients/apiclient/model_request_ids_response.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the RequestIDsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestIDsResponse{} + // RequestIDsResponse struct for RequestIDsResponse type RequestIDsResponse struct { - RequestIds []string `json:"requestIds,omitempty"` + RequestIds []string `json:"requestIds"` } // NewRequestIDsResponse instantiates a new RequestIDsResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRequestIDsResponse() *RequestIDsResponse { +func NewRequestIDsResponse(requestIds []string) *RequestIDsResponse { this := RequestIDsResponse{} + this.RequestIds = requestIds return &this } @@ -36,46 +40,44 @@ func NewRequestIDsResponseWithDefaults() *RequestIDsResponse { return &this } -// GetRequestIds returns the RequestIds field value if set, zero value otherwise. +// GetRequestIds returns the RequestIds field value func (o *RequestIDsResponse) GetRequestIds() []string { - if o == nil || isNil(o.RequestIds) { + if o == nil { var ret []string return ret } + return o.RequestIds } -// GetRequestIdsOk returns a tuple with the RequestIds field value if set, nil otherwise +// GetRequestIdsOk returns a tuple with the RequestIds field value // and a boolean to check if the value has been set. func (o *RequestIDsResponse) GetRequestIdsOk() ([]string, bool) { - if o == nil || isNil(o.RequestIds) { - return nil, false + if o == nil { + return nil, false } return o.RequestIds, true } -// HasRequestIds returns a boolean if a field has been set. -func (o *RequestIDsResponse) HasRequestIds() bool { - if o != nil && !isNil(o.RequestIds) { - return true - } - - return false -} - -// SetRequestIds gets a reference to the given []string and assigns it to the RequestIds field. +// SetRequestIds sets field value func (o *RequestIDsResponse) SetRequestIds(v []string) { o.RequestIds = v } func (o RequestIDsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.RequestIds) { - toSerialize["requestIds"] = o.RequestIds + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o RequestIDsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["requestIds"] = o.RequestIds + return toSerialize, nil +} + type NullableRequestIDsResponse struct { value *RequestIDsResponse isSet bool diff --git a/client/model_request_processed_response.go b/clients/apiclient/model_request_processed_response.go similarity index 58% rename from client/model_request_processed_response.go rename to clients/apiclient/model_request_processed_response.go index cd11b94dac..0a37932833 100644 --- a/client/model_request_processed_response.go +++ b/clients/apiclient/model_request_processed_response.go @@ -3,30 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the RequestProcessedResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestProcessedResponse{} + // RequestProcessedResponse struct for RequestProcessedResponse type RequestProcessedResponse struct { - ChainId *string `json:"chainId,omitempty"` - IsProcessed *bool `json:"isProcessed,omitempty"` - RequestId *string `json:"requestId,omitempty"` + ChainId string `json:"chainId"` + IsProcessed bool `json:"isProcessed"` + RequestId string `json:"requestId"` } // NewRequestProcessedResponse instantiates a new RequestProcessedResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRequestProcessedResponse() *RequestProcessedResponse { +func NewRequestProcessedResponse(chainId string, isProcessed bool, requestId string) *RequestProcessedResponse { this := RequestProcessedResponse{} + this.ChainId = chainId + this.IsProcessed = isProcessed + this.RequestId = requestId return &this } @@ -38,116 +44,94 @@ func NewRequestProcessedResponseWithDefaults() *RequestProcessedResponse { return &this } -// GetChainId returns the ChainId field value if set, zero value otherwise. +// GetChainId returns the ChainId field value func (o *RequestProcessedResponse) GetChainId() string { - if o == nil || isNil(o.ChainId) { + if o == nil { var ret string return ret } - return *o.ChainId + + return o.ChainId } -// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// GetChainIdOk returns a tuple with the ChainId field value // and a boolean to check if the value has been set. func (o *RequestProcessedResponse) GetChainIdOk() (*string, bool) { - if o == nil || isNil(o.ChainId) { - return nil, false - } - return o.ChainId, true -} - -// HasChainId returns a boolean if a field has been set. -func (o *RequestProcessedResponse) HasChainId() bool { - if o != nil && !isNil(o.ChainId) { - return true + if o == nil { + return nil, false } - - return false + return &o.ChainId, true } -// SetChainId gets a reference to the given string and assigns it to the ChainId field. +// SetChainId sets field value func (o *RequestProcessedResponse) SetChainId(v string) { - o.ChainId = &v + o.ChainId = v } -// GetIsProcessed returns the IsProcessed field value if set, zero value otherwise. +// GetIsProcessed returns the IsProcessed field value func (o *RequestProcessedResponse) GetIsProcessed() bool { - if o == nil || isNil(o.IsProcessed) { + if o == nil { var ret bool return ret } - return *o.IsProcessed + + return o.IsProcessed } -// GetIsProcessedOk returns a tuple with the IsProcessed field value if set, nil otherwise +// GetIsProcessedOk returns a tuple with the IsProcessed field value // and a boolean to check if the value has been set. func (o *RequestProcessedResponse) GetIsProcessedOk() (*bool, bool) { - if o == nil || isNil(o.IsProcessed) { - return nil, false + if o == nil { + return nil, false } - return o.IsProcessed, true -} - -// HasIsProcessed returns a boolean if a field has been set. -func (o *RequestProcessedResponse) HasIsProcessed() bool { - if o != nil && !isNil(o.IsProcessed) { - return true - } - - return false + return &o.IsProcessed, true } -// SetIsProcessed gets a reference to the given bool and assigns it to the IsProcessed field. +// SetIsProcessed sets field value func (o *RequestProcessedResponse) SetIsProcessed(v bool) { - o.IsProcessed = &v + o.IsProcessed = v } -// GetRequestId returns the RequestId field value if set, zero value otherwise. +// GetRequestId returns the RequestId field value func (o *RequestProcessedResponse) GetRequestId() string { - if o == nil || isNil(o.RequestId) { + if o == nil { var ret string return ret } - return *o.RequestId + + return o.RequestId } -// GetRequestIdOk returns a tuple with the RequestId field value if set, nil otherwise +// GetRequestIdOk returns a tuple with the RequestId field value // and a boolean to check if the value has been set. func (o *RequestProcessedResponse) GetRequestIdOk() (*string, bool) { - if o == nil || isNil(o.RequestId) { - return nil, false - } - return o.RequestId, true -} - -// HasRequestId returns a boolean if a field has been set. -func (o *RequestProcessedResponse) HasRequestId() bool { - if o != nil && !isNil(o.RequestId) { - return true + if o == nil { + return nil, false } - - return false + return &o.RequestId, true } -// SetRequestId gets a reference to the given string and assigns it to the RequestId field. +// SetRequestId sets field value func (o *RequestProcessedResponse) SetRequestId(v string) { - o.RequestId = &v + o.RequestId = v } func (o RequestProcessedResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.ChainId) { - toSerialize["chainId"] = o.ChainId - } - if !isNil(o.IsProcessed) { - toSerialize["isProcessed"] = o.IsProcessed - } - if !isNil(o.RequestId) { - toSerialize["requestId"] = o.RequestId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o RequestProcessedResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["chainId"] = o.ChainId + toSerialize["isProcessed"] = o.IsProcessed + toSerialize["requestId"] = o.RequestId + return toSerialize, nil +} + type NullableRequestProcessedResponse struct { value *RequestProcessedResponse isSet bool diff --git a/clients/apiclient/model_request_receipt_response.go b/clients/apiclient/model_request_receipt_response.go new file mode 100644 index 0000000000..db0835ab4b --- /dev/null +++ b/clients/apiclient/model_request_receipt_response.go @@ -0,0 +1,306 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the RequestReceiptResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestReceiptResponse{} + +// RequestReceiptResponse struct for RequestReceiptResponse +type RequestReceiptResponse struct { + BlockIndex uint32 `json:"blockIndex"` + Error BlockReceiptError `json:"error"` + GasBudget int64 `json:"gasBudget"` + GasBurnLog BurnLog `json:"gasBurnLog"` + GasBurned int64 `json:"gasBurned"` + GasFeeCharged int64 `json:"gasFeeCharged"` + Request RequestDetail `json:"request"` + RequestIndex uint32 `json:"requestIndex"` +} + +// NewRequestReceiptResponse instantiates a new RequestReceiptResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestReceiptResponse(blockIndex uint32, error_ BlockReceiptError, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32) *RequestReceiptResponse { + this := RequestReceiptResponse{} + this.BlockIndex = blockIndex + this.Error = error_ + this.GasBudget = gasBudget + this.GasBurnLog = gasBurnLog + this.GasBurned = gasBurned + this.GasFeeCharged = gasFeeCharged + this.Request = request + this.RequestIndex = requestIndex + return &this +} + +// NewRequestReceiptResponseWithDefaults instantiates a new RequestReceiptResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestReceiptResponseWithDefaults() *RequestReceiptResponse { + this := RequestReceiptResponse{} + return &this +} + +// GetBlockIndex returns the BlockIndex field value +func (o *RequestReceiptResponse) GetBlockIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.BlockIndex +} + +// GetBlockIndexOk returns a tuple with the BlockIndex field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetBlockIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.BlockIndex, true +} + +// SetBlockIndex sets field value +func (o *RequestReceiptResponse) SetBlockIndex(v uint32) { + o.BlockIndex = v +} + +// GetError returns the Error field value +func (o *RequestReceiptResponse) GetError() BlockReceiptError { + if o == nil { + var ret BlockReceiptError + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetErrorOk() (*BlockReceiptError, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *RequestReceiptResponse) SetError(v BlockReceiptError) { + o.Error = v +} + +// GetGasBudget returns the GasBudget field value +func (o *RequestReceiptResponse) GetGasBudget() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasBudget +} + +// GetGasBudgetOk returns a tuple with the GasBudget field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasBudget, true +} + +// SetGasBudget sets field value +func (o *RequestReceiptResponse) SetGasBudget(v int64) { + o.GasBudget = v +} + +// GetGasBurnLog returns the GasBurnLog field value +func (o *RequestReceiptResponse) GetGasBurnLog() BurnLog { + if o == nil { + var ret BurnLog + return ret + } + + return o.GasBurnLog +} + +// GetGasBurnLogOk returns a tuple with the GasBurnLog field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasBurnLogOk() (*BurnLog, bool) { + if o == nil { + return nil, false + } + return &o.GasBurnLog, true +} + +// SetGasBurnLog sets field value +func (o *RequestReceiptResponse) SetGasBurnLog(v BurnLog) { + o.GasBurnLog = v +} + +// GetGasBurned returns the GasBurned field value +func (o *RequestReceiptResponse) GetGasBurned() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasBurned +} + +// GetGasBurnedOk returns a tuple with the GasBurned field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasBurned, true +} + +// SetGasBurned sets field value +func (o *RequestReceiptResponse) SetGasBurned(v int64) { + o.GasBurned = v +} + +// GetGasFeeCharged returns the GasFeeCharged field value +func (o *RequestReceiptResponse) GetGasFeeCharged() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.GasFeeCharged +} + +// GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.GasFeeCharged, true +} + +// SetGasFeeCharged sets field value +func (o *RequestReceiptResponse) SetGasFeeCharged(v int64) { + o.GasFeeCharged = v +} + +// GetRequest returns the Request field value +func (o *RequestReceiptResponse) GetRequest() RequestDetail { + if o == nil { + var ret RequestDetail + return ret + } + + return o.Request +} + +// GetRequestOk returns a tuple with the Request field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetRequestOk() (*RequestDetail, bool) { + if o == nil { + return nil, false + } + return &o.Request, true +} + +// SetRequest sets field value +func (o *RequestReceiptResponse) SetRequest(v RequestDetail) { + o.Request = v +} + +// GetRequestIndex returns the RequestIndex field value +func (o *RequestReceiptResponse) GetRequestIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.RequestIndex +} + +// GetRequestIndexOk returns a tuple with the RequestIndex field value +// and a boolean to check if the value has been set. +func (o *RequestReceiptResponse) GetRequestIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.RequestIndex, true +} + +// SetRequestIndex sets field value +func (o *RequestReceiptResponse) SetRequestIndex(v uint32) { + o.RequestIndex = v +} + +func (o RequestReceiptResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestReceiptResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockIndex"] = o.BlockIndex + toSerialize["error"] = o.Error + toSerialize["gasBudget"] = o.GasBudget + toSerialize["gasBurnLog"] = o.GasBurnLog + toSerialize["gasBurned"] = o.GasBurned + toSerialize["gasFeeCharged"] = o.GasFeeCharged + toSerialize["request"] = o.Request + toSerialize["requestIndex"] = o.RequestIndex + return toSerialize, nil +} + +type NullableRequestReceiptResponse struct { + value *RequestReceiptResponse + isSet bool +} + +func (v NullableRequestReceiptResponse) Get() *RequestReceiptResponse { + return v.value +} + +func (v *NullableRequestReceiptResponse) Set(val *RequestReceiptResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestReceiptResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestReceiptResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestReceiptResponse(val *RequestReceiptResponse) *NullableRequestReceiptResponse { + return &NullableRequestReceiptResponse{value: val, isSet: true} +} + +func (v NullableRequestReceiptResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestReceiptResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_state_response.go b/clients/apiclient/model_state_response.go new file mode 100644 index 0000000000..7423649ba0 --- /dev/null +++ b/clients/apiclient/model_state_response.go @@ -0,0 +1,118 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.2-403-g907bc6c54 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the StateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StateResponse{} + +// StateResponse struct for StateResponse +type StateResponse struct { + // The state of the requested key (Hex-encoded) + State string `json:"state"` +} + +// NewStateResponse instantiates a new StateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStateResponse(state string) *StateResponse { + this := StateResponse{} + this.State = state + return &this +} + +// NewStateResponseWithDefaults instantiates a new StateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStateResponseWithDefaults() *StateResponse { + this := StateResponse{} + return &this +} + +// GetState returns the State field value +func (o *StateResponse) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *StateResponse) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *StateResponse) SetState(v string) { + o.State = v +} + +func (o StateResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["state"] = o.State + return toSerialize, nil +} + +type NullableStateResponse struct { + value *StateResponse + isSet bool +} + +func (v NullableStateResponse) Get() *StateResponse { + return v.value +} + +func (v *NullableStateResponse) Set(val *StateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableStateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableStateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStateResponse(val *StateResponse) *NullableStateResponse { + return &NullableStateResponse{value: val, isSet: true} +} + +func (v NullableStateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/client/model_transaction.go b/clients/apiclient/model_transaction.go similarity index 73% rename from client/model_transaction.go rename to clients/apiclient/model_transaction.go index ab13a31001..ec879410c1 100644 --- a/client/model_transaction.go +++ b/clients/apiclient/model_transaction.go @@ -3,29 +3,33 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the Transaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Transaction{} + // Transaction struct for Transaction type Transaction struct { // The transaction ID - TxId *string `json:"txId,omitempty"` + TxId string `json:"txId"` } // NewTransaction instantiates a new Transaction object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTransaction() *Transaction { +func NewTransaction(txId string) *Transaction { this := Transaction{} + this.TxId = txId return &this } @@ -37,46 +41,44 @@ func NewTransactionWithDefaults() *Transaction { return &this } -// GetTxId returns the TxId field value if set, zero value otherwise. +// GetTxId returns the TxId field value func (o *Transaction) GetTxId() string { - if o == nil || isNil(o.TxId) { + if o == nil { var ret string return ret } - return *o.TxId + + return o.TxId } -// GetTxIdOk returns a tuple with the TxId field value if set, nil otherwise +// GetTxIdOk returns a tuple with the TxId field value // and a boolean to check if the value has been set. func (o *Transaction) GetTxIdOk() (*string, bool) { - if o == nil || isNil(o.TxId) { - return nil, false - } - return o.TxId, true -} - -// HasTxId returns a boolean if a field has been set. -func (o *Transaction) HasTxId() bool { - if o != nil && !isNil(o.TxId) { - return true + if o == nil { + return nil, false } - - return false + return &o.TxId, true } -// SetTxId gets a reference to the given string and assigns it to the TxId field. +// SetTxId sets field value func (o *Transaction) SetTxId(v string) { - o.TxId = &v + o.TxId = v } func (o Transaction) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.TxId) { - toSerialize["txId"] = o.TxId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o Transaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["txId"] = o.TxId + return toSerialize, nil +} + type NullableTransaction struct { value *Transaction isSet bool diff --git a/client/model_transaction_id_metric_item.go b/clients/apiclient/model_transaction_id_metric_item.go similarity index 54% rename from client/model_transaction_id_metric_item.go rename to clients/apiclient/model_transaction_id_metric_item.go index e9a09f7ea3..76ac7084a1 100644 --- a/client/model_transaction_id_metric_item.go +++ b/clients/apiclient/model_transaction_id_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the TransactionIDMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionIDMetricItem{} + // TransactionIDMetricItem struct for TransactionIDMetricItem type TransactionIDMetricItem struct { - LastMessage *Transaction `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage Transaction `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewTransactionIDMetricItem instantiates a new TransactionIDMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTransactionIDMetricItem() *TransactionIDMetricItem { +func NewTransactionIDMetricItem(lastMessage Transaction, messages uint32, timestamp time.Time) *TransactionIDMetricItem { this := TransactionIDMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewTransactionIDMetricItemWithDefaults() *TransactionIDMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *TransactionIDMetricItem) GetLastMessage() Transaction { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret Transaction return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *TransactionIDMetricItem) GetLastMessageOk() (*Transaction, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *TransactionIDMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given Transaction and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *TransactionIDMetricItem) SetLastMessage(v Transaction) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *TransactionIDMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *TransactionIDMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransactionIDMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *TransactionIDMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *TransactionIDMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *TransactionIDMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *TransactionIDMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *TransactionIDMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *TransactionIDMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *TransactionIDMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *TransactionIDMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o TransactionIDMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o TransactionIDMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableTransactionIDMetricItem struct { value *TransactionIDMetricItem isSet bool diff --git a/client/model_transaction_metric_item.go b/clients/apiclient/model_transaction_metric_item.go similarity index 53% rename from client/model_transaction_metric_item.go rename to clients/apiclient/model_transaction_metric_item.go index 7e01b952b7..db9eb1179d 100644 --- a/client/model_transaction_metric_item.go +++ b/clients/apiclient/model_transaction_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the TransactionMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionMetricItem{} + // TransactionMetricItem struct for TransactionMetricItem type TransactionMetricItem struct { - LastMessage *Transaction `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage Transaction `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewTransactionMetricItem instantiates a new TransactionMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTransactionMetricItem() *TransactionMetricItem { +func NewTransactionMetricItem(lastMessage Transaction, messages uint32, timestamp time.Time) *TransactionMetricItem { this := TransactionMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewTransactionMetricItemWithDefaults() *TransactionMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *TransactionMetricItem) GetLastMessage() Transaction { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret Transaction return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *TransactionMetricItem) GetLastMessageOk() (*Transaction, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *TransactionMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given Transaction and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *TransactionMetricItem) SetLastMessage(v Transaction) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *TransactionMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *TransactionMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TransactionMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *TransactionMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *TransactionMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *TransactionMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *TransactionMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *TransactionMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *TransactionMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *TransactionMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *TransactionMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o TransactionMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o TransactionMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableTransactionMetricItem struct { value *TransactionMetricItem isSet bool diff --git a/client/model_tx_inclusion_state_msg.go b/clients/apiclient/model_tx_inclusion_state_msg.go similarity index 64% rename from client/model_tx_inclusion_state_msg.go rename to clients/apiclient/model_tx_inclusion_state_msg.go index 0465d6b25c..4e44627db2 100644 --- a/client/model_tx_inclusion_state_msg.go +++ b/clients/apiclient/model_tx_inclusion_state_msg.go @@ -3,31 +3,36 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the TxInclusionStateMsg type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TxInclusionStateMsg{} + // TxInclusionStateMsg struct for TxInclusionStateMsg type TxInclusionStateMsg struct { // The inclusion state - State *string `json:"state,omitempty"` + State string `json:"state"` // The transaction ID - TxId *string `json:"txId,omitempty"` + TxId string `json:"txId"` } // NewTxInclusionStateMsg instantiates a new TxInclusionStateMsg object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTxInclusionStateMsg() *TxInclusionStateMsg { +func NewTxInclusionStateMsg(state string, txId string) *TxInclusionStateMsg { this := TxInclusionStateMsg{} + this.State = state + this.TxId = txId return &this } @@ -39,81 +44,69 @@ func NewTxInclusionStateMsgWithDefaults() *TxInclusionStateMsg { return &this } -// GetState returns the State field value if set, zero value otherwise. +// GetState returns the State field value func (o *TxInclusionStateMsg) GetState() string { - if o == nil || isNil(o.State) { + if o == nil { var ret string return ret } - return *o.State + + return o.State } -// GetStateOk returns a tuple with the State field value if set, nil otherwise +// GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. func (o *TxInclusionStateMsg) GetStateOk() (*string, bool) { - if o == nil || isNil(o.State) { - return nil, false - } - return o.State, true -} - -// HasState returns a boolean if a field has been set. -func (o *TxInclusionStateMsg) HasState() bool { - if o != nil && !isNil(o.State) { - return true + if o == nil { + return nil, false } - - return false + return &o.State, true } -// SetState gets a reference to the given string and assigns it to the State field. +// SetState sets field value func (o *TxInclusionStateMsg) SetState(v string) { - o.State = &v + o.State = v } -// GetTxId returns the TxId field value if set, zero value otherwise. +// GetTxId returns the TxId field value func (o *TxInclusionStateMsg) GetTxId() string { - if o == nil || isNil(o.TxId) { + if o == nil { var ret string return ret } - return *o.TxId + + return o.TxId } -// GetTxIdOk returns a tuple with the TxId field value if set, nil otherwise +// GetTxIdOk returns a tuple with the TxId field value // and a boolean to check if the value has been set. func (o *TxInclusionStateMsg) GetTxIdOk() (*string, bool) { - if o == nil || isNil(o.TxId) { - return nil, false - } - return o.TxId, true -} - -// HasTxId returns a boolean if a field has been set. -func (o *TxInclusionStateMsg) HasTxId() bool { - if o != nil && !isNil(o.TxId) { - return true + if o == nil { + return nil, false } - - return false + return &o.TxId, true } -// SetTxId gets a reference to the given string and assigns it to the TxId field. +// SetTxId sets field value func (o *TxInclusionStateMsg) SetTxId(v string) { - o.TxId = &v + o.TxId = v } func (o TxInclusionStateMsg) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.State) { - toSerialize["state"] = o.State - } - if !isNil(o.TxId) { - toSerialize["txId"] = o.TxId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o TxInclusionStateMsg) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["state"] = o.State + toSerialize["txId"] = o.TxId + return toSerialize, nil +} + type NullableTxInclusionStateMsg struct { value *TxInclusionStateMsg isSet bool diff --git a/client/model_tx_inclusion_state_msg_metric_item.go b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go similarity index 55% rename from client/model_tx_inclusion_state_msg_metric_item.go rename to clients/apiclient/model_tx_inclusion_state_msg_metric_item.go index fbb9b70241..a47c3c20aa 100644 --- a/client/model_tx_inclusion_state_msg_metric_item.go +++ b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the TxInclusionStateMsgMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TxInclusionStateMsgMetricItem{} + // TxInclusionStateMsgMetricItem struct for TxInclusionStateMsgMetricItem type TxInclusionStateMsgMetricItem struct { - LastMessage *TxInclusionStateMsg `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage TxInclusionStateMsg `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewTxInclusionStateMsgMetricItem instantiates a new TxInclusionStateMsgMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTxInclusionStateMsgMetricItem() *TxInclusionStateMsgMetricItem { +func NewTxInclusionStateMsgMetricItem(lastMessage TxInclusionStateMsg, messages uint32, timestamp time.Time) *TxInclusionStateMsgMetricItem { this := TxInclusionStateMsgMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewTxInclusionStateMsgMetricItemWithDefaults() *TxInclusionStateMsgMetricIt return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *TxInclusionStateMsgMetricItem) GetLastMessage() TxInclusionStateMsg { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret TxInclusionStateMsg return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *TxInclusionStateMsgMetricItem) GetLastMessageOk() (*TxInclusionStateMsg, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *TxInclusionStateMsgMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given TxInclusionStateMsg and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *TxInclusionStateMsgMetricItem) SetLastMessage(v TxInclusionStateMsg) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *TxInclusionStateMsgMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *TxInclusionStateMsgMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TxInclusionStateMsgMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *TxInclusionStateMsgMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *TxInclusionStateMsgMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *TxInclusionStateMsgMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *TxInclusionStateMsgMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *TxInclusionStateMsgMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *TxInclusionStateMsgMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *TxInclusionStateMsgMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *TxInclusionStateMsgMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o TxInclusionStateMsgMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o TxInclusionStateMsgMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableTxInclusionStateMsgMetricItem struct { value *TxInclusionStateMsgMetricItem isSet bool diff --git a/client/model_update_user_password_request.go b/clients/apiclient/model_update_user_password_request.go similarity index 74% rename from client/model_update_user_password_request.go rename to clients/apiclient/model_update_user_password_request.go index 9bd4f5149c..bba1339102 100644 --- a/client/model_update_user_password_request.go +++ b/clients/apiclient/model_update_user_password_request.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the UpdateUserPasswordRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPasswordRequest{} + // UpdateUserPasswordRequest struct for UpdateUserPasswordRequest type UpdateUserPasswordRequest struct { - Password *string `json:"password,omitempty"` + Password string `json:"password"` } // NewUpdateUserPasswordRequest instantiates a new UpdateUserPasswordRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUpdateUserPasswordRequest() *UpdateUserPasswordRequest { +func NewUpdateUserPasswordRequest(password string) *UpdateUserPasswordRequest { this := UpdateUserPasswordRequest{} + this.Password = password return &this } @@ -36,46 +40,44 @@ func NewUpdateUserPasswordRequestWithDefaults() *UpdateUserPasswordRequest { return &this } -// GetPassword returns the Password field value if set, zero value otherwise. +// GetPassword returns the Password field value func (o *UpdateUserPasswordRequest) GetPassword() string { - if o == nil || isNil(o.Password) { + if o == nil { var ret string return ret } - return *o.Password + + return o.Password } -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. func (o *UpdateUserPasswordRequest) GetPasswordOk() (*string, bool) { - if o == nil || isNil(o.Password) { - return nil, false - } - return o.Password, true -} - -// HasPassword returns a boolean if a field has been set. -func (o *UpdateUserPasswordRequest) HasPassword() bool { - if o != nil && !isNil(o.Password) { - return true + if o == nil { + return nil, false } - - return false + return &o.Password, true } -// SetPassword gets a reference to the given string and assigns it to the Password field. +// SetPassword sets field value func (o *UpdateUserPasswordRequest) SetPassword(v string) { - o.Password = &v + o.Password = v } func (o UpdateUserPasswordRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Password) { - toSerialize["password"] = o.Password + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o UpdateUserPasswordRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + return toSerialize, nil +} + type NullableUpdateUserPasswordRequest struct { value *UpdateUserPasswordRequest isSet bool diff --git a/client/model_update_user_permissions_request.go b/clients/apiclient/model_update_user_permissions_request.go similarity index 77% rename from client/model_update_user_permissions_request.go rename to clients/apiclient/model_update_user_permissions_request.go index 2c0de446f6..89004604a3 100644 --- a/client/model_update_user_permissions_request.go +++ b/clients/apiclient/model_update_user_permissions_request.go @@ -3,28 +3,32 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the UpdateUserPermissionsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateUserPermissionsRequest{} + // UpdateUserPermissionsRequest struct for UpdateUserPermissionsRequest type UpdateUserPermissionsRequest struct { - Permissions []string `json:"permissions,omitempty"` + Permissions []string `json:"permissions"` } // NewUpdateUserPermissionsRequest instantiates a new UpdateUserPermissionsRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUpdateUserPermissionsRequest() *UpdateUserPermissionsRequest { +func NewUpdateUserPermissionsRequest(permissions []string) *UpdateUserPermissionsRequest { this := UpdateUserPermissionsRequest{} + this.Permissions = permissions return &this } @@ -36,46 +40,44 @@ func NewUpdateUserPermissionsRequestWithDefaults() *UpdateUserPermissionsRequest return &this } -// GetPermissions returns the Permissions field value if set, zero value otherwise. +// GetPermissions returns the Permissions field value func (o *UpdateUserPermissionsRequest) GetPermissions() []string { - if o == nil || isNil(o.Permissions) { + if o == nil { var ret []string return ret } + return o.Permissions } -// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. func (o *UpdateUserPermissionsRequest) GetPermissionsOk() ([]string, bool) { - if o == nil || isNil(o.Permissions) { - return nil, false + if o == nil { + return nil, false } return o.Permissions, true } -// HasPermissions returns a boolean if a field has been set. -func (o *UpdateUserPermissionsRequest) HasPermissions() bool { - if o != nil && !isNil(o.Permissions) { - return true - } - - return false -} - -// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +// SetPermissions sets field value func (o *UpdateUserPermissionsRequest) SetPermissions(v []string) { o.Permissions = v } func (o UpdateUserPermissionsRequest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Permissions) { - toSerialize["permissions"] = o.Permissions + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o UpdateUserPermissionsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["permissions"] = o.Permissions + return toSerialize, nil +} + type NullableUpdateUserPermissionsRequest struct { value *UpdateUserPermissionsRequest isSet bool diff --git a/client/model_user.go b/clients/apiclient/model_user.go similarity index 60% rename from client/model_user.go rename to clients/apiclient/model_user.go index 0b60ab662c..623d2dfd02 100644 --- a/client/model_user.go +++ b/clients/apiclient/model_user.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + // User struct for User type User struct { - Permissions []string `json:"permissions,omitempty"` - Username *string `json:"username,omitempty"` + Permissions []string `json:"permissions"` + Username string `json:"username"` } // NewUser instantiates a new User object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUser() *User { +func NewUser(permissions []string, username string) *User { this := User{} + this.Permissions = permissions + this.Username = username return &this } @@ -37,81 +42,69 @@ func NewUserWithDefaults() *User { return &this } -// GetPermissions returns the Permissions field value if set, zero value otherwise. +// GetPermissions returns the Permissions field value func (o *User) GetPermissions() []string { - if o == nil || isNil(o.Permissions) { + if o == nil { var ret []string return ret } + return o.Permissions } -// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// GetPermissionsOk returns a tuple with the Permissions field value // and a boolean to check if the value has been set. func (o *User) GetPermissionsOk() ([]string, bool) { - if o == nil || isNil(o.Permissions) { - return nil, false + if o == nil { + return nil, false } return o.Permissions, true } -// HasPermissions returns a boolean if a field has been set. -func (o *User) HasPermissions() bool { - if o != nil && !isNil(o.Permissions) { - return true - } - - return false -} - -// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +// SetPermissions sets field value func (o *User) SetPermissions(v []string) { o.Permissions = v } -// GetUsername returns the Username field value if set, zero value otherwise. +// GetUsername returns the Username field value func (o *User) GetUsername() string { - if o == nil || isNil(o.Username) { + if o == nil { var ret string return ret } - return *o.Username + + return o.Username } -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || isNil(o.Username) { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *User) HasUsername() bool { - if o != nil && !isNil(o.Username) { - return true + if o == nil { + return nil, false } - - return false + return &o.Username, true } -// SetUsername gets a reference to the given string and assigns it to the Username field. +// SetUsername sets field value func (o *User) SetUsername(v string) { - o.Username = &v + o.Username = v } func (o User) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Permissions) { - toSerialize["permissions"] = o.Permissions - } - if !isNil(o.Username) { - toSerialize["username"] = o.Username + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["permissions"] = o.Permissions + toSerialize["username"] = o.Username + return toSerialize, nil +} + type NullableUser struct { value *User isSet bool diff --git a/client/model_utxo_input_metric_item.go b/clients/apiclient/model_utxo_input_metric_item.go similarity index 53% rename from client/model_utxo_input_metric_item.go rename to clients/apiclient/model_utxo_input_metric_item.go index 3a6b043d81..97e5cd9506 100644 --- a/client/model_utxo_input_metric_item.go +++ b/clients/apiclient/model_utxo_input_metric_item.go @@ -3,31 +3,37 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" "time" ) +// checks if the UTXOInputMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UTXOInputMetricItem{} + // UTXOInputMetricItem struct for UTXOInputMetricItem type UTXOInputMetricItem struct { - LastMessage *OutputID `json:"lastMessage,omitempty"` - Messages *int32 `json:"messages,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty"` + LastMessage OutputID `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` } // NewUTXOInputMetricItem instantiates a new UTXOInputMetricItem object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUTXOInputMetricItem() *UTXOInputMetricItem { +func NewUTXOInputMetricItem(lastMessage OutputID, messages uint32, timestamp time.Time) *UTXOInputMetricItem { this := UTXOInputMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp return &this } @@ -39,116 +45,94 @@ func NewUTXOInputMetricItemWithDefaults() *UTXOInputMetricItem { return &this } -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +// GetLastMessage returns the LastMessage field value func (o *UTXOInputMetricItem) GetLastMessage() OutputID { - if o == nil || isNil(o.LastMessage) { + if o == nil { var ret OutputID return ret } - return *o.LastMessage + + return o.LastMessage } -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// GetLastMessageOk returns a tuple with the LastMessage field value // and a boolean to check if the value has been set. func (o *UTXOInputMetricItem) GetLastMessageOk() (*OutputID, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *UTXOInputMetricItem) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true + if o == nil { + return nil, false } - - return false + return &o.LastMessage, true } -// SetLastMessage gets a reference to the given OutputID and assigns it to the LastMessage field. +// SetLastMessage sets field value func (o *UTXOInputMetricItem) SetLastMessage(v OutputID) { - o.LastMessage = &v + o.LastMessage = v } -// GetMessages returns the Messages field value if set, zero value otherwise. -func (o *UTXOInputMetricItem) GetMessages() int32 { - if o == nil || isNil(o.Messages) { - var ret int32 +// GetMessages returns the Messages field value +func (o *UTXOInputMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 return ret } - return *o.Messages -} -// GetMessagesOk returns a tuple with the Messages field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UTXOInputMetricItem) GetMessagesOk() (*int32, bool) { - if o == nil || isNil(o.Messages) { - return nil, false - } - return o.Messages, true + return o.Messages } -// HasMessages returns a boolean if a field has been set. -func (o *UTXOInputMetricItem) HasMessages() bool { - if o != nil && !isNil(o.Messages) { - return true +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *UTXOInputMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false } - - return false + return &o.Messages, true } -// SetMessages gets a reference to the given int32 and assigns it to the Messages field. -func (o *UTXOInputMetricItem) SetMessages(v int32) { - o.Messages = &v +// SetMessages sets field value +func (o *UTXOInputMetricItem) SetMessages(v uint32) { + o.Messages = v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +// GetTimestamp returns the Timestamp field value func (o *UTXOInputMetricItem) GetTimestamp() time.Time { - if o == nil || isNil(o.Timestamp) { + if o == nil { var ret time.Time return ret } - return *o.Timestamp + + return o.Timestamp } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. func (o *UTXOInputMetricItem) GetTimestampOk() (*time.Time, bool) { - if o == nil || isNil(o.Timestamp) { - return nil, false - } - return o.Timestamp, true -} - -// HasTimestamp returns a boolean if a field has been set. -func (o *UTXOInputMetricItem) HasTimestamp() bool { - if o != nil && !isNil(o.Timestamp) { - return true + if o == nil { + return nil, false } - - return false + return &o.Timestamp, true } -// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// SetTimestamp sets field value func (o *UTXOInputMetricItem) SetTimestamp(v time.Time) { - o.Timestamp = &v + o.Timestamp = v } func (o UTXOInputMetricItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Messages) { - toSerialize["messages"] = o.Messages - } - if !isNil(o.Timestamp) { - toSerialize["timestamp"] = o.Timestamp + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o UTXOInputMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + type NullableUTXOInputMetricItem struct { value *UTXOInputMetricItem isSet bool diff --git a/client/model_validation_error.go b/clients/apiclient/model_validation_error.go similarity index 62% rename from client/model_validation_error.go rename to clients/apiclient/model_validation_error.go index 3953b0ec23..94e60db5ba 100644 --- a/client/model_validation_error.go +++ b/clients/apiclient/model_validation_error.go @@ -3,29 +3,34 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" ) +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + // ValidationError struct for ValidationError type ValidationError struct { - Error *string `json:"Error,omitempty"` - MissingPermission *string `json:"MissingPermission,omitempty"` + Error string `json:"error"` + MissingPermission string `json:"missingPermission"` } // NewValidationError instantiates a new ValidationError object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewValidationError() *ValidationError { +func NewValidationError(error_ string, missingPermission string) *ValidationError { this := ValidationError{} + this.Error = error_ + this.MissingPermission = missingPermission return &this } @@ -37,81 +42,69 @@ func NewValidationErrorWithDefaults() *ValidationError { return &this } -// GetError returns the Error field value if set, zero value otherwise. +// GetError returns the Error field value func (o *ValidationError) GetError() string { - if o == nil || isNil(o.Error) { + if o == nil { var ret string return ret } - return *o.Error + + return o.Error } -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// GetErrorOk returns a tuple with the Error field value // and a boolean to check if the value has been set. func (o *ValidationError) GetErrorOk() (*string, bool) { - if o == nil || isNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *ValidationError) HasError() bool { - if o != nil && !isNil(o.Error) { - return true + if o == nil { + return nil, false } - - return false + return &o.Error, true } -// SetError gets a reference to the given string and assigns it to the Error field. +// SetError sets field value func (o *ValidationError) SetError(v string) { - o.Error = &v + o.Error = v } -// GetMissingPermission returns the MissingPermission field value if set, zero value otherwise. +// GetMissingPermission returns the MissingPermission field value func (o *ValidationError) GetMissingPermission() string { - if o == nil || isNil(o.MissingPermission) { + if o == nil { var ret string return ret } - return *o.MissingPermission + + return o.MissingPermission } -// GetMissingPermissionOk returns a tuple with the MissingPermission field value if set, nil otherwise +// GetMissingPermissionOk returns a tuple with the MissingPermission field value // and a boolean to check if the value has been set. func (o *ValidationError) GetMissingPermissionOk() (*string, bool) { - if o == nil || isNil(o.MissingPermission) { - return nil, false - } - return o.MissingPermission, true -} - -// HasMissingPermission returns a boolean if a field has been set. -func (o *ValidationError) HasMissingPermission() bool { - if o != nil && !isNil(o.MissingPermission) { - return true + if o == nil { + return nil, false } - - return false + return &o.MissingPermission, true } -// SetMissingPermission gets a reference to the given string and assigns it to the MissingPermission field. +// SetMissingPermission sets field value func (o *ValidationError) SetMissingPermission(v string) { - o.MissingPermission = &v + o.MissingPermission = v } func (o ValidationError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Error) { - toSerialize["Error"] = o.Error - } - if !isNil(o.MissingPermission) { - toSerialize["MissingPermission"] = o.MissingPermission + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error"] = o.Error + toSerialize["missingPermission"] = o.MissingPermission + return toSerialize, nil +} + type NullableValidationError struct { value *ValidationError isSet bool diff --git a/client/response.go b/clients/apiclient/response.go similarity index 95% rename from client/response.go rename to clients/apiclient/response.go index 3d38eb042b..3bf96b515c 100644 --- a/client/response.go +++ b/clients/apiclient/response.go @@ -3,12 +3,12 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "net/http" diff --git a/client/test/api_chains_test.go b/clients/apiclient/test/api_chains_test.go similarity index 100% rename from client/test/api_chains_test.go rename to clients/apiclient/test/api_chains_test.go diff --git a/client/test/api_corecontracts_test.go b/clients/apiclient/test/api_corecontracts_test.go similarity index 100% rename from client/test/api_corecontracts_test.go rename to clients/apiclient/test/api_corecontracts_test.go diff --git a/client/test/api_metrics_test.go b/clients/apiclient/test/api_metrics_test.go similarity index 100% rename from client/test/api_metrics_test.go rename to clients/apiclient/test/api_metrics_test.go diff --git a/client/test/api_node_test.go b/clients/apiclient/test/api_node_test.go similarity index 100% rename from client/test/api_node_test.go rename to clients/apiclient/test/api_node_test.go diff --git a/client/test/api_requests_test.go b/clients/apiclient/test/api_requests_test.go similarity index 100% rename from client/test/api_requests_test.go rename to clients/apiclient/test/api_requests_test.go diff --git a/client/test/api_users_test.go b/clients/apiclient/test/api_users_test.go similarity index 100% rename from client/test/api_users_test.go rename to clients/apiclient/test/api_users_test.go diff --git a/client/utils.go b/clients/apiclient/utils.go similarity index 93% rename from client/utils.go rename to clients/apiclient/utils.go index 192629546b..8e238f0ddf 100644 --- a/client/utils.go +++ b/clients/apiclient/utils.go @@ -3,16 +3,16 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-402-g2adcf666b +API version: 0.4.0-alpha.2-403-g907bc6c54 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. -package client +package apiclient import ( "encoding/json" - "reflect" + "reflect" "time" ) @@ -330,14 +330,18 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { // isNil checks if an input is nil func isNil(i interface{}) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} \ No newline at end of file + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/clients/apiutils.go b/clients/apiutils.go new file mode 100644 index 0000000000..2f8374d5b6 --- /dev/null +++ b/clients/apiutils.go @@ -0,0 +1 @@ +package apiclient diff --git a/clients/auth/auth.go b/clients/auth/auth.go new file mode 100644 index 0000000000..8832b06d18 --- /dev/null +++ b/clients/auth/auth.go @@ -0,0 +1 @@ +package auth diff --git a/clients/chainclient/callview.go b/clients/chainclient/callview.go new file mode 100644 index 0000000000..1d082551f4 --- /dev/null +++ b/clients/chainclient/callview.go @@ -0,0 +1,30 @@ +package chainclient + +import ( + "context" + + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/packages/kv/dict" +) + +// CallView sends a request to call a view function of a given contract, and returns the result of the call +func (c *Client) CallView(ctx context.Context, hContract isc.Hname, functionName string, args dict.Dict) (dict.Dict, error) { + + request := apiclient.ContractCallViewRequest{ + ChainId: c.ChainID.String(), + ContractHName: hContract.String(), + FunctionName: functionName, + Arguments: *clients.JSONDictToAPIJSONDict(args.JSONDict()), + } + + result, _, err := c.WaspClient.RequestsApi. + CallView(ctx). + ContractCallViewRequest(request). + Execute() + + dictResult, err := dict.FromJSONDict(clients.APIJsonDictToJSONDict(*result)) + + return dictResult, err +} diff --git a/clients/chainclient/chainclient.go b/clients/chainclient/chainclient.go new file mode 100644 index 0000000000..399d3fdba7 --- /dev/null +++ b/clients/chainclient/chainclient.go @@ -0,0 +1,245 @@ +package chainclient + +import ( + "context" + + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/cryptolib" + "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/packages/kv/codec" + "github.com/iotaledger/wasp/packages/kv/dict" + "github.com/iotaledger/wasp/packages/l1connection" + "github.com/iotaledger/wasp/packages/transaction" + "github.com/iotaledger/wasp/packages/vm/core/accounts" + "github.com/iotaledger/wasp/packages/vm/gas" +) + +// Client allows to interact with a specific chain in the node, for example to send on-ledger or off-ledger requests +type Client struct { + Layer1Client l1connection.Client + WaspClient *apiclient.APIClient + ChainID isc.ChainID + KeyPair *cryptolib.KeyPair + nonces map[string]uint64 +} + +// New creates a new chainclient.Client +func New( + layer1Client l1connection.Client, + waspClient *apiclient.APIClient, + chainID isc.ChainID, + keyPair *cryptolib.KeyPair, +) *Client { + return &Client{ + Layer1Client: layer1Client, + WaspClient: waspClient, + ChainID: chainID, + KeyPair: keyPair, + nonces: make(map[string]uint64), + } +} + +type PostRequestParams struct { + Transfer *isc.FungibleTokens + Args dict.Dict + Nonce uint64 + NFT *isc.NFT + Allowance *isc.Allowance + GasBudget *uint64 + AutoAdjustStorageDeposit bool +} + +func defaultParams(params ...PostRequestParams) PostRequestParams { + if len(params) > 0 { + return params[0] + } + return PostRequestParams{} +} + +// Post1Request sends an on-ledger transaction with one request on it to the chain +func (c *Client) Post1Request( + contractHname isc.Hname, + entryPoint isc.Hname, + params ...PostRequestParams, +) (*iotago.Transaction, error) { + outputsSet, err := c.Layer1Client.OutputMap(c.KeyPair.Address()) + if err != nil { + return nil, err + } + return c.post1RequestWithOutputs(contractHname, entryPoint, outputsSet, params...) +} + +// PostNRequest sends n consecutive on-ledger transactions with one request on each, to the chain +func (c *Client) PostNRequests( + contractHname isc.Hname, + entryPoint isc.Hname, + requestsCount int, + params ...PostRequestParams, +) ([]*iotago.Transaction, error) { + var err error + outputs, err := c.Layer1Client.OutputMap(c.KeyPair.Address()) + if err != nil { + return nil, err + } + transactions := make([]*iotago.Transaction, requestsCount) + for i := 0; i < requestsCount; i++ { + transactions[i], err = c.post1RequestWithOutputs(contractHname, entryPoint, outputs, params...) + if err != nil { + return nil, err + } + txID, err := transactions[i].ID() + if err != nil { + return nil, err + } + for _, input := range transactions[i].Essence.Inputs { + if utxoInput, ok := input.(*iotago.UTXOInput); ok { + delete(outputs, utxoInput.ID()) + } + } + for index, output := range transactions[i].Essence.Outputs { + if basicOutput, ok := output.(*iotago.BasicOutput); ok { + if basicOutput.Ident().Equal(c.KeyPair.Address()) { + outputID := iotago.OutputIDFromTransactionIDAndIndex(txID, uint16(index)) + outputs[outputID] = transactions[i].Essence.Outputs[index] + } + } + } + } + return transactions, nil +} + +func (c *Client) post1RequestWithOutputs( + contractHname isc.Hname, + entryPoint isc.Hname, + outputs iotago.OutputSet, + params ...PostRequestParams, +) (*iotago.Transaction, error) { + par := defaultParams(params...) + var gasBudget uint64 + if par.GasBudget == nil { + gasBudget = gas.MaxGasPerRequest + } else { + gasBudget = *par.GasBudget + } + tx, err := transaction.NewRequestTransaction( + transaction.NewRequestTransactionParams{ + SenderKeyPair: c.KeyPair, + SenderAddress: c.KeyPair.Address(), + UnspentOutputs: outputs, + UnspentOutputIDs: isc.OutputSetToOutputIDs(outputs), + Request: &isc.RequestParameters{ + TargetAddress: c.ChainID.AsAddress(), + FungibleTokens: par.Transfer, + AdjustToMinimumStorageDeposit: par.AutoAdjustStorageDeposit, + Metadata: &isc.SendMetadata{ + TargetContract: contractHname, + EntryPoint: entryPoint, + Params: par.Args, + Allowance: par.Allowance, + GasBudget: gasBudget, + }, + }, + NFT: par.NFT, + }, + ) + if err != nil { + return nil, err + } + _, err = c.Layer1Client.PostTxAndWaitUntilConfirmation(tx) + return tx, err +} + +// PostOffLedgerRequest sends an off-ledger tx via the wasp node web api +func (c *Client) PostOffLedgerRequest( + contractHname isc.Hname, + entrypoint isc.Hname, + params ...PostRequestParams, +) (isc.OffLedgerRequest, error) { + par := defaultParams(params...) + if par.Nonce == 0 { + c.nonces[c.KeyPair.Address().Key()]++ + par.Nonce = c.nonces[c.KeyPair.Address().Key()] + } + var gasBudget uint64 + if par.GasBudget == nil { + gasBudget = gas.MaxGasPerRequest + } else { + gasBudget = *par.GasBudget + } + req := isc.NewOffLedgerRequest(c.ChainID, contractHname, entrypoint, par.Args, par.Nonce) + req.WithAllowance(par.Allowance) + if par.GasBudget != nil { + req = req.WithGasBudget(gasBudget) + } + req.WithNonce(par.Nonce) + signed := req.Sign(c.KeyPair) + + request := iotago.EncodeHex(signed.Bytes()) + + offLedgerRequest := apiclient.OffLedgerRequest{ + ChainId: c.ChainID.String(), + Request: request, + } + _, err := c.WaspClient.RequestsApi. + OffLedger(context.Background()). + OffLedgerRequest(offLedgerRequest). + Execute() + + return signed, err +} + +func (c *Client) DepositFunds(n uint64) (*iotago.Transaction, error) { + return c.Post1Request(accounts.Contract.Hname(), accounts.FuncDeposit.Hname(), PostRequestParams{ + Transfer: isc.NewFungibleTokens(n, nil), + }) +} + +// NewPostRequestParams simplifies encoding of request parameters +func NewPostRequestParams(p ...interface{}) *PostRequestParams { + return &PostRequestParams{ + Args: parseParams(p), + Transfer: isc.NewFungibleTokens(0, nil), + } +} + +func (par *PostRequestParams) WithTransfer(transfer *isc.FungibleTokens) *PostRequestParams { + par.Transfer = transfer + return par +} + +func (par *PostRequestParams) WithBaseTokens(i uint64) *PostRequestParams { + par.Transfer.AddBaseTokens(i) + return par +} + +func (par *PostRequestParams) WithGasBudget(budget uint64) *PostRequestParams { + par.GasBudget = &budget + return par +} + +func parseParams(params []interface{}) dict.Dict { + if len(params) == 1 { + return params[0].(dict.Dict) + } + return codec.MakeDict(toMap(params)) +} + +// makes map without hashing +func toMap(params []interface{}) map[string]interface{} { + par := make(map[string]interface{}) + if len(params) == 0 { + return par + } + if len(params)%2 != 0 { + panic("toMap: len(params) % 2 != 0") + } + for i := 0; i < len(params)/2; i++ { + key, ok := params[2*i].(string) + if !ok { + panic("toMap: string expected") + } + par[key] = params[2*i+1] + } + return par +} diff --git a/clients/chainclient/chainrecord.go b/clients/chainclient/chainrecord.go new file mode 100644 index 0000000000..65c9674232 --- /dev/null +++ b/clients/chainclient/chainrecord.go @@ -0,0 +1,14 @@ +package chainclient + +import ( + "context" + + "github.com/iotaledger/wasp/clients/apiclient" +) + +// GetChainRecord fetches the chain's Record +func (c *Client) GetChainRecord(ctx context.Context) (*apiclient.ChainInfoResponse, error) { + chainInfo, _, err := c.WaspClient.ChainsApi.GetChainInfo(ctx, c.ChainID.String()).Execute() + + return chainInfo, err +} diff --git a/clients/chainclient/checkrequest.go b/clients/chainclient/checkrequest.go new file mode 100644 index 0000000000..71f279278b --- /dev/null +++ b/clients/chainclient/checkrequest.go @@ -0,0 +1,33 @@ +package chainclient + +import ( + "errors" + "fmt" + + "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/packages/kv/codec" + "github.com/iotaledger/wasp/packages/kv/dict" + "github.com/iotaledger/wasp/packages/vm/core/blocklog" +) + +// CheckRequestResult fetches the receipt for the given request ID, and returns +// an error indicating whether the request was processed successfully. +func (c *Client) CheckRequestResult(reqID isc.RequestID) error { + ret, err := c.CallView(blocklog.Contract.Hname(), blocklog.ViewGetRequestReceipt.Name, dict.Dict{ + blocklog.ParamRequestID: codec.EncodeRequestID(reqID), + }) + if err != nil { + return fmt.Errorf("could not fetch receipt for request: %w", err) + } + if !ret.MustHas(blocklog.ParamRequestRecord) { + return errors.New("could not fetch receipt for request: not found in blocklog") + } + req, err := blocklog.RequestReceiptFromBytes(ret.MustGet(blocklog.ParamRequestRecord)) + if err != nil { + return fmt.Errorf("could not decode receipt for request: %w", err) + } + if req.Error != nil { + return fmt.Errorf("the request was rejected: %v", req.Error) + } + return nil +} diff --git a/clients/chainclient/evm.go b/clients/chainclient/evm.go new file mode 100644 index 0000000000..3af043876a --- /dev/null +++ b/clients/chainclient/evm.go @@ -0,0 +1,11 @@ +package chainclient + +import ( + "github.com/ethereum/go-ethereum/common" + + "github.com/iotaledger/wasp/packages/isc" +) + +func (c *Client) RequestIDByEVMTransactionHash(txHash common.Hash) (isc.RequestID, error) { + return c.WaspClient.RequestIDByEVMTransactionHash(c.ChainID, txHash) +} diff --git a/clients/chainclient/stateget.go b/clients/chainclient/stateget.go new file mode 100644 index 0000000000..1efb985885 --- /dev/null +++ b/clients/chainclient/stateget.go @@ -0,0 +1,6 @@ +package chainclient + +// StateGet fetches the raw value associated with the given key in the chain state +func (c *Client) StateGet(key string) ([]byte, error) { + return c.WaspClient.StateGet(c.ChainID, key) +} diff --git a/clients/chainclient/uploadblob.go b/clients/chainclient/uploadblob.go new file mode 100644 index 0000000000..cfd29021a7 --- /dev/null +++ b/clients/chainclient/uploadblob.go @@ -0,0 +1,29 @@ +package chainclient + +import ( + "time" + + "github.com/iotaledger/wasp/packages/hashing" + "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/packages/kv/dict" + "github.com/iotaledger/wasp/packages/vm/core/blob" +) + +// UploadBlob sends an off-ledger request to call 'store' in the blob contract. +func (c *Client) UploadBlob(fields dict.Dict) (hashing.HashValue, isc.OffLedgerRequest, *isc.Receipt, error) { + blobHash := blob.MustGetBlobHash(fields) + + req, err := c.PostOffLedgerRequest( + blob.Contract.Hname(), + blob.FuncStoreBlob.Hname(), + PostRequestParams{ + Args: fields, + }, + ) + if err != nil { + return hashing.NilHash, nil, nil, err + } + + receipt, err := c.WaspClient.WaitUntilRequestProcessed(c.ChainID, req.ID(), 2*time.Minute) + return blobHash, req, receipt, err +} diff --git a/clients/scclient/postrequest.go b/clients/scclient/postrequest.go new file mode 100644 index 0000000000..ed33010783 --- /dev/null +++ b/clients/scclient/postrequest.go @@ -0,0 +1,19 @@ +package scclient + +import ( + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/packages/isc" +) + +func (c *SCClient) PostRequest(fname string, params ...chainclient.PostRequestParams) (*iotago.Transaction, error) { + return c.ChainClient.Post1Request(c.ContractHname, isc.Hn(fname), params...) +} + +func (c *SCClient) PostNRequests(fname string, n int, params ...chainclient.PostRequestParams) ([]*iotago.Transaction, error) { + return c.ChainClient.PostNRequests(c.ContractHname, isc.Hn(fname), n, params...) +} + +func (c *SCClient) PostOffLedgerRequest(fname string, params ...chainclient.PostRequestParams) (isc.OffLedgerRequest, error) { + return c.ChainClient.PostOffLedgerRequest(c.ContractHname, isc.Hn(fname), params...) +} diff --git a/clients/scclient/scclient.go b/clients/scclient/scclient.go new file mode 100644 index 0000000000..26b9219b11 --- /dev/null +++ b/clients/scclient/scclient.go @@ -0,0 +1,23 @@ +package scclient + +import ( + "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/packages/isc" +) + +// SCClient allows to send webapi requests targeted to a specific contract +type SCClient struct { + ChainClient *chainclient.Client + ContractHname isc.Hname +} + +// New creates a new SCClient +func New( + chainClient *chainclient.Client, + contractHname isc.Hname, +) *SCClient { + return &SCClient{ + ChainClient: chainClient, + ContractHname: contractHname, + } +} diff --git a/clients/scclient/stateget.go b/clients/scclient/stateget.go new file mode 100644 index 0000000000..666bc943dd --- /dev/null +++ b/clients/scclient/stateget.go @@ -0,0 +1,6 @@ +package scclient + +// StateGet fetches the raw value associated with the given key in the smart contract state +func (c *SCClient) StateGet(key string) ([]byte, error) { + return c.ChainClient.StateGet(string(c.ContractHname.Bytes()) + key) +} diff --git a/tools/wasp-cli/cli/cliclients/clients.go b/tools/wasp-cli/cli/cliclients/clients.go new file mode 100644 index 0000000000..04da6e6fe3 --- /dev/null +++ b/tools/wasp-cli/cli/cliclients/clients.go @@ -0,0 +1,36 @@ +package clients + +import ( + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/l1connection" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/log" +) + +func WaspClientForNodeNumber(i ...int) *apiclient.APIClient { + return WaspClient(config.WaspAPIURL(i...)) +} + +func WaspClient(apiAddress string) *apiclient.APIClient { + // TODO: add authentication for /adm + L1Client() // this will fill parameters.L1() with data from the L1 node + log.Verbosef("using Wasp host %s\n", apiAddress) + + apiConfig := apiclient.NewConfiguration() + apiConfig.Host = apiAddress + apiConfig.AddDefaultHeader("Authorization", config.GetToken()) + + return apiclient.NewAPIClient(apiConfig) +} + +func L1Client() l1connection.Client { + log.Verbosef("using L1 API %s\n", config.L1APIAddress()) + + return l1connection.NewClient( + l1connection.Config{ + APIAddress: config.L1APIAddress(), + FaucetAddress: config.L1FaucetAddress(), + }, + log.HiveLogger(), + ) +} diff --git a/tools/wasp-cli/config/checkversions.go b/tools/wasp-cli/cli/config/checkversions.go similarity index 88% rename from tools/wasp-cli/config/checkversions.go rename to tools/wasp-cli/cli/config/checkversions.go index fae5dd1200..c2ab9a4696 100644 --- a/tools/wasp-cli/config/checkversions.go +++ b/tools/wasp-cli/cli/config/checkversions.go @@ -3,7 +3,6 @@ package config import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/client" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -15,7 +14,7 @@ func initCheckVersionsCmd(waspVersion string) *cobra.Command { Run: func(cmd *cobra.Command, args []string) { // query every wasp node info endpoint and ensure the `Version` matches for i := 0; i < totalNumberOfWaspNodes(); i++ { - client := client.NewWaspClient(committeeHost(HostKindAPI, i)) + client := clients.NewWaspClient(committeeHost(HostKindAPI, i)) waspServerInfo, err := client.Info() log.Check(err) if waspVersion == waspServerInfo.Version { diff --git a/tools/wasp-cli/config/config.go b/tools/wasp-cli/cli/config/config.go similarity index 88% rename from tools/wasp-cli/config/config.go rename to tools/wasp-cli/cli/config/config.go index 9a329101ed..7d9263bb79 100644 --- a/tools/wasp-cli/config/config.go +++ b/tools/wasp-cli/cli/config/config.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/iotaledger/wasp/client" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/l1connection" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/testutil/privtangle/privtangledefaults" @@ -162,22 +162,31 @@ func SetToken(token string) { Set("authentication.token", token) } -func WaspClient(apiAddress string) *client.WaspClient { +func WaspClientForNodeNumber(i ...int) *apiclient.APIClient { + return WaspClient(WaspAPIURL(i...)) +} + +func WaspClient(apiAddress string) *apiclient.APIClient { // TODO: add authentication for /adm L1Client() // this will fill parameters.L1() with data from the L1 node log.Verbosef("using Wasp host %s\n", apiAddress) - return client.NewWaspClient(apiAddress).WithToken(GetToken()) + + config := apiclient.NewConfiguration() + config.Host = apiAddress + config.AddDefaultHeader("Authorization", GetToken()) + + return apiclient.NewAPIClient(config) } -func MustWaspAPI(i ...int) string { - apiAddress := WaspAPI(i...) +func MustWaspAPIURL(i ...int) string { + apiAddress := WaspAPIURL(i...) if apiAddress == "" { panic("wasp webapi not defined") } return apiAddress } -func WaspAPI(i ...int) string { +func WaspAPIURL(i ...int) string { index := 0 if len(i) > 0 { index = i[0] @@ -207,19 +216,19 @@ func FindNodeBy(kind, v string) int { return 0 } -func CommitteeAPI(indices []int) []string { - return committee(HostKindAPI, indices) +func CommitteeAPIURL(indices []int) []string { + return committeeHosts(HostKindAPI, indices) } func CommitteePeering(indices []int) []string { - return committee(HostKindPeering, indices) + return committeeHosts(HostKindPeering, indices) } func CommitteeNanomsg(indices []int) []string { - return committee(HostKindNanomsg, indices) + return committeeHosts(HostKindNanomsg, indices) } -func committee(kind string, indices []int) []string { +func committeeHosts(kind string, indices []int) []string { hosts := make([]string, 0) for _, i := range indices { hosts = append(hosts, committeeHost(kind, i)) diff --git a/tools/wasp-cli/cli/config/init.go b/tools/wasp-cli/cli/config/init.go new file mode 100644 index 0000000000..d912156bec --- /dev/null +++ b/tools/wasp-cli/cli/config/init.go @@ -0,0 +1 @@ +package config From e45a119adf71668170ede9035ce75bc747e7f512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 2 Feb 2023 20:33:35 +0100 Subject: [PATCH 03/39] Update API client, refactoring of chain package in wasp-cli, refactoring wasp-cli clients --- clients/apiclient/.openapi-generator/FILES | 8 + clients/apiclient/api/openapi.yaml | 322 ++++++++++++------ clients/apiclient/api_auth.go | 229 +++++++++++++ clients/apiclient/api_chains.go | 24 +- clients/apiclient/api_corecontracts.go | 54 +-- clients/apiclient/api_metrics.go | 10 +- clients/apiclient/api_node.go | 26 +- clients/apiclient/api_requests.go | 10 +- clients/apiclient/api_users.go | 14 +- clients/apiclient/client.go | 7 +- clients/apiclient/configuration.go | 2 +- clients/apiclient/docs/AuthApi.md | 133 ++++++++ clients/apiclient/docs/AuthInfoModel.md | 72 ++++ clients/apiclient/docs/BaseToken.md | 44 +-- clients/apiclient/docs/Blob.md | 16 +- clients/apiclient/docs/BlobInfoResponse.md | 9 +- clients/apiclient/docs/BlobValueResponse.md | 9 +- clients/apiclient/docs/BurnLog.md | 9 +- clients/apiclient/docs/BurnRecord.md | 16 +- clients/apiclient/docs/ChainsApi.md | 22 +- clients/apiclient/docs/CorecontractsApi.md | 52 +-- clients/apiclient/docs/LoginRequest.md | 72 ++++ clients/apiclient/docs/LoginResponse.md | 72 ++++ clients/apiclient/docs/MetricsApi.md | 8 +- clients/apiclient/docs/NodeApi.md | 24 +- .../apiclient/docs/RequestReceiptResponse.md | 9 +- clients/apiclient/docs/RequestsApi.md | 8 +- clients/apiclient/docs/UsersApi.md | 12 +- .../apiclient/model_account_list_response.go | 2 +- .../apiclient/model_account_nfts_response.go | 2 +- .../apiclient/model_account_nonce_response.go | 2 +- clients/apiclient/model_add_user_request.go | 2 +- .../model_alias_output_metric_item.go | 2 +- clients/apiclient/model_allowance.go | 2 +- clients/apiclient/model_assets_response.go | 2 +- clients/apiclient/model_auth_info_model.go | 145 ++++++++ clients/apiclient/model_base_token.go | 202 ++++------- clients/apiclient/model_blob.go | 70 ++-- clients/apiclient/model_blob_info_response.go | 37 +- clients/apiclient/model_blob_list_response.go | 2 +- .../apiclient/model_blob_value_response.go | 37 +- .../apiclient/model_block_info_response.go | 2 +- .../apiclient/model_block_receipt_error.go | 2 +- .../model_block_receipts_response.go | 2 +- clients/apiclient/model_burn_log.go | 31 +- clients/apiclient/model_burn_record.go | 70 ++-- clients/apiclient/model_call_target.go | 2 +- .../apiclient/model_chain_info_response.go | 2 +- clients/apiclient/model_chain_metrics.go | 2 +- .../model_committee_info_response.go | 2 +- clients/apiclient/model_committee_node.go | 2 +- .../apiclient/model_consensus_pipe_metrics.go | 2 +- .../model_consensus_workflow_metrics.go | 2 +- .../model_contract_call_view_request.go | 2 +- .../apiclient/model_contract_info_response.go | 2 +- .../model_control_addresses_response.go | 2 +- clients/apiclient/model_dk_shares_info.go | 2 +- .../apiclient/model_dk_shares_post_request.go | 2 +- .../model_error_message_format_response.go | 2 +- clients/apiclient/model_events_response.go | 2 +- .../model_foundry_output_response.go | 2 +- clients/apiclient/model_fungible_tokens.go | 2 +- clients/apiclient/model_gas_fee_policy.go | 2 +- .../model_gov_chain_info_response.go | 2 +- clients/apiclient/model_in_output.go | 2 +- .../apiclient/model_in_output_metric_item.go | 2 +- clients/apiclient/model_in_state_output.go | 2 +- .../model_in_state_output_metric_item.go | 2 +- clients/apiclient/model_info_response.go | 2 +- .../apiclient/model_interface_metric_item.go | 2 +- clients/apiclient/model_item.go | 2 +- clients/apiclient/model_json_dict.go | 2 +- clients/apiclient/model_l1_params.go | 2 +- clients/apiclient/model_login_request.go | 144 ++++++++ clients/apiclient/model_login_response.go | 144 ++++++++ clients/apiclient/model_native_token.go | 2 +- ...model_native_token_id_registry_response.go | 2 +- clients/apiclient/model_nft_data_response.go | 2 +- .../model_node_owner_certificate_request.go | 2 +- clients/apiclient/model_off_ledger_request.go | 2 +- clients/apiclient/model_on_ledger_request.go | 2 +- .../model_on_ledger_request_metric_item.go | 2 +- clients/apiclient/model_output.go | 2 +- clients/apiclient/model_output_id.go | 2 +- .../model_peering_node_identity_response.go | 2 +- .../model_peering_node_status_response.go | 2 +- .../apiclient/model_peering_trust_request.go | 2 +- .../apiclient/model_protocol_parameters.go | 2 +- clients/apiclient/model_receipt_error.go | 2 +- clients/apiclient/model_receipt_response.go | 2 +- clients/apiclient/model_rent_structure.go | 2 +- clients/apiclient/model_request_detail.go | 2 +- .../apiclient/model_request_ids_response.go | 2 +- .../model_request_processed_response.go | 2 +- .../model_request_receipt_response.go | 37 +- clients/apiclient/model_state_response.go | 2 +- clients/apiclient/model_transaction.go | 2 +- .../model_transaction_id_metric_item.go | 2 +- .../model_transaction_metric_item.go | 2 +- .../apiclient/model_tx_inclusion_state_msg.go | 2 +- ...odel_tx_inclusion_state_msg_metric_item.go | 2 +- .../model_update_user_password_request.go | 2 +- .../model_update_user_permissions_request.go | 2 +- clients/apiclient/model_user.go | 2 +- .../apiclient/model_utxo_input_metric_item.go | 2 +- clients/apiclient/model_validation_error.go | 2 +- clients/apiclient/response.go | 2 +- clients/apiclient/test/api_auth_test.go | 49 +++ clients/apiclient/utils.go | 2 +- clients/apiutils.go | 41 ++- clients/auth/auth.go | 46 +++ clients/chainclient/callview.go | 2 +- clients/chainclient/checkrequest.go | 23 +- clients/chainclient/evm.go | 14 +- clients/chainclient/stateget.go | 18 +- clients/chainclient/uploadblob.go | 8 +- clients/scclient/postrequest.go | 2 +- clients/scclient/scclient.go | 5 +- clients/scclient/stateget.go | 6 +- packages/apilib/rundkg.go | 3 +- .../go/wasmclient/wasmclientservice.go | 6 +- tools/cluster/cluster.go | 1 - tools/wasp-cli/authentication/info.go | 39 ++- tools/wasp-cli/authentication/login.go | 20 +- tools/wasp-cli/chain/accounts.go | 51 ++- tools/wasp-cli/chain/activate.go | 26 +- tools/wasp-cli/chain/alias.go | 2 +- tools/wasp-cli/chain/blobs.go | 64 ++-- tools/wasp-cli/chain/blocklog.go | 130 +++---- tools/wasp-cli/chain/callview.go | 25 +- tools/wasp-cli/chain/client.go | 25 -- tools/wasp-cli/chain/deploy.go | 6 +- tools/wasp-cli/chain/deploycontract.go | 7 +- tools/wasp-cli/chain/info.go | 4 +- tools/wasp-cli/chain/list.go | 4 +- tools/wasp-cli/chain/rotate.go | 2 +- tools/wasp-cli/chain/rundkg.go | 9 +- tools/wasp-cli/cli/cliclients/clients.go | 22 +- tools/wasp-cli/cli/config/config.go | 136 +------- tools/wasp-cli/cli/config/init.go | 54 +++ tools/wasp-cli/log/log.go | 3 +- tools/wasp-cli/main.go | 2 +- tools/wasp-cli/metrics/consensus.go | 4 +- tools/wasp-cli/metrics/nodeconn.go | 4 +- tools/wasp-cli/peering/distrust.go | 4 +- tools/wasp-cli/peering/info.go | 4 +- tools/wasp-cli/peering/listtrusted.go | 4 +- tools/wasp-cli/peering/trust.go | 3 +- tools/wasp-cli/util/tx.go | 6 +- tools/wasp-cli/wallet/info.go | 2 +- tools/wasp-cli/wallet/request-funds.go | 2 +- tools/wasp-cli/wallet/send.go | 2 +- tools/wasp-cli/wallet/wallet.go | 2 +- 153 files changed, 2167 insertions(+), 1075 deletions(-) create mode 100644 clients/apiclient/api_auth.go create mode 100644 clients/apiclient/docs/AuthApi.md create mode 100644 clients/apiclient/docs/AuthInfoModel.md create mode 100644 clients/apiclient/docs/LoginRequest.md create mode 100644 clients/apiclient/docs/LoginResponse.md create mode 100644 clients/apiclient/model_auth_info_model.go create mode 100644 clients/apiclient/model_login_request.go create mode 100644 clients/apiclient/model_login_response.go create mode 100644 clients/apiclient/test/api_auth_test.go delete mode 100644 tools/wasp-cli/chain/client.go diff --git a/clients/apiclient/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES index 3750ea12bb..78850b5f82 100644 --- a/clients/apiclient/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore .travis.yml api/openapi.yaml +api_auth.go api_chains.go api_corecontracts.go api_metrics.go @@ -16,6 +17,8 @@ docs/AddUserRequest.md docs/AliasOutputMetricItem.md docs/Allowance.md docs/AssetsResponse.md +docs/AuthApi.md +docs/AuthInfoModel.md docs/BaseToken.md docs/Blob.md docs/BlobInfoResponse.md @@ -55,6 +58,8 @@ docs/InterfaceMetricItem.md docs/Item.md docs/JSONDict.md docs/L1Params.md +docs/LoginRequest.md +docs/LoginResponse.md docs/MetricsApi.md docs/NFTDataResponse.md docs/NativeToken.md @@ -99,6 +104,7 @@ model_add_user_request.go model_alias_output_metric_item.go model_allowance.go model_assets_response.go +model_auth_info_model.go model_base_token.go model_blob.go model_blob_info_response.go @@ -136,6 +142,8 @@ model_interface_metric_item.go model_item.go model_json_dict.go model_l1_params.go +model_login_request.go +model_login_response.go model_native_token.go model_native_token_id_registry_response.go model_nft_data_response.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index add47bb1c2..41bd619a28 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.1 info: description: REST API for the Wasp node title: Wasp API - version: 0.4.0-alpha.2-403-g907bc6c54 + version: "123" externalDocs: description: Find out more about Wasp url: https://wiki.iota.org/smart-contracts/overview @@ -10,6 +10,7 @@ servers: - url: http://localhost:9090/ - url: https://localhost:9090/ tags: +- name: auth - name: chains - name: chains - name: metrics @@ -23,7 +24,44 @@ tags: - name: corecontracts - name: corecontracts paths: - /chains: + /auth: + post: + operationId: authenticate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LoginRequest' + description: The login request + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LoginResponse' + description: Login was successful + "401": + content: {} + description: "Unauthorized (Wrong permissions, missing token)" + summary: Authenticate towards the node + tags: + - auth + x-codegen-request-body-name: "" + /auth/info: + get: + operationId: authInfo + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AuthInfoModel' + description: Login was successful + summary: Get information about the current authentication mode + tags: + - auth + /v2chains: get: operationId: getChains responses: @@ -46,7 +84,7 @@ paths: summary: Get a list of all chains tags: - chains - /chains/{chainID}: + /v2chains/{chainID}: get: operationId: getChainInfo parameters: @@ -75,7 +113,7 @@ paths: summary: Get information about a specific chain tags: - chains - /chains/{chainID}/access-node/{publicKey}: + /v2chains/{chainID}/access-node/{publicKey}: delete: operationId: removeAccessNode parameters: @@ -140,7 +178,7 @@ paths: summary: Configure a trusted node to be an access node. tags: - chains - /chains/{chainID}/activate: + /v2chains/{chainID}/activate: post: operationId: activateChain parameters: @@ -169,7 +207,7 @@ paths: summary: Activate a chain tags: - chains - /chains/{chainID}/committee: + /v2chains/{chainID}/committee: get: operationId: getCommitteeInfo parameters: @@ -198,7 +236,7 @@ paths: summary: Get information about the deployed committee tags: - chains - /chains/{chainID}/contracts: + /v2chains/{chainID}/contracts: get: operationId: getContracts parameters: @@ -229,7 +267,7 @@ paths: summary: Get all available chain contracts tags: - chains - /chains/{chainID}/core/accounts: + /v2chains/{chainID}/core/accounts: get: operationId: accountsGetAccounts parameters: @@ -256,7 +294,7 @@ paths: summary: Get a list of all accounts tags: - corecontracts - /chains/{chainID}/core/accounts/account/{agentID}/balance: + /v2chains/{chainID}/core/accounts/account/{agentID}/balance: get: operationId: accountsGetAccountBalance parameters: @@ -290,7 +328,7 @@ paths: summary: Get all assets belonging to an account tags: - corecontracts - /chains/{chainID}/core/accounts/account/{agentID}/nfts: + /v2chains/{chainID}/core/accounts/account/{agentID}/nfts: get: operationId: accountsGetAccountNFTIDs parameters: @@ -324,7 +362,7 @@ paths: summary: Get all NFT ids belonging to an account tags: - corecontracts - /chains/{chainID}/core/accounts/account/{agentID}/nonce: + /v2chains/{chainID}/core/accounts/account/{agentID}/nonce: get: operationId: accountsGetAccountNonce parameters: @@ -359,7 +397,7 @@ paths: summary: Get the current nonce of an account tags: - corecontracts - /chains/{chainID}/core/accounts/foundry_output: + /v2chains/{chainID}/core/accounts/foundry_output: get: operationId: accountsGetFoundryOutput parameters: @@ -393,7 +431,7 @@ paths: summary: Get the foundry output tags: - corecontracts - /chains/{chainID}/core/accounts/nftdata: + /v2chains/{chainID}/core/accounts/nftdata: get: operationId: accountsGetNFTData parameters: @@ -427,7 +465,7 @@ paths: summary: Get the NFT data by an ID tags: - corecontracts - /chains/{chainID}/core/accounts/token_registry: + /v2chains/{chainID}/core/accounts/token_registry: get: operationId: accountsGetNativeTokenIDRegistry parameters: @@ -454,7 +492,7 @@ paths: summary: Get a list of all registries tags: - corecontracts - /chains/{chainID}/core/accounts/total_assets: + /v2chains/{chainID}/core/accounts/total_assets: get: operationId: accountsGetTotalAssets parameters: @@ -481,7 +519,7 @@ paths: summary: Get all stored assets tags: - corecontracts - /chains/{chainID}/core/blobs: + /v2chains/{chainID}/core/blobs: get: operationId: blobsGetAllBlobs parameters: @@ -508,7 +546,7 @@ paths: summary: Get all stored blobs tags: - corecontracts - /chains/{chainID}/core/blobs/{blobHash}: + /v2chains/{chainID}/core/blobs/{blobHash}: get: operationId: blobsGetBlobInfo parameters: @@ -542,7 +580,7 @@ paths: summary: Get all fields of a blob tags: - corecontracts - /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: + /v2chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: get: operationId: blobsGetBlobValue parameters: @@ -583,7 +621,7 @@ paths: summary: Get the value of the supplied field (key) tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/latest: + /v2chains/{chainID}/core/blocklog/blocks/latest: get: operationId: blocklogGetLatestBlockInfo parameters: @@ -610,7 +648,7 @@ paths: summary: Get the block info of the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/latest/receipts: + /v2chains/{chainID}/core/blocklog/blocks/latest/receipts: get: operationId: blocklogGetRequestReceiptsOfLatestBlock parameters: @@ -637,7 +675,7 @@ paths: summary: Get all receipts of the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/latest/requestids: + /v2chains/{chainID}/core/blocklog/blocks/latest/requestids: get: operationId: blocklogGetRequestIDsForLatestBlock parameters: @@ -664,7 +702,7 @@ paths: summary: Get the request ids for the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/{blockIndex}: + /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}: get: operationId: blocklogGetBlockInfo parameters: @@ -698,7 +736,7 @@ paths: summary: Get the block info of a certain block index tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: get: operationId: blocklogGetRequestReceiptsOfBlock parameters: @@ -732,7 +770,7 @@ paths: summary: Get all receipts of a certain block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: + /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: get: operationId: blocklogGetRequestIDsForBlock parameters: @@ -766,7 +804,7 @@ paths: summary: Get the request ids for a certain block index tags: - corecontracts - /chains/{chainID}/core/blocklog/controladdresses: + /v2chains/{chainID}/core/blocklog/controladdresses: get: operationId: blocklogGetControlAddresses parameters: @@ -793,7 +831,7 @@ paths: summary: Get the control addresses tags: - corecontracts - /chains/{chainID}/core/blocklog/events/block/latest: + /v2chains/{chainID}/core/blocklog/events/block/latest: get: operationId: blocklogGetEventsOfLatestBlock parameters: @@ -820,7 +858,7 @@ paths: summary: Get events of the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/events/block/{blockIndex}: + /v2chains/{chainID}/core/blocklog/events/block/{blockIndex}: get: operationId: blocklogGetEventsOfBlock parameters: @@ -854,7 +892,7 @@ paths: summary: Get events of a block tags: - corecontracts - /chains/{chainID}/core/blocklog/events/contract/{contractHname}: + /v2chains/{chainID}/core/blocklog/events/contract/{contractHname}: get: operationId: blocklogGetEventsOfContract parameters: @@ -888,7 +926,7 @@ paths: summary: Get events of a contract tags: - corecontracts - /chains/{chainID}/core/blocklog/events/request/{requestID}: + /v2chains/{chainID}/core/blocklog/events/request/{requestID}: get: operationId: blocklogGetEventsOfRequest parameters: @@ -922,7 +960,7 @@ paths: summary: Get events of a request tags: - corecontracts - /chains/{chainID}/core/blocklog/requests/{requestID}: + /v2chains/{chainID}/core/blocklog/requests/{requestID}: get: operationId: blocklogGetRequestReceipt parameters: @@ -956,7 +994,7 @@ paths: summary: Get the receipt of a certain request id tags: - corecontracts - /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: + /v2chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: get: operationId: blocklogGetRequestIsProcessed parameters: @@ -990,7 +1028,7 @@ paths: summary: Get the request processing status tags: - corecontracts - /chains/{chainID}/core/errors/{contractHname}/message/{errorID}: + /v2chains/{chainID}/core/errors/{contractHname}/message/{errorID}: get: operationId: errorsGetErrorMessageFormat parameters: @@ -1031,7 +1069,7 @@ paths: summary: Get the error message format of a specific error id tags: - corecontracts - /chains/{chainID}/core/governance/chaininfo: + /v2chains/{chainID}/core/governance/chaininfo: get: description: "If you are using the common API functions, you most likely rather\ \ want to use '/chains/:chainID' to get information about a chain." @@ -1060,7 +1098,7 @@ paths: summary: Get the chain info tags: - corecontracts - /chains/{chainID}/deactivate: + /v2chains/{chainID}/deactivate: post: operationId: deactivateChain parameters: @@ -1089,7 +1127,7 @@ paths: summary: Deactivate a chain tags: - chains - /chains/{chainID}/evm/tx/{txHash}: + /v2chains/{chainID}/evm/tx/{txHash}: get: operationId: getRequestIDFromEVMTransactionID parameters: @@ -1125,7 +1163,7 @@ paths: summary: Get the ISC request ID for the given Ethereum transaction hash tags: - chains - /chains/{chainID}/receipts/{requestID}: + /v2chains/{chainID}/receipts/{requestID}: get: operationId: getReceipt parameters: @@ -1153,7 +1191,7 @@ paths: summary: Get a receipt from a request ID tags: - requests - /chains/{chainID}/requests/{requestID}/wait: + /v2chains/{chainID}/requests/{requestID}/wait: get: operationId: waitForTransaction parameters: @@ -1187,7 +1225,7 @@ paths: summary: Wait until the given request has been processed by the node tags: - requests - /chains/{chainID}/state/{stateKey}: + /v2chains/{chainID}/state/{stateKey}: get: operationId: getStateValue parameters: @@ -1215,7 +1253,7 @@ paths: summary: Fetch the raw value associated with the given key in the chain state tags: - chains - /chains/{chainID}/ws: + /v2chains/{chainID}/ws: get: operationId: attachToWebsocket parameters: @@ -1232,7 +1270,7 @@ paths: description: successful operation tags: - chains - /metrics/chain/{chainID}: + /v2metrics/chain/{chainID}: get: operationId: getChainMetrics parameters: @@ -1261,7 +1299,7 @@ paths: summary: Get chain specific metrics. tags: - metrics - /metrics/chain/{chainID}/pipe: + /v2metrics/chain/{chainID}/pipe: get: operationId: getChainPipeMetrics parameters: @@ -1290,7 +1328,7 @@ paths: summary: Get chain pipe event metrics. tags: - metrics - /metrics/chain/{chainID}/workflow: + /v2metrics/chain/{chainID}/workflow: get: operationId: getChainWorkflowMetrics parameters: @@ -1319,7 +1357,7 @@ paths: summary: Get chain workflow metrics. tags: - metrics - /metrics/l1: + /v2metrics/l1: get: operationId: getL1Metrics responses: @@ -1340,7 +1378,7 @@ paths: summary: Get accumulated metrics. tags: - metrics - /node/config: + /v2node/config: get: operationId: getConfiguration responses: @@ -1365,7 +1403,7 @@ paths: summary: Return the Wasp configuration tags: - node - /node/dks: + /v2node/dks: post: operationId: generateDKS requestBody: @@ -1394,7 +1432,7 @@ paths: tags: - node x-codegen-request-body-name: DKSharesPostRequest - /node/dks/{sharedAddress}: + /v2node/dks/{sharedAddress}: get: operationId: getDKSInfo parameters: @@ -1423,7 +1461,7 @@ paths: summary: Get information about the shared address DKS configuration tags: - node - /node/info: + /v2node/info: get: operationId: getInfo responses: @@ -1444,7 +1482,7 @@ paths: summary: Returns private information about this node. tags: - node - /node/owner/certificate: + /v2node/owner/certificate: post: operationId: setNodeOwner requestBody: @@ -1470,7 +1508,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /node/peers: + /v2node/peers: get: operationId: getAllPeers responses: @@ -1493,7 +1531,7 @@ paths: summary: Get basic information about all configured peers tags: - node - /node/peers/identity: + /v2node/peers/identity: get: operationId: getPeeringIdentity responses: @@ -1514,7 +1552,7 @@ paths: summary: Get basic peer info of the current node tags: - node - /node/peers/trusted: + /v2node/peers/trusted: delete: operationId: distrustPeer requestBody: @@ -1587,7 +1625,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /node/shutdown: + /v2node/shutdown: post: operationId: shutdownNode responses: @@ -1605,7 +1643,7 @@ paths: summary: Shut down the node tags: - node - /node/version: + /v2node/version: get: operationId: getVersion responses: @@ -1619,7 +1657,7 @@ paths: summary: Returns the node version. tags: - node - /requests/callview: + /v2requests/callview: post: description: "Execute a view call. Either use HName or Name properties. If both\ \ are supplied, HName are used." @@ -1642,7 +1680,7 @@ paths: tags: - requests x-codegen-request-body-name: "" - /requests/offledger: + /v2requests/offledger: post: operationId: offLedger requestBody: @@ -1660,7 +1698,7 @@ paths: tags: - requests x-codegen-request-body-name: "" - /users: + /v2users: get: operationId: getUsers responses: @@ -1711,7 +1749,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /users/{username}: + /v2users/{username}: delete: operationId: deleteUser parameters: @@ -1771,7 +1809,7 @@ paths: summary: Get a user tags: - users - /users/{username}/password: + /v2users/{username}/password: put: operationId: changeUserPassword parameters: @@ -1808,7 +1846,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /users/{username}/permissions: + /v2users/{username}/permissions: put: operationId: changeUserPermissions parameters: @@ -2016,6 +2054,28 @@ components: type: object xml: name: AssetsResponse + AuthInfoModel: + example: + authURL: authURL + scheme: scheme + properties: + authURL: + description: JWT only + format: string + type: string + xml: + name: AuthURL + scheme: + format: string + type: string + xml: + name: Scheme + required: + - authURL + - scheme + type: object + xml: + name: AuthInfoModel BaseToken: example: unit: TEST @@ -2066,49 +2126,61 @@ components: type: boolean xml: name: UseMetricPrefix + required: + - decimals + - name + - subunit + - tickerSymbol + - unit + - useMetricPrefix type: object xml: name: BaseToken Blob: example: - Size: 0 - Hash: Hash + size: 0 + hash: hash properties: - Hash: + hash: format: string type: string xml: name: Hash - Size: + size: format: int32 type: integer xml: name: Size + required: + - hash + - size type: object xml: name: Blob BlobInfoResponse: example: - Fields: + fields: key: 0 properties: - Fields: + fields: additionalProperties: format: int32 type: integer type: object xml: name: Fields + required: + - fields type: object xml: name: BlobInfoResponse BlobListResponse: example: Blobs: - - Size: 0 - Hash: Hash - - Size: 0 - Hash: Hash + - size: 0 + hash: hash + - size: 0 + hash: hash properties: Blobs: items: @@ -2122,13 +2194,15 @@ components: name: BlobListResponse BlobValueResponse: example: - ValueData: ValueData + valueData: valueData properties: - ValueData: + valueData: format: string type: string xml: name: ValueData + required: + - valueData type: object xml: name: BlobValueResponse @@ -2259,11 +2333,11 @@ components: example: receipts: - gasBurnLog: - Records: - - GasBurned: 5 - Code: 1 - - GasBurned: 5 - Code: 1 + records: + - code: 1 + gasBurned: 5 + - code: 1 + gasBurned: 5 request: fungibleTokens: baseTokens: 7 @@ -2312,11 +2386,11 @@ components: errorMessage: errorMessage hash: hash - gasBurnLog: - Records: - - GasBurned: 5 - Code: 1 - - GasBurned: 5 - Code: 1 + records: + - code: 1 + gasBurned: 5 + - code: 1 + gasBurned: 5 request: fungibleTokens: baseTokens: 7 @@ -2379,37 +2453,42 @@ components: name: BlockReceiptsResponse BurnLog: example: - Records: - - GasBurned: 5 - Code: 1 - - GasBurned: 5 - Code: 1 + records: + - code: 1 + gasBurned: 5 + - code: 1 + gasBurned: 5 properties: - Records: + records: items: $ref: '#/components/schemas/BurnRecord' type: array xml: name: Records wrapped: true + required: + - records type: object xml: name: BurnLog BurnRecord: example: - GasBurned: 5 - Code: 1 + code: 1 + gasBurned: 5 properties: - Code: + code: format: int32 type: integer xml: name: Code - GasBurned: + gasBurned: format: int64 type: integer xml: name: GasBurned + required: + - code + - gasBurned type: object xml: name: BurnRecord @@ -3662,6 +3741,48 @@ components: type: object xml: name: L1Params + LoginRequest: + example: + password: password + username: username + properties: + password: + format: string + type: string + xml: + name: Password + username: + format: string + type: string + xml: + name: Username + required: + - password + - username + type: object + xml: + name: LoginRequest + LoginResponse: + example: + jwt: jwt + error: error + properties: + error: + format: string + type: string + xml: + name: Error + jwt: + format: string + type: string + xml: + name: JWT + required: + - error + - jwt + type: object + xml: + name: LoginResponse NFTDataResponse: example: owner: owner @@ -4173,10 +4294,10 @@ components: ReceiptResponse: example: gasBurnLog: - - GasBurned: 5 - Code: 1 - - GasBurned: 5 - Code: 1 + - code: 1 + gasBurned: 5 + - code: 1 + gasBurned: 5 request: request blockIndex: 1 requestIndex: 1 @@ -4426,11 +4547,11 @@ components: RequestReceiptResponse: example: gasBurnLog: - Records: - - GasBurned: 5 - Code: 1 - - GasBurned: 5 - Code: 1 + records: + - code: 1 + gasBurned: 5 + - code: 1 + gasBurned: 5 request: fungibleTokens: baseTokens: 7 @@ -4514,7 +4635,6 @@ components: name: RequestIndex required: - blockIndex - - error - gasBudget - gasBurnLog - gasBurned diff --git a/clients/apiclient/api_auth.go b/clients/apiclient/api_auth.go new file mode 100644 index 0000000000..ed40a9897b --- /dev/null +++ b/clients/apiclient/api_auth.go @@ -0,0 +1,229 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// AuthApiService AuthApi service +type AuthApiService service + +type ApiAuthInfoRequest struct { + ctx context.Context + ApiService *AuthApiService +} + +func (r ApiAuthInfoRequest) Execute() (*AuthInfoModel, *http.Response, error) { + return r.ApiService.AuthInfoExecute(r) +} + +/* +AuthInfo Get information about the current authentication mode + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthInfoRequest +*/ +func (a *AuthApiService) AuthInfo(ctx context.Context) ApiAuthInfoRequest { + return ApiAuthInfoRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AuthInfoModel +func (a *AuthApiService) AuthInfoExecute(r ApiAuthInfoRequest) (*AuthInfoModel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthInfoModel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthApiService.AuthInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/auth/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticateRequest struct { + ctx context.Context + ApiService *AuthApiService + loginRequest *LoginRequest +} + +// The login request +func (r ApiAuthenticateRequest) LoginRequest(loginRequest LoginRequest) ApiAuthenticateRequest { + r.loginRequest = &loginRequest + return r +} + +func (r ApiAuthenticateRequest) Execute() (*LoginResponse, *http.Response, error) { + return r.ApiService.AuthenticateExecute(r) +} + +/* +Authenticate Authenticate towards the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticateRequest +*/ +func (a *AuthApiService) Authenticate(ctx context.Context) ApiAuthenticateRequest { + return ApiAuthenticateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return LoginResponse +func (a *AuthApiService) AuthenticateExecute(r ApiAuthenticateRequest) (*LoginResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LoginResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthApiService.Authenticate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/auth" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.loginRequest == nil { + return localVarReturnValue, nil, reportError("loginRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.loginRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index 94831f2095..258b0934b1 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -61,7 +61,7 @@ func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/activate" + localVarPath := localBasePath + "/v2chains/{chainID}/activate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -178,7 +178,7 @@ func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/v2chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -293,7 +293,7 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/ws" + localVarPath := localBasePath + "/v2chains/{chainID}/ws" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -383,7 +383,7 @@ func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) ( return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/deactivate" + localVarPath := localBasePath + "/v2chains/{chainID}/deactivate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -499,7 +499,7 @@ func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*Chain return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}" + localVarPath := localBasePath + "/v2chains/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -621,7 +621,7 @@ func (a *ChainsApiService) GetChainsExecute(r ApiGetChainsRequest) ([]ChainInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains" + localVarPath := localBasePath + "/v2chains" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -745,7 +745,7 @@ func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/committee" + localVarPath := localBasePath + "/v2chains/{chainID}/committee" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -870,7 +870,7 @@ func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]Cont return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/contracts" + localVarPath := localBasePath + "/v2chains/{chainID}/contracts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -998,7 +998,7 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/evm/tx/{txHash}" + localVarPath := localBasePath + "/v2chains/{chainID}/evm/tx/{txHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) @@ -1113,7 +1113,7 @@ func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) (*Sta return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/state/{stateKey}" + localVarPath := localBasePath + "/v2chains/{chainID}/state/{stateKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterValueToString(r.stateKey, "stateKey")), -1) @@ -1216,7 +1216,7 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/v2chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index ce07e36354..5fd6d0a237 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -66,7 +66,7 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/balance" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/account/{agentID}/balance" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -181,7 +181,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nfts" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/account/{agentID}/nfts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -296,7 +296,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nonce" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/account/{agentID}/nonce" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -408,7 +408,7 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -522,7 +522,7 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/foundry_output" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/foundry_output" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"chainID_"+"}", url.PathEscape(parameterValueToString(r.chainID2, "chainID2")), -1) @@ -637,7 +637,7 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/nftdata" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/nftdata" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterValueToString(r.nftID, "nftID")), -1) @@ -749,7 +749,7 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/token_registry" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/token_registry" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -860,7 +860,7 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/total_assets" + localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/total_assets" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -971,7 +971,7 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blobs" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blobs" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1085,7 +1085,7 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blobs/{blobHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) @@ -1203,7 +1203,7 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterValueToString(r.fieldKey, "fieldKey")), -1) @@ -1319,7 +1319,7 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -1431,7 +1431,7 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/controladdresses" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/controladdresses" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1545,7 +1545,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/{blockIndex}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/block/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -1660,7 +1660,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/contract/{contractHname}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/contract/{contractHname}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) @@ -1772,7 +1772,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/latest" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/block/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1886,7 +1886,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/request/{requestID}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/request/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -1998,7 +1998,7 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2112,7 +2112,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -2224,7 +2224,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/requestids" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/latest/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2338,7 +2338,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2453,7 +2453,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/requests/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2568,7 +2568,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -2680,7 +2680,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/receipts" + localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/latest/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2797,7 +2797,7 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" + localVarPath := localBasePath + "/v2chains/{chainID}/core/errors/{contractHname}/message/{errorID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterValueToString(r.errorID, "errorID")), -1) @@ -2912,7 +2912,7 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/governance/chaininfo" + localVarPath := localBasePath + "/v2chains/{chainID}/core/governance/chaininfo" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) diff --git a/clients/apiclient/api_metrics.go b/clients/apiclient/api_metrics.go index 0e17605fce..d73a582462 100644 --- a/clients/apiclient/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -63,7 +63,7 @@ func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/chain/{chainID}" + localVarPath := localBasePath + "/v2metrics/chain/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -188,7 +188,7 @@ func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/chain/{chainID}/pipe" + localVarPath := localBasePath + "/v2metrics/chain/{chainID}/pipe" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -313,7 +313,7 @@ func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflow return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/chain/{chainID}/workflow" + localVarPath := localBasePath + "/v2metrics/chain/{chainID}/workflow" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *MetricsApiService) GetL1MetricsExecute(r ApiGetL1MetricsRequest) (*Chai return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/l1" + localVarPath := localBasePath + "/v2metrics/l1" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index b742160200..0976505c99 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func (a *NodeApiService) DistrustPeerExecute(r ApiDistrustPeerRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/trusted" + localVarPath := localBasePath + "/v2node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -189,7 +189,7 @@ func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesP return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/dks" + localVarPath := localBasePath + "/v2node/dks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -315,7 +315,7 @@ func (a *NodeApiService) GetAllPeersExecute(r ApiGetAllPeersRequest) ([]PeeringN return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers" + localVarPath := localBasePath + "/v2node/peers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -436,7 +436,7 @@ func (a *NodeApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/config" + localVarPath := localBasePath + "/v2node/config" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -560,7 +560,7 @@ func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInf return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/dks/{sharedAddress}" + localVarPath := localBasePath + "/v2node/dks/{sharedAddress}" localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) localVarHeaderParams := make(map[string]string) @@ -682,7 +682,7 @@ func (a *NodeApiService) GetInfoExecute(r ApiGetInfoRequest) (*InfoResponse, *ht return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/info" + localVarPath := localBasePath + "/v2node/info" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -803,7 +803,7 @@ func (a *NodeApiService) GetPeeringIdentityExecute(r ApiGetPeeringIdentityReques return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/identity" + localVarPath := localBasePath + "/v2node/peers/identity" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -924,7 +924,7 @@ func (a *NodeApiService) GetTrustedPeersExecute(r ApiGetTrustedPeersRequest) ([] return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/trusted" + localVarPath := localBasePath + "/v2node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1045,7 +1045,7 @@ func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (string, *htt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/version" + localVarPath := localBasePath + "/v2node/version" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1147,7 +1147,7 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/owner/certificate" + localVarPath := localBasePath + "/v2node/owner/certificate" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1262,7 +1262,7 @@ func (a *NodeApiService) ShutdownNodeExecute(r ApiShutdownNodeRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/shutdown" + localVarPath := localBasePath + "/v2node/shutdown" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1379,7 +1379,7 @@ func (a *NodeApiService) TrustPeerExecute(r ApiTrustPeerRequest) (*http.Response return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/trusted" + localVarPath := localBasePath + "/v2node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index f19d85a6d9..64b489d994 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -69,7 +69,7 @@ func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, * return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/requests/callview" + localVarPath := localBasePath + "/v2requests/callview" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -177,7 +177,7 @@ func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*Receipt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/receipts/{requestID}" + localVarPath := localBasePath + "/v2chains/{chainID}/receipts/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -281,7 +281,7 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/requests/offledger" + localVarPath := localBasePath + "/v2requests/offledger" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -380,7 +380,7 @@ func (a *RequestsApiService) WaitForTransactionExecute(r ApiWaitForTransactionRe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/requests/{requestID}/wait" + localVarPath := localBasePath + "/v2chains/{chainID}/requests/{requestID}/wait" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) diff --git a/clients/apiclient/api_users.go b/clients/apiclient/api_users.go index 168e6cfd63..494a686467 100644 --- a/clients/apiclient/api_users.go +++ b/clients/apiclient/api_users.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func (a *UsersApiService) AddUserExecute(r ApiAddUserRequest) (*http.Response, e return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users" + localVarPath := localBasePath + "/v2users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -190,7 +190,7 @@ func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordReque return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}/password" + localVarPath := localBasePath + "/v2users/{username}/password" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -316,7 +316,7 @@ func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermission return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}/permissions" + localVarPath := localBasePath + "/v2users/{username}/permissions" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respo return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}" + localVarPath := localBasePath + "/v2users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -552,7 +552,7 @@ func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Resp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}" + localVarPath := localBasePath + "/v2users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -675,7 +675,7 @@ func (a *UsersApiService) GetUsersExecute(r ApiGetUsersRequest) ([]User, *http.R return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users" + localVarPath := localBasePath + "/v2users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go index 49560be886..314eb0380f 100644 --- a/clients/apiclient/client.go +++ b/clients/apiclient/client.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Wasp API API v0.4.0-alpha.2-403-g907bc6c54 +// APIClient manages communication with the Wasp API API v123 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -50,6 +50,8 @@ type APIClient struct { // API Services + AuthApi *AuthApiService + ChainsApi *ChainsApiService CorecontractsApi *CorecontractsApiService @@ -79,6 +81,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.AuthApi = (*AuthApiService)(&c.common) c.ChainsApi = (*ChainsApiService)(&c.common) c.CorecontractsApi = (*CorecontractsApiService)(&c.common) c.MetricsApi = (*MetricsApiService)(&c.common) diff --git a/clients/apiclient/configuration.go b/clients/apiclient/configuration.go index 3d39f8019e..6561422c43 100644 --- a/clients/apiclient/configuration.go +++ b/clients/apiclient/configuration.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/docs/AuthApi.md b/clients/apiclient/docs/AuthApi.md new file mode 100644 index 0000000000..619c0c8f7b --- /dev/null +++ b/clients/apiclient/docs/AuthApi.md @@ -0,0 +1,133 @@ +# \AuthApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AuthInfo**](AuthApi.md#AuthInfo) | **Get** /auth/info | Get information about the current authentication mode +[**Authenticate**](AuthApi.md#Authenticate) | **Post** /auth | Authenticate towards the node + + + +## AuthInfo + +> AuthInfoModel AuthInfo(ctx).Execute() + +Get information about the current authentication mode + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthApi.AuthInfo(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.AuthInfo``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AuthInfo`: AuthInfoModel + fmt.Fprintf(os.Stdout, "Response from `AuthApi.AuthInfo`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAuthInfoRequest struct via the builder pattern + + +### Return type + +[**AuthInfoModel**](AuthInfoModel.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) + + +## Authenticate + +> LoginResponse Authenticate(ctx).LoginRequest(loginRequest).Execute() + +Authenticate towards the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + loginRequest := *openapiclient.NewLoginRequest("Password_example", "Username_example") // LoginRequest | The login request + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthApi.Authenticate(context.Background()).LoginRequest(loginRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.Authenticate``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Authenticate`: LoginResponse + fmt.Fprintf(os.Stdout, "Response from `AuthApi.Authenticate`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAuthenticateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loginRequest** | [**LoginRequest**](LoginRequest.md) | The login request | + +### Return type + +[**LoginResponse**](LoginResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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/clients/apiclient/docs/AuthInfoModel.md b/clients/apiclient/docs/AuthInfoModel.md new file mode 100644 index 0000000000..30106979e1 --- /dev/null +++ b/clients/apiclient/docs/AuthInfoModel.md @@ -0,0 +1,72 @@ +# AuthInfoModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AuthURL** | **string** | JWT only | +**Scheme** | **string** | | + +## Methods + +### NewAuthInfoModel + +`func NewAuthInfoModel(authURL string, scheme string, ) *AuthInfoModel` + +NewAuthInfoModel instantiates a new AuthInfoModel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAuthInfoModelWithDefaults + +`func NewAuthInfoModelWithDefaults() *AuthInfoModel` + +NewAuthInfoModelWithDefaults instantiates a new AuthInfoModel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAuthURL + +`func (o *AuthInfoModel) GetAuthURL() string` + +GetAuthURL returns the AuthURL field if non-nil, zero value otherwise. + +### GetAuthURLOk + +`func (o *AuthInfoModel) GetAuthURLOk() (*string, bool)` + +GetAuthURLOk returns a tuple with the AuthURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthURL + +`func (o *AuthInfoModel) SetAuthURL(v string)` + +SetAuthURL sets AuthURL field to given value. + + +### GetScheme + +`func (o *AuthInfoModel) GetScheme() string` + +GetScheme returns the Scheme field if non-nil, zero value otherwise. + +### GetSchemeOk + +`func (o *AuthInfoModel) GetSchemeOk() (*string, bool)` + +GetSchemeOk returns a tuple with the Scheme field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheme + +`func (o *AuthInfoModel) SetScheme(v string)` + +SetScheme sets Scheme field to given value. + + + +[[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/clients/apiclient/docs/BaseToken.md b/clients/apiclient/docs/BaseToken.md index 97abbbbd95..dddf71612e 100644 --- a/clients/apiclient/docs/BaseToken.md +++ b/clients/apiclient/docs/BaseToken.md @@ -4,18 +4,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Decimals** | Pointer to **int32** | The token decimals | [optional] -**Name** | Pointer to **string** | The base token name | [optional] -**Subunit** | Pointer to **string** | The token subunit | [optional] -**TickerSymbol** | Pointer to **string** | The ticker symbol | [optional] -**Unit** | Pointer to **string** | The token unit | [optional] -**UseMetricPrefix** | Pointer to **bool** | Whether or not the token uses a metric prefix | [optional] +**Decimals** | **int32** | The token decimals | +**Name** | **string** | The base token name | +**Subunit** | **string** | The token subunit | +**TickerSymbol** | **string** | The ticker symbol | +**Unit** | **string** | The token unit | +**UseMetricPrefix** | **bool** | Whether or not the token uses a metric prefix | ## Methods ### NewBaseToken -`func NewBaseToken() *BaseToken` +`func NewBaseToken(decimals int32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool, ) *BaseToken` NewBaseToken instantiates a new BaseToken object This constructor will assign default values to properties that have it defined, @@ -49,11 +49,6 @@ and a boolean to check if the value has been set. SetDecimals sets Decimals field to given value. -### HasDecimals - -`func (o *BaseToken) HasDecimals() bool` - -HasDecimals returns a boolean if a field has been set. ### GetName @@ -74,11 +69,6 @@ and a boolean to check if the value has been set. SetName sets Name field to given value. -### HasName - -`func (o *BaseToken) HasName() bool` - -HasName returns a boolean if a field has been set. ### GetSubunit @@ -99,11 +89,6 @@ and a boolean to check if the value has been set. SetSubunit sets Subunit field to given value. -### HasSubunit - -`func (o *BaseToken) HasSubunit() bool` - -HasSubunit returns a boolean if a field has been set. ### GetTickerSymbol @@ -124,11 +109,6 @@ and a boolean to check if the value has been set. SetTickerSymbol sets TickerSymbol field to given value. -### HasTickerSymbol - -`func (o *BaseToken) HasTickerSymbol() bool` - -HasTickerSymbol returns a boolean if a field has been set. ### GetUnit @@ -149,11 +129,6 @@ and a boolean to check if the value has been set. SetUnit sets Unit field to given value. -### HasUnit - -`func (o *BaseToken) HasUnit() bool` - -HasUnit returns a boolean if a field has been set. ### GetUseMetricPrefix @@ -174,11 +149,6 @@ and a boolean to check if the value has been set. SetUseMetricPrefix sets UseMetricPrefix field to given value. -### HasUseMetricPrefix - -`func (o *BaseToken) HasUseMetricPrefix() bool` - -HasUseMetricPrefix returns a boolean if a field has been set. [[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/clients/apiclient/docs/Blob.md b/clients/apiclient/docs/Blob.md index 1fb2ad7ceb..6cd815d639 100644 --- a/clients/apiclient/docs/Blob.md +++ b/clients/apiclient/docs/Blob.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Hash** | Pointer to **string** | | [optional] -**Size** | Pointer to **int32** | | [optional] +**Hash** | **string** | | +**Size** | **int32** | | ## Methods ### NewBlob -`func NewBlob() *Blob` +`func NewBlob(hash string, size int32, ) *Blob` NewBlob instantiates a new Blob object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetHash sets Hash field to given value. -### HasHash - -`func (o *Blob) HasHash() bool` - -HasHash returns a boolean if a field has been set. ### GetSize @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetSize sets Size field to given value. -### HasSize - -`func (o *Blob) HasSize() bool` - -HasSize returns a boolean if a field has been set. [[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/clients/apiclient/docs/BlobInfoResponse.md b/clients/apiclient/docs/BlobInfoResponse.md index d48bea3d06..81aecc6485 100644 --- a/clients/apiclient/docs/BlobInfoResponse.md +++ b/clients/apiclient/docs/BlobInfoResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Fields** | Pointer to **map[string]int32** | | [optional] +**Fields** | **map[string]int32** | | ## Methods ### NewBlobInfoResponse -`func NewBlobInfoResponse() *BlobInfoResponse` +`func NewBlobInfoResponse(fields map[string]int32, ) *BlobInfoResponse` NewBlobInfoResponse instantiates a new BlobInfoResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetFields sets Fields field to given value. -### HasFields - -`func (o *BlobInfoResponse) HasFields() bool` - -HasFields returns a boolean if a field has been set. [[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/clients/apiclient/docs/BlobValueResponse.md b/clients/apiclient/docs/BlobValueResponse.md index 97dfde8c79..7a2ad5e0ba 100644 --- a/clients/apiclient/docs/BlobValueResponse.md +++ b/clients/apiclient/docs/BlobValueResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ValueData** | Pointer to **string** | | [optional] +**ValueData** | **string** | | ## Methods ### NewBlobValueResponse -`func NewBlobValueResponse() *BlobValueResponse` +`func NewBlobValueResponse(valueData string, ) *BlobValueResponse` NewBlobValueResponse instantiates a new BlobValueResponse object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetValueData sets ValueData field to given value. -### HasValueData - -`func (o *BlobValueResponse) HasValueData() bool` - -HasValueData returns a boolean if a field has been set. [[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/clients/apiclient/docs/BurnLog.md b/clients/apiclient/docs/BurnLog.md index 269b5fd5f2..53d223a00d 100644 --- a/clients/apiclient/docs/BurnLog.md +++ b/clients/apiclient/docs/BurnLog.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Records** | Pointer to [**[]BurnRecord**](BurnRecord.md) | | [optional] +**Records** | [**[]BurnRecord**](BurnRecord.md) | | ## Methods ### NewBurnLog -`func NewBurnLog() *BurnLog` +`func NewBurnLog(records []BurnRecord, ) *BurnLog` NewBurnLog instantiates a new BurnLog object This constructor will assign default values to properties that have it defined, @@ -44,11 +44,6 @@ and a boolean to check if the value has been set. SetRecords sets Records field to given value. -### HasRecords - -`func (o *BurnLog) HasRecords() bool` - -HasRecords returns a boolean if a field has been set. [[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/clients/apiclient/docs/BurnRecord.md b/clients/apiclient/docs/BurnRecord.md index c4e2b5941b..840ebc129b 100644 --- a/clients/apiclient/docs/BurnRecord.md +++ b/clients/apiclient/docs/BurnRecord.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | Pointer to **int32** | | [optional] -**GasBurned** | Pointer to **int64** | | [optional] +**Code** | **int32** | | +**GasBurned** | **int64** | | ## Methods ### NewBurnRecord -`func NewBurnRecord() *BurnRecord` +`func NewBurnRecord(code int32, gasBurned int64, ) *BurnRecord` NewBurnRecord instantiates a new BurnRecord object This constructor will assign default values to properties that have it defined, @@ -45,11 +45,6 @@ and a boolean to check if the value has been set. SetCode sets Code field to given value. -### HasCode - -`func (o *BurnRecord) HasCode() bool` - -HasCode returns a boolean if a field has been set. ### GetGasBurned @@ -70,11 +65,6 @@ and a boolean to check if the value has been set. SetGasBurned sets GasBurned field to given value. -### HasGasBurned - -`func (o *BurnRecord) HasGasBurned() bool` - -HasGasBurned returns a boolean if a field has been set. [[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/clients/apiclient/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md index 1aa5915187..4c18cee3cc 100644 --- a/clients/apiclient/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -4,17 +4,17 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /chains/{chainID}/activate | Activate a chain -[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. -[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /chains/{chainID}/ws | -[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain -[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /chains/{chainID} | Get information about a specific chain -[**GetChains**](ChainsApi.md#GetChains) | **Get** /chains | Get a list of all chains -[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee -[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts -[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash -[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state -[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. +[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /v2chains/{chainID}/activate | Activate a chain +[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /v2chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. +[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /v2chains/{chainID}/ws | +[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /v2chains/{chainID}/deactivate | Deactivate a chain +[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /v2chains/{chainID} | Get information about a specific chain +[**GetChains**](ChainsApi.md#GetChains) | **Get** /v2chains | Get a list of all chains +[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /v2chains/{chainID}/committee | Get information about the deployed committee +[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /v2chains/{chainID}/contracts | Get all available chain contracts +[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /v2chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /v2chains/{chainID}/access-node/{publicKey} | Remove an access node. diff --git a/clients/apiclient/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md index ed217e9dd4..39efbe439c 100644 --- a/clients/apiclient/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -4,32 +4,32 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account -[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account -[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account -[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /chains/{chainID}/core/accounts | Get a list of all accounts -[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /chains/{chainID}/core/accounts/foundry_output | Get the foundry output -[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID -[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /chains/{chainID}/core/accounts/token_registry | Get a list of all registries -[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /chains/{chainID}/core/accounts/total_assets | Get all stored assets -[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /chains/{chainID}/core/blobs | Get all stored blobs -[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob -[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) -[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index -[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /chains/{chainID}/core/blocklog/controladdresses | Get the control addresses -[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block -[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract -[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block -[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request -[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block -[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index -[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block -[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status -[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id -[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block -[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block -[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id -[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /chains/{chainID}/core/governance/chaininfo | Get the chain info +[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /v2chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /v2chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /v2chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /v2chains/{chainID}/core/accounts | Get a list of all accounts +[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /v2chains/{chainID}/core/accounts/foundry_output | Get the foundry output +[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /v2chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /v2chains/{chainID}/core/accounts/token_registry | Get a list of all registries +[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /v2chains/{chainID}/core/accounts/total_assets | Get all stored assets +[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /v2chains/{chainID}/core/blobs | Get all stored blobs +[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /v2chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /v2chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /v2chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /v2chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /v2chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /v2chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /v2chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /v2chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /v2chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /v2chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /v2chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2chains/{chainID}/core/governance/chaininfo | Get the chain info diff --git a/clients/apiclient/docs/LoginRequest.md b/clients/apiclient/docs/LoginRequest.md new file mode 100644 index 0000000000..a83ab06d9f --- /dev/null +++ b/clients/apiclient/docs/LoginRequest.md @@ -0,0 +1,72 @@ +# LoginRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Password** | **string** | | +**Username** | **string** | | + +## Methods + +### NewLoginRequest + +`func NewLoginRequest(password string, username string, ) *LoginRequest` + +NewLoginRequest instantiates a new LoginRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLoginRequestWithDefaults + +`func NewLoginRequestWithDefaults() *LoginRequest` + +NewLoginRequestWithDefaults instantiates a new LoginRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPassword + +`func (o *LoginRequest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *LoginRequest) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *LoginRequest) SetPassword(v string)` + +SetPassword sets Password field to given value. + + +### GetUsername + +`func (o *LoginRequest) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *LoginRequest) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *LoginRequest) SetUsername(v string)` + +SetUsername sets Username field to given value. + + + +[[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/clients/apiclient/docs/LoginResponse.md b/clients/apiclient/docs/LoginResponse.md new file mode 100644 index 0000000000..127bebfead --- /dev/null +++ b/clients/apiclient/docs/LoginResponse.md @@ -0,0 +1,72 @@ +# LoginResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | | +**Jwt** | **string** | | + +## Methods + +### NewLoginResponse + +`func NewLoginResponse(error_ string, jwt string, ) *LoginResponse` + +NewLoginResponse instantiates a new LoginResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLoginResponseWithDefaults + +`func NewLoginResponseWithDefaults() *LoginResponse` + +NewLoginResponseWithDefaults instantiates a new LoginResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *LoginResponse) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *LoginResponse) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *LoginResponse) SetError(v string)` + +SetError sets Error field to given value. + + +### GetJwt + +`func (o *LoginResponse) GetJwt() string` + +GetJwt returns the Jwt field if non-nil, zero value otherwise. + +### GetJwtOk + +`func (o *LoginResponse) GetJwtOk() (*string, bool)` + +GetJwtOk returns a tuple with the Jwt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJwt + +`func (o *LoginResponse) SetJwt(v string)` + +SetJwt sets Jwt field to given value. + + + +[[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/clients/apiclient/docs/MetricsApi.md b/clients/apiclient/docs/MetricsApi.md index 83f5ab2f3b..355bce2eb2 100644 --- a/clients/apiclient/docs/MetricsApi.md +++ b/clients/apiclient/docs/MetricsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /metrics/chain/{chainID} | Get chain specific metrics. -[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /metrics/chain/{chainID}/pipe | Get chain pipe event metrics. -[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /metrics/chain/{chainID}/workflow | Get chain workflow metrics. -[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /metrics/l1 | Get accumulated metrics. +[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /v2metrics/chain/{chainID} | Get chain specific metrics. +[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /v2metrics/chain/{chainID}/pipe | Get chain pipe event metrics. +[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /v2metrics/chain/{chainID}/workflow | Get chain workflow metrics. +[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /v2metrics/l1 | Get accumulated metrics. diff --git a/clients/apiclient/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md index fa3d29dab5..4ad15a0fb8 100644 --- a/clients/apiclient/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -4,18 +4,18 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /node/peers/trusted | Distrust a peering node -[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /node/dks | Generate a new distributed key -[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /node/peers | Get basic information about all configured peers -[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /node/config | Return the Wasp configuration -[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /node/dks/{sharedAddress} | Get information about the shared address DKS configuration -[**GetInfo**](NodeApi.md#GetInfo) | **Get** /node/info | Returns private information about this node. -[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /node/peers/identity | Get basic peer info of the current node -[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /node/peers/trusted | Get trusted peers -[**GetVersion**](NodeApi.md#GetVersion) | **Get** /node/version | Returns the node version. -[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /node/owner/certificate | Sets the node owner -[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /node/shutdown | Shut down the node -[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /node/peers/trusted | Trust a peering node +[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /v2node/peers/trusted | Distrust a peering node +[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /v2node/dks | Generate a new distributed key +[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /v2node/peers | Get basic information about all configured peers +[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /v2node/config | Return the Wasp configuration +[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /v2node/dks/{sharedAddress} | Get information about the shared address DKS configuration +[**GetInfo**](NodeApi.md#GetInfo) | **Get** /v2node/info | Returns private information about this node. +[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /v2node/peers/identity | Get basic peer info of the current node +[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /v2node/peers/trusted | Get trusted peers +[**GetVersion**](NodeApi.md#GetVersion) | **Get** /v2node/version | Returns the node version. +[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /v2node/owner/certificate | Sets the node owner +[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /v2node/shutdown | Shut down the node +[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /v2node/peers/trusted | Trust a peering node diff --git a/clients/apiclient/docs/RequestReceiptResponse.md b/clients/apiclient/docs/RequestReceiptResponse.md index a4eafa043f..06b2be0191 100644 --- a/clients/apiclient/docs/RequestReceiptResponse.md +++ b/clients/apiclient/docs/RequestReceiptResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BlockIndex** | **uint32** | | -**Error** | [**BlockReceiptError**](BlockReceiptError.md) | | +**Error** | Pointer to [**BlockReceiptError**](BlockReceiptError.md) | | [optional] **GasBudget** | **int64** | | **GasBurnLog** | [**BurnLog**](BurnLog.md) | | **GasBurned** | **int64** | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ### NewRequestReceiptResponse -`func NewRequestReceiptResponse(blockIndex uint32, error_ BlockReceiptError, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32, ) *RequestReceiptResponse` +`func NewRequestReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32, ) *RequestReceiptResponse` NewRequestReceiptResponse instantiates a new RequestReceiptResponse object This constructor will assign default values to properties that have it defined, @@ -71,6 +71,11 @@ and a boolean to check if the value has been set. SetError sets Error field to given value. +### HasError + +`func (o *RequestReceiptResponse) HasError() bool` + +HasError returns a boolean if a field has been set. ### GetGasBudget diff --git a/clients/apiclient/docs/RequestsApi.md b/clients/apiclient/docs/RequestsApi.md index 39368df2fe..27ad2c03ac 100644 --- a/clients/apiclient/docs/RequestsApi.md +++ b/clients/apiclient/docs/RequestsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CallView**](RequestsApi.md#CallView) | **Post** /requests/callview | Call a view function on a contract by Hname -[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID -[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /requests/offledger | Post an off-ledger request -[**WaitForTransaction**](RequestsApi.md#WaitForTransaction) | **Get** /chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +[**CallView**](RequestsApi.md#CallView) | **Post** /v2requests/callview | Call a view function on a contract by Hname +[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2requests/offledger | Post an off-ledger request +[**WaitForTransaction**](RequestsApi.md#WaitForTransaction) | **Get** /v2chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node diff --git a/clients/apiclient/docs/UsersApi.md b/clients/apiclient/docs/UsersApi.md index f5ea3cc788..fbf039ee28 100644 --- a/clients/apiclient/docs/UsersApi.md +++ b/clients/apiclient/docs/UsersApi.md @@ -4,12 +4,12 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AddUser**](UsersApi.md#AddUser) | **Post** /users | Add a user -[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /users/{username}/password | Change user password -[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /users/{username}/permissions | Change user permissions -[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /users/{username} | Deletes a user -[**GetUser**](UsersApi.md#GetUser) | **Get** /users/{username} | Get a user -[**GetUsers**](UsersApi.md#GetUsers) | **Get** /users | Get a list of all users +[**AddUser**](UsersApi.md#AddUser) | **Post** /v2users | Add a user +[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /v2users/{username}/password | Change user password +[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /v2users/{username}/permissions | Change user permissions +[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /v2users/{username} | Deletes a user +[**GetUser**](UsersApi.md#GetUser) | **Get** /v2users/{username} | Get a user +[**GetUsers**](UsersApi.md#GetUsers) | **Get** /v2users | Get a list of all users diff --git a/clients/apiclient/model_account_list_response.go b/clients/apiclient/model_account_list_response.go index 93566ba8fd..82e8ac76ac 100644 --- a/clients/apiclient/model_account_list_response.go +++ b/clients/apiclient/model_account_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nfts_response.go b/clients/apiclient/model_account_nfts_response.go index 7195f78854..7ad3b21b32 100644 --- a/clients/apiclient/model_account_nfts_response.go +++ b/clients/apiclient/model_account_nfts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nonce_response.go b/clients/apiclient/model_account_nonce_response.go index 8752b703a9..0980f2c43e 100644 --- a/clients/apiclient/model_account_nonce_response.go +++ b/clients/apiclient/model_account_nonce_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_add_user_request.go b/clients/apiclient/model_add_user_request.go index 6b85292ead..5d7eb41b01 100644 --- a/clients/apiclient/model_add_user_request.go +++ b/clients/apiclient/model_add_user_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_alias_output_metric_item.go b/clients/apiclient/model_alias_output_metric_item.go index 375417bbe8..af30c57f1e 100644 --- a/clients/apiclient/model_alias_output_metric_item.go +++ b/clients/apiclient/model_alias_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_allowance.go b/clients/apiclient/model_allowance.go index e7b2150cca..2151db83a2 100644 --- a/clients/apiclient/model_allowance.go +++ b/clients/apiclient/model_allowance.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets_response.go b/clients/apiclient/model_assets_response.go index 3c2610d651..154bed4967 100644 --- a/clients/apiclient/model_assets_response.go +++ b/clients/apiclient/model_assets_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_auth_info_model.go b/clients/apiclient/model_auth_info_model.go new file mode 100644 index 0000000000..3b5b12ffb5 --- /dev/null +++ b/clients/apiclient/model_auth_info_model.go @@ -0,0 +1,145 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the AuthInfoModel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthInfoModel{} + +// AuthInfoModel struct for AuthInfoModel +type AuthInfoModel struct { + // JWT only + AuthURL string `json:"authURL"` + Scheme string `json:"scheme"` +} + +// NewAuthInfoModel instantiates a new AuthInfoModel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthInfoModel(authURL string, scheme string) *AuthInfoModel { + this := AuthInfoModel{} + this.AuthURL = authURL + this.Scheme = scheme + return &this +} + +// NewAuthInfoModelWithDefaults instantiates a new AuthInfoModel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthInfoModelWithDefaults() *AuthInfoModel { + this := AuthInfoModel{} + return &this +} + +// GetAuthURL returns the AuthURL field value +func (o *AuthInfoModel) GetAuthURL() string { + if o == nil { + var ret string + return ret + } + + return o.AuthURL +} + +// GetAuthURLOk returns a tuple with the AuthURL field value +// and a boolean to check if the value has been set. +func (o *AuthInfoModel) GetAuthURLOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthURL, true +} + +// SetAuthURL sets field value +func (o *AuthInfoModel) SetAuthURL(v string) { + o.AuthURL = v +} + +// GetScheme returns the Scheme field value +func (o *AuthInfoModel) GetScheme() string { + if o == nil { + var ret string + return ret + } + + return o.Scheme +} + +// GetSchemeOk returns a tuple with the Scheme field value +// and a boolean to check if the value has been set. +func (o *AuthInfoModel) GetSchemeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Scheme, true +} + +// SetScheme sets field value +func (o *AuthInfoModel) SetScheme(v string) { + o.Scheme = v +} + +func (o AuthInfoModel) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthInfoModel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authURL"] = o.AuthURL + toSerialize["scheme"] = o.Scheme + return toSerialize, nil +} + +type NullableAuthInfoModel struct { + value *AuthInfoModel + isSet bool +} + +func (v NullableAuthInfoModel) Get() *AuthInfoModel { + return v.value +} + +func (v *NullableAuthInfoModel) Set(val *AuthInfoModel) { + v.value = val + v.isSet = true +} + +func (v NullableAuthInfoModel) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthInfoModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthInfoModel(val *AuthInfoModel) *NullableAuthInfoModel { + return &NullableAuthInfoModel{value: val, isSet: true} +} + +func (v NullableAuthInfoModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthInfoModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_base_token.go b/clients/apiclient/model_base_token.go index a827d85521..daed65e86e 100644 --- a/clients/apiclient/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,25 +20,31 @@ var _ MappedNullable = &BaseToken{} // BaseToken struct for BaseToken type BaseToken struct { // The token decimals - Decimals *int32 `json:"decimals,omitempty"` + Decimals int32 `json:"decimals"` // The base token name - Name *string `json:"name,omitempty"` + Name string `json:"name"` // The token subunit - Subunit *string `json:"subunit,omitempty"` + Subunit string `json:"subunit"` // The ticker symbol - TickerSymbol *string `json:"tickerSymbol,omitempty"` + TickerSymbol string `json:"tickerSymbol"` // The token unit - Unit *string `json:"unit,omitempty"` + Unit string `json:"unit"` // Whether or not the token uses a metric prefix - UseMetricPrefix *bool `json:"useMetricPrefix,omitempty"` + UseMetricPrefix bool `json:"useMetricPrefix"` } // NewBaseToken instantiates a new BaseToken object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBaseToken() *BaseToken { +func NewBaseToken(decimals int32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool) *BaseToken { this := BaseToken{} + this.Decimals = decimals + this.Name = name + this.Subunit = subunit + this.TickerSymbol = tickerSymbol + this.Unit = unit + this.UseMetricPrefix = useMetricPrefix return &this } @@ -50,196 +56,148 @@ func NewBaseTokenWithDefaults() *BaseToken { return &this } -// GetDecimals returns the Decimals field value if set, zero value otherwise. +// GetDecimals returns the Decimals field value func (o *BaseToken) GetDecimals() int32 { - if o == nil || isNil(o.Decimals) { + if o == nil { var ret int32 return ret } - return *o.Decimals + + return o.Decimals } -// GetDecimalsOk returns a tuple with the Decimals field value if set, nil otherwise +// GetDecimalsOk returns a tuple with the Decimals field value // and a boolean to check if the value has been set. func (o *BaseToken) GetDecimalsOk() (*int32, bool) { - if o == nil || isNil(o.Decimals) { + if o == nil { return nil, false } - return o.Decimals, true -} - -// HasDecimals returns a boolean if a field has been set. -func (o *BaseToken) HasDecimals() bool { - if o != nil && !isNil(o.Decimals) { - return true - } - - return false + return &o.Decimals, true } -// SetDecimals gets a reference to the given int32 and assigns it to the Decimals field. +// SetDecimals sets field value func (o *BaseToken) SetDecimals(v int32) { - o.Decimals = &v + o.Decimals = v } -// GetName returns the Name field value if set, zero value otherwise. +// GetName returns the Name field value func (o *BaseToken) GetName() string { - if o == nil || isNil(o.Name) { + if o == nil { var ret string return ret } - return *o.Name + + return o.Name } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *BaseToken) GetNameOk() (*string, bool) { - if o == nil || isNil(o.Name) { + if o == nil { return nil, false } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *BaseToken) HasName() bool { - if o != nil && !isNil(o.Name) { - return true - } - - return false + return &o.Name, true } -// SetName gets a reference to the given string and assigns it to the Name field. +// SetName sets field value func (o *BaseToken) SetName(v string) { - o.Name = &v + o.Name = v } -// GetSubunit returns the Subunit field value if set, zero value otherwise. +// GetSubunit returns the Subunit field value func (o *BaseToken) GetSubunit() string { - if o == nil || isNil(o.Subunit) { + if o == nil { var ret string return ret } - return *o.Subunit + + return o.Subunit } -// GetSubunitOk returns a tuple with the Subunit field value if set, nil otherwise +// GetSubunitOk returns a tuple with the Subunit field value // and a boolean to check if the value has been set. func (o *BaseToken) GetSubunitOk() (*string, bool) { - if o == nil || isNil(o.Subunit) { + if o == nil { return nil, false } - return o.Subunit, true + return &o.Subunit, true } -// HasSubunit returns a boolean if a field has been set. -func (o *BaseToken) HasSubunit() bool { - if o != nil && !isNil(o.Subunit) { - return true - } - - return false -} - -// SetSubunit gets a reference to the given string and assigns it to the Subunit field. +// SetSubunit sets field value func (o *BaseToken) SetSubunit(v string) { - o.Subunit = &v + o.Subunit = v } -// GetTickerSymbol returns the TickerSymbol field value if set, zero value otherwise. +// GetTickerSymbol returns the TickerSymbol field value func (o *BaseToken) GetTickerSymbol() string { - if o == nil || isNil(o.TickerSymbol) { + if o == nil { var ret string return ret } - return *o.TickerSymbol + + return o.TickerSymbol } -// GetTickerSymbolOk returns a tuple with the TickerSymbol field value if set, nil otherwise +// GetTickerSymbolOk returns a tuple with the TickerSymbol field value // and a boolean to check if the value has been set. func (o *BaseToken) GetTickerSymbolOk() (*string, bool) { - if o == nil || isNil(o.TickerSymbol) { + if o == nil { return nil, false } - return o.TickerSymbol, true -} - -// HasTickerSymbol returns a boolean if a field has been set. -func (o *BaseToken) HasTickerSymbol() bool { - if o != nil && !isNil(o.TickerSymbol) { - return true - } - - return false + return &o.TickerSymbol, true } -// SetTickerSymbol gets a reference to the given string and assigns it to the TickerSymbol field. +// SetTickerSymbol sets field value func (o *BaseToken) SetTickerSymbol(v string) { - o.TickerSymbol = &v + o.TickerSymbol = v } -// GetUnit returns the Unit field value if set, zero value otherwise. +// GetUnit returns the Unit field value func (o *BaseToken) GetUnit() string { - if o == nil || isNil(o.Unit) { + if o == nil { var ret string return ret } - return *o.Unit + + return o.Unit } -// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// GetUnitOk returns a tuple with the Unit field value // and a boolean to check if the value has been set. func (o *BaseToken) GetUnitOk() (*string, bool) { - if o == nil || isNil(o.Unit) { + if o == nil { return nil, false } - return o.Unit, true + return &o.Unit, true } -// HasUnit returns a boolean if a field has been set. -func (o *BaseToken) HasUnit() bool { - if o != nil && !isNil(o.Unit) { - return true - } - - return false -} - -// SetUnit gets a reference to the given string and assigns it to the Unit field. +// SetUnit sets field value func (o *BaseToken) SetUnit(v string) { - o.Unit = &v + o.Unit = v } -// GetUseMetricPrefix returns the UseMetricPrefix field value if set, zero value otherwise. +// GetUseMetricPrefix returns the UseMetricPrefix field value func (o *BaseToken) GetUseMetricPrefix() bool { - if o == nil || isNil(o.UseMetricPrefix) { + if o == nil { var ret bool return ret } - return *o.UseMetricPrefix + + return o.UseMetricPrefix } -// GetUseMetricPrefixOk returns a tuple with the UseMetricPrefix field value if set, nil otherwise +// GetUseMetricPrefixOk returns a tuple with the UseMetricPrefix field value // and a boolean to check if the value has been set. func (o *BaseToken) GetUseMetricPrefixOk() (*bool, bool) { - if o == nil || isNil(o.UseMetricPrefix) { + if o == nil { return nil, false } - return o.UseMetricPrefix, true -} - -// HasUseMetricPrefix returns a boolean if a field has been set. -func (o *BaseToken) HasUseMetricPrefix() bool { - if o != nil && !isNil(o.UseMetricPrefix) { - return true - } - - return false + return &o.UseMetricPrefix, true } -// SetUseMetricPrefix gets a reference to the given bool and assigns it to the UseMetricPrefix field. +// SetUseMetricPrefix sets field value func (o *BaseToken) SetUseMetricPrefix(v bool) { - o.UseMetricPrefix = &v + o.UseMetricPrefix = v } func (o BaseToken) MarshalJSON() ([]byte, error) { @@ -252,24 +210,12 @@ func (o BaseToken) MarshalJSON() ([]byte, error) { func (o BaseToken) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.Decimals) { - toSerialize["decimals"] = o.Decimals - } - if !isNil(o.Name) { - toSerialize["name"] = o.Name - } - if !isNil(o.Subunit) { - toSerialize["subunit"] = o.Subunit - } - if !isNil(o.TickerSymbol) { - toSerialize["tickerSymbol"] = o.TickerSymbol - } - if !isNil(o.Unit) { - toSerialize["unit"] = o.Unit - } - if !isNil(o.UseMetricPrefix) { - toSerialize["useMetricPrefix"] = o.UseMetricPrefix - } + toSerialize["decimals"] = o.Decimals + toSerialize["name"] = o.Name + toSerialize["subunit"] = o.Subunit + toSerialize["tickerSymbol"] = o.TickerSymbol + toSerialize["unit"] = o.Unit + toSerialize["useMetricPrefix"] = o.UseMetricPrefix return toSerialize, nil } diff --git a/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index 131fb5b8cc..7bdd224f4a 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,16 +19,18 @@ var _ MappedNullable = &Blob{} // Blob struct for Blob type Blob struct { - Hash *string `json:"Hash,omitempty"` - Size *int32 `json:"Size,omitempty"` + Hash string `json:"hash"` + Size int32 `json:"size"` } // NewBlob instantiates a new Blob object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlob() *Blob { +func NewBlob(hash string, size int32) *Blob { this := Blob{} + this.Hash = hash + this.Size = size return &this } @@ -40,68 +42,52 @@ func NewBlobWithDefaults() *Blob { return &this } -// GetHash returns the Hash field value if set, zero value otherwise. +// GetHash returns the Hash field value func (o *Blob) GetHash() string { - if o == nil || isNil(o.Hash) { + if o == nil { var ret string return ret } - return *o.Hash + + return o.Hash } -// GetHashOk returns a tuple with the Hash field value if set, nil otherwise +// GetHashOk returns a tuple with the Hash field value // and a boolean to check if the value has been set. func (o *Blob) GetHashOk() (*string, bool) { - if o == nil || isNil(o.Hash) { + if o == nil { return nil, false } - return o.Hash, true -} - -// HasHash returns a boolean if a field has been set. -func (o *Blob) HasHash() bool { - if o != nil && !isNil(o.Hash) { - return true - } - - return false + return &o.Hash, true } -// SetHash gets a reference to the given string and assigns it to the Hash field. +// SetHash sets field value func (o *Blob) SetHash(v string) { - o.Hash = &v + o.Hash = v } -// GetSize returns the Size field value if set, zero value otherwise. +// GetSize returns the Size field value func (o *Blob) GetSize() int32 { - if o == nil || isNil(o.Size) { + if o == nil { var ret int32 return ret } - return *o.Size + + return o.Size } -// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. func (o *Blob) GetSizeOk() (*int32, bool) { - if o == nil || isNil(o.Size) { + if o == nil { return nil, false } - return o.Size, true + return &o.Size, true } -// HasSize returns a boolean if a field has been set. -func (o *Blob) HasSize() bool { - if o != nil && !isNil(o.Size) { - return true - } - - return false -} - -// SetSize gets a reference to the given int32 and assigns it to the Size field. +// SetSize sets field value func (o *Blob) SetSize(v int32) { - o.Size = &v + o.Size = v } func (o Blob) MarshalJSON() ([]byte, error) { @@ -114,12 +100,8 @@ func (o Blob) MarshalJSON() ([]byte, error) { func (o Blob) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.Hash) { - toSerialize["Hash"] = o.Hash - } - if !isNil(o.Size) { - toSerialize["Size"] = o.Size - } + toSerialize["hash"] = o.Hash + toSerialize["size"] = o.Size return toSerialize, nil } diff --git a/clients/apiclient/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go index c11bb778ea..5b0e501127 100644 --- a/clients/apiclient/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,16 @@ var _ MappedNullable = &BlobInfoResponse{} // BlobInfoResponse struct for BlobInfoResponse type BlobInfoResponse struct { - Fields *map[string]int32 `json:"Fields,omitempty"` + Fields map[string]int32 `json:"fields"` } // NewBlobInfoResponse instantiates a new BlobInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlobInfoResponse() *BlobInfoResponse { +func NewBlobInfoResponse(fields map[string]int32) *BlobInfoResponse { this := BlobInfoResponse{} + this.Fields = fields return &this } @@ -39,36 +40,28 @@ func NewBlobInfoResponseWithDefaults() *BlobInfoResponse { return &this } -// GetFields returns the Fields field value if set, zero value otherwise. +// GetFields returns the Fields field value func (o *BlobInfoResponse) GetFields() map[string]int32 { - if o == nil || isNil(o.Fields) { + if o == nil { var ret map[string]int32 return ret } - return *o.Fields + + return o.Fields } -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// GetFieldsOk returns a tuple with the Fields field value // and a boolean to check if the value has been set. func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool) { - if o == nil || isNil(o.Fields) { + if o == nil { return nil, false } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *BlobInfoResponse) HasFields() bool { - if o != nil && !isNil(o.Fields) { - return true - } - - return false + return &o.Fields, true } -// SetFields gets a reference to the given map[string]int32 and assigns it to the Fields field. +// SetFields sets field value func (o *BlobInfoResponse) SetFields(v map[string]int32) { - o.Fields = &v + o.Fields = v } func (o BlobInfoResponse) MarshalJSON() ([]byte, error) { @@ -81,9 +74,7 @@ func (o BlobInfoResponse) MarshalJSON() ([]byte, error) { func (o BlobInfoResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.Fields) { - toSerialize["Fields"] = o.Fields - } + toSerialize["fields"] = o.Fields return toSerialize, nil } diff --git a/clients/apiclient/model_blob_list_response.go b/clients/apiclient/model_blob_list_response.go index e6c44d1d7c..33668d7065 100644 --- a/clients/apiclient/model_blob_list_response.go +++ b/clients/apiclient/model_blob_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go index 61003c9b4c..ca7ead8600 100644 --- a/clients/apiclient/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,16 @@ var _ MappedNullable = &BlobValueResponse{} // BlobValueResponse struct for BlobValueResponse type BlobValueResponse struct { - ValueData *string `json:"ValueData,omitempty"` + ValueData string `json:"valueData"` } // NewBlobValueResponse instantiates a new BlobValueResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlobValueResponse() *BlobValueResponse { +func NewBlobValueResponse(valueData string) *BlobValueResponse { this := BlobValueResponse{} + this.ValueData = valueData return &this } @@ -39,36 +40,28 @@ func NewBlobValueResponseWithDefaults() *BlobValueResponse { return &this } -// GetValueData returns the ValueData field value if set, zero value otherwise. +// GetValueData returns the ValueData field value func (o *BlobValueResponse) GetValueData() string { - if o == nil || isNil(o.ValueData) { + if o == nil { var ret string return ret } - return *o.ValueData + + return o.ValueData } -// GetValueDataOk returns a tuple with the ValueData field value if set, nil otherwise +// GetValueDataOk returns a tuple with the ValueData field value // and a boolean to check if the value has been set. func (o *BlobValueResponse) GetValueDataOk() (*string, bool) { - if o == nil || isNil(o.ValueData) { + if o == nil { return nil, false } - return o.ValueData, true -} - -// HasValueData returns a boolean if a field has been set. -func (o *BlobValueResponse) HasValueData() bool { - if o != nil && !isNil(o.ValueData) { - return true - } - - return false + return &o.ValueData, true } -// SetValueData gets a reference to the given string and assigns it to the ValueData field. +// SetValueData sets field value func (o *BlobValueResponse) SetValueData(v string) { - o.ValueData = &v + o.ValueData = v } func (o BlobValueResponse) MarshalJSON() ([]byte, error) { @@ -81,9 +74,7 @@ func (o BlobValueResponse) MarshalJSON() ([]byte, error) { func (o BlobValueResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.ValueData) { - toSerialize["ValueData"] = o.ValueData - } + toSerialize["valueData"] = o.ValueData return toSerialize, nil } diff --git a/clients/apiclient/model_block_info_response.go b/clients/apiclient/model_block_info_response.go index 036b451677..10ba19582c 100644 --- a/clients/apiclient/model_block_info_response.go +++ b/clients/apiclient/model_block_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipt_error.go b/clients/apiclient/model_block_receipt_error.go index 5dbf03e2c2..ff12e4b427 100644 --- a/clients/apiclient/model_block_receipt_error.go +++ b/clients/apiclient/model_block_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipts_response.go b/clients/apiclient/model_block_receipts_response.go index 4c784d9ec8..5b6e913509 100644 --- a/clients/apiclient/model_block_receipts_response.go +++ b/clients/apiclient/model_block_receipts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_log.go b/clients/apiclient/model_burn_log.go index d3fa7beed7..ce94047f11 100644 --- a/clients/apiclient/model_burn_log.go +++ b/clients/apiclient/model_burn_log.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,16 @@ var _ MappedNullable = &BurnLog{} // BurnLog struct for BurnLog type BurnLog struct { - Records []BurnRecord `json:"Records,omitempty"` + Records []BurnRecord `json:"records"` } // NewBurnLog instantiates a new BurnLog object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBurnLog() *BurnLog { +func NewBurnLog(records []BurnRecord) *BurnLog { this := BurnLog{} + this.Records = records return &this } @@ -39,34 +40,26 @@ func NewBurnLogWithDefaults() *BurnLog { return &this } -// GetRecords returns the Records field value if set, zero value otherwise. +// GetRecords returns the Records field value func (o *BurnLog) GetRecords() []BurnRecord { - if o == nil || isNil(o.Records) { + if o == nil { var ret []BurnRecord return ret } + return o.Records } -// GetRecordsOk returns a tuple with the Records field value if set, nil otherwise +// GetRecordsOk returns a tuple with the Records field value // and a boolean to check if the value has been set. func (o *BurnLog) GetRecordsOk() ([]BurnRecord, bool) { - if o == nil || isNil(o.Records) { + if o == nil { return nil, false } return o.Records, true } -// HasRecords returns a boolean if a field has been set. -func (o *BurnLog) HasRecords() bool { - if o != nil && !isNil(o.Records) { - return true - } - - return false -} - -// SetRecords gets a reference to the given []BurnRecord and assigns it to the Records field. +// SetRecords sets field value func (o *BurnLog) SetRecords(v []BurnRecord) { o.Records = v } @@ -81,9 +74,7 @@ func (o BurnLog) MarshalJSON() ([]byte, error) { func (o BurnLog) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.Records) { - toSerialize["Records"] = o.Records - } + toSerialize["records"] = o.Records return toSerialize, nil } diff --git a/clients/apiclient/model_burn_record.go b/clients/apiclient/model_burn_record.go index 700ea6b265..dde5ce270e 100644 --- a/clients/apiclient/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,16 +19,18 @@ var _ MappedNullable = &BurnRecord{} // BurnRecord struct for BurnRecord type BurnRecord struct { - Code *int32 `json:"Code,omitempty"` - GasBurned *int64 `json:"GasBurned,omitempty"` + Code int32 `json:"code"` + GasBurned int64 `json:"gasBurned"` } // NewBurnRecord instantiates a new BurnRecord object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBurnRecord() *BurnRecord { +func NewBurnRecord(code int32, gasBurned int64) *BurnRecord { this := BurnRecord{} + this.Code = code + this.GasBurned = gasBurned return &this } @@ -40,68 +42,52 @@ func NewBurnRecordWithDefaults() *BurnRecord { return &this } -// GetCode returns the Code field value if set, zero value otherwise. +// GetCode returns the Code field value func (o *BurnRecord) GetCode() int32 { - if o == nil || isNil(o.Code) { + if o == nil { var ret int32 return ret } - return *o.Code + + return o.Code } -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. func (o *BurnRecord) GetCodeOk() (*int32, bool) { - if o == nil || isNil(o.Code) { + if o == nil { return nil, false } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *BurnRecord) HasCode() bool { - if o != nil && !isNil(o.Code) { - return true - } - - return false + return &o.Code, true } -// SetCode gets a reference to the given int32 and assigns it to the Code field. +// SetCode sets field value func (o *BurnRecord) SetCode(v int32) { - o.Code = &v + o.Code = v } -// GetGasBurned returns the GasBurned field value if set, zero value otherwise. +// GetGasBurned returns the GasBurned field value func (o *BurnRecord) GetGasBurned() int64 { - if o == nil || isNil(o.GasBurned) { + if o == nil { var ret int64 return ret } - return *o.GasBurned + + return o.GasBurned } -// GetGasBurnedOk returns a tuple with the GasBurned field value if set, nil otherwise +// GetGasBurnedOk returns a tuple with the GasBurned field value // and a boolean to check if the value has been set. func (o *BurnRecord) GetGasBurnedOk() (*int64, bool) { - if o == nil || isNil(o.GasBurned) { + if o == nil { return nil, false } - return o.GasBurned, true + return &o.GasBurned, true } -// HasGasBurned returns a boolean if a field has been set. -func (o *BurnRecord) HasGasBurned() bool { - if o != nil && !isNil(o.GasBurned) { - return true - } - - return false -} - -// SetGasBurned gets a reference to the given int64 and assigns it to the GasBurned field. +// SetGasBurned sets field value func (o *BurnRecord) SetGasBurned(v int64) { - o.GasBurned = &v + o.GasBurned = v } func (o BurnRecord) MarshalJSON() ([]byte, error) { @@ -114,12 +100,8 @@ func (o BurnRecord) MarshalJSON() ([]byte, error) { func (o BurnRecord) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.Code) { - toSerialize["Code"] = o.Code - } - if !isNil(o.GasBurned) { - toSerialize["GasBurned"] = o.GasBurned - } + toSerialize["code"] = o.Code + toSerialize["gasBurned"] = o.GasBurned return toSerialize, nil } diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index 8de988f778..ad167681d1 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_info_response.go b/clients/apiclient/model_chain_info_response.go index 556c5796ba..f0380ceee0 100644 --- a/clients/apiclient/model_chain_info_response.go +++ b/clients/apiclient/model_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go index 1a4b83c507..60ff3e7df6 100644 --- a/clients/apiclient/model_chain_metrics.go +++ b/clients/apiclient/model_chain_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_info_response.go b/clients/apiclient/model_committee_info_response.go index 99a1493b4d..ad6c06bec0 100644 --- a/clients/apiclient/model_committee_info_response.go +++ b/clients/apiclient/model_committee_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_node.go b/clients/apiclient/model_committee_node.go index 7f1949395f..91d10d55b8 100644 --- a/clients/apiclient/model_committee_node.go +++ b/clients/apiclient/model_committee_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go index ba6888811c..c94d77ffbe 100644 --- a/clients/apiclient/model_consensus_pipe_metrics.go +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_workflow_metrics.go b/clients/apiclient/model_consensus_workflow_metrics.go index 705c49e2db..182450b4d1 100644 --- a/clients/apiclient/model_consensus_workflow_metrics.go +++ b/clients/apiclient/model_consensus_workflow_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_call_view_request.go b/clients/apiclient/model_contract_call_view_request.go index eae124ebc0..0bc9cac75f 100644 --- a/clients/apiclient/model_contract_call_view_request.go +++ b/clients/apiclient/model_contract_call_view_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_info_response.go b/clients/apiclient/model_contract_info_response.go index e30a9cdd36..071bf0b67f 100644 --- a/clients/apiclient/model_contract_info_response.go +++ b/clients/apiclient/model_contract_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go index 28c5ec4e27..cf80b7a453 100644 --- a/clients/apiclient/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_info.go b/clients/apiclient/model_dk_shares_info.go index 2926232f5f..babb4b8a12 100644 --- a/clients/apiclient/model_dk_shares_info.go +++ b/clients/apiclient/model_dk_shares_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_post_request.go b/clients/apiclient/model_dk_shares_post_request.go index 459e91221d..6222d699b2 100644 --- a/clients/apiclient/model_dk_shares_post_request.go +++ b/clients/apiclient/model_dk_shares_post_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_error_message_format_response.go b/clients/apiclient/model_error_message_format_response.go index 709188c93b..fc06ac69e8 100644 --- a/clients/apiclient/model_error_message_format_response.go +++ b/clients/apiclient/model_error_message_format_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_events_response.go b/clients/apiclient/model_events_response.go index 133b5e7128..132629ee5f 100644 --- a/clients/apiclient/model_events_response.go +++ b/clients/apiclient/model_events_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_foundry_output_response.go b/clients/apiclient/model_foundry_output_response.go index c6d288f6c4..ee37a3b06f 100644 --- a/clients/apiclient/model_foundry_output_response.go +++ b/clients/apiclient/model_foundry_output_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_fungible_tokens.go b/clients/apiclient/model_fungible_tokens.go index 6781eacdd8..b524b670eb 100644 --- a/clients/apiclient/model_fungible_tokens.go +++ b/clients/apiclient/model_fungible_tokens.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index f5d8a6c273..1cdbb4faf7 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go index 82bed4ad9a..70d9549081 100644 --- a/clients/apiclient/model_gov_chain_info_response.go +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output.go b/clients/apiclient/model_in_output.go index 617a56210d..f19798608d 100644 --- a/clients/apiclient/model_in_output.go +++ b/clients/apiclient/model_in_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output_metric_item.go b/clients/apiclient/model_in_output_metric_item.go index d8b4d8cb38..19c9332ddd 100644 --- a/clients/apiclient/model_in_output_metric_item.go +++ b/clients/apiclient/model_in_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output.go b/clients/apiclient/model_in_state_output.go index 066abae4e2..2d99086a96 100644 --- a/clients/apiclient/model_in_state_output.go +++ b/clients/apiclient/model_in_state_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output_metric_item.go b/clients/apiclient/model_in_state_output_metric_item.go index bb40774358..7c635ba91d 100644 --- a/clients/apiclient/model_in_state_output_metric_item.go +++ b/clients/apiclient/model_in_state_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_info_response.go b/clients/apiclient/model_info_response.go index 70ce120dd8..b60fd8b2c4 100644 --- a/clients/apiclient/model_info_response.go +++ b/clients/apiclient/model_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_interface_metric_item.go b/clients/apiclient/model_interface_metric_item.go index c32feb20e1..b65c1b3227 100644 --- a/clients/apiclient/model_interface_metric_item.go +++ b/clients/apiclient/model_interface_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_item.go b/clients/apiclient/model_item.go index 1ee86b28c6..b5e7917bdf 100644 --- a/clients/apiclient/model_item.go +++ b/clients/apiclient/model_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_json_dict.go b/clients/apiclient/model_json_dict.go index cd26e94c57..2ce01a452f 100644 --- a/clients/apiclient/model_json_dict.go +++ b/clients/apiclient/model_json_dict.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_l1_params.go b/clients/apiclient/model_l1_params.go index 23ec9c460b..a0aec00bb6 100644 --- a/clients/apiclient/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_request.go b/clients/apiclient/model_login_request.go new file mode 100644 index 0000000000..66c90ff4ca --- /dev/null +++ b/clients/apiclient/model_login_request.go @@ -0,0 +1,144 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the LoginRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoginRequest{} + +// LoginRequest struct for LoginRequest +type LoginRequest struct { + Password string `json:"password"` + Username string `json:"username"` +} + +// NewLoginRequest instantiates a new LoginRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoginRequest(password string, username string) *LoginRequest { + this := LoginRequest{} + this.Password = password + this.Username = username + return &this +} + +// NewLoginRequestWithDefaults instantiates a new LoginRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoginRequestWithDefaults() *LoginRequest { + this := LoginRequest{} + return &this +} + +// GetPassword returns the Password field value +func (o *LoginRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *LoginRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *LoginRequest) SetPassword(v string) { + o.Password = v +} + +// GetUsername returns the Username field value +func (o *LoginRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *LoginRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *LoginRequest) SetUsername(v string) { + o.Username = v +} + +func (o LoginRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LoginRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + toSerialize["username"] = o.Username + return toSerialize, nil +} + +type NullableLoginRequest struct { + value *LoginRequest + isSet bool +} + +func (v NullableLoginRequest) Get() *LoginRequest { + return v.value +} + +func (v *NullableLoginRequest) Set(val *LoginRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLoginRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLoginRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoginRequest(val *LoginRequest) *NullableLoginRequest { + return &NullableLoginRequest{value: val, isSet: true} +} + +func (v NullableLoginRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoginRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_login_response.go b/clients/apiclient/model_login_response.go new file mode 100644 index 0000000000..7177ed26dc --- /dev/null +++ b/clients/apiclient/model_login_response.go @@ -0,0 +1,144 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the LoginResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoginResponse{} + +// LoginResponse struct for LoginResponse +type LoginResponse struct { + Error string `json:"error"` + Jwt string `json:"jwt"` +} + +// NewLoginResponse instantiates a new LoginResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoginResponse(error_ string, jwt string) *LoginResponse { + this := LoginResponse{} + this.Error = error_ + this.Jwt = jwt + return &this +} + +// NewLoginResponseWithDefaults instantiates a new LoginResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoginResponseWithDefaults() *LoginResponse { + this := LoginResponse{} + return &this +} + +// GetError returns the Error field value +func (o *LoginResponse) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *LoginResponse) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *LoginResponse) SetError(v string) { + o.Error = v +} + +// GetJwt returns the Jwt field value +func (o *LoginResponse) GetJwt() string { + if o == nil { + var ret string + return ret + } + + return o.Jwt +} + +// GetJwtOk returns a tuple with the Jwt field value +// and a boolean to check if the value has been set. +func (o *LoginResponse) GetJwtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Jwt, true +} + +// SetJwt sets field value +func (o *LoginResponse) SetJwt(v string) { + o.Jwt = v +} + +func (o LoginResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LoginResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error"] = o.Error + toSerialize["jwt"] = o.Jwt + return toSerialize, nil +} + +type NullableLoginResponse struct { + value *LoginResponse + isSet bool +} + +func (v NullableLoginResponse) Get() *LoginResponse { + return v.value +} + +func (v *NullableLoginResponse) Set(val *LoginResponse) { + v.value = val + v.isSet = true +} + +func (v NullableLoginResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableLoginResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoginResponse(val *LoginResponse) *NullableLoginResponse { + return &NullableLoginResponse{value: val, isSet: true} +} + +func (v NullableLoginResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoginResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_native_token.go b/clients/apiclient/model_native_token.go index 7e2a321087..b6fe976308 100644 --- a/clients/apiclient/model_native_token.go +++ b/clients/apiclient/model_native_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token_id_registry_response.go b/clients/apiclient/model_native_token_id_registry_response.go index 7790ac6ed3..623efebbf2 100644 --- a/clients/apiclient/model_native_token_id_registry_response.go +++ b/clients/apiclient/model_native_token_id_registry_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_nft_data_response.go b/clients/apiclient/model_nft_data_response.go index db3b9fd8c6..5f3e0089b5 100644 --- a/clients/apiclient/model_nft_data_response.go +++ b/clients/apiclient/model_nft_data_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_request.go b/clients/apiclient/model_node_owner_certificate_request.go index 6fc1abad66..3d7628ce63 100644 --- a/clients/apiclient/model_node_owner_certificate_request.go +++ b/clients/apiclient/model_node_owner_certificate_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_off_ledger_request.go b/clients/apiclient/model_off_ledger_request.go index 8c7e1381f1..943d056735 100644 --- a/clients/apiclient/model_off_ledger_request.go +++ b/clients/apiclient/model_off_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request.go b/clients/apiclient/model_on_ledger_request.go index 2b6dcc0917..fa7bcda73d 100644 --- a/clients/apiclient/model_on_ledger_request.go +++ b/clients/apiclient/model_on_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request_metric_item.go b/clients/apiclient/model_on_ledger_request_metric_item.go index eb0bf6751c..8809a78b0a 100644 --- a/clients/apiclient/model_on_ledger_request_metric_item.go +++ b/clients/apiclient/model_on_ledger_request_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output.go b/clients/apiclient/model_output.go index 586af1a55e..1264715de6 100644 --- a/clients/apiclient/model_output.go +++ b/clients/apiclient/model_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output_id.go b/clients/apiclient/model_output_id.go index 22ae7a0f6e..3f3862db23 100644 --- a/clients/apiclient/model_output_id.go +++ b/clients/apiclient/model_output_id.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_identity_response.go b/clients/apiclient/model_peering_node_identity_response.go index 14572fc574..36a5e52169 100644 --- a/clients/apiclient/model_peering_node_identity_response.go +++ b/clients/apiclient/model_peering_node_identity_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go index a2f96e1bdf..af2e9362ff 100644 --- a/clients/apiclient/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_trust_request.go b/clients/apiclient/model_peering_trust_request.go index 5a1c229bcc..78fbc333c9 100644 --- a/clients/apiclient/model_peering_trust_request.go +++ b/clients/apiclient/model_peering_trust_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go index 6e607437a9..65f343761c 100644 --- a/clients/apiclient/model_protocol_parameters.go +++ b/clients/apiclient/model_protocol_parameters.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index 4de2863860..035e7171de 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_response.go b/clients/apiclient/model_receipt_response.go index 27734b3c5b..a352ac564b 100644 --- a/clients/apiclient/model_receipt_response.go +++ b/clients/apiclient/model_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_rent_structure.go b/clients/apiclient/model_rent_structure.go index 154e9db53a..600e607fde 100644 --- a/clients/apiclient/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_detail.go b/clients/apiclient/model_request_detail.go index 9b728cd2f1..e880836ff7 100644 --- a/clients/apiclient/model_request_detail.go +++ b/clients/apiclient/model_request_detail.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_ids_response.go b/clients/apiclient/model_request_ids_response.go index e5ae935999..22769ab765 100644 --- a/clients/apiclient/model_request_ids_response.go +++ b/clients/apiclient/model_request_ids_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_processed_response.go b/clients/apiclient/model_request_processed_response.go index 0a37932833..074c618145 100644 --- a/clients/apiclient/model_request_processed_response.go +++ b/clients/apiclient/model_request_processed_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_receipt_response.go b/clients/apiclient/model_request_receipt_response.go index db0835ab4b..807d890a67 100644 --- a/clients/apiclient/model_request_receipt_response.go +++ b/clients/apiclient/model_request_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ var _ MappedNullable = &RequestReceiptResponse{} // RequestReceiptResponse struct for RequestReceiptResponse type RequestReceiptResponse struct { BlockIndex uint32 `json:"blockIndex"` - Error BlockReceiptError `json:"error"` + Error *BlockReceiptError `json:"error,omitempty"` GasBudget int64 `json:"gasBudget"` GasBurnLog BurnLog `json:"gasBurnLog"` GasBurned int64 `json:"gasBurned"` @@ -33,10 +33,9 @@ type RequestReceiptResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRequestReceiptResponse(blockIndex uint32, error_ BlockReceiptError, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32) *RequestReceiptResponse { +func NewRequestReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32) *RequestReceiptResponse { this := RequestReceiptResponse{} this.BlockIndex = blockIndex - this.Error = error_ this.GasBudget = gasBudget this.GasBurnLog = gasBurnLog this.GasBurned = gasBurned @@ -78,28 +77,36 @@ func (o *RequestReceiptResponse) SetBlockIndex(v uint32) { o.BlockIndex = v } -// GetError returns the Error field value +// GetError returns the Error field value if set, zero value otherwise. func (o *RequestReceiptResponse) GetError() BlockReceiptError { - if o == nil { + if o == nil || isNil(o.Error) { var ret BlockReceiptError return ret } - - return o.Error + return *o.Error } -// GetErrorOk returns a tuple with the Error field value +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *RequestReceiptResponse) GetErrorOk() (*BlockReceiptError, bool) { - if o == nil { + if o == nil || isNil(o.Error) { return nil, false } - return &o.Error, true + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *RequestReceiptResponse) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false } -// SetError sets field value +// SetError gets a reference to the given BlockReceiptError and assigns it to the Error field. func (o *RequestReceiptResponse) SetError(v BlockReceiptError) { - o.Error = v + o.Error = &v } // GetGasBudget returns the GasBudget field value @@ -257,7 +264,9 @@ func (o RequestReceiptResponse) MarshalJSON() ([]byte, error) { func (o RequestReceiptResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["blockIndex"] = o.BlockIndex - toSerialize["error"] = o.Error + if !isNil(o.Error) { + toSerialize["error"] = o.Error + } toSerialize["gasBudget"] = o.GasBudget toSerialize["gasBurnLog"] = o.GasBurnLog toSerialize["gasBurned"] = o.GasBurned diff --git a/clients/apiclient/model_state_response.go b/clients/apiclient/model_state_response.go index 7423649ba0..b1dabb7c5b 100644 --- a/clients/apiclient/model_state_response.go +++ b/clients/apiclient/model_state_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction.go b/clients/apiclient/model_transaction.go index ec879410c1..4d6a619b74 100644 --- a/clients/apiclient/model_transaction.go +++ b/clients/apiclient/model_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_id_metric_item.go b/clients/apiclient/model_transaction_id_metric_item.go index 76ac7084a1..0cb288c0ab 100644 --- a/clients/apiclient/model_transaction_id_metric_item.go +++ b/clients/apiclient/model_transaction_id_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_metric_item.go b/clients/apiclient/model_transaction_metric_item.go index db9eb1179d..e3d7cb076d 100644 --- a/clients/apiclient/model_transaction_metric_item.go +++ b/clients/apiclient/model_transaction_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg.go b/clients/apiclient/model_tx_inclusion_state_msg.go index 4e44627db2..ac02171db1 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg.go +++ b/clients/apiclient/model_tx_inclusion_state_msg.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go index a47c3c20aa..502ed18de0 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go +++ b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_password_request.go b/clients/apiclient/model_update_user_password_request.go index bba1339102..6bc430e522 100644 --- a/clients/apiclient/model_update_user_password_request.go +++ b/clients/apiclient/model_update_user_password_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_permissions_request.go b/clients/apiclient/model_update_user_permissions_request.go index 89004604a3..e3f92ebb2e 100644 --- a/clients/apiclient/model_update_user_permissions_request.go +++ b/clients/apiclient/model_update_user_permissions_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_user.go b/clients/apiclient/model_user.go index 623d2dfd02..5fdf8acf34 100644 --- a/clients/apiclient/model_user.go +++ b/clients/apiclient/model_user.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_utxo_input_metric_item.go b/clients/apiclient/model_utxo_input_metric_item.go index 97e5cd9506..3a0de0d238 100644 --- a/clients/apiclient/model_utxo_input_metric_item.go +++ b/clients/apiclient/model_utxo_input_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_validation_error.go b/clients/apiclient/model_validation_error.go index 94e60db5ba..a7976ba812 100644 --- a/clients/apiclient/model_validation_error.go +++ b/clients/apiclient/model_validation_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/response.go b/clients/apiclient/response.go index 3bf96b515c..668b069dc4 100644 --- a/clients/apiclient/response.go +++ b/clients/apiclient/response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/test/api_auth_test.go b/clients/apiclient/test/api_auth_test.go new file mode 100644 index 0000000000..da91d87620 --- /dev/null +++ b/clients/apiclient/test/api_auth_test.go @@ -0,0 +1,49 @@ +/* +Wasp API + +Testing AuthApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apiclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func Test_apiclient_AuthApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AuthApiService AuthInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AuthApi.AuthInfo(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AuthApiService Authenticate", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AuthApi.Authenticate(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/clients/apiclient/utils.go b/clients/apiclient/utils.go index 8e238f0ddf..3276acf5c9 100644 --- a/clients/apiclient/utils.go +++ b/clients/apiclient/utils.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.2-403-g907bc6c54 +API version: 123 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiutils.go b/clients/apiutils.go index 2f8374d5b6..79ba96a33a 100644 --- a/clients/apiutils.go +++ b/clients/apiutils.go @@ -1 +1,40 @@ -package apiclient +package clients + +import ( + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/kv/dict" +) + +func JSONDictToAPIJSONDict(jsonDict dict.JSONDict) apiclient.JSONDict { + apiJsonDict := apiclient.NewJSONDict() + + for k, v := range jsonDict.Items { + apiJsonDict.Items[k] = apiclient.Item{ + Key: v.Key, + Value: v.Value, + } + } + + return *apiJsonDict +} + +func APIJsonDictToJSONDict(apiJsonDict apiclient.JSONDict) dict.JSONDict { + jsonDict := dict.JSONDict{ + Items: make([]dict.Item, len(apiJsonDict.Items)), + } + + for k, v := range apiJsonDict.Items { + jsonDict.Items[k] = dict.Item{ + Key: v.Key, + Value: v.Value, + } + } + + return jsonDict +} + +func APIJsonDictToDict(apiJsonDict apiclient.JSONDict) (dict.Dict, error) { + jsonDict := APIJsonDictToJSONDict(apiJsonDict) + + return dict.FromJSONDict(jsonDict) +} \ No newline at end of file diff --git a/clients/auth/auth.go b/clients/auth/auth.go index 8832b06d18..bbfa3ddf23 100644 --- a/clients/auth/auth.go +++ b/clients/auth/auth.go @@ -1 +1,47 @@ package auth + +import ( + "bytes" + "encoding/json" + "io" + "net/http" + + "github.com/iotaledger/wasp/packages/authentication/shared" +) + +// Login is a soon-to-be deprecated login function. It will be replaced by a generated client function. +func Login(client *http.Client, username, password string) (string, error) { + loginRequest := shared.LoginRequest{ + Username: username, + Password: password, + } + + requestBytes, err := json.Marshal(loginRequest) + + if err != nil { + return "", err + } + + request, err := http.NewRequest(http.MethodPost, "/auth", bytes.NewBuffer(requestBytes)) + if err != nil { + return "", err + } + + result, err := client.Do(request) + if err != nil { + return "", err + } + + resBody, err := io.ReadAll(result.Body) + if err != nil { + return "", err + } + + var loginResponse shared.LoginResponse + err = json.Unmarshal(resBody, &loginResponse) + if err != nil { + return "", err + } + + return loginResponse.JWT, nil +} diff --git a/clients/chainclient/callview.go b/clients/chainclient/callview.go index 1d082551f4..46dbceb16a 100644 --- a/clients/chainclient/callview.go +++ b/clients/chainclient/callview.go @@ -16,7 +16,7 @@ func (c *Client) CallView(ctx context.Context, hContract isc.Hname, functionName ChainId: c.ChainID.String(), ContractHName: hContract.String(), FunctionName: functionName, - Arguments: *clients.JSONDictToAPIJSONDict(args.JSONDict()), + Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), } result, _, err := c.WaspClient.RequestsApi. diff --git a/clients/chainclient/checkrequest.go b/clients/chainclient/checkrequest.go index 71f279278b..8f8528e3c5 100644 --- a/clients/chainclient/checkrequest.go +++ b/clients/chainclient/checkrequest.go @@ -1,33 +1,24 @@ package chainclient import ( + "context" "errors" "fmt" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" ) // CheckRequestResult fetches the receipt for the given request ID, and returns // an error indicating whether the request was processed successfully. -func (c *Client) CheckRequestResult(reqID isc.RequestID) error { - ret, err := c.CallView(blocklog.Contract.Hname(), blocklog.ViewGetRequestReceipt.Name, dict.Dict{ - blocklog.ParamRequestID: codec.EncodeRequestID(reqID), - }) +func (c *Client) CheckRequestResult(ctx context.Context, reqID isc.RequestID) error { + receipt, _, err := c.WaspClient.CorecontractsApi.BlocklogGetRequestReceipt(ctx, c.ChainID.String(), reqID.String()).Execute() if err != nil { - return fmt.Errorf("could not fetch receipt for request: %w", err) - } - if !ret.MustHas(blocklog.ParamRequestRecord) { return errors.New("could not fetch receipt for request: not found in blocklog") } - req, err := blocklog.RequestReceiptFromBytes(ret.MustGet(blocklog.ParamRequestRecord)) - if err != nil { - return fmt.Errorf("could not decode receipt for request: %w", err) - } - if req.Error != nil { - return fmt.Errorf("the request was rejected: %v", req.Error) + + if receipt.Error != nil { + return fmt.Errorf("the request was rejected: %v", receipt.Error.ErrorMessage) } + return nil } diff --git a/clients/chainclient/evm.go b/clients/chainclient/evm.go index 3af043876a..b6200f71ba 100644 --- a/clients/chainclient/evm.go +++ b/clients/chainclient/evm.go @@ -1,11 +1,21 @@ package chainclient import ( + "context" + "github.com/ethereum/go-ethereum/common" "github.com/iotaledger/wasp/packages/isc" ) -func (c *Client) RequestIDByEVMTransactionHash(txHash common.Hash) (isc.RequestID, error) { - return c.WaspClient.RequestIDByEVMTransactionHash(c.ChainID, txHash) +func (c *Client) RequestIDByEVMTransactionHash(ctx context.Context, txHash common.Hash) (isc.RequestID, error) { + requestIDStr, _, err := c.WaspClient.ChainsApi.GetRequestIDFromEVMTransactionID(ctx, c.ChainID.String(), txHash.String()).Execute() + + if err != nil { + return isc.RequestID{}, err + } + + requestID, err := isc.RequestIDFromString(requestIDStr) + + return requestID, err } diff --git a/clients/chainclient/stateget.go b/clients/chainclient/stateget.go index 1efb985885..1ecc9e2540 100644 --- a/clients/chainclient/stateget.go +++ b/clients/chainclient/stateget.go @@ -1,6 +1,20 @@ package chainclient +import ( + "context" + + iotago "github.com/iotaledger/iota.go/v3" +) + // StateGet fetches the raw value associated with the given key in the chain state -func (c *Client) StateGet(key string) ([]byte, error) { - return c.WaspClient.StateGet(c.ChainID, key) +func (c *Client) StateGet(ctx context.Context, key string) ([]byte, error) { + stateResponse, _, err := c.WaspClient.ChainsApi.GetStateValue(ctx, c.ChainID.String(), key).Execute() + + if err != nil { + return nil, err + } + + hexBytes, err := iotago.DecodeHex(stateResponse.State) + + return hexBytes, err } diff --git a/clients/chainclient/uploadblob.go b/clients/chainclient/uploadblob.go index cfd29021a7..340ad9e8b9 100644 --- a/clients/chainclient/uploadblob.go +++ b/clients/chainclient/uploadblob.go @@ -1,8 +1,9 @@ package chainclient import ( - "time" + "context" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" @@ -10,7 +11,7 @@ import ( ) // UploadBlob sends an off-ledger request to call 'store' in the blob contract. -func (c *Client) UploadBlob(fields dict.Dict) (hashing.HashValue, isc.OffLedgerRequest, *isc.Receipt, error) { +func (c *Client) UploadBlob(ctx context.Context, fields dict.Dict) (hashing.HashValue, isc.OffLedgerRequest, *apiclient.ReceiptResponse, error) { blobHash := blob.MustGetBlobHash(fields) req, err := c.PostOffLedgerRequest( @@ -24,6 +25,7 @@ func (c *Client) UploadBlob(fields dict.Dict) (hashing.HashValue, isc.OffLedgerR return hashing.NilHash, nil, nil, err } - receipt, err := c.WaspClient.WaitUntilRequestProcessed(c.ChainID, req.ID(), 2*time.Minute) + receipt, _, err := c.WaspClient.RequestsApi.WaitForTransaction(ctx, c.ChainID.String(), req.ID().String()).Execute() + return blobHash, req, receipt, err } diff --git a/clients/scclient/postrequest.go b/clients/scclient/postrequest.go index ed33010783..79eb32c12b 100644 --- a/clients/scclient/postrequest.go +++ b/clients/scclient/postrequest.go @@ -2,7 +2,7 @@ package scclient import ( iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" ) diff --git a/clients/scclient/scclient.go b/clients/scclient/scclient.go index 26b9219b11..c1bc013312 100644 --- a/clients/scclient/scclient.go +++ b/clients/scclient/scclient.go @@ -1,12 +1,15 @@ package scclient import ( - "github.com/iotaledger/wasp/client/chainclient" + "context" + + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" ) // SCClient allows to send webapi requests targeted to a specific contract type SCClient struct { + context context.Context ChainClient *chainclient.Client ContractHname isc.Hname } diff --git a/clients/scclient/stateget.go b/clients/scclient/stateget.go index 666bc943dd..1d74d95c2f 100644 --- a/clients/scclient/stateget.go +++ b/clients/scclient/stateget.go @@ -1,6 +1,8 @@ package scclient +import "context" + // StateGet fetches the raw value associated with the given key in the smart contract state -func (c *SCClient) StateGet(key string) ([]byte, error) { - return c.ChainClient.StateGet(string(c.ContractHname.Bytes()) + key) +func (c *SCClient) StateGet(ctx context.Context, key string) ([]byte, error) { + return c.ChainClient.StateGet(ctx, string(c.ContractHname.Bytes())+key) } diff --git a/packages/apilib/rundkg.go b/packages/apilib/rundkg.go index 1df39a4c25..caed81ff64 100644 --- a/packages/apilib/rundkg.go +++ b/packages/apilib/rundkg.go @@ -10,7 +10,6 @@ import ( "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client" "github.com/iotaledger/wasp/packages/webapi/v1/model" ) @@ -27,7 +26,7 @@ func RunDKG(authToken string, apiHosts, peerPubKeys []string, threshold, initiat if int(initiatorIndex) >= len(apiHosts) { return nil, errors.New("RunDKG: wrong initiator index") } - dkShares, err := client.NewWaspClient(apiHosts[initiatorIndex]).WithToken(authToken).DKSharesPost(&model.DKSharesPostRequest{ + dkShares, err := clients.NewWaspClient(apiHosts[initiatorIndex]).WithToken(authToken).DKSharesPost(&model.DKSharesPostRequest{ PeerPubKeys: peerPubKeys, Threshold: threshold, TimeoutMS: to, // 1 min diff --git a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go index 0753154227..a370afbbf1 100644 --- a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go +++ b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go @@ -6,7 +6,6 @@ package wasmclient import ( "time" - "github.com/iotaledger/wasp/client" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" @@ -23,14 +22,15 @@ type IClientService interface { } type WasmClientService struct { - waspClient *client.WaspClient + cvt wasmhost.WasmConvertor + waspClient *clients.WaspClient eventPort string } var _ IClientService = new(WasmClientService) func NewWasmClientService(waspAPI, eventPort string) *WasmClientService { - return &WasmClientService{waspClient: client.NewWaspClient(waspAPI), eventPort: eventPort} + return &WasmClientService{waspClient: clients.NewWaspClient(waspAPI), eventPort: eventPort} } func DefaultWasmClientService() *WasmClientService { diff --git a/tools/cluster/cluster.go b/tools/cluster/cluster.go index e2d3e4a9e6..593a4d1ae9 100644 --- a/tools/cluster/cluster.go +++ b/tools/cluster/cluster.go @@ -23,7 +23,6 @@ import ( "github.com/iotaledger/hive.go/core/logger" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client" "github.com/iotaledger/wasp/client/chainclient" "github.com/iotaledger/wasp/client/multiclient" "github.com/iotaledger/wasp/packages/apilib" diff --git a/tools/wasp-cli/authentication/info.go b/tools/wasp-cli/authentication/info.go index 73fe2d5b3f..045e7b5fc5 100644 --- a/tools/wasp-cli/authentication/info.go +++ b/tools/wasp-cli/authentication/info.go @@ -1,31 +1,42 @@ package authentication import ( - "encoding/json" + "context" "github.com/spf13/cobra" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) +type AuthInfoOutput struct { + AuthenticationMethod string + AuthenticationURL string +} + +var _ log.CLIOutput = &AuthInfoOutput{} + +func (l *AuthInfoOutput) AsText() (string, error) { + template := `Authentication Method: {{ .AuthenticationMethod }}\nAuthentication URL: {{ .AuthenticationURL }}` + return log.ParseCLIOutputTemplate(l, template) +} + func initInfoCmd() *cobra.Command { return &cobra.Command{ Use: "info", Short: "Receive information about the authentication methods", Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPI()) - authInfo, err := client.AuthInfo() - if err != nil { - panic(err) - } - - authInfoJSON, err := json.MarshalIndent(authInfo, "", " ") - if err != nil { - panic(err) - } - - log.Printf(string(authInfoJSON)) + + // Auth is currently not inside Swagger, so this is a temporary change + client := cliclients.WaspClientForNodeIndex() + authInfo, _, err := client.AuthApi.AuthInfo(context.Background()).Execute() + + log.Check(err) + + log.PrintCLIOutput(&AuthInfoOutput{ + AuthenticationMethod: authInfo.Scheme, + AuthenticationURL: authInfo.AuthURL, + }) }, } } diff --git a/tools/wasp-cli/authentication/login.go b/tools/wasp-cli/authentication/login.go index a56f16d2c7..562752285f 100644 --- a/tools/wasp-cli/authentication/login.go +++ b/tools/wasp-cli/authentication/login.go @@ -2,13 +2,16 @@ package authentication import ( "bufio" + "context" "os" "syscall" "github.com/spf13/cobra" "golang.org/x/term" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -45,13 +48,16 @@ func initLoginCmd() *cobra.Command { return } - client := config.WaspClient(config.MustWaspAPI()) - token, err := client.Login(username, password) - if err != nil { - panic(err) - } + token, _, err := cliclients.WaspClientForNodeIndex().AuthApi. + Authenticate(context.Background()). + LoginRequest(apiclient.LoginRequest{ + Username: username, + Password: password, + }).Execute() + + log.Check(err) - config.SetToken(token) + config.SetToken(token.Jwt) log.Printf("\nSuccessfully authenticated\n") }, diff --git a/tools/wasp-cli/chain/accounts.go b/tools/wasp-cli/chain/accounts.go index 22df1a8593..ba9f582e47 100644 --- a/tools/wasp-cli/chain/accounts.go +++ b/tools/wasp-cli/chain/accounts.go @@ -1,16 +1,17 @@ package chain import ( + "context" "strings" "github.com/spf13/cobra" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/vm/core/accounts" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" "github.com/iotaledger/wasp/tools/wasp-cli/wallet" @@ -22,18 +23,18 @@ func initListAccountsCmd() *cobra.Command { Short: "List L2 accounts", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - ret, err := SCClient(accounts.Contract.Hname()).CallView(accounts.ViewAccounts.Name, nil) + client := cliclients.WaspClientForNodeIndex() + chainID := GetCurrentChainID() + + accountList, _, err := client.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID.String()).Execute() log.Check(err) - log.Printf("Total %d account(s) in chain %s\n", len(ret), GetCurrentChainID().String()) + log.Printf("Total %d account(s) in chain %s\n", len(accountList.Accounts), GetCurrentChainID().String()) header := []string{"agentid"} - rows := make([][]string, len(ret)) - i := 0 - for k := range ret { - agentID, err := codec.DecodeAgentID([]byte(k)) - log.Check(err) - rows[i] = []string{agentID.String()} + rows := make([][]string, len(accountList.Accounts)) + for i, account := range accountList.Accounts { + rows[i] = []string{account} i++ } log.PrintTable(header, rows) @@ -56,25 +57,19 @@ func initBalanceCmd() *cobra.Command { log.Check(err) } - ret, err := SCClient(accounts.Contract.Hname()).CallView(accounts.ViewBalance.Name, dict.Dict{ - accounts.ParamAgentID: agentID.Bytes(), - }) + client := cliclients.WaspClientForNodeIndex() + chainID := GetCurrentChainID() + balance, _, err := client.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID.String(), agentID.String()).Execute() + log.Check(err) header := []string{"token", "amount"} - rows := make([][]string, len(ret)) - i := 0 - for k, v := range ret { - tokenStr := util.BaseTokenStr - if !isc.IsBaseToken([]byte(k)) { - tokenStr = codec.MustDecodeNativeTokenID([]byte(k)).String() - } - bal, err := codec.DecodeBigIntAbs(v) - log.Check(err) + rows := make([][]string, len(balance.NativeTokens)) - rows[i] = []string{tokenStr, bal.String()} - i++ + for k, v := range balance.NativeTokens { + rows[k] = []string{v.Id, v.Amount} } + log.PrintTable(header, rows) }, } @@ -92,7 +87,9 @@ func initDepositCmd() *cobra.Command { // deposit to own agentID tokens := util.ParseFungibleTokens(args) util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { - return SCClient(accounts.Contract.Hname()).PostRequest( + client := cliclients.WaspClientForNodeIndex() + + return cliclients.SCClient(client, accounts.Contract.Hname()).PostRequest( accounts.FuncDeposit.Name, chainclient.PostRequestParams{ Transfer: tokens, @@ -109,7 +106,9 @@ func initDepositCmd() *cobra.Command { allowance := tokens.Clone() util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { - return SCClient(accounts.Contract.Hname()).PostRequest( + client := cliclients.WaspClientForNodeIndex() + + return cliclients.SCClient(client, accounts.Contract.Hname()).PostRequest( accounts.FuncTransferAllowanceTo.Name, chainclient.PostRequestParams{ Args: dict.Dict{ diff --git a/tools/wasp-cli/chain/activate.go b/tools/wasp-cli/chain/activate.go index 11e9aec2aa..5fc04e5989 100644 --- a/tools/wasp-cli/chain/activate.go +++ b/tools/wasp-cli/chain/activate.go @@ -1,13 +1,12 @@ package chain import ( + "context" "regexp" "github.com/spf13/cobra" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -25,20 +24,20 @@ func initActivateCmd() *cobra.Command { nodes = GetAllWaspNodes() } for _, nodeIdx := range nodes { - client := Client(config.WaspAPI(nodeIdx)) - r, err := client.WaspClient.GetChainInfo(chainID) + client := cliclients.WaspClientForNodeIndex(nodeIdx) + + r, _, err := client.ChainsApi.GetChainInfo(context.Background(), chainID.String()).Execute() if err != nil && !HTTP404ErrRegexp.MatchString(err.Error()) { log.Check(err) } - if r != nil && r.Active { + + if r != nil && r.IsActive { continue } - if r == nil { - log.Check(client.WaspClient.PutChainRecord(registry.NewChainRecord(chainID, true, []*cryptolib.PublicKey{}))) - } else { - log.Check(client.WaspClient.ActivateChain(chainID)) - } + + _, err = client.ChainsApi.ActivateChain(context.Background(), chainID.String()).Execute() + log.Check(err) } }, } @@ -60,7 +59,10 @@ func initDeactivateCmd() *cobra.Command { nodes = GetAllWaspNodes() } for _, nodeIdx := range nodes { - log.Check(Client(config.WaspAPI(nodeIdx)).WaspClient.DeactivateChain(chainID)) + client := cliclients.WaspClientForNodeIndex(nodeIdx) + + _, err := client.ChainsApi.DeactivateChain(context.Background(), chainID.String()).Execute() + log.Check(err) } }, } diff --git a/tools/wasp-cli/chain/alias.go b/tools/wasp-cli/chain/alias.go index 72eaf491d6..36bbd472eb 100644 --- a/tools/wasp-cli/chain/alias.go +++ b/tools/wasp-cli/chain/alias.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/viper" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) diff --git a/tools/wasp-cli/chain/blobs.go b/tools/wasp-cli/chain/blobs.go index 2f6aadd36c..c4918f9702 100644 --- a/tools/wasp-cli/chain/blobs.go +++ b/tools/wasp-cli/chain/blobs.go @@ -1,15 +1,16 @@ package chain import ( + "context" "fmt" "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/hashing" - "github.com/iotaledger/wasp/packages/kv/codec" + "github.com/iotaledger/wasp/packages/kv" "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blob" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + config2 "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -26,13 +27,16 @@ func initStoreBlobCmd() *cobra.Command { Short: "Store a blob in the chain", Args: cobra.MinimumNArgs(4), Run: func(cmd *cobra.Command, args []string) { - uploadBlob(util.EncodeParams(args), config.MustWaspAPI()) + uploadBlob(util.EncodeParams(args), config2.MustWaspAPIURL()) }, } } func uploadBlob(fieldValues dict.Dict, apiAddress string) (hash hashing.HashValue) { - hash, _, _, err := Client(apiAddress).UploadBlob(fieldValues) + client := cliclients.WaspClientForNodeIndex() + chainClient := cliclients.ChainClient(client) + + hash, _, _, err := chainClient.UploadBlob(context.Background(), fieldValues) log.Check(err) log.Printf("uploaded blob to chain -- hash: %s", hash) // TODO print receipt? @@ -47,23 +51,24 @@ func initShowBlobCmd() *cobra.Command { Run: func(cmd *cobra.Command, args []string) { hash, err := hashing.HashValueFromHex(args[0]) log.Check(err) - fields, err := SCClient(blob.Contract.Hname()).CallView( - blob.ViewGetBlobInfo.Name, - dict.Dict{blob.ParamHash: hash.Bytes()}, - ) + + client := cliclients.WaspClientForNodeIndex() + + blobInfo, _, err := client. + CorecontractsApi. + BlobsGetBlobInfo(context.Background(), GetCurrentChainID().String(), hash.Hex()). + Execute() log.Check(err) values := dict.New() - for field := range fields { - value, err := SCClient(blob.Contract.Hname()).CallView( - blob.ViewGetBlobField.Name, - dict.Dict{ - blob.ParamHash: hash.Bytes(), - blob.ParamField: []byte(field), - }, - ) + for field := range blobInfo.Fields { + value, _, err := client. + CorecontractsApi. + BlobsGetBlobValue(context.Background(), GetCurrentChainID().String(), hash.Hex(), field). + Execute() + log.Check(err) - values.Set(field, value[blob.ParamBytes]) + values.Set(kv.Key(field), []byte(value.ValueData)) } util.PrintDictAsJSON(values) }, @@ -76,23 +81,24 @@ func initListBlobsCmd() *cobra.Command { Short: "List blobs in chain", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - ret, err := SCClient(blob.Contract.Hname()).CallView(blob.ViewListBlobs.Name, nil) - log.Check(err) + client := cliclients.WaspClientForNodeIndex() + + blobsResponse, _, err := client. + CorecontractsApi. + BlobsGetAllBlobs(context.Background(), GetCurrentChainID().String()). + Execute() - blobs, err := blob.DecodeSizesMap(ret) log.Check(err) - log.Printf("Total %d blob(s) in chain %s\n", len(ret), GetCurrentChainID()) + log.Printf("Total %d blob(s) in chain %s\n", len(blobsResponse.Blobs), GetCurrentChainID()) header := []string{"hash", "size"} - rows := make([][]string, len(ret)) - i := 0 - for k, size := range blobs { - hash, err := codec.DecodeHashValue([]byte(k)) - log.Check(err) - rows[i] = []string{hash.String(), fmt.Sprintf("%d", size)} - i++ + rows := make([][]string, len(blobsResponse.Blobs)) + + for i, blob := range blobsResponse.Blobs { + rows[i] = []string{blob.Hash, fmt.Sprintf("%d", blob.Size)} } + log.PrintTable(header, rows) }, } diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index 3028f711fc..d028ef3616 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -1,17 +1,15 @@ package chain import ( + "context" "strconv" "time" "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/collections" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/vm/core/errors" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -35,49 +33,56 @@ func initBlockCmd() *cobra.Command { } } -func fetchBlockInfo(args []string) *blocklog.BlockInfo { +func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { + client := cliclients.WaspClientForNodeIndex() + if len(args) == 0 { - ret, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetBlockInfo.Name, nil) - log.Check(err) - index, err := codec.DecodeUint32(ret.MustGet(blocklog.ParamBlockIndex)) - log.Check(err) - b, err := blocklog.BlockInfoFromBytes(index, ret.MustGet(blocklog.ParamBlockInfo)) + blockInfo, _, err := client. + CorecontractsApi. + BlocklogGetLatestBlockInfo(context.Background(), GetCurrentChainID().String()). + Execute() + log.Check(err) - return b + return blockInfo } + index, err := strconv.Atoi(args[0]) log.Check(err) - ret, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetBlockInfo.Name, dict.Dict{ - blocklog.ParamBlockIndex: codec.EncodeUint32(uint32(index)), - }) - log.Check(err) - b, err := blocklog.BlockInfoFromBytes(uint32(index), ret.MustGet(blocklog.ParamBlockInfo)) + + blockInfo, _, err := client. + CorecontractsApi. + BlocklogGetBlockInfo(context.Background(), GetCurrentChainID().String(), int32(index)). + Execute() + log.Check(err) - return b + + return blockInfo } func logRequestsInBlock(index uint32) { - ret, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetRequestReceiptsForBlock.Name, dict.Dict{ - blocklog.ParamBlockIndex: codec.EncodeUint32(index), - }) + client := cliclients.WaspClientForNodeIndex() + // TODO: It should be uint32 here. Fix generator! + receipts, _, err := client.CorecontractsApi. + BlocklogGetRequestReceiptsOfBlock(context.Background(), GetCurrentChainID().String(), int32(index)). + Execute() + log.Check(err) - arr := collections.NewArray16ReadOnly(ret, blocklog.ParamRequestRecord) - for i := uint16(0); i < arr.MustLen(); i++ { - receipt, err := blocklog.RequestReceiptFromBytes(arr.MustGetAt(i)) - log.Check(err) - logReceipt(receipt, i) + + for i, receipt := range receipts.Receipts { + logReceipt(&receipt, i) } } -func logReceipt(receipt *blocklog.RequestReceipt, index ...uint16) { +func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { req := receipt.Request kind := "on-ledger" - if req.IsOffLedger() { + if req.IsOffLedger { kind = "off-ledger" } - args := req.Params() + args := req.Params.Items + var argsTree interface{} = "(empty)" if len(args) > 0 { argsTree = args @@ -85,35 +90,34 @@ func logReceipt(receipt *blocklog.RequestReceipt, index ...uint16) { errMsg := "(empty)" if receipt.Error != nil { - resolved, err := errors.Resolve(receipt.Error, func(contractName string, funcName string, params dict.Dict) (dict.Dict, error) { - return SCClient(isc.Hn(contractName)).CallView(funcName, params) - }) - log.Check(err) - errMsg = resolved.Error() + errMsg = receipt.Error.ErrorMessage } tree := []log.TreeItem{ {K: "Kind", V: kind}, - {K: "Sender", V: req.SenderAccount().String()}, - {K: "Contract Hname", V: req.CallTarget().Contract.String()}, - {K: "Entry point", V: req.CallTarget().EntryPoint.String()}, + {K: "Sender", V: req.SenderAccount}, + {K: "Contract Hname", V: req.CallTarget.Contract}, + {K: "Entry point", V: req.CallTarget.EntryPoint}, {K: "Arguments", V: argsTree}, {K: "Error", V: errMsg}, } if len(index) > 0 { - log.Printf("Request #%d (%s):\n", index[0], req.ID().String()) + log.Printf("Request #%d (%s):\n", index[0], req.RequestId) } else { - log.Printf("Request %s:\n", req.ID().String()) + log.Printf("Request %s:\n", req.RequestId) } log.PrintTree(tree, 2, 2) } func logEventsInBlock(index uint32) { - ret, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetEventsForBlock.Name, dict.Dict{ - blocklog.ParamBlockIndex: codec.EncodeUint32(index), - }) + client := cliclients.WaspClientForNodeIndex() + // TODO: It should be uint32 here. Fix generator! + events, _, err := client.CorecontractsApi. + BlocklogGetEventsOfBlock(context.Background(), GetCurrentChainID().String(), int32(index)). + Execute() + log.Check(err) - logEvents(ret) + logEvents(events) } func initRequestCmd() *cobra.Command { @@ -124,18 +128,18 @@ func initRequestCmd() *cobra.Command { Run: func(cmd *cobra.Command, args []string) { reqID, err := isc.RequestIDFromString(args[0]) log.Check(err) - ret, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetRequestReceipt.Name, dict.Dict{ - blocklog.ParamRequestID: codec.EncodeRequestID(reqID), - }) - log.Check(err) - blockIndex, err := codec.DecodeUint32(ret.MustGet(blocklog.ParamBlockIndex)) - log.Check(err) - receipt, err := blocklog.RequestReceiptFromBytes(ret.MustGet(blocklog.ParamRequestRecord)) + client := cliclients.WaspClientForNodeIndex() + // TODO: It should be uint32 here. Fix generator! + receipt, _, err := client.CorecontractsApi. + BlocklogGetRequestReceipt(context.Background(), GetCurrentChainID().String(), reqID.String()). + Execute() + log.Check(err) - log.Printf("Request found in block %d\n\n", blockIndex) + log.Printf("Request found in block %d\n\n", receipt.BlockIndex) logReceipt(receipt) + log.Printf("\n") logEventsInRequest(reqID) log.Printf("\n") @@ -144,20 +148,24 @@ func initRequestCmd() *cobra.Command { } func logEventsInRequest(reqID isc.RequestID) { - ret, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetEventsForRequest.Name, dict.Dict{ - blocklog.ParamRequestID: codec.EncodeRequestID(reqID), - }) + client := cliclients.WaspClientForNodeIndex() + // TODO: It should be uint32 here. Fix generator! + events, _, err := client.CorecontractsApi. + BlocklogGetEventsOfRequest(context.Background(), GetCurrentChainID().String(), reqID.String()). + Execute() + log.Check(err) - logEvents(ret) + logEvents(events) } -func logEvents(ret dict.Dict) { - arr := collections.NewArray16ReadOnly(ret, blocklog.ParamEvent) +func logEvents(ret *apiclient.EventsResponse) { header := []string{"event"} - rows := make([][]string, arr.MustLen()) - for i := uint16(0); i < arr.MustLen(); i++ { - rows[i] = []string{string(arr.MustGetAt(i))} + rows := make([][]string, len(ret.Events)) + + for i, event := range ret.Events { + rows[i] = []string{event} } - log.Printf("Total %d events\n", arr.MustLen()) + + log.Printf("Total %d events\n", len(ret.Events)) log.PrintTable(header, rows) } diff --git a/tools/wasp-cli/chain/callview.go b/tools/wasp-cli/chain/callview.go index 82c8530c55..94f152b89d 100644 --- a/tools/wasp-cli/chain/callview.go +++ b/tools/wasp-cli/chain/callview.go @@ -1,9 +1,13 @@ package chain import ( + "context" + "github.com/spf13/cobra" - "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -15,9 +19,24 @@ func initCallViewCmd() *cobra.Command { Long: "Call contract , view function with given params.", Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - r, err := SCClient(isc.Hn(args[0])).CallView(args[1], util.EncodeParams(args[2:])) + client := cliclients.WaspClientForNodeIndex() + + contractName := args[0] + funcName := args[1] + params := util.EncodeParams(args[2:]) + + result, _, err := client.RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ChainId: GetCurrentChainID().String(), + ContractName: contractName, + FunctionName: funcName, + Arguments: clients.JSONDictToAPIJSONDict(params.JSONDict()), + }).Execute() log.Check(err) - util.PrintDictAsJSON(r) + + decodedResult, err := clients.APIJsonDictToDict(*result) + log.Check(err) + + util.PrintDictAsJSON(decodedResult) }, } } diff --git a/tools/wasp-cli/chain/client.go b/tools/wasp-cli/chain/client.go deleted file mode 100644 index bb74abf058..0000000000 --- a/tools/wasp-cli/chain/client.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -package chain - -import ( - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/client/scclient" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/tools/wasp-cli/config" - "github.com/iotaledger/wasp/tools/wasp-cli/wallet" -) - -func Client(apiAddress string) *chainclient.Client { - return chainclient.New( - config.L1Client(), - config.WaspClient(apiAddress), - GetCurrentChainID(), - wallet.Load().KeyPair, - ) -} - -func SCClient(contractHname isc.Hname, i ...int) *scclient.SCClient { - return scclient.New(Client(config.WaspAPI(i...)), contractHname) -} diff --git a/tools/wasp-cli/chain/deploy.go b/tools/wasp-cli/chain/deploy.go index 8f309eed62..9419a776d4 100644 --- a/tools/wasp-cli/chain/deploy.go +++ b/tools/wasp-cli/chain/deploy.go @@ -19,7 +19,7 @@ import ( "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/vm/core/evm" "github.com/iotaledger/wasp/packages/vm/core/root" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) @@ -88,7 +88,7 @@ func initDeployCmd() *cobra.Command { } committeePubKeys := make([]string, 0) - for _, api := range config.CommitteeAPI(committee) { + for _, api := range config.CommitteeAPIURL(committee) { peerInfo, err := config.WaspClient(api).GetPeeringSelf() log.Check(err) committeePubKeys = append(committeePubKeys, peerInfo.PubKey) @@ -97,7 +97,7 @@ func initDeployCmd() *cobra.Command { chainid, _, err := apilib.DeployChainWithDKG(apilib.CreateChainParams{ AuthenticationToken: config.GetToken(), Layer1Client: l1Client, - CommitteeAPIHosts: config.CommitteeAPI(committee), + CommitteeAPIHosts: config.CommitteeAPIURL(committee), CommitteePubKeys: committeePubKeys, N: uint16(len(committee)), T: uint16(quorum), diff --git a/tools/wasp-cli/chain/deploycontract.go b/tools/wasp-cli/chain/deploycontract.go index 594be43c51..1616f403a3 100644 --- a/tools/wasp-cli/chain/deploycontract.go +++ b/tools/wasp-cli/chain/deploycontract.go @@ -11,7 +11,8 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/blob" "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/packages/vm/vmtypes" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -22,7 +23,7 @@ func initDeployContractCmd() *cobra.Command { Short: "Deploy a contract in the chain", Args: cobra.MinimumNArgs(4), Run: func(cmd *cobra.Command, args []string) { - apiAddress := config.MustWaspAPI() + apiAddress := config.MustWaspAPIURL() vmtype := args[0] name := args[1] description := args[2] @@ -61,7 +62,7 @@ func deployContract(name, description string, progHash hashing.HashValue, initPa root.ParamProgramHash: progHash, }) args.Extend(initParams) - return Client(apiAddress).PostOffLedgerRequest( + return cliclients.ChainClient(apiAddress).PostOffLedgerRequest( root.Contract.Hname(), root.FuncDeployContract.Hname(), chainclient.PostRequestParams{ diff --git a/tools/wasp-cli/chain/info.go b/tools/wasp-cli/chain/info.go index 9a6b60a4cc..35711243cd 100644 --- a/tools/wasp-cli/chain/info.go +++ b/tools/wasp-cli/chain/info.go @@ -13,7 +13,7 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/governance" "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -24,7 +24,7 @@ func initInfoCmd() *cobra.Command { Short: "Show information about the chain", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - chainInfo, err := config.WaspClient(config.MustWaspAPI()).GetChainInfo(GetCurrentChainID()) + chainInfo, err := config.WaspClient(config.MustWaspAPIURL()).GetChainInfo(GetCurrentChainID()) log.Check(err) printNodesRowHdr := []string{"PubKey", "NetID", "Alive", "Committee", "Access", "AccessAPI"} diff --git a/tools/wasp-cli/chain/list.go b/tools/wasp-cli/chain/list.go index cb8e286b3f..f675b71f51 100644 --- a/tools/wasp-cli/chain/list.go +++ b/tools/wasp-cli/chain/list.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,7 +16,7 @@ func initListCmd() *cobra.Command { Short: "List deployed chains", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPI()) + client := config.WaspClient(config.MustWaspAPIURL()) chains, err := client.GetChainRecordList() log.Check(err) model := &ListChainModel{ diff --git a/tools/wasp-cli/chain/rotate.go b/tools/wasp-cli/chain/rotate.go index 84903d21c9..bb6509c4b6 100644 --- a/tools/wasp-cli/chain/rotate.go +++ b/tools/wasp-cli/chain/rotate.go @@ -12,7 +12,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/transaction" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) diff --git a/tools/wasp-cli/chain/rundkg.go b/tools/wasp-cli/chain/rundkg.go index 7894fb151c..f80002a315 100644 --- a/tools/wasp-cli/chain/rundkg.go +++ b/tools/wasp-cli/chain/rundkg.go @@ -10,10 +10,9 @@ import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/client" "github.com/iotaledger/wasp/packages/apilib" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -36,14 +35,14 @@ func initRunDKGCmd() *cobra.Command { } committeePubKeys := make([]string, 0) - for _, api := range config.CommitteeAPI(committee) { - peerInfo, err := client.NewWaspClient(api).GetPeeringSelf() + for _, api := range config.CommitteeAPIURL(committee) { + peerInfo, err := clients.NewWaspClient(api).GetPeeringSelf() log.Check(err) committeePubKeys = append(committeePubKeys, peerInfo.PubKey) } dkgInitiatorIndex := uint16(rand.Intn(len(committee))) - stateControllerAddr, err := apilib.RunDKG(config.GetToken(), config.CommitteeAPI(committee), committeePubKeys, uint16(quorum), dkgInitiatorIndex) + stateControllerAddr, err := apilib.RunDKG(config.GetToken(), config.CommitteeAPIURL(committee), committeePubKeys, uint16(quorum), dkgInitiatorIndex) log.Check(err) fmt.Fprintf(os.Stdout, "DKG successful, address: %s", stateControllerAddr.Bech32(parameters.L1().Protocol.Bech32HRP)) diff --git a/tools/wasp-cli/cli/cliclients/clients.go b/tools/wasp-cli/cli/cliclients/clients.go index 04da6e6fe3..6f92d9ce4b 100644 --- a/tools/wasp-cli/cli/cliclients/clients.go +++ b/tools/wasp-cli/cli/cliclients/clients.go @@ -1,13 +1,18 @@ -package clients +package cliclients import ( "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/chainclient" + "github.com/iotaledger/wasp/clients/scclient" + "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/l1connection" + "github.com/iotaledger/wasp/tools/wasp-cli/chain" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" + "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) -func WaspClientForNodeNumber(i ...int) *apiclient.APIClient { +func WaspClientForNodeIndex(i ...int) *apiclient.APIClient { return WaspClient(config.WaspAPIURL(i...)) } @@ -34,3 +39,16 @@ func L1Client() l1connection.Client { log.HiveLogger(), ) } + +func ChainClient(waspClient *apiclient.APIClient) *chainclient.Client { + return chainclient.New( + L1Client(), + waspClient, + chain.GetCurrentChainID(), + wallet.Load().KeyPair, + ) +} + +func SCClient(apiClient *apiclient.APIClient, contractHname isc.Hname) *scclient.SCClient { + return scclient.New(ChainClient(apiClient), contractHname) +} diff --git a/tools/wasp-cli/cli/config/config.go b/tools/wasp-cli/cli/config/config.go index 7d9263bb79..5ffd9e46a1 100644 --- a/tools/wasp-cli/cli/config/config.go +++ b/tools/wasp-cli/cli/config/config.go @@ -4,13 +4,11 @@ import ( "fmt" "time" - "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/iotaledger/wasp/clients/apiclient" - "github.com/iotaledger/wasp/packages/l1connection" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/testutil/privtangle/privtangledefaults" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -29,54 +27,6 @@ const ( l1ParamsExpiration = 24 * time.Hour ) -func initConfigSetCmd() *cobra.Command { - return &cobra.Command{ - Use: "set ", - Short: "Set a configuration value", - Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { - v := args[1] - switch v { - case "true": - Set(args[0], true) - case "false": - Set(args[0], false) - default: - Set(args[0], v) - } - }, - } -} - -func initRefreshL1ParamsCmd() *cobra.Command { - return &cobra.Command{ - Use: "refresh-l1-params", - Short: "Refresh L1 params from node", - Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { - refreshL1ParamsFromNode() - }, - } -} - -func Init(rootCmd *cobra.Command, waspVersion string) { - rootCmd.PersistentFlags().StringVarP(&ConfigPath, "config", "c", "wasp-cli.json", "path to wasp-cli.json") - rootCmd.PersistentFlags().BoolVarP(&WaitForCompletion, "wait", "w", true, "wait for request completion") - - rootCmd.AddCommand(initConfigSetCmd()) - rootCmd.AddCommand(initCheckVersionsCmd(waspVersion)) - rootCmd.AddCommand(initRefreshL1ParamsCmd()) - - // The first time parameters.L1() is called, it will be initialized with this function - parameters.InitL1Lazy(func() { - if l1ParamsExpired() { - refreshL1ParamsFromNode() - } else { - loadL1ParamsFromConfig() - } - }) -} - func l1ParamsExpired() bool { if viper.Get(l1ParamsKey) == nil { return true @@ -88,7 +38,7 @@ func refreshL1ParamsFromNode() { if log.VerboseFlag { log.Printf("Getting L1 params from node at %s...\n", L1APIAddress()) } - L1Client() // this will call parameters.InitL1() + cliclients.L1Client() // this will call parameters.InitL1() Set(l1ParamsKey, parameters.L1NoLock()) Set(l1ParamsTimestampKey, time.Now()) } @@ -118,18 +68,6 @@ func L1APIAddress() string { ) } -func L1INXAddress() string { - host := viper.GetString("l1.inxAddress") - if host != "" { - return host - } - return fmt.Sprintf( - "%s:%d", - privtangledefaults.INXHost, - privtangledefaults.BasePort+privtangledefaults.NodePortOffsetINX, - ) -} - func L1FaucetAddress() string { address := viper.GetString("l1.faucetAddress") if address != "" { @@ -142,18 +80,6 @@ func L1FaucetAddress() string { ) } -func L1Client() l1connection.Client { - log.Verbosef("using L1 API %s\n", L1APIAddress()) - - return l1connection.NewClient( - l1connection.Config{ - APIAddress: L1APIAddress(), - FaucetAddress: L1FaucetAddress(), - }, - log.HiveLogger(), - ) -} - func GetToken() string { return viper.GetString("authentication.token") } @@ -162,22 +88,6 @@ func SetToken(token string) { Set("authentication.token", token) } -func WaspClientForNodeNumber(i ...int) *apiclient.APIClient { - return WaspClient(WaspAPIURL(i...)) -} - -func WaspClient(apiAddress string) *apiclient.APIClient { - // TODO: add authentication for /adm - L1Client() // this will fill parameters.L1() with data from the L1 node - log.Verbosef("using Wasp host %s\n", apiAddress) - - config := apiclient.NewConfiguration() - config.Host = apiAddress - config.AddDefaultHeader("Authorization", GetToken()) - - return apiclient.NewAPIClient(config) -} - func MustWaspAPIURL(i ...int) string { apiAddress := WaspAPIURL(i...) if apiAddress == "" { @@ -194,40 +104,10 @@ func WaspAPIURL(i ...int) string { return viper.GetString(fmt.Sprintf("wasp.%d.%s", index, HostKindAPI)) } -func WaspNanomsg(i ...int) string { - index := 0 - if len(i) > 0 { - index = i[0] - } - r := viper.GetString("wasp." + HostKindNanomsg) - if r != "" { - return r - } - return committeeHost(HostKindNanomsg, index) -} - -func FindNodeBy(kind, v string) int { - for i := 0; i < 100; i++ { - if committeeHost(kind, i) == v { - return i - } - } - log.Fatalf("Cannot find node with %q = %q in configuration", kind, v) - return 0 -} - func CommitteeAPIURL(indices []int) []string { return committeeHosts(HostKindAPI, indices) } -func CommitteePeering(indices []int) []string { - return committeeHosts(HostKindPeering, indices) -} - -func CommitteeNanomsg(indices []int) []string { - return committeeHosts(HostKindNanomsg, indices) -} - func committeeHosts(kind string, indices []int) []string { hosts := make([]string, 0) for _, i := range indices { @@ -240,18 +120,6 @@ func committeeConfigVar(kind string, i int) string { return fmt.Sprintf("wasp.%d.%s", i, kind) } -func CommitteeAPIConfigVar(i int) string { - return committeeConfigVar(HostKindAPI, i) -} - -func CommitteePeeringConfigVar(i int) string { - return committeeConfigVar(HostKindPeering, i) -} - -func CommitteeNanomsgConfigVar(i int) string { - return committeeConfigVar(HostKindNanomsg, i) -} - func committeeHost(kind string, i int) string { r := viper.GetString(committeeConfigVar(kind, i)) if r != "" { diff --git a/tools/wasp-cli/cli/config/init.go b/tools/wasp-cli/cli/config/init.go index d912156bec..39ceb49f58 100644 --- a/tools/wasp-cli/cli/config/init.go +++ b/tools/wasp-cli/cli/config/init.go @@ -1 +1,55 @@ package config + +import ( + "github.com/spf13/cobra" + + "github.com/iotaledger/wasp/packages/parameters" +) + +func initConfigSetCmd() *cobra.Command { + return &cobra.Command{ + Use: "set ", + Short: "Set a configuration value", + Args: cobra.ExactArgs(2), + Run: func(cmd *cobra.Command, args []string) { + v := args[1] + switch v { + case "true": + Set(args[0], true) + case "false": + Set(args[0], false) + default: + Set(args[0], v) + } + }, + } +} + +func initRefreshL1ParamsCmd() *cobra.Command { + return &cobra.Command{ + Use: "refresh-l1-params", + Short: "Refresh L1 params from node", + Args: cobra.NoArgs, + Run: func(cmd *cobra.Command, args []string) { + refreshL1ParamsFromNode() + }, + } +} + +func Init(rootCmd *cobra.Command, waspVersion string) { + rootCmd.PersistentFlags().StringVarP(&ConfigPath, "config", "c", "wasp-cli.json", "path to wasp-cli.json") + rootCmd.PersistentFlags().BoolVarP(&WaitForCompletion, "wait", "w", true, "wait for request completion") + + rootCmd.AddCommand(initConfigSetCmd()) + rootCmd.AddCommand(initCheckVersionsCmd(waspVersion)) + rootCmd.AddCommand(initRefreshL1ParamsCmd()) + + // The first time parameters.L1() is called, it will be initialized with this function + parameters.InitL1Lazy(func() { + if l1ParamsExpired() { + refreshL1ParamsFromNode() + } else { + loadL1ParamsFromConfig() + } + }) +} diff --git a/tools/wasp-cli/log/log.go b/tools/wasp-cli/log/log.go index 45fc4dddb5..3b308e4938 100644 --- a/tools/wasp-cli/log/log.go +++ b/tools/wasp-cli/log/log.go @@ -14,7 +14,6 @@ import ( "github.com/iotaledger/hive.go/core/logger" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client" "github.com/iotaledger/wasp/packages/kv/dict" ) @@ -143,7 +142,7 @@ func PrintCLIOutput(output CLIOutput) { func Check(err error) { if err != nil { - if errors.Is(err, client.ErrNotAuthorized) { + if errors.Is(err, clients.ErrNotAuthorized) { err = errors.New("unauthorized request: are you logged in? (wasp-cli login)") } diff --git a/tools/wasp-cli/main.go b/tools/wasp-cli/main.go index 3c0654feeb..7592ce6612 100644 --- a/tools/wasp-cli/main.go +++ b/tools/wasp-cli/main.go @@ -12,8 +12,8 @@ import ( "github.com/iotaledger/wasp/core/app" "github.com/iotaledger/wasp/tools/wasp-cli/authentication" "github.com/iotaledger/wasp/tools/wasp-cli/chain" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/completion" - "github.com/iotaledger/wasp/tools/wasp-cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/decode" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/metrics" diff --git a/tools/wasp-cli/metrics/consensus.go b/tools/wasp-cli/metrics/consensus.go index 5938b75d9e..3ae78ec33d 100644 --- a/tools/wasp-cli/metrics/consensus.go +++ b/tools/wasp-cli/metrics/consensus.go @@ -8,7 +8,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -20,7 +20,7 @@ func initConsensusMetricsCmd() *cobra.Command { Short: "Show current value of collected metrics of consensus", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPI()) + client := config.WaspClient(config.MustWaspAPIURL()) _, chainAddress, err := iotago.ParseBech32(chainAlias) log.Check(err) chainID := isc.ChainIDFromAddress(chainAddress.(*iotago.AliasAddress)) diff --git a/tools/wasp-cli/metrics/nodeconn.go b/tools/wasp-cli/metrics/nodeconn.go index a9b56989f8..8b6c717a50 100644 --- a/tools/wasp-cli/metrics/nodeconn.go +++ b/tools/wasp-cli/metrics/nodeconn.go @@ -8,7 +8,7 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -20,7 +20,7 @@ func initNodeconnMetricsCmd() *cobra.Command { Short: "Show current value of collected metrics of connection to L1", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPI()) + client := config.WaspClient(config.MustWaspAPIURL()) if chainAlias == "" { nodeconnMetrics, err := client.GetNodeConnectionMetrics() log.Check(err) diff --git a/tools/wasp-cli/peering/distrust.go b/tools/wasp-cli/peering/distrust.go index d42fab8b47..1b3940da3c 100644 --- a/tools/wasp-cli/peering/distrust.go +++ b/tools/wasp-cli/peering/distrust.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -18,7 +18,7 @@ func initDistrustCmd() *cobra.Command { Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { pubKeyOrNetID := args[0] - waspClient := config.WaspClient(config.MustWaspAPI()) + waspClient := config.WaspClient(config.MustWaspAPIURL()) if peering.CheckNetID(pubKeyOrNetID) != nil { log.Check(waspClient.DeletePeeringTrusted(pubKeyOrNetID)) log.Printf("# Distrusted PubKey: %v\n", pubKeyOrNetID) diff --git a/tools/wasp-cli/peering/info.go b/tools/wasp-cli/peering/info.go index 9ce3026c23..b6553ecb6c 100644 --- a/tools/wasp-cli/peering/info.go +++ b/tools/wasp-cli/peering/info.go @@ -6,7 +6,7 @@ package peering import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,7 +16,7 @@ func initInfoCmd() *cobra.Command { Short: "Node info.", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - info, err := config.WaspClient(config.MustWaspAPI()).GetPeeringSelf() + info, err := config.WaspClient(config.MustWaspAPIURL()).GetPeeringSelf() log.Check(err) model := &InfoModel{PubKey: info.PubKey, NetID: info.NetID} diff --git a/tools/wasp-cli/peering/listtrusted.go b/tools/wasp-cli/peering/listtrusted.go index 1789bf2f55..1602d95e56 100644 --- a/tools/wasp-cli/peering/listtrusted.go +++ b/tools/wasp-cli/peering/listtrusted.go @@ -6,7 +6,7 @@ package peering import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,7 +16,7 @@ func initListTrustedCmd() *cobra.Command { Short: "List trusted wasp nodes.", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - trustedList, err := config.WaspClient(config.MustWaspAPI()).GetPeeringTrustedList() + trustedList, err := config.WaspClient(config.MustWaspAPIURL()).GetPeeringTrustedList() log.Check(err) header := []string{"PubKey", "NetID"} rows := make([][]string, len(trustedList)) diff --git a/tools/wasp-cli/peering/trust.go b/tools/wasp-cli/peering/trust.go index f06d940719..6bac464a6f 100644 --- a/tools/wasp-cli/peering/trust.go +++ b/tools/wasp-cli/peering/trust.go @@ -8,8 +8,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/tools/wasp-cli/chain" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) diff --git a/tools/wasp-cli/util/tx.go b/tools/wasp-cli/util/tx.go index 9e27cf9648..4a06844fea 100644 --- a/tools/wasp-cli/util/tx.go +++ b/tools/wasp-cli/util/tx.go @@ -6,7 +6,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -20,7 +20,7 @@ func WithOffLedgerRequest(chainID isc.ChainID, f func() (isc.OffLedgerRequest, e log.Check(err) log.Printf("Posted off-ledger request (check result with: %s chain request %s)\n", os.Args[0], req.ID().String()) if config.WaitForCompletion { - _, err = config.WaspClient(config.MustWaspAPI()).WaitUntilRequestProcessed(chainID, req.ID(), 1*time.Minute) + _, err = config.WaspClient(config.MustWaspAPIURL()).WaitUntilRequestProcessed(chainID, req.ID(), 1*time.Minute) log.Check(err) } // TODO print receipt? @@ -33,7 +33,7 @@ func WithSCTransaction(chainID isc.ChainID, f func() (*iotago.Transaction, error if config.WaitForCompletion || len(forceWait) > 0 { log.Printf("Waiting for tx requests to be processed...\n") - _, err := config.WaspClient(config.MustWaspAPI()).WaitUntilAllRequestsProcessed(chainID, tx, 1*time.Minute) + _, err := config.WaspClient(config.MustWaspAPIURL()).WaitUntilAllRequestsProcessed(chainID, tx, 1*time.Minute) log.Check(err) } diff --git a/tools/wasp-cli/wallet/info.go b/tools/wasp-cli/wallet/info.go index f3fb9ed499..c6264c0ba0 100644 --- a/tools/wasp-cli/wallet/info.go +++ b/tools/wasp-cli/wallet/info.go @@ -6,7 +6,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) diff --git a/tools/wasp-cli/wallet/request-funds.go b/tools/wasp-cli/wallet/request-funds.go index b7ef7b7a6b..ece34fcbe2 100644 --- a/tools/wasp-cli/wallet/request-funds.go +++ b/tools/wasp-cli/wallet/request-funds.go @@ -4,7 +4,7 @@ import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) diff --git a/tools/wasp-cli/wallet/send.go b/tools/wasp-cli/wallet/send.go index cbbc547048..932ea97729 100644 --- a/tools/wasp-cli/wallet/send.go +++ b/tools/wasp-cli/wallet/send.go @@ -6,7 +6,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/transaction" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) diff --git a/tools/wasp-cli/wallet/wallet.go b/tools/wasp-cli/wallet/wallet.go index 697cafe404..fa81c8a06e 100644 --- a/tools/wasp-cli/wallet/wallet.go +++ b/tools/wasp-cli/wallet/wallet.go @@ -6,7 +6,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) From 61e376bdb013227f1a30d96fc5c04712d9ed7dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 2 Feb 2023 22:17:19 +0100 Subject: [PATCH 04/39] Finished wasp-cli/chain refactoring, metrics refactoring, peering refactoring --- tools/wasp-cli/authentication/info.go | 2 +- tools/wasp-cli/authentication/login.go | 2 +- tools/wasp-cli/chain/accounts.go | 8 +-- tools/wasp-cli/chain/activate.go | 4 +- tools/wasp-cli/chain/blobs.go | 11 ++- tools/wasp-cli/chain/blocklog.go | 10 +-- tools/wasp-cli/chain/callview.go | 2 +- tools/wasp-cli/chain/deploy.go | 11 +-- tools/wasp-cli/chain/deploycontract.go | 14 ++-- tools/wasp-cli/chain/events.go | 17 +++-- tools/wasp-cli/chain/governance.go | 2 +- tools/wasp-cli/chain/info.go | 86 ++++++++++++++---------- tools/wasp-cli/chain/list.go | 22 +++--- tools/wasp-cli/chain/listcontracts.go | 22 +++++- tools/wasp-cli/chain/postrequest.go | 6 +- tools/wasp-cli/chain/rotate.go | 4 +- tools/wasp-cli/chain/rundkg.go | 9 ++- tools/wasp-cli/cli/cliclients/clients.go | 10 +-- tools/wasp-cli/metrics/consensus.go | 16 +++-- tools/wasp-cli/metrics/nodeconn.go | 10 +-- tools/wasp-cli/peering/distrust.go | 28 +++++--- 21 files changed, 182 insertions(+), 114 deletions(-) diff --git a/tools/wasp-cli/authentication/info.go b/tools/wasp-cli/authentication/info.go index 045e7b5fc5..7834d58257 100644 --- a/tools/wasp-cli/authentication/info.go +++ b/tools/wasp-cli/authentication/info.go @@ -28,7 +28,7 @@ func initInfoCmd() *cobra.Command { Run: func(cmd *cobra.Command, args []string) { // Auth is currently not inside Swagger, so this is a temporary change - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() authInfo, _, err := client.AuthApi.AuthInfo(context.Background()).Execute() log.Check(err) diff --git a/tools/wasp-cli/authentication/login.go b/tools/wasp-cli/authentication/login.go index 562752285f..3f44e88356 100644 --- a/tools/wasp-cli/authentication/login.go +++ b/tools/wasp-cli/authentication/login.go @@ -48,7 +48,7 @@ func initLoginCmd() *cobra.Command { return } - token, _, err := cliclients.WaspClientForNodeIndex().AuthApi. + token, _, err := cliclients.WaspClientForIndex().AuthApi. Authenticate(context.Background()). LoginRequest(apiclient.LoginRequest{ Username: username, diff --git a/tools/wasp-cli/chain/accounts.go b/tools/wasp-cli/chain/accounts.go index ba9f582e47..005853ac1a 100644 --- a/tools/wasp-cli/chain/accounts.go +++ b/tools/wasp-cli/chain/accounts.go @@ -23,7 +23,7 @@ func initListAccountsCmd() *cobra.Command { Short: "List L2 accounts", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() chainID := GetCurrentChainID() accountList, _, err := client.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID.String()).Execute() @@ -57,7 +57,7 @@ func initBalanceCmd() *cobra.Command { log.Check(err) } - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() chainID := GetCurrentChainID() balance, _, err := client.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID.String(), agentID.String()).Execute() @@ -87,7 +87,7 @@ func initDepositCmd() *cobra.Command { // deposit to own agentID tokens := util.ParseFungibleTokens(args) util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() return cliclients.SCClient(client, accounts.Contract.Hname()).PostRequest( accounts.FuncDeposit.Name, @@ -106,7 +106,7 @@ func initDepositCmd() *cobra.Command { allowance := tokens.Clone() util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() return cliclients.SCClient(client, accounts.Contract.Hname()).PostRequest( accounts.FuncTransferAllowanceTo.Name, diff --git a/tools/wasp-cli/chain/activate.go b/tools/wasp-cli/chain/activate.go index 5fc04e5989..6bbcfbb923 100644 --- a/tools/wasp-cli/chain/activate.go +++ b/tools/wasp-cli/chain/activate.go @@ -24,7 +24,7 @@ func initActivateCmd() *cobra.Command { nodes = GetAllWaspNodes() } for _, nodeIdx := range nodes { - client := cliclients.WaspClientForNodeIndex(nodeIdx) + client := cliclients.WaspClientForIndex(nodeIdx) r, _, err := client.ChainsApi.GetChainInfo(context.Background(), chainID.String()).Execute() @@ -59,7 +59,7 @@ func initDeactivateCmd() *cobra.Command { nodes = GetAllWaspNodes() } for _, nodeIdx := range nodes { - client := cliclients.WaspClientForNodeIndex(nodeIdx) + client := cliclients.WaspClientForIndex(nodeIdx) _, err := client.ChainsApi.DeactivateChain(context.Background(), chainID.String()).Execute() log.Check(err) diff --git a/tools/wasp-cli/chain/blobs.go b/tools/wasp-cli/chain/blobs.go index c4918f9702..fed62e2be7 100644 --- a/tools/wasp-cli/chain/blobs.go +++ b/tools/wasp-cli/chain/blobs.go @@ -6,11 +6,11 @@ import ( "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/kv" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" - config2 "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -27,13 +27,12 @@ func initStoreBlobCmd() *cobra.Command { Short: "Store a blob in the chain", Args: cobra.MinimumNArgs(4), Run: func(cmd *cobra.Command, args []string) { - uploadBlob(util.EncodeParams(args), config2.MustWaspAPIURL()) + uploadBlob(cliclients.WaspClientForIndex(), util.EncodeParams(args)) }, } } -func uploadBlob(fieldValues dict.Dict, apiAddress string) (hash hashing.HashValue) { - client := cliclients.WaspClientForNodeIndex() +func uploadBlob(client *apiclient.APIClient, fieldValues dict.Dict) (hash hashing.HashValue) { chainClient := cliclients.ChainClient(client) hash, _, _, err := chainClient.UploadBlob(context.Background(), fieldValues) @@ -52,7 +51,7 @@ func initShowBlobCmd() *cobra.Command { hash, err := hashing.HashValueFromHex(args[0]) log.Check(err) - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() blobInfo, _, err := client. CorecontractsApi. @@ -81,7 +80,7 @@ func initListBlobsCmd() *cobra.Command { Short: "List blobs in chain", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() blobsResponse, _, err := client. CorecontractsApi. diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index d028ef3616..5d26a85d5e 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -34,7 +34,7 @@ func initBlockCmd() *cobra.Command { } func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() if len(args) == 0 { blockInfo, _, err := client. @@ -60,7 +60,7 @@ func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { } func logRequestsInBlock(index uint32) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! receipts, _, err := client.CorecontractsApi. BlocklogGetRequestReceiptsOfBlock(context.Background(), GetCurrentChainID().String(), int32(index)). @@ -110,7 +110,7 @@ func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { } func logEventsInBlock(index uint32) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. BlocklogGetEventsOfBlock(context.Background(), GetCurrentChainID().String(), int32(index)). @@ -129,7 +129,7 @@ func initRequestCmd() *cobra.Command { reqID, err := isc.RequestIDFromString(args[0]) log.Check(err) - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! receipt, _, err := client.CorecontractsApi. BlocklogGetRequestReceipt(context.Background(), GetCurrentChainID().String(), reqID.String()). @@ -148,7 +148,7 @@ func initRequestCmd() *cobra.Command { } func logEventsInRequest(reqID isc.RequestID) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. BlocklogGetEventsOfRequest(context.Background(), GetCurrentChainID().String(), reqID.String()). diff --git a/tools/wasp-cli/chain/callview.go b/tools/wasp-cli/chain/callview.go index 94f152b89d..c8313edee8 100644 --- a/tools/wasp-cli/chain/callview.go +++ b/tools/wasp-cli/chain/callview.go @@ -19,7 +19,7 @@ func initCallViewCmd() *cobra.Command { Long: "Call contract , view function with given params.", Args: cobra.MinimumNArgs(2), Run: func(cmd *cobra.Command, args []string) { - client := cliclients.WaspClientForNodeIndex() + client := cliclients.WaspClientForIndex() contractName := args[0] funcName := args[1] diff --git a/tools/wasp-cli/chain/deploy.go b/tools/wasp-cli/chain/deploy.go index 9419a776d4..5076d7afaf 100644 --- a/tools/wasp-cli/chain/deploy.go +++ b/tools/wasp-cli/chain/deploy.go @@ -4,6 +4,7 @@ package chain import ( + "context" "math" "os" "strconv" @@ -19,6 +20,7 @@ import ( "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/vm/core/evm" "github.com/iotaledger/wasp/packages/vm/core/root" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/wallet" @@ -73,7 +75,8 @@ func initDeployCmd() *cobra.Command { Short: "Deploy a new chain", Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - l1Client := config.L1Client() + l1Client := cliclients.L1Client() + alias := GetChainAlias() if committee == nil { committee = GetAllWaspNodes() @@ -88,10 +91,10 @@ func initDeployCmd() *cobra.Command { } committeePubKeys := make([]string, 0) - for _, api := range config.CommitteeAPIURL(committee) { - peerInfo, err := config.WaspClient(api).GetPeeringSelf() + for _, apiIndex := range committee { + peerInfo, _, err := cliclients.WaspClientForIndex(apiIndex).NodeApi.GetPeeringIdentity(context.Background()).Execute() log.Check(err) - committeePubKeys = append(committeePubKeys, peerInfo.PubKey) + committeePubKeys = append(committeePubKeys, peerInfo.PublicKey) } chainid, _, err := apilib.DeployChainWithDKG(apilib.CreateChainParams{ diff --git a/tools/wasp-cli/chain/deploycontract.go b/tools/wasp-cli/chain/deploycontract.go index 1616f403a3..0163fabcfc 100644 --- a/tools/wasp-cli/chain/deploycontract.go +++ b/tools/wasp-cli/chain/deploycontract.go @@ -3,7 +3,8 @@ package chain import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" @@ -12,7 +13,6 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/packages/vm/vmtypes" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -23,7 +23,7 @@ func initDeployContractCmd() *cobra.Command { Short: "Deploy a contract in the chain", Args: cobra.MinimumNArgs(4), Run: func(cmd *cobra.Command, args []string) { - apiAddress := config.MustWaspAPIURL() + client := cliclients.WaspClientForIndex() vmtype := args[0] name := args[1] description := args[2] @@ -47,14 +47,14 @@ func initDeployContractCmd() *cobra.Command { blob.VarFieldProgramDescription: description, blob.VarFieldProgramBinary: util.ReadFile(filename), }) - progHash = uploadBlob(blobFieldValues, apiAddress) + progHash = uploadBlob(client, blobFieldValues) } - deployContract(name, description, progHash, initParams, apiAddress) + deployContract(client, name, description, progHash, initParams) }, } } -func deployContract(name, description string, progHash hashing.HashValue, initParams dict.Dict, apiAddress string) { +func deployContract(client *apiclient.APIClient, name, description string, progHash hashing.HashValue, initParams dict.Dict) { util.WithOffLedgerRequest(GetCurrentChainID(), func() (isc.OffLedgerRequest, error) { args := codec.MakeDict(map[string]interface{}{ root.ParamName: name, @@ -62,7 +62,7 @@ func deployContract(name, description string, progHash hashing.HashValue, initPa root.ParamProgramHash: progHash, }) args.Extend(initParams) - return cliclients.ChainClient(apiAddress).PostOffLedgerRequest( + return cliclients.ChainClient(client).PostOffLedgerRequest( root.Contract.Hname(), root.FuncDeployContract.Hname(), chainclient.PostRequestParams{ diff --git a/tools/wasp-cli/chain/events.go b/tools/wasp-cli/chain/events.go index ac8a4fe254..42368d9edd 100644 --- a/tools/wasp-cli/chain/events.go +++ b/tools/wasp-cli/chain/events.go @@ -1,11 +1,12 @@ package chain import ( + "context" + "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -15,11 +16,15 @@ func initEventsCmd() *cobra.Command { Short: "Show events of contract ", Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { - r, err := SCClient(blocklog.Contract.Hname()).CallView(blocklog.ViewGetEventsForContract.Name, dict.Dict{ - blocklog.ParamContractHname: isc.Hn(args[0]).Bytes(), - }) + client := cliclients.WaspClientForIndex() + contractHName := isc.Hn(args[0]).String(); + + events, _, err := client.CorecontractsApi. + BlocklogGetEventsOfContract(context.Background(), GetCurrentChainID().String(), contractHName). + Execute() + log.Check(err) - logEvents(r) + logEvents(events) }, } } diff --git a/tools/wasp-cli/chain/governance.go b/tools/wasp-cli/chain/governance.go index e64dd2aad9..bb0c35bb43 100644 --- a/tools/wasp-cli/chain/governance.go +++ b/tools/wasp-cli/chain/governance.go @@ -6,7 +6,7 @@ package chain import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/vm/core/governance" "github.com/iotaledger/wasp/tools/wasp-cli/log" diff --git a/tools/wasp-cli/chain/info.go b/tools/wasp-cli/chain/info.go index 35711243cd..9d62b37984 100644 --- a/tools/wasp-cli/chain/info.go +++ b/tools/wasp-cli/chain/info.go @@ -4,16 +4,15 @@ package chain import ( + "context" "strconv" "github.com/spf13/cobra" + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/collections" - "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/vm/core/root" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -24,68 +23,81 @@ func initInfoCmd() *cobra.Command { Short: "Show information about the chain", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - chainInfo, err := config.WaspClient(config.MustWaspAPIURL()).GetChainInfo(GetCurrentChainID()) + client := cliclients.WaspClientForIndex() + + chainInfo, _, err := client.ChainsApi. + GetChainInfo(context.Background(), GetCurrentChainID().String()). + Execute() + log.Check(err) + + committeeInfo, _, err := client.ChainsApi. + GetCommitteeInfo(context.Background(), GetCurrentChainID().String()). + Execute() log.Check(err) printNodesRowHdr := []string{"PubKey", "NetID", "Alive", "Committee", "Access", "AccessAPI"} - printNodesRowFmt := func(n *model.ChainNodeStatus) []string { + printNodesRowFmt := func(n apiclient.CommitteeNode, isCommitteeNode, isAccessNode bool) []string { return []string{ - n.Node.PubKey, - n.Node.NetID, + n.Node.PublicKey, + n.Node.NetId, strconv.FormatBool(n.Node.IsAlive), - strconv.FormatBool(n.ForCommittee), - strconv.FormatBool(n.ForAccess), + strconv.FormatBool(isCommitteeNode), + strconv.FormatBool(isAccessNode), n.AccessAPI, } } - printNodes := func(label string, nodes []*model.ChainNodeStatus) { + printNodes := func(label string, nodes []apiclient.CommitteeNode, isCommitteeNode, isAccessNode bool) { if nodes == nil { log.Printf("%s: N/A\n", label) } log.Printf("%s: %v\n", label, len(nodes)) rows := make([][]string, 0) for _, n := range nodes { - rows = append(rows, printNodesRowFmt(n)) + rows = append(rows, printNodesRowFmt(n, isCommitteeNode, isAccessNode)) } log.PrintTable(printNodesRowHdr, rows) } log.Printf("Chain ID: %s\n", chainInfo.ChainID) - log.Printf("Active: %v\n", chainInfo.Active) + log.Printf("Active: %v\n", chainInfo.IsActive) - if chainInfo.Active { - log.Printf("State address: %v\n", chainInfo.StateAddress) - printNodes("Committee nodes", chainInfo.CommitteeNodes) - printNodes("Access nodes", chainInfo.AccessNodes) - printNodes("Candidate nodes", chainInfo.CandidateNodes) - - ret, err := SCClient(governance.Contract.Hname()).CallView(governance.ViewGetChainInfo.Name, nil) - log.Check(err) - govInfo, err := governance.GetChainInfo(ret) - log.Check(err) + if chainInfo.IsActive { + log.Printf("State address: %v\n", committeeInfo.StateAddress) + printNodes("Committee nodes", committeeInfo.CommitteeNodes, true, false) + printNodes("Access nodes", committeeInfo.AccessNodes, false, true) + printNodes("Candidate nodes", committeeInfo.CandidateNodes, false, false) - log.Printf("Description: %s\n", govInfo.Description) + log.Printf("Description: %s\n", chainInfo.Description) - recs, err := SCClient(root.Contract.Hname()).CallView(root.ViewGetContractRecords.Name, nil) - log.Check(err) - contracts, err := root.DecodeContractRegistry(collections.NewMapReadOnly(recs, root.StateVarContractRegistry)) + contracts, _, err := client.ChainsApi.GetContracts(context.Background(), GetCurrentChainID().String()).Execute() log.Check(err) log.Printf("#Contracts: %d\n", len(contracts)) - log.Printf("Owner: %s\n", govInfo.ChainOwnerID.String()) + log.Printf("Owner: %s\n", chainInfo.ChainOwnerId) - if govInfo.GasFeePolicy != nil { + // TODO: Validate the gas fee token id logic + if chainInfo.GasFeePolicy != nil { gasFeeToken := util.BaseTokenStr - if !isc.IsEmptyNativeTokenID(govInfo.GasFeePolicy.GasFeeTokenID) { - gasFeeToken = govInfo.GasFeePolicy.GasFeeTokenID.String() + + if chainInfo.GasFeePolicy.GasFeeTokenId != "" { + decodedToken, err := iotago.DecodeHex(chainInfo.GasFeePolicy.GasFeeTokenId) + log.Check(err) + + tokenID, err := isc.NativeTokenIDFromBytes(decodedToken) + log.Check(err) + + if !isc.IsEmptyNativeTokenID(tokenID) { + gasFeeToken = tokenID.String() + } } - log.Printf("Gas fee: 1 %s = %d gas units\n", gasFeeToken, govInfo.GasFeePolicy.GasPerToken) - log.Printf("Validator fee share: %d%%\n", govInfo.GasFeePolicy.ValidatorFeeShare) + + log.Printf("Gas fee: 1 %s = %d gas units\n", gasFeeToken, chainInfo.GasFeePolicy.GasPerToken) + log.Printf("Validator fee share: %d%%\n", chainInfo.GasFeePolicy.ValidatorFeeShare) } - log.Printf("Maximum blob size: %d bytes\n", govInfo.MaxBlobSize) - log.Printf("Maximum event size: %d bytes\n", govInfo.MaxEventSize) - log.Printf("Maximum events per request: %d\n", govInfo.MaxEventsPerReq) + log.Printf("Maximum blob size: %d bytes\n", chainInfo.MaxBlobSize) + log.Printf("Maximum event size: %d bytes\n", chainInfo.MaxEventSize) + log.Printf("Maximum events per request: %d\n", chainInfo.MaxEventsPerReq) } }, } diff --git a/tools/wasp-cli/chain/list.go b/tools/wasp-cli/chain/list.go index f675b71f51..bf98d594e8 100644 --- a/tools/wasp-cli/chain/list.go +++ b/tools/wasp-cli/chain/list.go @@ -1,12 +1,13 @@ package chain import ( + "context" "fmt" "github.com/spf13/cobra" - "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,31 +17,34 @@ func initListCmd() *cobra.Command { Short: "List deployed chains", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPIURL()) - chains, err := client.GetChainRecordList() + client := cliclients.WaspClientForIndex() + chains, _, err := client.ChainsApi.GetChains(context.Background()).Execute() log.Check(err) + model := &ListChainModel{ Length: len(chains), - BaseURL: client.BaseURL(), + BaseURL: client.GetConfig().Host, } + model.Chains = make(map[string]bool) for _, chain := range chains { - model.Chains[chain.ChainID().String()] = chain.Active + model.Chains[chain.ChainID] = chain.IsActive } + log.PrintCLIOutput(model) showChainList(chains) }, } } -func showChainList(chains []*registry.ChainRecord) { +func showChainList(chains []apiclient.ChainInfoResponse) { header := []string{"chainid", "active"} rows := make([][]string, len(chains)) for i, chain := range chains { rows[i] = []string{ - chain.ChainID().String(), - fmt.Sprintf("%v", chain.Active), + chain.ChainID, + fmt.Sprintf("%v", chain.IsActive), } } log.PrintTable(header, rows) diff --git a/tools/wasp-cli/chain/listcontracts.go b/tools/wasp-cli/chain/listcontracts.go index 29dd5c4d2f..04478f1d65 100644 --- a/tools/wasp-cli/chain/listcontracts.go +++ b/tools/wasp-cli/chain/listcontracts.go @@ -1,10 +1,15 @@ package chain import ( + "context" + "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/kv/collections" "github.com/iotaledger/wasp/packages/vm/core/root" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -14,9 +19,22 @@ func initListContractsCmd() *cobra.Command { Short: "List deployed contracts in chain", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - records, err := SCClient(root.Contract.Hname()).CallView(root.ViewGetContractRecords.Name, nil) + client := cliclients.WaspClientForIndex() + + // TODO: Implement root view calls into v2 api + records, _, err := client.RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ContractName: root.Contract.Name, + FunctionName: root.ViewGetContractRecords.Name, + }).Execute() + + if records == nil { + log.Fatal("Could not fetch contract records") + } + + parsedRecords, err := clients.APIJsonDictToDict(*records) log.Check(err) - contracts, err := root.DecodeContractRegistry(collections.NewMapReadOnly(records, root.StateVarContractRegistry)) + + contracts, err := root.DecodeContractRegistry(collections.NewMapReadOnly(parsedRecords, root.StateVarContractRegistry)) log.Check(err) log.Printf("Total %d contracts in chain %s\n", len(contracts), GetCurrentChainID()) diff --git a/tools/wasp-cli/chain/postrequest.go b/tools/wasp-cli/chain/postrequest.go index a9f0e62b30..9d3a75497e 100644 --- a/tools/wasp-cli/chain/postrequest.go +++ b/tools/wasp-cli/chain/postrequest.go @@ -6,15 +6,17 @@ import ( "github.com/spf13/cobra" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/transaction" "github.com/iotaledger/wasp/packages/vm/gas" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) func postRequest(hname, fname string, params chainclient.PostRequestParams, offLedger, adjustStorageDeposit bool) { - scClient := SCClient(isc.Hn(hname)) + apiClient := cliclients.WaspClientForIndex() + scClient := cliclients.SCClient(apiClient, isc.Hn(hname)) if offLedger { params.Nonce = uint64(time.Now().UnixNano()) diff --git a/tools/wasp-cli/chain/rotate.go b/tools/wasp-cli/chain/rotate.go index bb6509c4b6..fff72b57e5 100644 --- a/tools/wasp-cli/chain/rotate.go +++ b/tools/wasp-cli/chain/rotate.go @@ -12,7 +12,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/transaction" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) @@ -23,7 +23,7 @@ func initRotateCmd() *cobra.Command { Short: "Issues a tx that changes the chain state controller", Args: cobra.MinimumNArgs(1), Run: func(cmd *cobra.Command, args []string) { - l1Client := config.L1Client() + l1Client := cliclients.L1Client() prefix, newStateControllerAddr, err := iotago.ParseBech32(args[0]) log.Check(err) if parameters.L1().Protocol.Bech32HRP != prefix { diff --git a/tools/wasp-cli/chain/rundkg.go b/tools/wasp-cli/chain/rundkg.go index f80002a315..b341718870 100644 --- a/tools/wasp-cli/chain/rundkg.go +++ b/tools/wasp-cli/chain/rundkg.go @@ -4,6 +4,7 @@ package chain import ( + "context" "fmt" "math/rand" "os" @@ -12,6 +13,7 @@ import ( "github.com/iotaledger/wasp/packages/apilib" "github.com/iotaledger/wasp/packages/parameters" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -35,10 +37,11 @@ func initRunDKGCmd() *cobra.Command { } committeePubKeys := make([]string, 0) - for _, api := range config.CommitteeAPIURL(committee) { - peerInfo, err := clients.NewWaspClient(api).GetPeeringSelf() + for _, apiIndex := range committee { + peerInfo, _, err := cliclients.WaspClientForIndex(apiIndex).NodeApi.GetPeeringIdentity(context.Background()).Execute() log.Check(err) - committeePubKeys = append(committeePubKeys, peerInfo.PubKey) + + committeePubKeys = append(committeePubKeys, peerInfo.PublicKey) } dkgInitiatorIndex := uint16(rand.Intn(len(committee))) diff --git a/tools/wasp-cli/cli/cliclients/clients.go b/tools/wasp-cli/cli/cliclients/clients.go index 6f92d9ce4b..c2a77a81a8 100644 --- a/tools/wasp-cli/cli/cliclients/clients.go +++ b/tools/wasp-cli/cli/cliclients/clients.go @@ -12,11 +12,7 @@ import ( "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) -func WaspClientForNodeIndex(i ...int) *apiclient.APIClient { - return WaspClient(config.WaspAPIURL(i...)) -} - -func WaspClient(apiAddress string) *apiclient.APIClient { +func waspClient(apiAddress string) *apiclient.APIClient { // TODO: add authentication for /adm L1Client() // this will fill parameters.L1() with data from the L1 node log.Verbosef("using Wasp host %s\n", apiAddress) @@ -28,6 +24,10 @@ func WaspClient(apiAddress string) *apiclient.APIClient { return apiclient.NewAPIClient(apiConfig) } +func WaspClientForIndex(i ...int) *apiclient.APIClient { + return waspClient(config.MustWaspAPIURL(i...)) +} + func L1Client() l1connection.Client { log.Verbosef("using L1 API %s\n", config.L1APIAddress()) diff --git a/tools/wasp-cli/metrics/consensus.go b/tools/wasp-cli/metrics/consensus.go index 3ae78ec33d..ad120c3d51 100644 --- a/tools/wasp-cli/metrics/consensus.go +++ b/tools/wasp-cli/metrics/consensus.go @@ -1,6 +1,7 @@ package metrics import ( + "context" "fmt" "time" @@ -8,7 +9,7 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -20,14 +21,21 @@ func initConsensusMetricsCmd() *cobra.Command { Short: "Show current value of collected metrics of consensus", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPIURL()) + client := cliclients.WaspClientForIndex() _, chainAddress, err := iotago.ParseBech32(chainAlias) log.Check(err) + chainID := isc.ChainIDFromAddress(chainAddress.(*iotago.AliasAddress)) - workflowStatus, err := client.GetChainConsensusWorkflowStatus(chainID) + workflowStatus, _, err := client.MetricsApi. + GetChainWorkflowMetrics(context.Background(), chainID.String()). + Execute() log.Check(err) - pipeMetrics, err := client.GetChainConsensusPipeMetrics(chainID) + + pipeMetrics, _, err := client.MetricsApi. + GetChainPipeMetrics(context.Background(), chainID.String()). + Execute() log.Check(err) + header := []string{"Flag name", "Value", "Last time set"} table := make([][]string, 15) table[0] = makeWorkflowTableRow("State received", workflowStatus.FlagStateReceived, time.Time{}) diff --git a/tools/wasp-cli/metrics/nodeconn.go b/tools/wasp-cli/metrics/nodeconn.go index 8b6c717a50..df1662ba58 100644 --- a/tools/wasp-cli/metrics/nodeconn.go +++ b/tools/wasp-cli/metrics/nodeconn.go @@ -1,14 +1,14 @@ package metrics import ( + "context" "fmt" "strings" "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -20,14 +20,16 @@ func initNodeconnMetricsCmd() *cobra.Command { Short: "Show current value of collected metrics of connection to L1", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - client := config.WaspClient(config.MustWaspAPIURL()) + client := cliclients.WaspClientForIndex() + if chainAlias == "" { - nodeconnMetrics, err := client.GetNodeConnectionMetrics() + nodeconnMetrics, _, err := client.MetricsApi.GetL1Metrics(context.Background()).Execute() log.Check(err) log.Printf("Following chains are registered for L1 events:\n") for _, s := range nodeconnMetrics.Registered { log.Printf("\t%s\n", s) } + printMessagesMetrics( &nodeconnMetrics.NodeConnectionMessagesMetrics, [][]string{makeMessagesMetricsTableRow("Milestone", true, nodeconnMetrics.InMilestone)}, diff --git a/tools/wasp-cli/peering/distrust.go b/tools/wasp-cli/peering/distrust.go index 1b3940da3c..01d0218b86 100644 --- a/tools/wasp-cli/peering/distrust.go +++ b/tools/wasp-cli/peering/distrust.go @@ -4,10 +4,13 @@ package peering import ( + "context" + "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -18,21 +21,30 @@ func initDistrustCmd() *cobra.Command { Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { pubKeyOrNetID := args[0] - waspClient := config.WaspClient(config.MustWaspAPIURL()) + client := cliclients.WaspClientForIndex() + if peering.CheckNetID(pubKeyOrNetID) != nil { - log.Check(waspClient.DeletePeeringTrusted(pubKeyOrNetID)) + _, err := client.NodeApi.DistrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ + NetId: pubKeyOrNetID, + }).Execute() + log.Check(err) log.Printf("# Distrusted PubKey: %v\n", pubKeyOrNetID) return } - trustedList, err := waspClient.GetPeeringTrustedList() + + trustedList, _, err := client.NodeApi.GetTrustedPeers(context.Background()).Execute() log.Check(err) + for _, t := range trustedList { - if t.NetID == pubKeyOrNetID { - err := waspClient.DeletePeeringTrusted(t.PubKey) + if t.NetId == pubKeyOrNetID { + _, err := client.NodeApi.DistrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ + PublicKey: t.PublicKey, + }).Execute() + if err != nil { - log.Printf("error: failed to distrust %v/%v, reason=%v\n", t.PubKey, t.NetID, err) + log.Printf("error: failed to distrust %v/%v, reason=%v\n", t.PublicKey, t.NetId, err) } else { - log.Printf("# Distrusted PubKey: %v\n", t.PubKey) + log.Printf("# Distrusted PubKey: %v\n", t.PublicKey) } } } From 43fb19fa990a0465df2a3ce222e3f0086b4a6872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 19:01:53 +0100 Subject: [PATCH 05/39] Make it compile with v2 --- clients/apiclient/.openapi-generator/FILES | 32 + clients/apiclient/api/openapi.yaml | 1939 +++++++++++++- clients/apiclient/api_admin.go | 2350 +++++++++++++++++ clients/apiclient/api_node.go | 39 +- clients/apiclient/api_public.go | 1254 +++++++++ clients/apiclient/api_requests.go | 18 +- clients/apiclient/client.go | 6 + clients/apiclient/docs/AdminApi.md | 1517 +++++++++++ clients/apiclient/docs/ChainMetrics.md | 65 +- clients/apiclient/docs/ChainRecord.md | 108 + .../apiclient/docs/ConsensusWorkflowStatus.md | 498 ++++ clients/apiclient/docs/MilestoneInfo.md | 108 + clients/apiclient/docs/MilestoneMetricItem.md | 93 + clients/apiclient/docs/NodeApi.md | 12 +- .../docs/NodeConnectionMessageMetrics.md | 108 + .../docs/NodeConnectionMessagesMetrics.md | 290 ++ .../apiclient/docs/NodeConnectionMetrics.md | 108 + .../docs/NodeOwnerCertificateResponse.md | 51 + .../apiclient/docs/OffLedgerRequestBody.md | 56 + clients/apiclient/docs/PeeringNodeStatus.md | 134 + clients/apiclient/docs/PeeringTrustedNode.md | 82 + clients/apiclient/docs/PublicApi.md | 802 ++++++ .../docs/PublisherStateTransactionItem.md | 93 + clients/apiclient/docs/RequestsApi.md | 16 +- clients/apiclient/docs/StateTransaction.md | 72 + .../docs/WaitRequestProcessedParams.md | 56 + clients/apiclient/go.mod | 6 - clients/apiclient/model_chain_metrics.go | 83 +- clients/apiclient/model_chain_record.go | 200 ++ .../model_consensus_workflow_status.go | 757 ++++++ clients/apiclient/model_milestone_info.go | 198 ++ .../apiclient/model_milestone_metric_item.go | 172 ++ .../model_node_connection_message_metrics.go | 202 ++ .../model_node_connection_messages_metrics.go | 450 ++++ .../model_node_connection_metrics.go | 199 ++ .../model_node_owner_certificate_response.go | 118 + .../model_off_ledger_request_body.go | 127 + .../apiclient/model_peering_node_status.go | 234 ++ .../apiclient/model_peering_trusted_node.go | 164 ++ .../model_publisher_state_transaction_item.go | 172 ++ clients/apiclient/model_state_transaction.go | 146 + .../model_wait_request_processed_params.go | 127 + clients/apiclient/test/api_admin_test.go | 321 +++ clients/apiclient/test/api_public_test.go | 187 ++ clients/apiutils.go | 42 +- clients/chainclient/uploadblob.go | 2 +- clients/multiclient/activate.go | 24 + clients/multiclient/chain_record.go | 30 + clients/multiclient/dkshares.go | 19 + clients/multiclient/multiclient.go | 51 + clients/multiclient/reqstatus.go | 74 + packages/apilib/deploychain.go | 21 +- packages/apilib/rundkg.go | 20 +- packages/dashboard/base.go | 7 +- packages/dashboard/dashboard_test.go | 2 +- packages/dashboard/testutil/httptest.go | 118 + packages/dashboard/testutil/mockchain.go | 100 + .../webapi/controllers/requests/controller.go | 8 +- packages/webapi/interfaces/interfaces.go | 6 + packages/webapi/services/offledger.go | 24 +- tools/cluster/chain.go | 157 +- tools/cluster/cluster.go | 99 +- tools/wasp-cli/chain/access-nodes.go | 17 +- tools/wasp-cli/chain/accounts.go | 13 +- tools/wasp-cli/chain/activate.go | 5 +- tools/wasp-cli/chain/add.go | 8 +- tools/wasp-cli/chain/alias.go | 39 - tools/wasp-cli/chain/blobs.go | 9 +- tools/wasp-cli/chain/blocklog.go | 13 +- tools/wasp-cli/chain/callview.go | 3 +- tools/wasp-cli/chain/cmd.go | 3 +- tools/wasp-cli/chain/deploy.go | 16 +- tools/wasp-cli/chain/deploycontract.go | 3 +- tools/wasp-cli/chain/events.go | 5 +- tools/wasp-cli/chain/info.go | 7 +- tools/wasp-cli/chain/listcontracts.go | 3 +- tools/wasp-cli/chain/postrequest.go | 7 +- tools/wasp-cli/chain/rotate.go | 6 +- tools/wasp-cli/chain/rundkg.go | 9 +- tools/wasp-cli/cli/cliclients/clients.go | 14 +- tools/wasp-cli/cli/config/chain.go | 40 + tools/wasp-cli/cli/config/config.go | 19 +- .../cli/{config => init}/checkversions.go | 18 +- tools/wasp-cli/cli/{config => init}/init.go | 23 +- tools/wasp-cli/cli/wallet/wallet.go | 40 + tools/wasp-cli/log/log.go | 6 +- tools/wasp-cli/main.go | 4 +- tools/wasp-cli/metrics/nodeconn.go | 65 +- tools/wasp-cli/peering/info.go | 9 +- tools/wasp-cli/peering/listtrusted.go | 12 +- tools/wasp-cli/peering/trust.go | 19 +- tools/wasp-cli/util/tx.go | 15 +- tools/wasp-cli/wallet/cmd.go | 4 +- tools/wasp-cli/wallet/info.go | 11 +- tools/wasp-cli/wallet/request-funds.go | 7 +- tools/wasp-cli/wallet/send.go | 7 +- tools/wasp-cli/wallet/wallet.go | 26 - 97 files changed, 14596 insertions(+), 483 deletions(-) create mode 100644 clients/apiclient/api_admin.go create mode 100644 clients/apiclient/api_public.go create mode 100644 clients/apiclient/docs/AdminApi.md create mode 100644 clients/apiclient/docs/ChainRecord.md create mode 100644 clients/apiclient/docs/ConsensusWorkflowStatus.md create mode 100644 clients/apiclient/docs/MilestoneInfo.md create mode 100644 clients/apiclient/docs/MilestoneMetricItem.md create mode 100644 clients/apiclient/docs/NodeConnectionMessageMetrics.md create mode 100644 clients/apiclient/docs/NodeConnectionMessagesMetrics.md create mode 100644 clients/apiclient/docs/NodeConnectionMetrics.md create mode 100644 clients/apiclient/docs/NodeOwnerCertificateResponse.md create mode 100644 clients/apiclient/docs/OffLedgerRequestBody.md create mode 100644 clients/apiclient/docs/PeeringNodeStatus.md create mode 100644 clients/apiclient/docs/PeeringTrustedNode.md create mode 100644 clients/apiclient/docs/PublicApi.md create mode 100644 clients/apiclient/docs/PublisherStateTransactionItem.md create mode 100644 clients/apiclient/docs/StateTransaction.md create mode 100644 clients/apiclient/docs/WaitRequestProcessedParams.md delete mode 100644 clients/apiclient/go.mod create mode 100644 clients/apiclient/model_chain_record.go create mode 100644 clients/apiclient/model_consensus_workflow_status.go create mode 100644 clients/apiclient/model_milestone_info.go create mode 100644 clients/apiclient/model_milestone_metric_item.go create mode 100644 clients/apiclient/model_node_connection_message_metrics.go create mode 100644 clients/apiclient/model_node_connection_messages_metrics.go create mode 100644 clients/apiclient/model_node_connection_metrics.go create mode 100644 clients/apiclient/model_node_owner_certificate_response.go create mode 100644 clients/apiclient/model_off_ledger_request_body.go create mode 100644 clients/apiclient/model_peering_node_status.go create mode 100644 clients/apiclient/model_peering_trusted_node.go create mode 100644 clients/apiclient/model_publisher_state_transaction_item.go create mode 100644 clients/apiclient/model_state_transaction.go create mode 100644 clients/apiclient/model_wait_request_processed_params.go create mode 100644 clients/apiclient/test/api_admin_test.go create mode 100644 clients/apiclient/test/api_public_test.go create mode 100644 clients/multiclient/activate.go create mode 100644 clients/multiclient/chain_record.go create mode 100644 clients/multiclient/dkshares.go create mode 100644 clients/multiclient/multiclient.go create mode 100644 clients/multiclient/reqstatus.go create mode 100644 packages/dashboard/testutil/httptest.go create mode 100644 packages/dashboard/testutil/mockchain.go create mode 100644 tools/wasp-cli/cli/config/chain.go rename tools/wasp-cli/cli/{config => init}/checkversions.go (59%) rename tools/wasp-cli/cli/{config => init}/init.go (64%) create mode 100644 tools/wasp-cli/cli/wallet/wallet.go diff --git a/clients/apiclient/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES index 78850b5f82..49681f0f08 100644 --- a/clients/apiclient/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -1,11 +1,13 @@ .gitignore .travis.yml api/openapi.yaml +api_admin.go api_auth.go api_chains.go api_corecontracts.go api_metrics.go api_node.go +api_public.go api_requests.go api_users.go client.go @@ -14,6 +16,7 @@ docs/AccountListResponse.md docs/AccountNFTsResponse.md docs/AccountNonceResponse.md docs/AddUserRequest.md +docs/AdminApi.md docs/AliasOutputMetricItem.md docs/Allowance.md docs/AssetsResponse.md @@ -32,11 +35,13 @@ docs/BurnRecord.md docs/CallTarget.md docs/ChainInfoResponse.md docs/ChainMetrics.md +docs/ChainRecord.md docs/ChainsApi.md docs/CommitteeInfoResponse.md docs/CommitteeNode.md docs/ConsensusPipeMetrics.md docs/ConsensusWorkflowMetrics.md +docs/ConsensusWorkflowStatus.md docs/ContractCallViewRequest.md docs/ContractInfoResponse.md docs/ControlAddressesResponse.md @@ -61,20 +66,31 @@ docs/L1Params.md docs/LoginRequest.md docs/LoginResponse.md docs/MetricsApi.md +docs/MilestoneInfo.md +docs/MilestoneMetricItem.md docs/NFTDataResponse.md docs/NativeToken.md docs/NativeTokenIDRegistryResponse.md docs/NodeApi.md +docs/NodeConnectionMessageMetrics.md +docs/NodeConnectionMessagesMetrics.md +docs/NodeConnectionMetrics.md docs/NodeOwnerCertificateRequest.md +docs/NodeOwnerCertificateResponse.md docs/OffLedgerRequest.md +docs/OffLedgerRequestBody.md docs/OnLedgerRequest.md docs/OnLedgerRequestMetricItem.md docs/Output.md docs/OutputID.md docs/PeeringNodeIdentityResponse.md +docs/PeeringNodeStatus.md docs/PeeringNodeStatusResponse.md docs/PeeringTrustRequest.md +docs/PeeringTrustedNode.md docs/ProtocolParameters.md +docs/PublicApi.md +docs/PublisherStateTransactionItem.md docs/ReceiptError.md docs/ReceiptResponse.md docs/RentStructure.md @@ -84,6 +100,7 @@ docs/RequestProcessedResponse.md docs/RequestReceiptResponse.md docs/RequestsApi.md docs/StateResponse.md +docs/StateTransaction.md docs/Transaction.md docs/TransactionIDMetricItem.md docs/TransactionMetricItem.md @@ -95,6 +112,7 @@ docs/UpdateUserPermissionsRequest.md docs/User.md docs/UsersApi.md docs/ValidationError.md +docs/WaitRequestProcessedParams.md git_push.sh go.sum model_account_list_response.go @@ -118,10 +136,12 @@ model_burn_record.go model_call_target.go model_chain_info_response.go model_chain_metrics.go +model_chain_record.go model_committee_info_response.go model_committee_node.go model_consensus_pipe_metrics.go model_consensus_workflow_metrics.go +model_consensus_workflow_status.go model_contract_call_view_request.go model_contract_info_response.go model_control_addresses_response.go @@ -144,19 +164,29 @@ model_json_dict.go model_l1_params.go model_login_request.go model_login_response.go +model_milestone_info.go +model_milestone_metric_item.go model_native_token.go model_native_token_id_registry_response.go model_nft_data_response.go +model_node_connection_message_metrics.go +model_node_connection_messages_metrics.go +model_node_connection_metrics.go model_node_owner_certificate_request.go +model_node_owner_certificate_response.go model_off_ledger_request.go +model_off_ledger_request_body.go model_on_ledger_request.go model_on_ledger_request_metric_item.go model_output.go model_output_id.go model_peering_node_identity_response.go +model_peering_node_status.go model_peering_node_status_response.go model_peering_trust_request.go +model_peering_trusted_node.go model_protocol_parameters.go +model_publisher_state_transaction_item.go model_receipt_error.go model_receipt_response.go model_rent_structure.go @@ -165,6 +195,7 @@ model_request_ids_response.go model_request_processed_response.go model_request_receipt_response.go model_state_response.go +model_state_transaction.go model_transaction.go model_transaction_id_metric_item.go model_transaction_metric_item.go @@ -175,5 +206,6 @@ model_update_user_permissions_request.go model_user.go model_utxo_input_metric_item.go model_validation_error.go +model_wait_request_processed_params.go response.go utils.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 41bd619a28..763416dd9d 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -10,6 +10,10 @@ servers: - url: http://localhost:9090/ - url: https://localhost:9090/ tags: +- description: Public endpoints + name: public +- description: Admin endpoints + name: admin - name: auth - name: chains - name: chains @@ -24,6 +28,445 @@ tags: - name: corecontracts - name: corecontracts paths: + /adm/chain/nodeconn/metrics: + get: + deprecated: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NodeConnectionMetrics' + description: Cummulative chains metrics + summary: Get cummulative chains node connection metrics + tags: + - admin + /adm/chain/{chainID}/access-node/{pubKey}: + delete: + parameters: + - description: ChainID (bech32)) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: PublicKey (hex string) + in: path + name: pubKey + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + summary: Remove an access node from a chain + tags: + - admin + put: + parameters: + - description: ChainID (bech32)) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: PublicKey (hex string) + in: path + name: pubKey + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + summary: Add an access node to a chain + tags: + - admin + /adm/chain/{chainID}/activate: + post: + deprecated: true + parameters: + - description: ChainID (bech32)) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + summary: Activate a chain + tags: + - admin + /adm/chain/{chainID}/consensus/metrics/pipe: + get: + deprecated: true + parameters: + - description: chainID + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConsensusPipeMetrics' + description: Chain consensus pipe metrics + "404": + content: {} + description: Chain consensus hasn't been created + summary: Get consensus pipe metrics + tags: + - admin + /adm/chain/{chainID}/consensus/status: + get: + deprecated: true + parameters: + - description: ChainID (bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConsensusWorkflowStatus' + description: Chain consensus stats + "404": + content: {} + description: Chain consensus hasn't been created + summary: Get chain state statistics for the given chain ID + tags: + - admin + /adm/chain/{chainID}/deactivate: + post: + deprecated: true + parameters: + - description: ChainID (bech32)) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + summary: Deactivate a chain + tags: + - admin + /adm/chain/{chainID}/info: + get: + deprecated: true + parameters: + - description: ChainID (bech32)) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + summary: Get basic chain info. + tags: + - admin + /adm/chain/{chainID}/nodeconn/metrics: + get: + deprecated: true + parameters: + - description: ChainID (bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NodeConnectionMessagesMetrics' + description: Chain metrics + summary: Get chain node connection metrics for the given chain ID + tags: + - admin + /adm/chainrecord: + post: + deprecated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChainRecord' + description: Chain record + required: true + responses: + default: + content: {} + description: successful operation + summary: Create a new chain record + tags: + - admin + x-codegen-request-body-name: Record + /adm/chainrecord/{chainID}: + get: + deprecated: true + parameters: + - description: ChainID (bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ChainRecord' + description: Chain Record + summary: Find the chain record for the given chain ID + tags: + - admin + /adm/chainrecords: + get: + deprecated: true + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ChainRecord' + type: array + description: Chain Record + summary: Get the list of chain records in the node + tags: + - admin + /adm/dks: + post: + deprecated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesPostRequest' + description: Request parameters + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesInfo' + description: DK shares info + summary: Generate a new distributed key + tags: + - admin + x-codegen-request-body-name: DKSharesPostRequest + /adm/dks/{sharedAddress}: + get: + deprecated: true + parameters: + - description: Address of the DK share (hex) + in: path + name: sharedAddress + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DKSharesInfo' + description: DK shares info + summary: Get distributed key properties + tags: + - admin + /adm/node/owner/certificate: + post: + deprecated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NodeOwnerCertificateRequest' + description: Certificate request + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/NodeOwnerCertificateResponse' + description: Generated certificate. + summary: "Provides a certificate, if the node recognizes the owner." + tags: + - admin + x-codegen-request-body-name: Request + /adm/peering/established: + get: + deprecated: true + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PeeringNodeStatus' + type: array + description: A list of all peers. + summary: Basic information about all configured peers. + tags: + - admin + /adm/peering/self: + get: + deprecated: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustedNode' + description: This node as a peer. + summary: Basic peer info of the current node. + tags: + - admin + /adm/peering/trusted: + get: + deprecated: true + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PeeringTrustedNode' + type: array + description: A list of trusted peers. + summary: Get a list of trusted peers. + tags: + - admin + post: + deprecated: true + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustedNode' + description: Info of the peer to trust. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustedNode' + description: Trusted peer info. + summary: Trust the specified peer. + tags: + - admin + x-codegen-request-body-name: PeeringTrustedNode + /adm/peering/trusted/{pubKey}: + delete: + deprecated: true + parameters: + - description: Public key of the trusted peer (hex). + in: path + name: pubKey + required: true + schema: + format: string + type: string + responses: + default: + content: {} + description: successful operation + summary: Distrust the specified peer. + tags: + - admin + get: + deprecated: true + parameters: + - description: Public key of the trusted peer (hex). + in: path + name: pubKey + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustedNode' + description: Trusted peer info. + summary: Get details on a particular trusted peer. + tags: + - admin + put: + deprecated: true + parameters: + - description: Public key of the trusted peer (hex). + in: path + name: pubKey + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustedNode' + description: Info of the peer to trust. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PeeringTrustedNode' + description: Trusted peer info. + summary: "Trust the specified peer, the pub key is passed via the path." + tags: + - admin + x-codegen-request-body-name: PeeringTrustedNode + /adm/shutdown: + get: + deprecated: true + responses: + default: + content: {} + description: successful operation + summary: Shut down the node + tags: + - admin /auth: post: operationId: authenticate @@ -31,36 +474,397 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/LoginRequest' - description: The login request + $ref: '#/components/schemas/LoginRequest' + description: The login request + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LoginResponse' + description: Login was successful + "401": + content: {} + description: "Unauthorized (Wrong permissions, missing token)" + summary: Authenticate towards the node + tags: + - auth + x-codegen-request-body-name: "" + /auth/info: + get: + operationId: authInfo + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AuthInfoModel' + description: Login was successful + summary: Get information about the current authentication mode + tags: + - auth + /chain/{chainID}/contract/{contractHname}/callview/{fname}: + get: + deprecated: true + parameters: + - description: ChainID + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Contract Hname + in: path + name: contractHname + required: true + schema: + format: string + type: string + - description: Function name + in: path + name: fname + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Parameters + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Result + summary: Call a view function on a contract by name + tags: + - public + x-codegen-request-body-name: params + post: + deprecated: true + parameters: + - description: ChainID + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Contract Hname + in: path + name: contractHname + required: true + schema: + format: string + type: string + - description: Function name + in: path + name: fname + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Parameters + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Result + summary: Call a view function on a contract by name + tags: + - public + x-codegen-request-body-name: params + /chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname}: + get: + deprecated: true + parameters: + - description: ChainID + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Contract Hname + in: path + name: contractHname + required: true + schema: + format: string + type: string + - description: Function Hname + in: path + name: functionHname + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Parameters + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Result + summary: Call a view function on a contract by Hname + tags: + - public + x-codegen-request-body-name: params + post: + deprecated: true + parameters: + - description: ChainID + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Contract Hname + in: path + name: contractHname + required: true + schema: + format: string + type: string + - description: Function Hname + in: path + name: functionHname + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Parameters + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JSONDict' + description: Result + summary: Call a view function on a contract by Hname + tags: + - public + x-codegen-request-body-name: params + /chain/{chainID}/evm/reqid/{txHash}: + get: + deprecated: true + parameters: + - description: ChainID (bech32-encoded) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Transaction hash (hex-encoded) + in: path + name: txHash + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + format: string + type: string + description: Request ID + "404": + content: + application/json: + schema: + example: 0x00000000000000000000000000000000000000000000000000000000000000000000 + format: string + type: string + description: Request ID not found + summary: Get the ISC request ID for the given Ethereum transaction hash + tags: + - public + /chain/{chainID}/request: + post: + deprecated: true + parameters: + - description: chainID + in: path + name: chainID + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OffLedgerRequestBody' + description: "Offledger Request encoded in base64. Optionally, the body can\ + \ be the binary representation of the offledger request, but mime-type must\ + \ be specified to \"application/octet-stream\"" + required: false + responses: + "202": + content: {} + description: Request submitted + summary: Post an off-ledger request + tags: + - public + x-codegen-request-body-name: Request + /chain/{chainID}/request/{reqID}/receipt: + get: + deprecated: true + parameters: + - description: ChainID (bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Request ID + in: path + name: reqID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RequestReceiptResponse' + description: Request Receipt + summary: Get the processing status of a given request in the node + tags: + - public + /chain/{chainID}/request/{reqID}/wait: + get: + deprecated: true + parameters: + - description: ChainID (bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Request ID + in: path + name: reqID + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WaitRequestProcessedParams' + description: Optional parameters + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RequestReceiptResponse' + description: Request Receipt + summary: Wait until the given request has been processed by the node + tags: + - public + x-codegen-request-body-name: Params + /chain/{chainID}/state/{key}: + get: + deprecated: true + parameters: + - description: ChainID + in: path + name: chainID + required: true + schema: + format: string + type: string + - description: Key (hex-encoded) + in: path + name: key required: true + schema: + format: string + type: string responses: "200": content: application/json: schema: - $ref: '#/components/schemas/LoginResponse' - description: Login was successful - "401": + items: + example: 118 + format: int32 + type: integer + type: array + description: Result + summary: Fetch the raw value associated with the given key in the chain state + tags: + - public + /chain/{chainID}/ws: + get: + deprecated: true + parameters: + - description: ChainID (bech32-encoded) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + default: content: {} - description: "Unauthorized (Wrong permissions, missing token)" - summary: Authenticate towards the node + description: successful operation tags: - - auth - x-codegen-request-body-name: "" - /auth/info: + - public + /info: get: - operationId: authInfo + deprecated: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/AuthInfoModel' - description: Login was successful - summary: Get information about the current authentication mode + $ref: '#/components/schemas/InfoResponse' + description: Node properties + summary: Get information about the node tags: - - auth + - public /v2chains: get: operationId: getChains @@ -983,7 +1787,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RequestReceiptResponse' + $ref: '#/components/schemas/RequestReceiptResponse_' description: The receipt "401": content: @@ -1193,7 +1997,7 @@ paths: - requests /v2chains/{chainID}/requests/{requestID}/wait: get: - operationId: waitForTransaction + operationId: waitForRequest parameters: - description: ChainID (Bech32) in: path @@ -1315,7 +2119,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ConsensusPipeMetrics' + $ref: '#/components/schemas/ConsensusPipeMetrics_' description: A list of all available metrics. "401": content: @@ -1410,7 +2214,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesPostRequest' + $ref: '#/components/schemas/DKSharesPostRequest_' description: Request parameters required: true responses: @@ -1418,7 +2222,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesPostRequest' + $ref: '#/components/schemas/DKSharesInfo_' description: DK shares info "401": content: @@ -1448,7 +2252,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesInfo' + $ref: '#/components/schemas/DKSharesInfo_' description: DK shares info "401": content: @@ -1469,7 +2273,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InfoResponse' + $ref: '#/components/schemas/InfoResponse_' description: Returns information about this node. "401": content: @@ -1489,12 +2293,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NodeOwnerCertificateRequest' + $ref: '#/components/schemas/NodeOwnerCertificateRequest_' description: The node owner certificate required: true responses: "200": - content: {} + content: + application/json: + schema: + $ref: '#/components/schemas/NodeOwnerCertificateResponse_' description: Node owner was successfully changed "401": content: @@ -1674,7 +2481,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/JSONDict_' + $ref: '#/components/schemas/JSONDict' description: Result summary: Call a view function on a contract by Hname tags: @@ -2441,7 +3248,7 @@ components: properties: receipts: items: - $ref: '#/components/schemas/RequestReceiptResponse' + $ref: '#/components/schemas/RequestReceiptResponse_' type: array xml: name: Receipts @@ -2607,6 +3414,12 @@ components: txId: txId messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 + outPublisherStateTransaction: + lastMessage: + stateIndex: 1 + txId: txId + messages: 1 + timestamp: 2000-01-23T04:56:07.000+00:00 inTxInclusionState: lastMessage: txId: txId @@ -2631,6 +3444,13 @@ components: outputId: outputId messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 + inMilestone: + lastMessage: + milestoneId: milestoneId + index: 1 + timestamp: 5 + messages: 1 + timestamp: 2000-01-23T04:56:07.000+00:00 inAliasOutput: lastMessage: outputType: 0 @@ -2650,6 +3470,9 @@ components: txId: txId messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 + registeredChainIDs: + - registeredChainIDs + - registeredChainIDs outPullLatestOutput: lastMessage: lastMessage messages: 1 @@ -2662,6 +3485,8 @@ components: properties: inAliasOutput: $ref: '#/components/schemas/AliasOutputMetricItem' + inMilestone: + $ref: '#/components/schemas/MilestoneMetricItem' inOnLedgerRequest: $ref: '#/components/schemas/OnLedgerRequestMetricItem' inOutput: @@ -2672,25 +3497,70 @@ components: $ref: '#/components/schemas/TxInclusionStateMsgMetricItem' outPublishGovernanceTransaction: $ref: '#/components/schemas/TransactionMetricItem' + outPublisherStateTransaction: + $ref: '#/components/schemas/PublisherStateTransactionItem' outPullLatestOutput: $ref: '#/components/schemas/InterfaceMetricItem' outPullOutputByID: $ref: '#/components/schemas/UTXOInputMetricItem' outPullTxInclusionState: $ref: '#/components/schemas/TransactionIDMetricItem' + registeredChainIDs: + items: + format: string + type: string + type: array + xml: + name: RegisteredChainIDs + wrapped: true required: - inAliasOutput + - inMilestone - inOnLedgerRequest - inOutput - inStateOutput - inTxInclusionState - outPublishGovernanceTransaction + - outPublisherStateTransaction - outPullLatestOutput - outPullOutputByID - outPullTxInclusionState + - registeredChainIDs type: object xml: name: ChainMetrics + ChainRecord: + example: + chainId: tst1pqtn76c7y28uh0fjz7pdu303j5mcwl35wthrq995qxyxa9zfr2s0uq8s0c9 + accessNodes: + - accessNodes + - accessNodes + active: true + properties: + accessNodes: + items: + format: string + type: string + type: array + xml: + name: AccessNodes + wrapped: true + active: + description: Whether or not the chain is active + format: boolean + type: boolean + xml: + name: Active + chainId: + description: ChainID (bech32) + example: tst1pqtn76c7y28uh0fjz7pdu303j5mcwl35wthrq995qxyxa9zfr2s0uq8s0c9 + format: string + type: string + xml: + name: ChainID + type: object + xml: + name: ChainRecord CommitteeInfoResponse: example: candidateNodes: @@ -2843,6 +3713,42 @@ components: xml: name: CommitteeNode ConsensusPipeMetrics: + example: + EventVMResultMsgPipeSize: 5 + EventStateTransitionMsgPipeSize: 1 + EventACSMsgPipeSize: 0 + EventPeerLogIndexMsgPipeSize: 6 + EventTimerMsgPipeSize: 5 + properties: + EventACSMsgPipeSize: + format: int32 + type: integer + xml: + name: EventACSMsgPipeSize + EventPeerLogIndexMsgPipeSize: + format: int32 + type: integer + xml: + name: EventPeerLogIndexMsgPipeSize + EventStateTransitionMsgPipeSize: + format: int32 + type: integer + xml: + name: EventStateTransitionMsgPipeSize + EventTimerMsgPipeSize: + format: int32 + type: integer + xml: + name: EventTimerMsgPipeSize + EventVMResultMsgPipeSize: + format: int32 + type: integer + xml: + name: EventVMResultMsgPipeSize + type: object + xml: + name: ConsensusPipeMetrics + ConsensusPipeMetrics_: example: eventACSMsgPipeSize: 0 eventPeerLogIndexMsgPipeSize: 6 @@ -2854,37 +3760,201 @@ components: format: int32 type: integer xml: - name: EventACSMsgPipeSize - eventPeerLogIndexMsgPipeSize: - format: int32 - type: integer + name: EventACSMsgPipeSize + eventPeerLogIndexMsgPipeSize: + format: int32 + type: integer + xml: + name: EventPeerLogIndexMsgPipeSize + eventStateTransitionMsgPipeSize: + format: int32 + type: integer + xml: + name: EventStateTransitionMsgPipeSize + eventTimerMsgPipeSize: + format: int32 + type: integer + xml: + name: EventTimerMsgPipeSize + eventVMResultMsgPipeSize: + format: int32 + type: integer + xml: + name: EventVMResultMsgPipeSize + required: + - eventACSMsgPipeSize + - eventPeerLogIndexMsgPipeSize + - eventStateTransitionMsgPipeSize + - eventTimerMsgPipeSize + - eventVMResultMsgPipeSize + type: object + xml: + name: ConsensusPipeMetrics + ConsensusWorkflowMetrics: + example: + flagStateReceived: true + flagTransactionPosted: true + flagVMStarted: true + timeTransactionSeen: 2000-01-23T04:56:07.000+00:00 + flagConsensusBatchKnown: true + timeTransactionFinalized: 2000-01-23T04:56:07.000+00:00 + timeVMStarted: 2000-01-23T04:56:07.000+00:00 + flagVMResultSigned: true + timeBatchProposalSent: 2000-01-23T04:56:07.000+00:00 + timeVMResultSigned: 2000-01-23T04:56:07.000+00:00 + timeCompleted: 2000-01-23T04:56:07.000+00:00 + timeTransactionPosted: 2000-01-23T04:56:07.000+00:00 + flagTransactionSeen: true + timeConsensusBatchKnown: 2000-01-23T04:56:07.000+00:00 + currentStateIndex: 1 + flagInProgress: true + flagBatchProposalSent: true + flagTransactionFinalized: true + properties: + currentStateIndex: + description: Shows current state index of the consensus + format: int32 + minimum: 1 + type: integer + xml: + name: CurrentStateIndex + flagBatchProposalSent: + description: Shows if batch proposal is sent out in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagBatchProposalSent + flagConsensusBatchKnown: + description: Shows if consensus on batch is reached and known in current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagConsensusBatchKnown + flagInProgress: + description: Shows if consensus algorithm is still not completed in current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagInProgress + flagStateReceived: + description: Shows if state output is received in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagStateReceived + flagTransactionFinalized: + description: Shows if consensus on transaction is reached in current consensus + iteration + format: boolean + type: boolean + xml: + name: FlagTransactionFinalized + flagTransactionPosted: + description: Shows if transaction is posted to L1 in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagTransactionPosted + flagTransactionSeen: + description: Shows if L1 reported that it has seen the transaction of current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagTransactionSeen + flagVMResultSigned: + description: Shows if virtual machine has returned its results in current + consensus iteration + format: boolean + type: boolean + xml: + name: FlagVMResultSigned + flagVMStarted: + description: Shows if virtual machine is started in current consensus iteration + format: boolean + type: boolean + xml: + name: FlagVMStarted + timeBatchProposalSent: + description: Shows when batch proposal was last sent out in current consensus + iteration + format: date-time + type: string + xml: + name: TimeBatchProposalSent + timeCompleted: + description: Shows when algorithm was last completed in current consensus + iteration + format: date-time + type: string + xml: + name: TimeCompleted + timeConsensusBatchKnown: + description: Shows when ACS results of consensus on batch was last received + in current consensus iteration + format: date-time + type: string xml: - name: EventPeerLogIndexMsgPipeSize - eventStateTransitionMsgPipeSize: - format: int32 - type: integer + name: TimeConsensusBatchKnown + timeTransactionFinalized: + description: Shows when algorithm last noted that all the data for consensus + on transaction had been received in current consensus iteration + format: date-time + type: string xml: - name: EventStateTransitionMsgPipeSize - eventTimerMsgPipeSize: - format: int32 - type: integer + name: TimeTransactionFinalized + timeTransactionPosted: + description: Shows when transaction was last posted to L1 in current consensus + iteration + format: date-time + type: string xml: - name: EventTimerMsgPipeSize - eventVMResultMsgPipeSize: - format: int32 - type: integer + name: TimeTransactionPosted + timeTransactionSeen: + description: Shows when algorithm last noted that transaction had been seen + by L1 in current consensus iteration + format: date-time + type: string xml: - name: EventVMResultMsgPipeSize + name: TimeTransactionSeen + timeVMResultSigned: + description: Shows when virtual machine results were last received and signed + in current consensus iteration + format: date-time + type: string + xml: + name: TimeVMResultSigned + timeVMStarted: + description: Shows when virtual machine was last started in current consensus + iteration + format: date-time + type: string + xml: + name: TimeVMStarted required: - - eventACSMsgPipeSize - - eventPeerLogIndexMsgPipeSize - - eventStateTransitionMsgPipeSize - - eventTimerMsgPipeSize - - eventVMResultMsgPipeSize + - flagBatchProposalSent + - flagConsensusBatchKnown + - flagInProgress + - flagStateReceived + - flagTransactionFinalized + - flagTransactionPosted + - flagTransactionSeen + - flagVMResultSigned + - flagVMStarted + - timeBatchProposalSent + - timeCompleted + - timeConsensusBatchKnown + - timeTransactionFinalized + - timeTransactionPosted + - timeTransactionSeen + - timeVMResultSigned + - timeVMStarted type: object xml: - name: ConsensusPipeMetrics - ConsensusWorkflowMetrics: + name: ConsensusWorkflowMetrics + ConsensusWorkflowStatus: example: flagStateReceived: true flagTransactionPosted: true @@ -2894,13 +3964,13 @@ components: timeTransactionFinalized: 2000-01-23T04:56:07.000+00:00 timeVMStarted: 2000-01-23T04:56:07.000+00:00 flagVMResultSigned: true - timeBatchProposalSent: 2000-01-23T04:56:07.000+00:00 + timeBatchProposalSent: 2023-02-03T18:48:24.994717506+01:00 timeVMResultSigned: 2000-01-23T04:56:07.000+00:00 timeCompleted: 2000-01-23T04:56:07.000+00:00 timeTransactionPosted: 2000-01-23T04:56:07.000+00:00 flagTransactionSeen: true - timeConsensusBatchKnown: 2000-01-23T04:56:07.000+00:00 - currentStateIndex: 1 + timeConsensusBatchKnown: 2023-02-03T18:48:29.994717666+01:00 + currentStateIndex: 0 flagInProgress: true flagBatchProposalSent: true flagTransactionFinalized: true @@ -2908,12 +3978,12 @@ components: currentStateIndex: description: Shows current state index of the consensus format: int32 - minimum: 1 type: integer xml: name: CurrentStateIndex flagBatchProposalSent: description: Shows if batch proposal is sent out in current consensus iteration + example: true format: boolean type: boolean xml: @@ -2921,6 +3991,7 @@ components: flagConsensusBatchKnown: description: Shows if consensus on batch is reached and known in current consensus iteration + example: true format: boolean type: boolean xml: @@ -2928,12 +3999,14 @@ components: flagInProgress: description: Shows if consensus algorithm is still not completed in current consensus iteration + example: true format: boolean type: boolean xml: name: FlagInProgress flagStateReceived: description: Shows if state output is received in current consensus iteration + example: true format: boolean type: boolean xml: @@ -2974,6 +4047,7 @@ components: timeBatchProposalSent: description: Shows when batch proposal was last sent out in current consensus iteration + example: 2023-02-03T18:48:24.994717506+01:00 format: date-time type: string xml: @@ -2988,6 +4062,7 @@ components: timeConsensusBatchKnown: description: Shows when ACS results of consensus on batch was last received in current consensus iteration + example: 2023-02-03T18:48:29.994717666+01:00 format: date-time type: string xml: @@ -3007,8 +4082,8 @@ components: xml: name: TimeTransactionPosted timeTransactionSeen: - description: Shows when algorithm last noted that transaction had been seen - by L1 in current consensus iteration + description: Shows when algorithm last noted that transaction hadd been + seen by L1 in current consensus iteration format: date-time type: string xml: @@ -3027,27 +4102,9 @@ components: type: string xml: name: TimeVMStarted - required: - - flagBatchProposalSent - - flagConsensusBatchKnown - - flagInProgress - - flagStateReceived - - flagTransactionFinalized - - flagTransactionPosted - - flagTransactionSeen - - flagVMResultSigned - - flagVMStarted - - timeBatchProposalSent - - timeCompleted - - timeConsensusBatchKnown - - timeTransactionFinalized - - timeTransactionPosted - - timeTransactionSeen - - timeVMResultSigned - - timeVMStarted type: object xml: - name: ConsensusWorkflowMetrics + name: ConsensusWorkflowStatus ContractCallViewRequest: example: contractHName: contractHName @@ -3063,7 +4120,7 @@ components: contractName: contractName properties: arguments: - $ref: '#/components/schemas/JSONDict' + $ref: '#/components/schemas/JSONDict_' chainId: description: The chain id format: string @@ -3182,6 +4239,67 @@ components: xml: name: ControlAddressesResponse DKSharesInfo: + example: + peerPubKeys: + - a2V5 + - a2V5 + address: tst1ppe9mtkewv8v4an5lv9yt6whz3kvzyj043ls4l3wqun9fhxrnwzpz6uv2s4 + threshold: 3 + pubKeyShares: + - a2V5 + - a2V5 + sharedPubKey: a2V5 + peerIndex: 0 + properties: + address: + description: New generated shared address. + example: tst1ppe9mtkewv8v4an5lv9yt6whz3kvzyj043ls4l3wqun9fhxrnwzpz6uv2s4 + format: string + type: string + xml: + name: Address + peerIndex: + format: int32 + type: integer + xml: + name: PeerIndex + peerPubKeys: + description: Public keys of the nodes sharing the key (base64-encoded). + items: + example: a2V5 + format: string + type: string + type: array + xml: + name: PeerPubKeys + wrapped: true + pubKeyShares: + description: Public key shares for all the peers (base64-encoded). + items: + example: a2V5 + format: string + type: string + type: array + xml: + name: PubKeyShares + wrapped: true + sharedPubKey: + description: Shared public key (base64-encoded). + example: a2V5 + format: string + type: string + xml: + name: SharedPubKey + threshold: + example: 3 + format: int32 + type: integer + xml: + name: Threshold + type: object + xml: + name: DKSharesInfo + DKSharesInfo_: example: publicKeyShares: - publicKeyShares @@ -3248,11 +4366,39 @@ components: name: DKSharesInfo DKSharesPostRequest: example: - peerIdentities: - - peerIdentities - - peerIdentities - timeoutMS: 1 - threshold: 1 + peerPubKeys: + - a2V5 + - a2V5 + timeoutMS: 10000 + threshold: 3 + properties: + peerPubKeys: + items: + example: a2V5 + format: string + type: string + type: array + xml: + name: PeerPubKeys + wrapped: true + threshold: + description: Should be =< len(PeerPubKeys) + example: 3 + format: int32 + type: integer + xml: + name: Threshold + timeoutMS: + description: Timeout in milliseconds. + example: 10000 + format: int32 + type: integer + xml: + name: TimeoutMS + type: object + xml: + name: DKSharesPostRequest + DKSharesPostRequest_: properties: peerIdentities: items: @@ -3532,6 +4678,33 @@ components: xml: name: InStateOutputMetricItem InfoResponse: + example: + networkId: networkId + version: version + publisherPort: 0 + properties: + networkId: + description: '''hostname:port''; uniquely identifies the node' + format: string + type: string + xml: + name: NetworkID + publisherPort: + description: Nanomsg port that exposes publisher messages + format: int32 + type: integer + xml: + name: PublisherPort + version: + description: Wasp version + format: string + type: string + xml: + name: Version + type: object + xml: + name: InfoResponse + InfoResponse_: example: netID: 0.0.0.0:4000 l1Params: @@ -3619,17 +4792,19 @@ components: name: InterfaceMetricItem Item: example: - value: value - key: key + value: 0x76616c756531 + key: 0x6b657931 properties: key: description: key (hex-encoded) + example: 0x6b657931 format: string type: string xml: name: Key value: description: value (hex-encoded) + example: 0x76616c756531 format: string type: string xml: @@ -3642,19 +4817,17 @@ components: name: Item Item_: example: - value: 0x76616c756531 - key: 0x6b657931 + value: value + key: key properties: key: description: key (hex-encoded) - example: 0x6b657931 format: string type: string xml: name: Key value: description: value (hex-encoded) - example: 0x76616c756531 format: string type: string xml: @@ -3668,10 +4841,10 @@ components: JSONDict: example: Items: - - value: value - key: key - - value: value - key: key + - value: 0x76616c756531 + key: 0x6b657931 + - value: 0x76616c756531 + key: 0x6b657931 properties: Items: items: @@ -3686,10 +4859,10 @@ components: JSONDict_: example: Items: - - value: 0x76616c756531 - key: 0x6b657931 - - value: 0x76616c756531 - key: 0x6b657931 + - value: value + key: key + - value: value + key: key properties: Items: items: @@ -3776,13 +4949,66 @@ components: format: string type: string xml: - name: JWT + name: JWT + required: + - error + - jwt + type: object + xml: + name: LoginResponse + MilestoneInfo: + example: + milestoneId: milestoneId + index: 1 + timestamp: 5 + properties: + index: + format: int32 + type: integer + xml: + name: Index + milestoneId: + format: string + type: string + xml: + name: MilestoneID + timestamp: + format: int32 + type: integer + xml: + name: Timestamp + type: object + xml: + name: MilestoneInfo + MilestoneMetricItem: + example: + lastMessage: + milestoneId: milestoneId + index: 1 + timestamp: 5 + messages: 1 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/MilestoneInfo' + messages: + format: int32 + minimum: 1 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp required: - - error - - jwt + - lastMessage + - messages + - timestamp type: object xml: - name: LoginResponse + name: MilestoneMetricItem NFTDataResponse: example: owner: owner @@ -3858,10 +5084,343 @@ components: type: object xml: name: NativeTokenIDRegistryResponse + NodeConnectionMessageMetrics: + example: + total: 3 + lastEvent: 2023-02-03T18:48:34.992472605+01:00 + lastMessage: Last sent PublishStateTransaction message structure + properties: + lastEvent: + description: Last time the message was sent/received + example: 2023-02-03T18:48:34.992472605+01:00 + format: date-time + type: string + xml: + name: LastEvent + lastMessage: + description: The print out of the last message + example: Last sent PublishStateTransaction message structure + format: string + type: string + xml: + name: LastMessage + total: + description: Total number of messages sent/received + example: 3 + format: int32 + type: integer + xml: + name: Total + type: object + xml: + name: NodeConnectionMessageMetrics + NodeConnectionMessageMetrics_: + example: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + properties: + lastEvent: + description: Last time the message was sent/received + example: 2023-02-03T18:48:32.994473647+01:00 + format: date-time + type: string + xml: + name: LastEvent + lastMessage: + description: The print out of the last message + example: Last received OnLedgerRequest message structure + format: string + type: string + xml: + name: LastMessage + total: + description: Total number of messages sent/received + example: 85 + format: int32 + type: integer + xml: + name: Total + type: object + xml: + name: NodeConnectionMessageMetrics + NodeConnectionMessageMetrics__: + example: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473276+01:00 + lastMessage: Last received State output message structure + properties: + lastEvent: + description: Last time the message was sent/received + example: 2023-02-03T18:48:26.994473276+01:00 + format: date-time + type: string + xml: + name: LastEvent + lastMessage: + description: The print out of the last message + example: Last received State output message structure + format: string + type: string + xml: + name: LastMessage + total: + description: Total number of messages sent/received + example: 101 + format: int32 + type: integer + xml: + name: Total + type: object + xml: + name: NodeConnectionMessageMetrics + NodeConnectionMessageMetrics___: + example: + total: 28 + lastEvent: 2023-02-03T18:48:29.994472995+01:00 + lastMessage: Last sent PullTxInclusionState message structure + properties: + lastEvent: + description: Last time the message was sent/received + example: 2023-02-03T18:48:29.994472995+01:00 + format: date-time + type: string + xml: + name: LastEvent + lastMessage: + description: The print out of the last message + example: Last sent PullTxInclusionState message structure + format: string + type: string + xml: + name: LastMessage + total: + description: Total number of messages sent/received + example: 28 + format: int32 + type: integer + xml: + name: Total + type: object + xml: + name: NodeConnectionMessageMetrics + NodeConnectionMessageMetrics____: + example: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473536+01:00 + lastMessage: Last received Output message structure + properties: + lastEvent: + description: Last time the message was sent/received + example: 2023-02-03T18:48:26.994473536+01:00 + format: date-time + type: string + xml: + name: LastEvent + lastMessage: + description: The print out of the last message + example: Last received Output message structure + format: string + type: string + xml: + name: LastMessage + total: + description: Total number of messages sent/received + example: 101 + format: int32 + type: integer + xml: + name: Total + type: object + xml: + name: NodeConnectionMessageMetrics + NodeConnectionMessageMetrics_____: + example: + total: 1234 + lastEvent: 2023-02-03T18:48:35.99447546+01:00 + lastMessage: Last received Milestone message structure + properties: + lastEvent: + description: Last time the message was sent/received + example: 2023-02-03T18:48:35.99447546+01:00 + format: date-time + type: string + xml: + name: LastEvent + lastMessage: + description: The print out of the last message + example: Last received Milestone message structure + format: string + type: string + xml: + name: LastMessage + total: + description: Total number of messages sent/received + example: 1234 + format: int32 + type: integer + xml: + name: Total + type: object + xml: + name: NodeConnectionMessageMetrics + NodeConnectionMessagesMetrics: + example: + outPublishGovernanceTransaction: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + inTxInclusionState: + total: 1234 + lastEvent: 2023-02-03T18:48:35.99447546+01:00 + lastMessage: Last received Milestone message structure + inOnLedgerRequest: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + inOutput: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473536+01:00 + lastMessage: Last received Output message structure + inAliasOutput: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + inStateOutput: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473276+01:00 + lastMessage: Last received State output message structure + outPublishStateTransaction: + total: 3 + lastEvent: 2023-02-03T18:48:34.992472605+01:00 + lastMessage: Last sent PublishStateTransaction message structure + outPullTxInclusionState: + total: 28 + lastEvent: 2023-02-03T18:48:29.994472995+01:00 + lastMessage: Last sent PullTxInclusionState message structure + outPullLatestOutput: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473276+01:00 + lastMessage: Last received State output message structure + outPullOutputByID: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473536+01:00 + lastMessage: Last received Output message structure + properties: + inAliasOutput: + $ref: '#/components/schemas/NodeConnectionMessageMetrics_' + inOnLedgerRequest: + $ref: '#/components/schemas/NodeConnectionMessageMetrics_' + inOutput: + $ref: '#/components/schemas/NodeConnectionMessageMetrics____' + inStateOutput: + $ref: '#/components/schemas/NodeConnectionMessageMetrics__' + inTxInclusionState: + $ref: '#/components/schemas/NodeConnectionMessageMetrics_____' + outPublishGovernanceTransaction: + $ref: '#/components/schemas/NodeConnectionMessageMetrics_' + outPublishStateTransaction: + $ref: '#/components/schemas/NodeConnectionMessageMetrics' + outPullLatestOutput: + $ref: '#/components/schemas/NodeConnectionMessageMetrics__' + outPullOutputByID: + $ref: '#/components/schemas/NodeConnectionMessageMetrics____' + outPullTxInclusionState: + $ref: '#/components/schemas/NodeConnectionMessageMetrics___' + type: object + xml: + name: NodeConnectionMessagesMetrics + NodeConnectionMetrics: + example: + inMilestone: + total: 1234 + lastEvent: 2023-02-03T18:48:35.99447546+01:00 + lastMessage: Last received Milestone message structure + registered: + - tst1pqjuqksecfatlgy4uxd2m73kqmnlv4hr0gqqcggq4wcerwu2cx7uz3p735p + - tst1pqjuqksecfatlgy4uxd2m73kqmnlv4hr0gqqcggq4wcerwu2cx7uz3p735p + nodeConnectionMessagesMetrics: + outPublishGovernanceTransaction: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + inTxInclusionState: + total: 1234 + lastEvent: 2023-02-03T18:48:35.99447546+01:00 + lastMessage: Last received Milestone message structure + inOnLedgerRequest: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + inOutput: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473536+01:00 + lastMessage: Last received Output message structure + inAliasOutput: + total: 85 + lastEvent: 2023-02-03T18:48:32.994473647+01:00 + lastMessage: Last received OnLedgerRequest message structure + inStateOutput: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473276+01:00 + lastMessage: Last received State output message structure + outPublishStateTransaction: + total: 3 + lastEvent: 2023-02-03T18:48:34.992472605+01:00 + lastMessage: Last sent PublishStateTransaction message structure + outPullTxInclusionState: + total: 28 + lastEvent: 2023-02-03T18:48:29.994472995+01:00 + lastMessage: Last sent PullTxInclusionState message structure + outPullLatestOutput: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473276+01:00 + lastMessage: Last received State output message structure + outPullOutputByID: + total: 101 + lastEvent: 2023-02-03T18:48:26.994473536+01:00 + lastMessage: Last received Output message structure + properties: + inMilestone: + $ref: '#/components/schemas/NodeConnectionMessageMetrics_____' + nodeConnectionMessagesMetrics: + $ref: '#/components/schemas/NodeConnectionMessagesMetrics' + registered: + description: Chain IDs of the chains registered to receiving L1 events + items: + example: tst1pqjuqksecfatlgy4uxd2m73kqmnlv4hr0gqqcggq4wcerwu2cx7uz3p735p + format: string + type: string + type: array + xml: + name: Registered + wrapped: true + type: object + xml: + name: NodeConnectionMetrics NodeOwnerCertificateRequest: example: - ownerAddress: ownerAddress - publicKey: publicKey + nodePubKey: AAER + ownerAddress: any_address + properties: + nodePubKey: + description: Node pub key. (base64) + example: AAER + format: string + type: string + xml: + name: NodePubKey + ownerAddress: + description: Node owner address. (bech32) + example: any_address + format: string + type: string + xml: + name: OwnerAddress + type: object + xml: + name: NodeOwnerCertificateRequest + NodeOwnerCertificateRequest_: properties: ownerAddress: description: Node owner address. (Bech32) @@ -3881,6 +5440,35 @@ components: type: object xml: name: NodeOwnerCertificateRequest + NodeOwnerCertificateResponse: + example: + certificate: AAEREw== + properties: + certificate: + description: Certificate stating the ownership. (base64) + example: AAEREw== + format: string + type: string + xml: + name: Certificate + type: object + xml: + name: NodeOwnerCertificateResponse + NodeOwnerCertificateResponse_: + example: + certificate: certificate + properties: + certificate: + description: Certificate stating the ownership. (Hex) + format: string + type: string + xml: + name: Certificate + required: + - certificate + type: object + xml: + name: NodeOwnerCertificateResponse OffLedgerRequest: example: request: Hex string @@ -3905,6 +5493,20 @@ components: type: object xml: name: OffLedgerRequest + OffLedgerRequestBody: + example: + request: base64 string + properties: + request: + description: Offledger Request (base64) + example: base64 string + format: string + type: string + xml: + name: Request + type: object + xml: + name: OffLedgerRequestBody OnLedgerRequest: example: output: @@ -4045,6 +5647,40 @@ components: type: object xml: name: PeeringNodeIdentityResponse + PeeringNodeStatus: + example: + PubKey: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ + NetID: some-host:9081 + IsAlive: true + NumUsers: 1 + properties: + IsAlive: + example: true + format: boolean + type: boolean + xml: + name: IsAlive + NetID: + example: some-host:9081 + format: string + type: string + xml: + name: NetID + NumUsers: + example: 1 + format: int32 + type: integer + xml: + name: NumUsers + PubKey: + example: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ + format: string + type: string + xml: + name: PubKey + type: object + xml: + name: PeeringNodeStatus PeeringNodeStatusResponse: example: isAlive: true @@ -4167,6 +5803,28 @@ components: type: object xml: name: PeeringTrustRequest + PeeringTrustedNode: + example: + netId: some-host:9081 + pubKey: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ + properties: + netId: + description: NetID of a peer to trust. + example: some-host:9081 + format: string + type: string + xml: + name: NetID + pubKey: + description: Public key of the NetID. + example: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ + format: string + type: string + xml: + name: PubKey + type: object + xml: + name: PeeringTrustedNode ProtocolParameters: example: rentStructure: @@ -4236,6 +5894,34 @@ components: type: object xml: name: ProtocolParameters + PublisherStateTransactionItem: + example: + lastMessage: + stateIndex: 1 + txId: txId + messages: 1 + timestamp: 2000-01-23T04:56:07.000+00:00 + properties: + lastMessage: + $ref: '#/components/schemas/StateTransaction' + messages: + format: int32 + minimum: 1 + type: integer + xml: + name: Messages + timestamp: + format: date-time + type: string + xml: + name: Timestamp + required: + - lastMessage + - messages + - timestamp + type: object + xml: + name: PublisherStateTransactionItem ReceiptError: example: messageFormat: messageFormat @@ -4466,7 +6152,7 @@ components: nft: $ref: '#/components/schemas/NFTDataResponse' params: - $ref: '#/components/schemas/JSONDict' + $ref: '#/components/schemas/JSONDict_' requestId: format: string type: string @@ -4545,6 +6231,18 @@ components: xml: name: RequestProcessedResponse RequestReceiptResponse: + example: + receipt: receipt + properties: + receipt: + format: string + type: string + xml: + name: Receipt + type: object + xml: + name: RequestReceiptResponse + RequestReceiptResponse_: example: gasBurnLog: records: @@ -4659,6 +6357,30 @@ components: type: object xml: name: StateResponse + StateTransaction: + example: + stateIndex: 1 + txId: txId + properties: + stateIndex: + description: The state index + format: int32 + minimum: 1 + type: integer + xml: + name: StateIndex + txId: + description: The transaction ID + format: string + type: string + xml: + name: TransactionID + required: + - stateIndex + - txId + type: object + xml: + name: StateTransaction Transaction: example: txId: txId @@ -4883,6 +6605,19 @@ components: type: object xml: name: ValidationError + WaitRequestProcessedParams: + example: + timeout: 0 + properties: + timeout: + description: Timeout in nanoseconds + format: int64 + type: integer + xml: + name: Timeout + type: object + xml: + name: WaitRequestProcessedParams gasFeePolicy: example: gasFeeTokenId: gasFeeTokenId diff --git a/clients/apiclient/api_admin.go b/clients/apiclient/api_admin.go new file mode 100644 index 0000000000..e7b027308e --- /dev/null +++ b/clients/apiclient/api_admin.go @@ -0,0 +1,2350 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// AdminApiService AdminApi service +type AdminApiService service + +type ApiAdmChainChainIDAccessNodePubKeyDeleteRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string + pubKey string +} + +func (r ApiAdmChainChainIDAccessNodePubKeyDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmChainChainIDAccessNodePubKeyDeleteExecute(r) +} + +/* +AdmChainChainIDAccessNodePubKeyDelete Remove an access node from a chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32)) + @param pubKey PublicKey (hex string) + @return ApiAdmChainChainIDAccessNodePubKeyDeleteRequest +*/ +func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyDelete(ctx context.Context, chainID string, pubKey string) ApiAdmChainChainIDAccessNodePubKeyDeleteRequest { + return ApiAdmChainChainIDAccessNodePubKeyDeleteRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + pubKey: pubKey, + } +} + +// Execute executes the request +func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyDeleteExecute(r ApiAdmChainChainIDAccessNodePubKeyDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDAccessNodePubKeyDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/access-node/{pubKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDAccessNodePubKeyPutRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string + pubKey string +} + +func (r ApiAdmChainChainIDAccessNodePubKeyPutRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmChainChainIDAccessNodePubKeyPutExecute(r) +} + +/* +AdmChainChainIDAccessNodePubKeyPut Add an access node to a chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32)) + @param pubKey PublicKey (hex string) + @return ApiAdmChainChainIDAccessNodePubKeyPutRequest +*/ +func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyPut(ctx context.Context, chainID string, pubKey string) ApiAdmChainChainIDAccessNodePubKeyPutRequest { + return ApiAdmChainChainIDAccessNodePubKeyPutRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + pubKey: pubKey, + } +} + +// Execute executes the request +func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyPutExecute(r ApiAdmChainChainIDAccessNodePubKeyPutRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDAccessNodePubKeyPut") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/access-node/{pubKey}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDActivatePostRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainChainIDActivatePostRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmChainChainIDActivatePostExecute(r) +} + +/* +AdmChainChainIDActivatePost Activate a chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32)) + @return ApiAdmChainChainIDActivatePostRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainChainIDActivatePost(ctx context.Context, chainID string) ApiAdmChainChainIDActivatePostRequest { + return ApiAdmChainChainIDActivatePostRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// Deprecated +func (a *AdminApiService) AdmChainChainIDActivatePostExecute(r ApiAdmChainChainIDActivatePostRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDActivatePost") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/activate" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDConsensusMetricsPipeGetRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainChainIDConsensusMetricsPipeGetRequest) Execute() (*ConsensusPipeMetrics, *http.Response, error) { + return r.ApiService.AdmChainChainIDConsensusMetricsPipeGetExecute(r) +} + +/* +AdmChainChainIDConsensusMetricsPipeGet Get consensus pipe metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID chainID + @return ApiAdmChainChainIDConsensusMetricsPipeGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainChainIDConsensusMetricsPipeGet(ctx context.Context, chainID string) ApiAdmChainChainIDConsensusMetricsPipeGetRequest { + return ApiAdmChainChainIDConsensusMetricsPipeGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ConsensusPipeMetrics +// Deprecated +func (a *AdminApiService) AdmChainChainIDConsensusMetricsPipeGetExecute(r ApiAdmChainChainIDConsensusMetricsPipeGetRequest) (*ConsensusPipeMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsensusPipeMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDConsensusMetricsPipeGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/consensus/metrics/pipe" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDConsensusStatusGetRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainChainIDConsensusStatusGetRequest) Execute() (*ConsensusWorkflowStatus, *http.Response, error) { + return r.ApiService.AdmChainChainIDConsensusStatusGetExecute(r) +} + +/* +AdmChainChainIDConsensusStatusGet Get chain state statistics for the given chain ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32) + @return ApiAdmChainChainIDConsensusStatusGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainChainIDConsensusStatusGet(ctx context.Context, chainID string) ApiAdmChainChainIDConsensusStatusGetRequest { + return ApiAdmChainChainIDConsensusStatusGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ConsensusWorkflowStatus +// Deprecated +func (a *AdminApiService) AdmChainChainIDConsensusStatusGetExecute(r ApiAdmChainChainIDConsensusStatusGetRequest) (*ConsensusWorkflowStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsensusWorkflowStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDConsensusStatusGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/consensus/status" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDDeactivatePostRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainChainIDDeactivatePostRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmChainChainIDDeactivatePostExecute(r) +} + +/* +AdmChainChainIDDeactivatePost Deactivate a chain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32)) + @return ApiAdmChainChainIDDeactivatePostRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainChainIDDeactivatePost(ctx context.Context, chainID string) ApiAdmChainChainIDDeactivatePostRequest { + return ApiAdmChainChainIDDeactivatePostRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// Deprecated +func (a *AdminApiService) AdmChainChainIDDeactivatePostExecute(r ApiAdmChainChainIDDeactivatePostRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDDeactivatePost") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/deactivate" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDInfoGetRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainChainIDInfoGetRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmChainChainIDInfoGetExecute(r) +} + +/* +AdmChainChainIDInfoGet Get basic chain info. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32)) + @return ApiAdmChainChainIDInfoGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainChainIDInfoGet(ctx context.Context, chainID string) ApiAdmChainChainIDInfoGetRequest { + return ApiAdmChainChainIDInfoGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// Deprecated +func (a *AdminApiService) AdmChainChainIDInfoGetExecute(r ApiAdmChainChainIDInfoGetRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDInfoGet") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/info" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmChainChainIDNodeconnMetricsGetRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainChainIDNodeconnMetricsGetRequest) Execute() (*NodeConnectionMessagesMetrics, *http.Response, error) { + return r.ApiService.AdmChainChainIDNodeconnMetricsGetExecute(r) +} + +/* +AdmChainChainIDNodeconnMetricsGet Get chain node connection metrics for the given chain ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32) + @return ApiAdmChainChainIDNodeconnMetricsGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainChainIDNodeconnMetricsGet(ctx context.Context, chainID string) ApiAdmChainChainIDNodeconnMetricsGetRequest { + return ApiAdmChainChainIDNodeconnMetricsGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return NodeConnectionMessagesMetrics +// Deprecated +func (a *AdminApiService) AdmChainChainIDNodeconnMetricsGetExecute(r ApiAdmChainChainIDNodeconnMetricsGetRequest) (*NodeConnectionMessagesMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NodeConnectionMessagesMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDNodeconnMetricsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/{chainID}/nodeconn/metrics" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmChainNodeconnMetricsGetRequest struct { + ctx context.Context + ApiService *AdminApiService +} + +func (r ApiAdmChainNodeconnMetricsGetRequest) Execute() (*NodeConnectionMetrics, *http.Response, error) { + return r.ApiService.AdmChainNodeconnMetricsGetExecute(r) +} + +/* +AdmChainNodeconnMetricsGet Get cummulative chains node connection metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmChainNodeconnMetricsGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainNodeconnMetricsGet(ctx context.Context) ApiAdmChainNodeconnMetricsGetRequest { + return ApiAdmChainNodeconnMetricsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return NodeConnectionMetrics +// Deprecated +func (a *AdminApiService) AdmChainNodeconnMetricsGetExecute(r ApiAdmChainNodeconnMetricsGetRequest) (*NodeConnectionMetrics, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NodeConnectionMetrics + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainNodeconnMetricsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chain/nodeconn/metrics" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmChainrecordChainIDGetRequest struct { + ctx context.Context + ApiService *AdminApiService + chainID string +} + +func (r ApiAdmChainrecordChainIDGetRequest) Execute() (*ChainRecord, *http.Response, error) { + return r.ApiService.AdmChainrecordChainIDGetExecute(r) +} + +/* +AdmChainrecordChainIDGet Find the chain record for the given chain ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32) + @return ApiAdmChainrecordChainIDGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainrecordChainIDGet(ctx context.Context, chainID string) ApiAdmChainrecordChainIDGetRequest { + return ApiAdmChainrecordChainIDGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return ChainRecord +// Deprecated +func (a *AdminApiService) AdmChainrecordChainIDGetExecute(r ApiAdmChainrecordChainIDGetRequest) (*ChainRecord, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ChainRecord + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainrecordChainIDGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chainrecord/{chainID}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmChainrecordPostRequest struct { + ctx context.Context + ApiService *AdminApiService + record *ChainRecord +} + +// Chain record +func (r ApiAdmChainrecordPostRequest) Record(record ChainRecord) ApiAdmChainrecordPostRequest { + r.record = &record + return r +} + +func (r ApiAdmChainrecordPostRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmChainrecordPostExecute(r) +} + +/* +AdmChainrecordPost Create a new chain record + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmChainrecordPostRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainrecordPost(ctx context.Context) ApiAdmChainrecordPostRequest { + return ApiAdmChainrecordPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// Deprecated +func (a *AdminApiService) AdmChainrecordPostExecute(r ApiAdmChainrecordPostRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainrecordPost") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chainrecord" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.record == nil { + return nil, reportError("record is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.record + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmChainrecordsGetRequest struct { + ctx context.Context + ApiService *AdminApiService +} + +func (r ApiAdmChainrecordsGetRequest) Execute() ([]ChainRecord, *http.Response, error) { + return r.ApiService.AdmChainrecordsGetExecute(r) +} + +/* +AdmChainrecordsGet Get the list of chain records in the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmChainrecordsGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmChainrecordsGet(ctx context.Context) ApiAdmChainrecordsGetRequest { + return ApiAdmChainrecordsGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []ChainRecord +// Deprecated +func (a *AdminApiService) AdmChainrecordsGetExecute(r ApiAdmChainrecordsGetRequest) ([]ChainRecord, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []ChainRecord + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainrecordsGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/chainrecords" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmDksPostRequest struct { + ctx context.Context + ApiService *AdminApiService + dKSharesPostRequest *DKSharesPostRequest +} + +// Request parameters +func (r ApiAdmDksPostRequest) DKSharesPostRequest(dKSharesPostRequest DKSharesPostRequest) ApiAdmDksPostRequest { + r.dKSharesPostRequest = &dKSharesPostRequest + return r +} + +func (r ApiAdmDksPostRequest) Execute() (*DKSharesInfo, *http.Response, error) { + return r.ApiService.AdmDksPostExecute(r) +} + +/* +AdmDksPost Generate a new distributed key + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmDksPostRequest + +Deprecated +*/ +func (a *AdminApiService) AdmDksPost(ctx context.Context) ApiAdmDksPostRequest { + return ApiAdmDksPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DKSharesInfo +// Deprecated +func (a *AdminApiService) AdmDksPostExecute(r ApiAdmDksPostRequest) (*DKSharesInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DKSharesInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmDksPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/dks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dKSharesPostRequest == nil { + return localVarReturnValue, nil, reportError("dKSharesPostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.dKSharesPostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmDksSharedAddressGetRequest struct { + ctx context.Context + ApiService *AdminApiService + sharedAddress string +} + +func (r ApiAdmDksSharedAddressGetRequest) Execute() (*DKSharesInfo, *http.Response, error) { + return r.ApiService.AdmDksSharedAddressGetExecute(r) +} + +/* +AdmDksSharedAddressGet Get distributed key properties + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param sharedAddress Address of the DK share (hex) + @return ApiAdmDksSharedAddressGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmDksSharedAddressGet(ctx context.Context, sharedAddress string) ApiAdmDksSharedAddressGetRequest { + return ApiAdmDksSharedAddressGetRequest{ + ApiService: a, + ctx: ctx, + sharedAddress: sharedAddress, + } +} + +// Execute executes the request +// @return DKSharesInfo +// Deprecated +func (a *AdminApiService) AdmDksSharedAddressGetExecute(r ApiAdmDksSharedAddressGetRequest) (*DKSharesInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DKSharesInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmDksSharedAddressGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/dks/{sharedAddress}" + localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmNodeOwnerCertificatePostRequest struct { + ctx context.Context + ApiService *AdminApiService + request *NodeOwnerCertificateRequest +} + +// Certificate request +func (r ApiAdmNodeOwnerCertificatePostRequest) Request(request NodeOwnerCertificateRequest) ApiAdmNodeOwnerCertificatePostRequest { + r.request = &request + return r +} + +func (r ApiAdmNodeOwnerCertificatePostRequest) Execute() (*NodeOwnerCertificateResponse, *http.Response, error) { + return r.ApiService.AdmNodeOwnerCertificatePostExecute(r) +} + +/* +AdmNodeOwnerCertificatePost Provides a certificate, if the node recognizes the owner. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmNodeOwnerCertificatePostRequest + +Deprecated +*/ +func (a *AdminApiService) AdmNodeOwnerCertificatePost(ctx context.Context) ApiAdmNodeOwnerCertificatePostRequest { + return ApiAdmNodeOwnerCertificatePostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return NodeOwnerCertificateResponse +// Deprecated +func (a *AdminApiService) AdmNodeOwnerCertificatePostExecute(r ApiAdmNodeOwnerCertificatePostRequest) (*NodeOwnerCertificateResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NodeOwnerCertificateResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmNodeOwnerCertificatePost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/node/owner/certificate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, reportError("request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmPeeringEstablishedGetRequest struct { + ctx context.Context + ApiService *AdminApiService +} + +func (r ApiAdmPeeringEstablishedGetRequest) Execute() ([]PeeringNodeStatus, *http.Response, error) { + return r.ApiService.AdmPeeringEstablishedGetExecute(r) +} + +/* +AdmPeeringEstablishedGet Basic information about all configured peers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmPeeringEstablishedGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringEstablishedGet(ctx context.Context) ApiAdmPeeringEstablishedGetRequest { + return ApiAdmPeeringEstablishedGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []PeeringNodeStatus +// Deprecated +func (a *AdminApiService) AdmPeeringEstablishedGetExecute(r ApiAdmPeeringEstablishedGetRequest) ([]PeeringNodeStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PeeringNodeStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringEstablishedGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/established" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmPeeringSelfGetRequest struct { + ctx context.Context + ApiService *AdminApiService +} + +func (r ApiAdmPeeringSelfGetRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { + return r.ApiService.AdmPeeringSelfGetExecute(r) +} + +/* +AdmPeeringSelfGet Basic peer info of the current node. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmPeeringSelfGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringSelfGet(ctx context.Context) ApiAdmPeeringSelfGetRequest { + return ApiAdmPeeringSelfGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PeeringTrustedNode +// Deprecated +func (a *AdminApiService) AdmPeeringSelfGetExecute(r ApiAdmPeeringSelfGetRequest) (*PeeringTrustedNode, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PeeringTrustedNode + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringSelfGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/self" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmPeeringTrustedGetRequest struct { + ctx context.Context + ApiService *AdminApiService +} + +func (r ApiAdmPeeringTrustedGetRequest) Execute() ([]PeeringTrustedNode, *http.Response, error) { + return r.ApiService.AdmPeeringTrustedGetExecute(r) +} + +/* +AdmPeeringTrustedGet Get a list of trusted peers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmPeeringTrustedGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringTrustedGet(ctx context.Context) ApiAdmPeeringTrustedGetRequest { + return ApiAdmPeeringTrustedGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []PeeringTrustedNode +// Deprecated +func (a *AdminApiService) AdmPeeringTrustedGetExecute(r ApiAdmPeeringTrustedGetRequest) ([]PeeringTrustedNode, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PeeringTrustedNode + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/trusted" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmPeeringTrustedPostRequest struct { + ctx context.Context + ApiService *AdminApiService + peeringTrustedNode *PeeringTrustedNode +} + +// Info of the peer to trust. +func (r ApiAdmPeeringTrustedPostRequest) PeeringTrustedNode(peeringTrustedNode PeeringTrustedNode) ApiAdmPeeringTrustedPostRequest { + r.peeringTrustedNode = &peeringTrustedNode + return r +} + +func (r ApiAdmPeeringTrustedPostRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { + return r.ApiService.AdmPeeringTrustedPostExecute(r) +} + +/* +AdmPeeringTrustedPost Trust the specified peer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmPeeringTrustedPostRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringTrustedPost(ctx context.Context) ApiAdmPeeringTrustedPostRequest { + return ApiAdmPeeringTrustedPostRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PeeringTrustedNode +// Deprecated +func (a *AdminApiService) AdmPeeringTrustedPostExecute(r ApiAdmPeeringTrustedPostRequest) (*PeeringTrustedNode, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PeeringTrustedNode + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/trusted" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.peeringTrustedNode == nil { + return localVarReturnValue, nil, reportError("peeringTrustedNode is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.peeringTrustedNode + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmPeeringTrustedPubKeyDeleteRequest struct { + ctx context.Context + ApiService *AdminApiService + pubKey string +} + +func (r ApiAdmPeeringTrustedPubKeyDeleteRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmPeeringTrustedPubKeyDeleteExecute(r) +} + +/* +AdmPeeringTrustedPubKeyDelete Distrust the specified peer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pubKey Public key of the trusted peer (hex). + @return ApiAdmPeeringTrustedPubKeyDeleteRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringTrustedPubKeyDelete(ctx context.Context, pubKey string) ApiAdmPeeringTrustedPubKeyDeleteRequest { + return ApiAdmPeeringTrustedPubKeyDeleteRequest{ + ApiService: a, + ctx: ctx, + pubKey: pubKey, + } +} + +// Execute executes the request +// Deprecated +func (a *AdminApiService) AdmPeeringTrustedPubKeyDeleteExecute(r ApiAdmPeeringTrustedPubKeyDeleteRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPubKeyDelete") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/trusted/{pubKey}" + localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdmPeeringTrustedPubKeyGetRequest struct { + ctx context.Context + ApiService *AdminApiService + pubKey string +} + +func (r ApiAdmPeeringTrustedPubKeyGetRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { + return r.ApiService.AdmPeeringTrustedPubKeyGetExecute(r) +} + +/* +AdmPeeringTrustedPubKeyGet Get details on a particular trusted peer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pubKey Public key of the trusted peer (hex). + @return ApiAdmPeeringTrustedPubKeyGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringTrustedPubKeyGet(ctx context.Context, pubKey string) ApiAdmPeeringTrustedPubKeyGetRequest { + return ApiAdmPeeringTrustedPubKeyGetRequest{ + ApiService: a, + ctx: ctx, + pubKey: pubKey, + } +} + +// Execute executes the request +// @return PeeringTrustedNode +// Deprecated +func (a *AdminApiService) AdmPeeringTrustedPubKeyGetExecute(r ApiAdmPeeringTrustedPubKeyGetRequest) (*PeeringTrustedNode, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PeeringTrustedNode + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPubKeyGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/trusted/{pubKey}" + localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmPeeringTrustedPubKeyPutRequest struct { + ctx context.Context + ApiService *AdminApiService + pubKey string + peeringTrustedNode *PeeringTrustedNode +} + +// Info of the peer to trust. +func (r ApiAdmPeeringTrustedPubKeyPutRequest) PeeringTrustedNode(peeringTrustedNode PeeringTrustedNode) ApiAdmPeeringTrustedPubKeyPutRequest { + r.peeringTrustedNode = &peeringTrustedNode + return r +} + +func (r ApiAdmPeeringTrustedPubKeyPutRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { + return r.ApiService.AdmPeeringTrustedPubKeyPutExecute(r) +} + +/* +AdmPeeringTrustedPubKeyPut Trust the specified peer, the pub key is passed via the path. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pubKey Public key of the trusted peer (hex). + @return ApiAdmPeeringTrustedPubKeyPutRequest + +Deprecated +*/ +func (a *AdminApiService) AdmPeeringTrustedPubKeyPut(ctx context.Context, pubKey string) ApiAdmPeeringTrustedPubKeyPutRequest { + return ApiAdmPeeringTrustedPubKeyPutRequest{ + ApiService: a, + ctx: ctx, + pubKey: pubKey, + } +} + +// Execute executes the request +// @return PeeringTrustedNode +// Deprecated +func (a *AdminApiService) AdmPeeringTrustedPubKeyPutExecute(r ApiAdmPeeringTrustedPubKeyPutRequest) (*PeeringTrustedNode, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PeeringTrustedNode + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPubKeyPut") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/peering/trusted/{pubKey}" + localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.peeringTrustedNode == nil { + return localVarReturnValue, nil, reportError("peeringTrustedNode is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.peeringTrustedNode + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdmShutdownGetRequest struct { + ctx context.Context + ApiService *AdminApiService +} + +func (r ApiAdmShutdownGetRequest) Execute() (*http.Response, error) { + return r.ApiService.AdmShutdownGetExecute(r) +} + +/* +AdmShutdownGet Shut down the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdmShutdownGetRequest + +Deprecated +*/ +func (a *AdminApiService) AdmShutdownGet(ctx context.Context) ApiAdmShutdownGetRequest { + return ApiAdmShutdownGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// Deprecated +func (a *AdminApiService) AdmShutdownGetExecute(r ApiAdmShutdownGetRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmShutdownGet") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/adm/shutdown" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index 0976505c99..32817e1a3f 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -157,7 +157,7 @@ func (r ApiGenerateDKSRequest) DKSharesPostRequest(dKSharesPostRequest DKSharesP return r } -func (r ApiGenerateDKSRequest) Execute() (*DKSharesPostRequest, *http.Response, error) { +func (r ApiGenerateDKSRequest) Execute() (*DKSharesInfo, *http.Response, error) { return r.ApiService.GenerateDKSExecute(r) } @@ -175,13 +175,13 @@ func (a *NodeApiService) GenerateDKS(ctx context.Context) ApiGenerateDKSRequest } // Execute executes the request -// @return DKSharesPostRequest -func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesPostRequest, *http.Response, error) { +// @return DKSharesInfo +func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesInfo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *DKSharesPostRequest + localVarReturnValue *DKSharesInfo ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GenerateDKS") @@ -1117,7 +1117,7 @@ func (r ApiSetNodeOwnerRequest) NodeOwnerCertificateRequest(nodeOwnerCertificate return r } -func (r ApiSetNodeOwnerRequest) Execute() (*http.Response, error) { +func (r ApiSetNodeOwnerRequest) Execute() (*NodeOwnerCertificateResponse, *http.Response, error) { return r.ApiService.SetNodeOwnerExecute(r) } @@ -1135,16 +1135,18 @@ func (a *NodeApiService) SetNodeOwner(ctx context.Context) ApiSetNodeOwnerReques } // Execute executes the request -func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Response, error) { +// @return NodeOwnerCertificateResponse +func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*NodeOwnerCertificateResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile + localVarReturnValue *NodeOwnerCertificateResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.SetNodeOwner") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/v2node/owner/certificate" @@ -1153,7 +1155,7 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Re localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.nodeOwnerCertificateRequest == nil { - return nil, reportError("nodeOwnerCertificateRequest is required and must be specified") + return localVarReturnValue, nil, reportError("nodeOwnerCertificateRequest is required and must be specified") } // to determine the Content-Type header @@ -1191,19 +1193,19 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Re } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -1216,15 +1218,24 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*http.Re err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } type ApiShutdownNodeRequest struct { diff --git a/clients/apiclient/api_public.go b/clients/apiclient/api_public.go new file mode 100644 index 0000000000..e05af06477 --- /dev/null +++ b/clients/apiclient/api_public.go @@ -0,0 +1,1254 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// PublicApiService PublicApi service +type PublicApiService service + +type ApiChainChainIDContractContractHnameCallviewFnameGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + contractHname string + fname string + params *JSONDict +} + +// Parameters +func (r ApiChainChainIDContractContractHnameCallviewFnameGetRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewFnameGetRequest { + r.params = ¶ms + return r +} + +func (r ApiChainChainIDContractContractHnameCallviewFnameGetRequest) Execute() (*JSONDict, *http.Response, error) { + return r.ApiService.ChainChainIDContractContractHnameCallviewFnameGetExecute(r) +} + +/* +ChainChainIDContractContractHnameCallviewFnameGet Call a view function on a contract by name + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID + @param contractHname Contract Hname + @param fname Function name + @return ApiChainChainIDContractContractHnameCallviewFnameGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnameGet(ctx context.Context, chainID string, contractHname string, fname string) ApiChainChainIDContractContractHnameCallviewFnameGetRequest { + return ApiChainChainIDContractContractHnameCallviewFnameGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + contractHname: contractHname, + fname: fname, + } +} + +// Execute executes the request +// @return JSONDict +// Deprecated +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnameGetExecute(r ApiChainChainIDContractContractHnameCallviewFnameGetRequest) (*JSONDict, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JSONDict + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewFnameGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callview/{fname}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"fname"+"}", url.PathEscape(parameterValueToString(r.fname, "fname")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.params + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDContractContractHnameCallviewFnamePostRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + contractHname string + fname string + params *JSONDict +} + +// Parameters +func (r ApiChainChainIDContractContractHnameCallviewFnamePostRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewFnamePostRequest { + r.params = ¶ms + return r +} + +func (r ApiChainChainIDContractContractHnameCallviewFnamePostRequest) Execute() (*JSONDict, *http.Response, error) { + return r.ApiService.ChainChainIDContractContractHnameCallviewFnamePostExecute(r) +} + +/* +ChainChainIDContractContractHnameCallviewFnamePost Call a view function on a contract by name + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID + @param contractHname Contract Hname + @param fname Function name + @return ApiChainChainIDContractContractHnameCallviewFnamePostRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnamePost(ctx context.Context, chainID string, contractHname string, fname string) ApiChainChainIDContractContractHnameCallviewFnamePostRequest { + return ApiChainChainIDContractContractHnameCallviewFnamePostRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + contractHname: contractHname, + fname: fname, + } +} + +// Execute executes the request +// @return JSONDict +// Deprecated +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnamePostExecute(r ApiChainChainIDContractContractHnameCallviewFnamePostRequest) (*JSONDict, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JSONDict + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewFnamePost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callview/{fname}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"fname"+"}", url.PathEscape(parameterValueToString(r.fname, "fname")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.params + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + contractHname string + functionHname string + params *JSONDict +} + +// Parameters +func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest { + r.params = ¶ms + return r +} + +func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest) Execute() (*JSONDict, *http.Response, error) { + return r.ApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetExecute(r) +} + +/* +ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet Call a view function on a contract by Hname + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID + @param contractHname Contract Hname + @param functionHname Function Hname + @return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(ctx context.Context, chainID string, contractHname string, functionHname string) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest { + return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + contractHname: contractHname, + functionHname: functionHname, + } +} + +// Execute executes the request +// @return JSONDict +// Deprecated +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetExecute(r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest) (*JSONDict, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JSONDict + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"functionHname"+"}", url.PathEscape(parameterValueToString(r.functionHname, "functionHname")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.params + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + contractHname string + functionHname string + params *JSONDict +} + +// Parameters +func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest { + r.params = ¶ms + return r +} + +func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest) Execute() (*JSONDict, *http.Response, error) { + return r.ApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostExecute(r) +} + +/* +ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost Call a view function on a contract by Hname + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID + @param contractHname Contract Hname + @param functionHname Function Hname + @return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(ctx context.Context, chainID string, contractHname string, functionHname string) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest { + return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + contractHname: contractHname, + functionHname: functionHname, + } +} + +// Execute executes the request +// @return JSONDict +// Deprecated +func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostExecute(r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest) (*JSONDict, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *JSONDict + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"functionHname"+"}", url.PathEscape(parameterValueToString(r.functionHname, "functionHname")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.params + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDEvmReqidTxHashGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + txHash string +} + +func (r ApiChainChainIDEvmReqidTxHashGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.ChainChainIDEvmReqidTxHashGetExecute(r) +} + +/* +ChainChainIDEvmReqidTxHashGet Get the ISC request ID for the given Ethereum transaction hash + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32-encoded) + @param txHash Transaction hash (hex-encoded) + @return ApiChainChainIDEvmReqidTxHashGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDEvmReqidTxHashGet(ctx context.Context, chainID string, txHash string) ApiChainChainIDEvmReqidTxHashGetRequest { + return ApiChainChainIDEvmReqidTxHashGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + txHash: txHash, + } +} + +// Execute executes the request +// @return string +// Deprecated +func (a *PublicApiService) ChainChainIDEvmReqidTxHashGetExecute(r ApiChainChainIDEvmReqidTxHashGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDEvmReqidTxHashGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/evm/reqid/{txHash}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDRequestPostRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + request *OffLedgerRequestBody +} + +// Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\" +func (r ApiChainChainIDRequestPostRequest) Request(request OffLedgerRequestBody) ApiChainChainIDRequestPostRequest { + r.request = &request + return r +} + +func (r ApiChainChainIDRequestPostRequest) Execute() (*http.Response, error) { + return r.ApiService.ChainChainIDRequestPostExecute(r) +} + +/* +ChainChainIDRequestPost Post an off-ledger request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID chainID + @return ApiChainChainIDRequestPostRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDRequestPost(ctx context.Context, chainID string) ApiChainChainIDRequestPostRequest { + return ApiChainChainIDRequestPostRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// Deprecated +func (a *PublicApiService) ChainChainIDRequestPostExecute(r ApiChainChainIDRequestPostRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDRequestPost") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/request" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiChainChainIDRequestReqIDReceiptGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + reqID string +} + +func (r ApiChainChainIDRequestReqIDReceiptGetRequest) Execute() (*RequestReceiptResponse, *http.Response, error) { + return r.ApiService.ChainChainIDRequestReqIDReceiptGetExecute(r) +} + +/* +ChainChainIDRequestReqIDReceiptGet Get the processing status of a given request in the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32) + @param reqID Request ID + @return ApiChainChainIDRequestReqIDReceiptGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDRequestReqIDReceiptGet(ctx context.Context, chainID string, reqID string) ApiChainChainIDRequestReqIDReceiptGetRequest { + return ApiChainChainIDRequestReqIDReceiptGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + reqID: reqID, + } +} + +// Execute executes the request +// @return RequestReceiptResponse +// Deprecated +func (a *PublicApiService) ChainChainIDRequestReqIDReceiptGetExecute(r ApiChainChainIDRequestReqIDReceiptGetRequest) (*RequestReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDRequestReqIDReceiptGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/request/{reqID}/receipt" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"reqID"+"}", url.PathEscape(parameterValueToString(r.reqID, "reqID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDRequestReqIDWaitGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + reqID string + params *WaitRequestProcessedParams +} + +// Optional parameters +func (r ApiChainChainIDRequestReqIDWaitGetRequest) Params(params WaitRequestProcessedParams) ApiChainChainIDRequestReqIDWaitGetRequest { + r.params = ¶ms + return r +} + +func (r ApiChainChainIDRequestReqIDWaitGetRequest) Execute() (*RequestReceiptResponse, *http.Response, error) { + return r.ApiService.ChainChainIDRequestReqIDWaitGetExecute(r) +} + +/* +ChainChainIDRequestReqIDWaitGet Wait until the given request has been processed by the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32) + @param reqID Request ID + @return ApiChainChainIDRequestReqIDWaitGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDRequestReqIDWaitGet(ctx context.Context, chainID string, reqID string) ApiChainChainIDRequestReqIDWaitGetRequest { + return ApiChainChainIDRequestReqIDWaitGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + reqID: reqID, + } +} + +// Execute executes the request +// @return RequestReceiptResponse +// Deprecated +func (a *PublicApiService) ChainChainIDRequestReqIDWaitGetExecute(r ApiChainChainIDRequestReqIDWaitGetRequest) (*RequestReceiptResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestReceiptResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDRequestReqIDWaitGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/request/{reqID}/wait" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"reqID"+"}", url.PathEscape(parameterValueToString(r.reqID, "reqID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.params + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDStateKeyGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string + key string +} + +func (r ApiChainChainIDStateKeyGetRequest) Execute() ([]int32, *http.Response, error) { + return r.ApiService.ChainChainIDStateKeyGetExecute(r) +} + +/* +ChainChainIDStateKeyGet Fetch the raw value associated with the given key in the chain state + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID + @param key Key (hex-encoded) + @return ApiChainChainIDStateKeyGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDStateKeyGet(ctx context.Context, chainID string, key string) ApiChainChainIDStateKeyGetRequest { + return ApiChainChainIDStateKeyGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + key: key, + } +} + +// Execute executes the request +// @return []int32 +// Deprecated +func (a *PublicApiService) ChainChainIDStateKeyGetExecute(r ApiChainChainIDStateKeyGetRequest) ([]int32, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []int32 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDStateKeyGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/state/{key}" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiChainChainIDWsGetRequest struct { + ctx context.Context + ApiService *PublicApiService + chainID string +} + +func (r ApiChainChainIDWsGetRequest) Execute() (*http.Response, error) { + return r.ApiService.ChainChainIDWsGetExecute(r) +} + +/* +ChainChainIDWsGet Method for ChainChainIDWsGet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (bech32-encoded) + @return ApiChainChainIDWsGetRequest + +Deprecated +*/ +func (a *PublicApiService) ChainChainIDWsGet(ctx context.Context, chainID string) ApiChainChainIDWsGetRequest { + return ApiChainChainIDWsGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// Deprecated +func (a *PublicApiService) ChainChainIDWsGetExecute(r ApiChainChainIDWsGetRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDWsGet") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chain/{chainID}/ws" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiInfoGetRequest struct { + ctx context.Context + ApiService *PublicApiService +} + +func (r ApiInfoGetRequest) Execute() (*InfoResponse, *http.Response, error) { + return r.ApiService.InfoGetExecute(r) +} + +/* +InfoGet Get information about the node + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInfoGetRequest + +Deprecated +*/ +func (a *PublicApiService) InfoGet(ctx context.Context) ApiInfoGetRequest { + return ApiInfoGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InfoResponse +// Deprecated +func (a *PublicApiService) InfoGetExecute(r ApiInfoGetRequest) (*InfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.InfoGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index 64b489d994..c06ecfb1ba 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -337,27 +337,27 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp return localVarHTTPResponse, nil } -type ApiWaitForTransactionRequest struct { +type ApiWaitForRequestRequest struct { ctx context.Context ApiService *RequestsApiService chainID string requestID string } -func (r ApiWaitForTransactionRequest) Execute() (*ReceiptResponse, *http.Response, error) { - return r.ApiService.WaitForTransactionExecute(r) +func (r ApiWaitForRequestRequest) Execute() (*ReceiptResponse, *http.Response, error) { + return r.ApiService.WaitForRequestExecute(r) } /* -WaitForTransaction Wait until the given request has been processed by the node +WaitForRequest Wait until the given request has been processed by the node @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param chainID ChainID (Bech32) @param requestID RequestID (Hex) - @return ApiWaitForTransactionRequest + @return ApiWaitForRequestRequest */ -func (a *RequestsApiService) WaitForTransaction(ctx context.Context, chainID string, requestID string) ApiWaitForTransactionRequest { - return ApiWaitForTransactionRequest{ +func (a *RequestsApiService) WaitForRequest(ctx context.Context, chainID string, requestID string) ApiWaitForRequestRequest { + return ApiWaitForRequestRequest{ ApiService: a, ctx: ctx, chainID: chainID, @@ -367,7 +367,7 @@ func (a *RequestsApiService) WaitForTransaction(ctx context.Context, chainID str // Execute executes the request // @return ReceiptResponse -func (a *RequestsApiService) WaitForTransactionExecute(r ApiWaitForTransactionRequest) (*ReceiptResponse, *http.Response, error) { +func (a *RequestsApiService) WaitForRequestExecute(r ApiWaitForRequestRequest) (*ReceiptResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -375,7 +375,7 @@ func (a *RequestsApiService) WaitForTransactionExecute(r ApiWaitForTransactionRe localVarReturnValue *ReceiptResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.WaitForTransaction") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RequestsApiService.WaitForRequest") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go index 314eb0380f..574d7cbee3 100644 --- a/clients/apiclient/client.go +++ b/clients/apiclient/client.go @@ -50,6 +50,8 @@ type APIClient struct { // API Services + AdminApi *AdminApiService + AuthApi *AuthApiService ChainsApi *ChainsApiService @@ -60,6 +62,8 @@ type APIClient struct { NodeApi *NodeApiService + PublicApi *PublicApiService + RequestsApi *RequestsApiService UsersApi *UsersApiService @@ -81,11 +85,13 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.AdminApi = (*AdminApiService)(&c.common) c.AuthApi = (*AuthApiService)(&c.common) c.ChainsApi = (*ChainsApiService)(&c.common) c.CorecontractsApi = (*CorecontractsApiService)(&c.common) c.MetricsApi = (*MetricsApiService)(&c.common) c.NodeApi = (*NodeApiService)(&c.common) + c.PublicApi = (*PublicApiService)(&c.common) c.RequestsApi = (*RequestsApiService)(&c.common) c.UsersApi = (*UsersApiService)(&c.common) diff --git a/clients/apiclient/docs/AdminApi.md b/clients/apiclient/docs/AdminApi.md new file mode 100644 index 0000000000..f2e0ef9113 --- /dev/null +++ b/clients/apiclient/docs/AdminApi.md @@ -0,0 +1,1517 @@ +# \AdminApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AdmChainChainIDAccessNodePubKeyDelete**](AdminApi.md#AdmChainChainIDAccessNodePubKeyDelete) | **Delete** /adm/chain/{chainID}/access-node/{pubKey} | Remove an access node from a chain +[**AdmChainChainIDAccessNodePubKeyPut**](AdminApi.md#AdmChainChainIDAccessNodePubKeyPut) | **Put** /adm/chain/{chainID}/access-node/{pubKey} | Add an access node to a chain +[**AdmChainChainIDActivatePost**](AdminApi.md#AdmChainChainIDActivatePost) | **Post** /adm/chain/{chainID}/activate | Activate a chain +[**AdmChainChainIDConsensusMetricsPipeGet**](AdminApi.md#AdmChainChainIDConsensusMetricsPipeGet) | **Get** /adm/chain/{chainID}/consensus/metrics/pipe | Get consensus pipe metrics +[**AdmChainChainIDConsensusStatusGet**](AdminApi.md#AdmChainChainIDConsensusStatusGet) | **Get** /adm/chain/{chainID}/consensus/status | Get chain state statistics for the given chain ID +[**AdmChainChainIDDeactivatePost**](AdminApi.md#AdmChainChainIDDeactivatePost) | **Post** /adm/chain/{chainID}/deactivate | Deactivate a chain +[**AdmChainChainIDInfoGet**](AdminApi.md#AdmChainChainIDInfoGet) | **Get** /adm/chain/{chainID}/info | Get basic chain info. +[**AdmChainChainIDNodeconnMetricsGet**](AdminApi.md#AdmChainChainIDNodeconnMetricsGet) | **Get** /adm/chain/{chainID}/nodeconn/metrics | Get chain node connection metrics for the given chain ID +[**AdmChainNodeconnMetricsGet**](AdminApi.md#AdmChainNodeconnMetricsGet) | **Get** /adm/chain/nodeconn/metrics | Get cummulative chains node connection metrics +[**AdmChainrecordChainIDGet**](AdminApi.md#AdmChainrecordChainIDGet) | **Get** /adm/chainrecord/{chainID} | Find the chain record for the given chain ID +[**AdmChainrecordPost**](AdminApi.md#AdmChainrecordPost) | **Post** /adm/chainrecord | Create a new chain record +[**AdmChainrecordsGet**](AdminApi.md#AdmChainrecordsGet) | **Get** /adm/chainrecords | Get the list of chain records in the node +[**AdmDksPost**](AdminApi.md#AdmDksPost) | **Post** /adm/dks | Generate a new distributed key +[**AdmDksSharedAddressGet**](AdminApi.md#AdmDksSharedAddressGet) | **Get** /adm/dks/{sharedAddress} | Get distributed key properties +[**AdmNodeOwnerCertificatePost**](AdminApi.md#AdmNodeOwnerCertificatePost) | **Post** /adm/node/owner/certificate | Provides a certificate, if the node recognizes the owner. +[**AdmPeeringEstablishedGet**](AdminApi.md#AdmPeeringEstablishedGet) | **Get** /adm/peering/established | Basic information about all configured peers. +[**AdmPeeringSelfGet**](AdminApi.md#AdmPeeringSelfGet) | **Get** /adm/peering/self | Basic peer info of the current node. +[**AdmPeeringTrustedGet**](AdminApi.md#AdmPeeringTrustedGet) | **Get** /adm/peering/trusted | Get a list of trusted peers. +[**AdmPeeringTrustedPost**](AdminApi.md#AdmPeeringTrustedPost) | **Post** /adm/peering/trusted | Trust the specified peer. +[**AdmPeeringTrustedPubKeyDelete**](AdminApi.md#AdmPeeringTrustedPubKeyDelete) | **Delete** /adm/peering/trusted/{pubKey} | Distrust the specified peer. +[**AdmPeeringTrustedPubKeyGet**](AdminApi.md#AdmPeeringTrustedPubKeyGet) | **Get** /adm/peering/trusted/{pubKey} | Get details on a particular trusted peer. +[**AdmPeeringTrustedPubKeyPut**](AdminApi.md#AdmPeeringTrustedPubKeyPut) | **Put** /adm/peering/trusted/{pubKey} | Trust the specified peer, the pub key is passed via the path. +[**AdmShutdownGet**](AdminApi.md#AdmShutdownGet) | **Get** /adm/shutdown | Shut down the node + + + +## AdmChainChainIDAccessNodePubKeyDelete + +> AdmChainChainIDAccessNodePubKeyDelete(ctx, chainID, pubKey).Execute() + +Remove an access node from a chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32)) + pubKey := "pubKey_example" // string | PublicKey (hex string) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyDelete(context.Background(), chainID, pubKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDAccessNodePubKeyDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32)) | +**pubKey** | **string** | PublicKey (hex string) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDAccessNodePubKeyDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## AdmChainChainIDAccessNodePubKeyPut + +> AdmChainChainIDAccessNodePubKeyPut(ctx, chainID, pubKey).Execute() + +Add an access node to a chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32)) + pubKey := "pubKey_example" // string | PublicKey (hex string) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyPut(context.Background(), chainID, pubKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDAccessNodePubKeyPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32)) | +**pubKey** | **string** | PublicKey (hex string) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDAccessNodePubKeyPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## AdmChainChainIDActivatePost + +> AdmChainChainIDActivatePost(ctx, chainID).Execute() + +Activate a chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32)) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDActivatePost(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDActivatePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32)) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDActivatePostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## AdmChainChainIDConsensusMetricsPipeGet + +> ConsensusPipeMetrics AdmChainChainIDConsensusMetricsPipeGet(ctx, chainID).Execute() + +Get consensus pipe metrics + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | chainID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDConsensusMetricsPipeGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDConsensusMetricsPipeGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmChainChainIDConsensusMetricsPipeGet`: ConsensusPipeMetrics + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainChainIDConsensusMetricsPipeGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | chainID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDConsensusMetricsPipeGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ConsensusPipeMetrics**](ConsensusPipeMetrics.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) + + +## AdmChainChainIDConsensusStatusGet + +> ConsensusWorkflowStatus AdmChainChainIDConsensusStatusGet(ctx, chainID).Execute() + +Get chain state statistics for the given chain ID + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDConsensusStatusGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDConsensusStatusGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmChainChainIDConsensusStatusGet`: ConsensusWorkflowStatus + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainChainIDConsensusStatusGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDConsensusStatusGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ConsensusWorkflowStatus**](ConsensusWorkflowStatus.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) + + +## AdmChainChainIDDeactivatePost + +> AdmChainChainIDDeactivatePost(ctx, chainID).Execute() + +Deactivate a chain + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32)) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDDeactivatePost(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDDeactivatePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32)) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDDeactivatePostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## AdmChainChainIDInfoGet + +> AdmChainChainIDInfoGet(ctx, chainID).Execute() + +Get basic chain info. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32)) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDInfoGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDInfoGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32)) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDInfoGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## AdmChainChainIDNodeconnMetricsGet + +> NodeConnectionMessagesMetrics AdmChainChainIDNodeconnMetricsGet(ctx, chainID).Execute() + +Get chain node connection metrics for the given chain ID + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainChainIDNodeconnMetricsGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDNodeconnMetricsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmChainChainIDNodeconnMetricsGet`: NodeConnectionMessagesMetrics + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainChainIDNodeconnMetricsGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainChainIDNodeconnMetricsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**NodeConnectionMessagesMetrics**](NodeConnectionMessagesMetrics.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) + + +## AdmChainNodeconnMetricsGet + +> NodeConnectionMetrics AdmChainNodeconnMetricsGet(ctx).Execute() + +Get cummulative chains node connection metrics + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainNodeconnMetricsGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainNodeconnMetricsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmChainNodeconnMetricsGet`: NodeConnectionMetrics + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainNodeconnMetricsGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainNodeconnMetricsGetRequest struct via the builder pattern + + +### Return type + +[**NodeConnectionMetrics**](NodeConnectionMetrics.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) + + +## AdmChainrecordChainIDGet + +> ChainRecord AdmChainrecordChainIDGet(ctx, chainID).Execute() + +Find the chain record for the given chain ID + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainrecordChainIDGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainrecordChainIDGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmChainrecordChainIDGet`: ChainRecord + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainrecordChainIDGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainrecordChainIDGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ChainRecord**](ChainRecord.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) + + +## AdmChainrecordPost + +> AdmChainrecordPost(ctx).Record(record).Execute() + +Create a new chain record + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + record := *openapiclient.NewChainRecord() // ChainRecord | Chain record + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainrecordPost(context.Background()).Record(record).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainrecordPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainrecordPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **record** | [**ChainRecord**](ChainRecord.md) | Chain record | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + +## AdmChainrecordsGet + +> []ChainRecord AdmChainrecordsGet(ctx).Execute() + +Get the list of chain records in the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmChainrecordsGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainrecordsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmChainrecordsGet`: []ChainRecord + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainrecordsGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmChainrecordsGetRequest struct via the builder pattern + + +### Return type + +[**[]ChainRecord**](ChainRecord.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) + + +## AdmDksPost + +> DKSharesInfo AdmDksPost(ctx).DKSharesPostRequest(dKSharesPostRequest).Execute() + +Generate a new distributed key + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + dKSharesPostRequest := *openapiclient.NewDKSharesPostRequest([]string{"PeerIdentities_example"}, uint32(123), uint32(123)) // DKSharesPostRequest | Request parameters + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmDksPost(context.Background()).DKSharesPostRequest(dKSharesPostRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmDksPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmDksPost`: DKSharesInfo + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmDksPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmDksPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dKSharesPostRequest** | [**DKSharesPostRequest**](DKSharesPostRequest.md) | Request parameters | + +### Return type + +[**DKSharesInfo**](DKSharesInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## AdmDksSharedAddressGet + +> DKSharesInfo AdmDksSharedAddressGet(ctx, sharedAddress).Execute() + +Get distributed key properties + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + sharedAddress := "sharedAddress_example" // string | Address of the DK share (hex) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmDksSharedAddressGet(context.Background(), sharedAddress).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmDksSharedAddressGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmDksSharedAddressGet`: DKSharesInfo + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmDksSharedAddressGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**sharedAddress** | **string** | Address of the DK share (hex) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmDksSharedAddressGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DKSharesInfo**](DKSharesInfo.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) + + +## AdmNodeOwnerCertificatePost + +> NodeOwnerCertificateResponse AdmNodeOwnerCertificatePost(ctx).Request(request).Execute() + +Provides a certificate, if the node recognizes the owner. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + request := *openapiclient.NewNodeOwnerCertificateRequest("OwnerAddress_example", "PublicKey_example") // NodeOwnerCertificateRequest | Certificate request + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmNodeOwnerCertificatePost(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmNodeOwnerCertificatePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmNodeOwnerCertificatePost`: NodeOwnerCertificateResponse + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmNodeOwnerCertificatePost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmNodeOwnerCertificatePostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**NodeOwnerCertificateRequest**](NodeOwnerCertificateRequest.md) | Certificate request | + +### Return type + +[**NodeOwnerCertificateResponse**](NodeOwnerCertificateResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## AdmPeeringEstablishedGet + +> []PeeringNodeStatus AdmPeeringEstablishedGet(ctx).Execute() + +Basic information about all configured peers. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringEstablishedGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringEstablishedGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmPeeringEstablishedGet`: []PeeringNodeStatus + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringEstablishedGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringEstablishedGetRequest struct via the builder pattern + + +### Return type + +[**[]PeeringNodeStatus**](PeeringNodeStatus.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) + + +## AdmPeeringSelfGet + +> PeeringTrustedNode AdmPeeringSelfGet(ctx).Execute() + +Basic peer info of the current node. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringSelfGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringSelfGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmPeeringSelfGet`: PeeringTrustedNode + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringSelfGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringSelfGetRequest struct via the builder pattern + + +### Return type + +[**PeeringTrustedNode**](PeeringTrustedNode.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) + + +## AdmPeeringTrustedGet + +> []PeeringTrustedNode AdmPeeringTrustedGet(ctx).Execute() + +Get a list of trusted peers. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringTrustedGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmPeeringTrustedGet`: []PeeringTrustedNode + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringTrustedGetRequest struct via the builder pattern + + +### Return type + +[**[]PeeringTrustedNode**](PeeringTrustedNode.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) + + +## AdmPeeringTrustedPost + +> PeeringTrustedNode AdmPeeringTrustedPost(ctx).PeeringTrustedNode(peeringTrustedNode).Execute() + +Trust the specified peer. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + peeringTrustedNode := *openapiclient.NewPeeringTrustedNode() // PeeringTrustedNode | Info of the peer to trust. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPost(context.Background()).PeeringTrustedNode(peeringTrustedNode).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmPeeringTrustedPost`: PeeringTrustedNode + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedPost`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringTrustedPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **peeringTrustedNode** | [**PeeringTrustedNode**](PeeringTrustedNode.md) | Info of the peer to trust. | + +### Return type + +[**PeeringTrustedNode**](PeeringTrustedNode.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## AdmPeeringTrustedPubKeyDelete + +> AdmPeeringTrustedPubKeyDelete(ctx, pubKey).Execute() + +Distrust the specified peer. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pubKey := "pubKey_example" // string | Public key of the trusted peer (hex). + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyDelete(context.Background(), pubKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPubKeyDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pubKey** | **string** | Public key of the trusted peer (hex). | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringTrustedPubKeyDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## AdmPeeringTrustedPubKeyGet + +> PeeringTrustedNode AdmPeeringTrustedPubKeyGet(ctx, pubKey).Execute() + +Get details on a particular trusted peer. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pubKey := "pubKey_example" // string | Public key of the trusted peer (hex). + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyGet(context.Background(), pubKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPubKeyGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmPeeringTrustedPubKeyGet`: PeeringTrustedNode + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedPubKeyGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pubKey** | **string** | Public key of the trusted peer (hex). | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringTrustedPubKeyGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**PeeringTrustedNode**](PeeringTrustedNode.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) + + +## AdmPeeringTrustedPubKeyPut + +> PeeringTrustedNode AdmPeeringTrustedPubKeyPut(ctx, pubKey).PeeringTrustedNode(peeringTrustedNode).Execute() + +Trust the specified peer, the pub key is passed via the path. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pubKey := "pubKey_example" // string | Public key of the trusted peer (hex). + peeringTrustedNode := *openapiclient.NewPeeringTrustedNode() // PeeringTrustedNode | Info of the peer to trust. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyPut(context.Background(), pubKey).PeeringTrustedNode(peeringTrustedNode).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPubKeyPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AdmPeeringTrustedPubKeyPut`: PeeringTrustedNode + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedPubKeyPut`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pubKey** | **string** | Public key of the trusted peer (hex). | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmPeeringTrustedPubKeyPutRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **peeringTrustedNode** | [**PeeringTrustedNode**](PeeringTrustedNode.md) | Info of the peer to trust. | + +### Return type + +[**PeeringTrustedNode**](PeeringTrustedNode.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## AdmShutdownGet + +> AdmShutdownGet(ctx).Execute() + +Shut down the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AdminApi.AdmShutdownGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmShutdownGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiAdmShutdownGetRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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/clients/apiclient/docs/ChainMetrics.md b/clients/apiclient/docs/ChainMetrics.md index c29f2bdcc3..e66c028b65 100644 --- a/clients/apiclient/docs/ChainMetrics.md +++ b/clients/apiclient/docs/ChainMetrics.md @@ -5,20 +5,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **InAliasOutput** | [**AliasOutputMetricItem**](AliasOutputMetricItem.md) | | +**InMilestone** | [**MilestoneMetricItem**](MilestoneMetricItem.md) | | **InOnLedgerRequest** | [**OnLedgerRequestMetricItem**](OnLedgerRequestMetricItem.md) | | **InOutput** | [**InOutputMetricItem**](InOutputMetricItem.md) | | **InStateOutput** | [**InStateOutputMetricItem**](InStateOutputMetricItem.md) | | **InTxInclusionState** | [**TxInclusionStateMsgMetricItem**](TxInclusionStateMsgMetricItem.md) | | **OutPublishGovernanceTransaction** | [**TransactionMetricItem**](TransactionMetricItem.md) | | +**OutPublisherStateTransaction** | [**PublisherStateTransactionItem**](PublisherStateTransactionItem.md) | | **OutPullLatestOutput** | [**InterfaceMetricItem**](InterfaceMetricItem.md) | | **OutPullOutputByID** | [**UTXOInputMetricItem**](UTXOInputMetricItem.md) | | **OutPullTxInclusionState** | [**TransactionIDMetricItem**](TransactionIDMetricItem.md) | | +**RegisteredChainIDs** | **[]string** | | ## Methods ### NewChainMetrics -`func NewChainMetrics(inAliasOutput AliasOutputMetricItem, inOnLedgerRequest OnLedgerRequestMetricItem, inOutput InOutputMetricItem, inStateOutput InStateOutputMetricItem, inTxInclusionState TxInclusionStateMsgMetricItem, outPublishGovernanceTransaction TransactionMetricItem, outPullLatestOutput InterfaceMetricItem, outPullOutputByID UTXOInputMetricItem, outPullTxInclusionState TransactionIDMetricItem, ) *ChainMetrics` +`func NewChainMetrics(inAliasOutput AliasOutputMetricItem, inMilestone MilestoneMetricItem, inOnLedgerRequest OnLedgerRequestMetricItem, inOutput InOutputMetricItem, inStateOutput InStateOutputMetricItem, inTxInclusionState TxInclusionStateMsgMetricItem, outPublishGovernanceTransaction TransactionMetricItem, outPublisherStateTransaction PublisherStateTransactionItem, outPullLatestOutput InterfaceMetricItem, outPullOutputByID UTXOInputMetricItem, outPullTxInclusionState TransactionIDMetricItem, registeredChainIDs []string, ) *ChainMetrics` NewChainMetrics instantiates a new ChainMetrics object This constructor will assign default values to properties that have it defined, @@ -53,6 +56,26 @@ and a boolean to check if the value has been set. SetInAliasOutput sets InAliasOutput field to given value. +### GetInMilestone + +`func (o *ChainMetrics) GetInMilestone() MilestoneMetricItem` + +GetInMilestone returns the InMilestone field if non-nil, zero value otherwise. + +### GetInMilestoneOk + +`func (o *ChainMetrics) GetInMilestoneOk() (*MilestoneMetricItem, bool)` + +GetInMilestoneOk returns a tuple with the InMilestone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInMilestone + +`func (o *ChainMetrics) SetInMilestone(v MilestoneMetricItem)` + +SetInMilestone sets InMilestone field to given value. + + ### GetInOnLedgerRequest `func (o *ChainMetrics) GetInOnLedgerRequest() OnLedgerRequestMetricItem` @@ -153,6 +176,26 @@ and a boolean to check if the value has been set. SetOutPublishGovernanceTransaction sets OutPublishGovernanceTransaction field to given value. +### GetOutPublisherStateTransaction + +`func (o *ChainMetrics) GetOutPublisherStateTransaction() PublisherStateTransactionItem` + +GetOutPublisherStateTransaction returns the OutPublisherStateTransaction field if non-nil, zero value otherwise. + +### GetOutPublisherStateTransactionOk + +`func (o *ChainMetrics) GetOutPublisherStateTransactionOk() (*PublisherStateTransactionItem, bool)` + +GetOutPublisherStateTransactionOk returns a tuple with the OutPublisherStateTransaction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPublisherStateTransaction + +`func (o *ChainMetrics) SetOutPublisherStateTransaction(v PublisherStateTransactionItem)` + +SetOutPublisherStateTransaction sets OutPublisherStateTransaction field to given value. + + ### GetOutPullLatestOutput `func (o *ChainMetrics) GetOutPullLatestOutput() InterfaceMetricItem` @@ -213,6 +256,26 @@ and a boolean to check if the value has been set. SetOutPullTxInclusionState sets OutPullTxInclusionState field to given value. +### GetRegisteredChainIDs + +`func (o *ChainMetrics) GetRegisteredChainIDs() []string` + +GetRegisteredChainIDs returns the RegisteredChainIDs field if non-nil, zero value otherwise. + +### GetRegisteredChainIDsOk + +`func (o *ChainMetrics) GetRegisteredChainIDsOk() (*[]string, bool)` + +GetRegisteredChainIDsOk returns a tuple with the RegisteredChainIDs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegisteredChainIDs + +`func (o *ChainMetrics) SetRegisteredChainIDs(v []string)` + +SetRegisteredChainIDs sets RegisteredChainIDs field to given value. + + [[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/clients/apiclient/docs/ChainRecord.md b/clients/apiclient/docs/ChainRecord.md new file mode 100644 index 0000000000..295a7cb409 --- /dev/null +++ b/clients/apiclient/docs/ChainRecord.md @@ -0,0 +1,108 @@ +# ChainRecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessNodes** | Pointer to **[]string** | | [optional] +**Active** | Pointer to **bool** | Whether or not the chain is active | [optional] +**ChainId** | Pointer to **string** | ChainID (bech32) | [optional] + +## Methods + +### NewChainRecord + +`func NewChainRecord() *ChainRecord` + +NewChainRecord instantiates a new ChainRecord object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChainRecordWithDefaults + +`func NewChainRecordWithDefaults() *ChainRecord` + +NewChainRecordWithDefaults instantiates a new ChainRecord object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessNodes + +`func (o *ChainRecord) GetAccessNodes() []string` + +GetAccessNodes returns the AccessNodes field if non-nil, zero value otherwise. + +### GetAccessNodesOk + +`func (o *ChainRecord) GetAccessNodesOk() (*[]string, bool)` + +GetAccessNodesOk returns a tuple with the AccessNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessNodes + +`func (o *ChainRecord) SetAccessNodes(v []string)` + +SetAccessNodes sets AccessNodes field to given value. + +### HasAccessNodes + +`func (o *ChainRecord) HasAccessNodes() bool` + +HasAccessNodes returns a boolean if a field has been set. + +### GetActive + +`func (o *ChainRecord) GetActive() bool` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *ChainRecord) GetActiveOk() (*bool, bool)` + +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActive + +`func (o *ChainRecord) SetActive(v bool)` + +SetActive sets Active field to given value. + +### HasActive + +`func (o *ChainRecord) HasActive() bool` + +HasActive returns a boolean if a field has been set. + +### GetChainId + +`func (o *ChainRecord) GetChainId() string` + +GetChainId returns the ChainId field if non-nil, zero value otherwise. + +### GetChainIdOk + +`func (o *ChainRecord) GetChainIdOk() (*string, bool)` + +GetChainIdOk returns a tuple with the ChainId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainId + +`func (o *ChainRecord) SetChainId(v string)` + +SetChainId sets ChainId field to given value. + +### HasChainId + +`func (o *ChainRecord) HasChainId() bool` + +HasChainId returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/ConsensusWorkflowStatus.md b/clients/apiclient/docs/ConsensusWorkflowStatus.md new file mode 100644 index 0000000000..3b6232aadf --- /dev/null +++ b/clients/apiclient/docs/ConsensusWorkflowStatus.md @@ -0,0 +1,498 @@ +# ConsensusWorkflowStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CurrentStateIndex** | Pointer to **int32** | Shows current state index of the consensus | [optional] +**FlagBatchProposalSent** | Pointer to **bool** | Shows if batch proposal is sent out in current consensus iteration | [optional] +**FlagConsensusBatchKnown** | Pointer to **bool** | Shows if consensus on batch is reached and known in current consensus iteration | [optional] +**FlagInProgress** | Pointer to **bool** | Shows if consensus algorithm is still not completed in current consensus iteration | [optional] +**FlagStateReceived** | Pointer to **bool** | Shows if state output is received in current consensus iteration | [optional] +**FlagTransactionFinalized** | Pointer to **bool** | Shows if consensus on transaction is reached in current consensus iteration | [optional] +**FlagTransactionPosted** | Pointer to **bool** | Shows if transaction is posted to L1 in current consensus iteration | [optional] +**FlagTransactionSeen** | Pointer to **bool** | Shows if L1 reported that it has seen the transaction of current consensus iteration | [optional] +**FlagVMResultSigned** | Pointer to **bool** | Shows if virtual machine has returned its results in current consensus iteration | [optional] +**FlagVMStarted** | Pointer to **bool** | Shows if virtual machine is started in current consensus iteration | [optional] +**TimeBatchProposalSent** | Pointer to **time.Time** | Shows when batch proposal was last sent out in current consensus iteration | [optional] +**TimeCompleted** | Pointer to **time.Time** | Shows when algorithm was last completed in current consensus iteration | [optional] +**TimeConsensusBatchKnown** | Pointer to **time.Time** | Shows when ACS results of consensus on batch was last received in current consensus iteration | [optional] +**TimeTransactionFinalized** | Pointer to **time.Time** | Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration | [optional] +**TimeTransactionPosted** | Pointer to **time.Time** | Shows when transaction was last posted to L1 in current consensus iteration | [optional] +**TimeTransactionSeen** | Pointer to **time.Time** | Shows when algorithm last noted that transaction hadd been seen by L1 in current consensus iteration | [optional] +**TimeVMResultSigned** | Pointer to **time.Time** | Shows when virtual machine results were last received and signed in current consensus iteration | [optional] +**TimeVMStarted** | Pointer to **time.Time** | Shows when virtual machine was last started in current consensus iteration | [optional] + +## Methods + +### NewConsensusWorkflowStatus + +`func NewConsensusWorkflowStatus() *ConsensusWorkflowStatus` + +NewConsensusWorkflowStatus instantiates a new ConsensusWorkflowStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConsensusWorkflowStatusWithDefaults + +`func NewConsensusWorkflowStatusWithDefaults() *ConsensusWorkflowStatus` + +NewConsensusWorkflowStatusWithDefaults instantiates a new ConsensusWorkflowStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrentStateIndex + +`func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() int32` + +GetCurrentStateIndex returns the CurrentStateIndex field if non-nil, zero value otherwise. + +### GetCurrentStateIndexOk + +`func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*int32, bool)` + +GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrentStateIndex + +`func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v int32)` + +SetCurrentStateIndex sets CurrentStateIndex field to given value. + +### HasCurrentStateIndex + +`func (o *ConsensusWorkflowStatus) HasCurrentStateIndex() bool` + +HasCurrentStateIndex returns a boolean if a field has been set. + +### GetFlagBatchProposalSent + +`func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSent() bool` + +GetFlagBatchProposalSent returns the FlagBatchProposalSent field if non-nil, zero value otherwise. + +### GetFlagBatchProposalSentOk + +`func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSentOk() (*bool, bool)` + +GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagBatchProposalSent + +`func (o *ConsensusWorkflowStatus) SetFlagBatchProposalSent(v bool)` + +SetFlagBatchProposalSent sets FlagBatchProposalSent field to given value. + +### HasFlagBatchProposalSent + +`func (o *ConsensusWorkflowStatus) HasFlagBatchProposalSent() bool` + +HasFlagBatchProposalSent returns a boolean if a field has been set. + +### GetFlagConsensusBatchKnown + +`func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnown() bool` + +GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field if non-nil, zero value otherwise. + +### GetFlagConsensusBatchKnownOk + +`func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnownOk() (*bool, bool)` + +GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagConsensusBatchKnown + +`func (o *ConsensusWorkflowStatus) SetFlagConsensusBatchKnown(v bool)` + +SetFlagConsensusBatchKnown sets FlagConsensusBatchKnown field to given value. + +### HasFlagConsensusBatchKnown + +`func (o *ConsensusWorkflowStatus) HasFlagConsensusBatchKnown() bool` + +HasFlagConsensusBatchKnown returns a boolean if a field has been set. + +### GetFlagInProgress + +`func (o *ConsensusWorkflowStatus) GetFlagInProgress() bool` + +GetFlagInProgress returns the FlagInProgress field if non-nil, zero value otherwise. + +### GetFlagInProgressOk + +`func (o *ConsensusWorkflowStatus) GetFlagInProgressOk() (*bool, bool)` + +GetFlagInProgressOk returns a tuple with the FlagInProgress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagInProgress + +`func (o *ConsensusWorkflowStatus) SetFlagInProgress(v bool)` + +SetFlagInProgress sets FlagInProgress field to given value. + +### HasFlagInProgress + +`func (o *ConsensusWorkflowStatus) HasFlagInProgress() bool` + +HasFlagInProgress returns a boolean if a field has been set. + +### GetFlagStateReceived + +`func (o *ConsensusWorkflowStatus) GetFlagStateReceived() bool` + +GetFlagStateReceived returns the FlagStateReceived field if non-nil, zero value otherwise. + +### GetFlagStateReceivedOk + +`func (o *ConsensusWorkflowStatus) GetFlagStateReceivedOk() (*bool, bool)` + +GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagStateReceived + +`func (o *ConsensusWorkflowStatus) SetFlagStateReceived(v bool)` + +SetFlagStateReceived sets FlagStateReceived field to given value. + +### HasFlagStateReceived + +`func (o *ConsensusWorkflowStatus) HasFlagStateReceived() bool` + +HasFlagStateReceived returns a boolean if a field has been set. + +### GetFlagTransactionFinalized + +`func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalized() bool` + +GetFlagTransactionFinalized returns the FlagTransactionFinalized field if non-nil, zero value otherwise. + +### GetFlagTransactionFinalizedOk + +`func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalizedOk() (*bool, bool)` + +GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagTransactionFinalized + +`func (o *ConsensusWorkflowStatus) SetFlagTransactionFinalized(v bool)` + +SetFlagTransactionFinalized sets FlagTransactionFinalized field to given value. + +### HasFlagTransactionFinalized + +`func (o *ConsensusWorkflowStatus) HasFlagTransactionFinalized() bool` + +HasFlagTransactionFinalized returns a boolean if a field has been set. + +### GetFlagTransactionPosted + +`func (o *ConsensusWorkflowStatus) GetFlagTransactionPosted() bool` + +GetFlagTransactionPosted returns the FlagTransactionPosted field if non-nil, zero value otherwise. + +### GetFlagTransactionPostedOk + +`func (o *ConsensusWorkflowStatus) GetFlagTransactionPostedOk() (*bool, bool)` + +GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagTransactionPosted + +`func (o *ConsensusWorkflowStatus) SetFlagTransactionPosted(v bool)` + +SetFlagTransactionPosted sets FlagTransactionPosted field to given value. + +### HasFlagTransactionPosted + +`func (o *ConsensusWorkflowStatus) HasFlagTransactionPosted() bool` + +HasFlagTransactionPosted returns a boolean if a field has been set. + +### GetFlagTransactionSeen + +`func (o *ConsensusWorkflowStatus) GetFlagTransactionSeen() bool` + +GetFlagTransactionSeen returns the FlagTransactionSeen field if non-nil, zero value otherwise. + +### GetFlagTransactionSeenOk + +`func (o *ConsensusWorkflowStatus) GetFlagTransactionSeenOk() (*bool, bool)` + +GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagTransactionSeen + +`func (o *ConsensusWorkflowStatus) SetFlagTransactionSeen(v bool)` + +SetFlagTransactionSeen sets FlagTransactionSeen field to given value. + +### HasFlagTransactionSeen + +`func (o *ConsensusWorkflowStatus) HasFlagTransactionSeen() bool` + +HasFlagTransactionSeen returns a boolean if a field has been set. + +### GetFlagVMResultSigned + +`func (o *ConsensusWorkflowStatus) GetFlagVMResultSigned() bool` + +GetFlagVMResultSigned returns the FlagVMResultSigned field if non-nil, zero value otherwise. + +### GetFlagVMResultSignedOk + +`func (o *ConsensusWorkflowStatus) GetFlagVMResultSignedOk() (*bool, bool)` + +GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagVMResultSigned + +`func (o *ConsensusWorkflowStatus) SetFlagVMResultSigned(v bool)` + +SetFlagVMResultSigned sets FlagVMResultSigned field to given value. + +### HasFlagVMResultSigned + +`func (o *ConsensusWorkflowStatus) HasFlagVMResultSigned() bool` + +HasFlagVMResultSigned returns a boolean if a field has been set. + +### GetFlagVMStarted + +`func (o *ConsensusWorkflowStatus) GetFlagVMStarted() bool` + +GetFlagVMStarted returns the FlagVMStarted field if non-nil, zero value otherwise. + +### GetFlagVMStartedOk + +`func (o *ConsensusWorkflowStatus) GetFlagVMStartedOk() (*bool, bool)` + +GetFlagVMStartedOk returns a tuple with the FlagVMStarted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFlagVMStarted + +`func (o *ConsensusWorkflowStatus) SetFlagVMStarted(v bool)` + +SetFlagVMStarted sets FlagVMStarted field to given value. + +### HasFlagVMStarted + +`func (o *ConsensusWorkflowStatus) HasFlagVMStarted() bool` + +HasFlagVMStarted returns a boolean if a field has been set. + +### GetTimeBatchProposalSent + +`func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSent() time.Time` + +GetTimeBatchProposalSent returns the TimeBatchProposalSent field if non-nil, zero value otherwise. + +### GetTimeBatchProposalSentOk + +`func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSentOk() (*time.Time, bool)` + +GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeBatchProposalSent + +`func (o *ConsensusWorkflowStatus) SetTimeBatchProposalSent(v time.Time)` + +SetTimeBatchProposalSent sets TimeBatchProposalSent field to given value. + +### HasTimeBatchProposalSent + +`func (o *ConsensusWorkflowStatus) HasTimeBatchProposalSent() bool` + +HasTimeBatchProposalSent returns a boolean if a field has been set. + +### GetTimeCompleted + +`func (o *ConsensusWorkflowStatus) GetTimeCompleted() time.Time` + +GetTimeCompleted returns the TimeCompleted field if non-nil, zero value otherwise. + +### GetTimeCompletedOk + +`func (o *ConsensusWorkflowStatus) GetTimeCompletedOk() (*time.Time, bool)` + +GetTimeCompletedOk returns a tuple with the TimeCompleted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeCompleted + +`func (o *ConsensusWorkflowStatus) SetTimeCompleted(v time.Time)` + +SetTimeCompleted sets TimeCompleted field to given value. + +### HasTimeCompleted + +`func (o *ConsensusWorkflowStatus) HasTimeCompleted() bool` + +HasTimeCompleted returns a boolean if a field has been set. + +### GetTimeConsensusBatchKnown + +`func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnown() time.Time` + +GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field if non-nil, zero value otherwise. + +### GetTimeConsensusBatchKnownOk + +`func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnownOk() (*time.Time, bool)` + +GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeConsensusBatchKnown + +`func (o *ConsensusWorkflowStatus) SetTimeConsensusBatchKnown(v time.Time)` + +SetTimeConsensusBatchKnown sets TimeConsensusBatchKnown field to given value. + +### HasTimeConsensusBatchKnown + +`func (o *ConsensusWorkflowStatus) HasTimeConsensusBatchKnown() bool` + +HasTimeConsensusBatchKnown returns a boolean if a field has been set. + +### GetTimeTransactionFinalized + +`func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalized() time.Time` + +GetTimeTransactionFinalized returns the TimeTransactionFinalized field if non-nil, zero value otherwise. + +### GetTimeTransactionFinalizedOk + +`func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalizedOk() (*time.Time, bool)` + +GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeTransactionFinalized + +`func (o *ConsensusWorkflowStatus) SetTimeTransactionFinalized(v time.Time)` + +SetTimeTransactionFinalized sets TimeTransactionFinalized field to given value. + +### HasTimeTransactionFinalized + +`func (o *ConsensusWorkflowStatus) HasTimeTransactionFinalized() bool` + +HasTimeTransactionFinalized returns a boolean if a field has been set. + +### GetTimeTransactionPosted + +`func (o *ConsensusWorkflowStatus) GetTimeTransactionPosted() time.Time` + +GetTimeTransactionPosted returns the TimeTransactionPosted field if non-nil, zero value otherwise. + +### GetTimeTransactionPostedOk + +`func (o *ConsensusWorkflowStatus) GetTimeTransactionPostedOk() (*time.Time, bool)` + +GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeTransactionPosted + +`func (o *ConsensusWorkflowStatus) SetTimeTransactionPosted(v time.Time)` + +SetTimeTransactionPosted sets TimeTransactionPosted field to given value. + +### HasTimeTransactionPosted + +`func (o *ConsensusWorkflowStatus) HasTimeTransactionPosted() bool` + +HasTimeTransactionPosted returns a boolean if a field has been set. + +### GetTimeTransactionSeen + +`func (o *ConsensusWorkflowStatus) GetTimeTransactionSeen() time.Time` + +GetTimeTransactionSeen returns the TimeTransactionSeen field if non-nil, zero value otherwise. + +### GetTimeTransactionSeenOk + +`func (o *ConsensusWorkflowStatus) GetTimeTransactionSeenOk() (*time.Time, bool)` + +GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeTransactionSeen + +`func (o *ConsensusWorkflowStatus) SetTimeTransactionSeen(v time.Time)` + +SetTimeTransactionSeen sets TimeTransactionSeen field to given value. + +### HasTimeTransactionSeen + +`func (o *ConsensusWorkflowStatus) HasTimeTransactionSeen() bool` + +HasTimeTransactionSeen returns a boolean if a field has been set. + +### GetTimeVMResultSigned + +`func (o *ConsensusWorkflowStatus) GetTimeVMResultSigned() time.Time` + +GetTimeVMResultSigned returns the TimeVMResultSigned field if non-nil, zero value otherwise. + +### GetTimeVMResultSignedOk + +`func (o *ConsensusWorkflowStatus) GetTimeVMResultSignedOk() (*time.Time, bool)` + +GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeVMResultSigned + +`func (o *ConsensusWorkflowStatus) SetTimeVMResultSigned(v time.Time)` + +SetTimeVMResultSigned sets TimeVMResultSigned field to given value. + +### HasTimeVMResultSigned + +`func (o *ConsensusWorkflowStatus) HasTimeVMResultSigned() bool` + +HasTimeVMResultSigned returns a boolean if a field has been set. + +### GetTimeVMStarted + +`func (o *ConsensusWorkflowStatus) GetTimeVMStarted() time.Time` + +GetTimeVMStarted returns the TimeVMStarted field if non-nil, zero value otherwise. + +### GetTimeVMStartedOk + +`func (o *ConsensusWorkflowStatus) GetTimeVMStartedOk() (*time.Time, bool)` + +GetTimeVMStartedOk returns a tuple with the TimeVMStarted field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeVMStarted + +`func (o *ConsensusWorkflowStatus) SetTimeVMStarted(v time.Time)` + +SetTimeVMStarted sets TimeVMStarted field to given value. + +### HasTimeVMStarted + +`func (o *ConsensusWorkflowStatus) HasTimeVMStarted() bool` + +HasTimeVMStarted returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/MilestoneInfo.md b/clients/apiclient/docs/MilestoneInfo.md new file mode 100644 index 0000000000..c2845fce4b --- /dev/null +++ b/clients/apiclient/docs/MilestoneInfo.md @@ -0,0 +1,108 @@ +# MilestoneInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Index** | Pointer to **int32** | | [optional] +**MilestoneId** | Pointer to **string** | | [optional] +**Timestamp** | Pointer to **int32** | | [optional] + +## Methods + +### NewMilestoneInfo + +`func NewMilestoneInfo() *MilestoneInfo` + +NewMilestoneInfo instantiates a new MilestoneInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMilestoneInfoWithDefaults + +`func NewMilestoneInfoWithDefaults() *MilestoneInfo` + +NewMilestoneInfoWithDefaults instantiates a new MilestoneInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIndex + +`func (o *MilestoneInfo) GetIndex() int32` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *MilestoneInfo) GetIndexOk() (*int32, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *MilestoneInfo) SetIndex(v int32)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *MilestoneInfo) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetMilestoneId + +`func (o *MilestoneInfo) GetMilestoneId() string` + +GetMilestoneId returns the MilestoneId field if non-nil, zero value otherwise. + +### GetMilestoneIdOk + +`func (o *MilestoneInfo) GetMilestoneIdOk() (*string, bool)` + +GetMilestoneIdOk returns a tuple with the MilestoneId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMilestoneId + +`func (o *MilestoneInfo) SetMilestoneId(v string)` + +SetMilestoneId sets MilestoneId field to given value. + +### HasMilestoneId + +`func (o *MilestoneInfo) HasMilestoneId() bool` + +HasMilestoneId returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *MilestoneInfo) GetTimestamp() int32` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *MilestoneInfo) GetTimestampOk() (*int32, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *MilestoneInfo) SetTimestamp(v int32)` + +SetTimestamp sets Timestamp field to given value. + +### HasTimestamp + +`func (o *MilestoneInfo) HasTimestamp() bool` + +HasTimestamp returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/MilestoneMetricItem.md b/clients/apiclient/docs/MilestoneMetricItem.md new file mode 100644 index 0000000000..b0dc15959e --- /dev/null +++ b/clients/apiclient/docs/MilestoneMetricItem.md @@ -0,0 +1,93 @@ +# MilestoneMetricItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | [**MilestoneInfo**](MilestoneInfo.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | + +## Methods + +### NewMilestoneMetricItem + +`func NewMilestoneMetricItem(lastMessage MilestoneInfo, messages uint32, timestamp time.Time, ) *MilestoneMetricItem` + +NewMilestoneMetricItem instantiates a new MilestoneMetricItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMilestoneMetricItemWithDefaults + +`func NewMilestoneMetricItemWithDefaults() *MilestoneMetricItem` + +NewMilestoneMetricItemWithDefaults instantiates a new MilestoneMetricItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *MilestoneMetricItem) GetLastMessage() MilestoneInfo` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *MilestoneMetricItem) GetLastMessageOk() (*MilestoneInfo, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *MilestoneMetricItem) SetLastMessage(v MilestoneInfo)` + +SetLastMessage sets LastMessage field to given value. + + +### GetMessages + +`func (o *MilestoneMetricItem) GetMessages() uint32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *MilestoneMetricItem) GetMessagesOk() (*uint32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *MilestoneMetricItem) SetMessages(v uint32)` + +SetMessages sets Messages field to given value. + + +### GetTimestamp + +`func (o *MilestoneMetricItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *MilestoneMetricItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *MilestoneMetricItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + + + +[[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/clients/apiclient/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md index 4ad15a0fb8..73834d05fa 100644 --- a/clients/apiclient/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -83,7 +83,7 @@ Name | Type | Description | Notes ## GenerateDKS -> DKSharesPostRequest GenerateDKS(ctx).DKSharesPostRequest(dKSharesPostRequest).Execute() +> DKSharesInfo GenerateDKS(ctx).DKSharesPostRequest(dKSharesPostRequest).Execute() Generate a new distributed key @@ -109,7 +109,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GenerateDKS``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GenerateDKS`: DKSharesPostRequest + // response from `GenerateDKS`: DKSharesInfo fmt.Fprintf(os.Stdout, "Response from `NodeApi.GenerateDKS`: %v\n", resp) } ``` @@ -129,7 +129,7 @@ Name | Type | Description | Notes ### Return type -[**DKSharesPostRequest**](DKSharesPostRequest.md) +[**DKSharesInfo**](DKSharesInfo.md) ### Authorization @@ -569,7 +569,7 @@ No authorization required ## SetNodeOwner -> SetNodeOwner(ctx).NodeOwnerCertificateRequest(nodeOwnerCertificateRequest).Execute() +> NodeOwnerCertificateResponse SetNodeOwner(ctx).NodeOwnerCertificateRequest(nodeOwnerCertificateRequest).Execute() Sets the node owner @@ -595,6 +595,8 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.SetNodeOwner``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `SetNodeOwner`: NodeOwnerCertificateResponse + fmt.Fprintf(os.Stdout, "Response from `NodeApi.SetNodeOwner`: %v\n", resp) } ``` @@ -613,7 +615,7 @@ Name | Type | Description | Notes ### Return type - (empty response body) +[**NodeOwnerCertificateResponse**](NodeOwnerCertificateResponse.md) ### Authorization diff --git a/clients/apiclient/docs/NodeConnectionMessageMetrics.md b/clients/apiclient/docs/NodeConnectionMessageMetrics.md new file mode 100644 index 0000000000..e284226063 --- /dev/null +++ b/clients/apiclient/docs/NodeConnectionMessageMetrics.md @@ -0,0 +1,108 @@ +# NodeConnectionMessageMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastEvent** | Pointer to **time.Time** | Last time the message was sent/received | [optional] +**LastMessage** | Pointer to **string** | The print out of the last message | [optional] +**Total** | Pointer to **int32** | Total number of messages sent/received | [optional] + +## Methods + +### NewNodeConnectionMessageMetrics + +`func NewNodeConnectionMessageMetrics() *NodeConnectionMessageMetrics` + +NewNodeConnectionMessageMetrics instantiates a new NodeConnectionMessageMetrics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNodeConnectionMessageMetricsWithDefaults + +`func NewNodeConnectionMessageMetricsWithDefaults() *NodeConnectionMessageMetrics` + +NewNodeConnectionMessageMetricsWithDefaults instantiates a new NodeConnectionMessageMetrics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastEvent + +`func (o *NodeConnectionMessageMetrics) GetLastEvent() time.Time` + +GetLastEvent returns the LastEvent field if non-nil, zero value otherwise. + +### GetLastEventOk + +`func (o *NodeConnectionMessageMetrics) GetLastEventOk() (*time.Time, bool)` + +GetLastEventOk returns a tuple with the LastEvent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastEvent + +`func (o *NodeConnectionMessageMetrics) SetLastEvent(v time.Time)` + +SetLastEvent sets LastEvent field to given value. + +### HasLastEvent + +`func (o *NodeConnectionMessageMetrics) HasLastEvent() bool` + +HasLastEvent returns a boolean if a field has been set. + +### GetLastMessage + +`func (o *NodeConnectionMessageMetrics) GetLastMessage() string` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *NodeConnectionMessageMetrics) GetLastMessageOk() (*string, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *NodeConnectionMessageMetrics) SetLastMessage(v string)` + +SetLastMessage sets LastMessage field to given value. + +### HasLastMessage + +`func (o *NodeConnectionMessageMetrics) HasLastMessage() bool` + +HasLastMessage returns a boolean if a field has been set. + +### GetTotal + +`func (o *NodeConnectionMessageMetrics) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *NodeConnectionMessageMetrics) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *NodeConnectionMessageMetrics) SetTotal(v int32)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *NodeConnectionMessageMetrics) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/NodeConnectionMessagesMetrics.md b/clients/apiclient/docs/NodeConnectionMessagesMetrics.md new file mode 100644 index 0000000000..f59c72c350 --- /dev/null +++ b/clients/apiclient/docs/NodeConnectionMessagesMetrics.md @@ -0,0 +1,290 @@ +# NodeConnectionMessagesMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InAliasOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**InOnLedgerRequest** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**InOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**InStateOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**InTxInclusionState** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**OutPublishGovernanceTransaction** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**OutPublishStateTransaction** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**OutPullLatestOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**OutPullOutputByID** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**OutPullTxInclusionState** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] + +## Methods + +### NewNodeConnectionMessagesMetrics + +`func NewNodeConnectionMessagesMetrics() *NodeConnectionMessagesMetrics` + +NewNodeConnectionMessagesMetrics instantiates a new NodeConnectionMessagesMetrics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNodeConnectionMessagesMetricsWithDefaults + +`func NewNodeConnectionMessagesMetricsWithDefaults() *NodeConnectionMessagesMetrics` + +NewNodeConnectionMessagesMetricsWithDefaults instantiates a new NodeConnectionMessagesMetrics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInAliasOutput + +`func (o *NodeConnectionMessagesMetrics) GetInAliasOutput() NodeConnectionMessageMetrics` + +GetInAliasOutput returns the InAliasOutput field if non-nil, zero value otherwise. + +### GetInAliasOutputOk + +`func (o *NodeConnectionMessagesMetrics) GetInAliasOutputOk() (*NodeConnectionMessageMetrics, bool)` + +GetInAliasOutputOk returns a tuple with the InAliasOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInAliasOutput + +`func (o *NodeConnectionMessagesMetrics) SetInAliasOutput(v NodeConnectionMessageMetrics)` + +SetInAliasOutput sets InAliasOutput field to given value. + +### HasInAliasOutput + +`func (o *NodeConnectionMessagesMetrics) HasInAliasOutput() bool` + +HasInAliasOutput returns a boolean if a field has been set. + +### GetInOnLedgerRequest + +`func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequest() NodeConnectionMessageMetrics` + +GetInOnLedgerRequest returns the InOnLedgerRequest field if non-nil, zero value otherwise. + +### GetInOnLedgerRequestOk + +`func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequestOk() (*NodeConnectionMessageMetrics, bool)` + +GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInOnLedgerRequest + +`func (o *NodeConnectionMessagesMetrics) SetInOnLedgerRequest(v NodeConnectionMessageMetrics)` + +SetInOnLedgerRequest sets InOnLedgerRequest field to given value. + +### HasInOnLedgerRequest + +`func (o *NodeConnectionMessagesMetrics) HasInOnLedgerRequest() bool` + +HasInOnLedgerRequest returns a boolean if a field has been set. + +### GetInOutput + +`func (o *NodeConnectionMessagesMetrics) GetInOutput() NodeConnectionMessageMetrics` + +GetInOutput returns the InOutput field if non-nil, zero value otherwise. + +### GetInOutputOk + +`func (o *NodeConnectionMessagesMetrics) GetInOutputOk() (*NodeConnectionMessageMetrics, bool)` + +GetInOutputOk returns a tuple with the InOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInOutput + +`func (o *NodeConnectionMessagesMetrics) SetInOutput(v NodeConnectionMessageMetrics)` + +SetInOutput sets InOutput field to given value. + +### HasInOutput + +`func (o *NodeConnectionMessagesMetrics) HasInOutput() bool` + +HasInOutput returns a boolean if a field has been set. + +### GetInStateOutput + +`func (o *NodeConnectionMessagesMetrics) GetInStateOutput() NodeConnectionMessageMetrics` + +GetInStateOutput returns the InStateOutput field if non-nil, zero value otherwise. + +### GetInStateOutputOk + +`func (o *NodeConnectionMessagesMetrics) GetInStateOutputOk() (*NodeConnectionMessageMetrics, bool)` + +GetInStateOutputOk returns a tuple with the InStateOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInStateOutput + +`func (o *NodeConnectionMessagesMetrics) SetInStateOutput(v NodeConnectionMessageMetrics)` + +SetInStateOutput sets InStateOutput field to given value. + +### HasInStateOutput + +`func (o *NodeConnectionMessagesMetrics) HasInStateOutput() bool` + +HasInStateOutput returns a boolean if a field has been set. + +### GetInTxInclusionState + +`func (o *NodeConnectionMessagesMetrics) GetInTxInclusionState() NodeConnectionMessageMetrics` + +GetInTxInclusionState returns the InTxInclusionState field if non-nil, zero value otherwise. + +### GetInTxInclusionStateOk + +`func (o *NodeConnectionMessagesMetrics) GetInTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool)` + +GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInTxInclusionState + +`func (o *NodeConnectionMessagesMetrics) SetInTxInclusionState(v NodeConnectionMessageMetrics)` + +SetInTxInclusionState sets InTxInclusionState field to given value. + +### HasInTxInclusionState + +`func (o *NodeConnectionMessagesMetrics) HasInTxInclusionState() bool` + +HasInTxInclusionState returns a boolean if a field has been set. + +### GetOutPublishGovernanceTransaction + +`func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransaction() NodeConnectionMessageMetrics` + +GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field if non-nil, zero value otherwise. + +### GetOutPublishGovernanceTransactionOk + +`func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransactionOk() (*NodeConnectionMessageMetrics, bool)` + +GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPublishGovernanceTransaction + +`func (o *NodeConnectionMessagesMetrics) SetOutPublishGovernanceTransaction(v NodeConnectionMessageMetrics)` + +SetOutPublishGovernanceTransaction sets OutPublishGovernanceTransaction field to given value. + +### HasOutPublishGovernanceTransaction + +`func (o *NodeConnectionMessagesMetrics) HasOutPublishGovernanceTransaction() bool` + +HasOutPublishGovernanceTransaction returns a boolean if a field has been set. + +### GetOutPublishStateTransaction + +`func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransaction() NodeConnectionMessageMetrics` + +GetOutPublishStateTransaction returns the OutPublishStateTransaction field if non-nil, zero value otherwise. + +### GetOutPublishStateTransactionOk + +`func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransactionOk() (*NodeConnectionMessageMetrics, bool)` + +GetOutPublishStateTransactionOk returns a tuple with the OutPublishStateTransaction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPublishStateTransaction + +`func (o *NodeConnectionMessagesMetrics) SetOutPublishStateTransaction(v NodeConnectionMessageMetrics)` + +SetOutPublishStateTransaction sets OutPublishStateTransaction field to given value. + +### HasOutPublishStateTransaction + +`func (o *NodeConnectionMessagesMetrics) HasOutPublishStateTransaction() bool` + +HasOutPublishStateTransaction returns a boolean if a field has been set. + +### GetOutPullLatestOutput + +`func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutput() NodeConnectionMessageMetrics` + +GetOutPullLatestOutput returns the OutPullLatestOutput field if non-nil, zero value otherwise. + +### GetOutPullLatestOutputOk + +`func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutputOk() (*NodeConnectionMessageMetrics, bool)` + +GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPullLatestOutput + +`func (o *NodeConnectionMessagesMetrics) SetOutPullLatestOutput(v NodeConnectionMessageMetrics)` + +SetOutPullLatestOutput sets OutPullLatestOutput field to given value. + +### HasOutPullLatestOutput + +`func (o *NodeConnectionMessagesMetrics) HasOutPullLatestOutput() bool` + +HasOutPullLatestOutput returns a boolean if a field has been set. + +### GetOutPullOutputByID + +`func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByID() NodeConnectionMessageMetrics` + +GetOutPullOutputByID returns the OutPullOutputByID field if non-nil, zero value otherwise. + +### GetOutPullOutputByIDOk + +`func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByIDOk() (*NodeConnectionMessageMetrics, bool)` + +GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPullOutputByID + +`func (o *NodeConnectionMessagesMetrics) SetOutPullOutputByID(v NodeConnectionMessageMetrics)` + +SetOutPullOutputByID sets OutPullOutputByID field to given value. + +### HasOutPullOutputByID + +`func (o *NodeConnectionMessagesMetrics) HasOutPullOutputByID() bool` + +HasOutPullOutputByID returns a boolean if a field has been set. + +### GetOutPullTxInclusionState + +`func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionState() NodeConnectionMessageMetrics` + +GetOutPullTxInclusionState returns the OutPullTxInclusionState field if non-nil, zero value otherwise. + +### GetOutPullTxInclusionStateOk + +`func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool)` + +GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutPullTxInclusionState + +`func (o *NodeConnectionMessagesMetrics) SetOutPullTxInclusionState(v NodeConnectionMessageMetrics)` + +SetOutPullTxInclusionState sets OutPullTxInclusionState field to given value. + +### HasOutPullTxInclusionState + +`func (o *NodeConnectionMessagesMetrics) HasOutPullTxInclusionState() bool` + +HasOutPullTxInclusionState returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/NodeConnectionMetrics.md b/clients/apiclient/docs/NodeConnectionMetrics.md new file mode 100644 index 0000000000..fd7e035c0c --- /dev/null +++ b/clients/apiclient/docs/NodeConnectionMetrics.md @@ -0,0 +1,108 @@ +# NodeConnectionMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InMilestone** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] +**NodeConnectionMessagesMetrics** | Pointer to [**NodeConnectionMessagesMetrics**](NodeConnectionMessagesMetrics.md) | | [optional] +**Registered** | Pointer to **[]string** | Chain IDs of the chains registered to receiving L1 events | [optional] + +## Methods + +### NewNodeConnectionMetrics + +`func NewNodeConnectionMetrics() *NodeConnectionMetrics` + +NewNodeConnectionMetrics instantiates a new NodeConnectionMetrics object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNodeConnectionMetricsWithDefaults + +`func NewNodeConnectionMetricsWithDefaults() *NodeConnectionMetrics` + +NewNodeConnectionMetricsWithDefaults instantiates a new NodeConnectionMetrics object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInMilestone + +`func (o *NodeConnectionMetrics) GetInMilestone() NodeConnectionMessageMetrics` + +GetInMilestone returns the InMilestone field if non-nil, zero value otherwise. + +### GetInMilestoneOk + +`func (o *NodeConnectionMetrics) GetInMilestoneOk() (*NodeConnectionMessageMetrics, bool)` + +GetInMilestoneOk returns a tuple with the InMilestone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInMilestone + +`func (o *NodeConnectionMetrics) SetInMilestone(v NodeConnectionMessageMetrics)` + +SetInMilestone sets InMilestone field to given value. + +### HasInMilestone + +`func (o *NodeConnectionMetrics) HasInMilestone() bool` + +HasInMilestone returns a boolean if a field has been set. + +### GetNodeConnectionMessagesMetrics + +`func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetrics() NodeConnectionMessagesMetrics` + +GetNodeConnectionMessagesMetrics returns the NodeConnectionMessagesMetrics field if non-nil, zero value otherwise. + +### GetNodeConnectionMessagesMetricsOk + +`func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetricsOk() (*NodeConnectionMessagesMetrics, bool)` + +GetNodeConnectionMessagesMetricsOk returns a tuple with the NodeConnectionMessagesMetrics field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNodeConnectionMessagesMetrics + +`func (o *NodeConnectionMetrics) SetNodeConnectionMessagesMetrics(v NodeConnectionMessagesMetrics)` + +SetNodeConnectionMessagesMetrics sets NodeConnectionMessagesMetrics field to given value. + +### HasNodeConnectionMessagesMetrics + +`func (o *NodeConnectionMetrics) HasNodeConnectionMessagesMetrics() bool` + +HasNodeConnectionMessagesMetrics returns a boolean if a field has been set. + +### GetRegistered + +`func (o *NodeConnectionMetrics) GetRegistered() []string` + +GetRegistered returns the Registered field if non-nil, zero value otherwise. + +### GetRegisteredOk + +`func (o *NodeConnectionMetrics) GetRegisteredOk() (*[]string, bool)` + +GetRegisteredOk returns a tuple with the Registered field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegistered + +`func (o *NodeConnectionMetrics) SetRegistered(v []string)` + +SetRegistered sets Registered field to given value. + +### HasRegistered + +`func (o *NodeConnectionMetrics) HasRegistered() bool` + +HasRegistered returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/NodeOwnerCertificateResponse.md b/clients/apiclient/docs/NodeOwnerCertificateResponse.md new file mode 100644 index 0000000000..91f293c800 --- /dev/null +++ b/clients/apiclient/docs/NodeOwnerCertificateResponse.md @@ -0,0 +1,51 @@ +# NodeOwnerCertificateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Certificate** | **string** | Certificate stating the ownership. (Hex) | + +## Methods + +### NewNodeOwnerCertificateResponse + +`func NewNodeOwnerCertificateResponse(certificate string, ) *NodeOwnerCertificateResponse` + +NewNodeOwnerCertificateResponse instantiates a new NodeOwnerCertificateResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNodeOwnerCertificateResponseWithDefaults + +`func NewNodeOwnerCertificateResponseWithDefaults() *NodeOwnerCertificateResponse` + +NewNodeOwnerCertificateResponseWithDefaults instantiates a new NodeOwnerCertificateResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCertificate + +`func (o *NodeOwnerCertificateResponse) GetCertificate() string` + +GetCertificate returns the Certificate field if non-nil, zero value otherwise. + +### GetCertificateOk + +`func (o *NodeOwnerCertificateResponse) GetCertificateOk() (*string, bool)` + +GetCertificateOk returns a tuple with the Certificate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCertificate + +`func (o *NodeOwnerCertificateResponse) SetCertificate(v string)` + +SetCertificate sets Certificate field to given value. + + + +[[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/clients/apiclient/docs/OffLedgerRequestBody.md b/clients/apiclient/docs/OffLedgerRequestBody.md new file mode 100644 index 0000000000..b30c320031 --- /dev/null +++ b/clients/apiclient/docs/OffLedgerRequestBody.md @@ -0,0 +1,56 @@ +# OffLedgerRequestBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Request** | Pointer to **string** | Offledger Request (base64) | [optional] + +## Methods + +### NewOffLedgerRequestBody + +`func NewOffLedgerRequestBody() *OffLedgerRequestBody` + +NewOffLedgerRequestBody instantiates a new OffLedgerRequestBody object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOffLedgerRequestBodyWithDefaults + +`func NewOffLedgerRequestBodyWithDefaults() *OffLedgerRequestBody` + +NewOffLedgerRequestBodyWithDefaults instantiates a new OffLedgerRequestBody object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequest + +`func (o *OffLedgerRequestBody) GetRequest() string` + +GetRequest returns the Request field if non-nil, zero value otherwise. + +### GetRequestOk + +`func (o *OffLedgerRequestBody) GetRequestOk() (*string, bool)` + +GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequest + +`func (o *OffLedgerRequestBody) SetRequest(v string)` + +SetRequest sets Request field to given value. + +### HasRequest + +`func (o *OffLedgerRequestBody) HasRequest() bool` + +HasRequest returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/PeeringNodeStatus.md b/clients/apiclient/docs/PeeringNodeStatus.md new file mode 100644 index 0000000000..e5821ca4c8 --- /dev/null +++ b/clients/apiclient/docs/PeeringNodeStatus.md @@ -0,0 +1,134 @@ +# PeeringNodeStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsAlive** | Pointer to **bool** | | [optional] +**NetID** | Pointer to **string** | | [optional] +**NumUsers** | Pointer to **int32** | | [optional] +**PubKey** | Pointer to **string** | | [optional] + +## Methods + +### NewPeeringNodeStatus + +`func NewPeeringNodeStatus() *PeeringNodeStatus` + +NewPeeringNodeStatus instantiates a new PeeringNodeStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPeeringNodeStatusWithDefaults + +`func NewPeeringNodeStatusWithDefaults() *PeeringNodeStatus` + +NewPeeringNodeStatusWithDefaults instantiates a new PeeringNodeStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIsAlive + +`func (o *PeeringNodeStatus) GetIsAlive() bool` + +GetIsAlive returns the IsAlive field if non-nil, zero value otherwise. + +### GetIsAliveOk + +`func (o *PeeringNodeStatus) GetIsAliveOk() (*bool, bool)` + +GetIsAliveOk returns a tuple with the IsAlive field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsAlive + +`func (o *PeeringNodeStatus) SetIsAlive(v bool)` + +SetIsAlive sets IsAlive field to given value. + +### HasIsAlive + +`func (o *PeeringNodeStatus) HasIsAlive() bool` + +HasIsAlive returns a boolean if a field has been set. + +### GetNetID + +`func (o *PeeringNodeStatus) GetNetID() string` + +GetNetID returns the NetID field if non-nil, zero value otherwise. + +### GetNetIDOk + +`func (o *PeeringNodeStatus) GetNetIDOk() (*string, bool)` + +GetNetIDOk returns a tuple with the NetID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetID + +`func (o *PeeringNodeStatus) SetNetID(v string)` + +SetNetID sets NetID field to given value. + +### HasNetID + +`func (o *PeeringNodeStatus) HasNetID() bool` + +HasNetID returns a boolean if a field has been set. + +### GetNumUsers + +`func (o *PeeringNodeStatus) GetNumUsers() int32` + +GetNumUsers returns the NumUsers field if non-nil, zero value otherwise. + +### GetNumUsersOk + +`func (o *PeeringNodeStatus) GetNumUsersOk() (*int32, bool)` + +GetNumUsersOk returns a tuple with the NumUsers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumUsers + +`func (o *PeeringNodeStatus) SetNumUsers(v int32)` + +SetNumUsers sets NumUsers field to given value. + +### HasNumUsers + +`func (o *PeeringNodeStatus) HasNumUsers() bool` + +HasNumUsers returns a boolean if a field has been set. + +### GetPubKey + +`func (o *PeeringNodeStatus) GetPubKey() string` + +GetPubKey returns the PubKey field if non-nil, zero value otherwise. + +### GetPubKeyOk + +`func (o *PeeringNodeStatus) GetPubKeyOk() (*string, bool)` + +GetPubKeyOk returns a tuple with the PubKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPubKey + +`func (o *PeeringNodeStatus) SetPubKey(v string)` + +SetPubKey sets PubKey field to given value. + +### HasPubKey + +`func (o *PeeringNodeStatus) HasPubKey() bool` + +HasPubKey returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/PeeringTrustedNode.md b/clients/apiclient/docs/PeeringTrustedNode.md new file mode 100644 index 0000000000..9822d183bd --- /dev/null +++ b/clients/apiclient/docs/PeeringTrustedNode.md @@ -0,0 +1,82 @@ +# PeeringTrustedNode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NetId** | Pointer to **string** | NetID of a peer to trust. | [optional] +**PubKey** | Pointer to **string** | Public key of the NetID. | [optional] + +## Methods + +### NewPeeringTrustedNode + +`func NewPeeringTrustedNode() *PeeringTrustedNode` + +NewPeeringTrustedNode instantiates a new PeeringTrustedNode object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPeeringTrustedNodeWithDefaults + +`func NewPeeringTrustedNodeWithDefaults() *PeeringTrustedNode` + +NewPeeringTrustedNodeWithDefaults instantiates a new PeeringTrustedNode object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNetId + +`func (o *PeeringTrustedNode) GetNetId() string` + +GetNetId returns the NetId field if non-nil, zero value otherwise. + +### GetNetIdOk + +`func (o *PeeringTrustedNode) GetNetIdOk() (*string, bool)` + +GetNetIdOk returns a tuple with the NetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetId + +`func (o *PeeringTrustedNode) SetNetId(v string)` + +SetNetId sets NetId field to given value. + +### HasNetId + +`func (o *PeeringTrustedNode) HasNetId() bool` + +HasNetId returns a boolean if a field has been set. + +### GetPubKey + +`func (o *PeeringTrustedNode) GetPubKey() string` + +GetPubKey returns the PubKey field if non-nil, zero value otherwise. + +### GetPubKeyOk + +`func (o *PeeringTrustedNode) GetPubKeyOk() (*string, bool)` + +GetPubKeyOk returns a tuple with the PubKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPubKey + +`func (o *PeeringTrustedNode) SetPubKey(v string)` + +SetPubKey sets PubKey field to given value. + +### HasPubKey + +`func (o *PeeringTrustedNode) HasPubKey() bool` + +HasPubKey returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/PublicApi.md b/clients/apiclient/docs/PublicApi.md new file mode 100644 index 0000000000..4e1bfbc118 --- /dev/null +++ b/clients/apiclient/docs/PublicApi.md @@ -0,0 +1,802 @@ +# \PublicApi + +All URIs are relative to *http://localhost:9090* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ChainChainIDContractContractHnameCallviewFnameGet**](PublicApi.md#ChainChainIDContractContractHnameCallviewFnameGet) | **Get** /chain/{chainID}/contract/{contractHname}/callview/{fname} | Call a view function on a contract by name +[**ChainChainIDContractContractHnameCallviewFnamePost**](PublicApi.md#ChainChainIDContractContractHnameCallviewFnamePost) | **Post** /chain/{chainID}/contract/{contractHname}/callview/{fname} | Call a view function on a contract by name +[**ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet**](PublicApi.md#ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet) | **Get** /chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname} | Call a view function on a contract by Hname +[**ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost**](PublicApi.md#ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost) | **Post** /chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname} | Call a view function on a contract by Hname +[**ChainChainIDEvmReqidTxHashGet**](PublicApi.md#ChainChainIDEvmReqidTxHashGet) | **Get** /chain/{chainID}/evm/reqid/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**ChainChainIDRequestPost**](PublicApi.md#ChainChainIDRequestPost) | **Post** /chain/{chainID}/request | Post an off-ledger request +[**ChainChainIDRequestReqIDReceiptGet**](PublicApi.md#ChainChainIDRequestReqIDReceiptGet) | **Get** /chain/{chainID}/request/{reqID}/receipt | Get the processing status of a given request in the node +[**ChainChainIDRequestReqIDWaitGet**](PublicApi.md#ChainChainIDRequestReqIDWaitGet) | **Get** /chain/{chainID}/request/{reqID}/wait | Wait until the given request has been processed by the node +[**ChainChainIDStateKeyGet**](PublicApi.md#ChainChainIDStateKeyGet) | **Get** /chain/{chainID}/state/{key} | Fetch the raw value associated with the given key in the chain state +[**ChainChainIDWsGet**](PublicApi.md#ChainChainIDWsGet) | **Get** /chain/{chainID}/ws | +[**InfoGet**](PublicApi.md#InfoGet) | **Get** /info | Get information about the node + + + +## ChainChainIDContractContractHnameCallviewFnameGet + +> JSONDict ChainChainIDContractContractHnameCallviewFnameGet(ctx, chainID, contractHname, fname).Params(params).Execute() + +Call a view function on a contract by name + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID + contractHname := "contractHname_example" // string | Contract Hname + fname := "fname_example" // string | Function name + params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnameGet(context.Background(), chainID, contractHname, fname).Params(params).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewFnameGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDContractContractHnameCallviewFnameGet`: JSONDict + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewFnameGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID | +**contractHname** | **string** | Contract Hname | +**fname** | **string** | Function name | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewFnameGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **params** | [**JSONDict**](JSONDict.md) | Parameters | + +### Return type + +[**JSONDict**](JSONDict.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChainChainIDContractContractHnameCallviewFnamePost + +> JSONDict ChainChainIDContractContractHnameCallviewFnamePost(ctx, chainID, contractHname, fname).Params(params).Execute() + +Call a view function on a contract by name + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID + contractHname := "contractHname_example" // string | Contract Hname + fname := "fname_example" // string | Function name + params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnamePost(context.Background(), chainID, contractHname, fname).Params(params).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewFnamePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDContractContractHnameCallviewFnamePost`: JSONDict + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewFnamePost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID | +**contractHname** | **string** | Contract Hname | +**fname** | **string** | Function name | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewFnamePostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **params** | [**JSONDict**](JSONDict.md) | Parameters | + +### Return type + +[**JSONDict**](JSONDict.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet + +> JSONDict ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(ctx, chainID, contractHname, functionHname).Params(params).Execute() + +Call a view function on a contract by Hname + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID + contractHname := "contractHname_example" // string | Contract Hname + functionHname := "functionHname_example" // string | Function Hname + params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(context.Background(), chainID, contractHname, functionHname).Params(params).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet`: JSONDict + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID | +**contractHname** | **string** | Contract Hname | +**functionHname** | **string** | Function Hname | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **params** | [**JSONDict**](JSONDict.md) | Parameters | + +### Return type + +[**JSONDict**](JSONDict.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost + +> JSONDict ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(ctx, chainID, contractHname, functionHname).Params(params).Execute() + +Call a view function on a contract by Hname + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID + contractHname := "contractHname_example" // string | Contract Hname + functionHname := "functionHname_example" // string | Function Hname + params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(context.Background(), chainID, contractHname, functionHname).Params(params).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost`: JSONDict + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID | +**contractHname** | **string** | Contract Hname | +**functionHname** | **string** | Function Hname | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **params** | [**JSONDict**](JSONDict.md) | Parameters | + +### Return type + +[**JSONDict**](JSONDict.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChainChainIDEvmReqidTxHashGet + +> string ChainChainIDEvmReqidTxHashGet(ctx, chainID, txHash).Execute() + +Get the ISC request ID for the given Ethereum transaction hash + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32-encoded) + txHash := "txHash_example" // string | Transaction hash (hex-encoded) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDEvmReqidTxHashGet(context.Background(), chainID, txHash).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDEvmReqidTxHashGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDEvmReqidTxHashGet`: string + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDEvmReqidTxHashGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32-encoded) | +**txHash** | **string** | Transaction hash (hex-encoded) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDEvmReqidTxHashGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**string** + +### 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) + + +## ChainChainIDRequestPost + +> ChainChainIDRequestPost(ctx, chainID).Request(request).Execute() + +Post an off-ledger request + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | chainID + request := *openapiclient.NewOffLedgerRequestBody() // OffLedgerRequestBody | Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\" (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDRequestPost(context.Background(), chainID).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDRequestPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | chainID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDRequestPostRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **request** | [**OffLedgerRequestBody**](OffLedgerRequestBody.md) | Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\" | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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) + + +## ChainChainIDRequestReqIDReceiptGet + +> RequestReceiptResponse ChainChainIDRequestReqIDReceiptGet(ctx, chainID, reqID).Execute() + +Get the processing status of a given request in the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32) + reqID := "reqID_example" // string | Request ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDRequestReqIDReceiptGet(context.Background(), chainID, reqID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDRequestReqIDReceiptGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDRequestReqIDReceiptGet`: RequestReceiptResponse + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDRequestReqIDReceiptGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32) | +**reqID** | **string** | Request ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDRequestReqIDReceiptGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**RequestReceiptResponse**](RequestReceiptResponse.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) + + +## ChainChainIDRequestReqIDWaitGet + +> RequestReceiptResponse ChainChainIDRequestReqIDWaitGet(ctx, chainID, reqID).Params(params).Execute() + +Wait until the given request has been processed by the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32) + reqID := "reqID_example" // string | Request ID + params := *openapiclient.NewWaitRequestProcessedParams() // WaitRequestProcessedParams | Optional parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDRequestReqIDWaitGet(context.Background(), chainID, reqID).Params(params).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDRequestReqIDWaitGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDRequestReqIDWaitGet`: RequestReceiptResponse + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDRequestReqIDWaitGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32) | +**reqID** | **string** | Request ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDRequestReqIDWaitGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **params** | [**WaitRequestProcessedParams**](WaitRequestProcessedParams.md) | Optional parameters | + +### Return type + +[**RequestReceiptResponse**](RequestReceiptResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## ChainChainIDStateKeyGet + +> []int32 ChainChainIDStateKeyGet(ctx, chainID, key).Execute() + +Fetch the raw value associated with the given key in the chain state + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID + key := "key_example" // string | Key (hex-encoded) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDStateKeyGet(context.Background(), chainID, key).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDStateKeyGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainChainIDStateKeyGet`: []int32 + fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDStateKeyGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID | +**key** | **string** | Key (hex-encoded) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDStateKeyGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +**[]int32** + +### 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) + + +## ChainChainIDWsGet + +> ChainChainIDWsGet(ctx, chainID).Execute() + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (bech32-encoded) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.ChainChainIDWsGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDWsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (bech32-encoded) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainChainIDWsGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## InfoGet + +> InfoResponse InfoGet(ctx).Execute() + +Get information about the node + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicApi.InfoGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.InfoGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `InfoGet`: InfoResponse + fmt.Fprintf(os.Stdout, "Response from `PublicApi.InfoGet`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiInfoGetRequest struct via the builder pattern + + +### Return type + +[**InfoResponse**](InfoResponse.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/clients/apiclient/docs/PublisherStateTransactionItem.md b/clients/apiclient/docs/PublisherStateTransactionItem.md new file mode 100644 index 0000000000..68749aafbe --- /dev/null +++ b/clients/apiclient/docs/PublisherStateTransactionItem.md @@ -0,0 +1,93 @@ +# PublisherStateTransactionItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LastMessage** | [**StateTransaction**](StateTransaction.md) | | +**Messages** | **uint32** | | +**Timestamp** | **time.Time** | | + +## Methods + +### NewPublisherStateTransactionItem + +`func NewPublisherStateTransactionItem(lastMessage StateTransaction, messages uint32, timestamp time.Time, ) *PublisherStateTransactionItem` + +NewPublisherStateTransactionItem instantiates a new PublisherStateTransactionItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPublisherStateTransactionItemWithDefaults + +`func NewPublisherStateTransactionItemWithDefaults() *PublisherStateTransactionItem` + +NewPublisherStateTransactionItemWithDefaults instantiates a new PublisherStateTransactionItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLastMessage + +`func (o *PublisherStateTransactionItem) GetLastMessage() StateTransaction` + +GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. + +### GetLastMessageOk + +`func (o *PublisherStateTransactionItem) GetLastMessageOk() (*StateTransaction, bool)` + +GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastMessage + +`func (o *PublisherStateTransactionItem) SetLastMessage(v StateTransaction)` + +SetLastMessage sets LastMessage field to given value. + + +### GetMessages + +`func (o *PublisherStateTransactionItem) GetMessages() uint32` + +GetMessages returns the Messages field if non-nil, zero value otherwise. + +### GetMessagesOk + +`func (o *PublisherStateTransactionItem) GetMessagesOk() (*uint32, bool)` + +GetMessagesOk returns a tuple with the Messages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessages + +`func (o *PublisherStateTransactionItem) SetMessages(v uint32)` + +SetMessages sets Messages field to given value. + + +### GetTimestamp + +`func (o *PublisherStateTransactionItem) GetTimestamp() time.Time` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *PublisherStateTransactionItem) GetTimestampOk() (*time.Time, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimestamp + +`func (o *PublisherStateTransactionItem) SetTimestamp(v time.Time)` + +SetTimestamp sets Timestamp field to given value. + + + +[[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/clients/apiclient/docs/RequestsApi.md b/clients/apiclient/docs/RequestsApi.md index 27ad2c03ac..be802b138b 100644 --- a/clients/apiclient/docs/RequestsApi.md +++ b/clients/apiclient/docs/RequestsApi.md @@ -7,7 +7,7 @@ Method | HTTP request | Description [**CallView**](RequestsApi.md#CallView) | **Post** /v2requests/callview | Call a view function on a contract by Hname [**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID [**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2requests/offledger | Post an off-ledger request -[**WaitForTransaction**](RequestsApi.md#WaitForTransaction) | **Get** /v2chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /v2chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node @@ -210,9 +210,9 @@ No authorization required [[Back to README]](../README.md) -## WaitForTransaction +## WaitForRequest -> ReceiptResponse WaitForTransaction(ctx, chainID, requestID).Execute() +> ReceiptResponse WaitForRequest(ctx, chainID, requestID).Execute() Wait until the given request has been processed by the node @@ -234,13 +234,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.RequestsApi.WaitForTransaction(context.Background(), chainID, requestID).Execute() + resp, r, err := apiClient.RequestsApi.WaitForRequest(context.Background(), chainID, requestID).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.WaitForTransaction``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.WaitForRequest``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `WaitForTransaction`: ReceiptResponse - fmt.Fprintf(os.Stdout, "Response from `RequestsApi.WaitForTransaction`: %v\n", resp) + // response from `WaitForRequest`: ReceiptResponse + fmt.Fprintf(os.Stdout, "Response from `RequestsApi.WaitForRequest`: %v\n", resp) } ``` @@ -255,7 +255,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiWaitForTransactionRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiWaitForRequestRequest struct via the builder pattern Name | Type | Description | Notes diff --git a/clients/apiclient/docs/StateTransaction.md b/clients/apiclient/docs/StateTransaction.md new file mode 100644 index 0000000000..e9e4869736 --- /dev/null +++ b/clients/apiclient/docs/StateTransaction.md @@ -0,0 +1,72 @@ +# StateTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StateIndex** | **uint32** | The state index | +**TxId** | **string** | The transaction ID | + +## Methods + +### NewStateTransaction + +`func NewStateTransaction(stateIndex uint32, txId string, ) *StateTransaction` + +NewStateTransaction instantiates a new StateTransaction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStateTransactionWithDefaults + +`func NewStateTransactionWithDefaults() *StateTransaction` + +NewStateTransactionWithDefaults instantiates a new StateTransaction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStateIndex + +`func (o *StateTransaction) GetStateIndex() uint32` + +GetStateIndex returns the StateIndex field if non-nil, zero value otherwise. + +### GetStateIndexOk + +`func (o *StateTransaction) GetStateIndexOk() (*uint32, bool)` + +GetStateIndexOk returns a tuple with the StateIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStateIndex + +`func (o *StateTransaction) SetStateIndex(v uint32)` + +SetStateIndex sets StateIndex field to given value. + + +### GetTxId + +`func (o *StateTransaction) GetTxId() string` + +GetTxId returns the TxId field if non-nil, zero value otherwise. + +### GetTxIdOk + +`func (o *StateTransaction) GetTxIdOk() (*string, bool)` + +GetTxIdOk returns a tuple with the TxId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTxId + +`func (o *StateTransaction) SetTxId(v string)` + +SetTxId sets TxId field to given value. + + + +[[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/clients/apiclient/docs/WaitRequestProcessedParams.md b/clients/apiclient/docs/WaitRequestProcessedParams.md new file mode 100644 index 0000000000..e9c07f17ae --- /dev/null +++ b/clients/apiclient/docs/WaitRequestProcessedParams.md @@ -0,0 +1,56 @@ +# WaitRequestProcessedParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Timeout** | Pointer to **int64** | Timeout in nanoseconds | [optional] + +## Methods + +### NewWaitRequestProcessedParams + +`func NewWaitRequestProcessedParams() *WaitRequestProcessedParams` + +NewWaitRequestProcessedParams instantiates a new WaitRequestProcessedParams object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWaitRequestProcessedParamsWithDefaults + +`func NewWaitRequestProcessedParamsWithDefaults() *WaitRequestProcessedParams` + +NewWaitRequestProcessedParamsWithDefaults instantiates a new WaitRequestProcessedParams object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTimeout + +`func (o *WaitRequestProcessedParams) GetTimeout() int64` + +GetTimeout returns the Timeout field if non-nil, zero value otherwise. + +### GetTimeoutOk + +`func (o *WaitRequestProcessedParams) GetTimeoutOk() (*int64, bool)` + +GetTimeoutOk returns a tuple with the Timeout field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeout + +`func (o *WaitRequestProcessedParams) SetTimeout(v int64)` + +SetTimeout sets Timeout field to given value. + +### HasTimeout + +`func (o *WaitRequestProcessedParams) HasTimeout() bool` + +HasTimeout returns a boolean if a field has been set. + + +[[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/clients/apiclient/go.mod b/clients/apiclient/go.mod deleted file mode 100644 index f3f28feb33..0000000000 --- a/clients/apiclient/go.mod +++ /dev/null @@ -1,6 +0,0 @@ -module github.com/iotaledger/wasp/clients/apiclient - -go 1.13 - -require ( -) diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go index 60ff3e7df6..41d84ccbf2 100644 --- a/clients/apiclient/model_chain_metrics.go +++ b/clients/apiclient/model_chain_metrics.go @@ -20,31 +20,37 @@ var _ MappedNullable = &ChainMetrics{} // ChainMetrics struct for ChainMetrics type ChainMetrics struct { InAliasOutput AliasOutputMetricItem `json:"inAliasOutput"` + InMilestone MilestoneMetricItem `json:"inMilestone"` InOnLedgerRequest OnLedgerRequestMetricItem `json:"inOnLedgerRequest"` InOutput InOutputMetricItem `json:"inOutput"` InStateOutput InStateOutputMetricItem `json:"inStateOutput"` InTxInclusionState TxInclusionStateMsgMetricItem `json:"inTxInclusionState"` OutPublishGovernanceTransaction TransactionMetricItem `json:"outPublishGovernanceTransaction"` + OutPublisherStateTransaction PublisherStateTransactionItem `json:"outPublisherStateTransaction"` OutPullLatestOutput InterfaceMetricItem `json:"outPullLatestOutput"` OutPullOutputByID UTXOInputMetricItem `json:"outPullOutputByID"` OutPullTxInclusionState TransactionIDMetricItem `json:"outPullTxInclusionState"` + RegisteredChainIDs []string `json:"registeredChainIDs"` } // NewChainMetrics instantiates a new ChainMetrics object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewChainMetrics(inAliasOutput AliasOutputMetricItem, inOnLedgerRequest OnLedgerRequestMetricItem, inOutput InOutputMetricItem, inStateOutput InStateOutputMetricItem, inTxInclusionState TxInclusionStateMsgMetricItem, outPublishGovernanceTransaction TransactionMetricItem, outPullLatestOutput InterfaceMetricItem, outPullOutputByID UTXOInputMetricItem, outPullTxInclusionState TransactionIDMetricItem) *ChainMetrics { +func NewChainMetrics(inAliasOutput AliasOutputMetricItem, inMilestone MilestoneMetricItem, inOnLedgerRequest OnLedgerRequestMetricItem, inOutput InOutputMetricItem, inStateOutput InStateOutputMetricItem, inTxInclusionState TxInclusionStateMsgMetricItem, outPublishGovernanceTransaction TransactionMetricItem, outPublisherStateTransaction PublisherStateTransactionItem, outPullLatestOutput InterfaceMetricItem, outPullOutputByID UTXOInputMetricItem, outPullTxInclusionState TransactionIDMetricItem, registeredChainIDs []string) *ChainMetrics { this := ChainMetrics{} this.InAliasOutput = inAliasOutput + this.InMilestone = inMilestone this.InOnLedgerRequest = inOnLedgerRequest this.InOutput = inOutput this.InStateOutput = inStateOutput this.InTxInclusionState = inTxInclusionState this.OutPublishGovernanceTransaction = outPublishGovernanceTransaction + this.OutPublisherStateTransaction = outPublisherStateTransaction this.OutPullLatestOutput = outPullLatestOutput this.OutPullOutputByID = outPullOutputByID this.OutPullTxInclusionState = outPullTxInclusionState + this.RegisteredChainIDs = registeredChainIDs return &this } @@ -80,6 +86,30 @@ func (o *ChainMetrics) SetInAliasOutput(v AliasOutputMetricItem) { o.InAliasOutput = v } +// GetInMilestone returns the InMilestone field value +func (o *ChainMetrics) GetInMilestone() MilestoneMetricItem { + if o == nil { + var ret MilestoneMetricItem + return ret + } + + return o.InMilestone +} + +// GetInMilestoneOk returns a tuple with the InMilestone field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetInMilestoneOk() (*MilestoneMetricItem, bool) { + if o == nil { + return nil, false + } + return &o.InMilestone, true +} + +// SetInMilestone sets field value +func (o *ChainMetrics) SetInMilestone(v MilestoneMetricItem) { + o.InMilestone = v +} + // GetInOnLedgerRequest returns the InOnLedgerRequest field value func (o *ChainMetrics) GetInOnLedgerRequest() OnLedgerRequestMetricItem { if o == nil { @@ -200,6 +230,30 @@ func (o *ChainMetrics) SetOutPublishGovernanceTransaction(v TransactionMetricIte o.OutPublishGovernanceTransaction = v } +// GetOutPublisherStateTransaction returns the OutPublisherStateTransaction field value +func (o *ChainMetrics) GetOutPublisherStateTransaction() PublisherStateTransactionItem { + if o == nil { + var ret PublisherStateTransactionItem + return ret + } + + return o.OutPublisherStateTransaction +} + +// GetOutPublisherStateTransactionOk returns a tuple with the OutPublisherStateTransaction field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetOutPublisherStateTransactionOk() (*PublisherStateTransactionItem, bool) { + if o == nil { + return nil, false + } + return &o.OutPublisherStateTransaction, true +} + +// SetOutPublisherStateTransaction sets field value +func (o *ChainMetrics) SetOutPublisherStateTransaction(v PublisherStateTransactionItem) { + o.OutPublisherStateTransaction = v +} + // GetOutPullLatestOutput returns the OutPullLatestOutput field value func (o *ChainMetrics) GetOutPullLatestOutput() InterfaceMetricItem { if o == nil { @@ -272,6 +326,30 @@ func (o *ChainMetrics) SetOutPullTxInclusionState(v TransactionIDMetricItem) { o.OutPullTxInclusionState = v } +// GetRegisteredChainIDs returns the RegisteredChainIDs field value +func (o *ChainMetrics) GetRegisteredChainIDs() []string { + if o == nil { + var ret []string + return ret + } + + return o.RegisteredChainIDs +} + +// GetRegisteredChainIDsOk returns a tuple with the RegisteredChainIDs field value +// and a boolean to check if the value has been set. +func (o *ChainMetrics) GetRegisteredChainIDsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.RegisteredChainIDs, true +} + +// SetRegisteredChainIDs sets field value +func (o *ChainMetrics) SetRegisteredChainIDs(v []string) { + o.RegisteredChainIDs = v +} + func (o ChainMetrics) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -283,14 +361,17 @@ func (o ChainMetrics) MarshalJSON() ([]byte, error) { func (o ChainMetrics) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["inAliasOutput"] = o.InAliasOutput + toSerialize["inMilestone"] = o.InMilestone toSerialize["inOnLedgerRequest"] = o.InOnLedgerRequest toSerialize["inOutput"] = o.InOutput toSerialize["inStateOutput"] = o.InStateOutput toSerialize["inTxInclusionState"] = o.InTxInclusionState toSerialize["outPublishGovernanceTransaction"] = o.OutPublishGovernanceTransaction + toSerialize["outPublisherStateTransaction"] = o.OutPublisherStateTransaction toSerialize["outPullLatestOutput"] = o.OutPullLatestOutput toSerialize["outPullOutputByID"] = o.OutPullOutputByID toSerialize["outPullTxInclusionState"] = o.OutPullTxInclusionState + toSerialize["registeredChainIDs"] = o.RegisteredChainIDs return toSerialize, nil } diff --git a/clients/apiclient/model_chain_record.go b/clients/apiclient/model_chain_record.go new file mode 100644 index 0000000000..5908b50e68 --- /dev/null +++ b/clients/apiclient/model_chain_record.go @@ -0,0 +1,200 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the ChainRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ChainRecord{} + +// ChainRecord struct for ChainRecord +type ChainRecord struct { + AccessNodes []string `json:"accessNodes,omitempty"` + // Whether or not the chain is active + Active *bool `json:"active,omitempty"` + // ChainID (bech32) + ChainId *string `json:"chainId,omitempty"` +} + +// NewChainRecord instantiates a new ChainRecord object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChainRecord() *ChainRecord { + this := ChainRecord{} + return &this +} + +// NewChainRecordWithDefaults instantiates a new ChainRecord object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChainRecordWithDefaults() *ChainRecord { + this := ChainRecord{} + return &this +} + +// GetAccessNodes returns the AccessNodes field value if set, zero value otherwise. +func (o *ChainRecord) GetAccessNodes() []string { + if o == nil || isNil(o.AccessNodes) { + var ret []string + return ret + } + return o.AccessNodes +} + +// GetAccessNodesOk returns a tuple with the AccessNodes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainRecord) GetAccessNodesOk() ([]string, bool) { + if o == nil || isNil(o.AccessNodes) { + return nil, false + } + return o.AccessNodes, true +} + +// HasAccessNodes returns a boolean if a field has been set. +func (o *ChainRecord) HasAccessNodes() bool { + if o != nil && !isNil(o.AccessNodes) { + return true + } + + return false +} + +// SetAccessNodes gets a reference to the given []string and assigns it to the AccessNodes field. +func (o *ChainRecord) SetAccessNodes(v []string) { + o.AccessNodes = v +} + +// GetActive returns the Active field value if set, zero value otherwise. +func (o *ChainRecord) GetActive() bool { + if o == nil || isNil(o.Active) { + var ret bool + return ret + } + return *o.Active +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainRecord) GetActiveOk() (*bool, bool) { + if o == nil || isNil(o.Active) { + return nil, false + } + return o.Active, true +} + +// HasActive returns a boolean if a field has been set. +func (o *ChainRecord) HasActive() bool { + if o != nil && !isNil(o.Active) { + return true + } + + return false +} + +// SetActive gets a reference to the given bool and assigns it to the Active field. +func (o *ChainRecord) SetActive(v bool) { + o.Active = &v +} + +// GetChainId returns the ChainId field value if set, zero value otherwise. +func (o *ChainRecord) GetChainId() string { + if o == nil || isNil(o.ChainId) { + var ret string + return ret + } + return *o.ChainId +} + +// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChainRecord) GetChainIdOk() (*string, bool) { + if o == nil || isNil(o.ChainId) { + return nil, false + } + return o.ChainId, true +} + +// HasChainId returns a boolean if a field has been set. +func (o *ChainRecord) HasChainId() bool { + if o != nil && !isNil(o.ChainId) { + return true + } + + return false +} + +// SetChainId gets a reference to the given string and assigns it to the ChainId field. +func (o *ChainRecord) SetChainId(v string) { + o.ChainId = &v +} + +func (o ChainRecord) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChainRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.AccessNodes) { + toSerialize["accessNodes"] = o.AccessNodes + } + if !isNil(o.Active) { + toSerialize["active"] = o.Active + } + if !isNil(o.ChainId) { + toSerialize["chainId"] = o.ChainId + } + return toSerialize, nil +} + +type NullableChainRecord struct { + value *ChainRecord + isSet bool +} + +func (v NullableChainRecord) Get() *ChainRecord { + return v.value +} + +func (v *NullableChainRecord) Set(val *ChainRecord) { + v.value = val + v.isSet = true +} + +func (v NullableChainRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableChainRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChainRecord(val *ChainRecord) *NullableChainRecord { + return &NullableChainRecord{value: val, isSet: true} +} + +func (v NullableChainRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChainRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_consensus_workflow_status.go b/clients/apiclient/model_consensus_workflow_status.go new file mode 100644 index 0000000000..ff6a10646e --- /dev/null +++ b/clients/apiclient/model_consensus_workflow_status.go @@ -0,0 +1,757 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" + "time" +) + +// checks if the ConsensusWorkflowStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsensusWorkflowStatus{} + +// ConsensusWorkflowStatus struct for ConsensusWorkflowStatus +type ConsensusWorkflowStatus struct { + // Shows current state index of the consensus + CurrentStateIndex *int32 `json:"currentStateIndex,omitempty"` + // Shows if batch proposal is sent out in current consensus iteration + FlagBatchProposalSent *bool `json:"flagBatchProposalSent,omitempty"` + // Shows if consensus on batch is reached and known in current consensus iteration + FlagConsensusBatchKnown *bool `json:"flagConsensusBatchKnown,omitempty"` + // Shows if consensus algorithm is still not completed in current consensus iteration + FlagInProgress *bool `json:"flagInProgress,omitempty"` + // Shows if state output is received in current consensus iteration + FlagStateReceived *bool `json:"flagStateReceived,omitempty"` + // Shows if consensus on transaction is reached in current consensus iteration + FlagTransactionFinalized *bool `json:"flagTransactionFinalized,omitempty"` + // Shows if transaction is posted to L1 in current consensus iteration + FlagTransactionPosted *bool `json:"flagTransactionPosted,omitempty"` + // Shows if L1 reported that it has seen the transaction of current consensus iteration + FlagTransactionSeen *bool `json:"flagTransactionSeen,omitempty"` + // Shows if virtual machine has returned its results in current consensus iteration + FlagVMResultSigned *bool `json:"flagVMResultSigned,omitempty"` + // Shows if virtual machine is started in current consensus iteration + FlagVMStarted *bool `json:"flagVMStarted,omitempty"` + // Shows when batch proposal was last sent out in current consensus iteration + TimeBatchProposalSent *time.Time `json:"timeBatchProposalSent,omitempty"` + // Shows when algorithm was last completed in current consensus iteration + TimeCompleted *time.Time `json:"timeCompleted,omitempty"` + // Shows when ACS results of consensus on batch was last received in current consensus iteration + TimeConsensusBatchKnown *time.Time `json:"timeConsensusBatchKnown,omitempty"` + // Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration + TimeTransactionFinalized *time.Time `json:"timeTransactionFinalized,omitempty"` + // Shows when transaction was last posted to L1 in current consensus iteration + TimeTransactionPosted *time.Time `json:"timeTransactionPosted,omitempty"` + // Shows when algorithm last noted that transaction hadd been seen by L1 in current consensus iteration + TimeTransactionSeen *time.Time `json:"timeTransactionSeen,omitempty"` + // Shows when virtual machine results were last received and signed in current consensus iteration + TimeVMResultSigned *time.Time `json:"timeVMResultSigned,omitempty"` + // Shows when virtual machine was last started in current consensus iteration + TimeVMStarted *time.Time `json:"timeVMStarted,omitempty"` +} + +// NewConsensusWorkflowStatus instantiates a new ConsensusWorkflowStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsensusWorkflowStatus() *ConsensusWorkflowStatus { + this := ConsensusWorkflowStatus{} + return &this +} + +// NewConsensusWorkflowStatusWithDefaults instantiates a new ConsensusWorkflowStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsensusWorkflowStatusWithDefaults() *ConsensusWorkflowStatus { + this := ConsensusWorkflowStatus{} + return &this +} + +// GetCurrentStateIndex returns the CurrentStateIndex field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() int32 { + if o == nil || isNil(o.CurrentStateIndex) { + var ret int32 + return ret + } + return *o.CurrentStateIndex +} + +// GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*int32, bool) { + if o == nil || isNil(o.CurrentStateIndex) { + return nil, false + } + return o.CurrentStateIndex, true +} + +// HasCurrentStateIndex returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasCurrentStateIndex() bool { + if o != nil && !isNil(o.CurrentStateIndex) { + return true + } + + return false +} + +// SetCurrentStateIndex gets a reference to the given int32 and assigns it to the CurrentStateIndex field. +func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v int32) { + o.CurrentStateIndex = &v +} + +// GetFlagBatchProposalSent returns the FlagBatchProposalSent field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSent() bool { + if o == nil || isNil(o.FlagBatchProposalSent) { + var ret bool + return ret + } + return *o.FlagBatchProposalSent +} + +// GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSentOk() (*bool, bool) { + if o == nil || isNil(o.FlagBatchProposalSent) { + return nil, false + } + return o.FlagBatchProposalSent, true +} + +// HasFlagBatchProposalSent returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagBatchProposalSent() bool { + if o != nil && !isNil(o.FlagBatchProposalSent) { + return true + } + + return false +} + +// SetFlagBatchProposalSent gets a reference to the given bool and assigns it to the FlagBatchProposalSent field. +func (o *ConsensusWorkflowStatus) SetFlagBatchProposalSent(v bool) { + o.FlagBatchProposalSent = &v +} + +// GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnown() bool { + if o == nil || isNil(o.FlagConsensusBatchKnown) { + var ret bool + return ret + } + return *o.FlagConsensusBatchKnown +} + +// GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnownOk() (*bool, bool) { + if o == nil || isNil(o.FlagConsensusBatchKnown) { + return nil, false + } + return o.FlagConsensusBatchKnown, true +} + +// HasFlagConsensusBatchKnown returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagConsensusBatchKnown() bool { + if o != nil && !isNil(o.FlagConsensusBatchKnown) { + return true + } + + return false +} + +// SetFlagConsensusBatchKnown gets a reference to the given bool and assigns it to the FlagConsensusBatchKnown field. +func (o *ConsensusWorkflowStatus) SetFlagConsensusBatchKnown(v bool) { + o.FlagConsensusBatchKnown = &v +} + +// GetFlagInProgress returns the FlagInProgress field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagInProgress() bool { + if o == nil || isNil(o.FlagInProgress) { + var ret bool + return ret + } + return *o.FlagInProgress +} + +// GetFlagInProgressOk returns a tuple with the FlagInProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagInProgressOk() (*bool, bool) { + if o == nil || isNil(o.FlagInProgress) { + return nil, false + } + return o.FlagInProgress, true +} + +// HasFlagInProgress returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagInProgress() bool { + if o != nil && !isNil(o.FlagInProgress) { + return true + } + + return false +} + +// SetFlagInProgress gets a reference to the given bool and assigns it to the FlagInProgress field. +func (o *ConsensusWorkflowStatus) SetFlagInProgress(v bool) { + o.FlagInProgress = &v +} + +// GetFlagStateReceived returns the FlagStateReceived field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagStateReceived() bool { + if o == nil || isNil(o.FlagStateReceived) { + var ret bool + return ret + } + return *o.FlagStateReceived +} + +// GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagStateReceivedOk() (*bool, bool) { + if o == nil || isNil(o.FlagStateReceived) { + return nil, false + } + return o.FlagStateReceived, true +} + +// HasFlagStateReceived returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagStateReceived() bool { + if o != nil && !isNil(o.FlagStateReceived) { + return true + } + + return false +} + +// SetFlagStateReceived gets a reference to the given bool and assigns it to the FlagStateReceived field. +func (o *ConsensusWorkflowStatus) SetFlagStateReceived(v bool) { + o.FlagStateReceived = &v +} + +// GetFlagTransactionFinalized returns the FlagTransactionFinalized field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalized() bool { + if o == nil || isNil(o.FlagTransactionFinalized) { + var ret bool + return ret + } + return *o.FlagTransactionFinalized +} + +// GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalizedOk() (*bool, bool) { + if o == nil || isNil(o.FlagTransactionFinalized) { + return nil, false + } + return o.FlagTransactionFinalized, true +} + +// HasFlagTransactionFinalized returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagTransactionFinalized() bool { + if o != nil && !isNil(o.FlagTransactionFinalized) { + return true + } + + return false +} + +// SetFlagTransactionFinalized gets a reference to the given bool and assigns it to the FlagTransactionFinalized field. +func (o *ConsensusWorkflowStatus) SetFlagTransactionFinalized(v bool) { + o.FlagTransactionFinalized = &v +} + +// GetFlagTransactionPosted returns the FlagTransactionPosted field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagTransactionPosted() bool { + if o == nil || isNil(o.FlagTransactionPosted) { + var ret bool + return ret + } + return *o.FlagTransactionPosted +} + +// GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagTransactionPostedOk() (*bool, bool) { + if o == nil || isNil(o.FlagTransactionPosted) { + return nil, false + } + return o.FlagTransactionPosted, true +} + +// HasFlagTransactionPosted returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagTransactionPosted() bool { + if o != nil && !isNil(o.FlagTransactionPosted) { + return true + } + + return false +} + +// SetFlagTransactionPosted gets a reference to the given bool and assigns it to the FlagTransactionPosted field. +func (o *ConsensusWorkflowStatus) SetFlagTransactionPosted(v bool) { + o.FlagTransactionPosted = &v +} + +// GetFlagTransactionSeen returns the FlagTransactionSeen field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagTransactionSeen() bool { + if o == nil || isNil(o.FlagTransactionSeen) { + var ret bool + return ret + } + return *o.FlagTransactionSeen +} + +// GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagTransactionSeenOk() (*bool, bool) { + if o == nil || isNil(o.FlagTransactionSeen) { + return nil, false + } + return o.FlagTransactionSeen, true +} + +// HasFlagTransactionSeen returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagTransactionSeen() bool { + if o != nil && !isNil(o.FlagTransactionSeen) { + return true + } + + return false +} + +// SetFlagTransactionSeen gets a reference to the given bool and assigns it to the FlagTransactionSeen field. +func (o *ConsensusWorkflowStatus) SetFlagTransactionSeen(v bool) { + o.FlagTransactionSeen = &v +} + +// GetFlagVMResultSigned returns the FlagVMResultSigned field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagVMResultSigned() bool { + if o == nil || isNil(o.FlagVMResultSigned) { + var ret bool + return ret + } + return *o.FlagVMResultSigned +} + +// GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagVMResultSignedOk() (*bool, bool) { + if o == nil || isNil(o.FlagVMResultSigned) { + return nil, false + } + return o.FlagVMResultSigned, true +} + +// HasFlagVMResultSigned returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagVMResultSigned() bool { + if o != nil && !isNil(o.FlagVMResultSigned) { + return true + } + + return false +} + +// SetFlagVMResultSigned gets a reference to the given bool and assigns it to the FlagVMResultSigned field. +func (o *ConsensusWorkflowStatus) SetFlagVMResultSigned(v bool) { + o.FlagVMResultSigned = &v +} + +// GetFlagVMStarted returns the FlagVMStarted field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetFlagVMStarted() bool { + if o == nil || isNil(o.FlagVMStarted) { + var ret bool + return ret + } + return *o.FlagVMStarted +} + +// GetFlagVMStartedOk returns a tuple with the FlagVMStarted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetFlagVMStartedOk() (*bool, bool) { + if o == nil || isNil(o.FlagVMStarted) { + return nil, false + } + return o.FlagVMStarted, true +} + +// HasFlagVMStarted returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasFlagVMStarted() bool { + if o != nil && !isNil(o.FlagVMStarted) { + return true + } + + return false +} + +// SetFlagVMStarted gets a reference to the given bool and assigns it to the FlagVMStarted field. +func (o *ConsensusWorkflowStatus) SetFlagVMStarted(v bool) { + o.FlagVMStarted = &v +} + +// GetTimeBatchProposalSent returns the TimeBatchProposalSent field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSent() time.Time { + if o == nil || isNil(o.TimeBatchProposalSent) { + var ret time.Time + return ret + } + return *o.TimeBatchProposalSent +} + +// GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSentOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeBatchProposalSent) { + return nil, false + } + return o.TimeBatchProposalSent, true +} + +// HasTimeBatchProposalSent returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeBatchProposalSent() bool { + if o != nil && !isNil(o.TimeBatchProposalSent) { + return true + } + + return false +} + +// SetTimeBatchProposalSent gets a reference to the given time.Time and assigns it to the TimeBatchProposalSent field. +func (o *ConsensusWorkflowStatus) SetTimeBatchProposalSent(v time.Time) { + o.TimeBatchProposalSent = &v +} + +// GetTimeCompleted returns the TimeCompleted field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeCompleted() time.Time { + if o == nil || isNil(o.TimeCompleted) { + var ret time.Time + return ret + } + return *o.TimeCompleted +} + +// GetTimeCompletedOk returns a tuple with the TimeCompleted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeCompletedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeCompleted) { + return nil, false + } + return o.TimeCompleted, true +} + +// HasTimeCompleted returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeCompleted() bool { + if o != nil && !isNil(o.TimeCompleted) { + return true + } + + return false +} + +// SetTimeCompleted gets a reference to the given time.Time and assigns it to the TimeCompleted field. +func (o *ConsensusWorkflowStatus) SetTimeCompleted(v time.Time) { + o.TimeCompleted = &v +} + +// GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnown() time.Time { + if o == nil || isNil(o.TimeConsensusBatchKnown) { + var ret time.Time + return ret + } + return *o.TimeConsensusBatchKnown +} + +// GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnownOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeConsensusBatchKnown) { + return nil, false + } + return o.TimeConsensusBatchKnown, true +} + +// HasTimeConsensusBatchKnown returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeConsensusBatchKnown() bool { + if o != nil && !isNil(o.TimeConsensusBatchKnown) { + return true + } + + return false +} + +// SetTimeConsensusBatchKnown gets a reference to the given time.Time and assigns it to the TimeConsensusBatchKnown field. +func (o *ConsensusWorkflowStatus) SetTimeConsensusBatchKnown(v time.Time) { + o.TimeConsensusBatchKnown = &v +} + +// GetTimeTransactionFinalized returns the TimeTransactionFinalized field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalized() time.Time { + if o == nil || isNil(o.TimeTransactionFinalized) { + var ret time.Time + return ret + } + return *o.TimeTransactionFinalized +} + +// GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalizedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeTransactionFinalized) { + return nil, false + } + return o.TimeTransactionFinalized, true +} + +// HasTimeTransactionFinalized returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeTransactionFinalized() bool { + if o != nil && !isNil(o.TimeTransactionFinalized) { + return true + } + + return false +} + +// SetTimeTransactionFinalized gets a reference to the given time.Time and assigns it to the TimeTransactionFinalized field. +func (o *ConsensusWorkflowStatus) SetTimeTransactionFinalized(v time.Time) { + o.TimeTransactionFinalized = &v +} + +// GetTimeTransactionPosted returns the TimeTransactionPosted field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeTransactionPosted() time.Time { + if o == nil || isNil(o.TimeTransactionPosted) { + var ret time.Time + return ret + } + return *o.TimeTransactionPosted +} + +// GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeTransactionPostedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeTransactionPosted) { + return nil, false + } + return o.TimeTransactionPosted, true +} + +// HasTimeTransactionPosted returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeTransactionPosted() bool { + if o != nil && !isNil(o.TimeTransactionPosted) { + return true + } + + return false +} + +// SetTimeTransactionPosted gets a reference to the given time.Time and assigns it to the TimeTransactionPosted field. +func (o *ConsensusWorkflowStatus) SetTimeTransactionPosted(v time.Time) { + o.TimeTransactionPosted = &v +} + +// GetTimeTransactionSeen returns the TimeTransactionSeen field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeTransactionSeen() time.Time { + if o == nil || isNil(o.TimeTransactionSeen) { + var ret time.Time + return ret + } + return *o.TimeTransactionSeen +} + +// GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeTransactionSeenOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeTransactionSeen) { + return nil, false + } + return o.TimeTransactionSeen, true +} + +// HasTimeTransactionSeen returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeTransactionSeen() bool { + if o != nil && !isNil(o.TimeTransactionSeen) { + return true + } + + return false +} + +// SetTimeTransactionSeen gets a reference to the given time.Time and assigns it to the TimeTransactionSeen field. +func (o *ConsensusWorkflowStatus) SetTimeTransactionSeen(v time.Time) { + o.TimeTransactionSeen = &v +} + +// GetTimeVMResultSigned returns the TimeVMResultSigned field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeVMResultSigned() time.Time { + if o == nil || isNil(o.TimeVMResultSigned) { + var ret time.Time + return ret + } + return *o.TimeVMResultSigned +} + +// GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeVMResultSignedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeVMResultSigned) { + return nil, false + } + return o.TimeVMResultSigned, true +} + +// HasTimeVMResultSigned returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeVMResultSigned() bool { + if o != nil && !isNil(o.TimeVMResultSigned) { + return true + } + + return false +} + +// SetTimeVMResultSigned gets a reference to the given time.Time and assigns it to the TimeVMResultSigned field. +func (o *ConsensusWorkflowStatus) SetTimeVMResultSigned(v time.Time) { + o.TimeVMResultSigned = &v +} + +// GetTimeVMStarted returns the TimeVMStarted field value if set, zero value otherwise. +func (o *ConsensusWorkflowStatus) GetTimeVMStarted() time.Time { + if o == nil || isNil(o.TimeVMStarted) { + var ret time.Time + return ret + } + return *o.TimeVMStarted +} + +// GetTimeVMStartedOk returns a tuple with the TimeVMStarted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsensusWorkflowStatus) GetTimeVMStartedOk() (*time.Time, bool) { + if o == nil || isNil(o.TimeVMStarted) { + return nil, false + } + return o.TimeVMStarted, true +} + +// HasTimeVMStarted returns a boolean if a field has been set. +func (o *ConsensusWorkflowStatus) HasTimeVMStarted() bool { + if o != nil && !isNil(o.TimeVMStarted) { + return true + } + + return false +} + +// SetTimeVMStarted gets a reference to the given time.Time and assigns it to the TimeVMStarted field. +func (o *ConsensusWorkflowStatus) SetTimeVMStarted(v time.Time) { + o.TimeVMStarted = &v +} + +func (o ConsensusWorkflowStatus) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsensusWorkflowStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.CurrentStateIndex) { + toSerialize["currentStateIndex"] = o.CurrentStateIndex + } + if !isNil(o.FlagBatchProposalSent) { + toSerialize["flagBatchProposalSent"] = o.FlagBatchProposalSent + } + if !isNil(o.FlagConsensusBatchKnown) { + toSerialize["flagConsensusBatchKnown"] = o.FlagConsensusBatchKnown + } + if !isNil(o.FlagInProgress) { + toSerialize["flagInProgress"] = o.FlagInProgress + } + if !isNil(o.FlagStateReceived) { + toSerialize["flagStateReceived"] = o.FlagStateReceived + } + if !isNil(o.FlagTransactionFinalized) { + toSerialize["flagTransactionFinalized"] = o.FlagTransactionFinalized + } + if !isNil(o.FlagTransactionPosted) { + toSerialize["flagTransactionPosted"] = o.FlagTransactionPosted + } + if !isNil(o.FlagTransactionSeen) { + toSerialize["flagTransactionSeen"] = o.FlagTransactionSeen + } + if !isNil(o.FlagVMResultSigned) { + toSerialize["flagVMResultSigned"] = o.FlagVMResultSigned + } + if !isNil(o.FlagVMStarted) { + toSerialize["flagVMStarted"] = o.FlagVMStarted + } + if !isNil(o.TimeBatchProposalSent) { + toSerialize["timeBatchProposalSent"] = o.TimeBatchProposalSent + } + if !isNil(o.TimeCompleted) { + toSerialize["timeCompleted"] = o.TimeCompleted + } + if !isNil(o.TimeConsensusBatchKnown) { + toSerialize["timeConsensusBatchKnown"] = o.TimeConsensusBatchKnown + } + if !isNil(o.TimeTransactionFinalized) { + toSerialize["timeTransactionFinalized"] = o.TimeTransactionFinalized + } + if !isNil(o.TimeTransactionPosted) { + toSerialize["timeTransactionPosted"] = o.TimeTransactionPosted + } + if !isNil(o.TimeTransactionSeen) { + toSerialize["timeTransactionSeen"] = o.TimeTransactionSeen + } + if !isNil(o.TimeVMResultSigned) { + toSerialize["timeVMResultSigned"] = o.TimeVMResultSigned + } + if !isNil(o.TimeVMStarted) { + toSerialize["timeVMStarted"] = o.TimeVMStarted + } + return toSerialize, nil +} + +type NullableConsensusWorkflowStatus struct { + value *ConsensusWorkflowStatus + isSet bool +} + +func (v NullableConsensusWorkflowStatus) Get() *ConsensusWorkflowStatus { + return v.value +} + +func (v *NullableConsensusWorkflowStatus) Set(val *ConsensusWorkflowStatus) { + v.value = val + v.isSet = true +} + +func (v NullableConsensusWorkflowStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableConsensusWorkflowStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsensusWorkflowStatus(val *ConsensusWorkflowStatus) *NullableConsensusWorkflowStatus { + return &NullableConsensusWorkflowStatus{value: val, isSet: true} +} + +func (v NullableConsensusWorkflowStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsensusWorkflowStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go new file mode 100644 index 0000000000..f045906729 --- /dev/null +++ b/clients/apiclient/model_milestone_info.go @@ -0,0 +1,198 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the MilestoneInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MilestoneInfo{} + +// MilestoneInfo struct for MilestoneInfo +type MilestoneInfo struct { + Index *int32 `json:"index,omitempty"` + MilestoneId *string `json:"milestoneId,omitempty"` + Timestamp *int32 `json:"timestamp,omitempty"` +} + +// NewMilestoneInfo instantiates a new MilestoneInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMilestoneInfo() *MilestoneInfo { + this := MilestoneInfo{} + return &this +} + +// NewMilestoneInfoWithDefaults instantiates a new MilestoneInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMilestoneInfoWithDefaults() *MilestoneInfo { + this := MilestoneInfo{} + return &this +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *MilestoneInfo) GetIndex() int32 { + if o == nil || isNil(o.Index) { + var ret int32 + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MilestoneInfo) GetIndexOk() (*int32, bool) { + if o == nil || isNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *MilestoneInfo) HasIndex() bool { + if o != nil && !isNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given int32 and assigns it to the Index field. +func (o *MilestoneInfo) SetIndex(v int32) { + o.Index = &v +} + +// GetMilestoneId returns the MilestoneId field value if set, zero value otherwise. +func (o *MilestoneInfo) GetMilestoneId() string { + if o == nil || isNil(o.MilestoneId) { + var ret string + return ret + } + return *o.MilestoneId +} + +// GetMilestoneIdOk returns a tuple with the MilestoneId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MilestoneInfo) GetMilestoneIdOk() (*string, bool) { + if o == nil || isNil(o.MilestoneId) { + return nil, false + } + return o.MilestoneId, true +} + +// HasMilestoneId returns a boolean if a field has been set. +func (o *MilestoneInfo) HasMilestoneId() bool { + if o != nil && !isNil(o.MilestoneId) { + return true + } + + return false +} + +// SetMilestoneId gets a reference to the given string and assigns it to the MilestoneId field. +func (o *MilestoneInfo) SetMilestoneId(v string) { + o.MilestoneId = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *MilestoneInfo) GetTimestamp() int32 { + if o == nil || isNil(o.Timestamp) { + var ret int32 + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MilestoneInfo) GetTimestampOk() (*int32, bool) { + if o == nil || isNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *MilestoneInfo) HasTimestamp() bool { + if o != nil && !isNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field. +func (o *MilestoneInfo) SetTimestamp(v int32) { + o.Timestamp = &v +} + +func (o MilestoneInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MilestoneInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Index) { + toSerialize["index"] = o.Index + } + if !isNil(o.MilestoneId) { + toSerialize["milestoneId"] = o.MilestoneId + } + if !isNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +type NullableMilestoneInfo struct { + value *MilestoneInfo + isSet bool +} + +func (v NullableMilestoneInfo) Get() *MilestoneInfo { + return v.value +} + +func (v *NullableMilestoneInfo) Set(val *MilestoneInfo) { + v.value = val + v.isSet = true +} + +func (v NullableMilestoneInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableMilestoneInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMilestoneInfo(val *MilestoneInfo) *NullableMilestoneInfo { + return &NullableMilestoneInfo{value: val, isSet: true} +} + +func (v NullableMilestoneInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMilestoneInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_milestone_metric_item.go b/clients/apiclient/model_milestone_metric_item.go new file mode 100644 index 0000000000..53c43fb145 --- /dev/null +++ b/clients/apiclient/model_milestone_metric_item.go @@ -0,0 +1,172 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" + "time" +) + +// checks if the MilestoneMetricItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MilestoneMetricItem{} + +// MilestoneMetricItem struct for MilestoneMetricItem +type MilestoneMetricItem struct { + LastMessage MilestoneInfo `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` +} + +// NewMilestoneMetricItem instantiates a new MilestoneMetricItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMilestoneMetricItem(lastMessage MilestoneInfo, messages uint32, timestamp time.Time) *MilestoneMetricItem { + this := MilestoneMetricItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp + return &this +} + +// NewMilestoneMetricItemWithDefaults instantiates a new MilestoneMetricItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMilestoneMetricItemWithDefaults() *MilestoneMetricItem { + this := MilestoneMetricItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value +func (o *MilestoneMetricItem) GetLastMessage() MilestoneInfo { + if o == nil { + var ret MilestoneInfo + return ret + } + + return o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value +// and a boolean to check if the value has been set. +func (o *MilestoneMetricItem) GetLastMessageOk() (*MilestoneInfo, bool) { + if o == nil { + return nil, false + } + return &o.LastMessage, true +} + +// SetLastMessage sets field value +func (o *MilestoneMetricItem) SetLastMessage(v MilestoneInfo) { + o.LastMessage = v +} + +// GetMessages returns the Messages field value +func (o *MilestoneMetricItem) GetMessages() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *MilestoneMetricItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.Messages, true +} + +// SetMessages sets field value +func (o *MilestoneMetricItem) SetMessages(v uint32) { + o.Messages = v +} + +// GetTimestamp returns the Timestamp field value +func (o *MilestoneMetricItem) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *MilestoneMetricItem) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *MilestoneMetricItem) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +func (o MilestoneMetricItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MilestoneMetricItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullableMilestoneMetricItem struct { + value *MilestoneMetricItem + isSet bool +} + +func (v NullableMilestoneMetricItem) Get() *MilestoneMetricItem { + return v.value +} + +func (v *NullableMilestoneMetricItem) Set(val *MilestoneMetricItem) { + v.value = val + v.isSet = true +} + +func (v NullableMilestoneMetricItem) IsSet() bool { + return v.isSet +} + +func (v *NullableMilestoneMetricItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMilestoneMetricItem(val *MilestoneMetricItem) *NullableMilestoneMetricItem { + return &NullableMilestoneMetricItem{value: val, isSet: true} +} + +func (v NullableMilestoneMetricItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMilestoneMetricItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_node_connection_message_metrics.go b/clients/apiclient/model_node_connection_message_metrics.go new file mode 100644 index 0000000000..fbeec14a27 --- /dev/null +++ b/clients/apiclient/model_node_connection_message_metrics.go @@ -0,0 +1,202 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" + "time" +) + +// checks if the NodeConnectionMessageMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeConnectionMessageMetrics{} + +// NodeConnectionMessageMetrics struct for NodeConnectionMessageMetrics +type NodeConnectionMessageMetrics struct { + // Last time the message was sent/received + LastEvent *time.Time `json:"lastEvent,omitempty"` + // The print out of the last message + LastMessage *string `json:"lastMessage,omitempty"` + // Total number of messages sent/received + Total *int32 `json:"total,omitempty"` +} + +// NewNodeConnectionMessageMetrics instantiates a new NodeConnectionMessageMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeConnectionMessageMetrics() *NodeConnectionMessageMetrics { + this := NodeConnectionMessageMetrics{} + return &this +} + +// NewNodeConnectionMessageMetricsWithDefaults instantiates a new NodeConnectionMessageMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeConnectionMessageMetricsWithDefaults() *NodeConnectionMessageMetrics { + this := NodeConnectionMessageMetrics{} + return &this +} + +// GetLastEvent returns the LastEvent field value if set, zero value otherwise. +func (o *NodeConnectionMessageMetrics) GetLastEvent() time.Time { + if o == nil || isNil(o.LastEvent) { + var ret time.Time + return ret + } + return *o.LastEvent +} + +// GetLastEventOk returns a tuple with the LastEvent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessageMetrics) GetLastEventOk() (*time.Time, bool) { + if o == nil || isNil(o.LastEvent) { + return nil, false + } + return o.LastEvent, true +} + +// HasLastEvent returns a boolean if a field has been set. +func (o *NodeConnectionMessageMetrics) HasLastEvent() bool { + if o != nil && !isNil(o.LastEvent) { + return true + } + + return false +} + +// SetLastEvent gets a reference to the given time.Time and assigns it to the LastEvent field. +func (o *NodeConnectionMessageMetrics) SetLastEvent(v time.Time) { + o.LastEvent = &v +} + +// GetLastMessage returns the LastMessage field value if set, zero value otherwise. +func (o *NodeConnectionMessageMetrics) GetLastMessage() string { + if o == nil || isNil(o.LastMessage) { + var ret string + return ret + } + return *o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessageMetrics) GetLastMessageOk() (*string, bool) { + if o == nil || isNil(o.LastMessage) { + return nil, false + } + return o.LastMessage, true +} + +// HasLastMessage returns a boolean if a field has been set. +func (o *NodeConnectionMessageMetrics) HasLastMessage() bool { + if o != nil && !isNil(o.LastMessage) { + return true + } + + return false +} + +// SetLastMessage gets a reference to the given string and assigns it to the LastMessage field. +func (o *NodeConnectionMessageMetrics) SetLastMessage(v string) { + o.LastMessage = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *NodeConnectionMessageMetrics) GetTotal() int32 { + if o == nil || isNil(o.Total) { + var ret int32 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessageMetrics) GetTotalOk() (*int32, bool) { + if o == nil || isNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *NodeConnectionMessageMetrics) HasTotal() bool { + if o != nil && !isNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *NodeConnectionMessageMetrics) SetTotal(v int32) { + o.Total = &v +} + +func (o NodeConnectionMessageMetrics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeConnectionMessageMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LastEvent) { + toSerialize["lastEvent"] = o.LastEvent + } + if !isNil(o.LastMessage) { + toSerialize["lastMessage"] = o.LastMessage + } + if !isNil(o.Total) { + toSerialize["total"] = o.Total + } + return toSerialize, nil +} + +type NullableNodeConnectionMessageMetrics struct { + value *NodeConnectionMessageMetrics + isSet bool +} + +func (v NullableNodeConnectionMessageMetrics) Get() *NodeConnectionMessageMetrics { + return v.value +} + +func (v *NullableNodeConnectionMessageMetrics) Set(val *NodeConnectionMessageMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableNodeConnectionMessageMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeConnectionMessageMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeConnectionMessageMetrics(val *NodeConnectionMessageMetrics) *NullableNodeConnectionMessageMetrics { + return &NullableNodeConnectionMessageMetrics{value: val, isSet: true} +} + +func (v NullableNodeConnectionMessageMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeConnectionMessageMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_node_connection_messages_metrics.go b/clients/apiclient/model_node_connection_messages_metrics.go new file mode 100644 index 0000000000..16b127df9a --- /dev/null +++ b/clients/apiclient/model_node_connection_messages_metrics.go @@ -0,0 +1,450 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the NodeConnectionMessagesMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeConnectionMessagesMetrics{} + +// NodeConnectionMessagesMetrics struct for NodeConnectionMessagesMetrics +type NodeConnectionMessagesMetrics struct { + InAliasOutput *NodeConnectionMessageMetrics `json:"inAliasOutput,omitempty"` + InOnLedgerRequest *NodeConnectionMessageMetrics `json:"inOnLedgerRequest,omitempty"` + InOutput *NodeConnectionMessageMetrics `json:"inOutput,omitempty"` + InStateOutput *NodeConnectionMessageMetrics `json:"inStateOutput,omitempty"` + InTxInclusionState *NodeConnectionMessageMetrics `json:"inTxInclusionState,omitempty"` + OutPublishGovernanceTransaction *NodeConnectionMessageMetrics `json:"outPublishGovernanceTransaction,omitempty"` + OutPublishStateTransaction *NodeConnectionMessageMetrics `json:"outPublishStateTransaction,omitempty"` + OutPullLatestOutput *NodeConnectionMessageMetrics `json:"outPullLatestOutput,omitempty"` + OutPullOutputByID *NodeConnectionMessageMetrics `json:"outPullOutputByID,omitempty"` + OutPullTxInclusionState *NodeConnectionMessageMetrics `json:"outPullTxInclusionState,omitempty"` +} + +// NewNodeConnectionMessagesMetrics instantiates a new NodeConnectionMessagesMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeConnectionMessagesMetrics() *NodeConnectionMessagesMetrics { + this := NodeConnectionMessagesMetrics{} + return &this +} + +// NewNodeConnectionMessagesMetricsWithDefaults instantiates a new NodeConnectionMessagesMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeConnectionMessagesMetricsWithDefaults() *NodeConnectionMessagesMetrics { + this := NodeConnectionMessagesMetrics{} + return &this +} + +// GetInAliasOutput returns the InAliasOutput field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetInAliasOutput() NodeConnectionMessageMetrics { + if o == nil || isNil(o.InAliasOutput) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.InAliasOutput +} + +// GetInAliasOutputOk returns a tuple with the InAliasOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetInAliasOutputOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.InAliasOutput) { + return nil, false + } + return o.InAliasOutput, true +} + +// HasInAliasOutput returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasInAliasOutput() bool { + if o != nil && !isNil(o.InAliasOutput) { + return true + } + + return false +} + +// SetInAliasOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InAliasOutput field. +func (o *NodeConnectionMessagesMetrics) SetInAliasOutput(v NodeConnectionMessageMetrics) { + o.InAliasOutput = &v +} + +// GetInOnLedgerRequest returns the InOnLedgerRequest field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequest() NodeConnectionMessageMetrics { + if o == nil || isNil(o.InOnLedgerRequest) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.InOnLedgerRequest +} + +// GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequestOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.InOnLedgerRequest) { + return nil, false + } + return o.InOnLedgerRequest, true +} + +// HasInOnLedgerRequest returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasInOnLedgerRequest() bool { + if o != nil && !isNil(o.InOnLedgerRequest) { + return true + } + + return false +} + +// SetInOnLedgerRequest gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InOnLedgerRequest field. +func (o *NodeConnectionMessagesMetrics) SetInOnLedgerRequest(v NodeConnectionMessageMetrics) { + o.InOnLedgerRequest = &v +} + +// GetInOutput returns the InOutput field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetInOutput() NodeConnectionMessageMetrics { + if o == nil || isNil(o.InOutput) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.InOutput +} + +// GetInOutputOk returns a tuple with the InOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetInOutputOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.InOutput) { + return nil, false + } + return o.InOutput, true +} + +// HasInOutput returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasInOutput() bool { + if o != nil && !isNil(o.InOutput) { + return true + } + + return false +} + +// SetInOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InOutput field. +func (o *NodeConnectionMessagesMetrics) SetInOutput(v NodeConnectionMessageMetrics) { + o.InOutput = &v +} + +// GetInStateOutput returns the InStateOutput field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetInStateOutput() NodeConnectionMessageMetrics { + if o == nil || isNil(o.InStateOutput) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.InStateOutput +} + +// GetInStateOutputOk returns a tuple with the InStateOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetInStateOutputOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.InStateOutput) { + return nil, false + } + return o.InStateOutput, true +} + +// HasInStateOutput returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasInStateOutput() bool { + if o != nil && !isNil(o.InStateOutput) { + return true + } + + return false +} + +// SetInStateOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InStateOutput field. +func (o *NodeConnectionMessagesMetrics) SetInStateOutput(v NodeConnectionMessageMetrics) { + o.InStateOutput = &v +} + +// GetInTxInclusionState returns the InTxInclusionState field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetInTxInclusionState() NodeConnectionMessageMetrics { + if o == nil || isNil(o.InTxInclusionState) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.InTxInclusionState +} + +// GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetInTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.InTxInclusionState) { + return nil, false + } + return o.InTxInclusionState, true +} + +// HasInTxInclusionState returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasInTxInclusionState() bool { + if o != nil && !isNil(o.InTxInclusionState) { + return true + } + + return false +} + +// SetInTxInclusionState gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InTxInclusionState field. +func (o *NodeConnectionMessagesMetrics) SetInTxInclusionState(v NodeConnectionMessageMetrics) { + o.InTxInclusionState = &v +} + +// GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransaction() NodeConnectionMessageMetrics { + if o == nil || isNil(o.OutPublishGovernanceTransaction) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.OutPublishGovernanceTransaction +} + +// GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransactionOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.OutPublishGovernanceTransaction) { + return nil, false + } + return o.OutPublishGovernanceTransaction, true +} + +// HasOutPublishGovernanceTransaction returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasOutPublishGovernanceTransaction() bool { + if o != nil && !isNil(o.OutPublishGovernanceTransaction) { + return true + } + + return false +} + +// SetOutPublishGovernanceTransaction gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPublishGovernanceTransaction field. +func (o *NodeConnectionMessagesMetrics) SetOutPublishGovernanceTransaction(v NodeConnectionMessageMetrics) { + o.OutPublishGovernanceTransaction = &v +} + +// GetOutPublishStateTransaction returns the OutPublishStateTransaction field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransaction() NodeConnectionMessageMetrics { + if o == nil || isNil(o.OutPublishStateTransaction) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.OutPublishStateTransaction +} + +// GetOutPublishStateTransactionOk returns a tuple with the OutPublishStateTransaction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransactionOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.OutPublishStateTransaction) { + return nil, false + } + return o.OutPublishStateTransaction, true +} + +// HasOutPublishStateTransaction returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasOutPublishStateTransaction() bool { + if o != nil && !isNil(o.OutPublishStateTransaction) { + return true + } + + return false +} + +// SetOutPublishStateTransaction gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPublishStateTransaction field. +func (o *NodeConnectionMessagesMetrics) SetOutPublishStateTransaction(v NodeConnectionMessageMetrics) { + o.OutPublishStateTransaction = &v +} + +// GetOutPullLatestOutput returns the OutPullLatestOutput field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutput() NodeConnectionMessageMetrics { + if o == nil || isNil(o.OutPullLatestOutput) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.OutPullLatestOutput +} + +// GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutputOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.OutPullLatestOutput) { + return nil, false + } + return o.OutPullLatestOutput, true +} + +// HasOutPullLatestOutput returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasOutPullLatestOutput() bool { + if o != nil && !isNil(o.OutPullLatestOutput) { + return true + } + + return false +} + +// SetOutPullLatestOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPullLatestOutput field. +func (o *NodeConnectionMessagesMetrics) SetOutPullLatestOutput(v NodeConnectionMessageMetrics) { + o.OutPullLatestOutput = &v +} + +// GetOutPullOutputByID returns the OutPullOutputByID field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByID() NodeConnectionMessageMetrics { + if o == nil || isNil(o.OutPullOutputByID) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.OutPullOutputByID +} + +// GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByIDOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.OutPullOutputByID) { + return nil, false + } + return o.OutPullOutputByID, true +} + +// HasOutPullOutputByID returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasOutPullOutputByID() bool { + if o != nil && !isNil(o.OutPullOutputByID) { + return true + } + + return false +} + +// SetOutPullOutputByID gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPullOutputByID field. +func (o *NodeConnectionMessagesMetrics) SetOutPullOutputByID(v NodeConnectionMessageMetrics) { + o.OutPullOutputByID = &v +} + +// GetOutPullTxInclusionState returns the OutPullTxInclusionState field value if set, zero value otherwise. +func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionState() NodeConnectionMessageMetrics { + if o == nil || isNil(o.OutPullTxInclusionState) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.OutPullTxInclusionState +} + +// GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.OutPullTxInclusionState) { + return nil, false + } + return o.OutPullTxInclusionState, true +} + +// HasOutPullTxInclusionState returns a boolean if a field has been set. +func (o *NodeConnectionMessagesMetrics) HasOutPullTxInclusionState() bool { + if o != nil && !isNil(o.OutPullTxInclusionState) { + return true + } + + return false +} + +// SetOutPullTxInclusionState gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPullTxInclusionState field. +func (o *NodeConnectionMessagesMetrics) SetOutPullTxInclusionState(v NodeConnectionMessageMetrics) { + o.OutPullTxInclusionState = &v +} + +func (o NodeConnectionMessagesMetrics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeConnectionMessagesMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.InAliasOutput) { + toSerialize["inAliasOutput"] = o.InAliasOutput + } + if !isNil(o.InOnLedgerRequest) { + toSerialize["inOnLedgerRequest"] = o.InOnLedgerRequest + } + if !isNil(o.InOutput) { + toSerialize["inOutput"] = o.InOutput + } + if !isNil(o.InStateOutput) { + toSerialize["inStateOutput"] = o.InStateOutput + } + if !isNil(o.InTxInclusionState) { + toSerialize["inTxInclusionState"] = o.InTxInclusionState + } + if !isNil(o.OutPublishGovernanceTransaction) { + toSerialize["outPublishGovernanceTransaction"] = o.OutPublishGovernanceTransaction + } + if !isNil(o.OutPublishStateTransaction) { + toSerialize["outPublishStateTransaction"] = o.OutPublishStateTransaction + } + if !isNil(o.OutPullLatestOutput) { + toSerialize["outPullLatestOutput"] = o.OutPullLatestOutput + } + if !isNil(o.OutPullOutputByID) { + toSerialize["outPullOutputByID"] = o.OutPullOutputByID + } + if !isNil(o.OutPullTxInclusionState) { + toSerialize["outPullTxInclusionState"] = o.OutPullTxInclusionState + } + return toSerialize, nil +} + +type NullableNodeConnectionMessagesMetrics struct { + value *NodeConnectionMessagesMetrics + isSet bool +} + +func (v NullableNodeConnectionMessagesMetrics) Get() *NodeConnectionMessagesMetrics { + return v.value +} + +func (v *NullableNodeConnectionMessagesMetrics) Set(val *NodeConnectionMessagesMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableNodeConnectionMessagesMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeConnectionMessagesMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeConnectionMessagesMetrics(val *NodeConnectionMessagesMetrics) *NullableNodeConnectionMessagesMetrics { + return &NullableNodeConnectionMessagesMetrics{value: val, isSet: true} +} + +func (v NullableNodeConnectionMessagesMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeConnectionMessagesMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_node_connection_metrics.go b/clients/apiclient/model_node_connection_metrics.go new file mode 100644 index 0000000000..fb0c19d15f --- /dev/null +++ b/clients/apiclient/model_node_connection_metrics.go @@ -0,0 +1,199 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the NodeConnectionMetrics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeConnectionMetrics{} + +// NodeConnectionMetrics struct for NodeConnectionMetrics +type NodeConnectionMetrics struct { + InMilestone *NodeConnectionMessageMetrics `json:"inMilestone,omitempty"` + NodeConnectionMessagesMetrics *NodeConnectionMessagesMetrics `json:"nodeConnectionMessagesMetrics,omitempty"` + // Chain IDs of the chains registered to receiving L1 events + Registered []string `json:"registered,omitempty"` +} + +// NewNodeConnectionMetrics instantiates a new NodeConnectionMetrics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeConnectionMetrics() *NodeConnectionMetrics { + this := NodeConnectionMetrics{} + return &this +} + +// NewNodeConnectionMetricsWithDefaults instantiates a new NodeConnectionMetrics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeConnectionMetricsWithDefaults() *NodeConnectionMetrics { + this := NodeConnectionMetrics{} + return &this +} + +// GetInMilestone returns the InMilestone field value if set, zero value otherwise. +func (o *NodeConnectionMetrics) GetInMilestone() NodeConnectionMessageMetrics { + if o == nil || isNil(o.InMilestone) { + var ret NodeConnectionMessageMetrics + return ret + } + return *o.InMilestone +} + +// GetInMilestoneOk returns a tuple with the InMilestone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMetrics) GetInMilestoneOk() (*NodeConnectionMessageMetrics, bool) { + if o == nil || isNil(o.InMilestone) { + return nil, false + } + return o.InMilestone, true +} + +// HasInMilestone returns a boolean if a field has been set. +func (o *NodeConnectionMetrics) HasInMilestone() bool { + if o != nil && !isNil(o.InMilestone) { + return true + } + + return false +} + +// SetInMilestone gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InMilestone field. +func (o *NodeConnectionMetrics) SetInMilestone(v NodeConnectionMessageMetrics) { + o.InMilestone = &v +} + +// GetNodeConnectionMessagesMetrics returns the NodeConnectionMessagesMetrics field value if set, zero value otherwise. +func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetrics() NodeConnectionMessagesMetrics { + if o == nil || isNil(o.NodeConnectionMessagesMetrics) { + var ret NodeConnectionMessagesMetrics + return ret + } + return *o.NodeConnectionMessagesMetrics +} + +// GetNodeConnectionMessagesMetricsOk returns a tuple with the NodeConnectionMessagesMetrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetricsOk() (*NodeConnectionMessagesMetrics, bool) { + if o == nil || isNil(o.NodeConnectionMessagesMetrics) { + return nil, false + } + return o.NodeConnectionMessagesMetrics, true +} + +// HasNodeConnectionMessagesMetrics returns a boolean if a field has been set. +func (o *NodeConnectionMetrics) HasNodeConnectionMessagesMetrics() bool { + if o != nil && !isNil(o.NodeConnectionMessagesMetrics) { + return true + } + + return false +} + +// SetNodeConnectionMessagesMetrics gets a reference to the given NodeConnectionMessagesMetrics and assigns it to the NodeConnectionMessagesMetrics field. +func (o *NodeConnectionMetrics) SetNodeConnectionMessagesMetrics(v NodeConnectionMessagesMetrics) { + o.NodeConnectionMessagesMetrics = &v +} + +// GetRegistered returns the Registered field value if set, zero value otherwise. +func (o *NodeConnectionMetrics) GetRegistered() []string { + if o == nil || isNil(o.Registered) { + var ret []string + return ret + } + return o.Registered +} + +// GetRegisteredOk returns a tuple with the Registered field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NodeConnectionMetrics) GetRegisteredOk() ([]string, bool) { + if o == nil || isNil(o.Registered) { + return nil, false + } + return o.Registered, true +} + +// HasRegistered returns a boolean if a field has been set. +func (o *NodeConnectionMetrics) HasRegistered() bool { + if o != nil && !isNil(o.Registered) { + return true + } + + return false +} + +// SetRegistered gets a reference to the given []string and assigns it to the Registered field. +func (o *NodeConnectionMetrics) SetRegistered(v []string) { + o.Registered = v +} + +func (o NodeConnectionMetrics) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeConnectionMetrics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.InMilestone) { + toSerialize["inMilestone"] = o.InMilestone + } + if !isNil(o.NodeConnectionMessagesMetrics) { + toSerialize["nodeConnectionMessagesMetrics"] = o.NodeConnectionMessagesMetrics + } + if !isNil(o.Registered) { + toSerialize["registered"] = o.Registered + } + return toSerialize, nil +} + +type NullableNodeConnectionMetrics struct { + value *NodeConnectionMetrics + isSet bool +} + +func (v NullableNodeConnectionMetrics) Get() *NodeConnectionMetrics { + return v.value +} + +func (v *NullableNodeConnectionMetrics) Set(val *NodeConnectionMetrics) { + v.value = val + v.isSet = true +} + +func (v NullableNodeConnectionMetrics) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeConnectionMetrics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeConnectionMetrics(val *NodeConnectionMetrics) *NullableNodeConnectionMetrics { + return &NullableNodeConnectionMetrics{value: val, isSet: true} +} + +func (v NullableNodeConnectionMetrics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeConnectionMetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_node_owner_certificate_response.go b/clients/apiclient/model_node_owner_certificate_response.go new file mode 100644 index 0000000000..0c45a39cda --- /dev/null +++ b/clients/apiclient/model_node_owner_certificate_response.go @@ -0,0 +1,118 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the NodeOwnerCertificateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NodeOwnerCertificateResponse{} + +// NodeOwnerCertificateResponse struct for NodeOwnerCertificateResponse +type NodeOwnerCertificateResponse struct { + // Certificate stating the ownership. (Hex) + Certificate string `json:"certificate"` +} + +// NewNodeOwnerCertificateResponse instantiates a new NodeOwnerCertificateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNodeOwnerCertificateResponse(certificate string) *NodeOwnerCertificateResponse { + this := NodeOwnerCertificateResponse{} + this.Certificate = certificate + return &this +} + +// NewNodeOwnerCertificateResponseWithDefaults instantiates a new NodeOwnerCertificateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNodeOwnerCertificateResponseWithDefaults() *NodeOwnerCertificateResponse { + this := NodeOwnerCertificateResponse{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *NodeOwnerCertificateResponse) GetCertificate() string { + if o == nil { + var ret string + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *NodeOwnerCertificateResponse) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *NodeOwnerCertificateResponse) SetCertificate(v string) { + o.Certificate = v +} + +func (o NodeOwnerCertificateResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NodeOwnerCertificateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + return toSerialize, nil +} + +type NullableNodeOwnerCertificateResponse struct { + value *NodeOwnerCertificateResponse + isSet bool +} + +func (v NullableNodeOwnerCertificateResponse) Get() *NodeOwnerCertificateResponse { + return v.value +} + +func (v *NullableNodeOwnerCertificateResponse) Set(val *NodeOwnerCertificateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNodeOwnerCertificateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNodeOwnerCertificateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNodeOwnerCertificateResponse(val *NodeOwnerCertificateResponse) *NullableNodeOwnerCertificateResponse { + return &NullableNodeOwnerCertificateResponse{value: val, isSet: true} +} + +func (v NullableNodeOwnerCertificateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNodeOwnerCertificateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_off_ledger_request_body.go b/clients/apiclient/model_off_ledger_request_body.go new file mode 100644 index 0000000000..102781dc94 --- /dev/null +++ b/clients/apiclient/model_off_ledger_request_body.go @@ -0,0 +1,127 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the OffLedgerRequestBody type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OffLedgerRequestBody{} + +// OffLedgerRequestBody struct for OffLedgerRequestBody +type OffLedgerRequestBody struct { + // Offledger Request (base64) + Request *string `json:"request,omitempty"` +} + +// NewOffLedgerRequestBody instantiates a new OffLedgerRequestBody object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOffLedgerRequestBody() *OffLedgerRequestBody { + this := OffLedgerRequestBody{} + return &this +} + +// NewOffLedgerRequestBodyWithDefaults instantiates a new OffLedgerRequestBody object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOffLedgerRequestBodyWithDefaults() *OffLedgerRequestBody { + this := OffLedgerRequestBody{} + return &this +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *OffLedgerRequestBody) GetRequest() string { + if o == nil || isNil(o.Request) { + var ret string + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OffLedgerRequestBody) GetRequestOk() (*string, bool) { + if o == nil || isNil(o.Request) { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *OffLedgerRequestBody) HasRequest() bool { + if o != nil && !isNil(o.Request) { + return true + } + + return false +} + +// SetRequest gets a reference to the given string and assigns it to the Request field. +func (o *OffLedgerRequestBody) SetRequest(v string) { + o.Request = &v +} + +func (o OffLedgerRequestBody) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OffLedgerRequestBody) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Request) { + toSerialize["request"] = o.Request + } + return toSerialize, nil +} + +type NullableOffLedgerRequestBody struct { + value *OffLedgerRequestBody + isSet bool +} + +func (v NullableOffLedgerRequestBody) Get() *OffLedgerRequestBody { + return v.value +} + +func (v *NullableOffLedgerRequestBody) Set(val *OffLedgerRequestBody) { + v.value = val + v.isSet = true +} + +func (v NullableOffLedgerRequestBody) IsSet() bool { + return v.isSet +} + +func (v *NullableOffLedgerRequestBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOffLedgerRequestBody(val *OffLedgerRequestBody) *NullableOffLedgerRequestBody { + return &NullableOffLedgerRequestBody{value: val, isSet: true} +} + +func (v NullableOffLedgerRequestBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOffLedgerRequestBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_peering_node_status.go b/clients/apiclient/model_peering_node_status.go new file mode 100644 index 0000000000..c4110a7114 --- /dev/null +++ b/clients/apiclient/model_peering_node_status.go @@ -0,0 +1,234 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the PeeringNodeStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PeeringNodeStatus{} + +// PeeringNodeStatus struct for PeeringNodeStatus +type PeeringNodeStatus struct { + IsAlive *bool `json:"IsAlive,omitempty"` + NetID *string `json:"NetID,omitempty"` + NumUsers *int32 `json:"NumUsers,omitempty"` + PubKey *string `json:"PubKey,omitempty"` +} + +// NewPeeringNodeStatus instantiates a new PeeringNodeStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPeeringNodeStatus() *PeeringNodeStatus { + this := PeeringNodeStatus{} + return &this +} + +// NewPeeringNodeStatusWithDefaults instantiates a new PeeringNodeStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPeeringNodeStatusWithDefaults() *PeeringNodeStatus { + this := PeeringNodeStatus{} + return &this +} + +// GetIsAlive returns the IsAlive field value if set, zero value otherwise. +func (o *PeeringNodeStatus) GetIsAlive() bool { + if o == nil || isNil(o.IsAlive) { + var ret bool + return ret + } + return *o.IsAlive +} + +// GetIsAliveOk returns a tuple with the IsAlive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatus) GetIsAliveOk() (*bool, bool) { + if o == nil || isNil(o.IsAlive) { + return nil, false + } + return o.IsAlive, true +} + +// HasIsAlive returns a boolean if a field has been set. +func (o *PeeringNodeStatus) HasIsAlive() bool { + if o != nil && !isNil(o.IsAlive) { + return true + } + + return false +} + +// SetIsAlive gets a reference to the given bool and assigns it to the IsAlive field. +func (o *PeeringNodeStatus) SetIsAlive(v bool) { + o.IsAlive = &v +} + +// GetNetID returns the NetID field value if set, zero value otherwise. +func (o *PeeringNodeStatus) GetNetID() string { + if o == nil || isNil(o.NetID) { + var ret string + return ret + } + return *o.NetID +} + +// GetNetIDOk returns a tuple with the NetID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatus) GetNetIDOk() (*string, bool) { + if o == nil || isNil(o.NetID) { + return nil, false + } + return o.NetID, true +} + +// HasNetID returns a boolean if a field has been set. +func (o *PeeringNodeStatus) HasNetID() bool { + if o != nil && !isNil(o.NetID) { + return true + } + + return false +} + +// SetNetID gets a reference to the given string and assigns it to the NetID field. +func (o *PeeringNodeStatus) SetNetID(v string) { + o.NetID = &v +} + +// GetNumUsers returns the NumUsers field value if set, zero value otherwise. +func (o *PeeringNodeStatus) GetNumUsers() int32 { + if o == nil || isNil(o.NumUsers) { + var ret int32 + return ret + } + return *o.NumUsers +} + +// GetNumUsersOk returns a tuple with the NumUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatus) GetNumUsersOk() (*int32, bool) { + if o == nil || isNil(o.NumUsers) { + return nil, false + } + return o.NumUsers, true +} + +// HasNumUsers returns a boolean if a field has been set. +func (o *PeeringNodeStatus) HasNumUsers() bool { + if o != nil && !isNil(o.NumUsers) { + return true + } + + return false +} + +// SetNumUsers gets a reference to the given int32 and assigns it to the NumUsers field. +func (o *PeeringNodeStatus) SetNumUsers(v int32) { + o.NumUsers = &v +} + +// GetPubKey returns the PubKey field value if set, zero value otherwise. +func (o *PeeringNodeStatus) GetPubKey() string { + if o == nil || isNil(o.PubKey) { + var ret string + return ret + } + return *o.PubKey +} + +// GetPubKeyOk returns a tuple with the PubKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringNodeStatus) GetPubKeyOk() (*string, bool) { + if o == nil || isNil(o.PubKey) { + return nil, false + } + return o.PubKey, true +} + +// HasPubKey returns a boolean if a field has been set. +func (o *PeeringNodeStatus) HasPubKey() bool { + if o != nil && !isNil(o.PubKey) { + return true + } + + return false +} + +// SetPubKey gets a reference to the given string and assigns it to the PubKey field. +func (o *PeeringNodeStatus) SetPubKey(v string) { + o.PubKey = &v +} + +func (o PeeringNodeStatus) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PeeringNodeStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.IsAlive) { + toSerialize["IsAlive"] = o.IsAlive + } + if !isNil(o.NetID) { + toSerialize["NetID"] = o.NetID + } + if !isNil(o.NumUsers) { + toSerialize["NumUsers"] = o.NumUsers + } + if !isNil(o.PubKey) { + toSerialize["PubKey"] = o.PubKey + } + return toSerialize, nil +} + +type NullablePeeringNodeStatus struct { + value *PeeringNodeStatus + isSet bool +} + +func (v NullablePeeringNodeStatus) Get() *PeeringNodeStatus { + return v.value +} + +func (v *NullablePeeringNodeStatus) Set(val *PeeringNodeStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePeeringNodeStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePeeringNodeStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePeeringNodeStatus(val *PeeringNodeStatus) *NullablePeeringNodeStatus { + return &NullablePeeringNodeStatus{value: val, isSet: true} +} + +func (v NullablePeeringNodeStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePeeringNodeStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_peering_trusted_node.go b/clients/apiclient/model_peering_trusted_node.go new file mode 100644 index 0000000000..09cc1850ea --- /dev/null +++ b/clients/apiclient/model_peering_trusted_node.go @@ -0,0 +1,164 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the PeeringTrustedNode type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PeeringTrustedNode{} + +// PeeringTrustedNode struct for PeeringTrustedNode +type PeeringTrustedNode struct { + // NetID of a peer to trust. + NetId *string `json:"netId,omitempty"` + // Public key of the NetID. + PubKey *string `json:"pubKey,omitempty"` +} + +// NewPeeringTrustedNode instantiates a new PeeringTrustedNode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPeeringTrustedNode() *PeeringTrustedNode { + this := PeeringTrustedNode{} + return &this +} + +// NewPeeringTrustedNodeWithDefaults instantiates a new PeeringTrustedNode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPeeringTrustedNodeWithDefaults() *PeeringTrustedNode { + this := PeeringTrustedNode{} + return &this +} + +// GetNetId returns the NetId field value if set, zero value otherwise. +func (o *PeeringTrustedNode) GetNetId() string { + if o == nil || isNil(o.NetId) { + var ret string + return ret + } + return *o.NetId +} + +// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringTrustedNode) GetNetIdOk() (*string, bool) { + if o == nil || isNil(o.NetId) { + return nil, false + } + return o.NetId, true +} + +// HasNetId returns a boolean if a field has been set. +func (o *PeeringTrustedNode) HasNetId() bool { + if o != nil && !isNil(o.NetId) { + return true + } + + return false +} + +// SetNetId gets a reference to the given string and assigns it to the NetId field. +func (o *PeeringTrustedNode) SetNetId(v string) { + o.NetId = &v +} + +// GetPubKey returns the PubKey field value if set, zero value otherwise. +func (o *PeeringTrustedNode) GetPubKey() string { + if o == nil || isNil(o.PubKey) { + var ret string + return ret + } + return *o.PubKey +} + +// GetPubKeyOk returns a tuple with the PubKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PeeringTrustedNode) GetPubKeyOk() (*string, bool) { + if o == nil || isNil(o.PubKey) { + return nil, false + } + return o.PubKey, true +} + +// HasPubKey returns a boolean if a field has been set. +func (o *PeeringTrustedNode) HasPubKey() bool { + if o != nil && !isNil(o.PubKey) { + return true + } + + return false +} + +// SetPubKey gets a reference to the given string and assigns it to the PubKey field. +func (o *PeeringTrustedNode) SetPubKey(v string) { + o.PubKey = &v +} + +func (o PeeringTrustedNode) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PeeringTrustedNode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.NetId) { + toSerialize["netId"] = o.NetId + } + if !isNil(o.PubKey) { + toSerialize["pubKey"] = o.PubKey + } + return toSerialize, nil +} + +type NullablePeeringTrustedNode struct { + value *PeeringTrustedNode + isSet bool +} + +func (v NullablePeeringTrustedNode) Get() *PeeringTrustedNode { + return v.value +} + +func (v *NullablePeeringTrustedNode) Set(val *PeeringTrustedNode) { + v.value = val + v.isSet = true +} + +func (v NullablePeeringTrustedNode) IsSet() bool { + return v.isSet +} + +func (v *NullablePeeringTrustedNode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePeeringTrustedNode(val *PeeringTrustedNode) *NullablePeeringTrustedNode { + return &NullablePeeringTrustedNode{value: val, isSet: true} +} + +func (v NullablePeeringTrustedNode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePeeringTrustedNode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_publisher_state_transaction_item.go b/clients/apiclient/model_publisher_state_transaction_item.go new file mode 100644 index 0000000000..10b7751d9c --- /dev/null +++ b/clients/apiclient/model_publisher_state_transaction_item.go @@ -0,0 +1,172 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" + "time" +) + +// checks if the PublisherStateTransactionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublisherStateTransactionItem{} + +// PublisherStateTransactionItem struct for PublisherStateTransactionItem +type PublisherStateTransactionItem struct { + LastMessage StateTransaction `json:"lastMessage"` + Messages uint32 `json:"messages"` + Timestamp time.Time `json:"timestamp"` +} + +// NewPublisherStateTransactionItem instantiates a new PublisherStateTransactionItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublisherStateTransactionItem(lastMessage StateTransaction, messages uint32, timestamp time.Time) *PublisherStateTransactionItem { + this := PublisherStateTransactionItem{} + this.LastMessage = lastMessage + this.Messages = messages + this.Timestamp = timestamp + return &this +} + +// NewPublisherStateTransactionItemWithDefaults instantiates a new PublisherStateTransactionItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublisherStateTransactionItemWithDefaults() *PublisherStateTransactionItem { + this := PublisherStateTransactionItem{} + return &this +} + +// GetLastMessage returns the LastMessage field value +func (o *PublisherStateTransactionItem) GetLastMessage() StateTransaction { + if o == nil { + var ret StateTransaction + return ret + } + + return o.LastMessage +} + +// GetLastMessageOk returns a tuple with the LastMessage field value +// and a boolean to check if the value has been set. +func (o *PublisherStateTransactionItem) GetLastMessageOk() (*StateTransaction, bool) { + if o == nil { + return nil, false + } + return &o.LastMessage, true +} + +// SetLastMessage sets field value +func (o *PublisherStateTransactionItem) SetLastMessage(v StateTransaction) { + o.LastMessage = v +} + +// GetMessages returns the Messages field value +func (o *PublisherStateTransactionItem) GetMessages() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *PublisherStateTransactionItem) GetMessagesOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.Messages, true +} + +// SetMessages sets field value +func (o *PublisherStateTransactionItem) SetMessages(v uint32) { + o.Messages = v +} + +// GetTimestamp returns the Timestamp field value +func (o *PublisherStateTransactionItem) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *PublisherStateTransactionItem) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *PublisherStateTransactionItem) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +func (o PublisherStateTransactionItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublisherStateTransactionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["lastMessage"] = o.LastMessage + toSerialize["messages"] = o.Messages + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullablePublisherStateTransactionItem struct { + value *PublisherStateTransactionItem + isSet bool +} + +func (v NullablePublisherStateTransactionItem) Get() *PublisherStateTransactionItem { + return v.value +} + +func (v *NullablePublisherStateTransactionItem) Set(val *PublisherStateTransactionItem) { + v.value = val + v.isSet = true +} + +func (v NullablePublisherStateTransactionItem) IsSet() bool { + return v.isSet +} + +func (v *NullablePublisherStateTransactionItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublisherStateTransactionItem(val *PublisherStateTransactionItem) *NullablePublisherStateTransactionItem { + return &NullablePublisherStateTransactionItem{value: val, isSet: true} +} + +func (v NullablePublisherStateTransactionItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublisherStateTransactionItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_state_transaction.go b/clients/apiclient/model_state_transaction.go new file mode 100644 index 0000000000..3cec4a3e48 --- /dev/null +++ b/clients/apiclient/model_state_transaction.go @@ -0,0 +1,146 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the StateTransaction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StateTransaction{} + +// StateTransaction struct for StateTransaction +type StateTransaction struct { + // The state index + StateIndex uint32 `json:"stateIndex"` + // The transaction ID + TxId string `json:"txId"` +} + +// NewStateTransaction instantiates a new StateTransaction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStateTransaction(stateIndex uint32, txId string) *StateTransaction { + this := StateTransaction{} + this.StateIndex = stateIndex + this.TxId = txId + return &this +} + +// NewStateTransactionWithDefaults instantiates a new StateTransaction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStateTransactionWithDefaults() *StateTransaction { + this := StateTransaction{} + return &this +} + +// GetStateIndex returns the StateIndex field value +func (o *StateTransaction) GetStateIndex() uint32 { + if o == nil { + var ret uint32 + return ret + } + + return o.StateIndex +} + +// GetStateIndexOk returns a tuple with the StateIndex field value +// and a boolean to check if the value has been set. +func (o *StateTransaction) GetStateIndexOk() (*uint32, bool) { + if o == nil { + return nil, false + } + return &o.StateIndex, true +} + +// SetStateIndex sets field value +func (o *StateTransaction) SetStateIndex(v uint32) { + o.StateIndex = v +} + +// GetTxId returns the TxId field value +func (o *StateTransaction) GetTxId() string { + if o == nil { + var ret string + return ret + } + + return o.TxId +} + +// GetTxIdOk returns a tuple with the TxId field value +// and a boolean to check if the value has been set. +func (o *StateTransaction) GetTxIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TxId, true +} + +// SetTxId sets field value +func (o *StateTransaction) SetTxId(v string) { + o.TxId = v +} + +func (o StateTransaction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StateTransaction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["stateIndex"] = o.StateIndex + toSerialize["txId"] = o.TxId + return toSerialize, nil +} + +type NullableStateTransaction struct { + value *StateTransaction + isSet bool +} + +func (v NullableStateTransaction) Get() *StateTransaction { + return v.value +} + +func (v *NullableStateTransaction) Set(val *StateTransaction) { + v.value = val + v.isSet = true +} + +func (v NullableStateTransaction) IsSet() bool { + return v.isSet +} + +func (v *NullableStateTransaction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStateTransaction(val *StateTransaction) *NullableStateTransaction { + return &NullableStateTransaction{value: val, isSet: true} +} + +func (v NullableStateTransaction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStateTransaction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_wait_request_processed_params.go b/clients/apiclient/model_wait_request_processed_params.go new file mode 100644 index 0000000000..d1e2f7561f --- /dev/null +++ b/clients/apiclient/model_wait_request_processed_params.go @@ -0,0 +1,127 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 123 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the WaitRequestProcessedParams type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WaitRequestProcessedParams{} + +// WaitRequestProcessedParams struct for WaitRequestProcessedParams +type WaitRequestProcessedParams struct { + // Timeout in nanoseconds + Timeout *int64 `json:"timeout,omitempty"` +} + +// NewWaitRequestProcessedParams instantiates a new WaitRequestProcessedParams object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWaitRequestProcessedParams() *WaitRequestProcessedParams { + this := WaitRequestProcessedParams{} + return &this +} + +// NewWaitRequestProcessedParamsWithDefaults instantiates a new WaitRequestProcessedParams object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWaitRequestProcessedParamsWithDefaults() *WaitRequestProcessedParams { + this := WaitRequestProcessedParams{} + return &this +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *WaitRequestProcessedParams) GetTimeout() int64 { + if o == nil || isNil(o.Timeout) { + var ret int64 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WaitRequestProcessedParams) GetTimeoutOk() (*int64, bool) { + if o == nil || isNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *WaitRequestProcessedParams) HasTimeout() bool { + if o != nil && !isNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int64 and assigns it to the Timeout field. +func (o *WaitRequestProcessedParams) SetTimeout(v int64) { + o.Timeout = &v +} + +func (o WaitRequestProcessedParams) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WaitRequestProcessedParams) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + return toSerialize, nil +} + +type NullableWaitRequestProcessedParams struct { + value *WaitRequestProcessedParams + isSet bool +} + +func (v NullableWaitRequestProcessedParams) Get() *WaitRequestProcessedParams { + return v.value +} + +func (v *NullableWaitRequestProcessedParams) Set(val *WaitRequestProcessedParams) { + v.value = val + v.isSet = true +} + +func (v NullableWaitRequestProcessedParams) IsSet() bool { + return v.isSet +} + +func (v *NullableWaitRequestProcessedParams) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWaitRequestProcessedParams(val *WaitRequestProcessedParams) *NullableWaitRequestProcessedParams { + return &NullableWaitRequestProcessedParams{value: val, isSet: true} +} + +func (v NullableWaitRequestProcessedParams) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWaitRequestProcessedParams) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/test/api_admin_test.go b/clients/apiclient/test/api_admin_test.go new file mode 100644 index 0000000000..5c992b96ac --- /dev/null +++ b/clients/apiclient/test/api_admin_test.go @@ -0,0 +1,321 @@ +/* +Wasp API + +Testing AdminApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apiclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func Test_apiclient_AdminApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AdminApiService AdmChainChainIDAccessNodePubKeyDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var pubKey string + + httpRes, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyDelete(context.Background(), chainID, pubKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDAccessNodePubKeyPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var pubKey string + + httpRes, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyPut(context.Background(), chainID, pubKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDActivatePost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + httpRes, err := apiClient.AdminApi.AdmChainChainIDActivatePost(context.Background(), chainID).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDConsensusMetricsPipeGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.AdminApi.AdmChainChainIDConsensusMetricsPipeGet(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDConsensusStatusGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.AdminApi.AdmChainChainIDConsensusStatusGet(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDDeactivatePost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + httpRes, err := apiClient.AdminApi.AdmChainChainIDDeactivatePost(context.Background(), chainID).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDInfoGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + httpRes, err := apiClient.AdminApi.AdmChainChainIDInfoGet(context.Background(), chainID).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainChainIDNodeconnMetricsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.AdminApi.AdmChainChainIDNodeconnMetricsGet(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainNodeconnMetricsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmChainNodeconnMetricsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainrecordChainIDGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + resp, httpRes, err := apiClient.AdminApi.AdmChainrecordChainIDGet(context.Background(), chainID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainrecordPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.AdminApi.AdmChainrecordPost(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmChainrecordsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmChainrecordsGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmDksPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmDksPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmDksSharedAddressGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var sharedAddress string + + resp, httpRes, err := apiClient.AdminApi.AdmDksSharedAddressGet(context.Background(), sharedAddress).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmNodeOwnerCertificatePost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmNodeOwnerCertificatePost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringEstablishedGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmPeeringEstablishedGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringSelfGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmPeeringSelfGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringTrustedGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringTrustedPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPost(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringTrustedPubKeyDelete", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var pubKey string + + httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyDelete(context.Background(), pubKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringTrustedPubKeyGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var pubKey string + + resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyGet(context.Background(), pubKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmPeeringTrustedPubKeyPut", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var pubKey string + + resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyPut(context.Background(), pubKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AdminApiService AdmShutdownGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.AdminApi.AdmShutdownGet(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/clients/apiclient/test/api_public_test.go b/clients/apiclient/test/api_public_test.go new file mode 100644 index 0000000000..318a4673e5 --- /dev/null +++ b/clients/apiclient/test/api_public_test.go @@ -0,0 +1,187 @@ +/* +Wasp API + +Testing PublicApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package apiclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func Test_apiclient_PublicApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewFnameGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var contractHname string + var fname string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnameGet(context.Background(), chainID, contractHname, fname).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewFnamePost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var contractHname string + var fname string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnamePost(context.Background(), chainID, contractHname, fname).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var contractHname string + var functionHname string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(context.Background(), chainID, contractHname, functionHname).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var contractHname string + var functionHname string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(context.Background(), chainID, contractHname, functionHname).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDEvmReqidTxHashGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var txHash string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDEvmReqidTxHashGet(context.Background(), chainID, txHash).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDRequestPost", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + httpRes, err := apiClient.PublicApi.ChainChainIDRequestPost(context.Background(), chainID).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDRequestReqIDReceiptGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var reqID string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDRequestReqIDReceiptGet(context.Background(), chainID, reqID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDRequestReqIDWaitGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var reqID string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDRequestReqIDWaitGet(context.Background(), chainID, reqID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDStateKeyGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + var key string + + resp, httpRes, err := apiClient.PublicApi.ChainChainIDStateKeyGet(context.Background(), chainID, key).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService ChainChainIDWsGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var chainID string + + httpRes, err := apiClient.PublicApi.ChainChainIDWsGet(context.Background(), chainID).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PublicApiService InfoGet", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PublicApi.InfoGet(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/clients/apiutils.go b/clients/apiutils.go index 79ba96a33a..d5c9a07338 100644 --- a/clients/apiutils.go +++ b/clients/apiutils.go @@ -1,29 +1,34 @@ package clients import ( + "context" + "time" + + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" ) func JSONDictToAPIJSONDict(jsonDict dict.JSONDict) apiclient.JSONDict { - apiJsonDict := apiclient.NewJSONDict() + apiJSONDict := apiclient.NewJSONDict() for k, v := range jsonDict.Items { - apiJsonDict.Items[k] = apiclient.Item{ + apiJSONDict.Items[k] = apiclient.Item{ Key: v.Key, Value: v.Value, } } - return *apiJsonDict + return *apiJSONDict } -func APIJsonDictToJSONDict(apiJsonDict apiclient.JSONDict) dict.JSONDict { +func APIJsonDictToJSONDict(apiJSONDict apiclient.JSONDict) dict.JSONDict { jsonDict := dict.JSONDict{ - Items: make([]dict.Item, len(apiJsonDict.Items)), + Items: make([]dict.Item, len(apiJSONDict.Items)), } - for k, v := range apiJsonDict.Items { + for k, v := range apiJSONDict.Items { jsonDict.Items[k] = dict.Item{ Key: v.Key, Value: v.Value, @@ -33,8 +38,27 @@ func APIJsonDictToJSONDict(apiJsonDict apiclient.JSONDict) dict.JSONDict { return jsonDict } -func APIJsonDictToDict(apiJsonDict apiclient.JSONDict) (dict.Dict, error) { - jsonDict := APIJsonDictToJSONDict(apiJsonDict) +func APIJsonDictToDict(apiJSONDict apiclient.JSONDict) (dict.Dict, error) { + jsonDict := APIJsonDictToJSONDict(apiJSONDict) return dict.FromJSONDict(jsonDict) -} \ No newline at end of file +} + +func APIWaitUntilAllRequestsProcessed(client *apiclient.APIClient, chainID isc.ChainID, tx *iotago.Transaction, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) { + reqs, err := isc.RequestsInTransaction(tx) + if err != nil { + return nil, err + } + ret := make([]*apiclient.ReceiptResponse, len(reqs)) + for i, req := range reqs[chainID] { + receipt, _, err := client.RequestsApi. + WaitForRequest(context.Background(), chainID.String(), req.ID().String()). + Execute() + if err != nil { + return nil, err + } + + ret[i] = receipt + } + return ret, nil +} diff --git a/clients/chainclient/uploadblob.go b/clients/chainclient/uploadblob.go index 340ad9e8b9..fc6fc733fd 100644 --- a/clients/chainclient/uploadblob.go +++ b/clients/chainclient/uploadblob.go @@ -25,7 +25,7 @@ func (c *Client) UploadBlob(ctx context.Context, fields dict.Dict) (hashing.Hash return hashing.NilHash, nil, nil, err } - receipt, _, err := c.WaspClient.RequestsApi.WaitForTransaction(ctx, c.ChainID.String(), req.ID().String()).Execute() + receipt, _, err := c.WaspClient.RequestsApi.WaitForRequest(ctx, c.ChainID.String(), req.ID().String()).Execute() return blobHash, req, receipt, err } diff --git a/clients/multiclient/activate.go b/clients/multiclient/activate.go new file mode 100644 index 0000000000..0e5b1fafcb --- /dev/null +++ b/clients/multiclient/activate.go @@ -0,0 +1,24 @@ +package multiclient + +import ( + "context" + + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/isc" +) + +// ActivateChain sends a request to activate a chain in all wasp nodes +func (m *MultiClient) ActivateChain(chainID isc.ChainID) error { + return m.Do(func(i int, w *apiclient.APIClient) error { + _, err := w.ChainsApi.ActivateChain(context.Background(), chainID.String()).Execute() + return err + }) +} + +// DeactivateChain sends a request to deactivate a chain in all wasp nodes +func (m *MultiClient) DeactivateChain(chainID isc.ChainID) error { + return m.Do(func(i int, w *apiclient.APIClient) error { + _, err := w.ChainsApi.DeactivateChain(context.Background(), chainID.String()).Execute() + return err + }) +} diff --git a/clients/multiclient/chain_record.go b/clients/multiclient/chain_record.go new file mode 100644 index 0000000000..33e341b9eb --- /dev/null +++ b/clients/multiclient/chain_record.go @@ -0,0 +1,30 @@ +package multiclient + +import ( + "context" + + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/registry" +) + +// PutChainRecord calls PutChainRecord in all wasp nodes +func (m *MultiClient) PutChainRecord(bd *registry.ChainRecord) error { + return m.Do(func(i int, w *apiclient.APIClient) error { + // TODO: Validate the replacement logic from PutChainRecord => ActivateChain + AccessNodes + _, err := w.ChainsApi.ActivateChain(context.Background(), bd.ChainID().String()).Execute() + + if err != nil { + return err + } + + for _, accessNode := range bd.AccessNodes { + _, err := w.ChainsApi.AddAccessNode(context.Background(), bd.ChainID().String(), accessNode.String()).Execute() + + if err != nil { + return err + } + } + + return nil + }) +} diff --git a/clients/multiclient/dkshares.go b/clients/multiclient/dkshares.go new file mode 100644 index 0000000000..8133a1a8d8 --- /dev/null +++ b/clients/multiclient/dkshares.go @@ -0,0 +1,19 @@ +package multiclient + +import ( + "context" + + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" +) + +// DKSharesGet retrieves distributed key info with specific ChainID from multiple hosts. +func (m *MultiClient) DKSharesGet(sharedAddress iotago.Address) ([]*apiclient.DKSharesInfo, error) { + ret := make([]*apiclient.DKSharesInfo, len(m.nodes)) + err := m.Do(func(i int, w *apiclient.APIClient) error { + sharesInfo, _, err := w.NodeApi.GetDKSInfo(context.Background(), sharedAddress.String()).Execute() + ret[i] = sharesInfo + return err + }) + return ret, err +} diff --git a/clients/multiclient/multiclient.go b/clients/multiclient/multiclient.go new file mode 100644 index 0000000000..3a6e000fcc --- /dev/null +++ b/clients/multiclient/multiclient.go @@ -0,0 +1,51 @@ +package multiclient + +import ( + "time" + + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/util/multicall" +) + +type ClientResolver func(apiHost string) *apiclient.APIClient + +// MultiClient allows to send webapi requests in parallel to multiple wasp nodes +type MultiClient struct { + nodes []*apiclient.APIClient + + Timeout time.Duration +} + +// New creates a new instance of MultiClient +func New(resolver ClientResolver, hosts []string) *MultiClient { + m := &MultiClient{ + nodes: make([]*apiclient.APIClient, len(hosts)), + } + + for i, host := range hosts { + m.nodes[i] = resolver(host) + } + + m.Timeout = 30 * time.Second + return m +} + +func (m *MultiClient) Len() int { + return len(m.nodes) +} + +// Do executes a callback once for each node in parallel, then wraps all error results into a single one +func (m *MultiClient) Do(f func(int, *apiclient.APIClient) error) error { + return m.DoWithQuorum(f, len(m.nodes)) +} + +// Do executes a callback once for each node in parallel, then wraps all error results into a single one +func (m *MultiClient) DoWithQuorum(f func(int, *apiclient.APIClient) error, quorum int) error { + funs := make([]func() error, len(m.nodes)) + for i := range m.nodes { + j := i // duplicate variable for closure + funs[j] = func() error { return f(j, m.nodes[j]) } + } + errs := multicall.MultiCall(funs, m.Timeout) + return multicall.WrapErrorsWithQuorum(errs, quorum) +} diff --git a/clients/multiclient/reqstatus.go b/clients/multiclient/reqstatus.go new file mode 100644 index 0000000000..239a4c5b84 --- /dev/null +++ b/clients/multiclient/reqstatus.go @@ -0,0 +1,74 @@ +package multiclient + +import ( + "context" + "fmt" + "time" + + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/isc" +) + +// WaitUntilRequestProcessed blocks until the request has been processed by all nodes +func (m *MultiClient) WaitUntilRequestProcessed(chainID isc.ChainID, reqID isc.RequestID, timeout time.Duration) (*apiclient.ReceiptResponse, error) { + oldTimeout := m.Timeout + defer func() { m.Timeout = oldTimeout }() + + m.Timeout = timeout + + var receipt *apiclient.ReceiptResponse + var err error + err = m.Do(func(i int, w *apiclient.APIClient) error { + receipt, _, err = w.RequestsApi.WaitForRequest(context.Background(), chainID.String(), reqID.String()).Execute() + return err + }) + return receipt, err +} + +// WaitUntilRequestProcessedSuccessfully is similar to WaitUntilRequestProcessed, +// but also checks the receipt and return an error if the request was processed with an error +func (m *MultiClient) WaitUntilRequestProcessedSuccessfully(chainID isc.ChainID, reqID isc.RequestID, timeout time.Duration) (*apiclient.ReceiptResponse, error) { + receipt, err := m.WaitUntilRequestProcessed(chainID, reqID, timeout) + if err != nil { + return receipt, err + } + if receipt.Error != nil { + return receipt, fmt.Errorf("request processed with an error: %s", receipt.Error.Message) + } + return receipt, nil +} + +// WaitUntilAllRequestsProcessed blocks until all requests in the given transaction have been processed +// by all nodes +func (m *MultiClient) WaitUntilAllRequestsProcessed(chainID isc.ChainID, tx *iotago.Transaction, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) { + oldTimeout := m.Timeout + defer func() { m.Timeout = oldTimeout }() + + m.Timeout = timeout + + var receipts []*apiclient.ReceiptResponse + var err error + err = m.Do(func(i int, w *apiclient.APIClient) error { + receipts, err = clients.APIWaitUntilAllRequestsProcessed(w, chainID, tx, timeout) + return err + }) + + return receipts, err +} + +// WaitUntilAllRequestsProcessedSuccessfully is similar to WaitUntilAllRequestsProcessed +// but also checks the receipts and return an error if any of the requests was processed with an error +func (m *MultiClient) WaitUntilAllRequestsProcessedSuccessfully(chainID isc.ChainID, tx *iotago.Transaction, timeout time.Duration) ([]*apiclient.ReceiptResponse, error) { + receipts, err := m.WaitUntilAllRequestsProcessed(chainID, tx, timeout) + if err != nil { + return receipts, err + } + for i, receipt := range receipts { + if receipt.Error != nil { + return receipts, fmt.Errorf("error found on receipt #%d: %s", i, receipt.Error.Message) + } + } + return receipts, nil +} diff --git a/packages/apilib/deploychain.go b/packages/apilib/deploychain.go index 95eaccc458..b1edb07e78 100644 --- a/packages/apilib/deploychain.go +++ b/packages/apilib/deploychain.go @@ -10,7 +10,7 @@ import ( "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/multiclient" + "github.com/iotaledger/wasp/clients/multiclient" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" @@ -34,14 +34,13 @@ type CreateChainParams struct { Prefix string InitParams dict.Dict GovernanceController iotago.Address - AuthenticationToken string } // DeployChainWithDKG performs all actions needed to deploy the chain // TODO: [KP] Shouldn't that be in the client packages? -func DeployChainWithDKG(par CreateChainParams) (isc.ChainID, iotago.Address, error) { +func DeployChainWithDKG(clientResolver multiclient.ClientResolver, par CreateChainParams) (isc.ChainID, iotago.Address, error) { dkgInitiatorIndex := uint16(rand.Intn(len(par.CommitteeAPIHosts))) - stateControllerAddr, err := RunDKG(par.AuthenticationToken, par.CommitteeAPIHosts, par.CommitteePubKeys, par.T, dkgInitiatorIndex) + stateControllerAddr, err := RunDKG(clientResolver, par.CommitteeAPIHosts, par.CommitteePubKeys, par.T, dkgInitiatorIndex) if err != nil { return isc.ChainID{}, nil, err } @@ -49,7 +48,7 @@ func DeployChainWithDKG(par CreateChainParams) (isc.ChainID, iotago.Address, err if par.GovernanceController != nil { govControllerAddr = par.GovernanceController } - chainID, err := DeployChain(par, stateControllerAddr, govControllerAddr) + chainID, err := DeployChain(clientResolver, par, stateControllerAddr, govControllerAddr) if err != nil { return isc.ChainID{}, nil, err } @@ -59,7 +58,7 @@ func DeployChainWithDKG(par CreateChainParams) (isc.ChainID, iotago.Address, err // DeployChain creates a new chain on specified committee address // noinspection ALL -func DeployChain(par CreateChainParams, stateControllerAddr, govControllerAddr iotago.Address) (isc.ChainID, error) { +func DeployChain(clientResolver multiclient.ClientResolver, par CreateChainParams, stateControllerAddr, govControllerAddr iotago.Address) (isc.ChainID, error) { var err error textout := io.Discard if par.Textout != nil { @@ -93,7 +92,7 @@ func DeployChain(par CreateChainParams, stateControllerAddr, govControllerAddr i fmt.Fprintf(textout, "creating chain origin and init transaction %s.. OK\n", txID.ToHex()) fmt.Fprint(textout, "sending committee record to nodes.. OK\n") - err = ActivateChainOnNodes(par.AuthenticationToken, par.CommitteeAPIHosts, chainID) + err = ActivateChainOnNodes(clientResolver, par.CommitteeAPIHosts, chainID) fmt.Fprint(textout, par.Prefix) if err != nil { fmt.Fprintf(textout, "activating chain %s.. FAILED: %v\n", chainID.String(), err) @@ -102,9 +101,9 @@ func DeployChain(par CreateChainParams, stateControllerAddr, govControllerAddr i fmt.Fprintf(textout, "activating chain %s.. OK.\n", chainID.String()) // ---------- wait until the request is processed at least in all committee nodes - _, err = multiclient.New(par.CommitteeAPIHosts). - WithToken(par.AuthenticationToken). + _, err = multiclient.New(clientResolver, par.CommitteeAPIHosts). WaitUntilAllRequestsProcessedSuccessfully(chainID, initRequestTx, 30*time.Second) + if err != nil { fmt.Fprintf(textout, "waiting root init request transaction.. FAILED: %v\n", err) return isc.ChainID{}, fmt.Errorf("DeployChain: %w", err) @@ -188,8 +187,8 @@ func CreateChainOrigin( } // ActivateChainOnNodes puts chain records into nodes and activates its -func ActivateChainOnNodes(authToken string, apiHosts []string, chainID isc.ChainID) error { - nodes := multiclient.New(apiHosts).WithToken(authToken) +func ActivateChainOnNodes(clientResolver multiclient.ClientResolver, apiHosts []string, chainID isc.ChainID) error { + nodes := multiclient.New(clientResolver, apiHosts) // ------------ put chain records to hosts return nodes.PutChainRecord(registry.NewChainRecord(chainID, true, []*cryptolib.PublicKey{})) } diff --git a/packages/apilib/rundkg.go b/packages/apilib/rundkg.go index caed81ff64..4bf0524ff6 100644 --- a/packages/apilib/rundkg.go +++ b/packages/apilib/rundkg.go @@ -4,18 +4,20 @@ package apilib import ( + "context" "errors" "fmt" "math" "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/webapi/v1/model" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/multiclient" ) // RunDKG runs DKG procedure on specific Wasp hosts: generates new keys and puts corresponding committee records // into nodes. In case of success, generated address is returned -func RunDKG(authToken string, apiHosts, peerPubKeys []string, threshold, initiatorIndex uint16, timeout ...time.Duration) (iotago.Address, error) { +func RunDKG(clientResolver multiclient.ClientResolver, apiHosts, peerPubKeys []string, threshold, initiatorIndex uint16, timeout ...time.Duration) (iotago.Address, error) { to := uint32(60 * 1000) if len(timeout) > 0 { n := timeout[0].Milliseconds() @@ -26,14 +28,18 @@ func RunDKG(authToken string, apiHosts, peerPubKeys []string, threshold, initiat if int(initiatorIndex) >= len(apiHosts) { return nil, errors.New("RunDKG: wrong initiator index") } - dkShares, err := clients.NewWaspClient(apiHosts[initiatorIndex]).WithToken(authToken).DKSharesPost(&model.DKSharesPostRequest{ - PeerPubKeys: peerPubKeys, - Threshold: threshold, - TimeoutMS: to, // 1 min - }) + + client := clientResolver(apiHosts[initiatorIndex]) + dkShares, _, err := client.NodeApi.GenerateDKS(context.Background()).DKSharesPostRequest(apiclient.DKSharesPostRequest{ + Threshold: uint32(threshold), + TimeoutMS: to, + PeerIdentities: peerPubKeys, + }).Execute() + if err != nil { return nil, err } + _, addr, err := iotago.ParseBech32(dkShares.Address) if err != nil { return nil, fmt.Errorf("RunDKG: invalid address returned from DKG: %w", err) diff --git a/packages/dashboard/base.go b/packages/dashboard/base.go index e7f60827e1..eb15e7b6e9 100644 --- a/packages/dashboard/base.go +++ b/packages/dashboard/base.go @@ -18,7 +18,6 @@ import ( "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" "github.com/iotaledger/wasp/packages/registry" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" ) //go:embed templates/base.tmpl @@ -106,6 +105,10 @@ func (d *Dashboard) BaseParams(c echo.Context, breadcrumbs ...Tab) BaseTemplateP } } +func EVMJSONRPC(chainIDBech32 string) string { + return "/chains/" + chainIDBech32 + "/evm/jsonrpc" +} + func (d *Dashboard) makeTemplate(e *echo.Echo, parts ...string) *template.Template { t := template.New("").Funcs(template.FuncMap{ "formatTimestamp": formatTimestamp, @@ -130,7 +133,7 @@ func (d *Dashboard) makeTemplate(e *echo.Echo, parts ...string) *template.Templa "hex": iotago.EncodeHex, "replace": strings.Replace, "webapiPort": d.wasp.WebAPIPort, - "evmJSONRPCEndpoint": routes.EVMJSONRPC, + "evmJSONRPCEndpoint": EVMJSONRPC, "uri": func(s string, p ...interface{}) string { return e.Reverse(s, p...) }, "href": func(s string) string { return s }, }) diff --git a/packages/dashboard/dashboard_test.go b/packages/dashboard/dashboard_test.go index 62d41f96f1..049f352b9d 100644 --- a/packages/dashboard/dashboard_test.go +++ b/packages/dashboard/dashboard_test.go @@ -8,11 +8,11 @@ import ( "github.com/PuerkitoBio/goquery" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/packages/dashboard/testutil" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/solo" "github.com/iotaledger/wasp/packages/vm/core/accounts" - "github.com/iotaledger/wasp/packages/webapi/v1/testutil" ) func checkProperConversionsToString(t *testing.T, html *goquery.Document) { diff --git a/packages/dashboard/testutil/httptest.go b/packages/dashboard/testutil/httptest.go new file mode 100644 index 0000000000..753e5b821f --- /dev/null +++ b/packages/dashboard/testutil/httptest.go @@ -0,0 +1,118 @@ +package testutil + +import ( + "bytes" + "encoding/json" + "net/http" + "net/http/httptest" + "net/url" + "strings" + "testing" + + "github.com/PuerkitoBio/goquery" + "github.com/labstack/echo/v4" + "github.com/stretchr/testify/require" +) + +func buildRequest(t *testing.T, method string, body interface{}) *http.Request { + if body == nil { + httptest.NewRequest(method, "/", nil) + } + + if bodybytes, ok := body.([]byte); ok { + req := httptest.NewRequest(method, "/", bytes.NewReader(bodybytes)) + req.Header.Set(echo.HeaderContentType, echo.MIMEOctetStream) + return req + } + + if bodymap, ok := body.(map[string]string); ok { + f := make(url.Values) + for k, v := range bodymap { + f.Set(k, v) + } + req := httptest.NewRequest(method, "/", strings.NewReader(f.Encode())) + req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationForm) + return req + } + + dataJSON, err := json.Marshal(body) + require.NoError(t, err) + req := httptest.NewRequest(method, "/", bytes.NewReader(dataJSON)) + req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationJSON) + return req +} + +func CallWebAPIRequestHandler( + t *testing.T, + handler echo.HandlerFunc, + method string, + route string, + params map[string]string, + body interface{}, + res interface{}, + exptectedStatus int, +) { + e := echo.New() + + req := buildRequest(t, method, body) + + rec := httptest.NewRecorder() + + c := e.NewContext(req, rec) + c.SetPath(route) + + paramNames := make([]string, 0) + paramValues := make([]string, 0) + for k, v := range params { + paramNames = append(paramNames, k) + paramValues = append(paramValues, v) + } + c.SetParamNames(paramNames...) + c.SetParamValues(paramValues...) + + err := handler(c) + if exptectedStatus >= 400 { + require.Error(t, err) + // TODO: Add error declaration + //require.Equal(t, exptectedStatus, err.(*httperrors.HTTPError).Code) + } else { + require.NoError(t, err) + require.Equal(t, exptectedStatus, rec.Code) + } + + if res != nil { + err = json.Unmarshal(rec.Body.Bytes(), res) + require.NoError(t, err) + } +} + +func CallHTMLRequestHandler(t *testing.T, e *echo.Echo, handler echo.HandlerFunc, route string, params map[string]string) *goquery.Document { + req := httptest.NewRequest(http.MethodGet, "/", nil) + + rec := httptest.NewRecorder() + + c := e.NewContext(req, rec) + c.SetPath(route) + + paramNames := make([]string, 0) + paramValues := make([]string, 0) + for k, v := range params { + paramNames = append(paramNames, k) + paramValues = append(paramValues, v) + } + c.SetParamNames(paramNames...) + c.SetParamValues(paramValues...) + + err := handler(c) + require.NoError(t, err) + + require.Equal(t, http.StatusOK, rec.Code) + + doc, err := goquery.NewDocumentFromReader(rec.Body) + require.NoError(t, err) + + _, err = doc.Html() + require.NoError(t, err) + + return doc +} diff --git a/packages/dashboard/testutil/mockchain.go b/packages/dashboard/testutil/mockchain.go new file mode 100644 index 0000000000..bc79f1da90 --- /dev/null +++ b/packages/dashboard/testutil/mockchain.go @@ -0,0 +1,100 @@ +package testutil + +import ( + "context" + + "github.com/iotaledger/hive.go/core/logger" + "github.com/iotaledger/wasp/packages/chain" + "github.com/iotaledger/wasp/packages/cryptolib" + "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/packages/metrics/nodeconnmetrics" + "github.com/iotaledger/wasp/packages/peering" + "github.com/iotaledger/wasp/packages/state" + "github.com/iotaledger/wasp/packages/testutil/testlogger" + "github.com/iotaledger/wasp/packages/vm/core/blocklog" + "github.com/iotaledger/wasp/packages/vm/core/governance" + "github.com/iotaledger/wasp/packages/vm/processors" +) + +type MockChain struct{} + +var _ chain.Chain = &MockChain{} + +// LatestAliasOutput implements chain.Chain +func (*MockChain) LatestAliasOutput() (confirmed *isc.AliasOutputWithID, active *isc.AliasOutputWithID) { + panic("unimplemented") +} + +// LatestState implements chain.Chain +func (*MockChain) LatestState(freshness chain.StateFreshness) (state.State, error) { + panic("unimplemented") +} + +// GetCandidateNodes implements chain.Chain +func (*MockChain) GetCandidateNodes() []*governance.AccessNodeInfo { + panic("unimplemented") +} + +// GetChainNodes implements chain.Chain +func (*MockChain) GetChainNodes() []peering.PeerStatusProvider { + panic("unimplemented") +} + +// GetCommitteeInfo implements chain.Chain +func (*MockChain) GetCommitteeInfo() *chain.CommitteeInfo { + panic("unimplemented") +} + +// Store implements chain.Chain +func (*MockChain) Store() state.Store { + panic("unimplemented") +} + +// ID implements chain.Chain +func (*MockChain) ID() isc.ChainID { + panic("unimplemented") +} + +// Log implements chain.Chain +func (*MockChain) Log() *logger.Logger { + return testlogger.NewSilentLogger("", true) +} + +// Processors implements chain.Chain +func (*MockChain) Processors() *processors.Cache { + return new(processors.Cache) +} + +// AwaitRequestProcessed implements chain.Chain +func (*MockChain) AwaitRequestProcessed(ctx context.Context, requestID isc.RequestID, confirmed bool) <-chan *blocklog.RequestReceipt { + panic("unimplemented") +} + +// ReceiveOffLedgerRequest implements chain.Chain +func (*MockChain) ReceiveOffLedgerRequest(request isc.OffLedgerRequest, sender *cryptolib.PublicKey) { +} + +// ConfigUpdated implements chain.Chain +func (*MockChain) ConfigUpdated(accessNodes []*cryptolib.PublicKey) { + panic("unimplemented") +} + +// ServersUpdated implements chain.Chain +func (*MockChain) ServersUpdated(serverNodes []*cryptolib.PublicKey) { + panic("unimplemented") +} + +// GetConsensusPipeMetrics implements chain.Chain +func (*MockChain) GetConsensusPipeMetrics() chain.ConsensusPipeMetrics { + panic("unimplemented") +} + +// GetConsensusWorkflowStatus implements chain.Chain +func (*MockChain) GetConsensusWorkflowStatus() chain.ConsensusWorkflowStatus { + panic("unimplemented") +} + +// GetNodeConnectionMetrics implements chain.Chain +func (*MockChain) GetNodeConnectionMetrics() nodeconnmetrics.NodeConnectionMetrics { + panic("unimplemented") +} diff --git a/packages/webapi/controllers/requests/controller.go b/packages/webapi/controllers/requests/controller.go index 6aeea40684..6817900f68 100644 --- a/packages/webapi/controllers/requests/controller.go +++ b/packages/webapi/controllers/requests/controller.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/webapi/interfaces" - models2 "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/models" ) type Controller struct { @@ -38,7 +38,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter publicAPI.GET("chains/:chainID/receipts/:requestID", c.getReceipt). AddParamPath("", "chainID", "ChainID (Bech32)"). AddParamPath("", "requestID", "RequestID (Hex)"). - AddResponse(http.StatusOK, "ReceiptResponse", mocker.Get(models2.ReceiptResponse{}), nil). + AddResponse(http.StatusOK, "ReceiptResponse", mocker.Get(models.ReceiptResponse{}), nil). SetSummary("Get a receipt from a request ID"). SetOperationId("getReceipt") @@ -51,7 +51,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter publicAPI.POST("requests/offledger", c.handleOffLedgerRequest). AddParamBody( - models2.OffLedgerRequest{Request: "Hex string"}, + models.OffLedgerRequest{Request: "Hex string"}, "", "Offledger request as JSON. Request encoded in Hex", true). @@ -66,7 +66,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter AddParamPath("", "requestID", "RequestID (Hex)"). AddResponse(http.StatusNotFound, "The chain or request id is invalid", nil, nil). AddResponse(http.StatusRequestTimeout, "The waiting time has reached the defined limit", nil, nil). - AddResponse(http.StatusOK, "The request receipt", mocker.Get(models2.ReceiptResponse{}), nil) + AddResponse(http.StatusOK, "The request receipt", mocker.Get(models.ReceiptResponse{}), nil) } func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfaces.Mocker) { diff --git a/packages/webapi/interfaces/interfaces.go b/packages/webapi/interfaces/interfaces.go index 9d16a07333..2675f2cfac 100644 --- a/packages/webapi/interfaces/interfaces.go +++ b/packages/webapi/interfaces/interfaces.go @@ -81,6 +81,12 @@ type PeeringService interface { TrustPeer(peer *cryptolib.PublicKey, netID string) (*dto2.PeeringNodeIdentity, error) } +var ErrUnableToGetLatestState = errors.New("unable to get latest state") +var ErrUnableToGetReceipt = errors.New("unable to get request receipt from block state") +var ErrAlreadyProcessed = errors.New("request already processed") +var ErrNoBalanceOnAccount = errors.New("no balance on account") +var ErrInvalidNonce = errors.New("invalid nonce") + type OffLedgerService interface { EnqueueOffLedgerRequest(chainID isc.ChainID, request []byte) error ParseRequest(payload []byte) (isc.OffLedgerRequest, error) diff --git a/packages/webapi/services/offledger.go b/packages/webapi/services/offledger.go index 6454f18c5e..9c227dcd62 100644 --- a/packages/webapi/services/offledger.go +++ b/packages/webapi/services/offledger.go @@ -16,7 +16,6 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/vm/vmcontext" "github.com/iotaledger/wasp/packages/webapi/interfaces" - "github.com/iotaledger/wasp/packages/webapi/v1/httperrors" ) type OffLedgerService struct { @@ -87,30 +86,41 @@ func (c *OffLedgerService) EnqueueOffLedgerRequest(chainID isc.ChainID, binaryRe } // implemented this way so we can re-use the same state, and avoid the overhead of calling views -// TODO exported just to be used by V1 API until that gets deprecated at once. func ShouldBeProcessed(ch chain.ChainCore, req isc.OffLedgerRequest) error { state, err := ch.LatestState(chain.ActiveOrCommittedState) if err != nil { - return httperrors.ServerError("unable to get latest state") + //ServerError + return interfaces.ErrUnableToGetLatestState } // query blocklog contract + processed, err := blocklog.IsRequestProcessed(state, req.ID()) if err != nil { - return httperrors.ServerError("unable to get request receipt from block state") + //ServerError + + return interfaces.ErrUnableToGetReceipt } if processed { - return httperrors.BadRequest("request already processed") + //BadRequest + + return interfaces.ErrAlreadyProcessed } // query accounts contract accountsPartition := subrealm.NewReadOnly(state, kv.Key(accounts.Contract.Hname().Bytes())) // check user has on-chain balance if !accounts.AccountExists(accountsPartition, req.SenderAccount()) { - return httperrors.BadRequest(fmt.Sprintf("No balance on account %s", req.SenderAccount().String())) + //BadRequest + + return interfaces.ErrNoBalanceOnAccount } + accountNonce := accounts.GetMaxAssumedNonce(accountsPartition, req.SenderAccount()) if err := vmcontext.CheckNonce(req, accountNonce); err != nil { - return httperrors.BadRequest(fmt.Sprintf("invalid nonce, %v", err)) + //BadRequest + + return interfaces.ErrInvalidNonce } + return nil } diff --git a/tools/cluster/chain.go b/tools/cluster/chain.go index 6a7b2ee3fe..e92f07b844 100644 --- a/tools/cluster/chain.go +++ b/tools/cluster/chain.go @@ -2,22 +2,22 @@ package cluster import ( "bytes" + "context" "fmt" "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/client/multiclient" - "github.com/iotaledger/wasp/client/scclient" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/chainclient" + "github.com/iotaledger/wasp/clients/multiclient" + "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/collections" - "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/vm/core/blob" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/packages/vm/vmtypes" ) @@ -89,11 +89,19 @@ func (ch *Chain) SCClient(contractHname isc.Hname, sigScheme *cryptolib.KeyPair, } func (ch *Chain) CommitteeMultiClient() *multiclient.MultiClient { - return multiclient.New(ch.CommitteeAPIHosts()).WithLogFunc(ch.Cluster.Logf) + var resolver multiclient.ClientResolver = func(apiHost string) *apiclient.APIClient { + return ch.Cluster.WaspClientFromHostName(apiHost) + } + + return multiclient.New(resolver, ch.CommitteeAPIHosts()) //.WithLogFunc(ch.Cluster.t.Logf) } func (ch *Chain) AllNodesMultiClient() *multiclient.MultiClient { - return multiclient.New(ch.AllAPIHosts()).WithLogFunc(ch.Cluster.Logf) + var resolver multiclient.ClientResolver = func(apiHost string) *apiclient.APIClient { + return ch.Cluster.WaspClientFromHostName(apiHost) + } + + return multiclient.New(resolver, ch.AllAPIHosts()) //.WithLogFunc(ch.Cluster.t.Logf) } func (ch *Chain) DeployContract(name, progHashStr, description string, initParams map[string]interface{}) (*iotago.Transaction, error) { @@ -134,7 +142,7 @@ func (ch *Chain) DeployWasmContract(name, description string, progBinary []byte, blob.VarFieldProgramDescription: description, }) - programHash, _, _, err := ch.OriginatorClient().UploadBlob(blobFieldValues) + programHash, _, _, err := ch.OriginatorClient().UploadBlob(context.Background(), blobFieldValues) if err != nil { return hashing.NilHash, err } @@ -176,114 +184,121 @@ func (ch *Chain) DeployWasmContract(name, description string, progBinary []byte, } func (ch *Chain) GetBlobFieldValue(blobHash hashing.HashValue, field string) ([]byte, error) { - v, err := ch.Cluster.WaspClient(0).CallView( - ch.ChainID, blob.Contract.Hname(), blob.ViewGetBlobField.Name, - dict.Dict{ - blob.ParamHash: blobHash[:], - blob.ParamField: []byte(field), - }) + v, _, err := ch.Cluster.WaspClient(0).CorecontractsApi. + BlobsGetBlobValue(context.Background(), ch.ChainID.String(), iotago.EncodeHex(blobHash[:]), field). + Execute() + if err != nil { return nil, err } - if v.IsEmpty() { - return nil, nil - } - ret, err := v.Get(blob.ParamBytes) + + decodedValue, err := iotago.DecodeHex(v.ValueData) if err != nil { return nil, err } - return ret, nil + + return decodedValue, nil } func (ch *Chain) BlockIndex(nodeIndex ...int) (uint32, error) { - cl := ch.SCClient(blocklog.Contract.Hname(), nil, nodeIndex...) - ret, err := cl.CallView(blocklog.ViewGetBlockInfo.Name, nil) + blockInfo, _, err := ch.Cluster. + WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), ch.ChainID.String()). + Execute() + if err != nil { return 0, err } - return codec.DecodeUint32(ret.MustGet(blocklog.ParamBlockIndex), 0) + + return blockInfo.BlockIndex, nil } -func (ch *Chain) GetAllBlockInfoRecordsReverse(nodeIndex ...int) ([]*blocklog.BlockInfo, error) { +func (ch *Chain) GetAllBlockInfoRecordsReverse(nodeIndex ...int) ([]*apiclient.BlockInfoResponse, error) { blockIndex, err := ch.BlockIndex(nodeIndex...) if err != nil { return nil, err } - cl := ch.SCClient(blocklog.Contract.Hname(), nil, nodeIndex...) - ret := make([]*blocklog.BlockInfo, 0, blockIndex+1) + ret := make([]*apiclient.BlockInfoResponse, 0, blockIndex+1) for idx := int(blockIndex); idx >= 0; idx-- { - res, err := cl.CallView(blocklog.ViewGetBlockInfo.Name, dict.Dict{ - blocklog.ParamBlockIndex: codec.EncodeUint32(uint32(idx)), - }) - if err != nil { - return nil, err - } - bi, err := blocklog.BlockInfoFromBytes(uint32(idx), res.MustGet(blocklog.ParamBlockInfo)) + blockInfo, _, err := ch.Cluster. + WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetBlockInfo(context.Background(), ch.ChainID.String(), int32(idx)). + Execute() + if err != nil { return nil, err } - ret = append(ret, bi) + + ret = append(ret, blockInfo) } return ret, nil } -func (ch *Chain) ContractRegistry(nodeIndex ...int) (map[isc.Hname]*root.ContractRecord, error) { - cl := ch.SCClient(root.Contract.Hname(), nil, nodeIndex...) - ret, err := cl.CallView(root.ViewGetContractRecords.Name, nil) +func (ch *Chain) ContractRegistry(nodeIndex ...int) ([]apiclient.ContractInfoResponse, error) { + contracts, _, err := ch.Cluster. + WaspClient(nodeIndex...).ChainsApi.GetContracts(context.Background(), ch.ChainID.String()). + Execute() + if err != nil { return nil, err } - return root.DecodeContractRegistry(collections.NewMapReadOnly(ret, root.StateVarContractRegistry)) + + return contracts, nil } func (ch *Chain) GetCounterValue(inccounterSCHname isc.Hname, nodeIndex ...int) (int64, error) { - cl := ch.SCClient(inccounterSCHname, nil, nodeIndex...) - ret, err := cl.CallView(inccounter.ViewGetCounter.Name, nil) + result, _, err := ch.Cluster. + WaspClient(nodeIndex...).RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ChainId: ch.ChainID.String(), + ContractHName: inccounterSCHname.String(), + FunctionHName: inccounter.ViewGetCounter.Hname().String(), + }).Execute() if err != nil { return 0, err } - return codec.DecodeInt64(ret.MustGet(inccounter.VarCounter), 0) + + parsedDict, err := clients.APIJsonDictToDict(*result) + if err != nil { + return 0, err + } + + return codec.DecodeInt64(parsedDict.MustGet(inccounter.VarCounter), 0) } func (ch *Chain) GetStateVariable(contractHname isc.Hname, key string, nodeIndex ...int) ([]byte, error) { cl := ch.SCClient(contractHname, nil, nodeIndex...) - return cl.StateGet(key) -} -func (ch *Chain) GetRequestReceipt(reqID isc.RequestID, nodeIndex ...int) (*isc.Receipt, error) { - idx := 0 - if len(nodeIndex) > 0 { - idx = nodeIndex[0] + result, _, err := ch.Cluster.WaspClient(nodeIndex...).ChainsApi. + GetStateValue(context.Background(), ch.ChainID.String(), key). + Execute() + + if err != nil { + return nil, err } - rec, err := ch.Cluster.WaspClient(idx).RequestReceipt(ch.ChainID, reqID) - return rec, err + + return cl.StateGet(context.Background(), result.State) } -func (ch *Chain) GetRequestReceiptsForBlock(blockIndex *uint32, nodeIndex ...int) ([]*blocklog.RequestReceipt, error) { - cl := ch.SCClient(blocklog.Contract.Hname(), nil, nodeIndex...) - params := dict.Dict{} +func (ch *Chain) GetRequestReceipt(reqID isc.RequestID, nodeIndex ...int) (*apiclient.ReceiptResponse, error) { + receipt, _, err := ch.Cluster.WaspClient(nodeIndex...).RequestsApi.GetReceipt(context.Background(), ch.ChainID.String(), reqID.String()). + Execute() + + return receipt, err +} + +func (ch *Chain) GetRequestReceiptsForBlock(blockIndex *uint32, nodeIndex ...int) ([]apiclient.RequestReceiptResponse, error) { + var err error + var receipts *apiclient.BlockReceiptsResponse + if blockIndex != nil { - params = dict.Dict{ - blocklog.ParamBlockIndex: codec.EncodeUint32(*blockIndex), - } + receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), ch.ChainID.String(), int32(*blockIndex)). + Execute() + } else { + receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), ch.ChainID.String()). + Execute() } - res, err := cl.CallView(blocklog.ViewGetRequestReceiptsForBlock.Name, params) + if err != nil { return nil, err } - returnedBlockIndex := codec.MustDecodeUint32(res.MustGet(blocklog.ParamBlockIndex)) - recs := collections.NewArray16ReadOnly(res, blocklog.ParamRequestRecord) - ret := make([]*blocklog.RequestReceipt, recs.MustLen()) - for i := range ret { - data, err := recs.GetAt(uint16(i)) - if err != nil { - return nil, err - } - ret[i], err = blocklog.RequestReceiptFromBytes(data) - if err != nil { - return nil, err - } - ret[i].WithBlockData(returnedBlockIndex, uint16(i)) - } - return ret, nil + + return receipts.Receipts, nil } diff --git a/tools/cluster/cluster.go b/tools/cluster/cluster.go index 593a4d1ae9..a23acceaf5 100644 --- a/tools/cluster/cluster.go +++ b/tools/cluster/cluster.go @@ -5,6 +5,7 @@ package cluster import ( "bufio" + "context" "errors" "fmt" "io" @@ -23,8 +24,9 @@ import ( "github.com/iotaledger/hive.go/core/logger" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/client/multiclient" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/chainclient" + "github.com/iotaledger/wasp/clients/multiclient" "github.com/iotaledger/wasp/packages/apilib" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" @@ -35,8 +37,6 @@ import ( "github.com/iotaledger/wasp/packages/transaction" "github.com/iotaledger/wasp/packages/util" "github.com/iotaledger/wasp/packages/vm/core/governance" - "github.com/iotaledger/wasp/packages/webapi/v1/model" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" "github.com/iotaledger/wasp/tools/cluster/templates" ) @@ -106,7 +106,7 @@ func (clu *Cluster) L1Client() l1connection.Client { return clu.l1 } -func (clu *Cluster) AddTrustedNode(peerInfo *model.PeeringTrustedNode, onNodes ...[]int) error { +func (clu *Cluster) AddTrustedNode(peerInfo *apiclient.PeeringTrustedNode, onNodes ...[]int) error { nodes := clu.Config.AllNodes() if len(onNodes) > 0 { nodes = onNodes[0] @@ -115,7 +115,10 @@ func (clu *Cluster) AddTrustedNode(peerInfo *model.PeeringTrustedNode, onNodes . for ni := range nodes { var err error if _, err = clu.WaspClient( - nodes[ni]).PostPeeringTrusted(peerInfo.PubKey, peerInfo.NetID); err != nil { + nodes[ni]).NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ + PublicKey: *peerInfo.PubKey, + NetId: *peerInfo.NetId, + }).Execute(); err != nil { return err } } @@ -124,17 +127,21 @@ func (clu *Cluster) AddTrustedNode(peerInfo *model.PeeringTrustedNode, onNodes . func (clu *Cluster) TrustAll() error { allNodes := clu.Config.AllNodes() - allPeers := make([]*model.PeeringTrustedNode, len(allNodes)) + allPeers := make([]*apiclient.PeeringNodeIdentityResponse, len(allNodes)) for ni := range allNodes { var err error - if allPeers[ni], err = clu.WaspClient(allNodes[ni]).GetPeeringSelf(); err != nil { + if allPeers[ni], _, err = clu.WaspClient(allNodes[ni]).NodeApi.GetPeeringIdentity(context.Background()).Execute(); err != nil { return err } } for ni := range allNodes { for pi := range allPeers { var err error - if _, err = clu.WaspClient(allNodes[ni]).PostPeeringTrusted(allPeers[pi].PubKey, allPeers[pi].NetID); err != nil { + if _, err = clu.WaspClient( + allNodes[ni]).NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ + PublicKey: allPeers[pi].PublicKey, + NetId: allPeers[pi].NetId, + }).Execute(); err != nil { return err } } @@ -170,15 +177,17 @@ func (clu *Cluster) RunDKG(committeeNodes []int, threshold uint16, timeout ...ti peerPubKeys := make([]string, 0) for _, i := range committeeNodes { - peeringNodeInfo, err := clu.WaspClient(i).GetPeeringSelf() + peeringNodeInfo, _, err := clu.WaspClient(i).NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return nil, err } - peerPubKeys = append(peerPubKeys, peeringNodeInfo.PubKey) + + peerPubKeys = append(peerPubKeys, peeringNodeInfo.PublicKey) } dkgInitiatorIndex := uint16(rand.Intn(len(apiHosts))) - return apilib.RunDKG("", apiHosts, peerPubKeys, threshold, dkgInitiatorIndex, timeout...) + + return apilib.RunDKG(clu.WaspClientFromHostName, apiHosts, peerPubKeys, threshold, dkgInitiatorIndex, timeout...) } func (clu *Cluster) DeployChainWithDKG(description string, allPeers, committeeNodes []int, quorum uint16) (*Chain, error) { @@ -212,14 +221,15 @@ func (clu *Cluster) DeployChain(description string, allPeers, committeeNodes []i committeePubKeys := make([]string, len(chain.CommitteeNodes)) for i, nodeIndex := range chain.CommitteeNodes { - peeringNode, err := clu.WaspClient(nodeIndex).GetPeeringSelf() + peeringNode, _, err := clu.WaspClient(nodeIndex).NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return nil, err } - committeePubKeys[i] = peeringNode.PubKey + + committeePubKeys[i] = peeringNode.PublicKey } - chainID, err := apilib.DeployChain(apilib.CreateChainParams{ + chainID, err := apilib.DeployChain(clu.WaspClientFromHostName, apilib.CreateChainParams{ Layer1Client: clu.L1Client(), CommitteeAPIHosts: chain.CommitteeAPIHosts(), CommitteePubKeys: committeePubKeys, @@ -254,10 +264,11 @@ func (clu *Cluster) addAllAccessNodes(chain *Chain, accessNodes []int) error { addAccessNodesRequests[i] = tx } - peers := multiclient.New(chain.CommitteeAPIHosts()).WithLogFunc(clu.Logf) + peers := multiclient.New(clu.WaspClientFromHostName, chain.CommitteeAPIHosts()) //.WithLogFunc(clu.t.Logf) for _, tx := range addAccessNodesRequests { // ---------- wait until the requests are processed in all committee nodes + if _, err := peers.WaitUntilAllRequestsProcessedSuccessfully(chain.ChainID, tx, 30*time.Second); err != nil { return fmt.Errorf("WaitAddAccessNode: %w", err) } @@ -266,11 +277,13 @@ func (clu *Cluster) addAllAccessNodes(chain *Chain, accessNodes []int) error { scArgs := governance.NewChangeAccessNodesRequest() for _, a := range accessNodes { waspClient := clu.WaspClient(a) - accessNodePeering, err := waspClient.GetPeeringSelf() + + accessNodePeering, _, err := waspClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return err } - accessNodePubKey, err := cryptolib.NewPublicKeyFromString(accessNodePeering.PubKey) + + accessNodePubKey, err := cryptolib.NewPublicKeyFromString(accessNodePeering.PublicKey) if err != nil { return err } @@ -280,6 +293,7 @@ func (clu *Cluster) addAllAccessNodes(chain *Chain, accessNodes []int) error { NewPostRequestParams(scArgs.AsDict()). WithBaseTokens(1 * isc.Million) govClient := chain.SCClient(governance.Contract.Hname(), chain.OriginatorKeyPair) + tx, err := govClient.PostRequest(governance.FuncChangeAccessNodes.Name, *scParams) if err != nil { return err @@ -297,41 +311,57 @@ func (clu *Cluster) addAllAccessNodes(chain *Chain, accessNodes []int) error { // to consider it as an access node. func (clu *Cluster) AddAccessNode(accessNodeIndex int, chain *Chain) (*iotago.Transaction, error) { waspClient := clu.WaspClient(accessNodeIndex) - if err := apilib.ActivateChainOnNodes("", clu.Config.APIHosts([]int{accessNodeIndex}), chain.ChainID); err != nil { + if err := apilib.ActivateChainOnNodes(clu.WaspClientFromHostName, clu.Config.APIHosts([]int{accessNodeIndex}), chain.ChainID); err != nil { return nil, err } - accessNodePeering, err := waspClient.GetPeeringSelf() + accessNodePeering, _, err := waspClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return nil, err } - accessNodePubKey, err := cryptolib.NewPublicKeyFromString(accessNodePeering.PubKey) + + accessNodePubKey, err := cryptolib.NewPublicKeyFromString(accessNodePeering.PublicKey) if err != nil { return nil, err } - cert, err := waspClient.NodeOwnershipCertificate(accessNodePubKey, chain.OriginatorAddress()) + + cert, _, err := waspClient.NodeApi.SetNodeOwner(context.Background()).NodeOwnerCertificateRequest(apiclient.NodeOwnerCertificateRequest{ + PublicKey: accessNodePubKey.String(), + OwnerAddress: chain.OriginatorAddress().String(), + }).Execute() + if err != nil { return nil, err } + + decodedCert, err := iotago.DecodeHex(cert.Certificate) + if err != nil { + return nil, err + } + scArgs := governance.AccessNodeInfo{ NodePubKey: accessNodePubKey.AsBytes(), ValidatorAddr: isc.BytesFromAddress(chain.OriginatorAddress()), - Certificate: cert.Bytes(), + Certificate: decodedCert, ForCommittee: false, AccessAPI: clu.Config.APIHost(accessNodeIndex), } scParams := chainclient. NewPostRequestParams(scArgs.ToAddCandidateNodeParams()). WithBaseTokens(1000) + govClient := chain.SCClient(governance.Contract.Hname(), chain.OriginatorKeyPair) + tx, err := govClient.PostRequest(governance.FuncAddCandidateNode.Name, *scParams) if err != nil { return nil, err } + txID, err := tx.ID() if err != nil { return nil, err } + fmt.Printf("[cluster] Governance::AddCandidateNode, Posted TX, id=%v, args=%+v\n", txID, scArgs) return tx, nil } @@ -341,11 +371,22 @@ func (clu *Cluster) IsNodeUp(i int) bool { } func (clu *Cluster) MultiClient() *multiclient.MultiClient { - return multiclient.New(clu.Config.APIHosts()).WithLogFunc(clu.Logf) + return multiclient.New(clu.WaspClientFromHostName, clu.Config.APIHosts()) //.WithLogFunc(clu.t.Logf) } -func (clu *Cluster) WaspClient(nodeIndex int) *client.WaspClient { - return client.NewWaspClient(clu.Config.APIHost(nodeIndex)).WithLogFunc(clu.Logf) +func (clu *Cluster) WaspClientFromHostName(hostName string) *apiclient.APIClient { + config := apiclient.NewConfiguration() + config.Host = hostName + return apiclient.NewAPIClient(config) +} + +func (clu *Cluster) WaspClient(nodeIndex ...int) *apiclient.APIClient { + idx := 0 + if len(nodeIndex) == 1 { + idx = nodeIndex[0] + } + + return clu.WaspClientFromHostName(clu.Config.APIHost(idx)) } func (clu *Cluster) NodeDataPath(i int) string { @@ -587,12 +628,13 @@ const pollAPIInterval = 500 * time.Millisecond // waits until API for a given WASP node is ready func waitForAPIReady(initOk chan<- bool, apiURL string) { - infoEndpointURL := fmt.Sprintf("%s%s", apiURL, routes.Info()) + infoEndpointURL := fmt.Sprintf("%s%s", apiURL, "/node/version") ticker := time.NewTicker(pollAPIInterval) go func() { for { <-ticker.C + rsp, err := http.Get(infoEndpointURL) //nolint:gosec,noctx if err != nil { fmt.Printf("Error Polling node API %s ready status: %v\n", apiURL, err) @@ -643,7 +685,8 @@ func (clu *Cluster) stopNode(nodeIndex int) { return } fmt.Printf("[cluster] Sending shutdown to wasp node %d\n", nodeIndex) - err := clu.WaspClient(nodeIndex).Shutdown() + + err := clu.KillNodeProcess(nodeIndex) if err != nil { fmt.Println(err) } diff --git a/tools/wasp-cli/chain/access-nodes.go b/tools/wasp-cli/chain/access-nodes.go index 6bdf08bbe8..f1ee2182a4 100644 --- a/tools/wasp-cli/chain/access-nodes.go +++ b/tools/wasp-cli/chain/access-nodes.go @@ -4,9 +4,12 @@ package chain import ( + "context" + "github.com/spf13/cobra" - "github.com/iotaledger/wasp/tools/wasp-cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -21,18 +24,22 @@ func initPermitionlessAccessNodesCmd() *cobra.Command { if nodes == nil { nodes = GetAllWaspNodes() } - chainID := GetCurrentChainID() + chainID := config.GetCurrentChainID() action := args[0] pubKey := args[1] for _, i := range nodes { - client := config.WaspClient(config.MustWaspAPI(i)) + client := cliclients.WaspClientForIndex(i) switch action { case "add": - err := client.AddAccessNode(chainID, pubKey) + _, err := client.ChainsApi. + AddAccessNode(context.Background(), chainID.String(), pubKey). + Execute() log.Check(err) case "remove": - err := client.RemoveAccessNode(chainID, pubKey) + _, err := client.ChainsApi. + RemoveAccessNode(context.Background(), chainID.String(), pubKey). + Execute() log.Check(err) default: log.Fatalf("unknown action: %s", action) diff --git a/tools/wasp-cli/chain/accounts.go b/tools/wasp-cli/chain/accounts.go index 005853ac1a..1403c0db54 100644 --- a/tools/wasp-cli/chain/accounts.go +++ b/tools/wasp-cli/chain/accounts.go @@ -12,9 +12,10 @@ import ( "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/vm/core/accounts" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" - "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) func initListAccountsCmd() *cobra.Command { @@ -24,12 +25,12 @@ func initListAccountsCmd() *cobra.Command { Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { client := cliclients.WaspClientForIndex() - chainID := GetCurrentChainID() + chainID := config.GetCurrentChainID() accountList, _, err := client.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID.String()).Execute() log.Check(err) - log.Printf("Total %d account(s) in chain %s\n", len(accountList.Accounts), GetCurrentChainID().String()) + log.Printf("Total %d account(s) in chain %s\n", len(accountList.Accounts), config.GetCurrentChainID().String()) header := []string{"agentid"} rows := make([][]string, len(accountList.Accounts)) @@ -58,7 +59,7 @@ func initBalanceCmd() *cobra.Command { } client := cliclients.WaspClientForIndex() - chainID := GetCurrentChainID() + chainID := config.GetCurrentChainID() balance, _, err := client.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID.String(), agentID.String()).Execute() log.Check(err) @@ -86,7 +87,7 @@ func initDepositCmd() *cobra.Command { if strings.Contains(args[0], ":") { // deposit to own agentID tokens := util.ParseFungibleTokens(args) - util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { + util.WithSCTransaction(config.GetCurrentChainID(), func() (*iotago.Transaction, error) { client := cliclients.WaspClientForIndex() return cliclients.SCClient(client, accounts.Contract.Hname()).PostRequest( @@ -105,7 +106,7 @@ func initDepositCmd() *cobra.Command { tokens := util.ParseFungibleTokens(tokensStr) allowance := tokens.Clone() - util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { + util.WithSCTransaction(config.GetCurrentChainID(), func() (*iotago.Transaction, error) { client := cliclients.WaspClientForIndex() return cliclients.SCClient(client, accounts.Contract.Hname()).PostRequest( diff --git a/tools/wasp-cli/chain/activate.go b/tools/wasp-cli/chain/activate.go index 6bbcfbb923..9a88d0bc2e 100644 --- a/tools/wasp-cli/chain/activate.go +++ b/tools/wasp-cli/chain/activate.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -19,7 +20,7 @@ func initActivateCmd() *cobra.Command { Short: "Activates the chain on selected nodes", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - chainID := GetCurrentChainID() + chainID := config.GetCurrentChainID() if nodes == nil { nodes = GetAllWaspNodes() } @@ -54,7 +55,7 @@ func initDeactivateCmd() *cobra.Command { Short: "Deactivates the chain on selected nodes", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - chainID := GetCurrentChainID() + chainID := config.GetCurrentChainID() if nodes == nil { nodes = GetAllWaspNodes() } diff --git a/tools/wasp-cli/chain/add.go b/tools/wasp-cli/chain/add.go index 3611f2f894..528ca02fe3 100644 --- a/tools/wasp-cli/chain/add.go +++ b/tools/wasp-cli/chain/add.go @@ -1,6 +1,10 @@ package chain -import "github.com/spf13/cobra" +import ( + "github.com/spf13/cobra" + + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" +) func initAddChainCmd() *cobra.Command { return &cobra.Command{ @@ -8,7 +12,7 @@ func initAddChainCmd() *cobra.Command { Short: "adds a chain to the list of chains", Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { - AddChainAlias(args[0], args[1]) + config.AddChainAlias(args[0], args[1]) }, } } diff --git a/tools/wasp-cli/chain/alias.go b/tools/wasp-cli/chain/alias.go index 36bbd472eb..5f5138febb 100644 --- a/tools/wasp-cli/chain/alias.go +++ b/tools/wasp-cli/chain/alias.go @@ -1,41 +1,2 @@ package chain -import ( - "github.com/spf13/cobra" - "github.com/spf13/viper" - - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" - "github.com/iotaledger/wasp/tools/wasp-cli/log" -) - -var chainAlias string - -func GetChainAlias() string { - if chainAlias == "" { - chainAlias = viper.GetString("chain") - } - if chainAlias == "" { - log.Fatal("No current chain. Call `chain deploy --chain=` or `set chain `") - } - return chainAlias -} - -func SetCurrentChain(chainAlias string) { - config.Set("chain", chainAlias) -} - -func initAliasFlags(chainCmd *cobra.Command) { - chainCmd.PersistentFlags().StringVarP(&chainAlias, "chain", "a", "", "chain alias") -} - -func AddChainAlias(chainAlias, id string) { - config.Set("chains."+chainAlias, id) - SetCurrentChain(chainAlias) -} - -func GetCurrentChainID() isc.ChainID { - chainID, err := isc.ChainIDFromString(viper.GetString("chains." + GetChainAlias())) - log.Check(err) - return chainID -} diff --git a/tools/wasp-cli/chain/blobs.go b/tools/wasp-cli/chain/blobs.go index fed62e2be7..d0b6b6a0c4 100644 --- a/tools/wasp-cli/chain/blobs.go +++ b/tools/wasp-cli/chain/blobs.go @@ -11,6 +11,7 @@ import ( "github.com/iotaledger/wasp/packages/kv" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -55,7 +56,7 @@ func initShowBlobCmd() *cobra.Command { blobInfo, _, err := client. CorecontractsApi. - BlobsGetBlobInfo(context.Background(), GetCurrentChainID().String(), hash.Hex()). + BlobsGetBlobInfo(context.Background(), config.GetCurrentChainID().String(), hash.Hex()). Execute() log.Check(err) @@ -63,7 +64,7 @@ func initShowBlobCmd() *cobra.Command { for field := range blobInfo.Fields { value, _, err := client. CorecontractsApi. - BlobsGetBlobValue(context.Background(), GetCurrentChainID().String(), hash.Hex(), field). + BlobsGetBlobValue(context.Background(), config.GetCurrentChainID().String(), hash.Hex(), field). Execute() log.Check(err) @@ -84,12 +85,12 @@ func initListBlobsCmd() *cobra.Command { blobsResponse, _, err := client. CorecontractsApi. - BlobsGetAllBlobs(context.Background(), GetCurrentChainID().String()). + BlobsGetAllBlobs(context.Background(), config.GetCurrentChainID().String()). Execute() log.Check(err) - log.Printf("Total %d blob(s) in chain %s\n", len(blobsResponse.Blobs), GetCurrentChainID()) + log.Printf("Total %d blob(s) in chain %s\n", len(blobsResponse.Blobs), config.GetCurrentChainID()) header := []string{"hash", "size"} rows := make([][]string, len(blobsResponse.Blobs)) diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index 5d26a85d5e..ed7c636a21 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -10,6 +10,7 @@ import ( "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -39,7 +40,7 @@ func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { if len(args) == 0 { blockInfo, _, err := client. CorecontractsApi. - BlocklogGetLatestBlockInfo(context.Background(), GetCurrentChainID().String()). + BlocklogGetLatestBlockInfo(context.Background(), config.GetCurrentChainID().String()). Execute() log.Check(err) @@ -51,7 +52,7 @@ func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { blockInfo, _, err := client. CorecontractsApi. - BlocklogGetBlockInfo(context.Background(), GetCurrentChainID().String(), int32(index)). + BlocklogGetBlockInfo(context.Background(), config.GetCurrentChainID().String(), int32(index)). Execute() log.Check(err) @@ -63,7 +64,7 @@ func logRequestsInBlock(index uint32) { client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! receipts, _, err := client.CorecontractsApi. - BlocklogGetRequestReceiptsOfBlock(context.Background(), GetCurrentChainID().String(), int32(index)). + BlocklogGetRequestReceiptsOfBlock(context.Background(), config.GetCurrentChainID().String(), int32(index)). Execute() log.Check(err) @@ -113,7 +114,7 @@ func logEventsInBlock(index uint32) { client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. - BlocklogGetEventsOfBlock(context.Background(), GetCurrentChainID().String(), int32(index)). + BlocklogGetEventsOfBlock(context.Background(), config.GetCurrentChainID().String(), int32(index)). Execute() log.Check(err) @@ -132,7 +133,7 @@ func initRequestCmd() *cobra.Command { client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! receipt, _, err := client.CorecontractsApi. - BlocklogGetRequestReceipt(context.Background(), GetCurrentChainID().String(), reqID.String()). + BlocklogGetRequestReceipt(context.Background(), config.GetCurrentChainID().String(), reqID.String()). Execute() log.Check(err) @@ -151,7 +152,7 @@ func logEventsInRequest(reqID isc.RequestID) { client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. - BlocklogGetEventsOfRequest(context.Background(), GetCurrentChainID().String(), reqID.String()). + BlocklogGetEventsOfRequest(context.Background(), config.GetCurrentChainID().String(), reqID.String()). Execute() log.Check(err) diff --git a/tools/wasp-cli/chain/callview.go b/tools/wasp-cli/chain/callview.go index c8313edee8..78905396da 100644 --- a/tools/wasp-cli/chain/callview.go +++ b/tools/wasp-cli/chain/callview.go @@ -8,6 +8,7 @@ import ( "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -26,7 +27,7 @@ func initCallViewCmd() *cobra.Command { params := util.EncodeParams(args[2:]) result, _, err := client.RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ - ChainId: GetCurrentChainID().String(), + ChainId: config.GetCurrentChainID().String(), ContractName: contractName, FunctionName: funcName, Arguments: clients.JSONDictToAPIJSONDict(params.JSONDict()), diff --git a/tools/wasp-cli/chain/cmd.go b/tools/wasp-cli/chain/cmd.go index d1a217b23a..6f428a2994 100644 --- a/tools/wasp-cli/chain/cmd.go +++ b/tools/wasp-cli/chain/cmd.go @@ -3,6 +3,7 @@ package chain import ( "github.com/spf13/cobra" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -21,7 +22,7 @@ func Init(rootCmd *cobra.Command) { chainCmd := initChainCmd() rootCmd.AddCommand(chainCmd) - initAliasFlags(chainCmd) + config.InitAliasFlags(chainCmd) initUploadFlags(chainCmd) chainCmd.AddCommand(initListCmd()) diff --git a/tools/wasp-cli/chain/deploy.go b/tools/wasp-cli/chain/deploy.go index 5076d7afaf..deadbd6075 100644 --- a/tools/wasp-cli/chain/deploy.go +++ b/tools/wasp-cli/chain/deploy.go @@ -13,6 +13,8 @@ import ( "github.com/spf13/viper" iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/multiclient" "github.com/iotaledger/wasp/packages/apilib" "github.com/iotaledger/wasp/packages/evm/evmtypes" "github.com/iotaledger/wasp/packages/kv/codec" @@ -22,8 +24,8 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" - "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) func GetAllWaspNodes() []int { @@ -76,7 +78,6 @@ func initDeployCmd() *cobra.Command { Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { l1Client := cliclients.L1Client() - alias := GetChainAlias() if committee == nil { committee = GetAllWaspNodes() @@ -97,8 +98,11 @@ func initDeployCmd() *cobra.Command { committeePubKeys = append(committeePubKeys, peerInfo.PublicKey) } - chainid, _, err := apilib.DeployChainWithDKG(apilib.CreateChainParams{ - AuthenticationToken: config.GetToken(), + var clientResolver multiclient.ClientResolver = func(apiHost string) *apiclient.APIClient { + return cliclients.WaspClientForHostName(apiHost) + } + + chainid, _, err := apilib.DeployChainWithDKG(clientResolver, apilib.CreateChainParams{ Layer1Client: l1Client, CommitteeAPIHosts: config.CommitteeAPIURL(committee), CommitteePubKeys: committeePubKeys, @@ -119,11 +123,11 @@ func initDeployCmd() *cobra.Command { var alias string if len(args) == 0 { - alias = GetChainAlias() + alias = config.GetChainAlias() } else { alias = args[0] } - AddChainAlias(alias, chainid.String()) + config.AddChainAlias(alias, chainid.String()) }, } diff --git a/tools/wasp-cli/chain/deploycontract.go b/tools/wasp-cli/chain/deploycontract.go index 0163fabcfc..652fa08b13 100644 --- a/tools/wasp-cli/chain/deploycontract.go +++ b/tools/wasp-cli/chain/deploycontract.go @@ -13,6 +13,7 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/packages/vm/vmtypes" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -55,7 +56,7 @@ func initDeployContractCmd() *cobra.Command { } func deployContract(client *apiclient.APIClient, name, description string, progHash hashing.HashValue, initParams dict.Dict) { - util.WithOffLedgerRequest(GetCurrentChainID(), func() (isc.OffLedgerRequest, error) { + util.WithOffLedgerRequest(config.GetCurrentChainID(), func() (isc.OffLedgerRequest, error) { args := codec.MakeDict(map[string]interface{}{ root.ParamName: name, root.ParamDescription: description, diff --git a/tools/wasp-cli/chain/events.go b/tools/wasp-cli/chain/events.go index 42368d9edd..646141aeb6 100644 --- a/tools/wasp-cli/chain/events.go +++ b/tools/wasp-cli/chain/events.go @@ -7,6 +7,7 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -17,10 +18,10 @@ func initEventsCmd() *cobra.Command { Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { client := cliclients.WaspClientForIndex() - contractHName := isc.Hn(args[0]).String(); + contractHName := isc.Hn(args[0]).String() events, _, err := client.CorecontractsApi. - BlocklogGetEventsOfContract(context.Background(), GetCurrentChainID().String(), contractHName). + BlocklogGetEventsOfContract(context.Background(), config.GetCurrentChainID().String(), contractHName). Execute() log.Check(err) diff --git a/tools/wasp-cli/chain/info.go b/tools/wasp-cli/chain/info.go index 9d62b37984..80d502a8b7 100644 --- a/tools/wasp-cli/chain/info.go +++ b/tools/wasp-cli/chain/info.go @@ -13,6 +13,7 @@ import ( "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -26,12 +27,12 @@ func initInfoCmd() *cobra.Command { client := cliclients.WaspClientForIndex() chainInfo, _, err := client.ChainsApi. - GetChainInfo(context.Background(), GetCurrentChainID().String()). + GetChainInfo(context.Background(), config.GetCurrentChainID().String()). Execute() log.Check(err) committeeInfo, _, err := client.ChainsApi. - GetCommitteeInfo(context.Background(), GetCurrentChainID().String()). + GetCommitteeInfo(context.Background(), config.GetCurrentChainID().String()). Execute() log.Check(err) @@ -69,7 +70,7 @@ func initInfoCmd() *cobra.Command { log.Printf("Description: %s\n", chainInfo.Description) - contracts, _, err := client.ChainsApi.GetContracts(context.Background(), GetCurrentChainID().String()).Execute() + contracts, _, err := client.ChainsApi.GetContracts(context.Background(), config.GetCurrentChainID().String()).Execute() log.Check(err) log.Printf("#Contracts: %d\n", len(contracts)) diff --git a/tools/wasp-cli/chain/listcontracts.go b/tools/wasp-cli/chain/listcontracts.go index 04478f1d65..67720efa51 100644 --- a/tools/wasp-cli/chain/listcontracts.go +++ b/tools/wasp-cli/chain/listcontracts.go @@ -10,6 +10,7 @@ import ( "github.com/iotaledger/wasp/packages/kv/collections" "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -37,7 +38,7 @@ func initListContractsCmd() *cobra.Command { contracts, err := root.DecodeContractRegistry(collections.NewMapReadOnly(parsedRecords, root.StateVarContractRegistry)) log.Check(err) - log.Printf("Total %d contracts in chain %s\n", len(contracts), GetCurrentChainID()) + log.Printf("Total %d contracts in chain %s\n", len(contracts), config.GetCurrentChainID()) header := []string{ "hname", diff --git a/tools/wasp-cli/chain/postrequest.go b/tools/wasp-cli/chain/postrequest.go index 9d3a75497e..d107e8c538 100644 --- a/tools/wasp-cli/chain/postrequest.go +++ b/tools/wasp-cli/chain/postrequest.go @@ -11,6 +11,7 @@ import ( "github.com/iotaledger/wasp/packages/transaction" "github.com/iotaledger/wasp/packages/vm/gas" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -20,7 +21,7 @@ func postRequest(hname, fname string, params chainclient.PostRequestParams, offL if offLedger { params.Nonce = uint64(time.Now().UnixNano()) - util.WithOffLedgerRequest(GetCurrentChainID(), func() (isc.OffLedgerRequest, error) { + util.WithOffLedgerRequest(config.GetCurrentChainID(), func() (isc.OffLedgerRequest, error) { return scClient.PostOffLedgerRequest(fname, params) }) return @@ -29,7 +30,7 @@ func postRequest(hname, fname string, params chainclient.PostRequestParams, offL if !adjustStorageDeposit { // check if there are enough funds for SD output := transaction.MakeBasicOutput( - GetCurrentChainID().AsAddress(), + config.GetCurrentChainID().AsAddress(), scClient.ChainClient.KeyPair.Address(), params.Transfer, &isc.RequestMetadata{ @@ -46,7 +47,7 @@ func postRequest(hname, fname string, params chainclient.PostRequestParams, offL util.SDAdjustmentPrompt(output) } - util.WithSCTransaction(GetCurrentChainID(), func() (*iotago.Transaction, error) { + util.WithSCTransaction(config.GetCurrentChainID(), func() (*iotago.Transaction, error) { return scClient.PostRequest(fname, params) }) } diff --git a/tools/wasp-cli/chain/rotate.go b/tools/wasp-cli/chain/rotate.go index fff72b57e5..025fcacfdf 100644 --- a/tools/wasp-cli/chain/rotate.go +++ b/tools/wasp-cli/chain/rotate.go @@ -13,8 +13,9 @@ import ( "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/transaction" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" - "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) func initRotateCmd() *cobra.Command { @@ -31,8 +32,7 @@ func initRotateCmd() *cobra.Command { } wallet := wallet.Load() - - aliasID := GetCurrentChainID().AsAliasID() + aliasID := config.GetCurrentChainID().AsAliasID() chainOutputID, chainOutput, err := l1Client.GetAliasOutput(aliasID) log.Check(err) diff --git a/tools/wasp-cli/chain/rundkg.go b/tools/wasp-cli/chain/rundkg.go index b341718870..5097b89b94 100644 --- a/tools/wasp-cli/chain/rundkg.go +++ b/tools/wasp-cli/chain/rundkg.go @@ -11,6 +11,8 @@ import ( "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/multiclient" "github.com/iotaledger/wasp/packages/apilib" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" @@ -45,7 +47,12 @@ func initRunDKGCmd() *cobra.Command { } dkgInitiatorIndex := uint16(rand.Intn(len(committee))) - stateControllerAddr, err := apilib.RunDKG(config.GetToken(), config.CommitteeAPIURL(committee), committeePubKeys, uint16(quorum), dkgInitiatorIndex) + + var clientResolver multiclient.ClientResolver = func(apiHost string) *apiclient.APIClient { + return cliclients.WaspClientForHostName(apiHost) + } + + stateControllerAddr, err := apilib.RunDKG(clientResolver, config.CommitteeAPIURL(committee), committeePubKeys, uint16(quorum), dkgInitiatorIndex) log.Check(err) fmt.Fprintf(os.Stdout, "DKG successful, address: %s", stateControllerAddr.Bech32(parameters.L1().Protocol.Bech32HRP)) diff --git a/tools/wasp-cli/cli/cliclients/clients.go b/tools/wasp-cli/cli/cliclients/clients.go index c2a77a81a8..cabb359e49 100644 --- a/tools/wasp-cli/cli/cliclients/clients.go +++ b/tools/wasp-cli/cli/cliclients/clients.go @@ -6,14 +6,12 @@ import ( "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/l1connection" - "github.com/iotaledger/wasp/tools/wasp-cli/chain" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" - "github.com/iotaledger/wasp/tools/wasp-cli/wallet" ) -func waspClient(apiAddress string) *apiclient.APIClient { - // TODO: add authentication for /adm +func WaspClientForHostName(apiAddress string) *apiclient.APIClient { L1Client() // this will fill parameters.L1() with data from the L1 node log.Verbosef("using Wasp host %s\n", apiAddress) @@ -21,11 +19,13 @@ func waspClient(apiAddress string) *apiclient.APIClient { apiConfig.Host = apiAddress apiConfig.AddDefaultHeader("Authorization", config.GetToken()) - return apiclient.NewAPIClient(apiConfig) + client := apiclient.NewAPIClient(apiConfig) + + return client } func WaspClientForIndex(i ...int) *apiclient.APIClient { - return waspClient(config.MustWaspAPIURL(i...)) + return WaspClientForHostName(config.MustWaspAPIURL(i...)) } func L1Client() l1connection.Client { @@ -44,7 +44,7 @@ func ChainClient(waspClient *apiclient.APIClient) *chainclient.Client { return chainclient.New( L1Client(), waspClient, - chain.GetCurrentChainID(), + config.GetCurrentChainID(), wallet.Load().KeyPair, ) } diff --git a/tools/wasp-cli/cli/config/chain.go b/tools/wasp-cli/cli/config/chain.go new file mode 100644 index 0000000000..d416dd4f79 --- /dev/null +++ b/tools/wasp-cli/cli/config/chain.go @@ -0,0 +1,40 @@ +package config + +import ( + "github.com/spf13/cobra" + "github.com/spf13/viper" + + "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/tools/wasp-cli/log" +) + +var chainAlias string + +func GetChainAlias() string { + if chainAlias == "" { + chainAlias = viper.GetString("chain") + } + if chainAlias == "" { + log.Fatal("No current chain. Call `chain deploy --chain=` or `set chain `") + } + return chainAlias +} + +func SetCurrentChain(chainAlias string) { + Set("chain", chainAlias) +} + +func InitAliasFlags(chainCmd *cobra.Command) { + chainCmd.PersistentFlags().StringVarP(&chainAlias, "chain", "a", "", "chain alias") +} + +func AddChainAlias(chainAlias, id string) { + Set("chains."+chainAlias, id) + SetCurrentChain(chainAlias) +} + +func GetCurrentChainID() isc.ChainID { + chainID, err := isc.ChainIDFromString(viper.GetString("chains." + GetChainAlias())) + log.Check(err) + return chainID +} diff --git a/tools/wasp-cli/cli/config/config.go b/tools/wasp-cli/cli/config/config.go index 5ffd9e46a1..f0ab61829c 100644 --- a/tools/wasp-cli/cli/config/config.go +++ b/tools/wasp-cli/cli/config/config.go @@ -8,7 +8,6 @@ import ( "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/testutil/privtangle/privtangledefaults" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -27,23 +26,24 @@ const ( l1ParamsExpiration = 24 * time.Hour ) -func l1ParamsExpired() bool { +func L1ParamsExpired() bool { if viper.Get(l1ParamsKey) == nil { return true } return viper.GetTime(l1ParamsTimestampKey).Add(l1ParamsExpiration).Before(time.Now()) } -func refreshL1ParamsFromNode() { +func RefreshL1ParamsFromNode() { if log.VerboseFlag { log.Printf("Getting L1 params from node at %s...\n", L1APIAddress()) } - cliclients.L1Client() // this will call parameters.InitL1() + //TODO: Move to a proper place + //cliclients.L1Client() // this will call parameters.InitL1() Set(l1ParamsKey, parameters.L1NoLock()) Set(l1ParamsTimestampKey, time.Now()) } -func loadL1ParamsFromConfig() { +func LoadL1ParamsFromConfig() { // read L1 params from config file var params *parameters.L1Params err := viper.UnmarshalKey("l1.params", ¶ms) @@ -129,13 +129,8 @@ func committeeHost(kind string, i int) string { return fmt.Sprintf("127.0.0.1:%d", defaultPort) } -func totalNumberOfWaspNodes() int { - waspSubKey := viper.Sub("wasp") - if waspSubKey == nil { - return 0 - } - - return len(waspSubKey.AllSettings()) +func TotalNumberOfWaspNodes() int { + return len(viper.Sub("wasp").AllSettings()) } func defaultWaspPort(kind string, i int) int { diff --git a/tools/wasp-cli/cli/config/checkversions.go b/tools/wasp-cli/cli/init/checkversions.go similarity index 59% rename from tools/wasp-cli/cli/config/checkversions.go rename to tools/wasp-cli/cli/init/checkversions.go index c2ab9a4696..07ba33a4d9 100644 --- a/tools/wasp-cli/cli/config/checkversions.go +++ b/tools/wasp-cli/cli/init/checkversions.go @@ -1,8 +1,12 @@ -package config +package init import ( + "context" + "github.com/spf13/cobra" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -13,14 +17,16 @@ func initCheckVersionsCmd(waspVersion string) *cobra.Command { Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { // query every wasp node info endpoint and ensure the `Version` matches - for i := 0; i < totalNumberOfWaspNodes(); i++ { - client := clients.NewWaspClient(committeeHost(HostKindAPI, i)) - waspServerInfo, err := client.Info() + for i := 0; i < config.TotalNumberOfWaspNodes(); i++ { + version, _, err := cliclients.WaspClientForIndex(i).NodeApi. + GetVersion(context.Background()). + Execute() log.Check(err) - if waspVersion == waspServerInfo.Version { + + if waspVersion == version { log.Printf("Wasp-cli version matches Wasp #%d\n", i) } else { - log.Printf("! -> Version mismatch with Wasp #%d. cli version: %s, wasp version: %s\n", i, waspVersion, waspServerInfo.Version) + log.Printf("! -> Version mismatch with Wasp #%d. cli version: %s, wasp version: %s\n", i, waspVersion, version) } } }, diff --git a/tools/wasp-cli/cli/config/init.go b/tools/wasp-cli/cli/init/init.go similarity index 64% rename from tools/wasp-cli/cli/config/init.go rename to tools/wasp-cli/cli/init/init.go index 39ceb49f58..d35ed5718e 100644 --- a/tools/wasp-cli/cli/config/init.go +++ b/tools/wasp-cli/cli/init/init.go @@ -1,9 +1,10 @@ -package config +package init import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/parameters" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" ) func initConfigSetCmd() *cobra.Command { @@ -15,11 +16,11 @@ func initConfigSetCmd() *cobra.Command { v := args[1] switch v { case "true": - Set(args[0], true) + config.Set(args[0], true) case "false": - Set(args[0], false) + config.Set(args[0], false) default: - Set(args[0], v) + config.Set(args[0], v) } }, } @@ -31,25 +32,25 @@ func initRefreshL1ParamsCmd() *cobra.Command { Short: "Refresh L1 params from node", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - refreshL1ParamsFromNode() + config.RefreshL1ParamsFromNode() }, } } func Init(rootCmd *cobra.Command, waspVersion string) { - rootCmd.PersistentFlags().StringVarP(&ConfigPath, "config", "c", "wasp-cli.json", "path to wasp-cli.json") - rootCmd.PersistentFlags().BoolVarP(&WaitForCompletion, "wait", "w", true, "wait for request completion") + rootCmd.PersistentFlags().StringVarP(&config.ConfigPath, "config", "c", "wasp-cli.json", "path to wasp-cli.json") + rootCmd.PersistentFlags().BoolVarP(&config.WaitForCompletion, "wait", "w", true, "wait for request completion") - rootCmd.AddCommand(initConfigSetCmd()) rootCmd.AddCommand(initCheckVersionsCmd(waspVersion)) + rootCmd.AddCommand(initConfigSetCmd()) rootCmd.AddCommand(initRefreshL1ParamsCmd()) // The first time parameters.L1() is called, it will be initialized with this function parameters.InitL1Lazy(func() { - if l1ParamsExpired() { - refreshL1ParamsFromNode() + if config.L1ParamsExpired() { + config.RefreshL1ParamsFromNode() } else { - loadL1ParamsFromConfig() + config.LoadL1ParamsFromConfig() } }) } diff --git a/tools/wasp-cli/cli/wallet/wallet.go b/tools/wasp-cli/cli/wallet/wallet.go new file mode 100644 index 0000000000..5795ff3a85 --- /dev/null +++ b/tools/wasp-cli/cli/wallet/wallet.go @@ -0,0 +1,40 @@ +package wallet + +import ( + "github.com/spf13/viper" + + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/packages/cryptolib" + "github.com/iotaledger/wasp/tools/wasp-cli/log" +) + +var AddressIndex int + +type Wallet struct { + KeyPair *cryptolib.KeyPair + AddressIndex int +} + +func Load() *Wallet { + seedHex := viper.GetString("wallet.seed") + + if seedHex == "" { + log.Fatal("call `init` first") + } + + seedBytes, err := iotago.DecodeHex(seedHex) + log.Check(err) + + seed := cryptolib.NewSeedFromBytes(seedBytes) + kp := cryptolib.NewKeyPairFromSeed(seed.SubSeed(uint64(AddressIndex))) + + return &Wallet{KeyPair: kp, AddressIndex: AddressIndex} +} + +func (w *Wallet) PrivateKey() *cryptolib.PrivateKey { + return w.KeyPair.GetPrivateKey() +} + +func (w *Wallet) Address() iotago.Address { + return w.KeyPair.GetPublicKey().AsEd25519Address() +} diff --git a/tools/wasp-cli/log/log.go b/tools/wasp-cli/log/log.go index 3b308e4938..8c6851cddf 100644 --- a/tools/wasp-cli/log/log.go +++ b/tools/wasp-cli/log/log.go @@ -3,7 +3,6 @@ package log import ( "bytes" "encoding/json" - "errors" "fmt" "os" "strings" @@ -142,9 +141,10 @@ func PrintCLIOutput(output CLIOutput) { func Check(err error) { if err != nil { - if errors.Is(err, clients.ErrNotAuthorized) { + // TODO: Debug error type here. + /*if errors.Is(err, apiclient.error) { err = errors.New("unauthorized request: are you logged in? (wasp-cli login)") - } + }*/ errorModel := &ErrorModel{err.Error()} message, _ := GetCLIOutputText(errorModel) diff --git a/tools/wasp-cli/main.go b/tools/wasp-cli/main.go index 7592ce6612..6c6149dbc4 100644 --- a/tools/wasp-cli/main.go +++ b/tools/wasp-cli/main.go @@ -13,6 +13,7 @@ import ( "github.com/iotaledger/wasp/tools/wasp-cli/authentication" "github.com/iotaledger/wasp/tools/wasp-cli/chain" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + cliinit "github.com/iotaledger/wasp/tools/wasp-cli/cli/init" "github.com/iotaledger/wasp/tools/wasp-cli/completion" "github.com/iotaledger/wasp/tools/wasp-cli/decode" "github.com/iotaledger/wasp/tools/wasp-cli/log" @@ -54,12 +55,11 @@ func init() { } rootCmd = initRootCmd(waspVersion) - rootCmd.AddCommand(completion.InitCompletionCommand(rootCmd.Root().Name())) authentication.Init(rootCmd) log.Init(rootCmd) - config.Init(rootCmd, waspVersion) + cliinit.Init(rootCmd, waspVersion) wallet.Init(rootCmd) chain.Init(rootCmd) decode.Init(rootCmd) diff --git a/tools/wasp-cli/metrics/nodeconn.go b/tools/wasp-cli/metrics/nodeconn.go index df1662ba58..59334c5868 100644 --- a/tools/wasp-cli/metrics/nodeconn.go +++ b/tools/wasp-cli/metrics/nodeconn.go @@ -4,9 +4,11 @@ import ( "context" "fmt" "strings" + "time" "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" @@ -23,21 +25,28 @@ func initNodeconnMetricsCmd() *cobra.Command { client := cliclients.WaspClientForIndex() if chainAlias == "" { + nodeconnMetrics, _, err := client.MetricsApi.GetL1Metrics(context.Background()).Execute() log.Check(err) log.Printf("Following chains are registered for L1 events:\n") - for _, s := range nodeconnMetrics.Registered { + for _, s := range nodeconnMetrics.RegisteredChainIDs { log.Printf("\t%s\n", s) } + milestoneMsg := "" + if nodeconnMetrics.InMilestone.LastMessage.MilestoneId != nil { + milestoneMsg = *nodeconnMetrics.InMilestone.LastMessage.MilestoneId + } + + inMilestone := mapMetricItem(nodeconnMetrics.InMilestone.Messages, nodeconnMetrics.InMilestone.Timestamp, milestoneMsg) printMessagesMetrics( - &nodeconnMetrics.NodeConnectionMessagesMetrics, - [][]string{makeMessagesMetricsTableRow("Milestone", true, nodeconnMetrics.InMilestone)}, + nodeconnMetrics, + [][]string{makeMessagesMetricsTableRow("Milestone", true, inMilestone)}, ) } else { chainID, err := isc.ChainIDFromString(chainAlias) log.Check(err) - msgsMetrics, err := client.GetChainNodeConnectionMetrics(chainID) + msgsMetrics, _, err := client.MetricsApi.GetChainMetrics(context.Background(), chainID.String()).Execute() log.Check(err) printMessagesMetrics(msgsMetrics, [][]string{}) } @@ -45,25 +54,45 @@ func initNodeconnMetricsCmd() *cobra.Command { } } -func printMessagesMetrics(msgsMetrics *model.NodeConnectionMessagesMetrics, additionalRows [][]string) { +func mapMetricItem(messages uint32, timestamp time.Time, message string) *apiclient.InterfaceMetricItem { + return &apiclient.InterfaceMetricItem{ + Timestamp: timestamp, + LastMessage: message, + Messages: messages, + } +} + +func printMessagesMetrics(msgsMetrics *apiclient.ChainMetrics, additionalRows [][]string) { header := []string{"Message name", "", "Total", "Last time", "Last message"} + + publisherStateTransaction := mapMetricItem(msgsMetrics.OutPublisherStateTransaction.Messages, msgsMetrics.OutPublisherStateTransaction.Timestamp, msgsMetrics.OutPublisherStateTransaction.LastMessage.TxId) + govTransaction := mapMetricItem(msgsMetrics.OutPublishGovernanceTransaction.Messages, msgsMetrics.OutPublishGovernanceTransaction.Timestamp, msgsMetrics.OutPublishGovernanceTransaction.LastMessage.TxId) + pullLatestOutput := mapMetricItem(msgsMetrics.OutPullLatestOutput.Messages, msgsMetrics.OutPullLatestOutput.Timestamp, msgsMetrics.OutPullLatestOutput.LastMessage) + outPullTxInclusionState := mapMetricItem(msgsMetrics.OutPullTxInclusionState.Messages, msgsMetrics.OutPullTxInclusionState.Timestamp, msgsMetrics.OutPullTxInclusionState.LastMessage.TxId) + outPullOutputByID := mapMetricItem(msgsMetrics.OutPullOutputByID.Messages, msgsMetrics.OutPullOutputByID.Timestamp, msgsMetrics.OutPullOutputByID.LastMessage.OutputId) + inStateOutput := mapMetricItem(msgsMetrics.InStateOutput.Messages, msgsMetrics.InStateOutput.Timestamp, msgsMetrics.InStateOutput.LastMessage.OutputId) + inAliasOutput := mapMetricItem(msgsMetrics.InAliasOutput.Messages, msgsMetrics.InAliasOutput.Timestamp, msgsMetrics.InAliasOutput.LastMessage.Raw) + inOutput := mapMetricItem(msgsMetrics.InOutput.Messages, msgsMetrics.InOutput.Timestamp, msgsMetrics.InOutput.LastMessage.OutputId) + inOnLedgerRequest := mapMetricItem(msgsMetrics.InOnLedgerRequest.Messages, msgsMetrics.InOnLedgerRequest.Timestamp, msgsMetrics.InOnLedgerRequest.LastMessage.OutputId) + inTxInclusionState := mapMetricItem(msgsMetrics.InTxInclusionState.Messages, msgsMetrics.InTxInclusionState.Timestamp, msgsMetrics.InTxInclusionState.LastMessage.TxId) + table := [][]string{ - makeMessagesMetricsTableRow("Publish state transaction", false, msgsMetrics.OutPublishStateTransaction), - makeMessagesMetricsTableRow("Publish governance transaction", false, msgsMetrics.OutPublishGovernanceTransaction), - makeMessagesMetricsTableRow("Pull latest output", false, msgsMetrics.OutPullLatestOutput), - makeMessagesMetricsTableRow("Pull tx inclusion state", false, msgsMetrics.OutPullTxInclusionState), - makeMessagesMetricsTableRow("Pull output by ID", false, msgsMetrics.OutPullOutputByID), - makeMessagesMetricsTableRow("State output", true, msgsMetrics.InStateOutput), - makeMessagesMetricsTableRow("Alias output", true, msgsMetrics.InAliasOutput), - makeMessagesMetricsTableRow("Output", true, msgsMetrics.InOutput), - makeMessagesMetricsTableRow("On ledger request", true, msgsMetrics.InOnLedgerRequest), - makeMessagesMetricsTableRow("Tx inclusion state", true, msgsMetrics.InTxInclusionState), + makeMessagesMetricsTableRow("Publish state transaction", false, publisherStateTransaction), + makeMessagesMetricsTableRow("Publish governance transaction", false, govTransaction), + makeMessagesMetricsTableRow("Pull latest output", false, pullLatestOutput), + makeMessagesMetricsTableRow("Pull tx inclusion state", false, outPullTxInclusionState), + makeMessagesMetricsTableRow("Pull output by ID", false, outPullOutputByID), + makeMessagesMetricsTableRow("State output", true, inStateOutput), + makeMessagesMetricsTableRow("Alias output", true, inAliasOutput), + makeMessagesMetricsTableRow("Output", true, inOutput), + makeMessagesMetricsTableRow("On ledger request", true, inOnLedgerRequest), + makeMessagesMetricsTableRow("Tx inclusion state", true, inTxInclusionState), } table = append(table, additionalRows...) log.PrintTable(header, table) } -func makeMessagesMetricsTableRow(name string, isIn bool, ncmm *model.NodeConnectionMessageMetrics) []string { +func makeMessagesMetricsTableRow(name string, isIn bool, ncmm *apiclient.InterfaceMetricItem) []string { res := make([]string, 5) res[0] = name if isIn { @@ -71,8 +100,8 @@ func makeMessagesMetricsTableRow(name string, isIn bool, ncmm *model.NodeConnect } else { res[1] = "OUT" } - res[2] = fmt.Sprintf("%v", ncmm.Total) - res[3] = ncmm.LastEvent.String() + res[2] = fmt.Sprintf("%v", ncmm.Messages) + res[3] = ncmm.Timestamp.String() res[4] = ncmm.LastMessage if len(res[4]) > maxMessageLen { res[4] = res[4][:maxMessageLen] diff --git a/tools/wasp-cli/peering/info.go b/tools/wasp-cli/peering/info.go index b6553ecb6c..216179e47a 100644 --- a/tools/wasp-cli/peering/info.go +++ b/tools/wasp-cli/peering/info.go @@ -4,9 +4,11 @@ package peering import ( + "context" + "github.com/spf13/cobra" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,10 +18,11 @@ func initInfoCmd() *cobra.Command { Short: "Node info.", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - info, err := config.WaspClient(config.MustWaspAPIURL()).GetPeeringSelf() + client := cliclients.WaspClientForIndex() + info, _, err := client.NodeApi.GetPeeringIdentity(context.Background()).Execute() log.Check(err) - model := &InfoModel{PubKey: info.PubKey, NetID: info.NetID} + model := &InfoModel{PubKey: info.PublicKey, NetID: info.NetId} log.PrintCLIOutput(model) }, } diff --git a/tools/wasp-cli/peering/listtrusted.go b/tools/wasp-cli/peering/listtrusted.go index 1602d95e56..8c1160e637 100644 --- a/tools/wasp-cli/peering/listtrusted.go +++ b/tools/wasp-cli/peering/listtrusted.go @@ -4,9 +4,11 @@ package peering import ( + "context" + "github.com/spf13/cobra" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,14 +18,16 @@ func initListTrustedCmd() *cobra.Command { Short: "List trusted wasp nodes.", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - trustedList, err := config.WaspClient(config.MustWaspAPIURL()).GetPeeringTrustedList() + client := cliclients.WaspClientForIndex() + trustedList, _, err := client.NodeApi.GetTrustedPeers(context.Background()).Execute() log.Check(err) + header := []string{"PubKey", "NetID"} rows := make([][]string, len(trustedList)) for i := range rows { rows[i] = []string{ - trustedList[i].PubKey, - trustedList[i].NetID, + trustedList[i].PublicKey, + trustedList[i].NetId, } } log.PrintTable(header, rows) diff --git a/tools/wasp-cli/peering/trust.go b/tools/wasp-cli/peering/trust.go index 6bac464a6f..62c80a35ac 100644 --- a/tools/wasp-cli/peering/trust.go +++ b/tools/wasp-cli/peering/trust.go @@ -4,11 +4,15 @@ package peering import ( + "context" + "github.com/spf13/cobra" iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/peering" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/chain" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -20,18 +24,27 @@ func initTrustCmd() *cobra.Command { Short: "Trust the specified wasp node as a peer.", Args: cobra.ExactArgs(2), Run: func(cmd *cobra.Command, args []string) { + if nodes == nil { nodes = chain.GetAllWaspNodes() } + pubKey := args[0] netID := args[1] _, err := iotago.DecodeHex(pubKey) // Assert it can be decoded. log.Check(err) log.Check(peering.CheckNetID(netID)) + for _, i := range nodes { - _, err = config.WaspClient(config.MustWaspAPI(i)).PostPeeringTrusted(pubKey, netID) - log.Check(err) + client := cliclients.WaspClientForIndex(i) + + _, err = client.NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ + NetId: netID, + PublicKey: pubKey, + }).Execute() } + + log.Check(err) }, } diff --git a/tools/wasp-cli/util/tx.go b/tools/wasp-cli/util/tx.go index 4a06844fea..0ad1dae957 100644 --- a/tools/wasp-cli/util/tx.go +++ b/tools/wasp-cli/util/tx.go @@ -1,17 +1,20 @@ package util import ( + "context" "os" "time" iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) func PostTransaction(tx *iotago.Transaction) { - _, err := config.L1Client().PostTxAndWaitUntilConfirmation(tx) + _, err := cliclients.L1Client().PostTxAndWaitUntilConfirmation(tx) log.Check(err) } @@ -20,7 +23,12 @@ func WithOffLedgerRequest(chainID isc.ChainID, f func() (isc.OffLedgerRequest, e log.Check(err) log.Printf("Posted off-ledger request (check result with: %s chain request %s)\n", os.Args[0], req.ID().String()) if config.WaitForCompletion { - _, err = config.WaspClient(config.MustWaspAPIURL()).WaitUntilRequestProcessed(chainID, req.ID(), 1*time.Minute) + + // TODO: Add timeout again? 1*time.Minute + _, _, err = cliclients.WaspClientForIndex().RequestsApi. + WaitForRequest(context.Background(), chainID.String(), req.ID().String()). + Execute() + log.Check(err) } // TODO print receipt? @@ -33,7 +41,8 @@ func WithSCTransaction(chainID isc.ChainID, f func() (*iotago.Transaction, error if config.WaitForCompletion || len(forceWait) > 0 { log.Printf("Waiting for tx requests to be processed...\n") - _, err := config.WaspClient(config.MustWaspAPIURL()).WaitUntilAllRequestsProcessed(chainID, tx, 1*time.Minute) + client := cliclients.WaspClientForIndex() + _, err := clients.APIWaitUntilAllRequestsProcessed(client, chainID, tx, 1*time.Minute) log.Check(err) } diff --git a/tools/wasp-cli/wallet/cmd.go b/tools/wasp-cli/wallet/cmd.go index c452dafc0b..a9189a2e8a 100644 --- a/tools/wasp-cli/wallet/cmd.go +++ b/tools/wasp-cli/wallet/cmd.go @@ -2,6 +2,8 @@ package wallet import ( "github.com/spf13/cobra" + + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" ) func Init(rootCmd *cobra.Command) { @@ -11,5 +13,5 @@ func Init(rootCmd *cobra.Command) { rootCmd.AddCommand(initSendFundsCmd()) rootCmd.AddCommand(initRequestFundsCmd()) - rootCmd.PersistentFlags().IntVarP(&addressIndex, "address-index", "i", 0, "address index") + rootCmd.PersistentFlags().IntVarP(&wallet.AddressIndex, "address-index", "i", 0, "address index") } diff --git a/tools/wasp-cli/wallet/info.go b/tools/wasp-cli/wallet/info.go index c6264c0ba0..5ba4254c03 100644 --- a/tools/wasp-cli/wallet/info.go +++ b/tools/wasp-cli/wallet/info.go @@ -6,7 +6,8 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -16,7 +17,7 @@ func initAddressCmd() *cobra.Command { Short: "Show the wallet address", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - wallet := Load() + wallet := wallet.Load() address := wallet.Address() @@ -58,17 +59,17 @@ func initBalanceCmd() *cobra.Command { Short: "Show the wallet balance", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - wallet := Load() + wallet := wallet.Load() address := wallet.Address() - outs, err := config.L1Client().OutputMap(address) + outs, err := cliclients.L1Client().OutputMap(address) log.Check(err) balance := isc.AssetsFromOutputMap(outs) model := &BalanceModel{ Address: address.Bech32(parameters.L1().Protocol.Bech32HRP), - AddressIndex: addressIndex, + AddressIndex: wallet.AddressIndex, NativeTokens: balance.NativeTokens, BaseTokens: balance.BaseTokens, OutputMap: outs, diff --git a/tools/wasp-cli/wallet/request-funds.go b/tools/wasp-cli/wallet/request-funds.go index ece34fcbe2..c93a827c8a 100644 --- a/tools/wasp-cli/wallet/request-funds.go +++ b/tools/wasp-cli/wallet/request-funds.go @@ -4,7 +4,8 @@ import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -14,8 +15,8 @@ func initRequestFundsCmd() *cobra.Command { Short: "Request funds from the faucet", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - address := Load().Address() - log.Check(config.L1Client().RequestFunds(address)) + address := wallet.Load().Address() + log.Check(cliclients.L1Client().RequestFunds(address)) model := &RequestFundsModel{ Address: address.Bech32(parameters.L1().Protocol.Bech32HRP), diff --git a/tools/wasp-cli/wallet/send.go b/tools/wasp-cli/wallet/send.go index 932ea97729..a2b104ce1c 100644 --- a/tools/wasp-cli/wallet/send.go +++ b/tools/wasp-cli/wallet/send.go @@ -6,7 +6,8 @@ import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/transaction" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -27,9 +28,9 @@ func initSendFundsCmd() *cobra.Command { log.Printf("\nSending \n\t%v \n\tto: %v\n\n", tokens, args[0]) - wallet := Load() + wallet := wallet.Load() senderAddress := wallet.Address() - client := config.L1Client() + client := cliclients.L1Client() outputSet, err := client.OutputMap(senderAddress) log.Check(err) diff --git a/tools/wasp-cli/wallet/wallet.go b/tools/wasp-cli/wallet/wallet.go index fa81c8a06e..ab17c2d083 100644 --- a/tools/wasp-cli/wallet/wallet.go +++ b/tools/wasp-cli/wallet/wallet.go @@ -14,10 +14,6 @@ type WalletConfig struct { Seed []byte } -type Wallet struct { - KeyPair *cryptolib.KeyPair -} - func initInitCmd() *cobra.Command { return &cobra.Command{ Use: "init", @@ -44,28 +40,6 @@ func initInitCmd() *cobra.Command { } } -func Load() *Wallet { - seedHex := viper.GetString("wallet.seed") - if seedHex == "" { - log.Fatal("call `init` first") - } - seedBytes, err := iotago.DecodeHex(seedHex) - log.Check(err) - seed := cryptolib.NewSeedFromBytes(seedBytes) - kp := cryptolib.NewKeyPairFromSeed(seed.SubSeed(uint64(addressIndex))) - return &Wallet{KeyPair: kp} -} - -var addressIndex int - -func (w *Wallet) PrivateKey() *cryptolib.PrivateKey { - return w.KeyPair.GetPrivateKey() -} - -func (w *Wallet) Address() iotago.Address { - return w.KeyPair.GetPublicKey().AsEd25519Address() -} - type InitModel struct { ConfigPath string Message string From c14971f013bc9cb95e9150a48597267f93eb5b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 19:10:23 +0100 Subject: [PATCH 06/39] Fix merge issues --- .../webapi/controllers/node/controller.go | 20 +++++++++---------- packages/webapi/models/metrics.go | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/webapi/controllers/node/controller.go b/packages/webapi/controllers/node/controller.go index d80871a709..445bd56a56 100644 --- a/packages/webapi/controllers/node/controller.go +++ b/packages/webapi/controllers/node/controller.go @@ -9,7 +9,7 @@ import ( "github.com/iotaledger/wasp/packages/authentication" "github.com/iotaledger/wasp/packages/authentication/shared/permissions" "github.com/iotaledger/wasp/packages/webapi/interfaces" - models2 "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/services" ) @@ -45,39 +45,39 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfaces.Mocker) { adminAPI.GET("node/info", c.getInfo). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "Returns information about this node.", mocker.Get(models2.InfoResponse{}), nil). + AddResponse(http.StatusOK, "Returns information about this node.", mocker.Get(models.InfoResponse{}), nil). SetOperationId("getInfo"). SetSummary("Returns private information about this node.") adminAPI.GET("node/peers/trusted", c.getTrustedPeers, authentication.ValidatePermissions([]string{permissions.Read})). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "A list of trusted peers", mocker.Get([]models2.PeeringNodeIdentityResponse{}), nil). + AddResponse(http.StatusOK, "A list of trusted peers", mocker.Get([]models.PeeringNodeIdentityResponse{}), nil). SetSummary("Get trusted peers"). SetOperationId("getTrustedPeers") adminAPI.DELETE("node/peers/trusted", c.distrustPeer, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models2.PeeringTrustRequest{}), "", "Info of the peer to distrust", true). + AddParamBody(mocker.Get(models.PeeringTrustRequest{}), "", "Info of the peer to distrust", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "Peer was successfully distrusted", nil, nil). SetSummary("Distrust a peering node"). SetOperationId("distrustPeer") adminAPI.POST("node/owner/certificate", c.setNodeOwner, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models2.NodeOwnerCertificateRequest{}), "", "The node owner certificate", true). + AddParamBody(mocker.Get(models.NodeOwnerCertificateRequest{}), "", "The node owner certificate", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "Node owner was successfully changed", mocker.Get(models.NodeOwnerCertificateResponse{}), nil). SetSummary("Sets the node owner"). SetOperationId("setNodeOwner") adminAPI.POST("node/peers/trusted", c.trustPeer, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models2.PeeringTrustRequest{}), "", "Info of the peer to trust", true). + AddParamBody(mocker.Get(models.PeeringTrustRequest{}), "", "Info of the peer to trust", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "Peer was successfully trusted", nil, nil). SetSummary("Trust a peering node"). SetOperationId("trustPeer") adminAPI.POST("node/dks", c.generateDKS, authentication.ValidatePermissions([]string{permissions.Write})). - AddParamBody(mocker.Get(models2.DKSharesPostRequest{}), "DKSharesPostRequest", "Request parameters", true). + AddParamBody(mocker.Get(models.DKSharesPostRequest{}), "DKSharesPostRequest", "Request parameters", true). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "DK shares info", mocker.Get(models.DKSharesInfo{}), nil). SetSummary("Generate a new distributed key"). @@ -86,19 +86,19 @@ func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfa adminAPI.GET("node/dks/:sharedAddress", c.getDKSInfo, authentication.ValidatePermissions([]string{permissions.Read})). AddParamPath("", "sharedAddress", "SharedAddress (Bech32)"). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "DK shares info", mocker.Get(models2.DKSharesInfo{}), nil). + AddResponse(http.StatusOK, "DK shares info", mocker.Get(models.DKSharesInfo{}), nil). SetSummary("Get information about the shared address DKS configuration"). SetOperationId("getDKSInfo") adminAPI.GET("node/peers/identity", c.getIdentity, authentication.ValidatePermissions([]string{permissions.Read})). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "This node peering identity", mocker.Get(models2.PeeringNodeIdentityResponse{}), nil). + AddResponse(http.StatusOK, "This node peering identity", mocker.Get(models.PeeringNodeIdentityResponse{}), nil). SetSummary("Get basic peer info of the current node"). SetOperationId("getPeeringIdentity") adminAPI.GET("node/peers", c.getRegisteredPeers, authentication.ValidatePermissions([]string{permissions.Read})). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). - AddResponse(http.StatusOK, "A list of all peers", mocker.Get([]models2.PeeringNodeStatusResponse{}), nil). + AddResponse(http.StatusOK, "A list of all peers", mocker.Get([]models.PeeringNodeStatusResponse{}), nil). SetSummary("Get basic information about all configured peers"). SetOperationId("getAllPeers") diff --git a/packages/webapi/models/metrics.go b/packages/webapi/models/metrics.go index 445edc8b4b..5745f5f44a 100644 --- a/packages/webapi/models/metrics.go +++ b/packages/webapi/models/metrics.go @@ -4,6 +4,7 @@ import ( "time" "github.com/iotaledger/wasp/packages/chain" + "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/webapi/dto" ) From bcd5cb14ec8e5ca2b613a5d4bad25c9f4679211c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 19:32:25 +0100 Subject: [PATCH 07/39] Update apiclient --- clients/apiclient/.openapi-generator/FILES | 30 +- clients/apiclient/api/openapi.yaml | 1820 ++--------------- clients/apiclient/api_auth.go | 2 +- clients/apiclient/api_chains.go | 2 +- clients/apiclient/api_corecontracts.go | 2 +- clients/apiclient/api_metrics.go | 2 +- clients/apiclient/api_node.go | 10 +- clients/apiclient/api_requests.go | 2 +- clients/apiclient/api_users.go | 2 +- clients/apiclient/client.go | 10 +- clients/apiclient/configuration.go | 2 +- clients/apiclient/docs/NodeApi.md | 6 +- clients/apiclient/docs/RequestDetail.md | 18 +- .../apiclient/model_account_list_response.go | 2 +- .../apiclient/model_account_nfts_response.go | 2 +- .../apiclient/model_account_nonce_response.go | 2 +- clients/apiclient/model_add_user_request.go | 2 +- .../model_alias_output_metric_item.go | 2 +- clients/apiclient/model_assets_response.go | 2 +- clients/apiclient/model_auth_info_model.go | 2 +- clients/apiclient/model_base_token.go | 2 +- clients/apiclient/model_blob.go | 2 +- clients/apiclient/model_blob_info_response.go | 2 +- clients/apiclient/model_blob_list_response.go | 2 +- .../apiclient/model_blob_value_response.go | 2 +- .../apiclient/model_block_info_response.go | 2 +- .../apiclient/model_block_receipt_error.go | 2 +- .../model_block_receipts_response.go | 2 +- clients/apiclient/model_burn_log.go | 2 +- clients/apiclient/model_burn_record.go | 2 +- clients/apiclient/model_call_target.go | 2 +- .../apiclient/model_chain_info_response.go | 2 +- clients/apiclient/model_chain_metrics.go | 2 +- .../model_committee_info_response.go | 2 +- clients/apiclient/model_committee_node.go | 2 +- .../apiclient/model_consensus_pipe_metrics.go | 2 +- .../model_consensus_workflow_metrics.go | 2 +- .../model_contract_call_view_request.go | 2 +- .../apiclient/model_contract_info_response.go | 2 +- .../model_control_addresses_response.go | 2 +- clients/apiclient/model_dk_shares_info.go | 2 +- .../apiclient/model_dk_shares_post_request.go | 2 +- .../model_error_message_format_response.go | 2 +- clients/apiclient/model_events_response.go | 2 +- .../model_foundry_output_response.go | 2 +- clients/apiclient/model_gas_fee_policy.go | 2 +- .../model_gov_chain_info_response.go | 2 +- clients/apiclient/model_in_output.go | 2 +- .../apiclient/model_in_output_metric_item.go | 2 +- clients/apiclient/model_in_state_output.go | 2 +- .../model_in_state_output_metric_item.go | 2 +- clients/apiclient/model_info_response.go | 2 +- .../apiclient/model_interface_metric_item.go | 2 +- clients/apiclient/model_item.go | 2 +- clients/apiclient/model_json_dict.go | 2 +- clients/apiclient/model_l1_params.go | 2 +- clients/apiclient/model_login_request.go | 2 +- clients/apiclient/model_login_response.go | 2 +- clients/apiclient/model_milestone_info.go | 2 +- .../apiclient/model_milestone_metric_item.go | 2 +- clients/apiclient/model_native_token.go | 2 +- ...model_native_token_id_registry_response.go | 2 +- clients/apiclient/model_nft_data_response.go | 2 +- .../model_node_owner_certificate_request.go | 2 +- .../model_node_owner_certificate_response.go | 2 +- clients/apiclient/model_off_ledger_request.go | 2 +- clients/apiclient/model_on_ledger_request.go | 2 +- .../model_on_ledger_request_metric_item.go | 2 +- clients/apiclient/model_output.go | 2 +- clients/apiclient/model_output_id.go | 2 +- .../model_peering_node_identity_response.go | 2 +- .../model_peering_node_status_response.go | 2 +- .../apiclient/model_peering_trust_request.go | 2 +- .../apiclient/model_protocol_parameters.go | 2 +- .../model_publisher_state_transaction_item.go | 2 +- clients/apiclient/model_receipt_error.go | 2 +- clients/apiclient/model_receipt_response.go | 2 +- clients/apiclient/model_rent_structure.go | 2 +- clients/apiclient/model_request_detail.go | 24 +- .../apiclient/model_request_ids_response.go | 2 +- .../model_request_processed_response.go | 2 +- .../model_request_receipt_response.go | 2 +- clients/apiclient/model_state_response.go | 2 +- clients/apiclient/model_state_transaction.go | 2 +- clients/apiclient/model_transaction.go | 2 +- .../model_transaction_id_metric_item.go | 2 +- .../model_transaction_metric_item.go | 2 +- .../apiclient/model_tx_inclusion_state_msg.go | 2 +- ...odel_tx_inclusion_state_msg_metric_item.go | 2 +- .../model_update_user_password_request.go | 2 +- .../model_update_user_permissions_request.go | 2 +- clients/apiclient/model_user.go | 2 +- .../apiclient/model_utxo_input_metric_item.go | 2 +- clients/apiclient/model_validation_error.go | 2 +- clients/apiclient/response.go | 2 +- clients/apiclient/utils.go | 2 +- clients/apiutils.go | 15 + .../webapi/controllers/node/controller.go | 2 +- packages/webapi/controllers/node/info.go | 2 +- packages/webapi/models/node.go | 4 + tools/cluster/cluster.go | 11 +- tools/wasp-cli/cli/cliclients/clients.go | 8 +- tools/wasp-cli/cli/init/checkversions.go | 4 +- 103 files changed, 281 insertions(+), 1861 deletions(-) diff --git a/clients/apiclient/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES index 49681f0f08..91d22e9312 100644 --- a/clients/apiclient/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -1,13 +1,11 @@ .gitignore .travis.yml api/openapi.yaml -api_admin.go api_auth.go api_chains.go api_corecontracts.go api_metrics.go api_node.go -api_public.go api_requests.go api_users.go client.go @@ -16,9 +14,8 @@ docs/AccountListResponse.md docs/AccountNFTsResponse.md docs/AccountNonceResponse.md docs/AddUserRequest.md -docs/AdminApi.md docs/AliasOutputMetricItem.md -docs/Allowance.md +docs/Assets.md docs/AssetsResponse.md docs/AuthApi.md docs/AuthInfoModel.md @@ -35,13 +32,11 @@ docs/BurnRecord.md docs/CallTarget.md docs/ChainInfoResponse.md docs/ChainMetrics.md -docs/ChainRecord.md docs/ChainsApi.md docs/CommitteeInfoResponse.md docs/CommitteeNode.md docs/ConsensusPipeMetrics.md docs/ConsensusWorkflowMetrics.md -docs/ConsensusWorkflowStatus.md docs/ContractCallViewRequest.md docs/ContractInfoResponse.md docs/ControlAddressesResponse.md @@ -51,7 +46,6 @@ docs/DKSharesPostRequest.md docs/ErrorMessageFormatResponse.md docs/EventsResponse.md docs/FoundryOutputResponse.md -docs/FungibleTokens.md docs/GasFeePolicy.md docs/GovChainInfoResponse.md docs/InOutput.md @@ -72,24 +66,17 @@ docs/NFTDataResponse.md docs/NativeToken.md docs/NativeTokenIDRegistryResponse.md docs/NodeApi.md -docs/NodeConnectionMessageMetrics.md -docs/NodeConnectionMessagesMetrics.md -docs/NodeConnectionMetrics.md docs/NodeOwnerCertificateRequest.md docs/NodeOwnerCertificateResponse.md docs/OffLedgerRequest.md -docs/OffLedgerRequestBody.md docs/OnLedgerRequest.md docs/OnLedgerRequestMetricItem.md docs/Output.md docs/OutputID.md docs/PeeringNodeIdentityResponse.md -docs/PeeringNodeStatus.md docs/PeeringNodeStatusResponse.md docs/PeeringTrustRequest.md -docs/PeeringTrustedNode.md docs/ProtocolParameters.md -docs/PublicApi.md docs/PublisherStateTransactionItem.md docs/ReceiptError.md docs/ReceiptResponse.md @@ -112,7 +99,7 @@ docs/UpdateUserPermissionsRequest.md docs/User.md docs/UsersApi.md docs/ValidationError.md -docs/WaitRequestProcessedParams.md +docs/VersionResponse.md git_push.sh go.sum model_account_list_response.go @@ -120,7 +107,7 @@ model_account_nfts_response.go model_account_nonce_response.go model_add_user_request.go model_alias_output_metric_item.go -model_allowance.go +model_assets.go model_assets_response.go model_auth_info_model.go model_base_token.go @@ -136,12 +123,10 @@ model_burn_record.go model_call_target.go model_chain_info_response.go model_chain_metrics.go -model_chain_record.go model_committee_info_response.go model_committee_node.go model_consensus_pipe_metrics.go model_consensus_workflow_metrics.go -model_consensus_workflow_status.go model_contract_call_view_request.go model_contract_info_response.go model_control_addresses_response.go @@ -150,7 +135,6 @@ model_dk_shares_post_request.go model_error_message_format_response.go model_events_response.go model_foundry_output_response.go -model_fungible_tokens.go model_gas_fee_policy.go model_gov_chain_info_response.go model_in_output.go @@ -169,22 +153,16 @@ model_milestone_metric_item.go model_native_token.go model_native_token_id_registry_response.go model_nft_data_response.go -model_node_connection_message_metrics.go -model_node_connection_messages_metrics.go -model_node_connection_metrics.go model_node_owner_certificate_request.go model_node_owner_certificate_response.go model_off_ledger_request.go -model_off_ledger_request_body.go model_on_ledger_request.go model_on_ledger_request_metric_item.go model_output.go model_output_id.go model_peering_node_identity_response.go -model_peering_node_status.go model_peering_node_status_response.go model_peering_trust_request.go -model_peering_trusted_node.go model_protocol_parameters.go model_publisher_state_transaction_item.go model_receipt_error.go @@ -206,6 +184,6 @@ model_update_user_permissions_request.go model_user.go model_utxo_input_metric_item.go model_validation_error.go -model_wait_request_processed_params.go +model_version_response.go response.go utils.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 763416dd9d..4294e5346a 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.1 info: description: REST API for the Wasp node title: Wasp API - version: "123" + version: 0.4.0-alpha.8-14-gbb23763d3 externalDocs: description: Find out more about Wasp url: https://wiki.iota.org/smart-contracts/overview @@ -10,10 +10,6 @@ servers: - url: http://localhost:9090/ - url: https://localhost:9090/ tags: -- description: Public endpoints - name: public -- description: Admin endpoints - name: admin - name: auth - name: chains - name: chains @@ -28,843 +24,43 @@ tags: - name: corecontracts - name: corecontracts paths: - /adm/chain/nodeconn/metrics: - get: - deprecated: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/NodeConnectionMetrics' - description: Cummulative chains metrics - summary: Get cummulative chains node connection metrics - tags: - - admin - /adm/chain/{chainID}/access-node/{pubKey}: - delete: - parameters: - - description: ChainID (bech32)) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: PublicKey (hex string) - in: path - name: pubKey - required: true - schema: - format: string - type: string - responses: - default: - content: {} - description: successful operation - summary: Remove an access node from a chain - tags: - - admin - put: - parameters: - - description: ChainID (bech32)) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: PublicKey (hex string) - in: path - name: pubKey - required: true - schema: - format: string - type: string - responses: - default: - content: {} - description: successful operation - summary: Add an access node to a chain - tags: - - admin - /adm/chain/{chainID}/activate: - post: - deprecated: true - parameters: - - description: ChainID (bech32)) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - default: - content: {} - description: successful operation - summary: Activate a chain - tags: - - admin - /adm/chain/{chainID}/consensus/metrics/pipe: - get: - deprecated: true - parameters: - - description: chainID - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConsensusPipeMetrics' - description: Chain consensus pipe metrics - "404": - content: {} - description: Chain consensus hasn't been created - summary: Get consensus pipe metrics - tags: - - admin - /adm/chain/{chainID}/consensus/status: - get: - deprecated: true - parameters: - - description: ChainID (bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ConsensusWorkflowStatus' - description: Chain consensus stats - "404": - content: {} - description: Chain consensus hasn't been created - summary: Get chain state statistics for the given chain ID - tags: - - admin - /adm/chain/{chainID}/deactivate: - post: - deprecated: true - parameters: - - description: ChainID (bech32)) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - default: - content: {} - description: successful operation - summary: Deactivate a chain - tags: - - admin - /adm/chain/{chainID}/info: - get: - deprecated: true - parameters: - - description: ChainID (bech32)) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - default: - content: {} - description: successful operation - summary: Get basic chain info. - tags: - - admin - /adm/chain/{chainID}/nodeconn/metrics: - get: - deprecated: true - parameters: - - description: ChainID (bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/NodeConnectionMessagesMetrics' - description: Chain metrics - summary: Get chain node connection metrics for the given chain ID - tags: - - admin - /adm/chainrecord: - post: - deprecated: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChainRecord' - description: Chain record - required: true - responses: - default: - content: {} - description: successful operation - summary: Create a new chain record - tags: - - admin - x-codegen-request-body-name: Record - /adm/chainrecord/{chainID}: - get: - deprecated: true - parameters: - - description: ChainID (bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ChainRecord' - description: Chain Record - summary: Find the chain record for the given chain ID - tags: - - admin - /adm/chainrecords: - get: - deprecated: true - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ChainRecord' - type: array - description: Chain Record - summary: Get the list of chain records in the node - tags: - - admin - /adm/dks: - post: - deprecated: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DKSharesPostRequest' - description: Request parameters - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DKSharesInfo' - description: DK shares info - summary: Generate a new distributed key - tags: - - admin - x-codegen-request-body-name: DKSharesPostRequest - /adm/dks/{sharedAddress}: - get: - deprecated: true - parameters: - - description: Address of the DK share (hex) - in: path - name: sharedAddress - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DKSharesInfo' - description: DK shares info - summary: Get distributed key properties - tags: - - admin - /adm/node/owner/certificate: - post: - deprecated: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NodeOwnerCertificateRequest' - description: Certificate request - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/NodeOwnerCertificateResponse' - description: Generated certificate. - summary: "Provides a certificate, if the node recognizes the owner." - tags: - - admin - x-codegen-request-body-name: Request - /adm/peering/established: - get: - deprecated: true - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/PeeringNodeStatus' - type: array - description: A list of all peers. - summary: Basic information about all configured peers. - tags: - - admin - /adm/peering/self: - get: - deprecated: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustedNode' - description: This node as a peer. - summary: Basic peer info of the current node. - tags: - - admin - /adm/peering/trusted: - get: - deprecated: true - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/PeeringTrustedNode' - type: array - description: A list of trusted peers. - summary: Get a list of trusted peers. - tags: - - admin - post: - deprecated: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustedNode' - description: Info of the peer to trust. - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustedNode' - description: Trusted peer info. - summary: Trust the specified peer. - tags: - - admin - x-codegen-request-body-name: PeeringTrustedNode - /adm/peering/trusted/{pubKey}: - delete: - deprecated: true - parameters: - - description: Public key of the trusted peer (hex). - in: path - name: pubKey - required: true - schema: - format: string - type: string - responses: - default: - content: {} - description: successful operation - summary: Distrust the specified peer. - tags: - - admin - get: - deprecated: true - parameters: - - description: Public key of the trusted peer (hex). - in: path - name: pubKey - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustedNode' - description: Trusted peer info. - summary: Get details on a particular trusted peer. - tags: - - admin - put: - deprecated: true - parameters: - - description: Public key of the trusted peer (hex). - in: path - name: pubKey - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustedNode' - description: Info of the peer to trust. - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/PeeringTrustedNode' - description: Trusted peer info. - summary: "Trust the specified peer, the pub key is passed via the path." - tags: - - admin - x-codegen-request-body-name: PeeringTrustedNode - /adm/shutdown: - get: - deprecated: true - responses: - default: - content: {} - description: successful operation - summary: Shut down the node - tags: - - admin - /auth: - post: - operationId: authenticate - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LoginRequest' - description: The login request - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/LoginResponse' - description: Login was successful - "401": - content: {} - description: "Unauthorized (Wrong permissions, missing token)" - summary: Authenticate towards the node - tags: - - auth - x-codegen-request-body-name: "" - /auth/info: - get: - operationId: authInfo - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/AuthInfoModel' - description: Login was successful - summary: Get information about the current authentication mode - tags: - - auth - /chain/{chainID}/contract/{contractHname}/callview/{fname}: - get: - deprecated: true - parameters: - - description: ChainID - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Contract Hname - in: path - name: contractHname - required: true - schema: - format: string - type: string - - description: Function name - in: path - name: fname - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Parameters - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Result - summary: Call a view function on a contract by name - tags: - - public - x-codegen-request-body-name: params - post: - deprecated: true - parameters: - - description: ChainID - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Contract Hname - in: path - name: contractHname - required: true - schema: - format: string - type: string - - description: Function name - in: path - name: fname - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Parameters - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Result - summary: Call a view function on a contract by name - tags: - - public - x-codegen-request-body-name: params - /chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname}: - get: - deprecated: true - parameters: - - description: ChainID - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Contract Hname - in: path - name: contractHname - required: true - schema: - format: string - type: string - - description: Function Hname - in: path - name: functionHname - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Parameters - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Result - summary: Call a view function on a contract by Hname - tags: - - public - x-codegen-request-body-name: params - post: - deprecated: true - parameters: - - description: ChainID - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Contract Hname - in: path - name: contractHname - required: true - schema: - format: string - type: string - - description: Function Hname - in: path - name: functionHname - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Parameters - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/JSONDict' - description: Result - summary: Call a view function on a contract by Hname - tags: - - public - x-codegen-request-body-name: params - /chain/{chainID}/evm/reqid/{txHash}: - get: - deprecated: true - parameters: - - description: ChainID (bech32-encoded) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Transaction hash (hex-encoded) - in: path - name: txHash - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - format: string - type: string - description: Request ID - "404": - content: - application/json: - schema: - example: 0x00000000000000000000000000000000000000000000000000000000000000000000 - format: string - type: string - description: Request ID not found - summary: Get the ISC request ID for the given Ethereum transaction hash - tags: - - public - /chain/{chainID}/request: + /auth: post: - deprecated: true - parameters: - - description: chainID - in: path - name: chainID - required: true - schema: - format: string - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OffLedgerRequestBody' - description: "Offledger Request encoded in base64. Optionally, the body can\ - \ be the binary representation of the offledger request, but mime-type must\ - \ be specified to \"application/octet-stream\"" - required: false - responses: - "202": - content: {} - description: Request submitted - summary: Post an off-ledger request - tags: - - public - x-codegen-request-body-name: Request - /chain/{chainID}/request/{reqID}/receipt: - get: - deprecated: true - parameters: - - description: ChainID (bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Request ID - in: path - name: reqID - required: true - schema: - format: string - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/RequestReceiptResponse' - description: Request Receipt - summary: Get the processing status of a given request in the node - tags: - - public - /chain/{chainID}/request/{reqID}/wait: - get: - deprecated: true - parameters: - - description: ChainID (bech32) - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Request ID - in: path - name: reqID - required: true - schema: - format: string - type: string + operationId: authenticate requestBody: content: application/json: schema: - $ref: '#/components/schemas/WaitRequestProcessedParams' - description: Optional parameters - required: false - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/RequestReceiptResponse' - description: Request Receipt - summary: Wait until the given request has been processed by the node - tags: - - public - x-codegen-request-body-name: Params - /chain/{chainID}/state/{key}: - get: - deprecated: true - parameters: - - description: ChainID - in: path - name: chainID - required: true - schema: - format: string - type: string - - description: Key (hex-encoded) - in: path - name: key + $ref: '#/components/schemas/LoginRequest' + description: The login request required: true - schema: - format: string - type: string responses: "200": content: application/json: schema: - items: - example: 118 - format: int32 - type: integer - type: array - description: Result - summary: Fetch the raw value associated with the given key in the chain state - tags: - - public - /chain/{chainID}/ws: - get: - deprecated: true - parameters: - - description: ChainID (bech32-encoded) - in: path - name: chainID - required: true - schema: - format: string - type: string - responses: - default: + $ref: '#/components/schemas/LoginResponse' + description: Login was successful + "401": content: {} - description: successful operation + description: "Unauthorized (Wrong permissions, missing token)" + summary: Authenticate towards the node tags: - - public - /info: + - auth + x-codegen-request-body-name: "" + /auth/info: get: - deprecated: true + operationId: authInfo responses: "200": content: application/json: schema: - $ref: '#/components/schemas/InfoResponse' - description: Node properties - summary: Get information about the node + $ref: '#/components/schemas/AuthInfoModel' + description: Login was successful + summary: Get information about the current authentication mode tags: - - public + - auth /v2chains: get: operationId: getChains @@ -1787,7 +983,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RequestReceiptResponse_' + $ref: '#/components/schemas/RequestReceiptResponse' description: The receipt "401": content: @@ -2119,7 +1315,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ConsensusPipeMetrics_' + $ref: '#/components/schemas/ConsensusPipeMetrics' description: A list of all available metrics. "401": content: @@ -2214,7 +1410,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesPostRequest_' + $ref: '#/components/schemas/DKSharesPostRequest' description: Request parameters required: true responses: @@ -2222,7 +1418,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesInfo_' + $ref: '#/components/schemas/DKSharesInfo' description: DK shares info "401": content: @@ -2252,7 +1448,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DKSharesInfo_' + $ref: '#/components/schemas/DKSharesInfo' description: DK shares info "401": content: @@ -2273,7 +1469,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/InfoResponse_' + $ref: '#/components/schemas/InfoResponse' description: Returns information about this node. "401": content: @@ -2293,7 +1489,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NodeOwnerCertificateRequest_' + $ref: '#/components/schemas/NodeOwnerCertificateRequest' description: The node owner certificate required: true responses: @@ -2301,7 +1497,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/NodeOwnerCertificateResponse_' + $ref: '#/components/schemas/NodeOwnerCertificateResponse' description: Node owner was successfully changed "401": content: @@ -2458,8 +1654,7 @@ paths: content: application/json: schema: - format: string - type: string + $ref: '#/components/schemas/VersionResponse' description: Returns the version of the node. summary: Returns the node version. tags: @@ -2481,7 +1676,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/JSONDict' + $ref: '#/components/schemas/JSONDict_' description: Result summary: Call a view function on a contract by Hname tags: @@ -2805,21 +2000,30 @@ components: type: object xml: name: AliasOutputMetricItem - Allowance: + Assets: example: - fungibleTokens: - baseTokens: 7 - nativeTokens: - - amount: amount - id: id - - amount: amount - id: id nfts: - nfts - nfts + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id properties: - fungibleTokens: - $ref: '#/components/schemas/FungibleTokens' + baseTokens: + format: int64 + type: integer + xml: + name: BaseTokens + nativeTokens: + items: + $ref: '#/components/schemas/NativeToken' + type: array + xml: + name: NativeTokens + wrapped: true nfts: items: format: string @@ -2829,11 +2033,12 @@ components: name: NFTs wrapped: true required: - - fungibleTokens + - baseTokens + - nativeTokens - nfts type: object xml: - name: Allowance + name: Assets AssetsResponse: example: baseTokens: 0 @@ -3147,6 +2352,9 @@ components: gasBurned: 5 request: fungibleTokens: + nfts: + - nfts + - nfts baseTokens: 7 nativeTokens: - amount: amount @@ -3162,16 +2370,15 @@ components: entryPoint: 3 targetAddress: targetAddress allowance: - fungibleTokens: - baseTokens: 7 - nativeTokens: - - amount: amount - id: id - - amount: amount - id: id nfts: - nfts - nfts + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id params: Items: - value: value @@ -3200,6 +2407,9 @@ components: gasBurned: 5 request: fungibleTokens: + nfts: + - nfts + - nfts baseTokens: 7 nativeTokens: - amount: amount @@ -3215,16 +2425,15 @@ components: entryPoint: 3 targetAddress: targetAddress allowance: - fungibleTokens: - baseTokens: 7 - nativeTokens: - - amount: amount - id: id - - amount: amount - id: id nfts: - nfts - nfts + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id params: Items: - value: value @@ -3248,7 +2457,7 @@ components: properties: receipts: items: - $ref: '#/components/schemas/RequestReceiptResponse_' + $ref: '#/components/schemas/RequestReceiptResponse' type: array xml: name: Receipts @@ -3529,38 +2738,6 @@ components: type: object xml: name: ChainMetrics - ChainRecord: - example: - chainId: tst1pqtn76c7y28uh0fjz7pdu303j5mcwl35wthrq995qxyxa9zfr2s0uq8s0c9 - accessNodes: - - accessNodes - - accessNodes - active: true - properties: - accessNodes: - items: - format: string - type: string - type: array - xml: - name: AccessNodes - wrapped: true - active: - description: Whether or not the chain is active - format: boolean - type: boolean - xml: - name: Active - chainId: - description: ChainID (bech32) - example: tst1pqtn76c7y28uh0fjz7pdu303j5mcwl35wthrq995qxyxa9zfr2s0uq8s0c9 - format: string - type: string - xml: - name: ChainID - type: object - xml: - name: ChainRecord CommitteeInfoResponse: example: candidateNodes: @@ -3713,42 +2890,6 @@ components: xml: name: CommitteeNode ConsensusPipeMetrics: - example: - EventVMResultMsgPipeSize: 5 - EventStateTransitionMsgPipeSize: 1 - EventACSMsgPipeSize: 0 - EventPeerLogIndexMsgPipeSize: 6 - EventTimerMsgPipeSize: 5 - properties: - EventACSMsgPipeSize: - format: int32 - type: integer - xml: - name: EventACSMsgPipeSize - EventPeerLogIndexMsgPipeSize: - format: int32 - type: integer - xml: - name: EventPeerLogIndexMsgPipeSize - EventStateTransitionMsgPipeSize: - format: int32 - type: integer - xml: - name: EventStateTransitionMsgPipeSize - EventTimerMsgPipeSize: - format: int32 - type: integer - xml: - name: EventTimerMsgPipeSize - EventVMResultMsgPipeSize: - format: int32 - type: integer - xml: - name: EventVMResultMsgPipeSize - type: object - xml: - name: ConsensusPipeMetrics - ConsensusPipeMetrics_: example: eventACSMsgPipeSize: 0 eventPeerLogIndexMsgPipeSize: 6 @@ -3954,157 +3095,6 @@ components: type: object xml: name: ConsensusWorkflowMetrics - ConsensusWorkflowStatus: - example: - flagStateReceived: true - flagTransactionPosted: true - flagVMStarted: true - timeTransactionSeen: 2000-01-23T04:56:07.000+00:00 - flagConsensusBatchKnown: true - timeTransactionFinalized: 2000-01-23T04:56:07.000+00:00 - timeVMStarted: 2000-01-23T04:56:07.000+00:00 - flagVMResultSigned: true - timeBatchProposalSent: 2023-02-03T18:48:24.994717506+01:00 - timeVMResultSigned: 2000-01-23T04:56:07.000+00:00 - timeCompleted: 2000-01-23T04:56:07.000+00:00 - timeTransactionPosted: 2000-01-23T04:56:07.000+00:00 - flagTransactionSeen: true - timeConsensusBatchKnown: 2023-02-03T18:48:29.994717666+01:00 - currentStateIndex: 0 - flagInProgress: true - flagBatchProposalSent: true - flagTransactionFinalized: true - properties: - currentStateIndex: - description: Shows current state index of the consensus - format: int32 - type: integer - xml: - name: CurrentStateIndex - flagBatchProposalSent: - description: Shows if batch proposal is sent out in current consensus iteration - example: true - format: boolean - type: boolean - xml: - name: FlagBatchProposalSent - flagConsensusBatchKnown: - description: Shows if consensus on batch is reached and known in current - consensus iteration - example: true - format: boolean - type: boolean - xml: - name: FlagConsensusBatchKnown - flagInProgress: - description: Shows if consensus algorithm is still not completed in current - consensus iteration - example: true - format: boolean - type: boolean - xml: - name: FlagInProgress - flagStateReceived: - description: Shows if state output is received in current consensus iteration - example: true - format: boolean - type: boolean - xml: - name: FlagStateReceived - flagTransactionFinalized: - description: Shows if consensus on transaction is reached in current consensus - iteration - format: boolean - type: boolean - xml: - name: FlagTransactionFinalized - flagTransactionPosted: - description: Shows if transaction is posted to L1 in current consensus iteration - format: boolean - type: boolean - xml: - name: FlagTransactionPosted - flagTransactionSeen: - description: Shows if L1 reported that it has seen the transaction of current - consensus iteration - format: boolean - type: boolean - xml: - name: FlagTransactionSeen - flagVMResultSigned: - description: Shows if virtual machine has returned its results in current - consensus iteration - format: boolean - type: boolean - xml: - name: FlagVMResultSigned - flagVMStarted: - description: Shows if virtual machine is started in current consensus iteration - format: boolean - type: boolean - xml: - name: FlagVMStarted - timeBatchProposalSent: - description: Shows when batch proposal was last sent out in current consensus - iteration - example: 2023-02-03T18:48:24.994717506+01:00 - format: date-time - type: string - xml: - name: TimeBatchProposalSent - timeCompleted: - description: Shows when algorithm was last completed in current consensus - iteration - format: date-time - type: string - xml: - name: TimeCompleted - timeConsensusBatchKnown: - description: Shows when ACS results of consensus on batch was last received - in current consensus iteration - example: 2023-02-03T18:48:29.994717666+01:00 - format: date-time - type: string - xml: - name: TimeConsensusBatchKnown - timeTransactionFinalized: - description: Shows when algorithm last noted that all the data for consensus - on transaction had been received in current consensus iteration - format: date-time - type: string - xml: - name: TimeTransactionFinalized - timeTransactionPosted: - description: Shows when transaction was last posted to L1 in current consensus - iteration - format: date-time - type: string - xml: - name: TimeTransactionPosted - timeTransactionSeen: - description: Shows when algorithm last noted that transaction hadd been - seen by L1 in current consensus iteration - format: date-time - type: string - xml: - name: TimeTransactionSeen - timeVMResultSigned: - description: Shows when virtual machine results were last received and signed - in current consensus iteration - format: date-time - type: string - xml: - name: TimeVMResultSigned - timeVMStarted: - description: Shows when virtual machine was last started in current consensus - iteration - format: date-time - type: string - xml: - name: TimeVMStarted - type: object - xml: - name: ConsensusWorkflowStatus ContractCallViewRequest: example: contractHName: contractHName @@ -4120,7 +3110,7 @@ components: contractName: contractName properties: arguments: - $ref: '#/components/schemas/JSONDict_' + $ref: '#/components/schemas/JSONDict' chainId: description: The chain id format: string @@ -4239,67 +3229,6 @@ components: xml: name: ControlAddressesResponse DKSharesInfo: - example: - peerPubKeys: - - a2V5 - - a2V5 - address: tst1ppe9mtkewv8v4an5lv9yt6whz3kvzyj043ls4l3wqun9fhxrnwzpz6uv2s4 - threshold: 3 - pubKeyShares: - - a2V5 - - a2V5 - sharedPubKey: a2V5 - peerIndex: 0 - properties: - address: - description: New generated shared address. - example: tst1ppe9mtkewv8v4an5lv9yt6whz3kvzyj043ls4l3wqun9fhxrnwzpz6uv2s4 - format: string - type: string - xml: - name: Address - peerIndex: - format: int32 - type: integer - xml: - name: PeerIndex - peerPubKeys: - description: Public keys of the nodes sharing the key (base64-encoded). - items: - example: a2V5 - format: string - type: string - type: array - xml: - name: PeerPubKeys - wrapped: true - pubKeyShares: - description: Public key shares for all the peers (base64-encoded). - items: - example: a2V5 - format: string - type: string - type: array - xml: - name: PubKeyShares - wrapped: true - sharedPubKey: - description: Shared public key (base64-encoded). - example: a2V5 - format: string - type: string - xml: - name: SharedPubKey - threshold: - example: 3 - format: int32 - type: integer - xml: - name: Threshold - type: object - xml: - name: DKSharesInfo - DKSharesInfo_: example: publicKeyShares: - publicKeyShares @@ -4366,39 +3295,11 @@ components: name: DKSharesInfo DKSharesPostRequest: example: - peerPubKeys: - - a2V5 - - a2V5 - timeoutMS: 10000 - threshold: 3 - properties: - peerPubKeys: - items: - example: a2V5 - format: string - type: string - type: array - xml: - name: PeerPubKeys - wrapped: true - threshold: - description: Should be =< len(PeerPubKeys) - example: 3 - format: int32 - type: integer - xml: - name: Threshold - timeoutMS: - description: Timeout in milliseconds. - example: 10000 - format: int32 - type: integer - xml: - name: TimeoutMS - type: object - xml: - name: DKSharesPostRequest - DKSharesPostRequest_: + peerIdentities: + - peerIdentities + - peerIdentities + timeoutMS: 1 + threshold: 1 properties: peerIdentities: items: @@ -4486,33 +3387,6 @@ components: type: object xml: name: FoundryOutputResponse - FungibleTokens: - example: - baseTokens: 7 - nativeTokens: - - amount: amount - id: id - - amount: amount - id: id - properties: - baseTokens: - format: int64 - type: integer - xml: - name: BaseTokens - nativeTokens: - items: - $ref: '#/components/schemas/NativeToken' - type: array - xml: - name: NativeTokens - wrapped: true - required: - - baseTokens - - nativeTokens - type: object - xml: - name: FungibleTokens GovChainInfoResponse: example: chainOwnerId: chainOwnerId @@ -4678,33 +3552,6 @@ components: xml: name: InStateOutputMetricItem InfoResponse: - example: - networkId: networkId - version: version - publisherPort: 0 - properties: - networkId: - description: '''hostname:port''; uniquely identifies the node' - format: string - type: string - xml: - name: NetworkID - publisherPort: - description: Nanomsg port that exposes publisher messages - format: int32 - type: integer - xml: - name: PublisherPort - version: - description: Wasp version - format: string - type: string - xml: - name: Version - type: object - xml: - name: InfoResponse - InfoResponse_: example: netID: 0.0.0.0:4000 l1Params: @@ -4792,19 +3639,17 @@ components: name: InterfaceMetricItem Item: example: - value: 0x76616c756531 - key: 0x6b657931 + value: value + key: key properties: key: description: key (hex-encoded) - example: 0x6b657931 format: string type: string xml: name: Key value: description: value (hex-encoded) - example: 0x76616c756531 format: string type: string xml: @@ -4817,17 +3662,19 @@ components: name: Item Item_: example: - value: value - key: key + value: 0x76616c756531 + key: 0x6b657931 properties: key: description: key (hex-encoded) + example: 0x6b657931 format: string type: string xml: name: Key value: description: value (hex-encoded) + example: 0x76616c756531 format: string type: string xml: @@ -4841,10 +3688,10 @@ components: JSONDict: example: Items: - - value: 0x76616c756531 - key: 0x6b657931 - - value: 0x76616c756531 - key: 0x6b657931 + - value: value + key: key + - value: value + key: key properties: Items: items: @@ -4859,10 +3706,10 @@ components: JSONDict_: example: Items: - - value: value - key: key - - value: value - key: key + - value: 0x76616c756531 + key: 0x6b657931 + - value: 0x76616c756531 + key: 0x6b657931 properties: Items: items: @@ -5084,343 +3931,10 @@ components: type: object xml: name: NativeTokenIDRegistryResponse - NodeConnectionMessageMetrics: - example: - total: 3 - lastEvent: 2023-02-03T18:48:34.992472605+01:00 - lastMessage: Last sent PublishStateTransaction message structure - properties: - lastEvent: - description: Last time the message was sent/received - example: 2023-02-03T18:48:34.992472605+01:00 - format: date-time - type: string - xml: - name: LastEvent - lastMessage: - description: The print out of the last message - example: Last sent PublishStateTransaction message structure - format: string - type: string - xml: - name: LastMessage - total: - description: Total number of messages sent/received - example: 3 - format: int32 - type: integer - xml: - name: Total - type: object - xml: - name: NodeConnectionMessageMetrics - NodeConnectionMessageMetrics_: - example: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - properties: - lastEvent: - description: Last time the message was sent/received - example: 2023-02-03T18:48:32.994473647+01:00 - format: date-time - type: string - xml: - name: LastEvent - lastMessage: - description: The print out of the last message - example: Last received OnLedgerRequest message structure - format: string - type: string - xml: - name: LastMessage - total: - description: Total number of messages sent/received - example: 85 - format: int32 - type: integer - xml: - name: Total - type: object - xml: - name: NodeConnectionMessageMetrics - NodeConnectionMessageMetrics__: - example: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473276+01:00 - lastMessage: Last received State output message structure - properties: - lastEvent: - description: Last time the message was sent/received - example: 2023-02-03T18:48:26.994473276+01:00 - format: date-time - type: string - xml: - name: LastEvent - lastMessage: - description: The print out of the last message - example: Last received State output message structure - format: string - type: string - xml: - name: LastMessage - total: - description: Total number of messages sent/received - example: 101 - format: int32 - type: integer - xml: - name: Total - type: object - xml: - name: NodeConnectionMessageMetrics - NodeConnectionMessageMetrics___: - example: - total: 28 - lastEvent: 2023-02-03T18:48:29.994472995+01:00 - lastMessage: Last sent PullTxInclusionState message structure - properties: - lastEvent: - description: Last time the message was sent/received - example: 2023-02-03T18:48:29.994472995+01:00 - format: date-time - type: string - xml: - name: LastEvent - lastMessage: - description: The print out of the last message - example: Last sent PullTxInclusionState message structure - format: string - type: string - xml: - name: LastMessage - total: - description: Total number of messages sent/received - example: 28 - format: int32 - type: integer - xml: - name: Total - type: object - xml: - name: NodeConnectionMessageMetrics - NodeConnectionMessageMetrics____: - example: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473536+01:00 - lastMessage: Last received Output message structure - properties: - lastEvent: - description: Last time the message was sent/received - example: 2023-02-03T18:48:26.994473536+01:00 - format: date-time - type: string - xml: - name: LastEvent - lastMessage: - description: The print out of the last message - example: Last received Output message structure - format: string - type: string - xml: - name: LastMessage - total: - description: Total number of messages sent/received - example: 101 - format: int32 - type: integer - xml: - name: Total - type: object - xml: - name: NodeConnectionMessageMetrics - NodeConnectionMessageMetrics_____: - example: - total: 1234 - lastEvent: 2023-02-03T18:48:35.99447546+01:00 - lastMessage: Last received Milestone message structure - properties: - lastEvent: - description: Last time the message was sent/received - example: 2023-02-03T18:48:35.99447546+01:00 - format: date-time - type: string - xml: - name: LastEvent - lastMessage: - description: The print out of the last message - example: Last received Milestone message structure - format: string - type: string - xml: - name: LastMessage - total: - description: Total number of messages sent/received - example: 1234 - format: int32 - type: integer - xml: - name: Total - type: object - xml: - name: NodeConnectionMessageMetrics - NodeConnectionMessagesMetrics: - example: - outPublishGovernanceTransaction: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - inTxInclusionState: - total: 1234 - lastEvent: 2023-02-03T18:48:35.99447546+01:00 - lastMessage: Last received Milestone message structure - inOnLedgerRequest: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - inOutput: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473536+01:00 - lastMessage: Last received Output message structure - inAliasOutput: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - inStateOutput: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473276+01:00 - lastMessage: Last received State output message structure - outPublishStateTransaction: - total: 3 - lastEvent: 2023-02-03T18:48:34.992472605+01:00 - lastMessage: Last sent PublishStateTransaction message structure - outPullTxInclusionState: - total: 28 - lastEvent: 2023-02-03T18:48:29.994472995+01:00 - lastMessage: Last sent PullTxInclusionState message structure - outPullLatestOutput: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473276+01:00 - lastMessage: Last received State output message structure - outPullOutputByID: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473536+01:00 - lastMessage: Last received Output message structure - properties: - inAliasOutput: - $ref: '#/components/schemas/NodeConnectionMessageMetrics_' - inOnLedgerRequest: - $ref: '#/components/schemas/NodeConnectionMessageMetrics_' - inOutput: - $ref: '#/components/schemas/NodeConnectionMessageMetrics____' - inStateOutput: - $ref: '#/components/schemas/NodeConnectionMessageMetrics__' - inTxInclusionState: - $ref: '#/components/schemas/NodeConnectionMessageMetrics_____' - outPublishGovernanceTransaction: - $ref: '#/components/schemas/NodeConnectionMessageMetrics_' - outPublishStateTransaction: - $ref: '#/components/schemas/NodeConnectionMessageMetrics' - outPullLatestOutput: - $ref: '#/components/schemas/NodeConnectionMessageMetrics__' - outPullOutputByID: - $ref: '#/components/schemas/NodeConnectionMessageMetrics____' - outPullTxInclusionState: - $ref: '#/components/schemas/NodeConnectionMessageMetrics___' - type: object - xml: - name: NodeConnectionMessagesMetrics - NodeConnectionMetrics: - example: - inMilestone: - total: 1234 - lastEvent: 2023-02-03T18:48:35.99447546+01:00 - lastMessage: Last received Milestone message structure - registered: - - tst1pqjuqksecfatlgy4uxd2m73kqmnlv4hr0gqqcggq4wcerwu2cx7uz3p735p - - tst1pqjuqksecfatlgy4uxd2m73kqmnlv4hr0gqqcggq4wcerwu2cx7uz3p735p - nodeConnectionMessagesMetrics: - outPublishGovernanceTransaction: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - inTxInclusionState: - total: 1234 - lastEvent: 2023-02-03T18:48:35.99447546+01:00 - lastMessage: Last received Milestone message structure - inOnLedgerRequest: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - inOutput: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473536+01:00 - lastMessage: Last received Output message structure - inAliasOutput: - total: 85 - lastEvent: 2023-02-03T18:48:32.994473647+01:00 - lastMessage: Last received OnLedgerRequest message structure - inStateOutput: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473276+01:00 - lastMessage: Last received State output message structure - outPublishStateTransaction: - total: 3 - lastEvent: 2023-02-03T18:48:34.992472605+01:00 - lastMessage: Last sent PublishStateTransaction message structure - outPullTxInclusionState: - total: 28 - lastEvent: 2023-02-03T18:48:29.994472995+01:00 - lastMessage: Last sent PullTxInclusionState message structure - outPullLatestOutput: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473276+01:00 - lastMessage: Last received State output message structure - outPullOutputByID: - total: 101 - lastEvent: 2023-02-03T18:48:26.994473536+01:00 - lastMessage: Last received Output message structure - properties: - inMilestone: - $ref: '#/components/schemas/NodeConnectionMessageMetrics_____' - nodeConnectionMessagesMetrics: - $ref: '#/components/schemas/NodeConnectionMessagesMetrics' - registered: - description: Chain IDs of the chains registered to receiving L1 events - items: - example: tst1pqjuqksecfatlgy4uxd2m73kqmnlv4hr0gqqcggq4wcerwu2cx7uz3p735p - format: string - type: string - type: array - xml: - name: Registered - wrapped: true - type: object - xml: - name: NodeConnectionMetrics NodeOwnerCertificateRequest: example: - nodePubKey: AAER - ownerAddress: any_address - properties: - nodePubKey: - description: Node pub key. (base64) - example: AAER - format: string - type: string - xml: - name: NodePubKey - ownerAddress: - description: Node owner address. (bech32) - example: any_address - format: string - type: string - xml: - name: OwnerAddress - type: object - xml: - name: NodeOwnerCertificateRequest - NodeOwnerCertificateRequest_: + ownerAddress: ownerAddress + publicKey: publicKey properties: ownerAddress: description: Node owner address. (Bech32) @@ -5441,20 +3955,6 @@ components: xml: name: NodeOwnerCertificateRequest NodeOwnerCertificateResponse: - example: - certificate: AAEREw== - properties: - certificate: - description: Certificate stating the ownership. (base64) - example: AAEREw== - format: string - type: string - xml: - name: Certificate - type: object - xml: - name: NodeOwnerCertificateResponse - NodeOwnerCertificateResponse_: example: certificate: certificate properties: @@ -5493,20 +3993,6 @@ components: type: object xml: name: OffLedgerRequest - OffLedgerRequestBody: - example: - request: base64 string - properties: - request: - description: Offledger Request (base64) - example: base64 string - format: string - type: string - xml: - name: Request - type: object - xml: - name: OffLedgerRequestBody OnLedgerRequest: example: output: @@ -5647,40 +4133,6 @@ components: type: object xml: name: PeeringNodeIdentityResponse - PeeringNodeStatus: - example: - PubKey: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ - NetID: some-host:9081 - IsAlive: true - NumUsers: 1 - properties: - IsAlive: - example: true - format: boolean - type: boolean - xml: - name: IsAlive - NetID: - example: some-host:9081 - format: string - type: string - xml: - name: NetID - NumUsers: - example: 1 - format: int32 - type: integer - xml: - name: NumUsers - PubKey: - example: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ - format: string - type: string - xml: - name: PubKey - type: object - xml: - name: PeeringNodeStatus PeeringNodeStatusResponse: example: isAlive: true @@ -5803,28 +4255,6 @@ components: type: object xml: name: PeeringTrustRequest - PeeringTrustedNode: - example: - netId: some-host:9081 - pubKey: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ - properties: - netId: - description: NetID of a peer to trust. - example: some-host:9081 - format: string - type: string - xml: - name: NetID - pubKey: - description: Public key of the NetID. - example: 8mcS4hUaiiedX3jRud41Zuu1ZcRUZZ8zY9SuJJgXHuiQ - format: string - type: string - xml: - name: PubKey - type: object - xml: - name: PeeringTrustedNode ProtocolParameters: example: rentStructure: @@ -6090,6 +4520,9 @@ components: RequestDetail: example: fungibleTokens: + nfts: + - nfts + - nfts baseTokens: 7 nativeTokens: - amount: amount @@ -6105,16 +4538,15 @@ components: entryPoint: 3 targetAddress: targetAddress allowance: - fungibleTokens: - baseTokens: 7 - nativeTokens: - - amount: amount - id: id - - amount: amount - id: id nfts: - nfts - nfts + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id params: Items: - value: value @@ -6129,11 +4561,11 @@ components: isEVM: true properties: allowance: - $ref: '#/components/schemas/Allowance' + $ref: '#/components/schemas/Assets' callTarget: $ref: '#/components/schemas/CallTarget' fungibleTokens: - $ref: '#/components/schemas/FungibleTokens' + $ref: '#/components/schemas/Assets' gasGudget: format: int64 type: integer @@ -6152,7 +4584,7 @@ components: nft: $ref: '#/components/schemas/NFTDataResponse' params: - $ref: '#/components/schemas/JSONDict_' + $ref: '#/components/schemas/JSONDict' requestId: format: string type: string @@ -6231,18 +4663,6 @@ components: xml: name: RequestProcessedResponse RequestReceiptResponse: - example: - receipt: receipt - properties: - receipt: - format: string - type: string - xml: - name: Receipt - type: object - xml: - name: RequestReceiptResponse - RequestReceiptResponse_: example: gasBurnLog: records: @@ -6252,6 +4672,9 @@ components: gasBurned: 5 request: fungibleTokens: + nfts: + - nfts + - nfts baseTokens: 7 nativeTokens: - amount: amount @@ -6267,16 +4690,15 @@ components: entryPoint: 3 targetAddress: targetAddress allowance: - fungibleTokens: - baseTokens: 7 - nativeTokens: - - amount: amount - id: id - - amount: amount - id: id nfts: - nfts - nfts + baseTokens: 7 + nativeTokens: + - amount: amount + id: id + - amount: amount + id: id params: Items: - value: value @@ -6605,19 +5027,21 @@ components: type: object xml: name: ValidationError - WaitRequestProcessedParams: + VersionResponse: example: - timeout: 0 + version: version properties: - timeout: - description: Timeout in nanoseconds - format: int64 - type: integer + version: + description: The version of the node + format: string + type: string xml: - name: Timeout + name: Version + required: + - version type: object xml: - name: WaitRequestProcessedParams + name: VersionResponse gasFeePolicy: example: gasFeeTokenId: gasFeeTokenId diff --git a/clients/apiclient/api_auth.go b/clients/apiclient/api_auth.go index ed40a9897b..f590d26ff4 100644 --- a/clients/apiclient/api_auth.go +++ b/clients/apiclient/api_auth.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index 258b0934b1..92c95dc1fc 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index 5fd6d0a237..9c0c1f5c21 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_metrics.go b/clients/apiclient/api_metrics.go index d73a582462..5f1a1435ae 100644 --- a/clients/apiclient/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index 32817e1a3f..457239963d 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -1013,7 +1013,7 @@ type ApiGetVersionRequest struct { ApiService *NodeApiService } -func (r ApiGetVersionRequest) Execute() (string, *http.Response, error) { +func (r ApiGetVersionRequest) Execute() (*VersionResponse, *http.Response, error) { return r.ApiService.GetVersionExecute(r) } @@ -1031,13 +1031,13 @@ func (a *NodeApiService) GetVersion(ctx context.Context) ApiGetVersionRequest { } // Execute executes the request -// @return string -func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (string, *http.Response, error) { +// @return VersionResponse +func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (*VersionResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue string + localVarReturnValue *VersionResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodeApiService.GetVersion") diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index c06ecfb1ba..d8595d8d64 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_users.go b/clients/apiclient/api_users.go index 494a686467..cb5310c624 100644 --- a/clients/apiclient/api_users.go +++ b/clients/apiclient/api_users.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go index 574d7cbee3..6d1b1f7889 100644 --- a/clients/apiclient/client.go +++ b/clients/apiclient/client.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Wasp API API v123 +// APIClient manages communication with the Wasp API API v0.4.0-alpha.8-14-gbb23763d3 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -50,8 +50,6 @@ type APIClient struct { // API Services - AdminApi *AdminApiService - AuthApi *AuthApiService ChainsApi *ChainsApiService @@ -62,8 +60,6 @@ type APIClient struct { NodeApi *NodeApiService - PublicApi *PublicApiService - RequestsApi *RequestsApiService UsersApi *UsersApiService @@ -85,13 +81,11 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.AdminApi = (*AdminApiService)(&c.common) c.AuthApi = (*AuthApiService)(&c.common) c.ChainsApi = (*ChainsApiService)(&c.common) c.CorecontractsApi = (*CorecontractsApiService)(&c.common) c.MetricsApi = (*MetricsApiService)(&c.common) c.NodeApi = (*NodeApiService)(&c.common) - c.PublicApi = (*PublicApiService)(&c.common) c.RequestsApi = (*RequestsApiService)(&c.common) c.UsersApi = (*UsersApiService)(&c.common) diff --git a/clients/apiclient/configuration.go b/clients/apiclient/configuration.go index 6561422c43..e6148c509c 100644 --- a/clients/apiclient/configuration.go +++ b/clients/apiclient/configuration.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md index 73834d05fa..117eea1252 100644 --- a/clients/apiclient/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -510,7 +510,7 @@ Other parameters are passed through a pointer to a apiGetTrustedPeersRequest str ## GetVersion -> string GetVersion(ctx).Execute() +> VersionResponse GetVersion(ctx).Execute() Returns the node version. @@ -535,7 +535,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `NodeApi.GetVersion``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetVersion`: string + // response from `GetVersion`: VersionResponse fmt.Fprintf(os.Stdout, "Response from `NodeApi.GetVersion`: %v\n", resp) } ``` @@ -551,7 +551,7 @@ Other parameters are passed through a pointer to a apiGetVersionRequest struct v ### Return type -**string** +[**VersionResponse**](VersionResponse.md) ### Authorization diff --git a/clients/apiclient/docs/RequestDetail.md b/clients/apiclient/docs/RequestDetail.md index a5e145ae60..dbbe1ca638 100644 --- a/clients/apiclient/docs/RequestDetail.md +++ b/clients/apiclient/docs/RequestDetail.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Allowance** | [**Allowance**](Allowance.md) | | +**Allowance** | [**Assets**](Assets.md) | | **CallTarget** | [**CallTarget**](CallTarget.md) | | -**FungibleTokens** | [**FungibleTokens**](FungibleTokens.md) | | +**FungibleTokens** | [**Assets**](Assets.md) | | **GasGudget** | **int64** | | **IsEVM** | **bool** | | **IsOffLedger** | **bool** | | @@ -20,7 +20,7 @@ Name | Type | Description | Notes ### NewRequestDetail -`func NewRequestDetail(allowance Allowance, callTarget CallTarget, fungibleTokens FungibleTokens, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string, ) *RequestDetail` +`func NewRequestDetail(allowance Assets, callTarget CallTarget, fungibleTokens Assets, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string, ) *RequestDetail` NewRequestDetail instantiates a new RequestDetail object This constructor will assign default values to properties that have it defined, @@ -37,20 +37,20 @@ but it doesn't guarantee that properties required by API are set ### GetAllowance -`func (o *RequestDetail) GetAllowance() Allowance` +`func (o *RequestDetail) GetAllowance() Assets` GetAllowance returns the Allowance field if non-nil, zero value otherwise. ### GetAllowanceOk -`func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool)` +`func (o *RequestDetail) GetAllowanceOk() (*Assets, bool)` GetAllowanceOk returns a tuple with the Allowance field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetAllowance -`func (o *RequestDetail) SetAllowance(v Allowance)` +`func (o *RequestDetail) SetAllowance(v Assets)` SetAllowance sets Allowance field to given value. @@ -77,20 +77,20 @@ SetCallTarget sets CallTarget field to given value. ### GetFungibleTokens -`func (o *RequestDetail) GetFungibleTokens() FungibleTokens` +`func (o *RequestDetail) GetFungibleTokens() Assets` GetFungibleTokens returns the FungibleTokens field if non-nil, zero value otherwise. ### GetFungibleTokensOk -`func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool)` +`func (o *RequestDetail) GetFungibleTokensOk() (*Assets, bool)` GetFungibleTokensOk returns a tuple with the FungibleTokens field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFungibleTokens -`func (o *RequestDetail) SetFungibleTokens(v FungibleTokens)` +`func (o *RequestDetail) SetFungibleTokens(v Assets)` SetFungibleTokens sets FungibleTokens field to given value. diff --git a/clients/apiclient/model_account_list_response.go b/clients/apiclient/model_account_list_response.go index 82e8ac76ac..2184888b1e 100644 --- a/clients/apiclient/model_account_list_response.go +++ b/clients/apiclient/model_account_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nfts_response.go b/clients/apiclient/model_account_nfts_response.go index 7ad3b21b32..5c9abfa58b 100644 --- a/clients/apiclient/model_account_nfts_response.go +++ b/clients/apiclient/model_account_nfts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nonce_response.go b/clients/apiclient/model_account_nonce_response.go index 0980f2c43e..984f9093f9 100644 --- a/clients/apiclient/model_account_nonce_response.go +++ b/clients/apiclient/model_account_nonce_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_add_user_request.go b/clients/apiclient/model_add_user_request.go index 5d7eb41b01..9f931f5305 100644 --- a/clients/apiclient/model_add_user_request.go +++ b/clients/apiclient/model_add_user_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_alias_output_metric_item.go b/clients/apiclient/model_alias_output_metric_item.go index af30c57f1e..a4e9a1905f 100644 --- a/clients/apiclient/model_alias_output_metric_item.go +++ b/clients/apiclient/model_alias_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets_response.go b/clients/apiclient/model_assets_response.go index 154bed4967..7b995b1fc7 100644 --- a/clients/apiclient/model_assets_response.go +++ b/clients/apiclient/model_assets_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_auth_info_model.go b/clients/apiclient/model_auth_info_model.go index 3b5b12ffb5..1271f81760 100644 --- a/clients/apiclient/model_auth_info_model.go +++ b/clients/apiclient/model_auth_info_model.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_base_token.go b/clients/apiclient/model_base_token.go index daed65e86e..bc2797fe50 100644 --- a/clients/apiclient/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index 7bdd224f4a..b6a73d1e6d 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go index 5b0e501127..0b60eb0b56 100644 --- a/clients/apiclient/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_list_response.go b/clients/apiclient/model_blob_list_response.go index 33668d7065..46a6769c82 100644 --- a/clients/apiclient/model_blob_list_response.go +++ b/clients/apiclient/model_blob_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go index ca7ead8600..bd2e2f5f41 100644 --- a/clients/apiclient/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_info_response.go b/clients/apiclient/model_block_info_response.go index 10ba19582c..d6a23b4755 100644 --- a/clients/apiclient/model_block_info_response.go +++ b/clients/apiclient/model_block_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipt_error.go b/clients/apiclient/model_block_receipt_error.go index ff12e4b427..fa806e599b 100644 --- a/clients/apiclient/model_block_receipt_error.go +++ b/clients/apiclient/model_block_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipts_response.go b/clients/apiclient/model_block_receipts_response.go index 5b6e913509..a1ff7fa384 100644 --- a/clients/apiclient/model_block_receipts_response.go +++ b/clients/apiclient/model_block_receipts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_log.go b/clients/apiclient/model_burn_log.go index ce94047f11..430f7e3c36 100644 --- a/clients/apiclient/model_burn_log.go +++ b/clients/apiclient/model_burn_log.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_record.go b/clients/apiclient/model_burn_record.go index dde5ce270e..51cfb53839 100644 --- a/clients/apiclient/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index ad167681d1..096c8e0a6e 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_info_response.go b/clients/apiclient/model_chain_info_response.go index f0380ceee0..20fd097d7c 100644 --- a/clients/apiclient/model_chain_info_response.go +++ b/clients/apiclient/model_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go index 41d84ccbf2..c4cd9d6a70 100644 --- a/clients/apiclient/model_chain_metrics.go +++ b/clients/apiclient/model_chain_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_info_response.go b/clients/apiclient/model_committee_info_response.go index ad6c06bec0..0b8c4b9b78 100644 --- a/clients/apiclient/model_committee_info_response.go +++ b/clients/apiclient/model_committee_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_node.go b/clients/apiclient/model_committee_node.go index 91d10d55b8..29f6684599 100644 --- a/clients/apiclient/model_committee_node.go +++ b/clients/apiclient/model_committee_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go index c94d77ffbe..6c5c3d89b9 100644 --- a/clients/apiclient/model_consensus_pipe_metrics.go +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_workflow_metrics.go b/clients/apiclient/model_consensus_workflow_metrics.go index 182450b4d1..f45b89ea67 100644 --- a/clients/apiclient/model_consensus_workflow_metrics.go +++ b/clients/apiclient/model_consensus_workflow_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_call_view_request.go b/clients/apiclient/model_contract_call_view_request.go index 0bc9cac75f..6d141af20f 100644 --- a/clients/apiclient/model_contract_call_view_request.go +++ b/clients/apiclient/model_contract_call_view_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_info_response.go b/clients/apiclient/model_contract_info_response.go index 071bf0b67f..a290538a43 100644 --- a/clients/apiclient/model_contract_info_response.go +++ b/clients/apiclient/model_contract_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go index cf80b7a453..e8300d14bd 100644 --- a/clients/apiclient/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_info.go b/clients/apiclient/model_dk_shares_info.go index babb4b8a12..cc6b0e5c1c 100644 --- a/clients/apiclient/model_dk_shares_info.go +++ b/clients/apiclient/model_dk_shares_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_post_request.go b/clients/apiclient/model_dk_shares_post_request.go index 6222d699b2..b2918b7f6b 100644 --- a/clients/apiclient/model_dk_shares_post_request.go +++ b/clients/apiclient/model_dk_shares_post_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_error_message_format_response.go b/clients/apiclient/model_error_message_format_response.go index fc06ac69e8..21b1407e6d 100644 --- a/clients/apiclient/model_error_message_format_response.go +++ b/clients/apiclient/model_error_message_format_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_events_response.go b/clients/apiclient/model_events_response.go index 132629ee5f..d741152ddf 100644 --- a/clients/apiclient/model_events_response.go +++ b/clients/apiclient/model_events_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_foundry_output_response.go b/clients/apiclient/model_foundry_output_response.go index ee37a3b06f..cacd326cdf 100644 --- a/clients/apiclient/model_foundry_output_response.go +++ b/clients/apiclient/model_foundry_output_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index 1cdbb4faf7..0802dce9b3 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go index 70d9549081..2c5666b851 100644 --- a/clients/apiclient/model_gov_chain_info_response.go +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output.go b/clients/apiclient/model_in_output.go index f19798608d..7051b25f5e 100644 --- a/clients/apiclient/model_in_output.go +++ b/clients/apiclient/model_in_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output_metric_item.go b/clients/apiclient/model_in_output_metric_item.go index 19c9332ddd..12d91ebb34 100644 --- a/clients/apiclient/model_in_output_metric_item.go +++ b/clients/apiclient/model_in_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output.go b/clients/apiclient/model_in_state_output.go index 2d99086a96..e4a758473d 100644 --- a/clients/apiclient/model_in_state_output.go +++ b/clients/apiclient/model_in_state_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output_metric_item.go b/clients/apiclient/model_in_state_output_metric_item.go index 7c635ba91d..78b44f1348 100644 --- a/clients/apiclient/model_in_state_output_metric_item.go +++ b/clients/apiclient/model_in_state_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_info_response.go b/clients/apiclient/model_info_response.go index b60fd8b2c4..72ee89de6d 100644 --- a/clients/apiclient/model_info_response.go +++ b/clients/apiclient/model_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_interface_metric_item.go b/clients/apiclient/model_interface_metric_item.go index b65c1b3227..c712907b30 100644 --- a/clients/apiclient/model_interface_metric_item.go +++ b/clients/apiclient/model_interface_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_item.go b/clients/apiclient/model_item.go index b5e7917bdf..7d37a72556 100644 --- a/clients/apiclient/model_item.go +++ b/clients/apiclient/model_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_json_dict.go b/clients/apiclient/model_json_dict.go index 2ce01a452f..536a774eaf 100644 --- a/clients/apiclient/model_json_dict.go +++ b/clients/apiclient/model_json_dict.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_l1_params.go b/clients/apiclient/model_l1_params.go index a0aec00bb6..b713932fea 100644 --- a/clients/apiclient/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_request.go b/clients/apiclient/model_login_request.go index 66c90ff4ca..def3136ac1 100644 --- a/clients/apiclient/model_login_request.go +++ b/clients/apiclient/model_login_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_response.go b/clients/apiclient/model_login_response.go index 7177ed26dc..ff9666d8ba 100644 --- a/clients/apiclient/model_login_response.go +++ b/clients/apiclient/model_login_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go index f045906729..4ce243acdd 100644 --- a/clients/apiclient/model_milestone_info.go +++ b/clients/apiclient/model_milestone_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_metric_item.go b/clients/apiclient/model_milestone_metric_item.go index 53c43fb145..2910ccbbcb 100644 --- a/clients/apiclient/model_milestone_metric_item.go +++ b/clients/apiclient/model_milestone_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token.go b/clients/apiclient/model_native_token.go index b6fe976308..31cfec87aa 100644 --- a/clients/apiclient/model_native_token.go +++ b/clients/apiclient/model_native_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token_id_registry_response.go b/clients/apiclient/model_native_token_id_registry_response.go index 623efebbf2..1cd26b0142 100644 --- a/clients/apiclient/model_native_token_id_registry_response.go +++ b/clients/apiclient/model_native_token_id_registry_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_nft_data_response.go b/clients/apiclient/model_nft_data_response.go index 5f3e0089b5..c95f7d7e1f 100644 --- a/clients/apiclient/model_nft_data_response.go +++ b/clients/apiclient/model_nft_data_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_request.go b/clients/apiclient/model_node_owner_certificate_request.go index 3d7628ce63..16d0e8b7c2 100644 --- a/clients/apiclient/model_node_owner_certificate_request.go +++ b/clients/apiclient/model_node_owner_certificate_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_response.go b/clients/apiclient/model_node_owner_certificate_response.go index 0c45a39cda..21a93249fc 100644 --- a/clients/apiclient/model_node_owner_certificate_response.go +++ b/clients/apiclient/model_node_owner_certificate_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_off_ledger_request.go b/clients/apiclient/model_off_ledger_request.go index 943d056735..c87cfcf1cd 100644 --- a/clients/apiclient/model_off_ledger_request.go +++ b/clients/apiclient/model_off_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request.go b/clients/apiclient/model_on_ledger_request.go index fa7bcda73d..52f589e51f 100644 --- a/clients/apiclient/model_on_ledger_request.go +++ b/clients/apiclient/model_on_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request_metric_item.go b/clients/apiclient/model_on_ledger_request_metric_item.go index 8809a78b0a..21c0661399 100644 --- a/clients/apiclient/model_on_ledger_request_metric_item.go +++ b/clients/apiclient/model_on_ledger_request_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output.go b/clients/apiclient/model_output.go index 1264715de6..21f3c42153 100644 --- a/clients/apiclient/model_output.go +++ b/clients/apiclient/model_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output_id.go b/clients/apiclient/model_output_id.go index 3f3862db23..b0f47edff7 100644 --- a/clients/apiclient/model_output_id.go +++ b/clients/apiclient/model_output_id.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_identity_response.go b/clients/apiclient/model_peering_node_identity_response.go index 36a5e52169..b961cd5fa7 100644 --- a/clients/apiclient/model_peering_node_identity_response.go +++ b/clients/apiclient/model_peering_node_identity_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go index af2e9362ff..26278c1cf3 100644 --- a/clients/apiclient/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_trust_request.go b/clients/apiclient/model_peering_trust_request.go index 78fbc333c9..2e5ca3c981 100644 --- a/clients/apiclient/model_peering_trust_request.go +++ b/clients/apiclient/model_peering_trust_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go index 65f343761c..39afdb3006 100644 --- a/clients/apiclient/model_protocol_parameters.go +++ b/clients/apiclient/model_protocol_parameters.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_publisher_state_transaction_item.go b/clients/apiclient/model_publisher_state_transaction_item.go index 10b7751d9c..fe6d0487af 100644 --- a/clients/apiclient/model_publisher_state_transaction_item.go +++ b/clients/apiclient/model_publisher_state_transaction_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index 035e7171de..28f367ce9c 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_response.go b/clients/apiclient/model_receipt_response.go index a352ac564b..095566d5b5 100644 --- a/clients/apiclient/model_receipt_response.go +++ b/clients/apiclient/model_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_rent_structure.go b/clients/apiclient/model_rent_structure.go index 600e607fde..2795138473 100644 --- a/clients/apiclient/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_detail.go b/clients/apiclient/model_request_detail.go index e880836ff7..672b455866 100644 --- a/clients/apiclient/model_request_detail.go +++ b/clients/apiclient/model_request_detail.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,9 @@ var _ MappedNullable = &RequestDetail{} // RequestDetail struct for RequestDetail type RequestDetail struct { - Allowance Allowance `json:"allowance"` + Allowance Assets `json:"allowance"` CallTarget CallTarget `json:"callTarget"` - FungibleTokens FungibleTokens `json:"fungibleTokens"` + FungibleTokens Assets `json:"fungibleTokens"` GasGudget int64 `json:"gasGudget"` IsEVM bool `json:"isEVM"` IsOffLedger bool `json:"isOffLedger"` @@ -36,7 +36,7 @@ type RequestDetail struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRequestDetail(allowance Allowance, callTarget CallTarget, fungibleTokens FungibleTokens, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string) *RequestDetail { +func NewRequestDetail(allowance Assets, callTarget CallTarget, fungibleTokens Assets, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string) *RequestDetail { this := RequestDetail{} this.Allowance = allowance this.CallTarget = callTarget @@ -61,9 +61,9 @@ func NewRequestDetailWithDefaults() *RequestDetail { } // GetAllowance returns the Allowance field value -func (o *RequestDetail) GetAllowance() Allowance { +func (o *RequestDetail) GetAllowance() Assets { if o == nil { - var ret Allowance + var ret Assets return ret } @@ -72,7 +72,7 @@ func (o *RequestDetail) GetAllowance() Allowance { // GetAllowanceOk returns a tuple with the Allowance field value // and a boolean to check if the value has been set. -func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool) { +func (o *RequestDetail) GetAllowanceOk() (*Assets, bool) { if o == nil { return nil, false } @@ -80,7 +80,7 @@ func (o *RequestDetail) GetAllowanceOk() (*Allowance, bool) { } // SetAllowance sets field value -func (o *RequestDetail) SetAllowance(v Allowance) { +func (o *RequestDetail) SetAllowance(v Assets) { o.Allowance = v } @@ -109,9 +109,9 @@ func (o *RequestDetail) SetCallTarget(v CallTarget) { } // GetFungibleTokens returns the FungibleTokens field value -func (o *RequestDetail) GetFungibleTokens() FungibleTokens { +func (o *RequestDetail) GetFungibleTokens() Assets { if o == nil { - var ret FungibleTokens + var ret Assets return ret } @@ -120,7 +120,7 @@ func (o *RequestDetail) GetFungibleTokens() FungibleTokens { // GetFungibleTokensOk returns a tuple with the FungibleTokens field value // and a boolean to check if the value has been set. -func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool) { +func (o *RequestDetail) GetFungibleTokensOk() (*Assets, bool) { if o == nil { return nil, false } @@ -128,7 +128,7 @@ func (o *RequestDetail) GetFungibleTokensOk() (*FungibleTokens, bool) { } // SetFungibleTokens sets field value -func (o *RequestDetail) SetFungibleTokens(v FungibleTokens) { +func (o *RequestDetail) SetFungibleTokens(v Assets) { o.FungibleTokens = v } diff --git a/clients/apiclient/model_request_ids_response.go b/clients/apiclient/model_request_ids_response.go index 22769ab765..be75617f09 100644 --- a/clients/apiclient/model_request_ids_response.go +++ b/clients/apiclient/model_request_ids_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_processed_response.go b/clients/apiclient/model_request_processed_response.go index 074c618145..05ecd07fd9 100644 --- a/clients/apiclient/model_request_processed_response.go +++ b/clients/apiclient/model_request_processed_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_receipt_response.go b/clients/apiclient/model_request_receipt_response.go index 807d890a67..06d03b5456 100644 --- a/clients/apiclient/model_request_receipt_response.go +++ b/clients/apiclient/model_request_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_response.go b/clients/apiclient/model_state_response.go index b1dabb7c5b..8314eb744e 100644 --- a/clients/apiclient/model_state_response.go +++ b/clients/apiclient/model_state_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_transaction.go b/clients/apiclient/model_state_transaction.go index 3cec4a3e48..dd64ea5904 100644 --- a/clients/apiclient/model_state_transaction.go +++ b/clients/apiclient/model_state_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction.go b/clients/apiclient/model_transaction.go index 4d6a619b74..d8cf887878 100644 --- a/clients/apiclient/model_transaction.go +++ b/clients/apiclient/model_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_id_metric_item.go b/clients/apiclient/model_transaction_id_metric_item.go index 0cb288c0ab..0c7dfbf466 100644 --- a/clients/apiclient/model_transaction_id_metric_item.go +++ b/clients/apiclient/model_transaction_id_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_metric_item.go b/clients/apiclient/model_transaction_metric_item.go index e3d7cb076d..312910c097 100644 --- a/clients/apiclient/model_transaction_metric_item.go +++ b/clients/apiclient/model_transaction_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg.go b/clients/apiclient/model_tx_inclusion_state_msg.go index ac02171db1..27170d071e 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg.go +++ b/clients/apiclient/model_tx_inclusion_state_msg.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go index 502ed18de0..644b228f5f 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go +++ b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_password_request.go b/clients/apiclient/model_update_user_password_request.go index 6bc430e522..697c84f025 100644 --- a/clients/apiclient/model_update_user_password_request.go +++ b/clients/apiclient/model_update_user_password_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_permissions_request.go b/clients/apiclient/model_update_user_permissions_request.go index e3f92ebb2e..fdf5b156f2 100644 --- a/clients/apiclient/model_update_user_permissions_request.go +++ b/clients/apiclient/model_update_user_permissions_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_user.go b/clients/apiclient/model_user.go index 5fdf8acf34..a77ea38d91 100644 --- a/clients/apiclient/model_user.go +++ b/clients/apiclient/model_user.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_utxo_input_metric_item.go b/clients/apiclient/model_utxo_input_metric_item.go index 3a0de0d238..975e85998f 100644 --- a/clients/apiclient/model_utxo_input_metric_item.go +++ b/clients/apiclient/model_utxo_input_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_validation_error.go b/clients/apiclient/model_validation_error.go index a7976ba812..9589685f96 100644 --- a/clients/apiclient/model_validation_error.go +++ b/clients/apiclient/model_validation_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/response.go b/clients/apiclient/response.go index 668b069dc4..73b08361ef 100644 --- a/clients/apiclient/response.go +++ b/clients/apiclient/response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/utils.go b/clients/apiclient/utils.go index 3276acf5c9..ef5977ec66 100644 --- a/clients/apiclient/utils.go +++ b/clients/apiclient/utils.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-14-gbb23763d3 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiutils.go b/clients/apiutils.go index d5c9a07338..e791b2168e 100644 --- a/clients/apiutils.go +++ b/clients/apiutils.go @@ -2,6 +2,7 @@ package clients import ( "context" + "net/url" "time" iotago "github.com/iotaledger/iota.go/v3" @@ -62,3 +63,17 @@ func APIWaitUntilAllRequestsProcessed(client *apiclient.APIClient, chainID isc.C } return ret, nil } + +func WaspAPIClientByHostName(hostname string) (*apiclient.APIClient, error) { + parsed, err := url.Parse(hostname) + + if err != nil { + return nil, err + } + + config := apiclient.NewConfiguration() + config.Host = parsed.Host + config.Scheme = parsed.Scheme + + return apiclient.NewAPIClient(config), nil +} diff --git a/packages/webapi/controllers/node/controller.go b/packages/webapi/controllers/node/controller.go index 445bd56a56..9a88609572 100644 --- a/packages/webapi/controllers/node/controller.go +++ b/packages/webapi/controllers/node/controller.go @@ -37,7 +37,7 @@ func (c *Controller) Name() string { func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker interfaces.Mocker) { publicAPI.GET("node/version", c.getPublicInfo). - AddResponse(http.StatusOK, "Returns the version of the node.", "", nil). + AddResponse(http.StatusOK, "Returns the version of the node.", mocker.Get(models.VersionResponse{}), nil). SetOperationId("getVersion"). SetSummary("Returns the node version.") } diff --git a/packages/webapi/controllers/node/info.go b/packages/webapi/controllers/node/info.go index e92bab380d..47468fafe3 100644 --- a/packages/webapi/controllers/node/info.go +++ b/packages/webapi/controllers/node/info.go @@ -23,7 +23,7 @@ func (c *Controller) getConfiguration(e echo.Context) error { } func (c *Controller) getPublicInfo(e echo.Context) error { - return e.JSON(http.StatusOK, c.waspVersion) + return e.JSON(http.StatusOK, models.VersionResponse{Version: c.waspVersion}) } func (c *Controller) getInfo(e echo.Context) error { diff --git a/packages/webapi/models/node.go b/packages/webapi/models/node.go index c77a3e0f88..b92a07efb3 100644 --- a/packages/webapi/models/node.go +++ b/packages/webapi/models/node.go @@ -76,6 +76,10 @@ func MapL1Params(l1 *parameters.L1Params) *L1Params { return params } +type VersionResponse struct { + Version string `json:"version" swagger:"desc(The version of the node),required"` +} + type InfoResponse struct { Version string `json:"version" swagger:"desc(The version of the node),required"` PublicKey string `json:"publicKey" swagger:"desc(The public key of the node (Hex)),required"` diff --git a/tools/cluster/cluster.go b/tools/cluster/cluster.go index a23acceaf5..015c384bdc 100644 --- a/tools/cluster/cluster.go +++ b/tools/cluster/cluster.go @@ -24,6 +24,7 @@ import ( "github.com/iotaledger/hive.go/core/logger" iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/multiclient" @@ -375,9 +376,13 @@ func (clu *Cluster) MultiClient() *multiclient.MultiClient { } func (clu *Cluster) WaspClientFromHostName(hostName string) *apiclient.APIClient { - config := apiclient.NewConfiguration() - config.Host = hostName - return apiclient.NewAPIClient(config) + client, err := clients.WaspAPIClientByHostName(hostName) + + if err != nil { + panic(err.Error()) + } + + return client } func (clu *Cluster) WaspClient(nodeIndex ...int) *apiclient.APIClient { diff --git a/tools/wasp-cli/cli/cliclients/clients.go b/tools/wasp-cli/cli/cliclients/clients.go index cabb359e49..0eeff53ed9 100644 --- a/tools/wasp-cli/cli/cliclients/clients.go +++ b/tools/wasp-cli/cli/cliclients/clients.go @@ -1,6 +1,7 @@ package cliclients import ( + "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/scclient" @@ -15,11 +16,10 @@ func WaspClientForHostName(apiAddress string) *apiclient.APIClient { L1Client() // this will fill parameters.L1() with data from the L1 node log.Verbosef("using Wasp host %s\n", apiAddress) - apiConfig := apiclient.NewConfiguration() - apiConfig.Host = apiAddress - apiConfig.AddDefaultHeader("Authorization", config.GetToken()) + client, err := clients.WaspAPIClientByHostName(apiAddress) + log.Check(err) - client := apiclient.NewAPIClient(apiConfig) + client.GetConfig().AddDefaultHeader("Authorization", "Bearer "+config.GetToken()) return client } diff --git a/tools/wasp-cli/cli/init/checkversions.go b/tools/wasp-cli/cli/init/checkversions.go index 07ba33a4d9..9bb3a6253f 100644 --- a/tools/wasp-cli/cli/init/checkversions.go +++ b/tools/wasp-cli/cli/init/checkversions.go @@ -23,10 +23,10 @@ func initCheckVersionsCmd(waspVersion string) *cobra.Command { Execute() log.Check(err) - if waspVersion == version { + if waspVersion == version.Version { log.Printf("Wasp-cli version matches Wasp #%d\n", i) } else { - log.Printf("! -> Version mismatch with Wasp #%d. cli version: %s, wasp version: %s\n", i, waspVersion, version) + log.Printf("! -> Version mismatch with Wasp #%d. cli version: %s, wasp version: %s\n", i, waspVersion, version.Version) } } }, From 418c909a6c1114bac544a948610140dc2ec34062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 19:32:40 +0100 Subject: [PATCH 08/39] Update apiclient --- clients/apiclient/docs/Assets.md | 93 +++++++++++ clients/apiclient/docs/VersionResponse.md | 51 ++++++ clients/apiclient/model_assets.go | 171 ++++++++++++++++++++ clients/apiclient/model_version_response.go | 118 ++++++++++++++ 4 files changed, 433 insertions(+) create mode 100644 clients/apiclient/docs/Assets.md create mode 100644 clients/apiclient/docs/VersionResponse.md create mode 100644 clients/apiclient/model_assets.go create mode 100644 clients/apiclient/model_version_response.go diff --git a/clients/apiclient/docs/Assets.md b/clients/apiclient/docs/Assets.md new file mode 100644 index 0000000000..cd4e595eeb --- /dev/null +++ b/clients/apiclient/docs/Assets.md @@ -0,0 +1,93 @@ +# Assets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BaseTokens** | **int64** | | +**NativeTokens** | [**[]NativeToken**](NativeToken.md) | | +**Nfts** | **[]string** | | + +## Methods + +### NewAssets + +`func NewAssets(baseTokens int64, nativeTokens []NativeToken, nfts []string, ) *Assets` + +NewAssets instantiates a new Assets object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAssetsWithDefaults + +`func NewAssetsWithDefaults() *Assets` + +NewAssetsWithDefaults instantiates a new Assets object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBaseTokens + +`func (o *Assets) GetBaseTokens() int64` + +GetBaseTokens returns the BaseTokens field if non-nil, zero value otherwise. + +### GetBaseTokensOk + +`func (o *Assets) GetBaseTokensOk() (*int64, bool)` + +GetBaseTokensOk returns a tuple with the BaseTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaseTokens + +`func (o *Assets) SetBaseTokens(v int64)` + +SetBaseTokens sets BaseTokens field to given value. + + +### GetNativeTokens + +`func (o *Assets) GetNativeTokens() []NativeToken` + +GetNativeTokens returns the NativeTokens field if non-nil, zero value otherwise. + +### GetNativeTokensOk + +`func (o *Assets) GetNativeTokensOk() (*[]NativeToken, bool)` + +GetNativeTokensOk returns a tuple with the NativeTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNativeTokens + +`func (o *Assets) SetNativeTokens(v []NativeToken)` + +SetNativeTokens sets NativeTokens field to given value. + + +### GetNfts + +`func (o *Assets) GetNfts() []string` + +GetNfts returns the Nfts field if non-nil, zero value otherwise. + +### GetNftsOk + +`func (o *Assets) GetNftsOk() (*[]string, bool)` + +GetNftsOk returns a tuple with the Nfts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNfts + +`func (o *Assets) SetNfts(v []string)` + +SetNfts sets Nfts field to given value. + + + +[[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/clients/apiclient/docs/VersionResponse.md b/clients/apiclient/docs/VersionResponse.md new file mode 100644 index 0000000000..9f7f6e5172 --- /dev/null +++ b/clients/apiclient/docs/VersionResponse.md @@ -0,0 +1,51 @@ +# VersionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Version** | **string** | The version of the node | + +## Methods + +### NewVersionResponse + +`func NewVersionResponse(version string, ) *VersionResponse` + +NewVersionResponse instantiates a new VersionResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVersionResponseWithDefaults + +`func NewVersionResponseWithDefaults() *VersionResponse` + +NewVersionResponseWithDefaults instantiates a new VersionResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVersion + +`func (o *VersionResponse) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *VersionResponse) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *VersionResponse) SetVersion(v string)` + +SetVersion sets Version field to given value. + + + +[[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/clients/apiclient/model_assets.go b/clients/apiclient/model_assets.go new file mode 100644 index 0000000000..6ac83abf99 --- /dev/null +++ b/clients/apiclient/model_assets.go @@ -0,0 +1,171 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.8-14-gbb23763d3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the Assets type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Assets{} + +// Assets struct for Assets +type Assets struct { + BaseTokens int64 `json:"baseTokens"` + NativeTokens []NativeToken `json:"nativeTokens"` + Nfts []string `json:"nfts"` +} + +// NewAssets instantiates a new Assets object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAssets(baseTokens int64, nativeTokens []NativeToken, nfts []string) *Assets { + this := Assets{} + this.BaseTokens = baseTokens + this.NativeTokens = nativeTokens + this.Nfts = nfts + return &this +} + +// NewAssetsWithDefaults instantiates a new Assets object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAssetsWithDefaults() *Assets { + this := Assets{} + return &this +} + +// GetBaseTokens returns the BaseTokens field value +func (o *Assets) GetBaseTokens() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.BaseTokens +} + +// GetBaseTokensOk returns a tuple with the BaseTokens field value +// and a boolean to check if the value has been set. +func (o *Assets) GetBaseTokensOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.BaseTokens, true +} + +// SetBaseTokens sets field value +func (o *Assets) SetBaseTokens(v int64) { + o.BaseTokens = v +} + +// GetNativeTokens returns the NativeTokens field value +func (o *Assets) GetNativeTokens() []NativeToken { + if o == nil { + var ret []NativeToken + return ret + } + + return o.NativeTokens +} + +// GetNativeTokensOk returns a tuple with the NativeTokens field value +// and a boolean to check if the value has been set. +func (o *Assets) GetNativeTokensOk() ([]NativeToken, bool) { + if o == nil { + return nil, false + } + return o.NativeTokens, true +} + +// SetNativeTokens sets field value +func (o *Assets) SetNativeTokens(v []NativeToken) { + o.NativeTokens = v +} + +// GetNfts returns the Nfts field value +func (o *Assets) GetNfts() []string { + if o == nil { + var ret []string + return ret + } + + return o.Nfts +} + +// GetNftsOk returns a tuple with the Nfts field value +// and a boolean to check if the value has been set. +func (o *Assets) GetNftsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Nfts, true +} + +// SetNfts sets field value +func (o *Assets) SetNfts(v []string) { + o.Nfts = v +} + +func (o Assets) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Assets) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["baseTokens"] = o.BaseTokens + toSerialize["nativeTokens"] = o.NativeTokens + toSerialize["nfts"] = o.Nfts + return toSerialize, nil +} + +type NullableAssets struct { + value *Assets + isSet bool +} + +func (v NullableAssets) Get() *Assets { + return v.value +} + +func (v *NullableAssets) Set(val *Assets) { + v.value = val + v.isSet = true +} + +func (v NullableAssets) IsSet() bool { + return v.isSet +} + +func (v *NullableAssets) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAssets(val *Assets) *NullableAssets { + return &NullableAssets{value: val, isSet: true} +} + +func (v NullableAssets) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAssets) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_version_response.go b/clients/apiclient/model_version_response.go new file mode 100644 index 0000000000..024320bd6d --- /dev/null +++ b/clients/apiclient/model_version_response.go @@ -0,0 +1,118 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0.4.0-alpha.8-14-gbb23763d3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the VersionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VersionResponse{} + +// VersionResponse struct for VersionResponse +type VersionResponse struct { + // The version of the node + Version string `json:"version"` +} + +// NewVersionResponse instantiates a new VersionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersionResponse(version string) *VersionResponse { + this := VersionResponse{} + this.Version = version + return &this +} + +// NewVersionResponseWithDefaults instantiates a new VersionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionResponseWithDefaults() *VersionResponse { + this := VersionResponse{} + return &this +} + +// GetVersion returns the Version field value +func (o *VersionResponse) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *VersionResponse) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *VersionResponse) SetVersion(v string) { + o.Version = v +} + +func (o VersionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VersionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableVersionResponse struct { + value *VersionResponse + isSet bool +} + +func (v NullableVersionResponse) Get() *VersionResponse { + return v.value +} + +func (v *NullableVersionResponse) Set(val *VersionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVersionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVersionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersionResponse(val *VersionResponse) *NullableVersionResponse { + return &NullableVersionResponse{value: val, isSet: true} +} + +func (v NullableVersionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + From 4a4f9041410223b95afa55fd2188541eeceb1ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 19:55:15 +0100 Subject: [PATCH 09/39] Fix chain record, chain deploy --- clients/apiclient/.openapi-generator/FILES | 2 + clients/apiclient/api/openapi.yaml | 245 +++++++++++++----- clients/apiclient/api_auth.go | 2 +- clients/apiclient/api_chains.go | 150 ++++++++++- clients/apiclient/api_corecontracts.go | 54 ++-- clients/apiclient/api_metrics.go | 10 +- clients/apiclient/api_node.go | 26 +- clients/apiclient/api_requests.go | 10 +- clients/apiclient/api_users.go | 14 +- clients/apiclient/client.go | 4 +- clients/apiclient/configuration.go | 2 +- clients/apiclient/docs/ChainRecord.md | 60 +---- clients/apiclient/docs/ChainsApi.md | 91 ++++++- clients/apiclient/docs/CorecontractsApi.md | 52 ++-- clients/apiclient/docs/MetricsApi.md | 8 +- clients/apiclient/docs/NodeApi.md | 24 +- clients/apiclient/docs/RequestsApi.md | 8 +- clients/apiclient/docs/UsersApi.md | 12 +- .../apiclient/model_account_list_response.go | 2 +- .../apiclient/model_account_nfts_response.go | 2 +- .../apiclient/model_account_nonce_response.go | 2 +- clients/apiclient/model_add_user_request.go | 2 +- .../model_alias_output_metric_item.go | 2 +- clients/apiclient/model_assets.go | 2 +- clients/apiclient/model_assets_response.go | 2 +- clients/apiclient/model_auth_info_model.go | 2 +- clients/apiclient/model_base_token.go | 2 +- clients/apiclient/model_blob.go | 2 +- clients/apiclient/model_blob_info_response.go | 2 +- clients/apiclient/model_blob_list_response.go | 2 +- .../apiclient/model_blob_value_response.go | 2 +- .../apiclient/model_block_info_response.go | 2 +- .../apiclient/model_block_receipt_error.go | 2 +- .../model_block_receipts_response.go | 2 +- clients/apiclient/model_burn_log.go | 2 +- clients/apiclient/model_burn_record.go | 2 +- clients/apiclient/model_call_target.go | 2 +- .../apiclient/model_chain_info_response.go | 2 +- clients/apiclient/model_chain_metrics.go | 2 +- clients/apiclient/model_chain_record.go | 106 ++------ .../model_committee_info_response.go | 2 +- clients/apiclient/model_committee_node.go | 2 +- .../apiclient/model_consensus_pipe_metrics.go | 2 +- .../model_consensus_workflow_metrics.go | 2 +- .../model_contract_call_view_request.go | 2 +- .../apiclient/model_contract_info_response.go | 2 +- .../model_control_addresses_response.go | 2 +- clients/apiclient/model_dk_shares_info.go | 2 +- .../apiclient/model_dk_shares_post_request.go | 2 +- .../model_error_message_format_response.go | 2 +- clients/apiclient/model_events_response.go | 2 +- .../model_foundry_output_response.go | 2 +- clients/apiclient/model_gas_fee_policy.go | 2 +- .../model_gov_chain_info_response.go | 2 +- clients/apiclient/model_in_output.go | 2 +- .../apiclient/model_in_output_metric_item.go | 2 +- clients/apiclient/model_in_state_output.go | 2 +- .../model_in_state_output_metric_item.go | 2 +- clients/apiclient/model_info_response.go | 2 +- .../apiclient/model_interface_metric_item.go | 2 +- clients/apiclient/model_item.go | 2 +- clients/apiclient/model_json_dict.go | 2 +- clients/apiclient/model_l1_params.go | 2 +- clients/apiclient/model_login_request.go | 2 +- clients/apiclient/model_login_response.go | 2 +- clients/apiclient/model_milestone_info.go | 2 +- .../apiclient/model_milestone_metric_item.go | 2 +- clients/apiclient/model_native_token.go | 2 +- ...model_native_token_id_registry_response.go | 2 +- clients/apiclient/model_nft_data_response.go | 2 +- .../model_node_owner_certificate_request.go | 2 +- .../model_node_owner_certificate_response.go | 2 +- clients/apiclient/model_off_ledger_request.go | 2 +- clients/apiclient/model_on_ledger_request.go | 2 +- .../model_on_ledger_request_metric_item.go | 2 +- clients/apiclient/model_output.go | 2 +- clients/apiclient/model_output_id.go | 2 +- .../model_peering_node_identity_response.go | 2 +- .../model_peering_node_status_response.go | 2 +- .../apiclient/model_peering_trust_request.go | 2 +- .../apiclient/model_protocol_parameters.go | 2 +- .../model_publisher_state_transaction_item.go | 2 +- clients/apiclient/model_receipt_error.go | 2 +- clients/apiclient/model_receipt_response.go | 2 +- clients/apiclient/model_rent_structure.go | 2 +- clients/apiclient/model_request_detail.go | 2 +- .../apiclient/model_request_ids_response.go | 2 +- .../model_request_processed_response.go | 2 +- .../model_request_receipt_response.go | 2 +- clients/apiclient/model_state_response.go | 2 +- clients/apiclient/model_state_transaction.go | 2 +- clients/apiclient/model_transaction.go | 2 +- .../model_transaction_id_metric_item.go | 2 +- .../model_transaction_metric_item.go | 2 +- .../apiclient/model_tx_inclusion_state_msg.go | 2 +- ...odel_tx_inclusion_state_msg_metric_item.go | 2 +- .../model_update_user_password_request.go | 2 +- .../model_update_user_permissions_request.go | 2 +- clients/apiclient/model_user.go | 2 +- .../apiclient/model_utxo_input_metric_item.go | 2 +- clients/apiclient/model_validation_error.go | 2 +- clients/apiclient/model_version_response.go | 2 +- clients/apiclient/response.go | 2 +- clients/apiclient/utils.go | 2 +- clients/multiclient/chain_record.go | 20 +- packages/webapi/api.go | 7 +- .../webapi/controllers/chain/controller.go | 8 + .../webapi/controllers/chain/management.go | 33 +++ packages/webapi/interfaces/interfaces.go | 1 + packages/webapi/models/chain.go | 5 + packages/webapi/services/chain.go | 43 +++ 111 files changed, 733 insertions(+), 434 deletions(-) diff --git a/clients/apiclient/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES index 91d22e9312..705f4dc776 100644 --- a/clients/apiclient/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -32,6 +32,7 @@ docs/BurnRecord.md docs/CallTarget.md docs/ChainInfoResponse.md docs/ChainMetrics.md +docs/ChainRecord.md docs/ChainsApi.md docs/CommitteeInfoResponse.md docs/CommitteeNode.md @@ -123,6 +124,7 @@ model_burn_record.go model_call_target.go model_chain_info_response.go model_chain_metrics.go +model_chain_record.go model_committee_info_response.go model_committee_node.go model_consensus_pipe_metrics.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 4294e5346a..7024a80583 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.1 info: description: REST API for the Wasp node title: Wasp API - version: 0.4.0-alpha.8-14-gbb23763d3 + version: 0.4.0-alpha.8-16-g83edf92b9 externalDocs: description: Find out more about Wasp url: https://wiki.iota.org/smart-contracts/overview @@ -61,7 +61,7 @@ paths: summary: Get information about the current authentication mode tags: - auth - /v2chains: + /chains: get: operationId: getChains responses: @@ -84,7 +84,7 @@ paths: summary: Get a list of all chains tags: - chains - /v2chains/{chainID}: + /chains/{chainID}: get: operationId: getChainInfo parameters: @@ -113,7 +113,7 @@ paths: summary: Get information about a specific chain tags: - chains - /v2chains/{chainID}/access-node/{publicKey}: + /chains/{chainID}/access-node/{publicKey}: delete: operationId: removeAccessNode parameters: @@ -178,7 +178,7 @@ paths: summary: Configure a trusted node to be an access node. tags: - chains - /v2chains/{chainID}/activate: + /chains/{chainID}/activate: post: operationId: activateChain parameters: @@ -207,7 +207,41 @@ paths: summary: Activate a chain tags: - chains - /v2chains/{chainID}/committee: + /chains/{chainID}/chainrecord: + post: + operationId: setChainRecord + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChainRecord' + description: Chain Record + required: true + responses: + "201": + content: {} + description: Chain record was saved + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Sets the chain record. + tags: + - chains + x-codegen-request-body-name: ChainRecord + /chains/{chainID}/committee: get: operationId: getCommitteeInfo parameters: @@ -236,7 +270,7 @@ paths: summary: Get information about the deployed committee tags: - chains - /v2chains/{chainID}/contracts: + /chains/{chainID}/contracts: get: operationId: getContracts parameters: @@ -267,7 +301,7 @@ paths: summary: Get all available chain contracts tags: - chains - /v2chains/{chainID}/core/accounts: + /chains/{chainID}/core/accounts: get: operationId: accountsGetAccounts parameters: @@ -294,7 +328,7 @@ paths: summary: Get a list of all accounts tags: - corecontracts - /v2chains/{chainID}/core/accounts/account/{agentID}/balance: + /chains/{chainID}/core/accounts/account/{agentID}/balance: get: operationId: accountsGetAccountBalance parameters: @@ -328,7 +362,7 @@ paths: summary: Get all assets belonging to an account tags: - corecontracts - /v2chains/{chainID}/core/accounts/account/{agentID}/nfts: + /chains/{chainID}/core/accounts/account/{agentID}/nfts: get: operationId: accountsGetAccountNFTIDs parameters: @@ -362,7 +396,7 @@ paths: summary: Get all NFT ids belonging to an account tags: - corecontracts - /v2chains/{chainID}/core/accounts/account/{agentID}/nonce: + /chains/{chainID}/core/accounts/account/{agentID}/nonce: get: operationId: accountsGetAccountNonce parameters: @@ -397,7 +431,7 @@ paths: summary: Get the current nonce of an account tags: - corecontracts - /v2chains/{chainID}/core/accounts/foundry_output: + /chains/{chainID}/core/accounts/foundry_output: get: operationId: accountsGetFoundryOutput parameters: @@ -431,7 +465,7 @@ paths: summary: Get the foundry output tags: - corecontracts - /v2chains/{chainID}/core/accounts/nftdata: + /chains/{chainID}/core/accounts/nftdata: get: operationId: accountsGetNFTData parameters: @@ -465,7 +499,7 @@ paths: summary: Get the NFT data by an ID tags: - corecontracts - /v2chains/{chainID}/core/accounts/token_registry: + /chains/{chainID}/core/accounts/token_registry: get: operationId: accountsGetNativeTokenIDRegistry parameters: @@ -492,7 +526,7 @@ paths: summary: Get a list of all registries tags: - corecontracts - /v2chains/{chainID}/core/accounts/total_assets: + /chains/{chainID}/core/accounts/total_assets: get: operationId: accountsGetTotalAssets parameters: @@ -519,7 +553,7 @@ paths: summary: Get all stored assets tags: - corecontracts - /v2chains/{chainID}/core/blobs: + /chains/{chainID}/core/blobs: get: operationId: blobsGetAllBlobs parameters: @@ -546,7 +580,7 @@ paths: summary: Get all stored blobs tags: - corecontracts - /v2chains/{chainID}/core/blobs/{blobHash}: + /chains/{chainID}/core/blobs/{blobHash}: get: operationId: blobsGetBlobInfo parameters: @@ -580,7 +614,7 @@ paths: summary: Get all fields of a blob tags: - corecontracts - /v2chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: + /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: get: operationId: blobsGetBlobValue parameters: @@ -621,7 +655,7 @@ paths: summary: Get the value of the supplied field (key) tags: - corecontracts - /v2chains/{chainID}/core/blocklog/blocks/latest: + /chains/{chainID}/core/blocklog/blocks/latest: get: operationId: blocklogGetLatestBlockInfo parameters: @@ -648,7 +682,7 @@ paths: summary: Get the block info of the latest block tags: - corecontracts - /v2chains/{chainID}/core/blocklog/blocks/latest/receipts: + /chains/{chainID}/core/blocklog/blocks/latest/receipts: get: operationId: blocklogGetRequestReceiptsOfLatestBlock parameters: @@ -675,7 +709,7 @@ paths: summary: Get all receipts of the latest block tags: - corecontracts - /v2chains/{chainID}/core/blocklog/blocks/latest/requestids: + /chains/{chainID}/core/blocklog/blocks/latest/requestids: get: operationId: blocklogGetRequestIDsForLatestBlock parameters: @@ -702,7 +736,7 @@ paths: summary: Get the request ids for the latest block tags: - corecontracts - /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}: + /chains/{chainID}/core/blocklog/blocks/{blockIndex}: get: operationId: blocklogGetBlockInfo parameters: @@ -736,7 +770,7 @@ paths: summary: Get the block info of a certain block index tags: - corecontracts - /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: get: operationId: blocklogGetRequestReceiptsOfBlock parameters: @@ -770,7 +804,7 @@ paths: summary: Get all receipts of a certain block tags: - corecontracts - /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: + /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: get: operationId: blocklogGetRequestIDsForBlock parameters: @@ -804,7 +838,7 @@ paths: summary: Get the request ids for a certain block index tags: - corecontracts - /v2chains/{chainID}/core/blocklog/controladdresses: + /chains/{chainID}/core/blocklog/controladdresses: get: operationId: blocklogGetControlAddresses parameters: @@ -831,7 +865,7 @@ paths: summary: Get the control addresses tags: - corecontracts - /v2chains/{chainID}/core/blocklog/events/block/latest: + /chains/{chainID}/core/blocklog/events/block/latest: get: operationId: blocklogGetEventsOfLatestBlock parameters: @@ -858,7 +892,7 @@ paths: summary: Get events of the latest block tags: - corecontracts - /v2chains/{chainID}/core/blocklog/events/block/{blockIndex}: + /chains/{chainID}/core/blocklog/events/block/{blockIndex}: get: operationId: blocklogGetEventsOfBlock parameters: @@ -892,7 +926,7 @@ paths: summary: Get events of a block tags: - corecontracts - /v2chains/{chainID}/core/blocklog/events/contract/{contractHname}: + /chains/{chainID}/core/blocklog/events/contract/{contractHname}: get: operationId: blocklogGetEventsOfContract parameters: @@ -926,7 +960,7 @@ paths: summary: Get events of a contract tags: - corecontracts - /v2chains/{chainID}/core/blocklog/events/request/{requestID}: + /chains/{chainID}/core/blocklog/events/request/{requestID}: get: operationId: blocklogGetEventsOfRequest parameters: @@ -960,7 +994,7 @@ paths: summary: Get events of a request tags: - corecontracts - /v2chains/{chainID}/core/blocklog/requests/{requestID}: + /chains/{chainID}/core/blocklog/requests/{requestID}: get: operationId: blocklogGetRequestReceipt parameters: @@ -994,7 +1028,7 @@ paths: summary: Get the receipt of a certain request id tags: - corecontracts - /v2chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: + /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: get: operationId: blocklogGetRequestIsProcessed parameters: @@ -1028,7 +1062,7 @@ paths: summary: Get the request processing status tags: - corecontracts - /v2chains/{chainID}/core/errors/{contractHname}/message/{errorID}: + /chains/{chainID}/core/errors/{contractHname}/message/{errorID}: get: operationId: errorsGetErrorMessageFormat parameters: @@ -1069,7 +1103,7 @@ paths: summary: Get the error message format of a specific error id tags: - corecontracts - /v2chains/{chainID}/core/governance/chaininfo: + /chains/{chainID}/core/governance/chaininfo: get: description: "If you are using the common API functions, you most likely rather\ \ want to use '/chains/:chainID' to get information about a chain." @@ -1098,7 +1132,7 @@ paths: summary: Get the chain info tags: - corecontracts - /v2chains/{chainID}/deactivate: + /chains/{chainID}/deactivate: post: operationId: deactivateChain parameters: @@ -1127,7 +1161,7 @@ paths: summary: Deactivate a chain tags: - chains - /v2chains/{chainID}/evm/tx/{txHash}: + /chains/{chainID}/evm/tx/{txHash}: get: operationId: getRequestIDFromEVMTransactionID parameters: @@ -1163,7 +1197,7 @@ paths: summary: Get the ISC request ID for the given Ethereum transaction hash tags: - chains - /v2chains/{chainID}/receipts/{requestID}: + /chains/{chainID}/receipts/{requestID}: get: operationId: getReceipt parameters: @@ -1191,7 +1225,7 @@ paths: summary: Get a receipt from a request ID tags: - requests - /v2chains/{chainID}/requests/{requestID}/wait: + /chains/{chainID}/requests/{requestID}/wait: get: operationId: waitForRequest parameters: @@ -1225,7 +1259,7 @@ paths: summary: Wait until the given request has been processed by the node tags: - requests - /v2chains/{chainID}/state/{stateKey}: + /chains/{chainID}/state/{stateKey}: get: operationId: getStateValue parameters: @@ -1253,7 +1287,7 @@ paths: summary: Fetch the raw value associated with the given key in the chain state tags: - chains - /v2chains/{chainID}/ws: + /chains/{chainID}/ws: get: operationId: attachToWebsocket parameters: @@ -1270,7 +1304,7 @@ paths: description: successful operation tags: - chains - /v2metrics/chain/{chainID}: + /metrics/chain/{chainID}: get: operationId: getChainMetrics parameters: @@ -1299,7 +1333,7 @@ paths: summary: Get chain specific metrics. tags: - metrics - /v2metrics/chain/{chainID}/pipe: + /metrics/chain/{chainID}/pipe: get: operationId: getChainPipeMetrics parameters: @@ -1328,7 +1362,7 @@ paths: summary: Get chain pipe event metrics. tags: - metrics - /v2metrics/chain/{chainID}/workflow: + /metrics/chain/{chainID}/workflow: get: operationId: getChainWorkflowMetrics parameters: @@ -1357,7 +1391,7 @@ paths: summary: Get chain workflow metrics. tags: - metrics - /v2metrics/l1: + /metrics/l1: get: operationId: getL1Metrics responses: @@ -1378,7 +1412,7 @@ paths: summary: Get accumulated metrics. tags: - metrics - /v2node/config: + /node/config: get: operationId: getConfiguration responses: @@ -1403,7 +1437,7 @@ paths: summary: Return the Wasp configuration tags: - node - /v2node/dks: + /node/dks: post: operationId: generateDKS requestBody: @@ -1432,7 +1466,7 @@ paths: tags: - node x-codegen-request-body-name: DKSharesPostRequest - /v2node/dks/{sharedAddress}: + /node/dks/{sharedAddress}: get: operationId: getDKSInfo parameters: @@ -1461,7 +1495,7 @@ paths: summary: Get information about the shared address DKS configuration tags: - node - /v2node/info: + /node/info: get: operationId: getInfo responses: @@ -1482,7 +1516,7 @@ paths: summary: Returns private information about this node. tags: - node - /v2node/owner/certificate: + /node/owner/certificate: post: operationId: setNodeOwner requestBody: @@ -1511,7 +1545,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /v2node/peers: + /node/peers: get: operationId: getAllPeers responses: @@ -1520,7 +1554,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/PeeringNodeStatusResponse_' + $ref: '#/components/schemas/PeeringNodeStatusResponse__' type: array description: A list of all peers "401": @@ -1534,7 +1568,7 @@ paths: summary: Get basic information about all configured peers tags: - node - /v2node/peers/identity: + /node/peers/identity: get: operationId: getPeeringIdentity responses: @@ -1555,7 +1589,7 @@ paths: summary: Get basic peer info of the current node tags: - node - /v2node/peers/trusted: + /node/peers/trusted: delete: operationId: distrustPeer requestBody: @@ -1628,7 +1662,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /v2node/shutdown: + /node/shutdown: post: operationId: shutdownNode responses: @@ -1646,7 +1680,7 @@ paths: summary: Shut down the node tags: - node - /v2node/version: + /node/version: get: operationId: getVersion responses: @@ -1659,7 +1693,7 @@ paths: summary: Returns the node version. tags: - node - /v2requests/callview: + /requests/callview: post: description: "Execute a view call. Either use HName or Name properties. If both\ \ are supplied, HName are used." @@ -1682,7 +1716,7 @@ paths: tags: - requests x-codegen-request-body-name: "" - /v2requests/offledger: + /requests/offledger: post: operationId: offLedger requestBody: @@ -1700,7 +1734,7 @@ paths: tags: - requests x-codegen-request-body-name: "" - /v2users: + /users: get: operationId: getUsers responses: @@ -1751,7 +1785,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /v2users/{username}: + /users/{username}: delete: operationId: deleteUser parameters: @@ -1811,7 +1845,7 @@ paths: summary: Get a user tags: - users - /v2users/{username}/password: + /users/{username}/password: put: operationId: changeUserPassword parameters: @@ -1848,7 +1882,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /v2users/{username}/permissions: + /users/{username}/permissions: put: operationId: changeUserPermissions parameters: @@ -2738,6 +2772,32 @@ components: type: object xml: name: ChainMetrics + ChainRecord: + example: + accessNodes: + - accessNodes + - accessNodes + isActive: true + properties: + accessNodes: + items: + format: string + type: string + type: array + xml: + name: AccessNodes + wrapped: true + isActive: + format: boolean + type: boolean + xml: + name: IsActive + required: + - accessNodes + - isActive + type: object + xml: + name: ChainRecord CommitteeInfoResponse: example: candidateNodes: @@ -2758,16 +2818,16 @@ components: committeeNodes: - node: isAlive: true - netId: localhost:4000 - publicKey: 0x0000 - numUsers: 1 + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 isTrusted: true accessAPI: accessAPI - node: isAlive: true - netId: localhost:4000 - publicKey: 0x0000 - numUsers: 1 + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 isTrusted: true accessAPI: accessAPI chainId: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e @@ -2870,9 +2930,9 @@ components: example: node: isAlive: true - netId: localhost:4000 - publicKey: 0x0000 - numUsers: 1 + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 isTrusted: true accessAPI: accessAPI properties: @@ -4180,6 +4240,53 @@ components: xml: name: PeeringNodeStatusResponse PeeringNodeStatusResponse_: + example: + isAlive: true + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 + isTrusted: true + properties: + isAlive: + description: Whether or not the peer is activated + format: boolean + type: boolean + xml: + name: IsAlive + isTrusted: + format: boolean + type: boolean + xml: + name: IsTrusted + netId: + description: The NetID of the peer + format: string + type: string + xml: + name: NetID + numUsers: + description: The amount of users attached to the peer + format: int32 + type: integer + xml: + name: NumUsers + publicKey: + description: The peers public key encoded in Hex + example: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + format: string + type: string + xml: + name: PublicKey + required: + - isAlive + - isTrusted + - netId + - numUsers + - publicKey + type: object + xml: + name: PeeringNodeStatusResponse + PeeringNodeStatusResponse__: example: isAlive: true netId: localhost:4000 diff --git a/clients/apiclient/api_auth.go b/clients/apiclient/api_auth.go index f590d26ff4..cea7cad3fe 100644 --- a/clients/apiclient/api_auth.go +++ b/clients/apiclient/api_auth.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index 92c95dc1fc..502d531ef4 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -61,7 +61,7 @@ func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/activate" + localVarPath := localBasePath + "/chains/{chainID}/activate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -178,7 +178,7 @@ func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -293,7 +293,7 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/ws" + localVarPath := localBasePath + "/chains/{chainID}/ws" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -383,7 +383,7 @@ func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) ( return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/deactivate" + localVarPath := localBasePath + "/chains/{chainID}/deactivate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -499,7 +499,7 @@ func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*Chain return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}" + localVarPath := localBasePath + "/chains/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -621,7 +621,7 @@ func (a *ChainsApiService) GetChainsExecute(r ApiGetChainsRequest) ([]ChainInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains" + localVarPath := localBasePath + "/chains" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -745,7 +745,7 @@ func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/committee" + localVarPath := localBasePath + "/chains/{chainID}/committee" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -870,7 +870,7 @@ func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]Cont return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/contracts" + localVarPath := localBasePath + "/chains/{chainID}/contracts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -998,7 +998,7 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/evm/tx/{txHash}" + localVarPath := localBasePath + "/chains/{chainID}/evm/tx/{txHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) @@ -1113,7 +1113,7 @@ func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) (*Sta return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/state/{stateKey}" + localVarPath := localBasePath + "/chains/{chainID}/state/{stateKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterValueToString(r.stateKey, "stateKey")), -1) @@ -1216,7 +1216,7 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -1292,3 +1292,129 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) return localVarHTTPResponse, nil } + +type ApiSetChainRecordRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string + chainRecord *ChainRecord +} + +// Chain Record +func (r ApiSetChainRecordRequest) ChainRecord(chainRecord ChainRecord) ApiSetChainRecordRequest { + r.chainRecord = &chainRecord + return r +} + +func (r ApiSetChainRecordRequest) Execute() (*http.Response, error) { + return r.ApiService.SetChainRecordExecute(r) +} + +/* +SetChainRecord Sets the chain record. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiSetChainRecordRequest +*/ +func (a *ChainsApiService) SetChainRecord(ctx context.Context, chainID string) ApiSetChainRecordRequest { + return ApiSetChainRecordRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +func (a *ChainsApiService) SetChainRecordExecute(r ApiSetChainRecordRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.SetChainRecord") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/chainrecord" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.chainRecord == nil { + return nil, reportError("chainRecord is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.chainRecord + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index 9c0c1f5c21..00b23ca5e7 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -66,7 +66,7 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/account/{agentID}/balance" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/balance" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -181,7 +181,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/account/{agentID}/nfts" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nfts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -296,7 +296,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/account/{agentID}/nonce" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nonce" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -408,7 +408,7 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -522,7 +522,7 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/foundry_output" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/foundry_output" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"chainID_"+"}", url.PathEscape(parameterValueToString(r.chainID2, "chainID2")), -1) @@ -637,7 +637,7 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/nftdata" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/nftdata" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterValueToString(r.nftID, "nftID")), -1) @@ -749,7 +749,7 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/token_registry" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/token_registry" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -860,7 +860,7 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/accounts/total_assets" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/total_assets" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -971,7 +971,7 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blobs" + localVarPath := localBasePath + "/chains/{chainID}/core/blobs" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1085,7 +1085,7 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blobs/{blobHash}" + localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) @@ -1203,7 +1203,7 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" + localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterValueToString(r.fieldKey, "fieldKey")), -1) @@ -1319,7 +1319,7 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/{blockIndex}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -1431,7 +1431,7 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/controladdresses" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/controladdresses" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1545,7 +1545,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/block/{blockIndex}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -1660,7 +1660,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/contract/{contractHname}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/contract/{contractHname}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) @@ -1772,7 +1772,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/block/latest" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1886,7 +1886,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/events/request/{requestID}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/request/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -1998,7 +1998,7 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/latest" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2112,7 +2112,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -2224,7 +2224,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/latest/requestids" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2338,7 +2338,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2453,7 +2453,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/requests/{requestID}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2568,7 +2568,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -2680,7 +2680,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/blocklog/blocks/latest/receipts" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2797,7 +2797,7 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/errors/{contractHname}/message/{errorID}" + localVarPath := localBasePath + "/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterValueToString(r.errorID, "errorID")), -1) @@ -2912,7 +2912,7 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/core/governance/chaininfo" + localVarPath := localBasePath + "/chains/{chainID}/core/governance/chaininfo" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) diff --git a/clients/apiclient/api_metrics.go b/clients/apiclient/api_metrics.go index 5f1a1435ae..b34f66e466 100644 --- a/clients/apiclient/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -63,7 +63,7 @@ func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2metrics/chain/{chainID}" + localVarPath := localBasePath + "/metrics/chain/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -188,7 +188,7 @@ func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2metrics/chain/{chainID}/pipe" + localVarPath := localBasePath + "/metrics/chain/{chainID}/pipe" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -313,7 +313,7 @@ func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflow return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2metrics/chain/{chainID}/workflow" + localVarPath := localBasePath + "/metrics/chain/{chainID}/workflow" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *MetricsApiService) GetL1MetricsExecute(r ApiGetL1MetricsRequest) (*Chai return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2metrics/l1" + localVarPath := localBasePath + "/metrics/l1" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index 457239963d..a148e53eea 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func (a *NodeApiService) DistrustPeerExecute(r ApiDistrustPeerRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/peers/trusted" + localVarPath := localBasePath + "/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -189,7 +189,7 @@ func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesI return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/dks" + localVarPath := localBasePath + "/node/dks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -315,7 +315,7 @@ func (a *NodeApiService) GetAllPeersExecute(r ApiGetAllPeersRequest) ([]PeeringN return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/peers" + localVarPath := localBasePath + "/node/peers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -436,7 +436,7 @@ func (a *NodeApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/config" + localVarPath := localBasePath + "/node/config" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -560,7 +560,7 @@ func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInf return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/dks/{sharedAddress}" + localVarPath := localBasePath + "/node/dks/{sharedAddress}" localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) localVarHeaderParams := make(map[string]string) @@ -682,7 +682,7 @@ func (a *NodeApiService) GetInfoExecute(r ApiGetInfoRequest) (*InfoResponse, *ht return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/info" + localVarPath := localBasePath + "/node/info" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -803,7 +803,7 @@ func (a *NodeApiService) GetPeeringIdentityExecute(r ApiGetPeeringIdentityReques return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/peers/identity" + localVarPath := localBasePath + "/node/peers/identity" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -924,7 +924,7 @@ func (a *NodeApiService) GetTrustedPeersExecute(r ApiGetTrustedPeersRequest) ([] return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/peers/trusted" + localVarPath := localBasePath + "/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1045,7 +1045,7 @@ func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (*VersionResp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/version" + localVarPath := localBasePath + "/node/version" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1149,7 +1149,7 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*NodeOwn return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/owner/certificate" + localVarPath := localBasePath + "/node/owner/certificate" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1273,7 +1273,7 @@ func (a *NodeApiService) ShutdownNodeExecute(r ApiShutdownNodeRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/shutdown" + localVarPath := localBasePath + "/node/shutdown" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1390,7 +1390,7 @@ func (a *NodeApiService) TrustPeerExecute(r ApiTrustPeerRequest) (*http.Response return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2node/peers/trusted" + localVarPath := localBasePath + "/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index d8595d8d64..55ccc4235c 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -69,7 +69,7 @@ func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, * return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2requests/callview" + localVarPath := localBasePath + "/requests/callview" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -177,7 +177,7 @@ func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*Receipt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/receipts/{requestID}" + localVarPath := localBasePath + "/chains/{chainID}/receipts/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -281,7 +281,7 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2requests/offledger" + localVarPath := localBasePath + "/requests/offledger" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -380,7 +380,7 @@ func (a *RequestsApiService) WaitForRequestExecute(r ApiWaitForRequestRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2chains/{chainID}/requests/{requestID}/wait" + localVarPath := localBasePath + "/chains/{chainID}/requests/{requestID}/wait" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) diff --git a/clients/apiclient/api_users.go b/clients/apiclient/api_users.go index cb5310c624..62ff0825cb 100644 --- a/clients/apiclient/api_users.go +++ b/clients/apiclient/api_users.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func (a *UsersApiService) AddUserExecute(r ApiAddUserRequest) (*http.Response, e return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2users" + localVarPath := localBasePath + "/users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -190,7 +190,7 @@ func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordReque return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2users/{username}/password" + localVarPath := localBasePath + "/users/{username}/password" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -316,7 +316,7 @@ func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermission return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2users/{username}/permissions" + localVarPath := localBasePath + "/users/{username}/permissions" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respo return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2users/{username}" + localVarPath := localBasePath + "/users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -552,7 +552,7 @@ func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Resp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2users/{username}" + localVarPath := localBasePath + "/users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -675,7 +675,7 @@ func (a *UsersApiService) GetUsersExecute(r ApiGetUsersRequest) ([]User, *http.R return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2users" + localVarPath := localBasePath + "/users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go index 6d1b1f7889..5ee397212b 100644 --- a/clients/apiclient/client.go +++ b/clients/apiclient/client.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Wasp API API v0.4.0-alpha.8-14-gbb23763d3 +// APIClient manages communication with the Wasp API API v0.4.0-alpha.8-16-g83edf92b9 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/clients/apiclient/configuration.go b/clients/apiclient/configuration.go index e6148c509c..551ecab0b1 100644 --- a/clients/apiclient/configuration.go +++ b/clients/apiclient/configuration.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/docs/ChainRecord.md b/clients/apiclient/docs/ChainRecord.md index 295a7cb409..403e40ff49 100644 --- a/clients/apiclient/docs/ChainRecord.md +++ b/clients/apiclient/docs/ChainRecord.md @@ -4,15 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AccessNodes** | Pointer to **[]string** | | [optional] -**Active** | Pointer to **bool** | Whether or not the chain is active | [optional] -**ChainId** | Pointer to **string** | ChainID (bech32) | [optional] +**AccessNodes** | **[]string** | | +**IsActive** | **bool** | | ## Methods ### NewChainRecord -`func NewChainRecord() *ChainRecord` +`func NewChainRecord(accessNodes []string, isActive bool, ) *ChainRecord` NewChainRecord instantiates a new ChainRecord object This constructor will assign default values to properties that have it defined, @@ -46,61 +45,26 @@ and a boolean to check if the value has been set. SetAccessNodes sets AccessNodes field to given value. -### HasAccessNodes -`func (o *ChainRecord) HasAccessNodes() bool` +### GetIsActive -HasAccessNodes returns a boolean if a field has been set. +`func (o *ChainRecord) GetIsActive() bool` -### GetActive +GetIsActive returns the IsActive field if non-nil, zero value otherwise. -`func (o *ChainRecord) GetActive() bool` +### GetIsActiveOk -GetActive returns the Active field if non-nil, zero value otherwise. +`func (o *ChainRecord) GetIsActiveOk() (*bool, bool)` -### GetActiveOk - -`func (o *ChainRecord) GetActiveOk() (*bool, bool)` - -GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +GetIsActiveOk returns a tuple with the IsActive field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetActive - -`func (o *ChainRecord) SetActive(v bool)` - -SetActive sets Active field to given value. - -### HasActive - -`func (o *ChainRecord) HasActive() bool` - -HasActive returns a boolean if a field has been set. - -### GetChainId - -`func (o *ChainRecord) GetChainId() string` - -GetChainId returns the ChainId field if non-nil, zero value otherwise. - -### GetChainIdOk - -`func (o *ChainRecord) GetChainIdOk() (*string, bool)` - -GetChainIdOk returns a tuple with the ChainId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetChainId - -`func (o *ChainRecord) SetChainId(v string)` - -SetChainId sets ChainId field to given value. +### SetIsActive -### HasChainId +`func (o *ChainRecord) SetIsActive(v bool)` -`func (o *ChainRecord) HasChainId() bool` +SetIsActive sets IsActive field to given value. -HasChainId returns a boolean if a field has been set. [[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/clients/apiclient/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md index 4c18cee3cc..c8e0a15d45 100644 --- a/clients/apiclient/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -4,17 +4,18 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /v2chains/{chainID}/activate | Activate a chain -[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /v2chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. -[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /v2chains/{chainID}/ws | -[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /v2chains/{chainID}/deactivate | Deactivate a chain -[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /v2chains/{chainID} | Get information about a specific chain -[**GetChains**](ChainsApi.md#GetChains) | **Get** /v2chains | Get a list of all chains -[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /v2chains/{chainID}/committee | Get information about the deployed committee -[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /v2chains/{chainID}/contracts | Get all available chain contracts -[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /v2chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash -[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state -[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /v2chains/{chainID}/access-node/{publicKey} | Remove an access node. +[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /chains/{chainID}/activate | Activate a chain +[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. +[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /chains/{chainID}/ws | +[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain +[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /chains/{chainID} | Get information about a specific chain +[**GetChains**](ChainsApi.md#GetChains) | **Get** /chains | Get a list of all chains +[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee +[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts +[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. +[**SetChainRecord**](ChainsApi.md#SetChainRecord) | **Post** /chains/{chainID}/chainrecord | Sets the chain record. @@ -758,3 +759,71 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## SetChainRecord + +> SetChainRecord(ctx, chainID).ChainRecord(chainRecord).Execute() + +Sets the chain record. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + chainRecord := *openapiclient.NewChainRecord([]string{"AccessNodes_example"}, false) // ChainRecord | Chain Record + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.SetChainRecord(context.Background(), chainID).ChainRecord(chainRecord).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.SetChainRecord``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSetChainRecordRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **chainRecord** | [**ChainRecord**](ChainRecord.md) | Chain Record | + +### Return type + + (empty response body) + +### Authorization + +[Authorization](../README.md#Authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **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/clients/apiclient/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md index 39efbe439c..ed217e9dd4 100644 --- a/clients/apiclient/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -4,32 +4,32 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /v2chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account -[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /v2chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account -[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /v2chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account -[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /v2chains/{chainID}/core/accounts | Get a list of all accounts -[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /v2chains/{chainID}/core/accounts/foundry_output | Get the foundry output -[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /v2chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID -[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /v2chains/{chainID}/core/accounts/token_registry | Get a list of all registries -[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /v2chains/{chainID}/core/accounts/total_assets | Get all stored assets -[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /v2chains/{chainID}/core/blobs | Get all stored blobs -[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /v2chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob -[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /v2chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) -[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /v2chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index -[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /v2chains/{chainID}/core/blocklog/controladdresses | Get the control addresses -[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /v2chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block -[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /v2chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract -[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /v2chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block -[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /v2chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request -[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /v2chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block -[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index -[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block -[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /v2chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status -[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /v2chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id -[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block -[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block -[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id -[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2chains/{chainID}/core/governance/chaininfo | Get the chain info +[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /chains/{chainID}/core/accounts | Get a list of all accounts +[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /chains/{chainID}/core/accounts/foundry_output | Get the foundry output +[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /chains/{chainID}/core/accounts/token_registry | Get a list of all registries +[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /chains/{chainID}/core/accounts/total_assets | Get all stored assets +[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /chains/{chainID}/core/blobs | Get all stored blobs +[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /chains/{chainID}/core/governance/chaininfo | Get the chain info diff --git a/clients/apiclient/docs/MetricsApi.md b/clients/apiclient/docs/MetricsApi.md index 355bce2eb2..83f5ab2f3b 100644 --- a/clients/apiclient/docs/MetricsApi.md +++ b/clients/apiclient/docs/MetricsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /v2metrics/chain/{chainID} | Get chain specific metrics. -[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /v2metrics/chain/{chainID}/pipe | Get chain pipe event metrics. -[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /v2metrics/chain/{chainID}/workflow | Get chain workflow metrics. -[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /v2metrics/l1 | Get accumulated metrics. +[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /metrics/chain/{chainID} | Get chain specific metrics. +[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /metrics/chain/{chainID}/pipe | Get chain pipe event metrics. +[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /metrics/chain/{chainID}/workflow | Get chain workflow metrics. +[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /metrics/l1 | Get accumulated metrics. diff --git a/clients/apiclient/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md index 117eea1252..662351446e 100644 --- a/clients/apiclient/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -4,18 +4,18 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /v2node/peers/trusted | Distrust a peering node -[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /v2node/dks | Generate a new distributed key -[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /v2node/peers | Get basic information about all configured peers -[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /v2node/config | Return the Wasp configuration -[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /v2node/dks/{sharedAddress} | Get information about the shared address DKS configuration -[**GetInfo**](NodeApi.md#GetInfo) | **Get** /v2node/info | Returns private information about this node. -[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /v2node/peers/identity | Get basic peer info of the current node -[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /v2node/peers/trusted | Get trusted peers -[**GetVersion**](NodeApi.md#GetVersion) | **Get** /v2node/version | Returns the node version. -[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /v2node/owner/certificate | Sets the node owner -[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /v2node/shutdown | Shut down the node -[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /v2node/peers/trusted | Trust a peering node +[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /node/peers/trusted | Distrust a peering node +[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /node/dks | Generate a new distributed key +[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /node/peers | Get basic information about all configured peers +[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /node/config | Return the Wasp configuration +[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /node/dks/{sharedAddress} | Get information about the shared address DKS configuration +[**GetInfo**](NodeApi.md#GetInfo) | **Get** /node/info | Returns private information about this node. +[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /node/peers/identity | Get basic peer info of the current node +[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /node/peers/trusted | Get trusted peers +[**GetVersion**](NodeApi.md#GetVersion) | **Get** /node/version | Returns the node version. +[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /node/owner/certificate | Sets the node owner +[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /node/shutdown | Shut down the node +[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /node/peers/trusted | Trust a peering node diff --git a/clients/apiclient/docs/RequestsApi.md b/clients/apiclient/docs/RequestsApi.md index be802b138b..815dca8b12 100644 --- a/clients/apiclient/docs/RequestsApi.md +++ b/clients/apiclient/docs/RequestsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CallView**](RequestsApi.md#CallView) | **Post** /v2requests/callview | Call a view function on a contract by Hname -[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID -[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2requests/offledger | Post an off-ledger request -[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /v2chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +[**CallView**](RequestsApi.md#CallView) | **Post** /requests/callview | Call a view function on a contract by Hname +[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /requests/offledger | Post an off-ledger request +[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node diff --git a/clients/apiclient/docs/UsersApi.md b/clients/apiclient/docs/UsersApi.md index fbf039ee28..f5ea3cc788 100644 --- a/clients/apiclient/docs/UsersApi.md +++ b/clients/apiclient/docs/UsersApi.md @@ -4,12 +4,12 @@ All URIs are relative to *http://localhost:9090* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AddUser**](UsersApi.md#AddUser) | **Post** /v2users | Add a user -[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /v2users/{username}/password | Change user password -[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /v2users/{username}/permissions | Change user permissions -[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /v2users/{username} | Deletes a user -[**GetUser**](UsersApi.md#GetUser) | **Get** /v2users/{username} | Get a user -[**GetUsers**](UsersApi.md#GetUsers) | **Get** /v2users | Get a list of all users +[**AddUser**](UsersApi.md#AddUser) | **Post** /users | Add a user +[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /users/{username}/password | Change user password +[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /users/{username}/permissions | Change user permissions +[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /users/{username} | Deletes a user +[**GetUser**](UsersApi.md#GetUser) | **Get** /users/{username} | Get a user +[**GetUsers**](UsersApi.md#GetUsers) | **Get** /users | Get a list of all users diff --git a/clients/apiclient/model_account_list_response.go b/clients/apiclient/model_account_list_response.go index 2184888b1e..85f1508e90 100644 --- a/clients/apiclient/model_account_list_response.go +++ b/clients/apiclient/model_account_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nfts_response.go b/clients/apiclient/model_account_nfts_response.go index 5c9abfa58b..8843ab26d2 100644 --- a/clients/apiclient/model_account_nfts_response.go +++ b/clients/apiclient/model_account_nfts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nonce_response.go b/clients/apiclient/model_account_nonce_response.go index 984f9093f9..f7be3844cb 100644 --- a/clients/apiclient/model_account_nonce_response.go +++ b/clients/apiclient/model_account_nonce_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_add_user_request.go b/clients/apiclient/model_add_user_request.go index 9f931f5305..7127bd986d 100644 --- a/clients/apiclient/model_add_user_request.go +++ b/clients/apiclient/model_add_user_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_alias_output_metric_item.go b/clients/apiclient/model_alias_output_metric_item.go index a4e9a1905f..577c39bed4 100644 --- a/clients/apiclient/model_alias_output_metric_item.go +++ b/clients/apiclient/model_alias_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets.go b/clients/apiclient/model_assets.go index 6ac83abf99..a27151d843 100644 --- a/clients/apiclient/model_assets.go +++ b/clients/apiclient/model_assets.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets_response.go b/clients/apiclient/model_assets_response.go index 7b995b1fc7..4b2f567546 100644 --- a/clients/apiclient/model_assets_response.go +++ b/clients/apiclient/model_assets_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_auth_info_model.go b/clients/apiclient/model_auth_info_model.go index 1271f81760..701b77f1a2 100644 --- a/clients/apiclient/model_auth_info_model.go +++ b/clients/apiclient/model_auth_info_model.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_base_token.go b/clients/apiclient/model_base_token.go index bc2797fe50..58f84a53b6 100644 --- a/clients/apiclient/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index b6a73d1e6d..280feb3d1a 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go index 0b60eb0b56..b4112fba30 100644 --- a/clients/apiclient/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_list_response.go b/clients/apiclient/model_blob_list_response.go index 46a6769c82..ca6ef686ed 100644 --- a/clients/apiclient/model_blob_list_response.go +++ b/clients/apiclient/model_blob_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go index bd2e2f5f41..7bd57379a3 100644 --- a/clients/apiclient/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_info_response.go b/clients/apiclient/model_block_info_response.go index d6a23b4755..4960b84c1b 100644 --- a/clients/apiclient/model_block_info_response.go +++ b/clients/apiclient/model_block_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipt_error.go b/clients/apiclient/model_block_receipt_error.go index fa806e599b..7784cb74ff 100644 --- a/clients/apiclient/model_block_receipt_error.go +++ b/clients/apiclient/model_block_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipts_response.go b/clients/apiclient/model_block_receipts_response.go index a1ff7fa384..4e5e20ab67 100644 --- a/clients/apiclient/model_block_receipts_response.go +++ b/clients/apiclient/model_block_receipts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_log.go b/clients/apiclient/model_burn_log.go index 430f7e3c36..f2a0896324 100644 --- a/clients/apiclient/model_burn_log.go +++ b/clients/apiclient/model_burn_log.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_record.go b/clients/apiclient/model_burn_record.go index 51cfb53839..f176a01ee3 100644 --- a/clients/apiclient/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index 096c8e0a6e..747a123778 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_info_response.go b/clients/apiclient/model_chain_info_response.go index 20fd097d7c..821d98b5e5 100644 --- a/clients/apiclient/model_chain_info_response.go +++ b/clients/apiclient/model_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go index c4cd9d6a70..f73bceeb1f 100644 --- a/clients/apiclient/model_chain_metrics.go +++ b/clients/apiclient/model_chain_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_record.go b/clients/apiclient/model_chain_record.go index 5908b50e68..ec2911f443 100644 --- a/clients/apiclient/model_chain_record.go +++ b/clients/apiclient/model_chain_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 123 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,19 +19,18 @@ var _ MappedNullable = &ChainRecord{} // ChainRecord struct for ChainRecord type ChainRecord struct { - AccessNodes []string `json:"accessNodes,omitempty"` - // Whether or not the chain is active - Active *bool `json:"active,omitempty"` - // ChainID (bech32) - ChainId *string `json:"chainId,omitempty"` + AccessNodes []string `json:"accessNodes"` + IsActive bool `json:"isActive"` } // NewChainRecord instantiates a new ChainRecord object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewChainRecord() *ChainRecord { +func NewChainRecord(accessNodes []string, isActive bool) *ChainRecord { this := ChainRecord{} + this.AccessNodes = accessNodes + this.IsActive = isActive return &this } @@ -43,100 +42,52 @@ func NewChainRecordWithDefaults() *ChainRecord { return &this } -// GetAccessNodes returns the AccessNodes field value if set, zero value otherwise. +// GetAccessNodes returns the AccessNodes field value func (o *ChainRecord) GetAccessNodes() []string { - if o == nil || isNil(o.AccessNodes) { + if o == nil { var ret []string return ret } + return o.AccessNodes } -// GetAccessNodesOk returns a tuple with the AccessNodes field value if set, nil otherwise +// GetAccessNodesOk returns a tuple with the AccessNodes field value // and a boolean to check if the value has been set. func (o *ChainRecord) GetAccessNodesOk() ([]string, bool) { - if o == nil || isNil(o.AccessNodes) { + if o == nil { return nil, false } return o.AccessNodes, true } -// HasAccessNodes returns a boolean if a field has been set. -func (o *ChainRecord) HasAccessNodes() bool { - if o != nil && !isNil(o.AccessNodes) { - return true - } - - return false -} - -// SetAccessNodes gets a reference to the given []string and assigns it to the AccessNodes field. +// SetAccessNodes sets field value func (o *ChainRecord) SetAccessNodes(v []string) { o.AccessNodes = v } -// GetActive returns the Active field value if set, zero value otherwise. -func (o *ChainRecord) GetActive() bool { - if o == nil || isNil(o.Active) { +// GetIsActive returns the IsActive field value +func (o *ChainRecord) GetIsActive() bool { + if o == nil { var ret bool return ret } - return *o.Active -} - -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ChainRecord) GetActiveOk() (*bool, bool) { - if o == nil || isNil(o.Active) { - return nil, false - } - return o.Active, true -} - -// HasActive returns a boolean if a field has been set. -func (o *ChainRecord) HasActive() bool { - if o != nil && !isNil(o.Active) { - return true - } - return false + return o.IsActive } -// SetActive gets a reference to the given bool and assigns it to the Active field. -func (o *ChainRecord) SetActive(v bool) { - o.Active = &v -} - -// GetChainId returns the ChainId field value if set, zero value otherwise. -func (o *ChainRecord) GetChainId() string { - if o == nil || isNil(o.ChainId) { - var ret string - return ret - } - return *o.ChainId -} - -// GetChainIdOk returns a tuple with the ChainId field value if set, nil otherwise +// GetIsActiveOk returns a tuple with the IsActive field value // and a boolean to check if the value has been set. -func (o *ChainRecord) GetChainIdOk() (*string, bool) { - if o == nil || isNil(o.ChainId) { +func (o *ChainRecord) GetIsActiveOk() (*bool, bool) { + if o == nil { return nil, false } - return o.ChainId, true + return &o.IsActive, true } -// HasChainId returns a boolean if a field has been set. -func (o *ChainRecord) HasChainId() bool { - if o != nil && !isNil(o.ChainId) { - return true - } - - return false -} - -// SetChainId gets a reference to the given string and assigns it to the ChainId field. -func (o *ChainRecord) SetChainId(v string) { - o.ChainId = &v +// SetIsActive sets field value +func (o *ChainRecord) SetIsActive(v bool) { + o.IsActive = v } func (o ChainRecord) MarshalJSON() ([]byte, error) { @@ -149,15 +100,8 @@ func (o ChainRecord) MarshalJSON() ([]byte, error) { func (o ChainRecord) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !isNil(o.AccessNodes) { - toSerialize["accessNodes"] = o.AccessNodes - } - if !isNil(o.Active) { - toSerialize["active"] = o.Active - } - if !isNil(o.ChainId) { - toSerialize["chainId"] = o.ChainId - } + toSerialize["accessNodes"] = o.AccessNodes + toSerialize["isActive"] = o.IsActive return toSerialize, nil } diff --git a/clients/apiclient/model_committee_info_response.go b/clients/apiclient/model_committee_info_response.go index 0b8c4b9b78..abf0e51cba 100644 --- a/clients/apiclient/model_committee_info_response.go +++ b/clients/apiclient/model_committee_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_node.go b/clients/apiclient/model_committee_node.go index 29f6684599..1c3ffbe4e3 100644 --- a/clients/apiclient/model_committee_node.go +++ b/clients/apiclient/model_committee_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go index 6c5c3d89b9..188cd59145 100644 --- a/clients/apiclient/model_consensus_pipe_metrics.go +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_workflow_metrics.go b/clients/apiclient/model_consensus_workflow_metrics.go index f45b89ea67..2a85e2148f 100644 --- a/clients/apiclient/model_consensus_workflow_metrics.go +++ b/clients/apiclient/model_consensus_workflow_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_call_view_request.go b/clients/apiclient/model_contract_call_view_request.go index 6d141af20f..a59e1e3738 100644 --- a/clients/apiclient/model_contract_call_view_request.go +++ b/clients/apiclient/model_contract_call_view_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_info_response.go b/clients/apiclient/model_contract_info_response.go index a290538a43..d1e157d33e 100644 --- a/clients/apiclient/model_contract_info_response.go +++ b/clients/apiclient/model_contract_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go index e8300d14bd..b013f1decc 100644 --- a/clients/apiclient/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_info.go b/clients/apiclient/model_dk_shares_info.go index cc6b0e5c1c..c7b8f7bb63 100644 --- a/clients/apiclient/model_dk_shares_info.go +++ b/clients/apiclient/model_dk_shares_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_post_request.go b/clients/apiclient/model_dk_shares_post_request.go index b2918b7f6b..5d1d325271 100644 --- a/clients/apiclient/model_dk_shares_post_request.go +++ b/clients/apiclient/model_dk_shares_post_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_error_message_format_response.go b/clients/apiclient/model_error_message_format_response.go index 21b1407e6d..07519d5112 100644 --- a/clients/apiclient/model_error_message_format_response.go +++ b/clients/apiclient/model_error_message_format_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_events_response.go b/clients/apiclient/model_events_response.go index d741152ddf..c5d467bc2a 100644 --- a/clients/apiclient/model_events_response.go +++ b/clients/apiclient/model_events_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_foundry_output_response.go b/clients/apiclient/model_foundry_output_response.go index cacd326cdf..49323eabe3 100644 --- a/clients/apiclient/model_foundry_output_response.go +++ b/clients/apiclient/model_foundry_output_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index 0802dce9b3..6192f5281d 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go index 2c5666b851..3ff32d6c43 100644 --- a/clients/apiclient/model_gov_chain_info_response.go +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output.go b/clients/apiclient/model_in_output.go index 7051b25f5e..5b0a03c280 100644 --- a/clients/apiclient/model_in_output.go +++ b/clients/apiclient/model_in_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output_metric_item.go b/clients/apiclient/model_in_output_metric_item.go index 12d91ebb34..c92148503a 100644 --- a/clients/apiclient/model_in_output_metric_item.go +++ b/clients/apiclient/model_in_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output.go b/clients/apiclient/model_in_state_output.go index e4a758473d..38c09de789 100644 --- a/clients/apiclient/model_in_state_output.go +++ b/clients/apiclient/model_in_state_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output_metric_item.go b/clients/apiclient/model_in_state_output_metric_item.go index 78b44f1348..fe4ed10571 100644 --- a/clients/apiclient/model_in_state_output_metric_item.go +++ b/clients/apiclient/model_in_state_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_info_response.go b/clients/apiclient/model_info_response.go index 72ee89de6d..dc6bdd99e6 100644 --- a/clients/apiclient/model_info_response.go +++ b/clients/apiclient/model_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_interface_metric_item.go b/clients/apiclient/model_interface_metric_item.go index c712907b30..255530c914 100644 --- a/clients/apiclient/model_interface_metric_item.go +++ b/clients/apiclient/model_interface_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_item.go b/clients/apiclient/model_item.go index 7d37a72556..72691e4d4a 100644 --- a/clients/apiclient/model_item.go +++ b/clients/apiclient/model_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_json_dict.go b/clients/apiclient/model_json_dict.go index 536a774eaf..ec6327597f 100644 --- a/clients/apiclient/model_json_dict.go +++ b/clients/apiclient/model_json_dict.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_l1_params.go b/clients/apiclient/model_l1_params.go index b713932fea..af9d18f94c 100644 --- a/clients/apiclient/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_request.go b/clients/apiclient/model_login_request.go index def3136ac1..d7cecc64c1 100644 --- a/clients/apiclient/model_login_request.go +++ b/clients/apiclient/model_login_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_response.go b/clients/apiclient/model_login_response.go index ff9666d8ba..fa81f98a5d 100644 --- a/clients/apiclient/model_login_response.go +++ b/clients/apiclient/model_login_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go index 4ce243acdd..53da92788f 100644 --- a/clients/apiclient/model_milestone_info.go +++ b/clients/apiclient/model_milestone_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_metric_item.go b/clients/apiclient/model_milestone_metric_item.go index 2910ccbbcb..35291ddc65 100644 --- a/clients/apiclient/model_milestone_metric_item.go +++ b/clients/apiclient/model_milestone_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token.go b/clients/apiclient/model_native_token.go index 31cfec87aa..d0304a3837 100644 --- a/clients/apiclient/model_native_token.go +++ b/clients/apiclient/model_native_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token_id_registry_response.go b/clients/apiclient/model_native_token_id_registry_response.go index 1cd26b0142..6dcef76889 100644 --- a/clients/apiclient/model_native_token_id_registry_response.go +++ b/clients/apiclient/model_native_token_id_registry_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_nft_data_response.go b/clients/apiclient/model_nft_data_response.go index c95f7d7e1f..6e9b8717a4 100644 --- a/clients/apiclient/model_nft_data_response.go +++ b/clients/apiclient/model_nft_data_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_request.go b/clients/apiclient/model_node_owner_certificate_request.go index 16d0e8b7c2..23151831cb 100644 --- a/clients/apiclient/model_node_owner_certificate_request.go +++ b/clients/apiclient/model_node_owner_certificate_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_response.go b/clients/apiclient/model_node_owner_certificate_response.go index 21a93249fc..0df3e6dbd2 100644 --- a/clients/apiclient/model_node_owner_certificate_response.go +++ b/clients/apiclient/model_node_owner_certificate_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_off_ledger_request.go b/clients/apiclient/model_off_ledger_request.go index c87cfcf1cd..2d836b0381 100644 --- a/clients/apiclient/model_off_ledger_request.go +++ b/clients/apiclient/model_off_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request.go b/clients/apiclient/model_on_ledger_request.go index 52f589e51f..ef6e6216c9 100644 --- a/clients/apiclient/model_on_ledger_request.go +++ b/clients/apiclient/model_on_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request_metric_item.go b/clients/apiclient/model_on_ledger_request_metric_item.go index 21c0661399..33bdb29c45 100644 --- a/clients/apiclient/model_on_ledger_request_metric_item.go +++ b/clients/apiclient/model_on_ledger_request_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output.go b/clients/apiclient/model_output.go index 21f3c42153..fec777c692 100644 --- a/clients/apiclient/model_output.go +++ b/clients/apiclient/model_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output_id.go b/clients/apiclient/model_output_id.go index b0f47edff7..b4e8473a67 100644 --- a/clients/apiclient/model_output_id.go +++ b/clients/apiclient/model_output_id.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_identity_response.go b/clients/apiclient/model_peering_node_identity_response.go index b961cd5fa7..581e8783da 100644 --- a/clients/apiclient/model_peering_node_identity_response.go +++ b/clients/apiclient/model_peering_node_identity_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go index 26278c1cf3..e92a1a79c5 100644 --- a/clients/apiclient/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_trust_request.go b/clients/apiclient/model_peering_trust_request.go index 2e5ca3c981..40dccc5d2c 100644 --- a/clients/apiclient/model_peering_trust_request.go +++ b/clients/apiclient/model_peering_trust_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go index 39afdb3006..f31b485b7e 100644 --- a/clients/apiclient/model_protocol_parameters.go +++ b/clients/apiclient/model_protocol_parameters.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_publisher_state_transaction_item.go b/clients/apiclient/model_publisher_state_transaction_item.go index fe6d0487af..46f0fd21ae 100644 --- a/clients/apiclient/model_publisher_state_transaction_item.go +++ b/clients/apiclient/model_publisher_state_transaction_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index 28f367ce9c..95d0c8b526 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_response.go b/clients/apiclient/model_receipt_response.go index 095566d5b5..bd2bade3b7 100644 --- a/clients/apiclient/model_receipt_response.go +++ b/clients/apiclient/model_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_rent_structure.go b/clients/apiclient/model_rent_structure.go index 2795138473..4c84a2c57d 100644 --- a/clients/apiclient/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_detail.go b/clients/apiclient/model_request_detail.go index 672b455866..0720a98ca2 100644 --- a/clients/apiclient/model_request_detail.go +++ b/clients/apiclient/model_request_detail.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_ids_response.go b/clients/apiclient/model_request_ids_response.go index be75617f09..b17a92d5a1 100644 --- a/clients/apiclient/model_request_ids_response.go +++ b/clients/apiclient/model_request_ids_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_processed_response.go b/clients/apiclient/model_request_processed_response.go index 05ecd07fd9..fb3d60a911 100644 --- a/clients/apiclient/model_request_processed_response.go +++ b/clients/apiclient/model_request_processed_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_receipt_response.go b/clients/apiclient/model_request_receipt_response.go index 06d03b5456..f8e84d0bc7 100644 --- a/clients/apiclient/model_request_receipt_response.go +++ b/clients/apiclient/model_request_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_response.go b/clients/apiclient/model_state_response.go index 8314eb744e..ca99e08b4f 100644 --- a/clients/apiclient/model_state_response.go +++ b/clients/apiclient/model_state_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_transaction.go b/clients/apiclient/model_state_transaction.go index dd64ea5904..08efa1cec4 100644 --- a/clients/apiclient/model_state_transaction.go +++ b/clients/apiclient/model_state_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction.go b/clients/apiclient/model_transaction.go index d8cf887878..f34a58aab6 100644 --- a/clients/apiclient/model_transaction.go +++ b/clients/apiclient/model_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_id_metric_item.go b/clients/apiclient/model_transaction_id_metric_item.go index 0c7dfbf466..b3c73aee27 100644 --- a/clients/apiclient/model_transaction_id_metric_item.go +++ b/clients/apiclient/model_transaction_id_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_metric_item.go b/clients/apiclient/model_transaction_metric_item.go index 312910c097..3154d81b43 100644 --- a/clients/apiclient/model_transaction_metric_item.go +++ b/clients/apiclient/model_transaction_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg.go b/clients/apiclient/model_tx_inclusion_state_msg.go index 27170d071e..c7ae482a7a 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg.go +++ b/clients/apiclient/model_tx_inclusion_state_msg.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go index 644b228f5f..af4dec6c57 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go +++ b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_password_request.go b/clients/apiclient/model_update_user_password_request.go index 697c84f025..b5ae414d7c 100644 --- a/clients/apiclient/model_update_user_password_request.go +++ b/clients/apiclient/model_update_user_password_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_permissions_request.go b/clients/apiclient/model_update_user_permissions_request.go index fdf5b156f2..4b127bf830 100644 --- a/clients/apiclient/model_update_user_permissions_request.go +++ b/clients/apiclient/model_update_user_permissions_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_user.go b/clients/apiclient/model_user.go index a77ea38d91..c2341646a7 100644 --- a/clients/apiclient/model_user.go +++ b/clients/apiclient/model_user.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_utxo_input_metric_item.go b/clients/apiclient/model_utxo_input_metric_item.go index 975e85998f..58ba0c21e6 100644 --- a/clients/apiclient/model_utxo_input_metric_item.go +++ b/clients/apiclient/model_utxo_input_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_validation_error.go b/clients/apiclient/model_validation_error.go index 9589685f96..318511c473 100644 --- a/clients/apiclient/model_validation_error.go +++ b/clients/apiclient/model_validation_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_version_response.go b/clients/apiclient/model_version_response.go index 024320bd6d..d93aff41a5 100644 --- a/clients/apiclient/model_version_response.go +++ b/clients/apiclient/model_version_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/response.go b/clients/apiclient/response.go index 73b08361ef..7adf029fbb 100644 --- a/clients/apiclient/response.go +++ b/clients/apiclient/response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/utils.go b/clients/apiclient/utils.go index ef5977ec66..05f46b8a02 100644 --- a/clients/apiclient/utils.go +++ b/clients/apiclient/utils.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-14-gbb23763d3 +API version: 0.4.0-alpha.8-16-g83edf92b9 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/multiclient/chain_record.go b/clients/multiclient/chain_record.go index 33e341b9eb..b014091b45 100644 --- a/clients/multiclient/chain_record.go +++ b/clients/multiclient/chain_record.go @@ -10,21 +10,17 @@ import ( // PutChainRecord calls PutChainRecord in all wasp nodes func (m *MultiClient) PutChainRecord(bd *registry.ChainRecord) error { return m.Do(func(i int, w *apiclient.APIClient) error { - // TODO: Validate the replacement logic from PutChainRecord => ActivateChain + AccessNodes - _, err := w.ChainsApi.ActivateChain(context.Background(), bd.ChainID().String()).Execute() + accessNodes := make([]string, len(bd.AccessNodes)) - if err != nil { - return err + for k, v := range bd.AccessNodes { + accessNodes[k] = v.String() } - for _, accessNode := range bd.AccessNodes { - _, err := w.ChainsApi.AddAccessNode(context.Background(), bd.ChainID().String(), accessNode.String()).Execute() + _, err := w.ChainsApi.SetChainRecord(context.Background(), bd.ChainID().String()).ChainRecord(apiclient.ChainRecord{ + IsActive: true, + AccessNodes: accessNodes, + }).Execute() - if err != nil { - return err - } - } - - return nil + return err }) } diff --git a/packages/webapi/api.go b/packages/webapi/api.go index 2e229e2085..d6662e1fbc 100644 --- a/packages/webapi/api.go +++ b/packages/webapi/api.go @@ -27,11 +27,12 @@ import ( func loadControllers(server echoswagger.ApiRoot, mocker *Mocker, controllersToLoad []interfaces.APIController) { for _, controller := range controllersToLoad { - group := server.Group(controller.Name(), "/v2/") + publicGroup := server.Group(controller.Name(), "/") - controller.RegisterPublic(group, mocker) + controller.RegisterPublic(publicGroup, mocker) - adminGroup := group.SetSecurity("Authorization") + adminGroup := server.Group(controller.Name(), "/"). + SetSecurity("Authorization") controller.RegisterAdmin(adminGroup, mocker) } diff --git a/packages/webapi/controllers/chain/controller.go b/packages/webapi/controllers/chain/controller.go index 2d7a51de77..869347048e 100644 --- a/packages/webapi/controllers/chain/controller.go +++ b/packages/webapi/controllers/chain/controller.go @@ -111,6 +111,14 @@ func (c *Controller) RegisterAdmin(adminAPI echoswagger.ApiGroup, mocker interfa SetOperationId("getContracts"). SetSummary("Get all available chain contracts") + adminAPI.POST("chains/:chainID/chainrecord", c.setChainRecord, authentication.ValidatePermissions([]string{permissions.Write})). + AddParamPath("", "chainID", "ChainID (Bech32)"). + AddParamBody(mocker.Get(models.ChainRecord{}), "ChainRecord", "Chain Record", true). + AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). + AddResponse(http.StatusCreated, "Chain record was saved", nil, nil). + SetSummary("Sets the chain record."). + SetOperationId("setChainRecord") + adminAPI.PUT("chains/:chainID/access-node/:publicKey", c.addAccessNode, authentication.ValidatePermissions([]string{permissions.Write})). AddParamPath("", "chainID", "ChainID (Bech32)"). AddParamPath("", "publicKey", "Nodes public key (Hex)"). diff --git a/packages/webapi/controllers/chain/management.go b/packages/webapi/controllers/chain/management.go index d02b3fb0b0..49a656ae9f 100644 --- a/packages/webapi/controllers/chain/management.go +++ b/packages/webapi/controllers/chain/management.go @@ -5,6 +5,10 @@ import ( "github.com/labstack/echo/v4" + "github.com/iotaledger/wasp/packages/cryptolib" + "github.com/iotaledger/wasp/packages/registry" + "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/params" ) @@ -33,3 +37,32 @@ func (c *Controller) deactivateChain(e echo.Context) error { return e.NoContent(http.StatusOK) } + +func (c *Controller) setChainRecord(e echo.Context) error { + chainID, err := params.DecodeChainID(e) + if err != nil { + return err + } + + var request models.ChainRecord + if err := e.Bind(&request); err != nil { + return apierrors.InvalidPropertyError("body", err) + } + + record := registry.NewChainRecord(chainID, request.IsActive, []*cryptolib.PublicKey{}) + + for _, publicKeyStr := range request.AccessNodes { + publicKey, err := cryptolib.NewPublicKeyFromString(publicKeyStr) + if err != nil { + return apierrors.InvalidPropertyError("accessNode", err) + } + + record.AccessNodes = append(record.AccessNodes, publicKey) + } + + if err := c.chainService.SetChainRecord(record); err != nil { + return err + } + + return e.NoContent(http.StatusOK) +} diff --git a/packages/webapi/interfaces/interfaces.go b/packages/webapi/interfaces/interfaces.go index 2675f2cfac..78add2ea27 100644 --- a/packages/webapi/interfaces/interfaces.go +++ b/packages/webapi/interfaces/interfaces.go @@ -31,6 +31,7 @@ type APIController interface { type ChainService interface { ActivateChain(chainID isc.ChainID) error + SetChainRecord(chainRecord *registry.ChainRecord) error DeactivateChain(chainID isc.ChainID) error GetAllChainIDs() ([]isc.ChainID, error) HasChain(chainID isc.ChainID) bool diff --git a/packages/webapi/models/chain.go b/packages/webapi/models/chain.go index 79ae939ab7..2f7600e2ca 100644 --- a/packages/webapi/models/chain.go +++ b/packages/webapi/models/chain.go @@ -101,3 +101,8 @@ func MapChainInfoResponse(chainInfo *dto2.ChainInfo, evmChainID uint16) ChainInf type RequestIDResponse struct { RequestID string `json:"requestId" swagger:"desc(The request ID of the given transaction ID.)"` } + +type ChainRecord struct { + IsActive bool `json:"isActive" swagger:"required"` + AccessNodes []string `json:"accessNodes" swagger:"required"` +} diff --git a/packages/webapi/services/chain.go b/packages/webapi/services/chain.go index 237f8271c6..91906913ea 100644 --- a/packages/webapi/services/chain.go +++ b/packages/webapi/services/chain.go @@ -58,6 +58,49 @@ func (c *ChainService) DeactivateChain(chainID isc.ChainID) error { return c.chainsProvider().Deactivate(chainID) } +func (c *ChainService) SetChainRecord(chainRecord *registry.ChainRecord) error { + err := c.chainRecordRegistryProvider.AddChainRecord(chainRecord) + if err != nil { + return err + } + + storedChainRec, err := c.chainRecordRegistryProvider.ChainRecord(chainRecord.ChainID()) + if err != nil { + return err + } + + if storedChainRec != nil { + _, err = c.chainRecordRegistryProvider.UpdateChainRecord( + chainRecord.ChainID(), + func(rec *registry.ChainRecord) bool { + rec.AccessNodes = chainRecord.AccessNodes + rec.Active = chainRecord.Active + return true + }, + ) + if err != nil { + return err + } + } else { + if err := c.chainRecordRegistryProvider.AddChainRecord(chainRecord); err != nil { + return err + } + } + + // Activate/deactivate the chain accordingly. + if chainRecord.Active { + if err := c.chainsProvider().Activate(chainRecord.ChainID()); err != nil { + return err + } + } else if storedChainRec != nil { + if err := c.chainsProvider().Deactivate(chainRecord.ChainID()); err != nil { + return err + } + } + + return nil +} + func (c *ChainService) HasChain(chainID isc.ChainID) bool { return c.GetChainByID(chainID) != nil } From c18616e5b479f8449e831ccb24b169f815798116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:11:24 +0100 Subject: [PATCH 10/39] Fix uints and block log --- clients/apiclient/api/openapi.yaml | 132 ++--- clients/apiclient/api_corecontracts.go | 16 +- clients/apiclient/docs/BaseToken.md | 10 +- clients/apiclient/docs/Blob.md | 10 +- clients/apiclient/docs/BurnRecord.md | 10 +- clients/apiclient/docs/CallTarget.md | 18 +- .../apiclient/docs/ConsensusPipeMetrics.md | 42 +- .../apiclient/docs/ConsensusWorkflowStatus.md | 8 +- clients/apiclient/docs/CorecontractsApi.md | 16 +- clients/apiclient/docs/GasFeePolicy.md | 10 +- .../apiclient/docs/GovChainInfoResponse.md | 26 +- clients/apiclient/docs/L1Params.md | 10 +- clients/apiclient/docs/MilestoneInfo.md | 16 +- .../docs/NodeConnectionMessageMetrics.md | 8 +- clients/apiclient/docs/Output.md | 10 +- clients/apiclient/docs/PeeringNodeStatus.md | 8 +- .../docs/PeeringNodeStatusResponse.md | 10 +- clients/apiclient/docs/ProtocolParameters.md | 10 +- clients/apiclient/docs/ReceiptError.md | 10 +- clients/apiclient/docs/RentStructure.md | 18 +- clients/apiclient/model_base_token.go | 12 +- clients/apiclient/model_blob.go | 12 +- clients/apiclient/model_burn_record.go | 12 +- clients/apiclient/model_call_target.go | 22 +- .../apiclient/model_consensus_pipe_metrics.go | 52 +- .../model_consensus_workflow_status.go | 12 +- clients/apiclient/model_gas_fee_policy.go | 12 +- .../model_gov_chain_info_response.go | 32 +- clients/apiclient/model_l1_params.go | 12 +- clients/apiclient/model_milestone_info.go | 24 +- .../model_node_connection_message_metrics.go | 12 +- clients/apiclient/model_output.go | 12 +- .../apiclient/model_peering_node_status.go | 12 +- .../model_peering_node_status_response.go | 12 +- .../apiclient/model_protocol_parameters.go | 12 +- clients/apiclient/model_receipt_error.go | 12 +- clients/apiclient/model_rent_structure.go | 22 +- .../apiclient/test/api_corecontracts_test.go | 467 +++++++++--------- clients/apiclient/utils.go | 10 +- tools/wasp-cli/chain/blocklog.go | 11 +- 40 files changed, 591 insertions(+), 591 deletions(-) diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 7024a80583..54577a67ea 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -752,7 +752,7 @@ paths: name: blockIndex required: true schema: - format: int32 + format: uint32 type: integer responses: "200": @@ -786,7 +786,7 @@ paths: name: blockIndex required: true schema: - format: int32 + format: uint32 type: integer responses: "200": @@ -820,7 +820,7 @@ paths: name: blockIndex required: true schema: - format: int32 + format: uint32 type: integer responses: "200": @@ -908,7 +908,7 @@ paths: name: blockIndex required: true schema: - format: int32 + format: uint32 type: integer responses: "200": @@ -2017,7 +2017,7 @@ components: lastMessage: $ref: '#/components/schemas/Output' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2134,7 +2134,7 @@ components: decimals: description: The token decimals example: 6 - format: int32 + format: uint32 type: integer xml: name: Decimals @@ -2193,7 +2193,7 @@ components: xml: name: Hash size: - format: int32 + format: uint32 type: integer xml: name: Size @@ -2210,7 +2210,7 @@ components: properties: fields: additionalProperties: - format: int32 + format: uint32 type: integer type: object xml: @@ -2274,7 +2274,7 @@ components: xml: name: AnchorTransactionID blockIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2295,13 +2295,13 @@ components: xml: name: L1CommitmentHash numOffLedgerRequests: - format: int32 + format: uint32 minimum: 1 type: integer xml: name: NumOffLedgerRequests numSuccessfulRequests: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2322,7 +2322,7 @@ components: xml: name: TotalBaseTokensInL2Accounts totalRequests: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2527,7 +2527,7 @@ components: gasBurned: 5 properties: code: - format: int32 + format: uint32 type: integer xml: name: Code @@ -2548,12 +2548,12 @@ components: entryPoint: 3 properties: contract: - format: int32 + format: uint32 type: integer xml: name: Contract entryPoint: - format: int32 + format: uint32 type: integer xml: name: EntryPoint @@ -2601,7 +2601,7 @@ components: evmChainId: description: The EVM chain ID example: 1074 - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2617,7 +2617,7 @@ components: maxBlobSize: description: The maximum contract blob size. example: 2000000 - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2625,7 +2625,7 @@ components: maxEventSize: description: The maximum event size. example: 2000 - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2633,7 +2633,7 @@ components: maxEventsPerReq: description: The maximum amount of events per request. example: 50 - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -2958,27 +2958,27 @@ components: eventTimerMsgPipeSize: 5 properties: eventACSMsgPipeSize: - format: int32 + format: uint32 type: integer xml: name: EventACSMsgPipeSize eventPeerLogIndexMsgPipeSize: - format: int32 + format: uint32 type: integer xml: name: EventPeerLogIndexMsgPipeSize eventStateTransitionMsgPipeSize: - format: int32 + format: uint32 type: integer xml: name: EventStateTransitionMsgPipeSize eventTimerMsgPipeSize: - format: int32 + format: uint32 type: integer xml: name: EventTimerMsgPipeSize eventVMResultMsgPipeSize: - format: int32 + format: uint32 type: integer xml: name: EventVMResultMsgPipeSize @@ -3014,7 +3014,7 @@ components: properties: currentStateIndex: description: Shows current state index of the consensus - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3245,7 +3245,7 @@ components: description: The hash of the contract. items: example: 193 - format: int32 + format: uint32 type: integer type: array xml: @@ -3271,7 +3271,7 @@ components: xml: name: GoverningAddress sinceBlockIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3317,7 +3317,7 @@ components: name: PeerIdentities wrapped: true peerIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3338,7 +3338,7 @@ components: name: PublicKeyShares wrapped: true threshold: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3371,14 +3371,14 @@ components: wrapped: true threshold: description: Should be =< len(PeerPublicIdentities) - format: int32 + format: uint32 minimum: 1 type: integer xml: name: Threshold timeoutMS: description: Timeout in milliseconds. - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3482,19 +3482,19 @@ components: $ref: '#/components/schemas/gasFeePolicy_' maxBlobSize: description: The maximum contract blob size. - format: int32 + format: uint32 type: integer xml: name: MaxBlobSize maxEventSize: description: The maximum event size. - format: int32 + format: uint32 type: integer xml: name: MaxEventSize maxEventsPerReq: description: The maximum amount of events per request. - format: int32 + format: uint32 type: integer xml: name: MaxEventsPerReq @@ -3543,7 +3543,7 @@ components: lastMessage: $ref: '#/components/schemas/InOutput' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3594,7 +3594,7 @@ components: lastMessage: $ref: '#/components/schemas/InStateOutput' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3680,7 +3680,7 @@ components: xml: name: LastMessage messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -3808,7 +3808,7 @@ components: maxPayloadSize: description: The max payload size example: 32498 - format: int32 + format: uint32 type: integer xml: name: MaxPayloadSize @@ -3870,7 +3870,7 @@ components: timestamp: 5 properties: index: - format: int32 + format: uint32 type: integer xml: name: Index @@ -3880,7 +3880,7 @@ components: xml: name: MilestoneID timestamp: - format: int32 + format: uint32 type: integer xml: name: Timestamp @@ -3899,7 +3899,7 @@ components: lastMessage: $ref: '#/components/schemas/MilestoneInfo' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4105,7 +4105,7 @@ components: lastMessage: $ref: '#/components/schemas/OnLedgerRequest' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4129,7 +4129,7 @@ components: properties: outputType: description: The output type - format: int32 + format: uint32 type: integer xml: name: OutputType @@ -4220,7 +4220,7 @@ components: name: NetID numUsers: description: The amount of users attached to the peer - format: int32 + format: uint32 type: integer xml: name: NumUsers @@ -4266,7 +4266,7 @@ components: name: NetID numUsers: description: The amount of users attached to the peer - format: int32 + format: uint32 type: integer xml: name: NumUsers @@ -4317,7 +4317,7 @@ components: numUsers: description: The amount of users attached to the peer example: 1 - format: int32 + format: uint32 type: integer xml: name: NumUsers @@ -4385,14 +4385,14 @@ components: belowMaxDepth: description: The networks max depth example: 15 - format: int32 + format: uint32 minimum: 1 type: integer xml: name: BelowMaxDepth minPowScore: description: The minimal PoW score - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4416,7 +4416,7 @@ components: version: description: The protocol version example: 2 - format: int32 + format: uint32 type: integer xml: name: Version @@ -4442,7 +4442,7 @@ components: lastMessage: $ref: '#/components/schemas/StateTransaction' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4471,7 +4471,7 @@ components: - parameters properties: contractId: - format: int32 + format: uint32 type: integer xml: name: ContractID @@ -4481,7 +4481,7 @@ components: xml: name: ErrorCode errorId: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4538,7 +4538,7 @@ components: - parameters properties: blockIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4573,7 +4573,7 @@ components: xml: name: Request requestIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4598,7 +4598,7 @@ components: vByteCost: description: The virtual byte cost example: 500 - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4606,14 +4606,14 @@ components: vByteFactorData: description: The virtual byte factor for data fields example: 1 - format: int32 + format: uint32 type: integer xml: name: VBFactorData vByteFactorKey: description: The virtual byte factor for key/lookup generating fields example: 10 - format: int32 + format: uint32 type: integer xml: name: VBFactorKey @@ -4828,7 +4828,7 @@ components: hash: hash properties: blockIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4855,7 +4855,7 @@ components: request: $ref: '#/components/schemas/RequestDetail' requestIndex: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4893,7 +4893,7 @@ components: properties: stateIndex: description: The state index - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4935,7 +4935,7 @@ components: lastMessage: $ref: '#/components/schemas/Transaction' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -4962,7 +4962,7 @@ components: lastMessage: $ref: '#/components/schemas/Transaction' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -5013,7 +5013,7 @@ components: lastMessage: $ref: '#/components/schemas/TxInclusionStateMsg' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -5040,7 +5040,7 @@ components: lastMessage: $ref: '#/components/schemas/OutputID' messages: - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -5170,7 +5170,7 @@ components: name: GasPerToken validatorFeeShare: description: The validator fee share. - format: int32 + format: uint32 minimum: 1 type: integer xml: @@ -5202,7 +5202,7 @@ components: name: GasPerToken validatorFeeShare: description: The validator fee share. - format: int32 + format: uint32 type: integer xml: name: ValidatorFeeShare diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index 00b23ca5e7..e1f3d707bf 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -1280,7 +1280,7 @@ type ApiBlocklogGetBlockInfoRequest struct { ctx context.Context ApiService *CorecontractsApiService chainID string - blockIndex int32 + blockIndex uint32 } func (r ApiBlocklogGetBlockInfoRequest) Execute() (*BlockInfoResponse, *http.Response, error) { @@ -1295,7 +1295,7 @@ BlocklogGetBlockInfo Get the block info of a certain block index @param blockIndex Block Index (uint32) @return ApiBlocklogGetBlockInfoRequest */ -func (a *CorecontractsApiService) BlocklogGetBlockInfo(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetBlockInfoRequest { +func (a *CorecontractsApiService) BlocklogGetBlockInfo(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetBlockInfoRequest { return ApiBlocklogGetBlockInfoRequest{ ApiService: a, ctx: ctx, @@ -1506,7 +1506,7 @@ type ApiBlocklogGetEventsOfBlockRequest struct { ctx context.Context ApiService *CorecontractsApiService chainID string - blockIndex int32 + blockIndex uint32 } func (r ApiBlocklogGetEventsOfBlockRequest) Execute() (*EventsResponse, *http.Response, error) { @@ -1521,7 +1521,7 @@ BlocklogGetEventsOfBlock Get events of a block @param blockIndex Block Index (uint32) @return ApiBlocklogGetEventsOfBlockRequest */ -func (a *CorecontractsApiService) BlocklogGetEventsOfBlock(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetEventsOfBlockRequest { +func (a *CorecontractsApiService) BlocklogGetEventsOfBlock(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetEventsOfBlockRequest { return ApiBlocklogGetEventsOfBlockRequest{ ApiService: a, ctx: ctx, @@ -2073,7 +2073,7 @@ type ApiBlocklogGetRequestIDsForBlockRequest struct { ctx context.Context ApiService *CorecontractsApiService chainID string - blockIndex int32 + blockIndex uint32 } func (r ApiBlocklogGetRequestIDsForBlockRequest) Execute() (*RequestIDsResponse, *http.Response, error) { @@ -2088,7 +2088,7 @@ BlocklogGetRequestIDsForBlock Get the request ids for a certain block index @param blockIndex Block Index (uint32) @return ApiBlocklogGetRequestIDsForBlockRequest */ -func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlock(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetRequestIDsForBlockRequest { +func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlock(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetRequestIDsForBlockRequest { return ApiBlocklogGetRequestIDsForBlockRequest{ ApiService: a, ctx: ctx, @@ -2529,7 +2529,7 @@ type ApiBlocklogGetRequestReceiptsOfBlockRequest struct { ctx context.Context ApiService *CorecontractsApiService chainID string - blockIndex int32 + blockIndex uint32 } func (r ApiBlocklogGetRequestReceiptsOfBlockRequest) Execute() (*BlockReceiptsResponse, *http.Response, error) { @@ -2544,7 +2544,7 @@ BlocklogGetRequestReceiptsOfBlock Get all receipts of a certain block @param blockIndex Block Index (uint32) @return ApiBlocklogGetRequestReceiptsOfBlockRequest */ -func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlock(ctx context.Context, chainID string, blockIndex int32) ApiBlocklogGetRequestReceiptsOfBlockRequest { +func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlock(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetRequestReceiptsOfBlockRequest { return ApiBlocklogGetRequestReceiptsOfBlockRequest{ ApiService: a, ctx: ctx, diff --git a/clients/apiclient/docs/BaseToken.md b/clients/apiclient/docs/BaseToken.md index dddf71612e..791dfd8d24 100644 --- a/clients/apiclient/docs/BaseToken.md +++ b/clients/apiclient/docs/BaseToken.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Decimals** | **int32** | The token decimals | +**Decimals** | **uint32** | The token decimals | **Name** | **string** | The base token name | **Subunit** | **string** | The token subunit | **TickerSymbol** | **string** | The ticker symbol | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewBaseToken -`func NewBaseToken(decimals int32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool, ) *BaseToken` +`func NewBaseToken(decimals uint32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool, ) *BaseToken` NewBaseToken instantiates a new BaseToken object This constructor will assign default values to properties that have it defined, @@ -32,20 +32,20 @@ but it doesn't guarantee that properties required by API are set ### GetDecimals -`func (o *BaseToken) GetDecimals() int32` +`func (o *BaseToken) GetDecimals() uint32` GetDecimals returns the Decimals field if non-nil, zero value otherwise. ### GetDecimalsOk -`func (o *BaseToken) GetDecimalsOk() (*int32, bool)` +`func (o *BaseToken) GetDecimalsOk() (*uint32, bool)` GetDecimalsOk returns a tuple with the Decimals field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDecimals -`func (o *BaseToken) SetDecimals(v int32)` +`func (o *BaseToken) SetDecimals(v uint32)` SetDecimals sets Decimals field to given value. diff --git a/clients/apiclient/docs/Blob.md b/clients/apiclient/docs/Blob.md index 6cd815d639..9c8f28c2a6 100644 --- a/clients/apiclient/docs/Blob.md +++ b/clients/apiclient/docs/Blob.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Hash** | **string** | | -**Size** | **int32** | | +**Size** | **uint32** | | ## Methods ### NewBlob -`func NewBlob(hash string, size int32, ) *Blob` +`func NewBlob(hash string, size uint32, ) *Blob` NewBlob instantiates a new Blob object This constructor will assign default values to properties that have it defined, @@ -48,20 +48,20 @@ SetHash sets Hash field to given value. ### GetSize -`func (o *Blob) GetSize() int32` +`func (o *Blob) GetSize() uint32` GetSize returns the Size field if non-nil, zero value otherwise. ### GetSizeOk -`func (o *Blob) GetSizeOk() (*int32, bool)` +`func (o *Blob) GetSizeOk() (*uint32, bool)` GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSize -`func (o *Blob) SetSize(v int32)` +`func (o *Blob) SetSize(v uint32)` SetSize sets Size field to given value. diff --git a/clients/apiclient/docs/BurnRecord.md b/clients/apiclient/docs/BurnRecord.md index 840ebc129b..77ca3605d5 100644 --- a/clients/apiclient/docs/BurnRecord.md +++ b/clients/apiclient/docs/BurnRecord.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int32** | | +**Code** | **uint32** | | **GasBurned** | **int64** | | ## Methods ### NewBurnRecord -`func NewBurnRecord(code int32, gasBurned int64, ) *BurnRecord` +`func NewBurnRecord(code uint32, gasBurned int64, ) *BurnRecord` NewBurnRecord instantiates a new BurnRecord object This constructor will assign default values to properties that have it defined, @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetCode -`func (o *BurnRecord) GetCode() int32` +`func (o *BurnRecord) GetCode() uint32` GetCode returns the Code field if non-nil, zero value otherwise. ### GetCodeOk -`func (o *BurnRecord) GetCodeOk() (*int32, bool)` +`func (o *BurnRecord) GetCodeOk() (*uint32, bool)` GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCode -`func (o *BurnRecord) SetCode(v int32)` +`func (o *BurnRecord) SetCode(v uint32)` SetCode sets Code field to given value. diff --git a/clients/apiclient/docs/CallTarget.md b/clients/apiclient/docs/CallTarget.md index ded8ac46dd..0a554b2550 100644 --- a/clients/apiclient/docs/CallTarget.md +++ b/clients/apiclient/docs/CallTarget.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Contract** | **int32** | | -**EntryPoint** | **int32** | | +**Contract** | **uint32** | | +**EntryPoint** | **uint32** | | ## Methods ### NewCallTarget -`func NewCallTarget(contract int32, entryPoint int32, ) *CallTarget` +`func NewCallTarget(contract uint32, entryPoint uint32, ) *CallTarget` NewCallTarget instantiates a new CallTarget object This constructor will assign default values to properties that have it defined, @@ -28,40 +28,40 @@ but it doesn't guarantee that properties required by API are set ### GetContract -`func (o *CallTarget) GetContract() int32` +`func (o *CallTarget) GetContract() uint32` GetContract returns the Contract field if non-nil, zero value otherwise. ### GetContractOk -`func (o *CallTarget) GetContractOk() (*int32, bool)` +`func (o *CallTarget) GetContractOk() (*uint32, bool)` GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetContract -`func (o *CallTarget) SetContract(v int32)` +`func (o *CallTarget) SetContract(v uint32)` SetContract sets Contract field to given value. ### GetEntryPoint -`func (o *CallTarget) GetEntryPoint() int32` +`func (o *CallTarget) GetEntryPoint() uint32` GetEntryPoint returns the EntryPoint field if non-nil, zero value otherwise. ### GetEntryPointOk -`func (o *CallTarget) GetEntryPointOk() (*int32, bool)` +`func (o *CallTarget) GetEntryPointOk() (*uint32, bool)` GetEntryPointOk returns a tuple with the EntryPoint field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEntryPoint -`func (o *CallTarget) SetEntryPoint(v int32)` +`func (o *CallTarget) SetEntryPoint(v uint32)` SetEntryPoint sets EntryPoint field to given value. diff --git a/clients/apiclient/docs/ConsensusPipeMetrics.md b/clients/apiclient/docs/ConsensusPipeMetrics.md index d2db03e462..5f1a26cff4 100644 --- a/clients/apiclient/docs/ConsensusPipeMetrics.md +++ b/clients/apiclient/docs/ConsensusPipeMetrics.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EventACSMsgPipeSize** | **int32** | | -**EventPeerLogIndexMsgPipeSize** | **int32** | | -**EventStateTransitionMsgPipeSize** | **int32** | | -**EventTimerMsgPipeSize** | **int32** | | -**EventVMResultMsgPipeSize** | **int32** | | +**EventACSMsgPipeSize** | **uint32** | | +**EventPeerLogIndexMsgPipeSize** | **uint32** | | +**EventStateTransitionMsgPipeSize** | **uint32** | | +**EventTimerMsgPipeSize** | **uint32** | | +**EventVMResultMsgPipeSize** | **uint32** | | ## Methods ### NewConsensusPipeMetrics -`func NewConsensusPipeMetrics(eventACSMsgPipeSize int32, eventPeerLogIndexMsgPipeSize int32, eventStateTransitionMsgPipeSize int32, eventTimerMsgPipeSize int32, eventVMResultMsgPipeSize int32, ) *ConsensusPipeMetrics` +`func NewConsensusPipeMetrics(eventACSMsgPipeSize uint32, eventPeerLogIndexMsgPipeSize uint32, eventStateTransitionMsgPipeSize uint32, eventTimerMsgPipeSize uint32, eventVMResultMsgPipeSize uint32, ) *ConsensusPipeMetrics` NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object This constructor will assign default values to properties that have it defined, @@ -31,100 +31,100 @@ but it doesn't guarantee that properties required by API are set ### GetEventACSMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32` +`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() uint32` GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field if non-nil, zero value otherwise. ### GetEventACSMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool)` +`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*uint32, bool)` GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventACSMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32)` +`func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v uint32)` SetEventACSMsgPipeSize sets EventACSMsgPipeSize field to given value. ### GetEventPeerLogIndexMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32` +`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() uint32` GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field if non-nil, zero value otherwise. ### GetEventPeerLogIndexMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool)` +`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*uint32, bool)` GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventPeerLogIndexMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32)` +`func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v uint32)` SetEventPeerLogIndexMsgPipeSize sets EventPeerLogIndexMsgPipeSize field to given value. ### GetEventStateTransitionMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32` +`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() uint32` GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field if non-nil, zero value otherwise. ### GetEventStateTransitionMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool)` +`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*uint32, bool)` GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventStateTransitionMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32)` +`func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v uint32)` SetEventStateTransitionMsgPipeSize sets EventStateTransitionMsgPipeSize field to given value. ### GetEventTimerMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32` +`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() uint32` GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field if non-nil, zero value otherwise. ### GetEventTimerMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool)` +`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*uint32, bool)` GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventTimerMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32)` +`func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v uint32)` SetEventTimerMsgPipeSize sets EventTimerMsgPipeSize field to given value. ### GetEventVMResultMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32` +`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() uint32` GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field if non-nil, zero value otherwise. ### GetEventVMResultMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool)` +`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*uint32, bool)` GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventVMResultMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32)` +`func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v uint32)` SetEventVMResultMsgPipeSize sets EventVMResultMsgPipeSize field to given value. diff --git a/clients/apiclient/docs/ConsensusWorkflowStatus.md b/clients/apiclient/docs/ConsensusWorkflowStatus.md index 3b6232aadf..bf51254bfb 100644 --- a/clients/apiclient/docs/ConsensusWorkflowStatus.md +++ b/clients/apiclient/docs/ConsensusWorkflowStatus.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**CurrentStateIndex** | Pointer to **int32** | Shows current state index of the consensus | [optional] +**CurrentStateIndex** | Pointer to **uint32** | Shows current state index of the consensus | [optional] **FlagBatchProposalSent** | Pointer to **bool** | Shows if batch proposal is sent out in current consensus iteration | [optional] **FlagConsensusBatchKnown** | Pointer to **bool** | Shows if consensus on batch is reached and known in current consensus iteration | [optional] **FlagInProgress** | Pointer to **bool** | Shows if consensus algorithm is still not completed in current consensus iteration | [optional] @@ -44,20 +44,20 @@ but it doesn't guarantee that properties required by API are set ### GetCurrentStateIndex -`func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() int32` +`func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() uint32` GetCurrentStateIndex returns the CurrentStateIndex field if non-nil, zero value otherwise. ### GetCurrentStateIndexOk -`func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*int32, bool)` +`func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*uint32, bool)` GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCurrentStateIndex -`func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v int32)` +`func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v uint32)` SetCurrentStateIndex sets CurrentStateIndex field to given value. diff --git a/clients/apiclient/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md index ed217e9dd4..a02f124e0b 100644 --- a/clients/apiclient/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -825,7 +825,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := int32(56) // int32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | Block Index (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -846,7 +846,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **int32** | Block Index (uint32) | +**blockIndex** | **uint32** | Block Index (uint32) | ### Other Parameters @@ -964,7 +964,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := int32(56) // int32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | Block Index (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -985,7 +985,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **int32** | Block Index (uint32) | +**blockIndex** | **uint32** | Block Index (uint32) | ### Other Parameters @@ -1313,7 +1313,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := int32(56) // int32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | Block Index (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1334,7 +1334,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **int32** | Block Index (uint32) | +**blockIndex** | **uint32** | Block Index (uint32) | ### Other Parameters @@ -1594,7 +1594,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := int32(56) // int32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | Block Index (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1615,7 +1615,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **int32** | Block Index (uint32) | +**blockIndex** | **uint32** | Block Index (uint32) | ### Other Parameters diff --git a/clients/apiclient/docs/GasFeePolicy.md b/clients/apiclient/docs/GasFeePolicy.md index e5338a955e..dd4a05df43 100644 --- a/clients/apiclient/docs/GasFeePolicy.md +++ b/clients/apiclient/docs/GasFeePolicy.md @@ -6,13 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **GasFeeTokenId** | **string** | The gas fee token id. Empty if base token. | **GasPerToken** | **int64** | The amount of gas per token. | -**ValidatorFeeShare** | **int32** | The validator fee share. | +**ValidatorFeeShare** | **uint32** | The validator fee share. | ## Methods ### NewGasFeePolicy -`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32, ) *GasFeePolicy` +`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare uint32, ) *GasFeePolicy` NewGasFeePolicy instantiates a new GasFeePolicy object This constructor will assign default values to properties that have it defined, @@ -69,20 +69,20 @@ SetGasPerToken sets GasPerToken field to given value. ### GetValidatorFeeShare -`func (o *GasFeePolicy) GetValidatorFeeShare() int32` +`func (o *GasFeePolicy) GetValidatorFeeShare() uint32` GetValidatorFeeShare returns the ValidatorFeeShare field if non-nil, zero value otherwise. ### GetValidatorFeeShareOk -`func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool)` +`func (o *GasFeePolicy) GetValidatorFeeShareOk() (*uint32, bool)` GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetValidatorFeeShare -`func (o *GasFeePolicy) SetValidatorFeeShare(v int32)` +`func (o *GasFeePolicy) SetValidatorFeeShare(v uint32)` SetValidatorFeeShare sets ValidatorFeeShare field to given value. diff --git a/clients/apiclient/docs/GovChainInfoResponse.md b/clients/apiclient/docs/GovChainInfoResponse.md index 6da5bf797e..48a4b41f1e 100644 --- a/clients/apiclient/docs/GovChainInfoResponse.md +++ b/clients/apiclient/docs/GovChainInfoResponse.md @@ -8,15 +8,15 @@ Name | Type | Description | Notes **ChainOwnerId** | **string** | The chain owner address (Bech32-encoded). | **Description** | **string** | The description of the chain. | **GasFeePolicy** | [**GasFeePolicy**](GasFeePolicy.md) | | -**MaxBlobSize** | **int32** | The maximum contract blob size. | -**MaxEventSize** | **int32** | The maximum event size. | -**MaxEventsPerReq** | **int32** | The maximum amount of events per request. | +**MaxBlobSize** | **uint32** | The maximum contract blob size. | +**MaxEventSize** | **uint32** | The maximum event size. | +**MaxEventsPerReq** | **uint32** | The maximum amount of events per request. | ## Methods ### NewGovChainInfoResponse -`func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize int32, maxEventSize int32, maxEventsPerReq int32, ) *GovChainInfoResponse` +`func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize uint32, maxEventSize uint32, maxEventsPerReq uint32, ) *GovChainInfoResponse` NewGovChainInfoResponse instantiates a new GovChainInfoResponse object This constructor will assign default values to properties that have it defined, @@ -113,60 +113,60 @@ SetGasFeePolicy sets GasFeePolicy field to given value. ### GetMaxBlobSize -`func (o *GovChainInfoResponse) GetMaxBlobSize() int32` +`func (o *GovChainInfoResponse) GetMaxBlobSize() uint32` GetMaxBlobSize returns the MaxBlobSize field if non-nil, zero value otherwise. ### GetMaxBlobSizeOk -`func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool)` +`func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool)` GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxBlobSize -`func (o *GovChainInfoResponse) SetMaxBlobSize(v int32)` +`func (o *GovChainInfoResponse) SetMaxBlobSize(v uint32)` SetMaxBlobSize sets MaxBlobSize field to given value. ### GetMaxEventSize -`func (o *GovChainInfoResponse) GetMaxEventSize() int32` +`func (o *GovChainInfoResponse) GetMaxEventSize() uint32` GetMaxEventSize returns the MaxEventSize field if non-nil, zero value otherwise. ### GetMaxEventSizeOk -`func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool)` +`func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool)` GetMaxEventSizeOk returns a tuple with the MaxEventSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxEventSize -`func (o *GovChainInfoResponse) SetMaxEventSize(v int32)` +`func (o *GovChainInfoResponse) SetMaxEventSize(v uint32)` SetMaxEventSize sets MaxEventSize field to given value. ### GetMaxEventsPerReq -`func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32` +`func (o *GovChainInfoResponse) GetMaxEventsPerReq() uint32` GetMaxEventsPerReq returns the MaxEventsPerReq field if non-nil, zero value otherwise. ### GetMaxEventsPerReqOk -`func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool)` +`func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool)` GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxEventsPerReq -`func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32)` +`func (o *GovChainInfoResponse) SetMaxEventsPerReq(v uint32)` SetMaxEventsPerReq sets MaxEventsPerReq field to given value. diff --git a/clients/apiclient/docs/L1Params.md b/clients/apiclient/docs/L1Params.md index 021891ba0b..00001fec68 100644 --- a/clients/apiclient/docs/L1Params.md +++ b/clients/apiclient/docs/L1Params.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BaseToken** | [**BaseToken**](BaseToken.md) | | -**MaxPayloadSize** | **int32** | The max payload size | +**MaxPayloadSize** | **uint32** | The max payload size | **Protocol** | [**ProtocolParameters**](ProtocolParameters.md) | | ## Methods ### NewL1Params -`func NewL1Params(baseToken BaseToken, maxPayloadSize int32, protocol ProtocolParameters, ) *L1Params` +`func NewL1Params(baseToken BaseToken, maxPayloadSize uint32, protocol ProtocolParameters, ) *L1Params` NewL1Params instantiates a new L1Params object This constructor will assign default values to properties that have it defined, @@ -49,20 +49,20 @@ SetBaseToken sets BaseToken field to given value. ### GetMaxPayloadSize -`func (o *L1Params) GetMaxPayloadSize() int32` +`func (o *L1Params) GetMaxPayloadSize() uint32` GetMaxPayloadSize returns the MaxPayloadSize field if non-nil, zero value otherwise. ### GetMaxPayloadSizeOk -`func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool)` +`func (o *L1Params) GetMaxPayloadSizeOk() (*uint32, bool)` GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxPayloadSize -`func (o *L1Params) SetMaxPayloadSize(v int32)` +`func (o *L1Params) SetMaxPayloadSize(v uint32)` SetMaxPayloadSize sets MaxPayloadSize field to given value. diff --git a/clients/apiclient/docs/MilestoneInfo.md b/clients/apiclient/docs/MilestoneInfo.md index c2845fce4b..657d661fca 100644 --- a/clients/apiclient/docs/MilestoneInfo.md +++ b/clients/apiclient/docs/MilestoneInfo.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Index** | Pointer to **int32** | | [optional] +**Index** | Pointer to **uint32** | | [optional] **MilestoneId** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **uint32** | | [optional] ## Methods @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetIndex -`func (o *MilestoneInfo) GetIndex() int32` +`func (o *MilestoneInfo) GetIndex() uint32` GetIndex returns the Index field if non-nil, zero value otherwise. ### GetIndexOk -`func (o *MilestoneInfo) GetIndexOk() (*int32, bool)` +`func (o *MilestoneInfo) GetIndexOk() (*uint32, bool)` GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetIndex -`func (o *MilestoneInfo) SetIndex(v int32)` +`func (o *MilestoneInfo) SetIndex(v uint32)` SetIndex sets Index field to given value. @@ -79,20 +79,20 @@ HasMilestoneId returns a boolean if a field has been set. ### GetTimestamp -`func (o *MilestoneInfo) GetTimestamp() int32` +`func (o *MilestoneInfo) GetTimestamp() uint32` GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. ### GetTimestampOk -`func (o *MilestoneInfo) GetTimestampOk() (*int32, bool)` +`func (o *MilestoneInfo) GetTimestampOk() (*uint32, bool)` GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimestamp -`func (o *MilestoneInfo) SetTimestamp(v int32)` +`func (o *MilestoneInfo) SetTimestamp(v uint32)` SetTimestamp sets Timestamp field to given value. diff --git a/clients/apiclient/docs/NodeConnectionMessageMetrics.md b/clients/apiclient/docs/NodeConnectionMessageMetrics.md index e284226063..e132d98041 100644 --- a/clients/apiclient/docs/NodeConnectionMessageMetrics.md +++ b/clients/apiclient/docs/NodeConnectionMessageMetrics.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **LastEvent** | Pointer to **time.Time** | Last time the message was sent/received | [optional] **LastMessage** | Pointer to **string** | The print out of the last message | [optional] -**Total** | Pointer to **int32** | Total number of messages sent/received | [optional] +**Total** | Pointer to **uint32** | Total number of messages sent/received | [optional] ## Methods @@ -79,20 +79,20 @@ HasLastMessage returns a boolean if a field has been set. ### GetTotal -`func (o *NodeConnectionMessageMetrics) GetTotal() int32` +`func (o *NodeConnectionMessageMetrics) GetTotal() uint32` GetTotal returns the Total field if non-nil, zero value otherwise. ### GetTotalOk -`func (o *NodeConnectionMessageMetrics) GetTotalOk() (*int32, bool)` +`func (o *NodeConnectionMessageMetrics) GetTotalOk() (*uint32, bool)` GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTotal -`func (o *NodeConnectionMessageMetrics) SetTotal(v int32)` +`func (o *NodeConnectionMessageMetrics) SetTotal(v uint32)` SetTotal sets Total field to given value. diff --git a/clients/apiclient/docs/Output.md b/clients/apiclient/docs/Output.md index 669acce103..f59165ac4e 100644 --- a/clients/apiclient/docs/Output.md +++ b/clients/apiclient/docs/Output.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**OutputType** | **int32** | The output type | +**OutputType** | **uint32** | The output type | **Raw** | **string** | The raw data of the output (Hex) | ## Methods ### NewOutput -`func NewOutput(outputType int32, raw string, ) *Output` +`func NewOutput(outputType uint32, raw string, ) *Output` NewOutput instantiates a new Output object This constructor will assign default values to properties that have it defined, @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetOutputType -`func (o *Output) GetOutputType() int32` +`func (o *Output) GetOutputType() uint32` GetOutputType returns the OutputType field if non-nil, zero value otherwise. ### GetOutputTypeOk -`func (o *Output) GetOutputTypeOk() (*int32, bool)` +`func (o *Output) GetOutputTypeOk() (*uint32, bool)` GetOutputTypeOk returns a tuple with the OutputType field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetOutputType -`func (o *Output) SetOutputType(v int32)` +`func (o *Output) SetOutputType(v uint32)` SetOutputType sets OutputType field to given value. diff --git a/clients/apiclient/docs/PeeringNodeStatus.md b/clients/apiclient/docs/PeeringNodeStatus.md index e5821ca4c8..d2c7252ac1 100644 --- a/clients/apiclient/docs/PeeringNodeStatus.md +++ b/clients/apiclient/docs/PeeringNodeStatus.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **IsAlive** | Pointer to **bool** | | [optional] **NetID** | Pointer to **string** | | [optional] -**NumUsers** | Pointer to **int32** | | [optional] +**NumUsers** | Pointer to **uint32** | | [optional] **PubKey** | Pointer to **string** | | [optional] ## Methods @@ -80,20 +80,20 @@ HasNetID returns a boolean if a field has been set. ### GetNumUsers -`func (o *PeeringNodeStatus) GetNumUsers() int32` +`func (o *PeeringNodeStatus) GetNumUsers() uint32` GetNumUsers returns the NumUsers field if non-nil, zero value otherwise. ### GetNumUsersOk -`func (o *PeeringNodeStatus) GetNumUsersOk() (*int32, bool)` +`func (o *PeeringNodeStatus) GetNumUsersOk() (*uint32, bool)` GetNumUsersOk returns a tuple with the NumUsers field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNumUsers -`func (o *PeeringNodeStatus) SetNumUsers(v int32)` +`func (o *PeeringNodeStatus) SetNumUsers(v uint32)` SetNumUsers sets NumUsers field to given value. diff --git a/clients/apiclient/docs/PeeringNodeStatusResponse.md b/clients/apiclient/docs/PeeringNodeStatusResponse.md index 69423b3092..1d973dd9aa 100644 --- a/clients/apiclient/docs/PeeringNodeStatusResponse.md +++ b/clients/apiclient/docs/PeeringNodeStatusResponse.md @@ -7,14 +7,14 @@ Name | Type | Description | Notes **IsAlive** | **bool** | Whether or not the peer is activated | **IsTrusted** | **bool** | | **NetId** | **string** | The NetID of the peer | -**NumUsers** | **int32** | The amount of users attached to the peer | +**NumUsers** | **uint32** | The amount of users attached to the peer | **PublicKey** | **string** | The peers public key encoded in Hex | ## Methods ### NewPeeringNodeStatusResponse -`func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers int32, publicKey string, ) *PeeringNodeStatusResponse` +`func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers uint32, publicKey string, ) *PeeringNodeStatusResponse` NewPeeringNodeStatusResponse instantiates a new PeeringNodeStatusResponse object This constructor will assign default values to properties that have it defined, @@ -91,20 +91,20 @@ SetNetId sets NetId field to given value. ### GetNumUsers -`func (o *PeeringNodeStatusResponse) GetNumUsers() int32` +`func (o *PeeringNodeStatusResponse) GetNumUsers() uint32` GetNumUsers returns the NumUsers field if non-nil, zero value otherwise. ### GetNumUsersOk -`func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool)` +`func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*uint32, bool)` GetNumUsersOk returns a tuple with the NumUsers field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNumUsers -`func (o *PeeringNodeStatusResponse) SetNumUsers(v int32)` +`func (o *PeeringNodeStatusResponse) SetNumUsers(v uint32)` SetNumUsers sets NumUsers field to given value. diff --git a/clients/apiclient/docs/ProtocolParameters.md b/clients/apiclient/docs/ProtocolParameters.md index 14141e5189..9ec0fa1f90 100644 --- a/clients/apiclient/docs/ProtocolParameters.md +++ b/clients/apiclient/docs/ProtocolParameters.md @@ -10,13 +10,13 @@ Name | Type | Description | Notes **NetworkName** | **string** | The network name | **RentStructure** | [**RentStructure**](RentStructure.md) | | **TokenSupply** | **string** | The token supply | -**Version** | **int32** | The protocol version | +**Version** | **uint32** | The protocol version | ## Methods ### NewProtocolParameters -`func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version int32, ) *ProtocolParameters` +`func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version uint32, ) *ProtocolParameters` NewProtocolParameters instantiates a new ProtocolParameters object This constructor will assign default values to properties that have it defined, @@ -153,20 +153,20 @@ SetTokenSupply sets TokenSupply field to given value. ### GetVersion -`func (o *ProtocolParameters) GetVersion() int32` +`func (o *ProtocolParameters) GetVersion() uint32` GetVersion returns the Version field if non-nil, zero value otherwise. ### GetVersionOk -`func (o *ProtocolParameters) GetVersionOk() (*int32, bool)` +`func (o *ProtocolParameters) GetVersionOk() (*uint32, bool)` GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVersion -`func (o *ProtocolParameters) SetVersion(v int32)` +`func (o *ProtocolParameters) SetVersion(v uint32)` SetVersion sets Version field to given value. diff --git a/clients/apiclient/docs/ReceiptError.md b/clients/apiclient/docs/ReceiptError.md index 960d58339d..35eda41d79 100644 --- a/clients/apiclient/docs/ReceiptError.md +++ b/clients/apiclient/docs/ReceiptError.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ContractId** | **int32** | | +**ContractId** | **uint32** | | **ErrorCode** | **string** | | **ErrorId** | **uint32** | | **Message** | **string** | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewReceiptError -`func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` +`func NewReceiptError(contractId uint32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` NewReceiptError instantiates a new ReceiptError object This constructor will assign default values to properties that have it defined, @@ -32,20 +32,20 @@ but it doesn't guarantee that properties required by API are set ### GetContractId -`func (o *ReceiptError) GetContractId() int32` +`func (o *ReceiptError) GetContractId() uint32` GetContractId returns the ContractId field if non-nil, zero value otherwise. ### GetContractIdOk -`func (o *ReceiptError) GetContractIdOk() (*int32, bool)` +`func (o *ReceiptError) GetContractIdOk() (*uint32, bool)` GetContractIdOk returns a tuple with the ContractId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetContractId -`func (o *ReceiptError) SetContractId(v int32)` +`func (o *ReceiptError) SetContractId(v uint32)` SetContractId sets ContractId field to given value. diff --git a/clients/apiclient/docs/RentStructure.md b/clients/apiclient/docs/RentStructure.md index 6c15d4dc9d..f52588708d 100644 --- a/clients/apiclient/docs/RentStructure.md +++ b/clients/apiclient/docs/RentStructure.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **VByteCost** | **uint32** | The virtual byte cost | -**VByteFactorData** | **int32** | The virtual byte factor for data fields | -**VByteFactorKey** | **int32** | The virtual byte factor for key/lookup generating fields | +**VByteFactorData** | **uint32** | The virtual byte factor for data fields | +**VByteFactorKey** | **uint32** | The virtual byte factor for key/lookup generating fields | ## Methods ### NewRentStructure -`func NewRentStructure(vByteCost uint32, vByteFactorData int32, vByteFactorKey int32, ) *RentStructure` +`func NewRentStructure(vByteCost uint32, vByteFactorData uint32, vByteFactorKey uint32, ) *RentStructure` NewRentStructure instantiates a new RentStructure object This constructor will assign default values to properties that have it defined, @@ -49,40 +49,40 @@ SetVByteCost sets VByteCost field to given value. ### GetVByteFactorData -`func (o *RentStructure) GetVByteFactorData() int32` +`func (o *RentStructure) GetVByteFactorData() uint32` GetVByteFactorData returns the VByteFactorData field if non-nil, zero value otherwise. ### GetVByteFactorDataOk -`func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool)` +`func (o *RentStructure) GetVByteFactorDataOk() (*uint32, bool)` GetVByteFactorDataOk returns a tuple with the VByteFactorData field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVByteFactorData -`func (o *RentStructure) SetVByteFactorData(v int32)` +`func (o *RentStructure) SetVByteFactorData(v uint32)` SetVByteFactorData sets VByteFactorData field to given value. ### GetVByteFactorKey -`func (o *RentStructure) GetVByteFactorKey() int32` +`func (o *RentStructure) GetVByteFactorKey() uint32` GetVByteFactorKey returns the VByteFactorKey field if non-nil, zero value otherwise. ### GetVByteFactorKeyOk -`func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool)` +`func (o *RentStructure) GetVByteFactorKeyOk() (*uint32, bool)` GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVByteFactorKey -`func (o *RentStructure) SetVByteFactorKey(v int32)` +`func (o *RentStructure) SetVByteFactorKey(v uint32)` SetVByteFactorKey sets VByteFactorKey field to given value. diff --git a/clients/apiclient/model_base_token.go b/clients/apiclient/model_base_token.go index 58f84a53b6..a5da717f10 100644 --- a/clients/apiclient/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -20,7 +20,7 @@ var _ MappedNullable = &BaseToken{} // BaseToken struct for BaseToken type BaseToken struct { // The token decimals - Decimals int32 `json:"decimals"` + Decimals uint32 `json:"decimals"` // The base token name Name string `json:"name"` // The token subunit @@ -37,7 +37,7 @@ type BaseToken struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBaseToken(decimals int32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool) *BaseToken { +func NewBaseToken(decimals uint32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool) *BaseToken { this := BaseToken{} this.Decimals = decimals this.Name = name @@ -57,9 +57,9 @@ func NewBaseTokenWithDefaults() *BaseToken { } // GetDecimals returns the Decimals field value -func (o *BaseToken) GetDecimals() int32 { +func (o *BaseToken) GetDecimals() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -68,7 +68,7 @@ func (o *BaseToken) GetDecimals() int32 { // GetDecimalsOk returns a tuple with the Decimals field value // and a boolean to check if the value has been set. -func (o *BaseToken) GetDecimalsOk() (*int32, bool) { +func (o *BaseToken) GetDecimalsOk() (*uint32, bool) { if o == nil { return nil, false } @@ -76,7 +76,7 @@ func (o *BaseToken) GetDecimalsOk() (*int32, bool) { } // SetDecimals sets field value -func (o *BaseToken) SetDecimals(v int32) { +func (o *BaseToken) SetDecimals(v uint32) { o.Decimals = v } diff --git a/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index 280feb3d1a..405eafc6f7 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -20,14 +20,14 @@ var _ MappedNullable = &Blob{} // Blob struct for Blob type Blob struct { Hash string `json:"hash"` - Size int32 `json:"size"` + Size uint32 `json:"size"` } // NewBlob instantiates a new Blob object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlob(hash string, size int32) *Blob { +func NewBlob(hash string, size uint32) *Blob { this := Blob{} this.Hash = hash this.Size = size @@ -67,9 +67,9 @@ func (o *Blob) SetHash(v string) { } // GetSize returns the Size field value -func (o *Blob) GetSize() int32 { +func (o *Blob) GetSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -78,7 +78,7 @@ func (o *Blob) GetSize() int32 { // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. -func (o *Blob) GetSizeOk() (*int32, bool) { +func (o *Blob) GetSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -86,7 +86,7 @@ func (o *Blob) GetSizeOk() (*int32, bool) { } // SetSize sets field value -func (o *Blob) SetSize(v int32) { +func (o *Blob) SetSize(v uint32) { o.Size = v } diff --git a/clients/apiclient/model_burn_record.go b/clients/apiclient/model_burn_record.go index f176a01ee3..71100e8940 100644 --- a/clients/apiclient/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -19,7 +19,7 @@ var _ MappedNullable = &BurnRecord{} // BurnRecord struct for BurnRecord type BurnRecord struct { - Code int32 `json:"code"` + Code uint32 `json:"code"` GasBurned int64 `json:"gasBurned"` } @@ -27,7 +27,7 @@ type BurnRecord struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBurnRecord(code int32, gasBurned int64) *BurnRecord { +func NewBurnRecord(code uint32, gasBurned int64) *BurnRecord { this := BurnRecord{} this.Code = code this.GasBurned = gasBurned @@ -43,9 +43,9 @@ func NewBurnRecordWithDefaults() *BurnRecord { } // GetCode returns the Code field value -func (o *BurnRecord) GetCode() int32 { +func (o *BurnRecord) GetCode() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -54,7 +54,7 @@ func (o *BurnRecord) GetCode() int32 { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. -func (o *BurnRecord) GetCodeOk() (*int32, bool) { +func (o *BurnRecord) GetCodeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -62,7 +62,7 @@ func (o *BurnRecord) GetCodeOk() (*int32, bool) { } // SetCode sets field value -func (o *BurnRecord) SetCode(v int32) { +func (o *BurnRecord) SetCode(v uint32) { o.Code = v } diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index 747a123778..04a9c38b82 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -19,15 +19,15 @@ var _ MappedNullable = &CallTarget{} // CallTarget struct for CallTarget type CallTarget struct { - Contract int32 `json:"contract"` - EntryPoint int32 `json:"entryPoint"` + Contract uint32 `json:"contract"` + EntryPoint uint32 `json:"entryPoint"` } // NewCallTarget instantiates a new CallTarget object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCallTarget(contract int32, entryPoint int32) *CallTarget { +func NewCallTarget(contract uint32, entryPoint uint32) *CallTarget { this := CallTarget{} this.Contract = contract this.EntryPoint = entryPoint @@ -43,9 +43,9 @@ func NewCallTargetWithDefaults() *CallTarget { } // GetContract returns the Contract field value -func (o *CallTarget) GetContract() int32 { +func (o *CallTarget) GetContract() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -54,7 +54,7 @@ func (o *CallTarget) GetContract() int32 { // GetContractOk returns a tuple with the Contract field value // and a boolean to check if the value has been set. -func (o *CallTarget) GetContractOk() (*int32, bool) { +func (o *CallTarget) GetContractOk() (*uint32, bool) { if o == nil { return nil, false } @@ -62,14 +62,14 @@ func (o *CallTarget) GetContractOk() (*int32, bool) { } // SetContract sets field value -func (o *CallTarget) SetContract(v int32) { +func (o *CallTarget) SetContract(v uint32) { o.Contract = v } // GetEntryPoint returns the EntryPoint field value -func (o *CallTarget) GetEntryPoint() int32 { +func (o *CallTarget) GetEntryPoint() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -78,7 +78,7 @@ func (o *CallTarget) GetEntryPoint() int32 { // GetEntryPointOk returns a tuple with the EntryPoint field value // and a boolean to check if the value has been set. -func (o *CallTarget) GetEntryPointOk() (*int32, bool) { +func (o *CallTarget) GetEntryPointOk() (*uint32, bool) { if o == nil { return nil, false } @@ -86,7 +86,7 @@ func (o *CallTarget) GetEntryPointOk() (*int32, bool) { } // SetEntryPoint sets field value -func (o *CallTarget) SetEntryPoint(v int32) { +func (o *CallTarget) SetEntryPoint(v uint32) { o.EntryPoint = v } diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go index 188cd59145..9366935155 100644 --- a/clients/apiclient/model_consensus_pipe_metrics.go +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -19,18 +19,18 @@ var _ MappedNullable = &ConsensusPipeMetrics{} // ConsensusPipeMetrics struct for ConsensusPipeMetrics type ConsensusPipeMetrics struct { - EventACSMsgPipeSize int32 `json:"eventACSMsgPipeSize"` - EventPeerLogIndexMsgPipeSize int32 `json:"eventPeerLogIndexMsgPipeSize"` - EventStateTransitionMsgPipeSize int32 `json:"eventStateTransitionMsgPipeSize"` - EventTimerMsgPipeSize int32 `json:"eventTimerMsgPipeSize"` - EventVMResultMsgPipeSize int32 `json:"eventVMResultMsgPipeSize"` + EventACSMsgPipeSize uint32 `json:"eventACSMsgPipeSize"` + EventPeerLogIndexMsgPipeSize uint32 `json:"eventPeerLogIndexMsgPipeSize"` + EventStateTransitionMsgPipeSize uint32 `json:"eventStateTransitionMsgPipeSize"` + EventTimerMsgPipeSize uint32 `json:"eventTimerMsgPipeSize"` + EventVMResultMsgPipeSize uint32 `json:"eventVMResultMsgPipeSize"` } // NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConsensusPipeMetrics(eventACSMsgPipeSize int32, eventPeerLogIndexMsgPipeSize int32, eventStateTransitionMsgPipeSize int32, eventTimerMsgPipeSize int32, eventVMResultMsgPipeSize int32) *ConsensusPipeMetrics { +func NewConsensusPipeMetrics(eventACSMsgPipeSize uint32, eventPeerLogIndexMsgPipeSize uint32, eventStateTransitionMsgPipeSize uint32, eventTimerMsgPipeSize uint32, eventVMResultMsgPipeSize uint32) *ConsensusPipeMetrics { this := ConsensusPipeMetrics{} this.EventACSMsgPipeSize = eventACSMsgPipeSize this.EventPeerLogIndexMsgPipeSize = eventPeerLogIndexMsgPipeSize @@ -49,9 +49,9 @@ func NewConsensusPipeMetricsWithDefaults() *ConsensusPipeMetrics { } // GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32 { +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -60,7 +60,7 @@ func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32 { // GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool) { +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -68,14 +68,14 @@ func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool) { } // SetEventACSMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32) { +func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v uint32) { o.EventACSMsgPipeSize = v } // GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32 { +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -84,7 +84,7 @@ func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32 { // GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool) { +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool } // SetEventPeerLogIndexMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32) { +func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v uint32) { o.EventPeerLogIndexMsgPipeSize = v } // GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32 { +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -108,7 +108,7 @@ func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32 { // GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool) { +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -116,14 +116,14 @@ func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, b } // SetEventStateTransitionMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32) { +func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v uint32) { o.EventStateTransitionMsgPipeSize = v } // GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32 { +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -132,7 +132,7 @@ func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32 { // GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool) { +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -140,14 +140,14 @@ func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool) { } // SetEventTimerMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32) { +func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v uint32) { o.EventTimerMsgPipeSize = v } // GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32 { +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -156,7 +156,7 @@ func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32 { // GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool) { +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -164,7 +164,7 @@ func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool) { } // SetEventVMResultMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32) { +func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v uint32) { o.EventVMResultMsgPipeSize = v } diff --git a/clients/apiclient/model_consensus_workflow_status.go b/clients/apiclient/model_consensus_workflow_status.go index ff6a10646e..e400200968 100644 --- a/clients/apiclient/model_consensus_workflow_status.go +++ b/clients/apiclient/model_consensus_workflow_status.go @@ -21,7 +21,7 @@ var _ MappedNullable = &ConsensusWorkflowStatus{} // ConsensusWorkflowStatus struct for ConsensusWorkflowStatus type ConsensusWorkflowStatus struct { // Shows current state index of the consensus - CurrentStateIndex *int32 `json:"currentStateIndex,omitempty"` + CurrentStateIndex *uint32 `json:"currentStateIndex,omitempty"` // Shows if batch proposal is sent out in current consensus iteration FlagBatchProposalSent *bool `json:"flagBatchProposalSent,omitempty"` // Shows if consensus on batch is reached and known in current consensus iteration @@ -76,9 +76,9 @@ func NewConsensusWorkflowStatusWithDefaults() *ConsensusWorkflowStatus { } // GetCurrentStateIndex returns the CurrentStateIndex field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() int32 { +func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() uint32 { if o == nil || isNil(o.CurrentStateIndex) { - var ret int32 + var ret uint32 return ret } return *o.CurrentStateIndex @@ -86,7 +86,7 @@ func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() int32 { // GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*int32, bool) { +func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*uint32, bool) { if o == nil || isNil(o.CurrentStateIndex) { return nil, false } @@ -102,8 +102,8 @@ func (o *ConsensusWorkflowStatus) HasCurrentStateIndex() bool { return false } -// SetCurrentStateIndex gets a reference to the given int32 and assigns it to the CurrentStateIndex field. -func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v int32) { +// SetCurrentStateIndex gets a reference to the given uint32 and assigns it to the CurrentStateIndex field. +func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v uint32) { o.CurrentStateIndex = &v } diff --git a/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index 6192f5281d..85899f2c2d 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -24,14 +24,14 @@ type GasFeePolicy struct { // The amount of gas per token. GasPerToken int64 `json:"gasPerToken"` // The validator fee share. - ValidatorFeeShare int32 `json:"validatorFeeShare"` + ValidatorFeeShare uint32 `json:"validatorFeeShare"` } // NewGasFeePolicy instantiates a new GasFeePolicy object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32) *GasFeePolicy { +func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare uint32) *GasFeePolicy { this := GasFeePolicy{} this.GasFeeTokenId = gasFeeTokenId this.GasPerToken = gasPerToken @@ -96,9 +96,9 @@ func (o *GasFeePolicy) SetGasPerToken(v int64) { } // GetValidatorFeeShare returns the ValidatorFeeShare field value -func (o *GasFeePolicy) GetValidatorFeeShare() int32 { +func (o *GasFeePolicy) GetValidatorFeeShare() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -107,7 +107,7 @@ func (o *GasFeePolicy) GetValidatorFeeShare() int32 { // GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field value // and a boolean to check if the value has been set. -func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool) { +func (o *GasFeePolicy) GetValidatorFeeShareOk() (*uint32, bool) { if o == nil { return nil, false } @@ -115,7 +115,7 @@ func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool) { } // SetValidatorFeeShare sets field value -func (o *GasFeePolicy) SetValidatorFeeShare(v int32) { +func (o *GasFeePolicy) SetValidatorFeeShare(v uint32) { o.ValidatorFeeShare = v } diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go index 3ff32d6c43..31fe738659 100644 --- a/clients/apiclient/model_gov_chain_info_response.go +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -27,18 +27,18 @@ type GovChainInfoResponse struct { Description string `json:"description"` GasFeePolicy GasFeePolicy `json:"gasFeePolicy"` // The maximum contract blob size. - MaxBlobSize int32 `json:"maxBlobSize"` + MaxBlobSize uint32 `json:"maxBlobSize"` // The maximum event size. - MaxEventSize int32 `json:"maxEventSize"` + MaxEventSize uint32 `json:"maxEventSize"` // The maximum amount of events per request. - MaxEventsPerReq int32 `json:"maxEventsPerReq"` + MaxEventsPerReq uint32 `json:"maxEventsPerReq"` } // NewGovChainInfoResponse instantiates a new GovChainInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize int32, maxEventSize int32, maxEventsPerReq int32) *GovChainInfoResponse { +func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize uint32, maxEventSize uint32, maxEventsPerReq uint32) *GovChainInfoResponse { this := GovChainInfoResponse{} this.ChainID = chainID this.ChainOwnerId = chainOwnerId @@ -155,9 +155,9 @@ func (o *GovChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { } // GetMaxBlobSize returns the MaxBlobSize field value -func (o *GovChainInfoResponse) GetMaxBlobSize() int32 { +func (o *GovChainInfoResponse) GetMaxBlobSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -166,7 +166,7 @@ func (o *GovChainInfoResponse) GetMaxBlobSize() int32 { // GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value // and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { +func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -174,14 +174,14 @@ func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { } // SetMaxBlobSize sets field value -func (o *GovChainInfoResponse) SetMaxBlobSize(v int32) { +func (o *GovChainInfoResponse) SetMaxBlobSize(v uint32) { o.MaxBlobSize = v } // GetMaxEventSize returns the MaxEventSize field value -func (o *GovChainInfoResponse) GetMaxEventSize() int32 { +func (o *GovChainInfoResponse) GetMaxEventSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -190,7 +190,7 @@ func (o *GovChainInfoResponse) GetMaxEventSize() int32 { // GetMaxEventSizeOk returns a tuple with the MaxEventSize field value // and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { +func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -198,14 +198,14 @@ func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { } // SetMaxEventSize sets field value -func (o *GovChainInfoResponse) SetMaxEventSize(v int32) { +func (o *GovChainInfoResponse) SetMaxEventSize(v uint32) { o.MaxEventSize = v } // GetMaxEventsPerReq returns the MaxEventsPerReq field value -func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32 { +func (o *GovChainInfoResponse) GetMaxEventsPerReq() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -214,7 +214,7 @@ func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32 { // GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value // and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { +func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool) { if o == nil { return nil, false } @@ -222,7 +222,7 @@ func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { } // SetMaxEventsPerReq sets field value -func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32) { +func (o *GovChainInfoResponse) SetMaxEventsPerReq(v uint32) { o.MaxEventsPerReq = v } diff --git a/clients/apiclient/model_l1_params.go b/clients/apiclient/model_l1_params.go index af9d18f94c..e2cad2d91f 100644 --- a/clients/apiclient/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -21,7 +21,7 @@ var _ MappedNullable = &L1Params{} type L1Params struct { BaseToken BaseToken `json:"baseToken"` // The max payload size - MaxPayloadSize int32 `json:"maxPayloadSize"` + MaxPayloadSize uint32 `json:"maxPayloadSize"` Protocol ProtocolParameters `json:"protocol"` } @@ -29,7 +29,7 @@ type L1Params struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewL1Params(baseToken BaseToken, maxPayloadSize int32, protocol ProtocolParameters) *L1Params { +func NewL1Params(baseToken BaseToken, maxPayloadSize uint32, protocol ProtocolParameters) *L1Params { this := L1Params{} this.BaseToken = baseToken this.MaxPayloadSize = maxPayloadSize @@ -70,9 +70,9 @@ func (o *L1Params) SetBaseToken(v BaseToken) { } // GetMaxPayloadSize returns the MaxPayloadSize field value -func (o *L1Params) GetMaxPayloadSize() int32 { +func (o *L1Params) GetMaxPayloadSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -81,7 +81,7 @@ func (o *L1Params) GetMaxPayloadSize() int32 { // GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field value // and a boolean to check if the value has been set. -func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool) { +func (o *L1Params) GetMaxPayloadSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -89,7 +89,7 @@ func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool) { } // SetMaxPayloadSize sets field value -func (o *L1Params) SetMaxPayloadSize(v int32) { +func (o *L1Params) SetMaxPayloadSize(v uint32) { o.MaxPayloadSize = v } diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go index 53da92788f..1e7e1ea36b 100644 --- a/clients/apiclient/model_milestone_info.go +++ b/clients/apiclient/model_milestone_info.go @@ -19,9 +19,9 @@ var _ MappedNullable = &MilestoneInfo{} // MilestoneInfo struct for MilestoneInfo type MilestoneInfo struct { - Index *int32 `json:"index,omitempty"` + Index *uint32 `json:"index,omitempty"` MilestoneId *string `json:"milestoneId,omitempty"` - Timestamp *int32 `json:"timestamp,omitempty"` + Timestamp *uint32 `json:"timestamp,omitempty"` } // NewMilestoneInfo instantiates a new MilestoneInfo object @@ -42,9 +42,9 @@ func NewMilestoneInfoWithDefaults() *MilestoneInfo { } // GetIndex returns the Index field value if set, zero value otherwise. -func (o *MilestoneInfo) GetIndex() int32 { +func (o *MilestoneInfo) GetIndex() uint32 { if o == nil || isNil(o.Index) { - var ret int32 + var ret uint32 return ret } return *o.Index @@ -52,7 +52,7 @@ func (o *MilestoneInfo) GetIndex() int32 { // GetIndexOk returns a tuple with the Index field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MilestoneInfo) GetIndexOk() (*int32, bool) { +func (o *MilestoneInfo) GetIndexOk() (*uint32, bool) { if o == nil || isNil(o.Index) { return nil, false } @@ -68,8 +68,8 @@ func (o *MilestoneInfo) HasIndex() bool { return false } -// SetIndex gets a reference to the given int32 and assigns it to the Index field. -func (o *MilestoneInfo) SetIndex(v int32) { +// SetIndex gets a reference to the given uint32 and assigns it to the Index field. +func (o *MilestoneInfo) SetIndex(v uint32) { o.Index = &v } @@ -106,9 +106,9 @@ func (o *MilestoneInfo) SetMilestoneId(v string) { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *MilestoneInfo) GetTimestamp() int32 { +func (o *MilestoneInfo) GetTimestamp() uint32 { if o == nil || isNil(o.Timestamp) { - var ret int32 + var ret uint32 return ret } return *o.Timestamp @@ -116,7 +116,7 @@ func (o *MilestoneInfo) GetTimestamp() int32 { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MilestoneInfo) GetTimestampOk() (*int32, bool) { +func (o *MilestoneInfo) GetTimestampOk() (*uint32, bool) { if o == nil || isNil(o.Timestamp) { return nil, false } @@ -132,8 +132,8 @@ func (o *MilestoneInfo) HasTimestamp() bool { return false } -// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field. -func (o *MilestoneInfo) SetTimestamp(v int32) { +// SetTimestamp gets a reference to the given uint32 and assigns it to the Timestamp field. +func (o *MilestoneInfo) SetTimestamp(v uint32) { o.Timestamp = &v } diff --git a/clients/apiclient/model_node_connection_message_metrics.go b/clients/apiclient/model_node_connection_message_metrics.go index fbeec14a27..9006df4f47 100644 --- a/clients/apiclient/model_node_connection_message_metrics.go +++ b/clients/apiclient/model_node_connection_message_metrics.go @@ -25,7 +25,7 @@ type NodeConnectionMessageMetrics struct { // The print out of the last message LastMessage *string `json:"lastMessage,omitempty"` // Total number of messages sent/received - Total *int32 `json:"total,omitempty"` + Total *uint32 `json:"total,omitempty"` } // NewNodeConnectionMessageMetrics instantiates a new NodeConnectionMessageMetrics object @@ -110,9 +110,9 @@ func (o *NodeConnectionMessageMetrics) SetLastMessage(v string) { } // GetTotal returns the Total field value if set, zero value otherwise. -func (o *NodeConnectionMessageMetrics) GetTotal() int32 { +func (o *NodeConnectionMessageMetrics) GetTotal() uint32 { if o == nil || isNil(o.Total) { - var ret int32 + var ret uint32 return ret } return *o.Total @@ -120,7 +120,7 @@ func (o *NodeConnectionMessageMetrics) GetTotal() int32 { // GetTotalOk returns a tuple with the Total field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *NodeConnectionMessageMetrics) GetTotalOk() (*int32, bool) { +func (o *NodeConnectionMessageMetrics) GetTotalOk() (*uint32, bool) { if o == nil || isNil(o.Total) { return nil, false } @@ -136,8 +136,8 @@ func (o *NodeConnectionMessageMetrics) HasTotal() bool { return false } -// SetTotal gets a reference to the given int32 and assigns it to the Total field. -func (o *NodeConnectionMessageMetrics) SetTotal(v int32) { +// SetTotal gets a reference to the given uint32 and assigns it to the Total field. +func (o *NodeConnectionMessageMetrics) SetTotal(v uint32) { o.Total = &v } diff --git a/clients/apiclient/model_output.go b/clients/apiclient/model_output.go index fec777c692..b36fba4fe7 100644 --- a/clients/apiclient/model_output.go +++ b/clients/apiclient/model_output.go @@ -20,7 +20,7 @@ var _ MappedNullable = &Output{} // Output struct for Output type Output struct { // The output type - OutputType int32 `json:"outputType"` + OutputType uint32 `json:"outputType"` // The raw data of the output (Hex) Raw string `json:"raw"` } @@ -29,7 +29,7 @@ type Output struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOutput(outputType int32, raw string) *Output { +func NewOutput(outputType uint32, raw string) *Output { this := Output{} this.OutputType = outputType this.Raw = raw @@ -45,9 +45,9 @@ func NewOutputWithDefaults() *Output { } // GetOutputType returns the OutputType field value -func (o *Output) GetOutputType() int32 { +func (o *Output) GetOutputType() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -56,7 +56,7 @@ func (o *Output) GetOutputType() int32 { // GetOutputTypeOk returns a tuple with the OutputType field value // and a boolean to check if the value has been set. -func (o *Output) GetOutputTypeOk() (*int32, bool) { +func (o *Output) GetOutputTypeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -64,7 +64,7 @@ func (o *Output) GetOutputTypeOk() (*int32, bool) { } // SetOutputType sets field value -func (o *Output) SetOutputType(v int32) { +func (o *Output) SetOutputType(v uint32) { o.OutputType = v } diff --git a/clients/apiclient/model_peering_node_status.go b/clients/apiclient/model_peering_node_status.go index c4110a7114..037c053bd2 100644 --- a/clients/apiclient/model_peering_node_status.go +++ b/clients/apiclient/model_peering_node_status.go @@ -21,7 +21,7 @@ var _ MappedNullable = &PeeringNodeStatus{} type PeeringNodeStatus struct { IsAlive *bool `json:"IsAlive,omitempty"` NetID *string `json:"NetID,omitempty"` - NumUsers *int32 `json:"NumUsers,omitempty"` + NumUsers *uint32 `json:"NumUsers,omitempty"` PubKey *string `json:"PubKey,omitempty"` } @@ -107,9 +107,9 @@ func (o *PeeringNodeStatus) SetNetID(v string) { } // GetNumUsers returns the NumUsers field value if set, zero value otherwise. -func (o *PeeringNodeStatus) GetNumUsers() int32 { +func (o *PeeringNodeStatus) GetNumUsers() uint32 { if o == nil || isNil(o.NumUsers) { - var ret int32 + var ret uint32 return ret } return *o.NumUsers @@ -117,7 +117,7 @@ func (o *PeeringNodeStatus) GetNumUsers() int32 { // GetNumUsersOk returns a tuple with the NumUsers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PeeringNodeStatus) GetNumUsersOk() (*int32, bool) { +func (o *PeeringNodeStatus) GetNumUsersOk() (*uint32, bool) { if o == nil || isNil(o.NumUsers) { return nil, false } @@ -133,8 +133,8 @@ func (o *PeeringNodeStatus) HasNumUsers() bool { return false } -// SetNumUsers gets a reference to the given int32 and assigns it to the NumUsers field. -func (o *PeeringNodeStatus) SetNumUsers(v int32) { +// SetNumUsers gets a reference to the given uint32 and assigns it to the NumUsers field. +func (o *PeeringNodeStatus) SetNumUsers(v uint32) { o.NumUsers = &v } diff --git a/clients/apiclient/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go index e92a1a79c5..e40bb0bcd0 100644 --- a/clients/apiclient/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -25,7 +25,7 @@ type PeeringNodeStatusResponse struct { // The NetID of the peer NetId string `json:"netId"` // The amount of users attached to the peer - NumUsers int32 `json:"numUsers"` + NumUsers uint32 `json:"numUsers"` // The peers public key encoded in Hex PublicKey string `json:"publicKey"` } @@ -34,7 +34,7 @@ type PeeringNodeStatusResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers int32, publicKey string) *PeeringNodeStatusResponse { +func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers uint32, publicKey string) *PeeringNodeStatusResponse { this := PeeringNodeStatusResponse{} this.IsAlive = isAlive this.IsTrusted = isTrusted @@ -125,9 +125,9 @@ func (o *PeeringNodeStatusResponse) SetNetId(v string) { } // GetNumUsers returns the NumUsers field value -func (o *PeeringNodeStatusResponse) GetNumUsers() int32 { +func (o *PeeringNodeStatusResponse) GetNumUsers() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -136,7 +136,7 @@ func (o *PeeringNodeStatusResponse) GetNumUsers() int32 { // GetNumUsersOk returns a tuple with the NumUsers field value // and a boolean to check if the value has been set. -func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool) { +func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*uint32, bool) { if o == nil { return nil, false } @@ -144,7 +144,7 @@ func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool) { } // SetNumUsers sets field value -func (o *PeeringNodeStatusResponse) SetNumUsers(v int32) { +func (o *PeeringNodeStatusResponse) SetNumUsers(v uint32) { o.NumUsers = v } diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go index f31b485b7e..8670370377 100644 --- a/clients/apiclient/model_protocol_parameters.go +++ b/clients/apiclient/model_protocol_parameters.go @@ -31,14 +31,14 @@ type ProtocolParameters struct { // The token supply TokenSupply string `json:"tokenSupply"` // The protocol version - Version int32 `json:"version"` + Version uint32 `json:"version"` } // NewProtocolParameters instantiates a new ProtocolParameters object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version int32) *ProtocolParameters { +func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version uint32) *ProtocolParameters { this := ProtocolParameters{} this.Bech32Hrp = bech32Hrp this.BelowMaxDepth = belowMaxDepth @@ -203,9 +203,9 @@ func (o *ProtocolParameters) SetTokenSupply(v string) { } // GetVersion returns the Version field value -func (o *ProtocolParameters) GetVersion() int32 { +func (o *ProtocolParameters) GetVersion() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -214,7 +214,7 @@ func (o *ProtocolParameters) GetVersion() int32 { // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetVersionOk() (*int32, bool) { +func (o *ProtocolParameters) GetVersionOk() (*uint32, bool) { if o == nil { return nil, false } @@ -222,7 +222,7 @@ func (o *ProtocolParameters) GetVersionOk() (*int32, bool) { } // SetVersion sets field value -func (o *ProtocolParameters) SetVersion(v int32) { +func (o *ProtocolParameters) SetVersion(v uint32) { o.Version = v } diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index 95d0c8b526..ec31c93319 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -19,7 +19,7 @@ var _ MappedNullable = &ReceiptError{} // ReceiptError struct for ReceiptError type ReceiptError struct { - ContractId int32 `json:"contractId"` + ContractId uint32 `json:"contractId"` ErrorCode string `json:"errorCode"` ErrorId uint32 `json:"errorId"` Message string `json:"message"` @@ -31,7 +31,7 @@ type ReceiptError struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { +func NewReceiptError(contractId uint32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { this := ReceiptError{} this.ContractId = contractId this.ErrorCode = errorCode @@ -51,9 +51,9 @@ func NewReceiptErrorWithDefaults() *ReceiptError { } // GetContractId returns the ContractId field value -func (o *ReceiptError) GetContractId() int32 { +func (o *ReceiptError) GetContractId() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -62,7 +62,7 @@ func (o *ReceiptError) GetContractId() int32 { // GetContractIdOk returns a tuple with the ContractId field value // and a boolean to check if the value has been set. -func (o *ReceiptError) GetContractIdOk() (*int32, bool) { +func (o *ReceiptError) GetContractIdOk() (*uint32, bool) { if o == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *ReceiptError) GetContractIdOk() (*int32, bool) { } // SetContractId sets field value -func (o *ReceiptError) SetContractId(v int32) { +func (o *ReceiptError) SetContractId(v uint32) { o.ContractId = v } diff --git a/clients/apiclient/model_rent_structure.go b/clients/apiclient/model_rent_structure.go index 4c84a2c57d..862e5c4f08 100644 --- a/clients/apiclient/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -22,16 +22,16 @@ type RentStructure struct { // The virtual byte cost VByteCost uint32 `json:"vByteCost"` // The virtual byte factor for data fields - VByteFactorData int32 `json:"vByteFactorData"` + VByteFactorData uint32 `json:"vByteFactorData"` // The virtual byte factor for key/lookup generating fields - VByteFactorKey int32 `json:"vByteFactorKey"` + VByteFactorKey uint32 `json:"vByteFactorKey"` } // NewRentStructure instantiates a new RentStructure object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRentStructure(vByteCost uint32, vByteFactorData int32, vByteFactorKey int32) *RentStructure { +func NewRentStructure(vByteCost uint32, vByteFactorData uint32, vByteFactorKey uint32) *RentStructure { this := RentStructure{} this.VByteCost = vByteCost this.VByteFactorData = vByteFactorData @@ -72,9 +72,9 @@ func (o *RentStructure) SetVByteCost(v uint32) { } // GetVByteFactorData returns the VByteFactorData field value -func (o *RentStructure) GetVByteFactorData() int32 { +func (o *RentStructure) GetVByteFactorData() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -83,7 +83,7 @@ func (o *RentStructure) GetVByteFactorData() int32 { // GetVByteFactorDataOk returns a tuple with the VByteFactorData field value // and a boolean to check if the value has been set. -func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool) { +func (o *RentStructure) GetVByteFactorDataOk() (*uint32, bool) { if o == nil { return nil, false } @@ -91,14 +91,14 @@ func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool) { } // SetVByteFactorData sets field value -func (o *RentStructure) SetVByteFactorData(v int32) { +func (o *RentStructure) SetVByteFactorData(v uint32) { o.VByteFactorData = v } // GetVByteFactorKey returns the VByteFactorKey field value -func (o *RentStructure) GetVByteFactorKey() int32 { +func (o *RentStructure) GetVByteFactorKey() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -107,7 +107,7 @@ func (o *RentStructure) GetVByteFactorKey() int32 { // GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field value // and a boolean to check if the value has been set. -func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool) { +func (o *RentStructure) GetVByteFactorKeyOk() (*uint32, bool) { if o == nil { return nil, false } @@ -115,7 +115,7 @@ func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool) { } // SetVByteFactorKey sets field value -func (o *RentStructure) SetVByteFactorKey(v int32) { +func (o *RentStructure) SetVByteFactorKey(v uint32) { o.VByteFactorKey = v } diff --git a/clients/apiclient/test/api_corecontracts_test.go b/clients/apiclient/test/api_corecontracts_test.go index 52e422d514..b786355779 100644 --- a/clients/apiclient/test/api_corecontracts_test.go +++ b/clients/apiclient/test/api_corecontracts_test.go @@ -10,398 +10,399 @@ Testing CorecontractsApiService package openapi import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "./openapi" + "context" + "testing" + + openapiclient "./openapi" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func Test_openapi_CorecontractsApiService(t *testing.T) { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) - t.Run("Test CorecontractsApiService AccountsGetAccountBalance", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetAccountBalance", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var agentID string + var chainID string + var agentID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID, agentID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID, agentID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetAccountNFTIDs", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetAccountNFTIDs", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var agentID string + var chainID string + var agentID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNFTIDs(context.Background(), chainID, agentID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNFTIDs(context.Background(), chainID, agentID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetAccountNonce", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetAccountNonce", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var agentID string + var chainID string + var agentID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNonce(context.Background(), chainID, agentID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNonce(context.Background(), chainID, agentID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetAccounts", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetAccounts", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetFoundryOutput", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetFoundryOutput", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var chainID2 string + var chainID string + var chainID2 string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, chainID2).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, chainID2).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetNFTData", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetNFTData", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var nftID string + var chainID string + var nftID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNFTData(context.Background(), chainID, nftID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNFTData(context.Background(), chainID, nftID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetNativeTokenIDRegistry", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetNativeTokenIDRegistry", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNativeTokenIDRegistry(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNativeTokenIDRegistry(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService AccountsGetTotalAssets", func(t *testing.T) { + t.Run("Test CorecontractsApiService AccountsGetTotalAssets", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetTotalAssets(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetTotalAssets(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlobsGetAllBlobs", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlobsGetAllBlobs", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetAllBlobs(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetAllBlobs(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlobsGetBlobInfo", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlobsGetBlobInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var blobHash string + var chainID string + var blobHash string - resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobInfo(context.Background(), chainID, blobHash).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobInfo(context.Background(), chainID, blobHash).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlobsGetBlobValue", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlobsGetBlobValue", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var blobHash string - var fieldKey string + var chainID string + var blobHash string + var fieldKey string - resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobValue(context.Background(), chainID, blobHash, fieldKey).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobValue(context.Background(), chainID, blobHash, fieldKey).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetBlockInfo", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetBlockInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var blockIndex int32 + var chainID string + var blockIndex uint32 - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetBlockInfo(context.Background(), chainID, blockIndex).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetBlockInfo(context.Background(), chainID, blockIndex).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetControlAddresses", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetControlAddresses", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetControlAddresses(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetControlAddresses(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetEventsOfBlock", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetEventsOfBlock", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var blockIndex int32 + var chainID string + var blockIndex uint32 - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfBlock(context.Background(), chainID, blockIndex).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfBlock(context.Background(), chainID, blockIndex).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetEventsOfContract", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetEventsOfContract", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var contractHname string + var chainID string + var contractHname string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfContract(context.Background(), chainID, contractHname).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfContract(context.Background(), chainID, contractHname).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetEventsOfLatestBlock", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetEventsOfLatestBlock", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetEventsOfRequest", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetEventsOfRequest", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var requestID string + var chainID string + var requestID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfRequest(context.Background(), chainID, requestID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfRequest(context.Background(), chainID, requestID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetLatestBlockInfo", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetLatestBlockInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForBlock", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForBlock", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var blockIndex int32 + var chainID string + var blockIndex uint32 - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForBlock(context.Background(), chainID, blockIndex).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForBlock(context.Background(), chainID, blockIndex).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForLatestBlock", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForLatestBlock", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForLatestBlock(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForLatestBlock(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetRequestIsProcessed", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetRequestIsProcessed", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var requestID string + var chainID string + var requestID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIsProcessed(context.Background(), chainID, requestID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIsProcessed(context.Background(), chainID, requestID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetRequestReceipt", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetRequestReceipt", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var requestID string + var chainID string + var requestID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceipt(context.Background(), chainID, requestID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceipt(context.Background(), chainID, requestID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfBlock", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfBlock", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var blockIndex int32 + var chainID string + var blockIndex uint32 - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), chainID, blockIndex).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), chainID, blockIndex).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfLatestBlock", func(t *testing.T) { + t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfLatestBlock", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService ErrorsGetErrorMessageFormat", func(t *testing.T) { + t.Run("Test CorecontractsApiService ErrorsGetErrorMessageFormat", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string - var contractHname string - var errorID string + var chainID string + var contractHname string + var errorID string - resp, httpRes, err := apiClient.CorecontractsApi.ErrorsGetErrorMessageFormat(context.Background(), chainID, contractHname, errorID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.ErrorsGetErrorMessageFormat(context.Background(), chainID, contractHname, errorID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) - t.Run("Test CorecontractsApiService GovernanceGetChainInfo", func(t *testing.T) { + t.Run("Test CorecontractsApiService GovernanceGetChainInfo", func(t *testing.T) { - t.Skip("skip test") // remove to run test + t.Skip("skip test") // remove to run test - var chainID string + var chainID string - resp, httpRes, err := apiClient.CorecontractsApi.GovernanceGetChainInfo(context.Background(), chainID).Execute() + resp, httpRes, err := apiClient.CorecontractsApi.GovernanceGetChainInfo(context.Background(), chainID).Execute() - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) - }) + }) } diff --git a/clients/apiclient/utils.go b/clients/apiclient/utils.go index 05f46b8a02..863a82efec 100644 --- a/clients/apiclient/utils.go +++ b/clients/apiclient/utils.go @@ -23,7 +23,7 @@ func PtrBool(v bool) *bool { return &v } func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } +func PtrInt32(v uint32) *uint32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. func PtrInt64(v int64) *int64 { return &v } @@ -113,15 +113,15 @@ func (v *NullableInt) UnmarshalJSON(src []byte) error { } type NullableInt32 struct { - value *int32 + value *uint32 isSet bool } -func (v NullableInt32) Get() *int32 { +func (v NullableInt32) Get() *uint32 { return v.value } -func (v *NullableInt32) Set(val *int32) { +func (v *NullableInt32) Set(val *uint32) { v.value = val v.isSet = true } @@ -135,7 +135,7 @@ func (v *NullableInt32) Unset() { v.isSet = false } -func NewNullableInt32(val *int32) *NullableInt32 { +func NewNullableInt32(val *uint32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index ed7c636a21..e9fd1fe3a4 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -52,7 +52,7 @@ func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { blockInfo, _, err := client. CorecontractsApi. - BlocklogGetBlockInfo(context.Background(), config.GetCurrentChainID().String(), int32(index)). + BlocklogGetBlockInfo(context.Background(), config.GetCurrentChainID().String(), uint32(index)). Execute() log.Check(err) @@ -64,7 +64,7 @@ func logRequestsInBlock(index uint32) { client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! receipts, _, err := client.CorecontractsApi. - BlocklogGetRequestReceiptsOfBlock(context.Background(), config.GetCurrentChainID().String(), int32(index)). + BlocklogGetRequestReceiptsOfBlock(context.Background(), config.GetCurrentChainID().String(), index). Execute() log.Check(err) @@ -97,8 +97,8 @@ func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { tree := []log.TreeItem{ {K: "Kind", V: kind}, {K: "Sender", V: req.SenderAccount}, - {K: "Contract Hname", V: req.CallTarget.Contract}, - {K: "Entry point", V: req.CallTarget.EntryPoint}, + {K: "Contract Hname", V: isc.Hname(req.CallTarget.Contract).String()}, + {K: "Entry point", V: isc.Hname(req.CallTarget.EntryPoint).String()}, {K: "Arguments", V: argsTree}, {K: "Error", V: errMsg}, } @@ -114,7 +114,7 @@ func logEventsInBlock(index uint32) { client := cliclients.WaspClientForIndex() // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. - BlocklogGetEventsOfBlock(context.Background(), config.GetCurrentChainID().String(), int32(index)). + BlocklogGetEventsOfBlock(context.Background(), config.GetCurrentChainID().String(), index). Execute() log.Check(err) @@ -131,7 +131,6 @@ func initRequestCmd() *cobra.Command { log.Check(err) client := cliclients.WaspClientForIndex() - // TODO: It should be uint32 here. Fix generator! receipt, _, err := client.CorecontractsApi. BlocklogGetRequestReceipt(context.Background(), config.GetCurrentChainID().String(), reqID.String()). Execute() From d9f0c922fa2a24c19b462eeccca2dd8449cde430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:13:34 +0100 Subject: [PATCH 11/39] Fix uints and block log --- tools/cluster/chain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cluster/chain.go b/tools/cluster/chain.go index e92f07b844..90038935f7 100644 --- a/tools/cluster/chain.go +++ b/tools/cluster/chain.go @@ -220,7 +220,7 @@ func (ch *Chain) GetAllBlockInfoRecordsReverse(nodeIndex ...int) ([]*apiclient.B ret := make([]*apiclient.BlockInfoResponse, 0, blockIndex+1) for idx := int(blockIndex); idx >= 0; idx-- { blockInfo, _, err := ch.Cluster. - WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetBlockInfo(context.Background(), ch.ChainID.String(), int32(idx)). + WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetBlockInfo(context.Background(), ch.ChainID.String(), uint32(idx)). Execute() if err != nil { @@ -289,7 +289,7 @@ func (ch *Chain) GetRequestReceiptsForBlock(blockIndex *uint32, nodeIndex ...int var receipts *apiclient.BlockReceiptsResponse if blockIndex != nil { - receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), ch.ChainID.String(), int32(*blockIndex)). + receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), ch.ChainID.String(), *blockIndex). Execute() } else { receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), ch.ChainID.String()). From f6aad5d13e110ed4857f70dfb2d0ae6962a59b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:18:50 +0100 Subject: [PATCH 12/39] Fix wasp-cli balance --- tools/wasp-cli/chain/accounts.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/wasp-cli/chain/accounts.go b/tools/wasp-cli/chain/accounts.go index 1403c0db54..707af0448e 100644 --- a/tools/wasp-cli/chain/accounts.go +++ b/tools/wasp-cli/chain/accounts.go @@ -65,10 +65,11 @@ func initBalanceCmd() *cobra.Command { log.Check(err) header := []string{"token", "amount"} - rows := make([][]string, len(balance.NativeTokens)) + rows := make([][]string, len(balance.NativeTokens)+1) + rows[0] = []string{"Base Token", iotago.EncodeUint64(uint64(balance.BaseTokens))} for k, v := range balance.NativeTokens { - rows[k] = []string{v.Id, v.Amount} + rows[k+1] = []string{v.Id, v.Amount} } log.PrintTable(header, rows) From bb285878434ddd1e35643102c52b9a7a09a36703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:22:04 +0100 Subject: [PATCH 13/39] Fix block log args --- tools/wasp-cli/chain/blocklog.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index e9fd1fe3a4..4ec9925e3e 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" @@ -82,7 +83,8 @@ func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { kind = "off-ledger" } - args := req.Params.Items + args, err := clients.APIJsonDictToDict(req.Params) + log.Check(err) var argsTree interface{} = "(empty)" if len(args) > 0 { From 4ff65ad64698d7312da30a5197c3e807f94f5e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:33:20 +0100 Subject: [PATCH 14/39] Fix contracts list and hname parsing --- .../webapi/controllers/requests/callview.go | 25 +++++++++++-------- tools/wasp-cli/chain/listcontracts.go | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/webapi/controllers/requests/callview.go b/packages/webapi/controllers/requests/callview.go index c61531d90c..e5543f9584 100644 --- a/packages/webapi/controllers/requests/callview.go +++ b/packages/webapi/controllers/requests/callview.go @@ -25,22 +25,25 @@ func (c *Controller) executeCallView(e echo.Context) error { } // Get contract and function. The request model supports HName and common string names. HNames are preferred. - contractHName, err := isc.HnameFromHexString(callViewRequest.ContractHName) - if err != nil { - return apierrors.InvalidPropertyError("contractHName", err) - } - - functionHName, err := isc.HnameFromHexString(callViewRequest.FunctionHName) - if err != nil { - return apierrors.InvalidPropertyError("functionHName", err) - } + var contractHName isc.Hname + var functionHName isc.Hname - if contractHName == 0 { + if callViewRequest.ContractHName == "" { contractHName = isc.Hn(callViewRequest.ContractName) + } else { + contractHName, err = isc.HnameFromHexString(callViewRequest.ContractHName) + if err != nil { + return apierrors.InvalidPropertyError("contractHName", err) + } } - if functionHName == 0 { + if callViewRequest.FunctionHName == "" { functionHName = isc.Hn(callViewRequest.FunctionName) + } else { + functionHName, err = isc.HnameFromHexString(callViewRequest.FunctionHName) + if err != nil { + return apierrors.InvalidPropertyError("contractHName", err) + } } args, err := dict.FromJSONDict(callViewRequest.Arguments) diff --git a/tools/wasp-cli/chain/listcontracts.go b/tools/wasp-cli/chain/listcontracts.go index 67720efa51..fef42b5f15 100644 --- a/tools/wasp-cli/chain/listcontracts.go +++ b/tools/wasp-cli/chain/listcontracts.go @@ -26,6 +26,7 @@ func initListContractsCmd() *cobra.Command { records, _, err := client.RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ ContractName: root.Contract.Name, FunctionName: root.ViewGetContractRecords.Name, + ChainId: config.GetCurrentChainID().String(), }).Execute() if records == nil { From 6a5abc832a93e8941dcb31f9e469a58765146b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:34:58 +0100 Subject: [PATCH 15/39] Fix auth info output --- tools/wasp-cli/authentication/info.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/wasp-cli/authentication/info.go b/tools/wasp-cli/authentication/info.go index 7834d58257..7e66a9c22b 100644 --- a/tools/wasp-cli/authentication/info.go +++ b/tools/wasp-cli/authentication/info.go @@ -17,7 +17,8 @@ type AuthInfoOutput struct { var _ log.CLIOutput = &AuthInfoOutput{} func (l *AuthInfoOutput) AsText() (string, error) { - template := `Authentication Method: {{ .AuthenticationMethod }}\nAuthentication URL: {{ .AuthenticationURL }}` + template := `Authentication Method: {{ .AuthenticationMethod }} +Authentication URL: {{ .AuthenticationURL }}` return log.ParseCLIOutputTemplate(l, template) } From 2ba6d8f9dbfdb6f5c5464e91471495be11fc7ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Fri, 3 Feb 2023 20:39:49 +0100 Subject: [PATCH 16/39] Fix distrust --- tools/wasp-cli/peering/distrust.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/wasp-cli/peering/distrust.go b/tools/wasp-cli/peering/distrust.go index 01d0218b86..5ab8f3d6e6 100644 --- a/tools/wasp-cli/peering/distrust.go +++ b/tools/wasp-cli/peering/distrust.go @@ -25,7 +25,8 @@ func initDistrustCmd() *cobra.Command { if peering.CheckNetID(pubKeyOrNetID) != nil { _, err := client.NodeApi.DistrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ - NetId: pubKeyOrNetID, + NetId: pubKeyOrNetID, + PublicKey: pubKeyOrNetID, }).Execute() log.Check(err) log.Printf("# Distrusted PubKey: %v\n", pubKeyOrNetID) @@ -36,7 +37,7 @@ func initDistrustCmd() *cobra.Command { log.Check(err) for _, t := range trustedList { - if t.NetId == pubKeyOrNetID { + if t.PublicKey == pubKeyOrNetID { _, err := client.NodeApi.DistrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ PublicKey: t.PublicKey, }).Execute() From b049dada5e7a92d5dfb2801b1623843836dab6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 19:21:59 +0100 Subject: [PATCH 17/39] fix import references --- packages/webapi/api.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/webapi/api.go b/packages/webapi/api.go index d6662e1fbc..21946703a0 100644 --- a/packages/webapi/api.go +++ b/packages/webapi/api.go @@ -22,7 +22,7 @@ import ( "github.com/iotaledger/wasp/packages/webapi/controllers/requests" "github.com/iotaledger/wasp/packages/webapi/controllers/users" "github.com/iotaledger/wasp/packages/webapi/interfaces" - services2 "github.com/iotaledger/wasp/packages/webapi/services" + "github.com/iotaledger/wasp/packages/webapi/services" ) func loadControllers(server echoswagger.ApiRoot, mocker *Mocker, controllersToLoad []interfaces.APIController) { @@ -61,17 +61,17 @@ func Init( mocker := NewMocker() mocker.LoadMockFiles() - vmService := services2.NewVMService(chainsProvider) - chainService := services2.NewChainService(chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) - committeeService := services2.NewCommitteeService(chainsProvider, networkProvider, dkShareRegistryProvider) - registryService := services2.NewRegistryService(chainsProvider, chainRecordRegistryProvider) - offLedgerService := services2.NewOffLedgerService(chainService, networkProvider, requestCacheTTL) - metricsService := services2.NewMetricsService(chainsProvider) - peeringService := services2.NewPeeringService(chainsProvider, networkProvider, trustedNetworkManager) - evmService := services2.NewEVMService(chainService, networkProvider) - nodeService := services2.NewNodeService(chainRecordRegistryProvider, nodeOwnerAddresses, nodeIdentityProvider, shutdownHandler, trustedNetworkManager) - dkgService := services2.NewDKGService(dkShareRegistryProvider, dkgNodeProvider) - userService := services2.NewUserService(userManager) + vmService := services.NewVMService(chainsProvider) + chainService := services.NewChainService(chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) + committeeService := services.NewCommitteeService(chainsProvider, networkProvider, dkShareRegistryProvider) + registryService := services.NewRegistryService(chainsProvider, chainRecordRegistryProvider) + offLedgerService := services.NewOffLedgerService(chainService, networkProvider, requestCacheTTL) + metricsService := services.NewMetricsService(chainsProvider) + peeringService := services.NewPeeringService(chainsProvider, networkProvider, trustedNetworkManager) + evmService := services.NewEVMService(chainService, networkProvider) + nodeService := services.NewNodeService(chainRecordRegistryProvider, nodeOwnerAddresses, nodeIdentityProvider, shutdownHandler, trustedNetworkManager) + dkgService := services.NewDKGService(dkShareRegistryProvider, dkgNodeProvider) + userService := services.NewUserService(userManager) // -- claimValidator := func(claims *authentication.WaspClaims) bool { From ee575e17ee3d65d54ecff15a1f1be447d12d1044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 20:46:02 +0100 Subject: [PATCH 18/39] Change (u)int64 responses to string, add uint documentation for routes --- .../controllers/corecontracts/accounts.go | 9 +++-- .../controllers/corecontracts/blocklog.go | 7 ++-- .../controllers/corecontracts/controller.go | 37 +++++++++++++------ packages/webapi/models/chain.go | 5 ++- packages/webapi/models/core_accounts.go | 4 +- packages/webapi/models/core_blocklog.go | 30 +++++++-------- .../webapi/models/mock/ChainInfoResponse.json | 2 +- .../models/mock/ChainInfoResponse[].json | 2 +- packages/webapi/models/vm.go | 12 +++--- tools/api-gen/main.go | 2 +- 10 files changed, 63 insertions(+), 47 deletions(-) diff --git a/packages/webapi/controllers/corecontracts/accounts.go b/packages/webapi/controllers/corecontracts/accounts.go index 3668e55b1d..21bdb2b572 100644 --- a/packages/webapi/controllers/corecontracts/accounts.go +++ b/packages/webapi/controllers/corecontracts/accounts.go @@ -5,6 +5,7 @@ import ( "github.com/labstack/echo/v4" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/webapi/apierrors" "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/params" @@ -44,7 +45,7 @@ func (c *Controller) getTotalAssets(e echo.Context) error { } assetsResponse := &models.AssetsResponse{ - BaseTokens: assets.BaseTokens, + BaseTokens: iotago.EncodeUint64(assets.BaseTokens), NativeTokens: models.MapNativeTokens(assets.NativeTokens), } @@ -68,7 +69,7 @@ func (c *Controller) getAccountBalance(e echo.Context) error { } assetsResponse := &models.AssetsResponse{ - BaseTokens: assets.BaseTokens, + BaseTokens: iotago.EncodeUint64(assets.BaseTokens), NativeTokens: models.MapNativeTokens(assets.NativeTokens), } @@ -119,7 +120,7 @@ func (c *Controller) getAccountNonce(e echo.Context) error { } nonceResponse := &models.AccountNonceResponse{ - Nonce: nonce, + Nonce: iotago.EncodeUint64(nonce), } return e.JSON(http.StatusOK, nonceResponse) @@ -192,7 +193,7 @@ func (c *Controller) getFoundryOutput(e echo.Context) error { foundryOutputResponse := &models.FoundryOutputResponse{ FoundryID: foundryOutputID.ToHex(), Assets: models.AssetsResponse{ - BaseTokens: foundryOutput.Amount, + BaseTokens: iotago.EncodeUint64(foundryOutput.Amount), NativeTokens: models.MapNativeTokens(foundryOutput.NativeTokens), }, } diff --git a/packages/webapi/controllers/corecontracts/blocklog.go b/packages/webapi/controllers/corecontracts/blocklog.go index f0123cf35a..dd497f6291 100644 --- a/packages/webapi/controllers/corecontracts/blocklog.go +++ b/packages/webapi/controllers/corecontracts/blocklog.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/labstack/echo/v4" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/parameters" @@ -106,10 +107,10 @@ func (c *Controller) getRequestIDsForBlock(e echo.Context) error { func MapRequestReceiptResponse(vmService interfaces.VMService, chainID isc.ChainID, receipt *blocklog.RequestReceipt) (*models.RequestReceiptResponse, error) { response := &models.RequestReceiptResponse{ BlockIndex: receipt.BlockIndex, - GasBudget: receipt.GasBudget, + GasBudget: iotago.EncodeUint64(receipt.GasBudget), GasBurnLog: receipt.GasBurnLog, - GasBurned: receipt.GasBurned, - GasFeeCharged: receipt.GasFeeCharged, + GasBurned: iotago.EncodeUint64(receipt.GasBurned), + GasFeeCharged: iotago.EncodeUint64(receipt.GasFeeCharged), Request: models.MapRequestDetail(receipt.Request), RequestIndex: receipt.RequestIndex, } diff --git a/packages/webapi/controllers/corecontracts/controller.go b/packages/webapi/controllers/corecontracts/controller.go index 09b7345e85..d4cd6011b1 100644 --- a/packages/webapi/controllers/corecontracts/controller.go +++ b/packages/webapi/controllers/corecontracts/controller.go @@ -82,9 +82,14 @@ func (c *Controller) addAccountContractRoutes(api echoswagger.ApiGroup, mocker i SetOperationId("accountsGetNativeTokenIDRegistry"). SetSummary("Get a list of all registries") - api.GET("chains/:chainID/core/accounts/foundry_output", c.getFoundryOutput). - AddParamPath("", "chainID", "ChainID (Bech32)"). - AddParamPath(uint32(0), "serialNumber", "Serial Number (uint32)"). + //nolint:unused + type foundryOutputParams struct { + chainID string `swagger:"required,desc(ChainID (Bech32))"` + serialNumber uint32 `swagger:"required,min(1),desc(Serial Number (uint32))"` + } + + api.GET("chains/:chainID/core/accounts/foundry_output/:serialNumber", c.getFoundryOutput). + AddParamPathNested(foundryOutputParams{}). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "The foundry output", mocker.Get(models.FoundryOutputResponse{}), nil). SetOperationId("accountsGetFoundryOutput"). @@ -125,10 +130,15 @@ func (c *Controller) addBlobContractRoutes(api echoswagger.ApiGroup, mocker inte } func (c *Controller) addErrorContractRoutes(api echoswagger.ApiGroup, mocker interfaces.Mocker) { + //nolint:unused + type errorMessageFormat struct { + chainID string `swagger:"required,desc(ChainID (Bech32))"` + contractHname string `swagger:"required,desc(Contract (Hname as Hex))"` + errorID uint16 `swagger:"required,min(1),desc(Error Id (uint16))"` + } + api.GET("chains/:chainID/core/errors/:contractHname/message/:errorID", c.getErrorMessageFormat). - AddParamPath("", "chainID", "ChainID (Bech32)"). - AddParamPath("", "contractHname", "Contract (Hname as Hex)"). - AddParamPath(uint16(0), "errorID", "Error Id (uint16)"). + AddParamPathNested(errorMessageFormat{}). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "The error message format", mocker.Get(ErrorMessageFormatResponse{}), nil). SetOperationId("errorsGetErrorMessageFormat"). @@ -153,9 +163,14 @@ func (c *Controller) addBlockLogContractRoutes(api echoswagger.ApiGroup, mocker SetOperationId("blocklogGetControlAddresses"). SetSummary("Get the control addresses") + //nolint:unused + type blocks struct { + chainID string `swagger:"required,desc(ChainID (Bech32))"` + blockIndex uint32 `swagger:"required,min(1),desc(BlockIndex (uint32))"` + } + api.GET("chains/:chainID/core/blocklog/blocks/:blockIndex", c.getBlockInfo). - AddParamPath("", "chainID", "ChainID (Bech32)"). - AddParamPath(uint32(0), "blockIndex", "Block Index (uint32)"). + AddParamPathNested(blocks{}). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "The block info", mocker.Get(models.BlockInfoResponse{}), nil). SetOperationId("blocklogGetBlockInfo"). @@ -169,8 +184,7 @@ func (c *Controller) addBlockLogContractRoutes(api echoswagger.ApiGroup, mocker SetSummary("Get the block info of the latest block") api.GET("chains/:chainID/core/blocklog/blocks/:blockIndex/requestids", c.getRequestIDsForBlock). - AddParamPath("", "chainID", "ChainID (Bech32)"). - AddParamPath(uint32(0), "blockIndex", "Block Index (uint32)"). + AddParamPathNested(blocks{}). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "A list of request ids (ISCRequestID[])", mocker.Get(models.RequestIDsResponse{}), nil). SetOperationId("blocklogGetRequestIDsForBlock"). @@ -215,8 +229,7 @@ func (c *Controller) addBlockLogContractRoutes(api echoswagger.ApiGroup, mocker SetSummary("Get the request processing status") api.GET("chains/:chainID/core/blocklog/events/block/:blockIndex", c.getBlockEvents). - AddParamPath("", "chainID", "ChainID (Bech32)"). - AddParamPath(0, "blockIndex", "Block Index (uint32)"). + AddParamPathNested(blocks{}). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "The events", mocker.Get(models.EventsResponse{}), nil). SetOperationId("blocklogGetEventsOfBlock"). diff --git a/packages/webapi/models/chain.go b/packages/webapi/models/chain.go index 2f7600e2ca..193d6263ec 100644 --- a/packages/webapi/models/chain.go +++ b/packages/webapi/models/chain.go @@ -1,6 +1,7 @@ package models import ( + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" dto2 "github.com/iotaledger/wasp/packages/webapi/dto" @@ -52,7 +53,7 @@ type ContractInfoResponse struct { type gasFeePolicy struct { GasFeeTokenID string `json:"gasFeeTokenId" swagger:"desc(The gas fee token id. Empty if base token.),required"` - GasPerToken uint64 `json:"gasPerToken" swagger:"desc(The amount of gas per token.),required"` + GasPerToken string `json:"gasPerToken" swagger:"desc(The amount of gas per token. (uint64 as string)),required"` ValidatorFeeShare uint8 `json:"validatorFeeShare" swagger:"desc(The validator fee share.),required,min(1)"` } @@ -87,7 +88,7 @@ func MapChainInfoResponse(chainInfo *dto2.ChainInfo, evmChainID uint16) ChainInf Description: chainInfo.Description, GasFeePolicy: gasFeePolicy{ GasFeeTokenID: gasFeeTokenID, - GasPerToken: chainInfo.GasFeePolicy.GasPerToken, + GasPerToken: iotago.EncodeUint64(chainInfo.GasFeePolicy.GasPerToken), ValidatorFeeShare: chainInfo.GasFeePolicy.ValidatorFeeShare, }, MaxBlobSize: chainInfo.MaxBlobSize, diff --git a/packages/webapi/models/core_accounts.go b/packages/webapi/models/core_accounts.go index 547f581d0c..b318116028 100644 --- a/packages/webapi/models/core_accounts.go +++ b/packages/webapi/models/core_accounts.go @@ -19,7 +19,7 @@ type NativeToken struct { } type AssetsResponse struct { - BaseTokens uint64 `json:"baseTokens" swagger:"required"` + BaseTokens string `json:"baseTokens" swagger:"required,desc(The base tokens (uint64 as string))"` NativeTokens []*NativeToken `json:"nativeTokens" swagger:"required"` } @@ -45,7 +45,7 @@ type AccountNFTsResponse struct { } type AccountNonceResponse struct { - Nonce uint64 `json:"nonce" swagger:"required"` + Nonce string `json:"nonce" swagger:"required,desc(The nonce (uint64 as string))"` } type NFTDataResponse struct { diff --git a/packages/webapi/models/core_blocklog.go b/packages/webapi/models/core_blocklog.go index 65f5e99948..65ee5a5fb2 100644 --- a/packages/webapi/models/core_blocklog.go +++ b/packages/webapi/models/core_blocklog.go @@ -20,16 +20,16 @@ type ControlAddressesResponse struct { type BlockInfoResponse struct { AnchorTransactionID string `json:"anchorTransactionId" swagger:"required"` BlockIndex uint32 `json:"blockIndex" swagger:"required,min(1)"` - GasBurned uint64 `json:"gasBurned" swagger:"required"` - GasFeeCharged uint64 `json:"gasFeeCharged" swagger:"required"` + GasBurned string `json:"gasBurned" swagger:"required,desc(The burned gas (uint64 as string))"` + GasFeeCharged string `json:"gasFeeCharged" swagger:"required,desc(The charged gas fee (uint64 as string))"` L1CommitmentHash string `json:"l1CommitmentHash" swagger:"required"` NumOffLedgerRequests uint16 `json:"numOffLedgerRequests" swagger:"required,min(1)"` NumSuccessfulRequests uint16 `json:"numSuccessfulRequests" swagger:"required,min(1)"` PreviousL1CommitmentHash string `json:"previousL1CommitmentHash" swagger:"required"` Timestamp time.Time `json:"timestamp" swagger:"required"` - TotalBaseTokensInL2Accounts uint64 `json:"totalBaseTokensInL2Accounts" swagger:"required"` + TotalBaseTokensInL2Accounts string `json:"totalBaseTokensInL2Accounts" swagger:"required,desc(The total L2 base tokens (uint64 as string))"` TotalRequests uint16 `json:"totalRequests" swagger:"required,min(1)"` - TotalStorageDeposit uint64 `json:"totalStorageDeposit" swagger:"required"` + TotalStorageDeposit string `json:"totalStorageDeposit" swagger:"required,desc(The total storage deposit (uint64 as string))"` TransactionSubEssenceHash string `json:"transactionSubEssenceHash" swagger:"required"` } @@ -44,16 +44,16 @@ func MapBlockInfoResponse(info *blocklog.BlockInfo) *BlockInfoResponse { return &BlockInfoResponse{ AnchorTransactionID: info.AnchorTransactionID.ToHex(), BlockIndex: info.BlockIndex, - GasBurned: info.GasBurned, - GasFeeCharged: info.GasFeeCharged, + GasBurned: iotago.EncodeUint64(info.GasBurned), + GasFeeCharged: iotago.EncodeUint64(info.GasFeeCharged), L1CommitmentHash: commitmentHash, NumOffLedgerRequests: info.NumOffLedgerRequests, NumSuccessfulRequests: info.NumSuccessfulRequests, PreviousL1CommitmentHash: info.PreviousL1Commitment.BlockHash().String(), Timestamp: info.Timestamp, - TotalBaseTokensInL2Accounts: info.TotalBaseTokensInL2Accounts, + TotalBaseTokensInL2Accounts: iotago.EncodeUint64(info.TotalBaseTokensInL2Accounts), TotalRequests: info.TotalRequests, - TotalStorageDeposit: info.TotalStorageDeposit, + TotalStorageDeposit: iotago.EncodeUint64(info.TotalStorageDeposit), TransactionSubEssenceHash: transactionEssenceHash, } } @@ -68,7 +68,7 @@ type BlockReceiptError struct { } type Assets struct { - BaseTokens uint64 `json:"baseTokens" swagger:"required"` + BaseTokens string `json:"baseTokens" swagger:"required,desc(The base tokens (uint64 as string))"` NativeTokens []*NativeToken `json:"nativeTokens" swagger:"required"` NFTs []string `json:"nfts" swagger:"required"` } @@ -79,7 +79,7 @@ func mapAssets(assets *isc.Assets) *Assets { } ret := &Assets{ - BaseTokens: assets.BaseTokens, + BaseTokens: iotago.EncodeUint64(assets.BaseTokens), NativeTokens: MapNativeTokens(assets.NativeTokens), NFTs: make([]string, len(assets.NFTs)), } @@ -94,7 +94,7 @@ type RequestDetail struct { Allowance *Assets `json:"allowance" swagger:"required"` CallTarget isc.CallTarget `json:"callTarget" swagger:"required"` Assets *Assets `json:"fungibleTokens" swagger:"required"` - GasGudget uint64 `json:"gasGudget" swagger:"required"` + GasGudget string `json:"gasGudget,string" swagger:"required,desc(The gas budget (uint64 as string))"` IsEVM bool `json:"isEVM" swagger:"required"` IsOffLedger bool `json:"isOffLedger" swagger:"required"` NFT *NFTDataResponse `json:"nft" swagger:"required"` @@ -111,7 +111,7 @@ func MapRequestDetail(request isc.Request) *RequestDetail { Allowance: mapAssets(request.Allowance()), CallTarget: request.CallTarget(), Assets: mapAssets(request.Assets()), - GasGudget: gasBudget, + GasGudget: iotago.EncodeUint64(gasBudget), IsEVM: isEVM, IsOffLedger: request.IsOffLedger(), NFT: MapNFTDataResponse(request.NFT()), @@ -125,10 +125,10 @@ func MapRequestDetail(request isc.Request) *RequestDetail { type RequestReceiptResponse struct { BlockIndex uint32 `json:"blockIndex" swagger:"required,min(1)"` Error *BlockReceiptError `json:"error" swagger:""` - GasBudget uint64 `json:"gasBudget" swagger:"required"` + GasBudget string `json:"gasBudget" swagger:"required,desc(The gas budget (uint64 as string))"` GasBurnLog *gas.BurnLog `json:"gasBurnLog" swagger:"required"` - GasBurned uint64 `json:"gasBurned" swagger:"required"` - GasFeeCharged uint64 `json:"gasFeeCharged" swagger:"required"` + GasBurned string `json:"gasBurned" swagger:"required,desc(The burned gas (uint64 as string))"` + GasFeeCharged string `json:"gasFeeCharged" swagger:"required,desc(The charged gas fee (uint64 as string))"` Request *RequestDetail `json:"request" swagger:"required"` RequestIndex uint16 `json:"requestIndex" swagger:"required,min(1)"` } diff --git a/packages/webapi/models/mock/ChainInfoResponse.json b/packages/webapi/models/mock/ChainInfoResponse.json index 5584984575..5eb832c1c6 100644 --- a/packages/webapi/models/mock/ChainInfoResponse.json +++ b/packages/webapi/models/mock/ChainInfoResponse.json @@ -5,7 +5,7 @@ "description": "", "gasFeePolicy": { "gasFeeTokenId": "", - "gasPerToken": 100, + "gasPerToken": "100", "validatorFeeShare": 0 }, "maxBlobSize": 2000000, diff --git a/packages/webapi/models/mock/ChainInfoResponse[].json b/packages/webapi/models/mock/ChainInfoResponse[].json index da94f4f63f..bb310f6616 100644 --- a/packages/webapi/models/mock/ChainInfoResponse[].json +++ b/packages/webapi/models/mock/ChainInfoResponse[].json @@ -6,7 +6,7 @@ "description": "", "gasFeePolicy": { "gasFeeTokenId": "", - "gasPerToken": 100, + "gasPerToken": "100", "validatorFeeShare": 0 }, "maxBlobSize": 2000000, diff --git a/packages/webapi/models/vm.go b/packages/webapi/models/vm.go index 7d3dc641db..c31b239eab 100644 --- a/packages/webapi/models/vm.go +++ b/packages/webapi/models/vm.go @@ -33,9 +33,9 @@ func MapReceiptError(err *isc.VMError) *ReceiptError { type ReceiptResponse struct { Request string `json:"request" swagger:"required"` Error *ReceiptError `json:"error"` - GasBudget uint64 `json:"gasBudget" swagger:"required"` - GasBurned uint64 `json:"gasBurned" swagger:"required"` - GasFeeCharged uint64 `json:"gasFeeCharged" swagger:"required"` + GasBudget string `json:"gasBudget" swagger:"required,desc(The gas budget (uint64 as string))"` + GasBurned string `json:"gasBurned" swagger:"required,desc(The burned gas (uint64 as string))"` + GasFeeCharged string `json:"gasFeeCharged" swagger:"required,desc(The charged gas fee (uint64 as string))"` BlockIndex uint32 `json:"blockIndex" swagger:"required,min(1)"` RequestIndex uint16 `json:"requestIndex" swagger:"required,min(1)"` GasBurnLog []gas.BurnRecord `json:"gasBurnLog" swagger:"required"` @@ -53,9 +53,9 @@ func MapReceiptResponse(receipt *isc.Receipt, resolvedError *isc.VMError) *Recei Error: MapReceiptError(resolvedError), BlockIndex: receipt.BlockIndex, RequestIndex: receipt.RequestIndex, - GasBudget: receipt.GasBudget, - GasBurned: receipt.GasBurned, - GasFeeCharged: receipt.GasFeeCharged, + GasBudget: iotago.EncodeUint64(receipt.GasBudget), + GasBurned: iotago.EncodeUint64(receipt.GasBurned), + GasFeeCharged: iotago.EncodeUint64(receipt.GasFeeCharged), GasBurnLog: burnRecords, } } diff --git a/tools/api-gen/main.go b/tools/api-gen/main.go index 93696aceec..f17a1c54ac 100644 --- a/tools/api-gen/main.go +++ b/tools/api-gen/main.go @@ -12,7 +12,7 @@ import ( "github.com/iotaledger/wasp/core/app" "github.com/iotaledger/wasp/packages/authentication" "github.com/iotaledger/wasp/packages/cryptolib" - v2 "github.com/iotaledger/wasp/packages/webapi/v2" + v2 "github.com/iotaledger/wasp/packages/webapi" "github.com/iotaledger/wasp/plugins/webapi" ) From c1e9fcdb230a73feb49272720581f7461ad7b092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 20:46:22 +0100 Subject: [PATCH 19/39] Adjust cluster tests --- tools/cluster/tests/access_nodes_test.go | 4 +- tools/cluster/tests/account_test.go | 4 +- .../cluster/tests/advanced_inccounter_test.go | 2 +- tools/cluster/tests/blob_test.go | 60 +++++++++++++------ tools/cluster/tests/deploy_test.go | 2 +- tools/cluster/tests/env.go | 4 +- tools/cluster/tests/evm_jsonrpc_test.go | 2 +- tools/cluster/tests/inccounter_test.go | 2 +- tools/cluster/tests/maintenance_test.go | 2 +- tools/cluster/tests/missing_requests_test.go | 2 +- .../cluster/tests/offledger_requests_test.go | 2 +- tools/cluster/tests/post_test.go | 45 +++++++++----- tools/cluster/tests/publisher_test.go | 2 +- tools/cluster/tests/reboot_test.go | 4 +- tools/cluster/tests/rotation_test.go | 2 +- tools/cluster/tests/spam_test.go | 2 +- tools/cluster/tests/transfer_test.go | 2 +- tools/cluster/tests/util.go | 25 ++++---- 18 files changed, 107 insertions(+), 61 deletions(-) diff --git a/tools/cluster/tests/access_nodes_test.go b/tools/cluster/tests/access_nodes_test.go index 46d3600c1c..ee570d2cc7 100644 --- a/tools/cluster/tests/access_nodes_test.go +++ b/tools/cluster/tests/access_nodes_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/client/scclient" + "github.com/iotaledger/wasp/clients/chainclient" + "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" diff --git a/tools/cluster/tests/account_test.go b/tools/cluster/tests/account_test.go index efb57a2762..c9fd38bce2 100644 --- a/tools/cluster/tests/account_test.go +++ b/tools/cluster/tests/account_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/parameters" @@ -90,7 +90,7 @@ func testAccounts(e *ChainEnv) { receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, reqTx, 10*time.Second) require.NoError(e.t, err) - fees := receipts[0].GasFeeCharged + fees := uint64(receipts[0].GasFeeCharged) e.checkBalanceOnChain(isc.NewAgentID(myAddress), isc.BaseTokenID, transferBaseTokens-fees) for i := range e.Chain.CommitteeNodes { diff --git a/tools/cluster/tests/advanced_inccounter_test.go b/tools/cluster/tests/advanced_inccounter_test.go index 71fc582d0e..54253463bd 100644 --- a/tools/cluster/tests/advanced_inccounter_test.go +++ b/tools/cluster/tests/advanced_inccounter_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/testutil" diff --git a/tools/cluster/tests/blob_test.go b/tools/cluster/tests/blob_test.go index 180740984d..914fc30593 100644 --- a/tools/cluster/tests/blob_test.go +++ b/tools/cluster/tests/blob_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "os" "testing" @@ -8,7 +9,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/dict" @@ -16,30 +19,53 @@ import ( ) func (e *ChainEnv) getBlobInfo(hash hashing.HashValue) map[string]uint32 { - ret, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, blob.Contract.Hname(), blob.ViewGetBlobInfo.Name, - dict.Dict{ - blob.ParamHash: hash[:], - }) + args := dict.Dict{ + blob.ParamHash: hash[:], + } + + jsonArgs := clients.JSONDictToAPIJSONDict(args.JSONDict()) + + result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: blob.Contract.Hname().String(), + FunctionHName: blob.ViewGetBlobInfo.Hname().String(), + Arguments: jsonArgs, + }).Execute() + require.NoError(e.t, err) - decoded, err := blob.DecodeSizesMap(ret) + decodedDict, err := clients.APIJsonDictToDict(*result) + require.NoError(e.t, err) + + decoded, err := blob.DecodeSizesMap(decodedDict) require.NoError(e.t, err) return decoded } func (e *ChainEnv) getBlobFieldValue(blobHash hashing.HashValue, field string) []byte { - v, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, blob.Contract.Hname(), blob.ViewGetBlobField.Name, - dict.Dict{ - blob.ParamHash: blobHash[:], - blob.ParamField: []byte(field), - }) + args := dict.Dict{ + blob.ParamHash: blobHash[:], + blob.ParamField: []byte(field), + } + + jsonArgs := clients.JSONDictToAPIJSONDict(args.JSONDict()) + + result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: blob.Contract.Hname().String(), + FunctionHName: blob.ViewGetBlobField.Hname().String(), + Arguments: jsonArgs, + }).Execute() + + decodedDict, err := clients.APIJsonDictToDict(*result) require.NoError(e.t, err) - if v.IsEmpty() { + + require.NoError(e.t, err) + if decodedDict.IsEmpty() { return nil } - ret, err := v.Get(blob.ParamBytes) + ret, err := decodedDict.Get(blob.ParamBytes) require.NoError(e.t, err) + return ret } @@ -108,9 +134,9 @@ func testBlobStoreManyBlobsNoEncoding(t *testing.T, e *ChainEnv) { _, err = e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, reqTx, 30*time.Second) require.NoError(t, err) - expectedHash, _, receipt, err := chClient.UploadBlob(fv) + expectedHash, _, receipt, err := chClient.UploadBlob(context.Background(), fv) require.NoError(t, err) - require.Empty(t, receipt.ResolvedError) + require.Empty(t, receipt.Error) t.Logf("expected hash: %s", expectedHash.String()) sizes := e.getBlobInfo(expectedHash) diff --git a/tools/cluster/tests/deploy_test.go b/tools/cluster/tests/deploy_test.go index 7ac5842b23..cfadd0c2aa 100644 --- a/tools/cluster/tests/deploy_test.go +++ b/tools/cluster/tests/deploy_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" diff --git a/tools/cluster/tests/env.go b/tools/cluster/tests/env.go index 6b98cbc867..3d664d2bb2 100644 --- a/tools/cluster/tests/env.go +++ b/tools/cluster/tests/env.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/client/scclient" + "github.com/iotaledger/wasp/clients/chainclient" + "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" diff --git a/tools/cluster/tests/evm_jsonrpc_test.go b/tools/cluster/tests/evm_jsonrpc_test.go index 55ff6e17a8..ca630fb66a 100644 --- a/tools/cluster/tests/evm_jsonrpc_test.go +++ b/tools/cluster/tests/evm_jsonrpc_test.go @@ -15,7 +15,7 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/evm/evmtest" "github.com/iotaledger/wasp/packages/evm/jsonrpc/jsonrpctest" "github.com/iotaledger/wasp/packages/isc" diff --git a/tools/cluster/tests/inccounter_test.go b/tools/cluster/tests/inccounter_test.go index 76f30dee96..46ca945c96 100644 --- a/tools/cluster/tests/inccounter_test.go +++ b/tools/cluster/tests/inccounter_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv" "github.com/iotaledger/wasp/packages/kv/codec" diff --git a/tools/cluster/tests/maintenance_test.go b/tools/cluster/tests/maintenance_test.go index 84242a0bc4..b9d983d27f 100644 --- a/tools/cluster/tests/maintenance_test.go +++ b/tools/cluster/tests/maintenance_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" diff --git a/tools/cluster/tests/missing_requests_test.go b/tools/cluster/tests/missing_requests_test.go index 4defd7f86d..64e71a42e0 100644 --- a/tools/cluster/tests/missing_requests_test.go +++ b/tools/cluster/tests/missing_requests_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" diff --git a/tools/cluster/tests/offledger_requests_test.go b/tools/cluster/tests/offledger_requests_test.go index 1ec91b4499..f25b44bb9e 100644 --- a/tools/cluster/tests/offledger_requests_test.go +++ b/tools/cluster/tests/offledger_requests_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" diff --git a/tools/cluster/tests/post_test.go b/tools/cluster/tests/post_test.go index 4dc04908c6..452f73dd5b 100644 --- a/tools/cluster/tests/post_test.go +++ b/tools/cluster/tests/post_test.go @@ -1,13 +1,16 @@ package tests import ( + "context" "testing" "time" "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" @@ -48,15 +51,25 @@ func deployInccounter42(e *ChainEnv) *isc.ContractAgentID { require.EqualValues(e.t, 42, counterValue) } - // test calling root.FuncFindContractByName view function using client - ret, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, root.Contract.Hname(), root.ViewFindContract.Name, - dict.Dict{ - root.ParamHname: hname.Bytes(), - }) + args := dict.Dict{ + root.ParamHname: hname.Bytes(), + } + + jsonArgs := clients.JSONDictToAPIJSONDict(args.JSONDict()) + + result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: root.Contract.Hname().String(), + FunctionHName: root.ViewFindContract.Hname().String(), + Arguments: jsonArgs, + }).Execute() + + decodedDict, err := clients.APIJsonDictToDict(*result) require.NoError(e.t, err) - recb, err := ret.Get(root.ParamContractRecData) + + recb, err := decodedDict.Get(root.ParamContractRecData) require.NoError(e.t, err) + rec, err := root.ContractRecordFromBytes(recb) require.NoError(e.t, err) require.EqualValues(e.t, description, rec.Description) @@ -75,12 +88,16 @@ func (e *ChainEnv) getNativeContractCounter(hname isc.Hname) int64 { } func (e *ChainEnv) getCounterForNode(hname isc.Hname, nodeIndex int) int64 { - ret, err := e.Chain.Cluster.WaspClient(nodeIndex).CallView( - e.Chain.ChainID, hname, "getCounter", nil, - ) + result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: hname.String(), + FunctionName: "getCounter", + }).Execute() + + decodedDict, err := clients.APIJsonDictToDict(*result) require.NoError(e.t, err) - counter, err := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter), 0) + counter, err := codec.DecodeInt64(decodedDict.MustGet(inccounter.VarCounter), 0) require.NoError(e.t, err) return counter @@ -182,7 +199,7 @@ func testPost5Requests(t *testing.T, e *ChainEnv) { require.NoError(t, err) receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, tx, 30*time.Second) require.NoError(t, err) - onChainBalance += baseTokesSent - receipts[0].GasFeeCharged + onChainBalance += baseTokesSent - uint64(receipts[0].GasFeeCharged) } e.expectCounter(contractID.Hname(), 42+5) @@ -215,7 +232,7 @@ func testPost5AsyncRequests(t *testing.T, e *ChainEnv) { for i := 0; i < 5; i++ { receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, tx[i], 30*time.Second) require.NoError(t, err) - onChainBalance += baseTokesSent - receipts[0].GasFeeCharged + onChainBalance += baseTokesSent - uint64(receipts[0].GasFeeCharged) } e.expectCounter(contractID.Hname(), 42+5) diff --git a/tools/cluster/tests/publisher_test.go b/tools/cluster/tests/publisher_test.go index e06dafe75d..be022b6951 100644 --- a/tools/cluster/tests/publisher_test.go +++ b/tools/cluster/tests/publisher_test.go @@ -14,7 +14,7 @@ import ( // without this import it won't work, no messages will be received by the client socket... _ "go.nanomsg.org/mangos/v3/transport/all" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/util" diff --git a/tools/cluster/tests/reboot_test.go b/tools/cluster/tests/reboot_test.go index c259114f8e..8acdcf512f 100644 --- a/tools/cluster/tests/reboot_test.go +++ b/tools/cluster/tests/reboot_test.go @@ -8,8 +8,8 @@ import ( "github.com/samber/lo" "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" - "github.com/iotaledger/wasp/client/scclient" + "github.com/iotaledger/wasp/clients/chainclient" + "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv" diff --git a/tools/cluster/tests/rotation_test.go b/tools/cluster/tests/rotation_test.go index 85f810426d..5fe57e0b9d 100644 --- a/tools/cluster/tests/rotation_test.go +++ b/tools/cluster/tests/rotation_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/isc/coreutil" diff --git a/tools/cluster/tests/spam_test.go b/tools/cluster/tests/spam_test.go index f7af5d9747..e55b641606 100644 --- a/tools/cluster/tests/spam_test.go +++ b/tools/cluster/tests/spam_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" diff --git a/tools/cluster/tests/transfer_test.go b/tools/cluster/tests/transfer_test.go index b9d17cc4a2..6b5156ef92 100644 --- a/tools/cluster/tests/transfer_test.go +++ b/tools/cluster/tests/transfer_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/utxodb" "github.com/iotaledger/wasp/packages/vm/core/accounts" diff --git a/tools/cluster/tests/util.go b/tools/cluster/tests/util.go index 00c9ac6463..62e90d9571 100644 --- a/tools/cluster/tests/util.go +++ b/tools/cluster/tests/util.go @@ -2,12 +2,14 @@ package tests import ( "bytes" + "context" "fmt" "testing" "time" "github.com/stretchr/testify/require" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" @@ -104,14 +106,12 @@ func (e *ChainEnv) checkBalanceOnChain(agentID isc.AgentID, assetID []byte, expe } func (e *ChainEnv) getAccountsOnChain() []isc.AgentID { - r, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, accounts.Contract.Hname(), accounts.ViewAccounts.Name, nil, - ) + accounts, _, err := e.Chain.Cluster.WaspClient(0).CorecontractsApi.AccountsGetAccounts(context.Background(), e.Chain.ChainID.String()).Execute() require.NoError(e.t, err) ret := make([]isc.AgentID, 0) - for key := range r { - aid, err := isc.AgentIDFromBytes([]byte(key)) + for _, address := range accounts.Accounts { + aid, err := isc.NewAgentIDFromString(address) require.NoError(e.t, err) ret = append(ret, aid) @@ -125,13 +125,16 @@ func (e *ChainEnv) getBalancesOnChain() map[string]*isc.Assets { ret := make(map[string]*isc.Assets) acc := e.getAccountsOnChain() for _, agentID := range acc { - r, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, accounts.Contract.Hname(), accounts.ViewBalance.Name, - dict.Dict{ - accounts.ParamAgentID: agentID.Bytes(), - }, - ) + balance, _, err := e.Chain.Cluster. + WaspClient(0). + CorecontractsApi. + AccountsGetAccountBalance(context.Background(), e.Chain.ChainID.String(), agentID.String()). + Execute() + require.NoError(e.t, err) + + isc.NewAssets(balance.BaseTokens, balance.NativeTokens.([]*iotago.NativeToken), nil) + ret[string(agentID.Bytes())], err = isc.AssetsFromDict(r) require.NoError(e.t, err) } From b9ddbac821ac3f90b33a1d1bfaf407c426dfa8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 21:50:49 +0100 Subject: [PATCH 20/39] Update swagger doc --- packages/webapi/SWAGGER_TRAPS.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/webapi/SWAGGER_TRAPS.md diff --git a/packages/webapi/SWAGGER_TRAPS.md b/packages/webapi/SWAGGER_TRAPS.md new file mode 100644 index 0000000000..2b1d2e35fa --- /dev/null +++ b/packages/webapi/SWAGGER_TRAPS.md @@ -0,0 +1,30 @@ +This page contains requirements to create a proper API documentation and client generation. + +# uints (16, 32) + +UInts are unsupported by the Swagger standard. It only knows signed integers and floats. + +Usually openapi generators have defined the rule, that if the documented property contains a min value of at least 0, it is treated as an uint. +This allows generation of clients with proper uint typing. + +Therefore, all Uints of any size need to have a min(0) or min(1) documented. See: `models/chain.go` => `ChainInfoResponse`: `MaxBlobSize` + +## uints in path parameters + +Paths like `/accounts/account/:id` are mostly documented with `.AddParamPath`. It automatically gets the proper type and documents it. + +Except for uints. If the query path requires uints, it is required to use `.AddParamPathNested` instead. Those properties require a `min(0)` or `min(1)`. + +See: `controllers/corecontracts/controller.go` at route `chains/:chainID/core/blocklog/blocks/:blockIndex` => `getBlockInfo`: `blockIndex`. + +Those properties need to be named the same way as the parameters in the route. The linter will complain about unused properties. +Therefore, a `//nolint:unused` is required in these cases. + +## uint 64 + +UInt64s are unsupported in JavaScript when consumed via JSON. Therefore, all uint64s are serialized as strings by the server. + +The documentation should point out, that these strings are to be treated as uint64s. + +See: `models/core_accounts.go` => `AccountNonceResponse`: `Nonce` + From 2d37fddd964ca5a51ecb90aae46d6627697a08c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 22:44:01 +0100 Subject: [PATCH 21/39] Update webapi and client models --- clients/apiclient/.openapi-generator/VERSION | 2 +- clients/apiclient/api/openapi.yaml | 584 ++++++++++-------- clients/apiclient/api_auth.go | 2 +- clients/apiclient/api_chains.go | 68 +- clients/apiclient/api_corecontracts.go | 458 ++++++++++++-- clients/apiclient/api_metrics.go | 10 +- clients/apiclient/api_node.go | 40 +- clients/apiclient/api_requests.go | 76 ++- clients/apiclient/api_users.go | 14 +- clients/apiclient/client.go | 4 +- clients/apiclient/configuration.go | 8 +- .../apiclient/docs/AccountNonceResponse.md | 10 +- clients/apiclient/docs/Assets.md | 10 +- clients/apiclient/docs/AssetsResponse.md | 10 +- clients/apiclient/docs/AuthApi.md | 2 +- clients/apiclient/docs/BaseToken.md | 10 +- clients/apiclient/docs/Blob.md | 10 +- clients/apiclient/docs/BlockInfoResponse.md | 34 +- clients/apiclient/docs/BurnRecord.md | 10 +- clients/apiclient/docs/CallTarget.md | 18 +- clients/apiclient/docs/ChainsApi.md | 32 +- .../apiclient/docs/ConsensusPipeMetrics.md | 42 +- .../apiclient/docs/ContractInfoResponse.md | 10 +- clients/apiclient/docs/CorecontractsApi.md | 134 ++-- clients/apiclient/docs/GasFeePolicy.md | 10 +- .../apiclient/docs/GovChainInfoResponse.md | 26 +- clients/apiclient/docs/L1Params.md | 10 +- clients/apiclient/docs/MetricsApi.md | 10 +- clients/apiclient/docs/MilestoneInfo.md | 16 +- clients/apiclient/docs/NodeApi.md | 28 +- clients/apiclient/docs/Output.md | 10 +- .../docs/PeeringNodeStatusResponse.md | 10 +- clients/apiclient/docs/ProtocolParameters.md | 10 +- clients/apiclient/docs/ReceiptError.md | 10 +- clients/apiclient/docs/ReceiptResponse.md | 26 +- clients/apiclient/docs/RentStructure.md | 18 +- clients/apiclient/docs/RequestDetail.md | 10 +- .../apiclient/docs/RequestReceiptResponse.md | 26 +- clients/apiclient/docs/RequestsApi.md | 24 +- clients/apiclient/docs/UsersApi.md | 14 +- .../apiclient/model_account_list_response.go | 2 +- .../apiclient/model_account_nfts_response.go | 2 +- .../apiclient/model_account_nonce_response.go | 15 +- clients/apiclient/model_add_user_request.go | 2 +- .../model_alias_output_metric_item.go | 2 +- clients/apiclient/model_assets.go | 15 +- clients/apiclient/model_assets_response.go | 15 +- clients/apiclient/model_auth_info_model.go | 2 +- clients/apiclient/model_base_token.go | 14 +- clients/apiclient/model_blob.go | 14 +- clients/apiclient/model_blob_info_response.go | 2 +- clients/apiclient/model_blob_list_response.go | 2 +- .../apiclient/model_blob_value_response.go | 2 +- .../apiclient/model_block_info_response.go | 48 +- .../apiclient/model_block_receipt_error.go | 2 +- .../model_block_receipts_response.go | 2 +- clients/apiclient/model_burn_log.go | 2 +- clients/apiclient/model_burn_record.go | 14 +- clients/apiclient/model_call_target.go | 24 +- .../apiclient/model_chain_info_response.go | 2 +- clients/apiclient/model_chain_metrics.go | 2 +- clients/apiclient/model_chain_record.go | 2 +- .../model_committee_info_response.go | 2 +- clients/apiclient/model_committee_node.go | 2 +- .../apiclient/model_consensus_pipe_metrics.go | 54 +- .../model_consensus_workflow_metrics.go | 2 +- .../model_contract_call_view_request.go | 2 +- .../apiclient/model_contract_info_response.go | 18 +- .../model_control_addresses_response.go | 2 +- clients/apiclient/model_dk_shares_info.go | 2 +- .../apiclient/model_dk_shares_post_request.go | 2 +- .../model_error_message_format_response.go | 2 +- clients/apiclient/model_events_response.go | 2 +- .../model_foundry_output_response.go | 2 +- clients/apiclient/model_gas_fee_policy.go | 14 +- .../model_gov_chain_info_response.go | 34 +- clients/apiclient/model_in_output.go | 2 +- .../apiclient/model_in_output_metric_item.go | 2 +- clients/apiclient/model_in_state_output.go | 2 +- .../model_in_state_output_metric_item.go | 2 +- clients/apiclient/model_info_response.go | 2 +- .../apiclient/model_interface_metric_item.go | 2 +- clients/apiclient/model_item.go | 2 +- clients/apiclient/model_json_dict.go | 2 +- clients/apiclient/model_l1_params.go | 14 +- clients/apiclient/model_login_request.go | 2 +- clients/apiclient/model_login_response.go | 2 +- clients/apiclient/model_milestone_info.go | 26 +- .../apiclient/model_milestone_metric_item.go | 2 +- clients/apiclient/model_native_token.go | 2 +- ...model_native_token_id_registry_response.go | 2 +- clients/apiclient/model_nft_data_response.go | 2 +- .../model_node_owner_certificate_request.go | 2 +- .../model_node_owner_certificate_response.go | 2 +- clients/apiclient/model_off_ledger_request.go | 2 +- clients/apiclient/model_on_ledger_request.go | 2 +- .../model_on_ledger_request_metric_item.go | 2 +- clients/apiclient/model_output.go | 14 +- clients/apiclient/model_output_id.go | 2 +- .../model_peering_node_identity_response.go | 2 +- .../model_peering_node_status_response.go | 14 +- .../apiclient/model_peering_trust_request.go | 2 +- .../apiclient/model_protocol_parameters.go | 14 +- .../model_publisher_state_transaction_item.go | 2 +- clients/apiclient/model_receipt_error.go | 14 +- clients/apiclient/model_receipt_response.go | 37 +- clients/apiclient/model_rent_structure.go | 24 +- clients/apiclient/model_request_detail.go | 15 +- .../apiclient/model_request_ids_response.go | 2 +- .../model_request_processed_response.go | 2 +- .../model_request_receipt_response.go | 37 +- clients/apiclient/model_state_response.go | 2 +- clients/apiclient/model_state_transaction.go | 2 +- clients/apiclient/model_transaction.go | 2 +- .../model_transaction_id_metric_item.go | 2 +- .../model_transaction_metric_item.go | 2 +- .../apiclient/model_tx_inclusion_state_msg.go | 2 +- ...odel_tx_inclusion_state_msg_metric_item.go | 2 +- .../model_update_user_password_request.go | 2 +- .../model_update_user_permissions_request.go | 2 +- clients/apiclient/model_user.go | 2 +- .../apiclient/model_utxo_input_metric_item.go | 2 +- clients/apiclient/model_validation_error.go | 2 +- clients/apiclient/model_version_response.go | 2 +- clients/apiclient/response.go | 2 +- clients/apiclient/utils.go | 12 +- clients/auth/auth.go | 47 -- .../webapi/controllers/chain/contracts.go | 2 +- .../controllers/corecontracts/controller.go | 3 +- .../webapi/controllers/requests/controller.go | 1 + .../controllers/requests/waitforrequest.go | 21 +- packages/webapi/models/chain.go | 9 +- packages/webapi/services/chain.go | 10 +- tools/api-gen/apigen.sh | 6 + tools/wasp-cli/chain/accounts.go | 2 +- tools/wasp-cli/chain/blocklog.go | 3 - tools/wasp-cli/chain/listcontracts.go | 32 +- tools/wasp-cli/util/tx.go | 7 +- 138 files changed, 1584 insertions(+), 1041 deletions(-) delete mode 100644 clients/auth/auth.go create mode 100644 tools/api-gen/apigen.sh diff --git a/clients/apiclient/.openapi-generator/VERSION b/clients/apiclient/.openapi-generator/VERSION index d6b4ec4aa7..717311e32e 100644 --- a/clients/apiclient/.openapi-generator/VERSION +++ b/clients/apiclient/.openapi-generator/VERSION @@ -1 +1 @@ -6.3.0-SNAPSHOT \ No newline at end of file +unset \ No newline at end of file diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 54577a67ea..a64a814090 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2,27 +2,20 @@ openapi: 3.0.1 info: description: REST API for the Wasp node title: Wasp API - version: 0.4.0-alpha.8-16-g83edf92b9 + version: v0.4.0-alpha.8-60-g8b0f75e6d externalDocs: description: Find out more about Wasp url: https://wiki.iota.org/smart-contracts/overview servers: -- url: http://localhost:9090/ -- url: https://localhost:9090/ +- url: / tags: - name: auth - name: chains -- name: chains -- name: metrics - name: metrics - name: node -- name: node - name: requests -- name: requests -- name: users - name: users - name: corecontracts -- name: corecontracts paths: /auth: post: @@ -61,7 +54,7 @@ paths: summary: Get information about the current authentication mode tags: - auth - /chains: + /v2/chains: get: operationId: getChains responses: @@ -84,7 +77,7 @@ paths: summary: Get a list of all chains tags: - chains - /chains/{chainID}: + /v2/chains/{chainID}: get: operationId: getChainInfo parameters: @@ -113,7 +106,7 @@ paths: summary: Get information about a specific chain tags: - chains - /chains/{chainID}/access-node/{publicKey}: + /v2/chains/{chainID}/access-node/{publicKey}: delete: operationId: removeAccessNode parameters: @@ -178,7 +171,7 @@ paths: summary: Configure a trusted node to be an access node. tags: - chains - /chains/{chainID}/activate: + /v2/chains/{chainID}/activate: post: operationId: activateChain parameters: @@ -207,7 +200,7 @@ paths: summary: Activate a chain tags: - chains - /chains/{chainID}/chainrecord: + /v2/chains/{chainID}/chainrecord: post: operationId: setChainRecord parameters: @@ -241,7 +234,7 @@ paths: tags: - chains x-codegen-request-body-name: ChainRecord - /chains/{chainID}/committee: + /v2/chains/{chainID}/committee: get: operationId: getCommitteeInfo parameters: @@ -270,7 +263,7 @@ paths: summary: Get information about the deployed committee tags: - chains - /chains/{chainID}/contracts: + /v2/chains/{chainID}/contracts: get: operationId: getContracts parameters: @@ -301,7 +294,7 @@ paths: summary: Get all available chain contracts tags: - chains - /chains/{chainID}/core/accounts: + /v2/chains/{chainID}/core/accounts: get: operationId: accountsGetAccounts parameters: @@ -325,10 +318,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get a list of all accounts tags: - corecontracts - /chains/{chainID}/core/accounts/account/{agentID}/balance: + /v2/chains/{chainID}/core/accounts/account/{agentID}/balance: get: operationId: accountsGetAccountBalance parameters: @@ -359,10 +354,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all assets belonging to an account tags: - corecontracts - /chains/{chainID}/core/accounts/account/{agentID}/nfts: + /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts: get: operationId: accountsGetAccountNFTIDs parameters: @@ -393,10 +390,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all NFT ids belonging to an account tags: - corecontracts - /chains/{chainID}/core/accounts/account/{agentID}/nonce: + /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce: get: operationId: accountsGetAccountNonce parameters: @@ -428,10 +427,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the current nonce of an account tags: - corecontracts - /chains/{chainID}/core/accounts/foundry_output: + /v2/chains/{chainID}/core/accounts/foundry_output/{serialNumber}: get: operationId: accountsGetFoundryOutput parameters: @@ -444,11 +445,12 @@ paths: type: string - description: Serial Number (uint32) in: path - name: chainID_ + name: serialNumber required: true schema: - format: string - type: string + format: int32 + minimum: 1 + type: integer responses: "200": content: @@ -462,10 +464,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the foundry output tags: - corecontracts - /chains/{chainID}/core/accounts/nftdata: + /v2/chains/{chainID}/core/accounts/nftdata: get: operationId: accountsGetNFTData parameters: @@ -496,10 +500,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the NFT data by an ID tags: - corecontracts - /chains/{chainID}/core/accounts/token_registry: + /v2/chains/{chainID}/core/accounts/token_registry: get: operationId: accountsGetNativeTokenIDRegistry parameters: @@ -523,10 +529,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get a list of all registries tags: - corecontracts - /chains/{chainID}/core/accounts/total_assets: + /v2/chains/{chainID}/core/accounts/total_assets: get: operationId: accountsGetTotalAssets parameters: @@ -550,10 +558,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all stored assets tags: - corecontracts - /chains/{chainID}/core/blobs: + /v2/chains/{chainID}/core/blobs: get: operationId: blobsGetAllBlobs parameters: @@ -577,10 +587,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all stored blobs tags: - corecontracts - /chains/{chainID}/core/blobs/{blobHash}: + /v2/chains/{chainID}/core/blobs/{blobHash}: get: operationId: blobsGetBlobInfo parameters: @@ -611,10 +623,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all fields of a blob tags: - corecontracts - /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: + /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: get: operationId: blobsGetBlobValue parameters: @@ -652,10 +666,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the value of the supplied field (key) tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/latest: + /v2/chains/{chainID}/core/blocklog/blocks/latest: get: operationId: blocklogGetLatestBlockInfo parameters: @@ -679,10 +695,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the block info of the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/latest/receipts: + /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts: get: operationId: blocklogGetRequestReceiptsOfLatestBlock parameters: @@ -706,10 +724,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all receipts of the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/latest/requestids: + /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids: get: operationId: blocklogGetRequestIDsForLatestBlock parameters: @@ -733,10 +753,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the request ids for the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/{blockIndex}: + /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}: get: operationId: blocklogGetBlockInfo parameters: @@ -747,12 +769,13 @@ paths: schema: format: string type: string - - description: Block Index (uint32) + - description: BlockIndex (uint32) in: path name: blockIndex required: true schema: - format: uint32 + format: int32 + minimum: 1 type: integer responses: "200": @@ -767,10 +790,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the block info of a certain block index tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: get: operationId: blocklogGetRequestReceiptsOfBlock parameters: @@ -781,12 +806,13 @@ paths: schema: format: string type: string - - description: Block Index (uint32) + - description: BlockIndex (uint32) in: path name: blockIndex required: true schema: - format: uint32 + format: int32 + minimum: 1 type: integer responses: "200": @@ -801,10 +827,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get all receipts of a certain block tags: - corecontracts - /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: + /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: get: operationId: blocklogGetRequestIDsForBlock parameters: @@ -815,12 +843,13 @@ paths: schema: format: string type: string - - description: Block Index (uint32) + - description: BlockIndex (uint32) in: path name: blockIndex required: true schema: - format: uint32 + format: int32 + minimum: 1 type: integer responses: "200": @@ -835,10 +864,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the request ids for a certain block index tags: - corecontracts - /chains/{chainID}/core/blocklog/controladdresses: + /v2/chains/{chainID}/core/blocklog/controladdresses: get: operationId: blocklogGetControlAddresses parameters: @@ -862,10 +893,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the control addresses tags: - corecontracts - /chains/{chainID}/core/blocklog/events/block/latest: + /v2/chains/{chainID}/core/blocklog/events/block/latest: get: operationId: blocklogGetEventsOfLatestBlock parameters: @@ -889,10 +922,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get events of the latest block tags: - corecontracts - /chains/{chainID}/core/blocklog/events/block/{blockIndex}: + /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}: get: operationId: blocklogGetEventsOfBlock parameters: @@ -903,12 +938,13 @@ paths: schema: format: string type: string - - description: Block Index (uint32) + - description: BlockIndex (uint32) in: path name: blockIndex required: true schema: - format: uint32 + format: int32 + minimum: 1 type: integer responses: "200": @@ -923,10 +959,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get events of a block tags: - corecontracts - /chains/{chainID}/core/blocklog/events/contract/{contractHname}: + /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}: get: operationId: blocklogGetEventsOfContract parameters: @@ -957,10 +995,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get events of a contract tags: - corecontracts - /chains/{chainID}/core/blocklog/events/request/{requestID}: + /v2/chains/{chainID}/core/blocklog/events/request/{requestID}: get: operationId: blocklogGetEventsOfRequest parameters: @@ -991,10 +1031,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get events of a request tags: - corecontracts - /chains/{chainID}/core/blocklog/requests/{requestID}: + /v2/chains/{chainID}/core/blocklog/requests/{requestID}: get: operationId: blocklogGetRequestReceipt parameters: @@ -1025,10 +1067,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the receipt of a certain request id tags: - corecontracts - /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: + /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: get: operationId: blocklogGetRequestIsProcessed parameters: @@ -1059,10 +1103,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the request processing status tags: - corecontracts - /chains/{chainID}/core/errors/{contractHname}/message/{errorID}: + /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}: get: operationId: errorsGetErrorMessageFormat parameters: @@ -1085,8 +1131,9 @@ paths: name: errorID required: true schema: - format: string - type: string + format: int32 + minimum: 1 + type: integer responses: "200": content: @@ -1100,10 +1147,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the error message format of a specific error id tags: - corecontracts - /chains/{chainID}/core/governance/chaininfo: + /v2/chains/{chainID}/core/governance/chaininfo: get: description: "If you are using the common API functions, you most likely rather\ \ want to use '/chains/:chainID' to get information about a chain." @@ -1129,10 +1178,12 @@ paths: schema: $ref: '#/components/schemas/ValidationError' description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] summary: Get the chain info tags: - corecontracts - /chains/{chainID}/deactivate: + /v2/chains/{chainID}/deactivate: post: operationId: deactivateChain parameters: @@ -1161,7 +1212,7 @@ paths: summary: Deactivate a chain tags: - chains - /chains/{chainID}/evm/tx/{txHash}: + /v2/chains/{chainID}/evm/tx/{txHash}: get: operationId: getRequestIDFromEVMTransactionID parameters: @@ -1194,10 +1245,12 @@ paths: format: string type: string description: Request ID not found + security: + - Authorization: [] summary: Get the ISC request ID for the given Ethereum transaction hash tags: - chains - /chains/{chainID}/receipts/{requestID}: + /v2/chains/{chainID}/receipts/{requestID}: get: operationId: getReceipt parameters: @@ -1222,10 +1275,12 @@ paths: schema: $ref: '#/components/schemas/ReceiptResponse' description: ReceiptResponse + security: + - Authorization: [] summary: Get a receipt from a request ID tags: - requests - /chains/{chainID}/requests/{requestID}/wait: + /v2/chains/{chainID}/requests/{requestID}/wait: get: operationId: waitForRequest parameters: @@ -1243,6 +1298,12 @@ paths: schema: format: string type: string + - description: The timeout in seconds + in: query + name: timeoutSeconds + schema: + format: int32 + type: integer responses: "200": content: @@ -1256,10 +1317,12 @@ paths: "408": content: {} description: The waiting time has reached the defined limit + security: + - Authorization: [] summary: Wait until the given request has been processed by the node tags: - requests - /chains/{chainID}/state/{stateKey}: + /v2/chains/{chainID}/state/{stateKey}: get: operationId: getStateValue parameters: @@ -1284,10 +1347,12 @@ paths: schema: $ref: '#/components/schemas/StateResponse' description: Result + security: + - Authorization: [] summary: Fetch the raw value associated with the given key in the chain state tags: - chains - /chains/{chainID}/ws: + /v2/chains/{chainID}/ws: get: operationId: attachToWebsocket parameters: @@ -1302,9 +1367,11 @@ paths: default: content: {} description: successful operation + security: + - Authorization: [] tags: - chains - /metrics/chain/{chainID}: + /v2/metrics/chain/{chainID}: get: operationId: getChainMetrics parameters: @@ -1333,7 +1400,7 @@ paths: summary: Get chain specific metrics. tags: - metrics - /metrics/chain/{chainID}/pipe: + /v2/metrics/chain/{chainID}/pipe: get: operationId: getChainPipeMetrics parameters: @@ -1362,7 +1429,7 @@ paths: summary: Get chain pipe event metrics. tags: - metrics - /metrics/chain/{chainID}/workflow: + /v2/metrics/chain/{chainID}/workflow: get: operationId: getChainWorkflowMetrics parameters: @@ -1391,7 +1458,7 @@ paths: summary: Get chain workflow metrics. tags: - metrics - /metrics/l1: + /v2/metrics/l1: get: operationId: getL1Metrics responses: @@ -1412,7 +1479,7 @@ paths: summary: Get accumulated metrics. tags: - metrics - /node/config: + /v2/node/config: get: operationId: getConfiguration responses: @@ -1421,7 +1488,7 @@ paths: application/json: schema: additionalProperties: - example: "true" + example: info format: string type: string type: object @@ -1437,7 +1504,7 @@ paths: summary: Return the Wasp configuration tags: - node - /node/dks: + /v2/node/dks: post: operationId: generateDKS requestBody: @@ -1466,7 +1533,7 @@ paths: tags: - node x-codegen-request-body-name: DKSharesPostRequest - /node/dks/{sharedAddress}: + /v2/node/dks/{sharedAddress}: get: operationId: getDKSInfo parameters: @@ -1495,7 +1562,7 @@ paths: summary: Get information about the shared address DKS configuration tags: - node - /node/info: + /v2/node/info: get: operationId: getInfo responses: @@ -1516,7 +1583,7 @@ paths: summary: Returns private information about this node. tags: - node - /node/owner/certificate: + /v2/node/owner/certificate: post: operationId: setNodeOwner requestBody: @@ -1545,7 +1612,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /node/peers: + /v2/node/peers: get: operationId: getAllPeers responses: @@ -1568,7 +1635,7 @@ paths: summary: Get basic information about all configured peers tags: - node - /node/peers/identity: + /v2/node/peers/identity: get: operationId: getPeeringIdentity responses: @@ -1589,7 +1656,7 @@ paths: summary: Get basic peer info of the current node tags: - node - /node/peers/trusted: + /v2/node/peers/trusted: delete: operationId: distrustPeer requestBody: @@ -1662,7 +1729,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /node/shutdown: + /v2/node/shutdown: post: operationId: shutdownNode responses: @@ -1680,7 +1747,7 @@ paths: summary: Shut down the node tags: - node - /node/version: + /v2/node/version: get: operationId: getVersion responses: @@ -1690,10 +1757,12 @@ paths: schema: $ref: '#/components/schemas/VersionResponse' description: Returns the version of the node. + security: + - Authorization: [] summary: Returns the node version. tags: - node - /requests/callview: + /v2/requests/callview: post: description: "Execute a view call. Either use HName or Name properties. If both\ \ are supplied, HName are used." @@ -1712,11 +1781,13 @@ paths: schema: $ref: '#/components/schemas/JSONDict_' description: Result + security: + - Authorization: [] summary: Call a view function on a contract by Hname tags: - requests x-codegen-request-body-name: "" - /requests/offledger: + /v2/requests/offledger: post: operationId: offLedger requestBody: @@ -1730,11 +1801,13 @@ paths: "202": content: {} description: Request submitted + security: + - Authorization: [] summary: Post an off-ledger request tags: - requests x-codegen-request-body-name: "" - /users: + /v2/users: get: operationId: getUsers responses: @@ -1785,7 +1858,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /users/{username}: + /v2/users/{username}: delete: operationId: deleteUser parameters: @@ -1845,7 +1918,7 @@ paths: summary: Get a user tags: - users - /users/{username}/password: + /v2/users/{username}/password: put: operationId: changeUserPassword parameters: @@ -1882,7 +1955,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /users/{username}/permissions: + /v2/users/{username}/permissions: put: operationId: changeUserPermissions parameters: @@ -1961,11 +2034,12 @@ components: name: AccountNFTsResponse AccountNonceResponse: example: - nonce: 0 + nonce: nonce properties: nonce: - format: int64 - type: integer + description: The nonce (uint64 as string) + format: string + type: string xml: name: Nonce required: @@ -2017,7 +2091,7 @@ components: lastMessage: $ref: '#/components/schemas/Output' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -2039,7 +2113,7 @@ components: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -2047,8 +2121,9 @@ components: id: id properties: baseTokens: - format: int64 - type: integer + description: The base tokens (uint64 as string) + format: string + type: string xml: name: BaseTokens nativeTokens: @@ -2075,7 +2150,7 @@ components: name: Assets AssetsResponse: example: - baseTokens: 0 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -2083,8 +2158,9 @@ components: id: id properties: baseTokens: - format: int64 - type: integer + description: The base tokens (uint64 as string) + format: string + type: string xml: name: BaseTokens nativeTokens: @@ -2134,7 +2210,7 @@ components: decimals: description: The token decimals example: 6 - format: uint32 + format: int32 type: integer xml: name: Decimals @@ -2193,7 +2269,7 @@ components: xml: name: Hash size: - format: uint32 + format: int32 type: integer xml: name: Size @@ -2210,7 +2286,7 @@ components: properties: fields: additionalProperties: - format: uint32 + format: int32 type: integer type: object xml: @@ -2255,18 +2331,18 @@ components: BlockInfoResponse: example: anchorTransactionId: anchorTransactionId - gasBurned: 6 + gasBurned: gasBurned totalRequests: 1 l1CommitmentHash: l1CommitmentHash blockIndex: 1 numSuccessfulRequests: 1 - gasFeeCharged: 1 - totalStorageDeposit: 9 + gasFeeCharged: gasFeeCharged + totalStorageDeposit: totalStorageDeposit transactionSubEssenceHash: transactionSubEssenceHash numOffLedgerRequests: 1 previousL1CommitmentHash: previousL1CommitmentHash timestamp: 2000-01-23T04:56:07.000+00:00 - totalBaseTokensInL2Accounts: 2 + totalBaseTokensInL2Accounts: totalBaseTokensInL2Accounts properties: anchorTransactionId: format: string @@ -2274,19 +2350,21 @@ components: xml: name: AnchorTransactionID blockIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: name: BlockIndex gasBurned: - format: int64 - type: integer + description: The burned gas (uint64 as string) + format: string + type: string xml: name: GasBurned gasFeeCharged: - format: int64 - type: integer + description: The charged gas fee (uint64 as string) + format: string + type: string xml: name: GasFeeCharged l1CommitmentHash: @@ -2295,13 +2373,13 @@ components: xml: name: L1CommitmentHash numOffLedgerRequests: - format: uint32 + format: int32 minimum: 1 type: integer xml: name: NumOffLedgerRequests numSuccessfulRequests: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -2317,19 +2395,21 @@ components: xml: name: Timestamp totalBaseTokensInL2Accounts: - format: int64 - type: integer + description: The total L2 base tokens (uint64 as string) + format: string + type: string xml: name: TotalBaseTokensInL2Accounts totalRequests: - format: uint32 + format: int32 minimum: 1 type: integer xml: name: TotalRequests totalStorageDeposit: - format: int64 - type: integer + description: The total storage deposit (uint64 as string) + format: string + type: string xml: name: TotalStorageDeposit transactionSubEssenceHash: @@ -2380,16 +2460,16 @@ components: receipts: - gasBurnLog: records: - - code: 1 - gasBurned: 5 - - code: 1 - gasBurned: 5 + - code: 6 + gasBurned: 1 + - code: 6 + gasBurned: 1 request: fungibleTokens: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -2397,17 +2477,17 @@ components: id: id senderAccount: senderAccount isOffLedger: true - gasGudget: 2 + gasGudget: gasGudget requestId: requestId callTarget: - contract: 9 - entryPoint: 3 + contract: 5 + entryPoint: 5 targetAddress: targetAddress allowance: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -2427,24 +2507,24 @@ components: isEVM: true blockIndex: 1 requestIndex: 1 - gasFeeCharged: 2 - gasBudget: 6 - gasBurned: 5 + gasFeeCharged: gasFeeCharged + gasBudget: gasBudget + gasBurned: gasBurned error: errorMessage: errorMessage hash: hash - gasBurnLog: records: - - code: 1 - gasBurned: 5 - - code: 1 - gasBurned: 5 + - code: 6 + gasBurned: 1 + - code: 6 + gasBurned: 1 request: fungibleTokens: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -2452,17 +2532,17 @@ components: id: id senderAccount: senderAccount isOffLedger: true - gasGudget: 2 + gasGudget: gasGudget requestId: requestId callTarget: - contract: 9 - entryPoint: 3 + contract: 5 + entryPoint: 5 targetAddress: targetAddress allowance: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -2482,9 +2562,9 @@ components: isEVM: true blockIndex: 1 requestIndex: 1 - gasFeeCharged: 2 - gasBudget: 6 - gasBurned: 5 + gasFeeCharged: gasFeeCharged + gasBudget: gasBudget + gasBurned: gasBurned error: errorMessage: errorMessage hash: hash @@ -2504,10 +2584,10 @@ components: BurnLog: example: records: - - code: 1 - gasBurned: 5 - - code: 1 - gasBurned: 5 + - code: 6 + gasBurned: 1 + - code: 6 + gasBurned: 1 properties: records: items: @@ -2523,11 +2603,11 @@ components: name: BurnLog BurnRecord: example: - code: 1 - gasBurned: 5 + code: 6 + gasBurned: 1 properties: code: - format: uint32 + format: int32 type: integer xml: name: Code @@ -2544,16 +2624,16 @@ components: name: BurnRecord CallTarget: example: - contract: 9 - entryPoint: 3 + contract: 5 + entryPoint: 5 properties: contract: - format: uint32 + format: int32 type: integer xml: name: Contract entryPoint: - format: uint32 + format: int32 type: integer xml: name: EntryPoint @@ -2572,7 +2652,7 @@ components: description: description gasFeePolicy: gasFeeTokenId: gasFeeTokenId - gasPerToken: 100 + gasPerToken: "100" validatorFeeShare: 1 isActive: true maxBlobSize: 2000000 @@ -2601,7 +2681,7 @@ components: evmChainId: description: The EVM chain ID example: 1074 - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -2617,7 +2697,7 @@ components: maxBlobSize: description: The maximum contract blob size. example: 2000000 - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -2625,7 +2705,7 @@ components: maxEventSize: description: The maximum event size. example: 2000 - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -2633,7 +2713,7 @@ components: maxEventsPerReq: description: The maximum amount of events per request. example: 50 - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -2958,27 +3038,27 @@ components: eventTimerMsgPipeSize: 5 properties: eventACSMsgPipeSize: - format: uint32 + format: int32 type: integer xml: name: EventACSMsgPipeSize eventPeerLogIndexMsgPipeSize: - format: uint32 + format: int32 type: integer xml: name: EventPeerLogIndexMsgPipeSize eventStateTransitionMsgPipeSize: - format: uint32 + format: int32 type: integer xml: name: EventStateTransitionMsgPipeSize eventTimerMsgPipeSize: - format: uint32 + format: int32 type: integer xml: name: EventTimerMsgPipeSize eventVMResultMsgPipeSize: - format: uint32 + format: int32 type: integer xml: name: EventVMResultMsgPipeSize @@ -3014,7 +3094,7 @@ components: properties: currentStateIndex: description: Shows current state index of the consensus - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3213,9 +3293,7 @@ components: name: ContractCallViewRequest ContractInfoResponse: example: - programHash: - - 193 - - 193 + programHash: 0xc102cb078eb7a8c59b65c3682c878e3189cc696b86098d8c5883d08d0d215a87 name: evm description: EVM contract hName: 07cb02c1 @@ -3242,15 +3320,12 @@ components: xml: name: Name programHash: - description: The hash of the contract. - items: - example: 193 - format: uint32 - type: integer - type: array + description: The hash of the contract. (Hex encoded) + example: 0xc102cb078eb7a8c59b65c3682c878e3189cc696b86098d8c5883d08d0d215a87 + format: string + type: string xml: name: ProgramHash - wrapped: true required: - description - hName @@ -3271,7 +3346,7 @@ components: xml: name: GoverningAddress sinceBlockIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3317,7 +3392,7 @@ components: name: PeerIdentities wrapped: true peerIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3338,7 +3413,7 @@ components: name: PublicKeyShares wrapped: true threshold: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3371,14 +3446,14 @@ components: wrapped: true threshold: description: Should be =< len(PeerPublicIdentities) - format: uint32 + format: int32 minimum: 1 type: integer xml: name: Threshold timeoutMS: description: Timeout in milliseconds. - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3426,7 +3501,7 @@ components: FoundryOutputResponse: example: assets: - baseTokens: 0 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -3482,19 +3557,19 @@ components: $ref: '#/components/schemas/gasFeePolicy_' maxBlobSize: description: The maximum contract blob size. - format: uint32 + format: int32 type: integer xml: name: MaxBlobSize maxEventSize: description: The maximum event size. - format: uint32 + format: int32 type: integer xml: name: MaxEventSize maxEventsPerReq: description: The maximum amount of events per request. - format: uint32 + format: int32 type: integer xml: name: MaxEventsPerReq @@ -3543,7 +3618,7 @@ components: lastMessage: $ref: '#/components/schemas/InOutput' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3594,7 +3669,7 @@ components: lastMessage: $ref: '#/components/schemas/InStateOutput' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3680,7 +3755,7 @@ components: xml: name: LastMessage messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -3808,7 +3883,7 @@ components: maxPayloadSize: description: The max payload size example: 32498 - format: uint32 + format: int32 type: integer xml: name: MaxPayloadSize @@ -3870,7 +3945,7 @@ components: timestamp: 5 properties: index: - format: uint32 + format: int32 type: integer xml: name: Index @@ -3880,7 +3955,7 @@ components: xml: name: MilestoneID timestamp: - format: uint32 + format: int32 type: integer xml: name: Timestamp @@ -3899,7 +3974,7 @@ components: lastMessage: $ref: '#/components/schemas/MilestoneInfo' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4105,7 +4180,7 @@ components: lastMessage: $ref: '#/components/schemas/OnLedgerRequest' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4129,7 +4204,7 @@ components: properties: outputType: description: The output type - format: uint32 + format: int32 type: integer xml: name: OutputType @@ -4220,7 +4295,7 @@ components: name: NetID numUsers: description: The amount of users attached to the peer - format: uint32 + format: int32 type: integer xml: name: NumUsers @@ -4266,7 +4341,7 @@ components: name: NetID numUsers: description: The amount of users attached to the peer - format: uint32 + format: int32 type: integer xml: name: NumUsers @@ -4317,7 +4392,7 @@ components: numUsers: description: The amount of users attached to the peer example: 1 - format: uint32 + format: int32 type: integer xml: name: NumUsers @@ -4385,14 +4460,14 @@ components: belowMaxDepth: description: The networks max depth example: 15 - format: uint32 + format: int32 minimum: 1 type: integer xml: name: BelowMaxDepth minPowScore: description: The minimal PoW score - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4416,7 +4491,7 @@ components: version: description: The protocol version example: 2 - format: uint32 + format: int32 type: integer xml: name: Version @@ -4442,7 +4517,7 @@ components: lastMessage: $ref: '#/components/schemas/StateTransaction' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4471,7 +4546,7 @@ components: - parameters properties: contractId: - format: uint32 + format: int32 type: integer xml: name: ContractID @@ -4481,7 +4556,7 @@ components: xml: name: ErrorCode errorId: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4517,16 +4592,16 @@ components: ReceiptResponse: example: gasBurnLog: - - code: 1 - gasBurned: 5 - - code: 1 - gasBurned: 5 + - code: 6 + gasBurned: 1 + - code: 6 + gasBurned: 1 request: request blockIndex: 1 requestIndex: 1 - gasFeeCharged: 2 - gasBudget: 5 - gasBurned: 5 + gasFeeCharged: gasFeeCharged + gasBudget: gasBudget + gasBurned: gasBurned error: messageFormat: messageFormat contractId: 6 @@ -4538,7 +4613,7 @@ components: - parameters properties: blockIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4546,8 +4621,9 @@ components: error: $ref: '#/components/schemas/ReceiptError' gasBudget: - format: int64 - type: integer + description: The gas budget (uint64 as string) + format: string + type: string xml: name: GasBudget gasBurnLog: @@ -4558,13 +4634,15 @@ components: name: GasBurnLog wrapped: true gasBurned: - format: int64 - type: integer + description: The burned gas (uint64 as string) + format: string + type: string xml: name: GasBurned gasFeeCharged: - format: int64 - type: integer + description: The charged gas fee (uint64 as string) + format: string + type: string xml: name: GasFeeCharged request: @@ -4573,7 +4651,7 @@ components: xml: name: Request requestIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4598,7 +4676,7 @@ components: vByteCost: description: The virtual byte cost example: 500 - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4606,14 +4684,14 @@ components: vByteFactorData: description: The virtual byte factor for data fields example: 1 - format: uint32 + format: int32 type: integer xml: name: VBFactorData vByteFactorKey: description: The virtual byte factor for key/lookup generating fields example: 10 - format: uint32 + format: int32 type: integer xml: name: VBFactorKey @@ -4630,7 +4708,7 @@ components: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -4638,17 +4716,17 @@ components: id: id senderAccount: senderAccount isOffLedger: true - gasGudget: 2 + gasGudget: gasGudget requestId: requestId callTarget: - contract: 9 - entryPoint: 3 + contract: 5 + entryPoint: 5 targetAddress: targetAddress allowance: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -4674,8 +4752,9 @@ components: fungibleTokens: $ref: '#/components/schemas/Assets' gasGudget: - format: int64 - type: integer + description: The gas budget (uint64 as string) + format: string + type: string xml: name: GasGudget isEVM: @@ -4773,16 +4852,16 @@ components: example: gasBurnLog: records: - - code: 1 - gasBurned: 5 - - code: 1 - gasBurned: 5 + - code: 6 + gasBurned: 1 + - code: 6 + gasBurned: 1 request: fungibleTokens: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -4790,17 +4869,17 @@ components: id: id senderAccount: senderAccount isOffLedger: true - gasGudget: 2 + gasGudget: gasGudget requestId: requestId callTarget: - contract: 9 - entryPoint: 3 + contract: 5 + entryPoint: 5 targetAddress: targetAddress allowance: nfts: - nfts - nfts - baseTokens: 7 + baseTokens: baseTokens nativeTokens: - amount: amount id: id @@ -4820,15 +4899,15 @@ components: isEVM: true blockIndex: 1 requestIndex: 1 - gasFeeCharged: 2 - gasBudget: 6 - gasBurned: 5 + gasFeeCharged: gasFeeCharged + gasBudget: gasBudget + gasBurned: gasBurned error: errorMessage: errorMessage hash: hash properties: blockIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4836,26 +4915,29 @@ components: error: $ref: '#/components/schemas/BlockReceiptError' gasBudget: - format: int64 - type: integer + description: The gas budget (uint64 as string) + format: string + type: string xml: name: GasBudget gasBurnLog: $ref: '#/components/schemas/BurnLog' gasBurned: - format: int64 - type: integer + description: The burned gas (uint64 as string) + format: string + type: string xml: name: GasBurned gasFeeCharged: - format: int64 - type: integer + description: The charged gas fee (uint64 as string) + format: string + type: string xml: name: GasFeeCharged request: $ref: '#/components/schemas/RequestDetail' requestIndex: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4893,7 +4975,7 @@ components: properties: stateIndex: description: The state index - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4935,7 +5017,7 @@ components: lastMessage: $ref: '#/components/schemas/Transaction' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -4962,7 +5044,7 @@ components: lastMessage: $ref: '#/components/schemas/Transaction' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -5013,7 +5095,7 @@ components: lastMessage: $ref: '#/components/schemas/TxInclusionStateMsg' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -5040,7 +5122,7 @@ components: lastMessage: $ref: '#/components/schemas/OutputID' messages: - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -5152,7 +5234,7 @@ components: gasFeePolicy: example: gasFeeTokenId: gasFeeTokenId - gasPerToken: 100 + gasPerToken: "100" validatorFeeShare: 1 properties: gasFeeTokenId: @@ -5162,15 +5244,15 @@ components: xml: name: GasFeeTokenID gasPerToken: - description: The amount of gas per token. - example: 100 - format: int64 - type: integer + description: The amount of gas per token. (uint64 as string) + example: "100" + format: string + type: string xml: name: GasPerToken validatorFeeShare: description: The validator fee share. - format: uint32 + format: int32 minimum: 1 type: integer xml: @@ -5202,7 +5284,7 @@ components: name: GasPerToken validatorFeeShare: description: The validator fee share. - format: uint32 + format: int32 type: integer xml: name: ValidatorFeeShare diff --git a/clients/apiclient/api_auth.go b/clients/apiclient/api_auth.go index cea7cad3fe..79047ba43b 100644 --- a/clients/apiclient/api_auth.go +++ b/clients/apiclient/api_auth.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index 502d531ef4..b33c6dbb5a 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -61,7 +61,7 @@ func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/activate" + localVarPath := localBasePath + "/v2/chains/{chainID}/activate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -178,7 +178,7 @@ func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/v2/chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -293,7 +293,7 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/ws" + localVarPath := localBasePath + "/v2/chains/{chainID}/ws" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -317,6 +317,20 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -383,7 +397,7 @@ func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) ( return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/deactivate" + localVarPath := localBasePath + "/v2/chains/{chainID}/deactivate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -499,7 +513,7 @@ func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*Chain return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}" + localVarPath := localBasePath + "/v2/chains/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -621,7 +635,7 @@ func (a *ChainsApiService) GetChainsExecute(r ApiGetChainsRequest) ([]ChainInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains" + localVarPath := localBasePath + "/v2/chains" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -745,7 +759,7 @@ func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/committee" + localVarPath := localBasePath + "/v2/chains/{chainID}/committee" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -870,7 +884,7 @@ func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]Cont return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/contracts" + localVarPath := localBasePath + "/v2/chains/{chainID}/contracts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -998,7 +1012,7 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/evm/tx/{txHash}" + localVarPath := localBasePath + "/v2/chains/{chainID}/evm/tx/{txHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) @@ -1023,6 +1037,20 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1113,7 +1141,7 @@ func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) (*Sta return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/state/{stateKey}" + localVarPath := localBasePath + "/v2/chains/{chainID}/state/{stateKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterValueToString(r.stateKey, "stateKey")), -1) @@ -1138,6 +1166,20 @@ func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) (*Sta if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1216,7 +1258,7 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/v2/chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -1338,7 +1380,7 @@ func (a *ChainsApiService) SetChainRecordExecute(r ApiSetChainRecordRequest) (*h return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/chainrecord" + localVarPath := localBasePath + "/v2/chains/{chainID}/chainrecord" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index e1f3d707bf..590461ad9b 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -66,7 +66,7 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/balance" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/balance" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -91,6 +91,20 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -181,7 +195,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nfts" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nfts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -206,6 +220,20 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -296,7 +324,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nonce" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nonce" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -321,6 +349,20 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -408,7 +450,7 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -432,6 +474,20 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -483,7 +539,7 @@ type ApiAccountsGetFoundryOutputRequest struct { ctx context.Context ApiService *CorecontractsApiService chainID string - chainID2 string + serialNumber uint32 } func (r ApiAccountsGetFoundryOutputRequest) Execute() (*FoundryOutputResponse, *http.Response, error) { @@ -495,15 +551,15 @@ AccountsGetFoundryOutput Get the foundry output @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param chainID ChainID (Bech32) - @param chainID2 Serial Number (uint32) + @param serialNumber Serial Number (uint32) @return ApiAccountsGetFoundryOutputRequest */ -func (a *CorecontractsApiService) AccountsGetFoundryOutput(ctx context.Context, chainID string, chainID2 string) ApiAccountsGetFoundryOutputRequest { +func (a *CorecontractsApiService) AccountsGetFoundryOutput(ctx context.Context, chainID string, serialNumber uint32) ApiAccountsGetFoundryOutputRequest { return ApiAccountsGetFoundryOutputRequest{ ApiService: a, ctx: ctx, chainID: chainID, - chainID2: chainID2, + serialNumber: serialNumber, } } @@ -522,13 +578,16 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/foundry_output" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/foundry_output/{serialNumber}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"chainID_"+"}", url.PathEscape(parameterValueToString(r.chainID2, "chainID2")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serialNumber"+"}", url.PathEscape(parameterValueToString(r.serialNumber, "serialNumber")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.serialNumber < 1 { + return localVarReturnValue, nil, reportError("serialNumber must be greater than 1") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -547,6 +606,20 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -637,7 +710,7 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/nftdata" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/nftdata" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterValueToString(r.nftID, "nftID")), -1) @@ -662,6 +735,20 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -749,7 +836,7 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/token_registry" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/token_registry" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -773,6 +860,20 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -860,7 +961,7 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/accounts/total_assets" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/total_assets" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -884,6 +985,20 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -971,7 +1086,7 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blobs" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -995,6 +1110,20 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1085,7 +1214,7 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) @@ -1110,6 +1239,20 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1203,7 +1346,7 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterValueToString(r.fieldKey, "fieldKey")), -1) @@ -1229,6 +1372,20 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1292,7 +1449,7 @@ BlocklogGetBlockInfo Get the block info of a certain block index @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param chainID ChainID (Bech32) - @param blockIndex Block Index (uint32) + @param blockIndex BlockIndex (uint32) @return ApiBlocklogGetBlockInfoRequest */ func (a *CorecontractsApiService) BlocklogGetBlockInfo(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetBlockInfoRequest { @@ -1319,13 +1476,16 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.blockIndex < 1 { + return localVarReturnValue, nil, reportError("blockIndex must be greater than 1") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1344,6 +1504,20 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1431,7 +1605,7 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/controladdresses" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/controladdresses" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1455,6 +1629,20 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1518,7 +1706,7 @@ BlocklogGetEventsOfBlock Get events of a block @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param chainID ChainID (Bech32) - @param blockIndex Block Index (uint32) + @param blockIndex BlockIndex (uint32) @return ApiBlocklogGetEventsOfBlockRequest */ func (a *CorecontractsApiService) BlocklogGetEventsOfBlock(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetEventsOfBlockRequest { @@ -1545,13 +1733,16 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/{blockIndex}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.blockIndex < 1 { + return localVarReturnValue, nil, reportError("blockIndex must be greater than 1") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1570,6 +1761,20 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1660,7 +1865,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/contract/{contractHname}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) @@ -1685,6 +1890,20 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1772,7 +1991,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/latest" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1796,6 +2015,20 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1886,7 +2119,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/request/{requestID}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/request/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -1911,6 +2144,20 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1998,7 +2245,7 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2022,6 +2269,20 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2085,7 +2346,7 @@ BlocklogGetRequestIDsForBlock Get the request ids for a certain block index @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param chainID ChainID (Bech32) - @param blockIndex Block Index (uint32) + @param blockIndex BlockIndex (uint32) @return ApiBlocklogGetRequestIDsForBlockRequest */ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlock(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetRequestIDsForBlockRequest { @@ -2112,13 +2373,16 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.blockIndex < 1 { + return localVarReturnValue, nil, reportError("blockIndex must be greater than 1") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2137,6 +2401,20 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2224,7 +2502,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/requestids" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2248,6 +2526,20 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2338,7 +2630,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2363,6 +2655,20 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2453,7 +2759,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2478,6 +2784,20 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2541,7 +2861,7 @@ BlocklogGetRequestReceiptsOfBlock Get all receipts of a certain block @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param chainID ChainID (Bech32) - @param blockIndex Block Index (uint32) + @param blockIndex BlockIndex (uint32) @return ApiBlocklogGetRequestReceiptsOfBlockRequest */ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlock(ctx context.Context, chainID string, blockIndex uint32) ApiBlocklogGetRequestReceiptsOfBlockRequest { @@ -2568,13 +2888,16 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.blockIndex < 1 { + return localVarReturnValue, nil, reportError("blockIndex must be greater than 1") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2593,6 +2916,20 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2680,7 +3017,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/receipts" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2704,6 +3041,20 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2756,7 +3107,7 @@ type ApiErrorsGetErrorMessageFormatRequest struct { ApiService *CorecontractsApiService chainID string contractHname string - errorID string + errorID uint32 } func (r ApiErrorsGetErrorMessageFormatRequest) Execute() (*ErrorMessageFormatResponse, *http.Response, error) { @@ -2772,7 +3123,7 @@ ErrorsGetErrorMessageFormat Get the error message format of a specific error id @param errorID Error Id (uint16) @return ApiErrorsGetErrorMessageFormatRequest */ -func (a *CorecontractsApiService) ErrorsGetErrorMessageFormat(ctx context.Context, chainID string, contractHname string, errorID string) ApiErrorsGetErrorMessageFormatRequest { +func (a *CorecontractsApiService) ErrorsGetErrorMessageFormat(ctx context.Context, chainID string, contractHname string, errorID uint32) ApiErrorsGetErrorMessageFormatRequest { return ApiErrorsGetErrorMessageFormatRequest{ ApiService: a, ctx: ctx, @@ -2797,7 +3148,7 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterValueToString(r.errorID, "errorID")), -1) @@ -2805,6 +3156,9 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.errorID < 1 { + return localVarReturnValue, nil, reportError("errorID must be greater than 1") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -2823,6 +3177,20 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -2912,7 +3280,7 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/core/governance/chaininfo" + localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/chaininfo" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2936,6 +3304,20 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err diff --git a/clients/apiclient/api_metrics.go b/clients/apiclient/api_metrics.go index b34f66e466..a7648beccf 100644 --- a/clients/apiclient/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -63,7 +63,7 @@ func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/chain/{chainID}" + localVarPath := localBasePath + "/v2/metrics/chain/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -188,7 +188,7 @@ func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/chain/{chainID}/pipe" + localVarPath := localBasePath + "/v2/metrics/chain/{chainID}/pipe" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -313,7 +313,7 @@ func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflow return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/chain/{chainID}/workflow" + localVarPath := localBasePath + "/v2/metrics/chain/{chainID}/workflow" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *MetricsApiService) GetL1MetricsExecute(r ApiGetL1MetricsRequest) (*Chai return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/metrics/l1" + localVarPath := localBasePath + "/v2/metrics/l1" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index a148e53eea..419a19bd94 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func (a *NodeApiService) DistrustPeerExecute(r ApiDistrustPeerRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/trusted" + localVarPath := localBasePath + "/v2/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -189,7 +189,7 @@ func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesI return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/dks" + localVarPath := localBasePath + "/v2/node/dks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -315,7 +315,7 @@ func (a *NodeApiService) GetAllPeersExecute(r ApiGetAllPeersRequest) ([]PeeringN return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers" + localVarPath := localBasePath + "/v2/node/peers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -436,7 +436,7 @@ func (a *NodeApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/config" + localVarPath := localBasePath + "/v2/node/config" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -560,7 +560,7 @@ func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInf return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/dks/{sharedAddress}" + localVarPath := localBasePath + "/v2/node/dks/{sharedAddress}" localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) localVarHeaderParams := make(map[string]string) @@ -682,7 +682,7 @@ func (a *NodeApiService) GetInfoExecute(r ApiGetInfoRequest) (*InfoResponse, *ht return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/info" + localVarPath := localBasePath + "/v2/node/info" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -803,7 +803,7 @@ func (a *NodeApiService) GetPeeringIdentityExecute(r ApiGetPeeringIdentityReques return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/identity" + localVarPath := localBasePath + "/v2/node/peers/identity" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -924,7 +924,7 @@ func (a *NodeApiService) GetTrustedPeersExecute(r ApiGetTrustedPeersRequest) ([] return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/trusted" + localVarPath := localBasePath + "/v2/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1045,7 +1045,7 @@ func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (*VersionResp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/version" + localVarPath := localBasePath + "/v2/node/version" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1068,6 +1068,20 @@ func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (*VersionResp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1149,7 +1163,7 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*NodeOwn return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/owner/certificate" + localVarPath := localBasePath + "/v2/node/owner/certificate" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1273,7 +1287,7 @@ func (a *NodeApiService) ShutdownNodeExecute(r ApiShutdownNodeRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/shutdown" + localVarPath := localBasePath + "/v2/node/shutdown" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1390,7 +1404,7 @@ func (a *NodeApiService) TrustPeerExecute(r ApiTrustPeerRequest) (*http.Response return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/node/peers/trusted" + localVarPath := localBasePath + "/v2/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index 55ccc4235c..e0595e1ee4 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -69,7 +69,7 @@ func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, * return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/requests/callview" + localVarPath := localBasePath + "/v2/requests/callview" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -97,6 +97,20 @@ func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, * } // body params localVarPostBody = r.contractCallViewRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -177,7 +191,7 @@ func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*Receipt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/receipts/{requestID}" + localVarPath := localBasePath + "/v2/chains/{chainID}/receipts/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -202,6 +216,20 @@ func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*Receipt if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -281,7 +309,7 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/requests/offledger" + localVarPath := localBasePath + "/v2/requests/offledger" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -309,6 +337,20 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp } // body params localVarPostBody = r.offLedgerRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -342,6 +384,13 @@ type ApiWaitForRequestRequest struct { ApiService *RequestsApiService chainID string requestID string + timeoutSeconds *int32 +} + +// The timeout in seconds +func (r ApiWaitForRequestRequest) TimeoutSeconds(timeoutSeconds int32) ApiWaitForRequestRequest { + r.timeoutSeconds = &timeoutSeconds + return r } func (r ApiWaitForRequestRequest) Execute() (*ReceiptResponse, *http.Response, error) { @@ -380,7 +429,7 @@ func (a *RequestsApiService) WaitForRequestExecute(r ApiWaitForRequestRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/chains/{chainID}/requests/{requestID}/wait" + localVarPath := localBasePath + "/v2/chains/{chainID}/requests/{requestID}/wait" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -388,6 +437,9 @@ func (a *RequestsApiService) WaitForRequestExecute(r ApiWaitForRequestRequest) ( localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.timeoutSeconds != nil { + parameterAddToQuery(localVarQueryParams, "timeoutSeconds", r.timeoutSeconds, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -405,6 +457,20 @@ func (a *RequestsApiService) WaitForRequestExecute(r ApiWaitForRequestRequest) ( if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err diff --git a/clients/apiclient/api_users.go b/clients/apiclient/api_users.go index 62ff0825cb..8e76212aba 100644 --- a/clients/apiclient/api_users.go +++ b/clients/apiclient/api_users.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -65,7 +65,7 @@ func (a *UsersApiService) AddUserExecute(r ApiAddUserRequest) (*http.Response, e return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users" + localVarPath := localBasePath + "/v2/users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -190,7 +190,7 @@ func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordReque return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}/password" + localVarPath := localBasePath + "/v2/users/{username}/password" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -316,7 +316,7 @@ func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermission return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}/permissions" + localVarPath := localBasePath + "/v2/users/{username}/permissions" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respo return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}" + localVarPath := localBasePath + "/v2/users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -552,7 +552,7 @@ func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Resp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users/{username}" + localVarPath := localBasePath + "/v2/users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -675,7 +675,7 @@ func (a *UsersApiService) GetUsersExecute(r ApiGetUsersRequest) ([]User, *http.R return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/users" + localVarPath := localBasePath + "/v2/users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go index 5ee397212b..5ad5f85a4d 100644 --- a/clients/apiclient/client.go +++ b/clients/apiclient/client.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Wasp API API v0.4.0-alpha.8-16-g83edf92b9 +// APIClient manages communication with the Wasp API API vv0.4.0-alpha.8-60-g8b0f75e6d // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/clients/apiclient/configuration.go b/clients/apiclient/configuration.go index 551ecab0b1..17a4d18329 100644 --- a/clients/apiclient/configuration.go +++ b/clients/apiclient/configuration.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -93,11 +93,7 @@ func NewConfiguration() *Configuration { Debug: false, Servers: ServerConfigurations{ { - URL: "http://localhost:9090", - Description: "No description provided", - }, - { - URL: "https://localhost:9090", + URL: "", Description: "No description provided", }, }, diff --git a/clients/apiclient/docs/AccountNonceResponse.md b/clients/apiclient/docs/AccountNonceResponse.md index 389338b59d..7ce2c2cec9 100644 --- a/clients/apiclient/docs/AccountNonceResponse.md +++ b/clients/apiclient/docs/AccountNonceResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Nonce** | **int64** | | +**Nonce** | **string** | The nonce (uint64 as string) | ## Methods ### NewAccountNonceResponse -`func NewAccountNonceResponse(nonce int64, ) *AccountNonceResponse` +`func NewAccountNonceResponse(nonce string, ) *AccountNonceResponse` NewAccountNonceResponse instantiates a new AccountNonceResponse object This constructor will assign default values to properties that have it defined, @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetNonce -`func (o *AccountNonceResponse) GetNonce() int64` +`func (o *AccountNonceResponse) GetNonce() string` GetNonce returns the Nonce field if non-nil, zero value otherwise. ### GetNonceOk -`func (o *AccountNonceResponse) GetNonceOk() (*int64, bool)` +`func (o *AccountNonceResponse) GetNonceOk() (*string, bool)` GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNonce -`func (o *AccountNonceResponse) SetNonce(v int64)` +`func (o *AccountNonceResponse) SetNonce(v string)` SetNonce sets Nonce field to given value. diff --git a/clients/apiclient/docs/Assets.md b/clients/apiclient/docs/Assets.md index cd4e595eeb..633404e1cc 100644 --- a/clients/apiclient/docs/Assets.md +++ b/clients/apiclient/docs/Assets.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BaseTokens** | **int64** | | +**BaseTokens** | **string** | The base tokens (uint64 as string) | **NativeTokens** | [**[]NativeToken**](NativeToken.md) | | **Nfts** | **[]string** | | @@ -12,7 +12,7 @@ Name | Type | Description | Notes ### NewAssets -`func NewAssets(baseTokens int64, nativeTokens []NativeToken, nfts []string, ) *Assets` +`func NewAssets(baseTokens string, nativeTokens []NativeToken, nfts []string, ) *Assets` NewAssets instantiates a new Assets object This constructor will assign default values to properties that have it defined, @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetBaseTokens -`func (o *Assets) GetBaseTokens() int64` +`func (o *Assets) GetBaseTokens() string` GetBaseTokens returns the BaseTokens field if non-nil, zero value otherwise. ### GetBaseTokensOk -`func (o *Assets) GetBaseTokensOk() (*int64, bool)` +`func (o *Assets) GetBaseTokensOk() (*string, bool)` GetBaseTokensOk returns a tuple with the BaseTokens field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBaseTokens -`func (o *Assets) SetBaseTokens(v int64)` +`func (o *Assets) SetBaseTokens(v string)` SetBaseTokens sets BaseTokens field to given value. diff --git a/clients/apiclient/docs/AssetsResponse.md b/clients/apiclient/docs/AssetsResponse.md index c4e70f1eb5..1b86213ae0 100644 --- a/clients/apiclient/docs/AssetsResponse.md +++ b/clients/apiclient/docs/AssetsResponse.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**BaseTokens** | **int64** | | +**BaseTokens** | **string** | The base tokens (uint64 as string) | **NativeTokens** | [**[]NativeToken**](NativeToken.md) | | ## Methods ### NewAssetsResponse -`func NewAssetsResponse(baseTokens int64, nativeTokens []NativeToken, ) *AssetsResponse` +`func NewAssetsResponse(baseTokens string, nativeTokens []NativeToken, ) *AssetsResponse` NewAssetsResponse instantiates a new AssetsResponse object This constructor will assign default values to properties that have it defined, @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetBaseTokens -`func (o *AssetsResponse) GetBaseTokens() int64` +`func (o *AssetsResponse) GetBaseTokens() string` GetBaseTokens returns the BaseTokens field if non-nil, zero value otherwise. ### GetBaseTokensOk -`func (o *AssetsResponse) GetBaseTokensOk() (*int64, bool)` +`func (o *AssetsResponse) GetBaseTokensOk() (*string, bool)` GetBaseTokensOk returns a tuple with the BaseTokens field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetBaseTokens -`func (o *AssetsResponse) SetBaseTokens(v int64)` +`func (o *AssetsResponse) SetBaseTokens(v string)` SetBaseTokens sets BaseTokens field to given value. diff --git a/clients/apiclient/docs/AuthApi.md b/clients/apiclient/docs/AuthApi.md index 619c0c8f7b..af8de4c9a7 100644 --- a/clients/apiclient/docs/AuthApi.md +++ b/clients/apiclient/docs/AuthApi.md @@ -1,6 +1,6 @@ # \AuthApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/clients/apiclient/docs/BaseToken.md b/clients/apiclient/docs/BaseToken.md index 791dfd8d24..dddf71612e 100644 --- a/clients/apiclient/docs/BaseToken.md +++ b/clients/apiclient/docs/BaseToken.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Decimals** | **uint32** | The token decimals | +**Decimals** | **int32** | The token decimals | **Name** | **string** | The base token name | **Subunit** | **string** | The token subunit | **TickerSymbol** | **string** | The ticker symbol | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewBaseToken -`func NewBaseToken(decimals uint32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool, ) *BaseToken` +`func NewBaseToken(decimals int32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool, ) *BaseToken` NewBaseToken instantiates a new BaseToken object This constructor will assign default values to properties that have it defined, @@ -32,20 +32,20 @@ but it doesn't guarantee that properties required by API are set ### GetDecimals -`func (o *BaseToken) GetDecimals() uint32` +`func (o *BaseToken) GetDecimals() int32` GetDecimals returns the Decimals field if non-nil, zero value otherwise. ### GetDecimalsOk -`func (o *BaseToken) GetDecimalsOk() (*uint32, bool)` +`func (o *BaseToken) GetDecimalsOk() (*int32, bool)` GetDecimalsOk returns a tuple with the Decimals field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDecimals -`func (o *BaseToken) SetDecimals(v uint32)` +`func (o *BaseToken) SetDecimals(v int32)` SetDecimals sets Decimals field to given value. diff --git a/clients/apiclient/docs/Blob.md b/clients/apiclient/docs/Blob.md index 9c8f28c2a6..6cd815d639 100644 --- a/clients/apiclient/docs/Blob.md +++ b/clients/apiclient/docs/Blob.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Hash** | **string** | | -**Size** | **uint32** | | +**Size** | **int32** | | ## Methods ### NewBlob -`func NewBlob(hash string, size uint32, ) *Blob` +`func NewBlob(hash string, size int32, ) *Blob` NewBlob instantiates a new Blob object This constructor will assign default values to properties that have it defined, @@ -48,20 +48,20 @@ SetHash sets Hash field to given value. ### GetSize -`func (o *Blob) GetSize() uint32` +`func (o *Blob) GetSize() int32` GetSize returns the Size field if non-nil, zero value otherwise. ### GetSizeOk -`func (o *Blob) GetSizeOk() (*uint32, bool)` +`func (o *Blob) GetSizeOk() (*int32, bool)` GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSize -`func (o *Blob) SetSize(v uint32)` +`func (o *Blob) SetSize(v int32)` SetSize sets Size field to given value. diff --git a/clients/apiclient/docs/BlockInfoResponse.md b/clients/apiclient/docs/BlockInfoResponse.md index 2ceb8eb0f6..424f4f0c75 100644 --- a/clients/apiclient/docs/BlockInfoResponse.md +++ b/clients/apiclient/docs/BlockInfoResponse.md @@ -6,23 +6,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AnchorTransactionId** | **string** | | **BlockIndex** | **uint32** | | -**GasBurned** | **int64** | | -**GasFeeCharged** | **int64** | | +**GasBurned** | **string** | The burned gas (uint64 as string) | +**GasFeeCharged** | **string** | The charged gas fee (uint64 as string) | **L1CommitmentHash** | **string** | | **NumOffLedgerRequests** | **uint32** | | **NumSuccessfulRequests** | **uint32** | | **PreviousL1CommitmentHash** | **string** | | **Timestamp** | **time.Time** | | -**TotalBaseTokensInL2Accounts** | **int64** | | +**TotalBaseTokensInL2Accounts** | **string** | The total L2 base tokens (uint64 as string) | **TotalRequests** | **uint32** | | -**TotalStorageDeposit** | **int64** | | +**TotalStorageDeposit** | **string** | The total storage deposit (uint64 as string) | **TransactionSubEssenceHash** | **string** | | ## Methods ### NewBlockInfoResponse -`func NewBlockInfoResponse(anchorTransactionId string, blockIndex uint32, gasBurned int64, gasFeeCharged int64, l1CommitmentHash string, numOffLedgerRequests uint32, numSuccessfulRequests uint32, previousL1CommitmentHash string, timestamp time.Time, totalBaseTokensInL2Accounts int64, totalRequests uint32, totalStorageDeposit int64, transactionSubEssenceHash string, ) *BlockInfoResponse` +`func NewBlockInfoResponse(anchorTransactionId string, blockIndex uint32, gasBurned string, gasFeeCharged string, l1CommitmentHash string, numOffLedgerRequests uint32, numSuccessfulRequests uint32, previousL1CommitmentHash string, timestamp time.Time, totalBaseTokensInL2Accounts string, totalRequests uint32, totalStorageDeposit string, transactionSubEssenceHash string, ) *BlockInfoResponse` NewBlockInfoResponse instantiates a new BlockInfoResponse object This constructor will assign default values to properties that have it defined, @@ -79,40 +79,40 @@ SetBlockIndex sets BlockIndex field to given value. ### GetGasBurned -`func (o *BlockInfoResponse) GetGasBurned() int64` +`func (o *BlockInfoResponse) GetGasBurned() string` GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. ### GetGasBurnedOk -`func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool)` +`func (o *BlockInfoResponse) GetGasBurnedOk() (*string, bool)` GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasBurned -`func (o *BlockInfoResponse) SetGasBurned(v int64)` +`func (o *BlockInfoResponse) SetGasBurned(v string)` SetGasBurned sets GasBurned field to given value. ### GetGasFeeCharged -`func (o *BlockInfoResponse) GetGasFeeCharged() int64` +`func (o *BlockInfoResponse) GetGasFeeCharged() string` GetGasFeeCharged returns the GasFeeCharged field if non-nil, zero value otherwise. ### GetGasFeeChargedOk -`func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool)` +`func (o *BlockInfoResponse) GetGasFeeChargedOk() (*string, bool)` GetGasFeeChargedOk returns a tuple with the GasFeeCharged field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasFeeCharged -`func (o *BlockInfoResponse) SetGasFeeCharged(v int64)` +`func (o *BlockInfoResponse) SetGasFeeCharged(v string)` SetGasFeeCharged sets GasFeeCharged field to given value. @@ -219,20 +219,20 @@ SetTimestamp sets Timestamp field to given value. ### GetTotalBaseTokensInL2Accounts -`func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64` +`func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() string` GetTotalBaseTokensInL2Accounts returns the TotalBaseTokensInL2Accounts field if non-nil, zero value otherwise. ### GetTotalBaseTokensInL2AccountsOk -`func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool)` +`func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*string, bool)` GetTotalBaseTokensInL2AccountsOk returns a tuple with the TotalBaseTokensInL2Accounts field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTotalBaseTokensInL2Accounts -`func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v int64)` +`func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v string)` SetTotalBaseTokensInL2Accounts sets TotalBaseTokensInL2Accounts field to given value. @@ -259,20 +259,20 @@ SetTotalRequests sets TotalRequests field to given value. ### GetTotalStorageDeposit -`func (o *BlockInfoResponse) GetTotalStorageDeposit() int64` +`func (o *BlockInfoResponse) GetTotalStorageDeposit() string` GetTotalStorageDeposit returns the TotalStorageDeposit field if non-nil, zero value otherwise. ### GetTotalStorageDepositOk -`func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool)` +`func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*string, bool)` GetTotalStorageDepositOk returns a tuple with the TotalStorageDeposit field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTotalStorageDeposit -`func (o *BlockInfoResponse) SetTotalStorageDeposit(v int64)` +`func (o *BlockInfoResponse) SetTotalStorageDeposit(v string)` SetTotalStorageDeposit sets TotalStorageDeposit field to given value. diff --git a/clients/apiclient/docs/BurnRecord.md b/clients/apiclient/docs/BurnRecord.md index 77ca3605d5..840ebc129b 100644 --- a/clients/apiclient/docs/BurnRecord.md +++ b/clients/apiclient/docs/BurnRecord.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **uint32** | | +**Code** | **int32** | | **GasBurned** | **int64** | | ## Methods ### NewBurnRecord -`func NewBurnRecord(code uint32, gasBurned int64, ) *BurnRecord` +`func NewBurnRecord(code int32, gasBurned int64, ) *BurnRecord` NewBurnRecord instantiates a new BurnRecord object This constructor will assign default values to properties that have it defined, @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetCode -`func (o *BurnRecord) GetCode() uint32` +`func (o *BurnRecord) GetCode() int32` GetCode returns the Code field if non-nil, zero value otherwise. ### GetCodeOk -`func (o *BurnRecord) GetCodeOk() (*uint32, bool)` +`func (o *BurnRecord) GetCodeOk() (*int32, bool)` GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetCode -`func (o *BurnRecord) SetCode(v uint32)` +`func (o *BurnRecord) SetCode(v int32)` SetCode sets Code field to given value. diff --git a/clients/apiclient/docs/CallTarget.md b/clients/apiclient/docs/CallTarget.md index 0a554b2550..ded8ac46dd 100644 --- a/clients/apiclient/docs/CallTarget.md +++ b/clients/apiclient/docs/CallTarget.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Contract** | **uint32** | | -**EntryPoint** | **uint32** | | +**Contract** | **int32** | | +**EntryPoint** | **int32** | | ## Methods ### NewCallTarget -`func NewCallTarget(contract uint32, entryPoint uint32, ) *CallTarget` +`func NewCallTarget(contract int32, entryPoint int32, ) *CallTarget` NewCallTarget instantiates a new CallTarget object This constructor will assign default values to properties that have it defined, @@ -28,40 +28,40 @@ but it doesn't guarantee that properties required by API are set ### GetContract -`func (o *CallTarget) GetContract() uint32` +`func (o *CallTarget) GetContract() int32` GetContract returns the Contract field if non-nil, zero value otherwise. ### GetContractOk -`func (o *CallTarget) GetContractOk() (*uint32, bool)` +`func (o *CallTarget) GetContractOk() (*int32, bool)` GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetContract -`func (o *CallTarget) SetContract(v uint32)` +`func (o *CallTarget) SetContract(v int32)` SetContract sets Contract field to given value. ### GetEntryPoint -`func (o *CallTarget) GetEntryPoint() uint32` +`func (o *CallTarget) GetEntryPoint() int32` GetEntryPoint returns the EntryPoint field if non-nil, zero value otherwise. ### GetEntryPointOk -`func (o *CallTarget) GetEntryPointOk() (*uint32, bool)` +`func (o *CallTarget) GetEntryPointOk() (*int32, bool)` GetEntryPointOk returns a tuple with the EntryPoint field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEntryPoint -`func (o *CallTarget) SetEntryPoint(v uint32)` +`func (o *CallTarget) SetEntryPoint(v int32)` SetEntryPoint sets EntryPoint field to given value. diff --git a/clients/apiclient/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md index c8e0a15d45..2595d4d015 100644 --- a/clients/apiclient/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -1,21 +1,21 @@ # \ChainsApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /chains/{chainID}/activate | Activate a chain -[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. -[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /chains/{chainID}/ws | -[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain -[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /chains/{chainID} | Get information about a specific chain -[**GetChains**](ChainsApi.md#GetChains) | **Get** /chains | Get a list of all chains -[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee -[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts -[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash -[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state -[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. -[**SetChainRecord**](ChainsApi.md#SetChainRecord) | **Post** /chains/{chainID}/chainrecord | Sets the chain record. +[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /v2/chains/{chainID}/activate | Activate a chain +[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /v2/chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. +[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /v2/chains/{chainID}/ws | +[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /v2/chains/{chainID}/deactivate | Deactivate a chain +[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /v2/chains/{chainID} | Get information about a specific chain +[**GetChains**](ChainsApi.md#GetChains) | **Get** /v2/chains | Get a list of all chains +[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /v2/chains/{chainID}/committee | Get information about the deployed committee +[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /v2/chains/{chainID}/contracts | Get all available chain contracts +[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /v2/chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2/chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /v2/chains/{chainID}/access-node/{publicKey} | Remove an access node. +[**SetChainRecord**](ChainsApi.md#SetChainRecord) | **Post** /v2/chains/{chainID}/chainrecord | Sets the chain record. @@ -208,7 +208,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -608,7 +608,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -679,7 +679,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers diff --git a/clients/apiclient/docs/ConsensusPipeMetrics.md b/clients/apiclient/docs/ConsensusPipeMetrics.md index 5f1a26cff4..d2db03e462 100644 --- a/clients/apiclient/docs/ConsensusPipeMetrics.md +++ b/clients/apiclient/docs/ConsensusPipeMetrics.md @@ -4,17 +4,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EventACSMsgPipeSize** | **uint32** | | -**EventPeerLogIndexMsgPipeSize** | **uint32** | | -**EventStateTransitionMsgPipeSize** | **uint32** | | -**EventTimerMsgPipeSize** | **uint32** | | -**EventVMResultMsgPipeSize** | **uint32** | | +**EventACSMsgPipeSize** | **int32** | | +**EventPeerLogIndexMsgPipeSize** | **int32** | | +**EventStateTransitionMsgPipeSize** | **int32** | | +**EventTimerMsgPipeSize** | **int32** | | +**EventVMResultMsgPipeSize** | **int32** | | ## Methods ### NewConsensusPipeMetrics -`func NewConsensusPipeMetrics(eventACSMsgPipeSize uint32, eventPeerLogIndexMsgPipeSize uint32, eventStateTransitionMsgPipeSize uint32, eventTimerMsgPipeSize uint32, eventVMResultMsgPipeSize uint32, ) *ConsensusPipeMetrics` +`func NewConsensusPipeMetrics(eventACSMsgPipeSize int32, eventPeerLogIndexMsgPipeSize int32, eventStateTransitionMsgPipeSize int32, eventTimerMsgPipeSize int32, eventVMResultMsgPipeSize int32, ) *ConsensusPipeMetrics` NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object This constructor will assign default values to properties that have it defined, @@ -31,100 +31,100 @@ but it doesn't guarantee that properties required by API are set ### GetEventACSMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() uint32` +`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32` GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field if non-nil, zero value otherwise. ### GetEventACSMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*uint32, bool)` +`func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool)` GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventACSMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v uint32)` +`func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32)` SetEventACSMsgPipeSize sets EventACSMsgPipeSize field to given value. ### GetEventPeerLogIndexMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() uint32` +`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32` GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field if non-nil, zero value otherwise. ### GetEventPeerLogIndexMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*uint32, bool)` +`func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool)` GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventPeerLogIndexMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v uint32)` +`func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32)` SetEventPeerLogIndexMsgPipeSize sets EventPeerLogIndexMsgPipeSize field to given value. ### GetEventStateTransitionMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() uint32` +`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32` GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field if non-nil, zero value otherwise. ### GetEventStateTransitionMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*uint32, bool)` +`func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool)` GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventStateTransitionMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v uint32)` +`func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32)` SetEventStateTransitionMsgPipeSize sets EventStateTransitionMsgPipeSize field to given value. ### GetEventTimerMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() uint32` +`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32` GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field if non-nil, zero value otherwise. ### GetEventTimerMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*uint32, bool)` +`func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool)` GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventTimerMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v uint32)` +`func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32)` SetEventTimerMsgPipeSize sets EventTimerMsgPipeSize field to given value. ### GetEventVMResultMsgPipeSize -`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() uint32` +`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32` GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field if non-nil, zero value otherwise. ### GetEventVMResultMsgPipeSizeOk -`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*uint32, bool)` +`func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool)` GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEventVMResultMsgPipeSize -`func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v uint32)` +`func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32)` SetEventVMResultMsgPipeSize sets EventVMResultMsgPipeSize field to given value. diff --git a/clients/apiclient/docs/ContractInfoResponse.md b/clients/apiclient/docs/ContractInfoResponse.md index 9588713489..17a153d6fe 100644 --- a/clients/apiclient/docs/ContractInfoResponse.md +++ b/clients/apiclient/docs/ContractInfoResponse.md @@ -7,13 +7,13 @@ Name | Type | Description | Notes **Description** | **string** | The description of the contract. | **HName** | **string** | The id (HName as Hex)) of the contract. | **Name** | **string** | The name of the contract. | -**ProgramHash** | **[]int32** | The hash of the contract. | +**ProgramHash** | **string** | The hash of the contract. (Hex encoded) | ## Methods ### NewContractInfoResponse -`func NewContractInfoResponse(description string, hName string, name string, programHash []int32, ) *ContractInfoResponse` +`func NewContractInfoResponse(description string, hName string, name string, programHash string, ) *ContractInfoResponse` NewContractInfoResponse instantiates a new ContractInfoResponse object This constructor will assign default values to properties that have it defined, @@ -90,20 +90,20 @@ SetName sets Name field to given value. ### GetProgramHash -`func (o *ContractInfoResponse) GetProgramHash() []int32` +`func (o *ContractInfoResponse) GetProgramHash() string` GetProgramHash returns the ProgramHash field if non-nil, zero value otherwise. ### GetProgramHashOk -`func (o *ContractInfoResponse) GetProgramHashOk() (*[]int32, bool)` +`func (o *ContractInfoResponse) GetProgramHashOk() (*string, bool)` GetProgramHashOk returns a tuple with the ProgramHash field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetProgramHash -`func (o *ContractInfoResponse) SetProgramHash(v []int32)` +`func (o *ContractInfoResponse) SetProgramHash(v string)` SetProgramHash sets ProgramHash field to given value. diff --git a/clients/apiclient/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md index a02f124e0b..5707bb3d5f 100644 --- a/clients/apiclient/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -1,35 +1,35 @@ # \CorecontractsApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account -[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account -[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account -[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /chains/{chainID}/core/accounts | Get a list of all accounts -[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /chains/{chainID}/core/accounts/foundry_output | Get the foundry output -[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID -[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /chains/{chainID}/core/accounts/token_registry | Get a list of all registries -[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /chains/{chainID}/core/accounts/total_assets | Get all stored assets -[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /chains/{chainID}/core/blobs | Get all stored blobs -[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob -[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) -[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index -[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /chains/{chainID}/core/blocklog/controladdresses | Get the control addresses -[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block -[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract -[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block -[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request -[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block -[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index -[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block -[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status -[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id -[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block -[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block -[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id -[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /chains/{chainID}/core/governance/chaininfo | Get the chain info +[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /v2/chains/{chainID}/core/accounts | Get a list of all accounts +[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /v2/chains/{chainID}/core/accounts/foundry_output/{serialNumber} | Get the foundry output +[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /v2/chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /v2/chains/{chainID}/core/accounts/token_registry | Get a list of all registries +[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /v2/chains/{chainID}/core/accounts/total_assets | Get all stored assets +[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /v2/chains/{chainID}/core/blobs | Get all stored blobs +[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /v2/chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /v2/chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2/chains/{chainID}/core/governance/chaininfo | Get the chain info @@ -92,7 +92,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -163,7 +163,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -234,7 +234,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -302,7 +302,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -316,7 +316,7 @@ No authorization required ## AccountsGetFoundryOutput -> FoundryOutputResponse AccountsGetFoundryOutput(ctx, chainID, chainID2).Execute() +> FoundryOutputResponse AccountsGetFoundryOutput(ctx, chainID, serialNumber).Execute() Get the foundry output @@ -334,11 +334,11 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - chainID2 := "chainID_example" // string | Serial Number (uint32) + serialNumber := uint32(56) // uint32 | Serial Number (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, chainID2).Execute() + resp, r, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, serialNumber).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.AccountsGetFoundryOutput``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -355,7 +355,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**chainID2** | **string** | Serial Number (uint32) | +**serialNumber** | **uint32** | Serial Number (uint32) | ### Other Parameters @@ -373,7 +373,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -444,7 +444,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -512,7 +512,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -580,7 +580,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -648,7 +648,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -719,7 +719,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -793,7 +793,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -825,7 +825,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := uint32(56) // uint32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | BlockIndex (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -846,7 +846,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **uint32** | Block Index (uint32) | +**blockIndex** | **uint32** | BlockIndex (uint32) | ### Other Parameters @@ -864,7 +864,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -932,7 +932,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -964,7 +964,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := uint32(56) // uint32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | BlockIndex (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -985,7 +985,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **uint32** | Block Index (uint32) | +**blockIndex** | **uint32** | BlockIndex (uint32) | ### Other Parameters @@ -1003,7 +1003,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1074,7 +1074,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1142,7 +1142,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1213,7 +1213,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1281,7 +1281,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1313,7 +1313,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := uint32(56) // uint32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | BlockIndex (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1334,7 +1334,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **uint32** | Block Index (uint32) | +**blockIndex** | **uint32** | BlockIndex (uint32) | ### Other Parameters @@ -1352,7 +1352,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1420,7 +1420,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1491,7 +1491,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1562,7 +1562,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1594,7 +1594,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) - blockIndex := uint32(56) // uint32 | Block Index (uint32) + blockIndex := uint32(56) // uint32 | BlockIndex (uint32) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1615,7 +1615,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | -**blockIndex** | **uint32** | Block Index (uint32) | +**blockIndex** | **uint32** | BlockIndex (uint32) | ### Other Parameters @@ -1633,7 +1633,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1701,7 +1701,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1734,7 +1734,7 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) contractHname := "contractHname_example" // string | Contract (Hname as Hex) - errorID := "errorID_example" // string | Error Id (uint16) + errorID := uint32(56) // uint32 | Error Id (uint16) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1756,7 +1756,7 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **chainID** | **string** | ChainID (Bech32) | **contractHname** | **string** | Contract (Hname as Hex) | -**errorID** | **string** | Error Id (uint16) | +**errorID** | **uint32** | Error Id (uint16) | ### Other Parameters @@ -1775,7 +1775,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -1845,7 +1845,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers diff --git a/clients/apiclient/docs/GasFeePolicy.md b/clients/apiclient/docs/GasFeePolicy.md index dd4a05df43..e5338a955e 100644 --- a/clients/apiclient/docs/GasFeePolicy.md +++ b/clients/apiclient/docs/GasFeePolicy.md @@ -6,13 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **GasFeeTokenId** | **string** | The gas fee token id. Empty if base token. | **GasPerToken** | **int64** | The amount of gas per token. | -**ValidatorFeeShare** | **uint32** | The validator fee share. | +**ValidatorFeeShare** | **int32** | The validator fee share. | ## Methods ### NewGasFeePolicy -`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare uint32, ) *GasFeePolicy` +`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32, ) *GasFeePolicy` NewGasFeePolicy instantiates a new GasFeePolicy object This constructor will assign default values to properties that have it defined, @@ -69,20 +69,20 @@ SetGasPerToken sets GasPerToken field to given value. ### GetValidatorFeeShare -`func (o *GasFeePolicy) GetValidatorFeeShare() uint32` +`func (o *GasFeePolicy) GetValidatorFeeShare() int32` GetValidatorFeeShare returns the ValidatorFeeShare field if non-nil, zero value otherwise. ### GetValidatorFeeShareOk -`func (o *GasFeePolicy) GetValidatorFeeShareOk() (*uint32, bool)` +`func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool)` GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetValidatorFeeShare -`func (o *GasFeePolicy) SetValidatorFeeShare(v uint32)` +`func (o *GasFeePolicy) SetValidatorFeeShare(v int32)` SetValidatorFeeShare sets ValidatorFeeShare field to given value. diff --git a/clients/apiclient/docs/GovChainInfoResponse.md b/clients/apiclient/docs/GovChainInfoResponse.md index 48a4b41f1e..6da5bf797e 100644 --- a/clients/apiclient/docs/GovChainInfoResponse.md +++ b/clients/apiclient/docs/GovChainInfoResponse.md @@ -8,15 +8,15 @@ Name | Type | Description | Notes **ChainOwnerId** | **string** | The chain owner address (Bech32-encoded). | **Description** | **string** | The description of the chain. | **GasFeePolicy** | [**GasFeePolicy**](GasFeePolicy.md) | | -**MaxBlobSize** | **uint32** | The maximum contract blob size. | -**MaxEventSize** | **uint32** | The maximum event size. | -**MaxEventsPerReq** | **uint32** | The maximum amount of events per request. | +**MaxBlobSize** | **int32** | The maximum contract blob size. | +**MaxEventSize** | **int32** | The maximum event size. | +**MaxEventsPerReq** | **int32** | The maximum amount of events per request. | ## Methods ### NewGovChainInfoResponse -`func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize uint32, maxEventSize uint32, maxEventsPerReq uint32, ) *GovChainInfoResponse` +`func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize int32, maxEventSize int32, maxEventsPerReq int32, ) *GovChainInfoResponse` NewGovChainInfoResponse instantiates a new GovChainInfoResponse object This constructor will assign default values to properties that have it defined, @@ -113,60 +113,60 @@ SetGasFeePolicy sets GasFeePolicy field to given value. ### GetMaxBlobSize -`func (o *GovChainInfoResponse) GetMaxBlobSize() uint32` +`func (o *GovChainInfoResponse) GetMaxBlobSize() int32` GetMaxBlobSize returns the MaxBlobSize field if non-nil, zero value otherwise. ### GetMaxBlobSizeOk -`func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool)` +`func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool)` GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxBlobSize -`func (o *GovChainInfoResponse) SetMaxBlobSize(v uint32)` +`func (o *GovChainInfoResponse) SetMaxBlobSize(v int32)` SetMaxBlobSize sets MaxBlobSize field to given value. ### GetMaxEventSize -`func (o *GovChainInfoResponse) GetMaxEventSize() uint32` +`func (o *GovChainInfoResponse) GetMaxEventSize() int32` GetMaxEventSize returns the MaxEventSize field if non-nil, zero value otherwise. ### GetMaxEventSizeOk -`func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool)` +`func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool)` GetMaxEventSizeOk returns a tuple with the MaxEventSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxEventSize -`func (o *GovChainInfoResponse) SetMaxEventSize(v uint32)` +`func (o *GovChainInfoResponse) SetMaxEventSize(v int32)` SetMaxEventSize sets MaxEventSize field to given value. ### GetMaxEventsPerReq -`func (o *GovChainInfoResponse) GetMaxEventsPerReq() uint32` +`func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32` GetMaxEventsPerReq returns the MaxEventsPerReq field if non-nil, zero value otherwise. ### GetMaxEventsPerReqOk -`func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool)` +`func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool)` GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxEventsPerReq -`func (o *GovChainInfoResponse) SetMaxEventsPerReq(v uint32)` +`func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32)` SetMaxEventsPerReq sets MaxEventsPerReq field to given value. diff --git a/clients/apiclient/docs/L1Params.md b/clients/apiclient/docs/L1Params.md index 00001fec68..021891ba0b 100644 --- a/clients/apiclient/docs/L1Params.md +++ b/clients/apiclient/docs/L1Params.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BaseToken** | [**BaseToken**](BaseToken.md) | | -**MaxPayloadSize** | **uint32** | The max payload size | +**MaxPayloadSize** | **int32** | The max payload size | **Protocol** | [**ProtocolParameters**](ProtocolParameters.md) | | ## Methods ### NewL1Params -`func NewL1Params(baseToken BaseToken, maxPayloadSize uint32, protocol ProtocolParameters, ) *L1Params` +`func NewL1Params(baseToken BaseToken, maxPayloadSize int32, protocol ProtocolParameters, ) *L1Params` NewL1Params instantiates a new L1Params object This constructor will assign default values to properties that have it defined, @@ -49,20 +49,20 @@ SetBaseToken sets BaseToken field to given value. ### GetMaxPayloadSize -`func (o *L1Params) GetMaxPayloadSize() uint32` +`func (o *L1Params) GetMaxPayloadSize() int32` GetMaxPayloadSize returns the MaxPayloadSize field if non-nil, zero value otherwise. ### GetMaxPayloadSizeOk -`func (o *L1Params) GetMaxPayloadSizeOk() (*uint32, bool)` +`func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool)` GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMaxPayloadSize -`func (o *L1Params) SetMaxPayloadSize(v uint32)` +`func (o *L1Params) SetMaxPayloadSize(v int32)` SetMaxPayloadSize sets MaxPayloadSize field to given value. diff --git a/clients/apiclient/docs/MetricsApi.md b/clients/apiclient/docs/MetricsApi.md index 83f5ab2f3b..0aeb805a57 100644 --- a/clients/apiclient/docs/MetricsApi.md +++ b/clients/apiclient/docs/MetricsApi.md @@ -1,13 +1,13 @@ # \MetricsApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /metrics/chain/{chainID} | Get chain specific metrics. -[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /metrics/chain/{chainID}/pipe | Get chain pipe event metrics. -[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /metrics/chain/{chainID}/workflow | Get chain workflow metrics. -[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /metrics/l1 | Get accumulated metrics. +[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /v2/metrics/chain/{chainID} | Get chain specific metrics. +[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /v2/metrics/chain/{chainID}/pipe | Get chain pipe event metrics. +[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /v2/metrics/chain/{chainID}/workflow | Get chain workflow metrics. +[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /v2/metrics/l1 | Get accumulated metrics. diff --git a/clients/apiclient/docs/MilestoneInfo.md b/clients/apiclient/docs/MilestoneInfo.md index 657d661fca..c2845fce4b 100644 --- a/clients/apiclient/docs/MilestoneInfo.md +++ b/clients/apiclient/docs/MilestoneInfo.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Index** | Pointer to **uint32** | | [optional] +**Index** | Pointer to **int32** | | [optional] **MilestoneId** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **uint32** | | [optional] +**Timestamp** | Pointer to **int32** | | [optional] ## Methods @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetIndex -`func (o *MilestoneInfo) GetIndex() uint32` +`func (o *MilestoneInfo) GetIndex() int32` GetIndex returns the Index field if non-nil, zero value otherwise. ### GetIndexOk -`func (o *MilestoneInfo) GetIndexOk() (*uint32, bool)` +`func (o *MilestoneInfo) GetIndexOk() (*int32, bool)` GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetIndex -`func (o *MilestoneInfo) SetIndex(v uint32)` +`func (o *MilestoneInfo) SetIndex(v int32)` SetIndex sets Index field to given value. @@ -79,20 +79,20 @@ HasMilestoneId returns a boolean if a field has been set. ### GetTimestamp -`func (o *MilestoneInfo) GetTimestamp() uint32` +`func (o *MilestoneInfo) GetTimestamp() int32` GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. ### GetTimestampOk -`func (o *MilestoneInfo) GetTimestampOk() (*uint32, bool)` +`func (o *MilestoneInfo) GetTimestampOk() (*int32, bool)` GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimestamp -`func (o *MilestoneInfo) SetTimestamp(v uint32)` +`func (o *MilestoneInfo) SetTimestamp(v int32)` SetTimestamp sets Timestamp field to given value. diff --git a/clients/apiclient/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md index 662351446e..50fe8acaef 100644 --- a/clients/apiclient/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -1,21 +1,21 @@ # \NodeApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /node/peers/trusted | Distrust a peering node -[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /node/dks | Generate a new distributed key -[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /node/peers | Get basic information about all configured peers -[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /node/config | Return the Wasp configuration -[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /node/dks/{sharedAddress} | Get information about the shared address DKS configuration -[**GetInfo**](NodeApi.md#GetInfo) | **Get** /node/info | Returns private information about this node. -[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /node/peers/identity | Get basic peer info of the current node -[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /node/peers/trusted | Get trusted peers -[**GetVersion**](NodeApi.md#GetVersion) | **Get** /node/version | Returns the node version. -[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /node/owner/certificate | Sets the node owner -[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /node/shutdown | Shut down the node -[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /node/peers/trusted | Trust a peering node +[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /v2/node/peers/trusted | Distrust a peering node +[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /v2/node/dks | Generate a new distributed key +[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /v2/node/peers | Get basic information about all configured peers +[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /v2/node/config | Return the Wasp configuration +[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /v2/node/dks/{sharedAddress} | Get information about the shared address DKS configuration +[**GetInfo**](NodeApi.md#GetInfo) | **Get** /v2/node/info | Returns private information about this node. +[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /v2/node/peers/identity | Get basic peer info of the current node +[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /v2/node/peers/trusted | Get trusted peers +[**GetVersion**](NodeApi.md#GetVersion) | **Get** /v2/node/version | Returns the node version. +[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /v2/node/owner/certificate | Sets the node owner +[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /v2/node/shutdown | Shut down the node +[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /v2/node/peers/trusted | Trust a peering node @@ -555,7 +555,7 @@ Other parameters are passed through a pointer to a apiGetVersionRequest struct v ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers diff --git a/clients/apiclient/docs/Output.md b/clients/apiclient/docs/Output.md index f59165ac4e..669acce103 100644 --- a/clients/apiclient/docs/Output.md +++ b/clients/apiclient/docs/Output.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**OutputType** | **uint32** | The output type | +**OutputType** | **int32** | The output type | **Raw** | **string** | The raw data of the output (Hex) | ## Methods ### NewOutput -`func NewOutput(outputType uint32, raw string, ) *Output` +`func NewOutput(outputType int32, raw string, ) *Output` NewOutput instantiates a new Output object This constructor will assign default values to properties that have it defined, @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetOutputType -`func (o *Output) GetOutputType() uint32` +`func (o *Output) GetOutputType() int32` GetOutputType returns the OutputType field if non-nil, zero value otherwise. ### GetOutputTypeOk -`func (o *Output) GetOutputTypeOk() (*uint32, bool)` +`func (o *Output) GetOutputTypeOk() (*int32, bool)` GetOutputTypeOk returns a tuple with the OutputType field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetOutputType -`func (o *Output) SetOutputType(v uint32)` +`func (o *Output) SetOutputType(v int32)` SetOutputType sets OutputType field to given value. diff --git a/clients/apiclient/docs/PeeringNodeStatusResponse.md b/clients/apiclient/docs/PeeringNodeStatusResponse.md index 1d973dd9aa..69423b3092 100644 --- a/clients/apiclient/docs/PeeringNodeStatusResponse.md +++ b/clients/apiclient/docs/PeeringNodeStatusResponse.md @@ -7,14 +7,14 @@ Name | Type | Description | Notes **IsAlive** | **bool** | Whether or not the peer is activated | **IsTrusted** | **bool** | | **NetId** | **string** | The NetID of the peer | -**NumUsers** | **uint32** | The amount of users attached to the peer | +**NumUsers** | **int32** | The amount of users attached to the peer | **PublicKey** | **string** | The peers public key encoded in Hex | ## Methods ### NewPeeringNodeStatusResponse -`func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers uint32, publicKey string, ) *PeeringNodeStatusResponse` +`func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers int32, publicKey string, ) *PeeringNodeStatusResponse` NewPeeringNodeStatusResponse instantiates a new PeeringNodeStatusResponse object This constructor will assign default values to properties that have it defined, @@ -91,20 +91,20 @@ SetNetId sets NetId field to given value. ### GetNumUsers -`func (o *PeeringNodeStatusResponse) GetNumUsers() uint32` +`func (o *PeeringNodeStatusResponse) GetNumUsers() int32` GetNumUsers returns the NumUsers field if non-nil, zero value otherwise. ### GetNumUsersOk -`func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*uint32, bool)` +`func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool)` GetNumUsersOk returns a tuple with the NumUsers field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNumUsers -`func (o *PeeringNodeStatusResponse) SetNumUsers(v uint32)` +`func (o *PeeringNodeStatusResponse) SetNumUsers(v int32)` SetNumUsers sets NumUsers field to given value. diff --git a/clients/apiclient/docs/ProtocolParameters.md b/clients/apiclient/docs/ProtocolParameters.md index 9ec0fa1f90..14141e5189 100644 --- a/clients/apiclient/docs/ProtocolParameters.md +++ b/clients/apiclient/docs/ProtocolParameters.md @@ -10,13 +10,13 @@ Name | Type | Description | Notes **NetworkName** | **string** | The network name | **RentStructure** | [**RentStructure**](RentStructure.md) | | **TokenSupply** | **string** | The token supply | -**Version** | **uint32** | The protocol version | +**Version** | **int32** | The protocol version | ## Methods ### NewProtocolParameters -`func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version uint32, ) *ProtocolParameters` +`func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version int32, ) *ProtocolParameters` NewProtocolParameters instantiates a new ProtocolParameters object This constructor will assign default values to properties that have it defined, @@ -153,20 +153,20 @@ SetTokenSupply sets TokenSupply field to given value. ### GetVersion -`func (o *ProtocolParameters) GetVersion() uint32` +`func (o *ProtocolParameters) GetVersion() int32` GetVersion returns the Version field if non-nil, zero value otherwise. ### GetVersionOk -`func (o *ProtocolParameters) GetVersionOk() (*uint32, bool)` +`func (o *ProtocolParameters) GetVersionOk() (*int32, bool)` GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVersion -`func (o *ProtocolParameters) SetVersion(v uint32)` +`func (o *ProtocolParameters) SetVersion(v int32)` SetVersion sets Version field to given value. diff --git a/clients/apiclient/docs/ReceiptError.md b/clients/apiclient/docs/ReceiptError.md index 35eda41d79..960d58339d 100644 --- a/clients/apiclient/docs/ReceiptError.md +++ b/clients/apiclient/docs/ReceiptError.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ContractId** | **uint32** | | +**ContractId** | **int32** | | **ErrorCode** | **string** | | **ErrorId** | **uint32** | | **Message** | **string** | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewReceiptError -`func NewReceiptError(contractId uint32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` +`func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` NewReceiptError instantiates a new ReceiptError object This constructor will assign default values to properties that have it defined, @@ -32,20 +32,20 @@ but it doesn't guarantee that properties required by API are set ### GetContractId -`func (o *ReceiptError) GetContractId() uint32` +`func (o *ReceiptError) GetContractId() int32` GetContractId returns the ContractId field if non-nil, zero value otherwise. ### GetContractIdOk -`func (o *ReceiptError) GetContractIdOk() (*uint32, bool)` +`func (o *ReceiptError) GetContractIdOk() (*int32, bool)` GetContractIdOk returns a tuple with the ContractId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetContractId -`func (o *ReceiptError) SetContractId(v uint32)` +`func (o *ReceiptError) SetContractId(v int32)` SetContractId sets ContractId field to given value. diff --git a/clients/apiclient/docs/ReceiptResponse.md b/clients/apiclient/docs/ReceiptResponse.md index e6e45e455f..a535827555 100644 --- a/clients/apiclient/docs/ReceiptResponse.md +++ b/clients/apiclient/docs/ReceiptResponse.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BlockIndex** | **uint32** | | **Error** | Pointer to [**ReceiptError**](ReceiptError.md) | | [optional] -**GasBudget** | **int64** | | +**GasBudget** | **string** | The gas budget (uint64 as string) | **GasBurnLog** | [**[]BurnRecord**](BurnRecord.md) | | -**GasBurned** | **int64** | | -**GasFeeCharged** | **int64** | | +**GasBurned** | **string** | The burned gas (uint64 as string) | +**GasFeeCharged** | **string** | The charged gas fee (uint64 as string) | **Request** | **string** | | **RequestIndex** | **uint32** | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ### NewReceiptResponse -`func NewReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog []BurnRecord, gasBurned int64, gasFeeCharged int64, request string, requestIndex uint32, ) *ReceiptResponse` +`func NewReceiptResponse(blockIndex uint32, gasBudget string, gasBurnLog []BurnRecord, gasBurned string, gasFeeCharged string, request string, requestIndex uint32, ) *ReceiptResponse` NewReceiptResponse instantiates a new ReceiptResponse object This constructor will assign default values to properties that have it defined, @@ -79,20 +79,20 @@ HasError returns a boolean if a field has been set. ### GetGasBudget -`func (o *ReceiptResponse) GetGasBudget() int64` +`func (o *ReceiptResponse) GetGasBudget() string` GetGasBudget returns the GasBudget field if non-nil, zero value otherwise. ### GetGasBudgetOk -`func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool)` +`func (o *ReceiptResponse) GetGasBudgetOk() (*string, bool)` GetGasBudgetOk returns a tuple with the GasBudget field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasBudget -`func (o *ReceiptResponse) SetGasBudget(v int64)` +`func (o *ReceiptResponse) SetGasBudget(v string)` SetGasBudget sets GasBudget field to given value. @@ -119,40 +119,40 @@ SetGasBurnLog sets GasBurnLog field to given value. ### GetGasBurned -`func (o *ReceiptResponse) GetGasBurned() int64` +`func (o *ReceiptResponse) GetGasBurned() string` GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. ### GetGasBurnedOk -`func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool)` +`func (o *ReceiptResponse) GetGasBurnedOk() (*string, bool)` GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasBurned -`func (o *ReceiptResponse) SetGasBurned(v int64)` +`func (o *ReceiptResponse) SetGasBurned(v string)` SetGasBurned sets GasBurned field to given value. ### GetGasFeeCharged -`func (o *ReceiptResponse) GetGasFeeCharged() int64` +`func (o *ReceiptResponse) GetGasFeeCharged() string` GetGasFeeCharged returns the GasFeeCharged field if non-nil, zero value otherwise. ### GetGasFeeChargedOk -`func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool)` +`func (o *ReceiptResponse) GetGasFeeChargedOk() (*string, bool)` GetGasFeeChargedOk returns a tuple with the GasFeeCharged field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasFeeCharged -`func (o *ReceiptResponse) SetGasFeeCharged(v int64)` +`func (o *ReceiptResponse) SetGasFeeCharged(v string)` SetGasFeeCharged sets GasFeeCharged field to given value. diff --git a/clients/apiclient/docs/RentStructure.md b/clients/apiclient/docs/RentStructure.md index f52588708d..6c15d4dc9d 100644 --- a/clients/apiclient/docs/RentStructure.md +++ b/clients/apiclient/docs/RentStructure.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **VByteCost** | **uint32** | The virtual byte cost | -**VByteFactorData** | **uint32** | The virtual byte factor for data fields | -**VByteFactorKey** | **uint32** | The virtual byte factor for key/lookup generating fields | +**VByteFactorData** | **int32** | The virtual byte factor for data fields | +**VByteFactorKey** | **int32** | The virtual byte factor for key/lookup generating fields | ## Methods ### NewRentStructure -`func NewRentStructure(vByteCost uint32, vByteFactorData uint32, vByteFactorKey uint32, ) *RentStructure` +`func NewRentStructure(vByteCost uint32, vByteFactorData int32, vByteFactorKey int32, ) *RentStructure` NewRentStructure instantiates a new RentStructure object This constructor will assign default values to properties that have it defined, @@ -49,40 +49,40 @@ SetVByteCost sets VByteCost field to given value. ### GetVByteFactorData -`func (o *RentStructure) GetVByteFactorData() uint32` +`func (o *RentStructure) GetVByteFactorData() int32` GetVByteFactorData returns the VByteFactorData field if non-nil, zero value otherwise. ### GetVByteFactorDataOk -`func (o *RentStructure) GetVByteFactorDataOk() (*uint32, bool)` +`func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool)` GetVByteFactorDataOk returns a tuple with the VByteFactorData field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVByteFactorData -`func (o *RentStructure) SetVByteFactorData(v uint32)` +`func (o *RentStructure) SetVByteFactorData(v int32)` SetVByteFactorData sets VByteFactorData field to given value. ### GetVByteFactorKey -`func (o *RentStructure) GetVByteFactorKey() uint32` +`func (o *RentStructure) GetVByteFactorKey() int32` GetVByteFactorKey returns the VByteFactorKey field if non-nil, zero value otherwise. ### GetVByteFactorKeyOk -`func (o *RentStructure) GetVByteFactorKeyOk() (*uint32, bool)` +`func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool)` GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetVByteFactorKey -`func (o *RentStructure) SetVByteFactorKey(v uint32)` +`func (o *RentStructure) SetVByteFactorKey(v int32)` SetVByteFactorKey sets VByteFactorKey field to given value. diff --git a/clients/apiclient/docs/RequestDetail.md b/clients/apiclient/docs/RequestDetail.md index dbbe1ca638..364d257284 100644 --- a/clients/apiclient/docs/RequestDetail.md +++ b/clients/apiclient/docs/RequestDetail.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **Allowance** | [**Assets**](Assets.md) | | **CallTarget** | [**CallTarget**](CallTarget.md) | | **FungibleTokens** | [**Assets**](Assets.md) | | -**GasGudget** | **int64** | | +**GasGudget** | **string** | The gas budget (uint64 as string) | **IsEVM** | **bool** | | **IsOffLedger** | **bool** | | **Nft** | [**NFTDataResponse**](NFTDataResponse.md) | | @@ -20,7 +20,7 @@ Name | Type | Description | Notes ### NewRequestDetail -`func NewRequestDetail(allowance Assets, callTarget CallTarget, fungibleTokens Assets, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string, ) *RequestDetail` +`func NewRequestDetail(allowance Assets, callTarget CallTarget, fungibleTokens Assets, gasGudget string, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string, ) *RequestDetail` NewRequestDetail instantiates a new RequestDetail object This constructor will assign default values to properties that have it defined, @@ -97,20 +97,20 @@ SetFungibleTokens sets FungibleTokens field to given value. ### GetGasGudget -`func (o *RequestDetail) GetGasGudget() int64` +`func (o *RequestDetail) GetGasGudget() string` GetGasGudget returns the GasGudget field if non-nil, zero value otherwise. ### GetGasGudgetOk -`func (o *RequestDetail) GetGasGudgetOk() (*int64, bool)` +`func (o *RequestDetail) GetGasGudgetOk() (*string, bool)` GetGasGudgetOk returns a tuple with the GasGudget field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasGudget -`func (o *RequestDetail) SetGasGudget(v int64)` +`func (o *RequestDetail) SetGasGudget(v string)` SetGasGudget sets GasGudget field to given value. diff --git a/clients/apiclient/docs/RequestReceiptResponse.md b/clients/apiclient/docs/RequestReceiptResponse.md index 06b2be0191..cd16b98841 100644 --- a/clients/apiclient/docs/RequestReceiptResponse.md +++ b/clients/apiclient/docs/RequestReceiptResponse.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BlockIndex** | **uint32** | | **Error** | Pointer to [**BlockReceiptError**](BlockReceiptError.md) | | [optional] -**GasBudget** | **int64** | | +**GasBudget** | **string** | The gas budget (uint64 as string) | **GasBurnLog** | [**BurnLog**](BurnLog.md) | | -**GasBurned** | **int64** | | -**GasFeeCharged** | **int64** | | +**GasBurned** | **string** | The burned gas (uint64 as string) | +**GasFeeCharged** | **string** | The charged gas fee (uint64 as string) | **Request** | [**RequestDetail**](RequestDetail.md) | | **RequestIndex** | **uint32** | | @@ -17,7 +17,7 @@ Name | Type | Description | Notes ### NewRequestReceiptResponse -`func NewRequestReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32, ) *RequestReceiptResponse` +`func NewRequestReceiptResponse(blockIndex uint32, gasBudget string, gasBurnLog BurnLog, gasBurned string, gasFeeCharged string, request RequestDetail, requestIndex uint32, ) *RequestReceiptResponse` NewRequestReceiptResponse instantiates a new RequestReceiptResponse object This constructor will assign default values to properties that have it defined, @@ -79,20 +79,20 @@ HasError returns a boolean if a field has been set. ### GetGasBudget -`func (o *RequestReceiptResponse) GetGasBudget() int64` +`func (o *RequestReceiptResponse) GetGasBudget() string` GetGasBudget returns the GasBudget field if non-nil, zero value otherwise. ### GetGasBudgetOk -`func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool)` +`func (o *RequestReceiptResponse) GetGasBudgetOk() (*string, bool)` GetGasBudgetOk returns a tuple with the GasBudget field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasBudget -`func (o *RequestReceiptResponse) SetGasBudget(v int64)` +`func (o *RequestReceiptResponse) SetGasBudget(v string)` SetGasBudget sets GasBudget field to given value. @@ -119,40 +119,40 @@ SetGasBurnLog sets GasBurnLog field to given value. ### GetGasBurned -`func (o *RequestReceiptResponse) GetGasBurned() int64` +`func (o *RequestReceiptResponse) GetGasBurned() string` GetGasBurned returns the GasBurned field if non-nil, zero value otherwise. ### GetGasBurnedOk -`func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool)` +`func (o *RequestReceiptResponse) GetGasBurnedOk() (*string, bool)` GetGasBurnedOk returns a tuple with the GasBurned field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasBurned -`func (o *RequestReceiptResponse) SetGasBurned(v int64)` +`func (o *RequestReceiptResponse) SetGasBurned(v string)` SetGasBurned sets GasBurned field to given value. ### GetGasFeeCharged -`func (o *RequestReceiptResponse) GetGasFeeCharged() int64` +`func (o *RequestReceiptResponse) GetGasFeeCharged() string` GetGasFeeCharged returns the GasFeeCharged field if non-nil, zero value otherwise. ### GetGasFeeChargedOk -`func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool)` +`func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*string, bool)` GetGasFeeChargedOk returns a tuple with the GasFeeCharged field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasFeeCharged -`func (o *RequestReceiptResponse) SetGasFeeCharged(v int64)` +`func (o *RequestReceiptResponse) SetGasFeeCharged(v string)` SetGasFeeCharged sets GasFeeCharged field to given value. diff --git a/clients/apiclient/docs/RequestsApi.md b/clients/apiclient/docs/RequestsApi.md index 815dca8b12..c01a93200c 100644 --- a/clients/apiclient/docs/RequestsApi.md +++ b/clients/apiclient/docs/RequestsApi.md @@ -1,13 +1,13 @@ # \RequestsApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CallView**](RequestsApi.md#CallView) | **Post** /requests/callview | Call a view function on a contract by Hname -[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID -[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /requests/offledger | Post an off-ledger request -[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +[**CallView**](RequestsApi.md#CallView) | **Post** /v2/requests/callview | Call a view function on a contract by Hname +[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2/chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2/requests/offledger | Post an off-ledger request +[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /v2/chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node @@ -65,7 +65,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -136,7 +136,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -198,7 +198,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers @@ -212,7 +212,7 @@ No authorization required ## WaitForRequest -> ReceiptResponse WaitForRequest(ctx, chainID, requestID).Execute() +> ReceiptResponse WaitForRequest(ctx, chainID, requestID).TimeoutSeconds(timeoutSeconds).Execute() Wait until the given request has been processed by the node @@ -231,10 +231,11 @@ import ( func main() { chainID := "chainID_example" // string | ChainID (Bech32) requestID := "requestID_example" // string | RequestID (Hex) + timeoutSeconds := int32(56) // int32 | The timeout in seconds (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.RequestsApi.WaitForRequest(context.Background(), chainID, requestID).Execute() + resp, r, err := apiClient.RequestsApi.WaitForRequest(context.Background(), chainID, requestID).TimeoutSeconds(timeoutSeconds).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `RequestsApi.WaitForRequest``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -262,6 +263,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **timeoutSeconds** | **int32** | The timeout in seconds | ### Return type @@ -269,7 +271,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[Authorization](../README.md#Authorization) ### HTTP request headers diff --git a/clients/apiclient/docs/UsersApi.md b/clients/apiclient/docs/UsersApi.md index f5ea3cc788..ad340e348a 100644 --- a/clients/apiclient/docs/UsersApi.md +++ b/clients/apiclient/docs/UsersApi.md @@ -1,15 +1,15 @@ # \UsersApi -All URIs are relative to *http://localhost:9090* +All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AddUser**](UsersApi.md#AddUser) | **Post** /users | Add a user -[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /users/{username}/password | Change user password -[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /users/{username}/permissions | Change user permissions -[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /users/{username} | Deletes a user -[**GetUser**](UsersApi.md#GetUser) | **Get** /users/{username} | Get a user -[**GetUsers**](UsersApi.md#GetUsers) | **Get** /users | Get a list of all users +[**AddUser**](UsersApi.md#AddUser) | **Post** /v2/users | Add a user +[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /v2/users/{username}/password | Change user password +[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /v2/users/{username}/permissions | Change user permissions +[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /v2/users/{username} | Deletes a user +[**GetUser**](UsersApi.md#GetUser) | **Get** /v2/users/{username} | Get a user +[**GetUsers**](UsersApi.md#GetUsers) | **Get** /v2/users | Get a list of all users diff --git a/clients/apiclient/model_account_list_response.go b/clients/apiclient/model_account_list_response.go index 85f1508e90..89f5cae8bf 100644 --- a/clients/apiclient/model_account_list_response.go +++ b/clients/apiclient/model_account_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nfts_response.go b/clients/apiclient/model_account_nfts_response.go index 8843ab26d2..2e62294668 100644 --- a/clients/apiclient/model_account_nfts_response.go +++ b/clients/apiclient/model_account_nfts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nonce_response.go b/clients/apiclient/model_account_nonce_response.go index f7be3844cb..9b25e455a1 100644 --- a/clients/apiclient/model_account_nonce_response.go +++ b/clients/apiclient/model_account_nonce_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,14 +19,15 @@ var _ MappedNullable = &AccountNonceResponse{} // AccountNonceResponse struct for AccountNonceResponse type AccountNonceResponse struct { - Nonce int64 `json:"nonce"` + // The nonce (uint64 as string) + Nonce string `json:"nonce"` } // NewAccountNonceResponse instantiates a new AccountNonceResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAccountNonceResponse(nonce int64) *AccountNonceResponse { +func NewAccountNonceResponse(nonce string) *AccountNonceResponse { this := AccountNonceResponse{} this.Nonce = nonce return &this @@ -41,9 +42,9 @@ func NewAccountNonceResponseWithDefaults() *AccountNonceResponse { } // GetNonce returns the Nonce field value -func (o *AccountNonceResponse) GetNonce() int64 { +func (o *AccountNonceResponse) GetNonce() string { if o == nil { - var ret int64 + var ret string return ret } @@ -52,7 +53,7 @@ func (o *AccountNonceResponse) GetNonce() int64 { // GetNonceOk returns a tuple with the Nonce field value // and a boolean to check if the value has been set. -func (o *AccountNonceResponse) GetNonceOk() (*int64, bool) { +func (o *AccountNonceResponse) GetNonceOk() (*string, bool) { if o == nil { return nil, false } @@ -60,7 +61,7 @@ func (o *AccountNonceResponse) GetNonceOk() (*int64, bool) { } // SetNonce sets field value -func (o *AccountNonceResponse) SetNonce(v int64) { +func (o *AccountNonceResponse) SetNonce(v string) { o.Nonce = v } diff --git a/clients/apiclient/model_add_user_request.go b/clients/apiclient/model_add_user_request.go index 7127bd986d..858182c202 100644 --- a/clients/apiclient/model_add_user_request.go +++ b/clients/apiclient/model_add_user_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_alias_output_metric_item.go b/clients/apiclient/model_alias_output_metric_item.go index 577c39bed4..1c5ecf4146 100644 --- a/clients/apiclient/model_alias_output_metric_item.go +++ b/clients/apiclient/model_alias_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets.go b/clients/apiclient/model_assets.go index a27151d843..c8b4136e57 100644 --- a/clients/apiclient/model_assets.go +++ b/clients/apiclient/model_assets.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,8 @@ var _ MappedNullable = &Assets{} // Assets struct for Assets type Assets struct { - BaseTokens int64 `json:"baseTokens"` + // The base tokens (uint64 as string) + BaseTokens string `json:"baseTokens"` NativeTokens []NativeToken `json:"nativeTokens"` Nfts []string `json:"nfts"` } @@ -28,7 +29,7 @@ type Assets struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAssets(baseTokens int64, nativeTokens []NativeToken, nfts []string) *Assets { +func NewAssets(baseTokens string, nativeTokens []NativeToken, nfts []string) *Assets { this := Assets{} this.BaseTokens = baseTokens this.NativeTokens = nativeTokens @@ -45,9 +46,9 @@ func NewAssetsWithDefaults() *Assets { } // GetBaseTokens returns the BaseTokens field value -func (o *Assets) GetBaseTokens() int64 { +func (o *Assets) GetBaseTokens() string { if o == nil { - var ret int64 + var ret string return ret } @@ -56,7 +57,7 @@ func (o *Assets) GetBaseTokens() int64 { // GetBaseTokensOk returns a tuple with the BaseTokens field value // and a boolean to check if the value has been set. -func (o *Assets) GetBaseTokensOk() (*int64, bool) { +func (o *Assets) GetBaseTokensOk() (*string, bool) { if o == nil { return nil, false } @@ -64,7 +65,7 @@ func (o *Assets) GetBaseTokensOk() (*int64, bool) { } // SetBaseTokens sets field value -func (o *Assets) SetBaseTokens(v int64) { +func (o *Assets) SetBaseTokens(v string) { o.BaseTokens = v } diff --git a/clients/apiclient/model_assets_response.go b/clients/apiclient/model_assets_response.go index 4b2f567546..079db2b8dc 100644 --- a/clients/apiclient/model_assets_response.go +++ b/clients/apiclient/model_assets_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,8 @@ var _ MappedNullable = &AssetsResponse{} // AssetsResponse struct for AssetsResponse type AssetsResponse struct { - BaseTokens int64 `json:"baseTokens"` + // The base tokens (uint64 as string) + BaseTokens string `json:"baseTokens"` NativeTokens []NativeToken `json:"nativeTokens"` } @@ -27,7 +28,7 @@ type AssetsResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAssetsResponse(baseTokens int64, nativeTokens []NativeToken) *AssetsResponse { +func NewAssetsResponse(baseTokens string, nativeTokens []NativeToken) *AssetsResponse { this := AssetsResponse{} this.BaseTokens = baseTokens this.NativeTokens = nativeTokens @@ -43,9 +44,9 @@ func NewAssetsResponseWithDefaults() *AssetsResponse { } // GetBaseTokens returns the BaseTokens field value -func (o *AssetsResponse) GetBaseTokens() int64 { +func (o *AssetsResponse) GetBaseTokens() string { if o == nil { - var ret int64 + var ret string return ret } @@ -54,7 +55,7 @@ func (o *AssetsResponse) GetBaseTokens() int64 { // GetBaseTokensOk returns a tuple with the BaseTokens field value // and a boolean to check if the value has been set. -func (o *AssetsResponse) GetBaseTokensOk() (*int64, bool) { +func (o *AssetsResponse) GetBaseTokensOk() (*string, bool) { if o == nil { return nil, false } @@ -62,7 +63,7 @@ func (o *AssetsResponse) GetBaseTokensOk() (*int64, bool) { } // SetBaseTokens sets field value -func (o *AssetsResponse) SetBaseTokens(v int64) { +func (o *AssetsResponse) SetBaseTokens(v string) { o.BaseTokens = v } diff --git a/clients/apiclient/model_auth_info_model.go b/clients/apiclient/model_auth_info_model.go index 701b77f1a2..c90608528a 100644 --- a/clients/apiclient/model_auth_info_model.go +++ b/clients/apiclient/model_auth_info_model.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_base_token.go b/clients/apiclient/model_base_token.go index a5da717f10..eea7a76148 100644 --- a/clients/apiclient/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ var _ MappedNullable = &BaseToken{} // BaseToken struct for BaseToken type BaseToken struct { // The token decimals - Decimals uint32 `json:"decimals"` + Decimals int32 `json:"decimals"` // The base token name Name string `json:"name"` // The token subunit @@ -37,7 +37,7 @@ type BaseToken struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBaseToken(decimals uint32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool) *BaseToken { +func NewBaseToken(decimals int32, name string, subunit string, tickerSymbol string, unit string, useMetricPrefix bool) *BaseToken { this := BaseToken{} this.Decimals = decimals this.Name = name @@ -57,9 +57,9 @@ func NewBaseTokenWithDefaults() *BaseToken { } // GetDecimals returns the Decimals field value -func (o *BaseToken) GetDecimals() uint32 { +func (o *BaseToken) GetDecimals() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -68,7 +68,7 @@ func (o *BaseToken) GetDecimals() uint32 { // GetDecimalsOk returns a tuple with the Decimals field value // and a boolean to check if the value has been set. -func (o *BaseToken) GetDecimalsOk() (*uint32, bool) { +func (o *BaseToken) GetDecimalsOk() (*int32, bool) { if o == nil { return nil, false } @@ -76,7 +76,7 @@ func (o *BaseToken) GetDecimalsOk() (*uint32, bool) { } // SetDecimals sets field value -func (o *BaseToken) SetDecimals(v uint32) { +func (o *BaseToken) SetDecimals(v int32) { o.Decimals = v } diff --git a/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index 405eafc6f7..a82cdca887 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,14 +20,14 @@ var _ MappedNullable = &Blob{} // Blob struct for Blob type Blob struct { Hash string `json:"hash"` - Size uint32 `json:"size"` + Size int32 `json:"size"` } // NewBlob instantiates a new Blob object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlob(hash string, size uint32) *Blob { +func NewBlob(hash string, size int32) *Blob { this := Blob{} this.Hash = hash this.Size = size @@ -67,9 +67,9 @@ func (o *Blob) SetHash(v string) { } // GetSize returns the Size field value -func (o *Blob) GetSize() uint32 { +func (o *Blob) GetSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -78,7 +78,7 @@ func (o *Blob) GetSize() uint32 { // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. -func (o *Blob) GetSizeOk() (*uint32, bool) { +func (o *Blob) GetSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -86,7 +86,7 @@ func (o *Blob) GetSizeOk() (*uint32, bool) { } // SetSize sets field value -func (o *Blob) SetSize(v uint32) { +func (o *Blob) SetSize(v int32) { o.Size = v } diff --git a/clients/apiclient/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go index b4112fba30..946fe486f0 100644 --- a/clients/apiclient/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_list_response.go b/clients/apiclient/model_blob_list_response.go index ca6ef686ed..4172c9e82e 100644 --- a/clients/apiclient/model_blob_list_response.go +++ b/clients/apiclient/model_blob_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go index 7bd57379a3..9245f7213e 100644 --- a/clients/apiclient/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_info_response.go b/clients/apiclient/model_block_info_response.go index 4960b84c1b..8d217100c1 100644 --- a/clients/apiclient/model_block_info_response.go +++ b/clients/apiclient/model_block_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,16 +22,20 @@ var _ MappedNullable = &BlockInfoResponse{} type BlockInfoResponse struct { AnchorTransactionId string `json:"anchorTransactionId"` BlockIndex uint32 `json:"blockIndex"` - GasBurned int64 `json:"gasBurned"` - GasFeeCharged int64 `json:"gasFeeCharged"` + // The burned gas (uint64 as string) + GasBurned string `json:"gasBurned"` + // The charged gas fee (uint64 as string) + GasFeeCharged string `json:"gasFeeCharged"` L1CommitmentHash string `json:"l1CommitmentHash"` NumOffLedgerRequests uint32 `json:"numOffLedgerRequests"` NumSuccessfulRequests uint32 `json:"numSuccessfulRequests"` PreviousL1CommitmentHash string `json:"previousL1CommitmentHash"` Timestamp time.Time `json:"timestamp"` - TotalBaseTokensInL2Accounts int64 `json:"totalBaseTokensInL2Accounts"` + // The total L2 base tokens (uint64 as string) + TotalBaseTokensInL2Accounts string `json:"totalBaseTokensInL2Accounts"` TotalRequests uint32 `json:"totalRequests"` - TotalStorageDeposit int64 `json:"totalStorageDeposit"` + // The total storage deposit (uint64 as string) + TotalStorageDeposit string `json:"totalStorageDeposit"` TransactionSubEssenceHash string `json:"transactionSubEssenceHash"` } @@ -39,7 +43,7 @@ type BlockInfoResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlockInfoResponse(anchorTransactionId string, blockIndex uint32, gasBurned int64, gasFeeCharged int64, l1CommitmentHash string, numOffLedgerRequests uint32, numSuccessfulRequests uint32, previousL1CommitmentHash string, timestamp time.Time, totalBaseTokensInL2Accounts int64, totalRequests uint32, totalStorageDeposit int64, transactionSubEssenceHash string) *BlockInfoResponse { +func NewBlockInfoResponse(anchorTransactionId string, blockIndex uint32, gasBurned string, gasFeeCharged string, l1CommitmentHash string, numOffLedgerRequests uint32, numSuccessfulRequests uint32, previousL1CommitmentHash string, timestamp time.Time, totalBaseTokensInL2Accounts string, totalRequests uint32, totalStorageDeposit string, transactionSubEssenceHash string) *BlockInfoResponse { this := BlockInfoResponse{} this.AnchorTransactionId = anchorTransactionId this.BlockIndex = blockIndex @@ -114,9 +118,9 @@ func (o *BlockInfoResponse) SetBlockIndex(v uint32) { } // GetGasBurned returns the GasBurned field value -func (o *BlockInfoResponse) GetGasBurned() int64 { +func (o *BlockInfoResponse) GetGasBurned() string { if o == nil { - var ret int64 + var ret string return ret } @@ -125,7 +129,7 @@ func (o *BlockInfoResponse) GetGasBurned() int64 { // GetGasBurnedOk returns a tuple with the GasBurned field value // and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool) { +func (o *BlockInfoResponse) GetGasBurnedOk() (*string, bool) { if o == nil { return nil, false } @@ -133,14 +137,14 @@ func (o *BlockInfoResponse) GetGasBurnedOk() (*int64, bool) { } // SetGasBurned sets field value -func (o *BlockInfoResponse) SetGasBurned(v int64) { +func (o *BlockInfoResponse) SetGasBurned(v string) { o.GasBurned = v } // GetGasFeeCharged returns the GasFeeCharged field value -func (o *BlockInfoResponse) GetGasFeeCharged() int64 { +func (o *BlockInfoResponse) GetGasFeeCharged() string { if o == nil { - var ret int64 + var ret string return ret } @@ -149,7 +153,7 @@ func (o *BlockInfoResponse) GetGasFeeCharged() int64 { // GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value // and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool) { +func (o *BlockInfoResponse) GetGasFeeChargedOk() (*string, bool) { if o == nil { return nil, false } @@ -157,7 +161,7 @@ func (o *BlockInfoResponse) GetGasFeeChargedOk() (*int64, bool) { } // SetGasFeeCharged sets field value -func (o *BlockInfoResponse) SetGasFeeCharged(v int64) { +func (o *BlockInfoResponse) SetGasFeeCharged(v string) { o.GasFeeCharged = v } @@ -282,9 +286,9 @@ func (o *BlockInfoResponse) SetTimestamp(v time.Time) { } // GetTotalBaseTokensInL2Accounts returns the TotalBaseTokensInL2Accounts field value -func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64 { +func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() string { if o == nil { - var ret int64 + var ret string return ret } @@ -293,7 +297,7 @@ func (o *BlockInfoResponse) GetTotalBaseTokensInL2Accounts() int64 { // GetTotalBaseTokensInL2AccountsOk returns a tuple with the TotalBaseTokensInL2Accounts field value // and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool) { +func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*string, bool) { if o == nil { return nil, false } @@ -301,7 +305,7 @@ func (o *BlockInfoResponse) GetTotalBaseTokensInL2AccountsOk() (*int64, bool) { } // SetTotalBaseTokensInL2Accounts sets field value -func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v int64) { +func (o *BlockInfoResponse) SetTotalBaseTokensInL2Accounts(v string) { o.TotalBaseTokensInL2Accounts = v } @@ -330,9 +334,9 @@ func (o *BlockInfoResponse) SetTotalRequests(v uint32) { } // GetTotalStorageDeposit returns the TotalStorageDeposit field value -func (o *BlockInfoResponse) GetTotalStorageDeposit() int64 { +func (o *BlockInfoResponse) GetTotalStorageDeposit() string { if o == nil { - var ret int64 + var ret string return ret } @@ -341,7 +345,7 @@ func (o *BlockInfoResponse) GetTotalStorageDeposit() int64 { // GetTotalStorageDepositOk returns a tuple with the TotalStorageDeposit field value // and a boolean to check if the value has been set. -func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool) { +func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*string, bool) { if o == nil { return nil, false } @@ -349,7 +353,7 @@ func (o *BlockInfoResponse) GetTotalStorageDepositOk() (*int64, bool) { } // SetTotalStorageDeposit sets field value -func (o *BlockInfoResponse) SetTotalStorageDeposit(v int64) { +func (o *BlockInfoResponse) SetTotalStorageDeposit(v string) { o.TotalStorageDeposit = v } diff --git a/clients/apiclient/model_block_receipt_error.go b/clients/apiclient/model_block_receipt_error.go index 7784cb74ff..b32a933075 100644 --- a/clients/apiclient/model_block_receipt_error.go +++ b/clients/apiclient/model_block_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipts_response.go b/clients/apiclient/model_block_receipts_response.go index 4e5e20ab67..bc8965a637 100644 --- a/clients/apiclient/model_block_receipts_response.go +++ b/clients/apiclient/model_block_receipts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_log.go b/clients/apiclient/model_burn_log.go index f2a0896324..487332605f 100644 --- a/clients/apiclient/model_burn_log.go +++ b/clients/apiclient/model_burn_log.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_record.go b/clients/apiclient/model_burn_record.go index 71100e8940..9075f8f5ee 100644 --- a/clients/apiclient/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ var _ MappedNullable = &BurnRecord{} // BurnRecord struct for BurnRecord type BurnRecord struct { - Code uint32 `json:"code"` + Code int32 `json:"code"` GasBurned int64 `json:"gasBurned"` } @@ -27,7 +27,7 @@ type BurnRecord struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBurnRecord(code uint32, gasBurned int64) *BurnRecord { +func NewBurnRecord(code int32, gasBurned int64) *BurnRecord { this := BurnRecord{} this.Code = code this.GasBurned = gasBurned @@ -43,9 +43,9 @@ func NewBurnRecordWithDefaults() *BurnRecord { } // GetCode returns the Code field value -func (o *BurnRecord) GetCode() uint32 { +func (o *BurnRecord) GetCode() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -54,7 +54,7 @@ func (o *BurnRecord) GetCode() uint32 { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. -func (o *BurnRecord) GetCodeOk() (*uint32, bool) { +func (o *BurnRecord) GetCodeOk() (*int32, bool) { if o == nil { return nil, false } @@ -62,7 +62,7 @@ func (o *BurnRecord) GetCodeOk() (*uint32, bool) { } // SetCode sets field value -func (o *BurnRecord) SetCode(v uint32) { +func (o *BurnRecord) SetCode(v int32) { o.Code = v } diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index 04a9c38b82..43afa45660 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,15 +19,15 @@ var _ MappedNullable = &CallTarget{} // CallTarget struct for CallTarget type CallTarget struct { - Contract uint32 `json:"contract"` - EntryPoint uint32 `json:"entryPoint"` + Contract int32 `json:"contract"` + EntryPoint int32 `json:"entryPoint"` } // NewCallTarget instantiates a new CallTarget object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCallTarget(contract uint32, entryPoint uint32) *CallTarget { +func NewCallTarget(contract int32, entryPoint int32) *CallTarget { this := CallTarget{} this.Contract = contract this.EntryPoint = entryPoint @@ -43,9 +43,9 @@ func NewCallTargetWithDefaults() *CallTarget { } // GetContract returns the Contract field value -func (o *CallTarget) GetContract() uint32 { +func (o *CallTarget) GetContract() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -54,7 +54,7 @@ func (o *CallTarget) GetContract() uint32 { // GetContractOk returns a tuple with the Contract field value // and a boolean to check if the value has been set. -func (o *CallTarget) GetContractOk() (*uint32, bool) { +func (o *CallTarget) GetContractOk() (*int32, bool) { if o == nil { return nil, false } @@ -62,14 +62,14 @@ func (o *CallTarget) GetContractOk() (*uint32, bool) { } // SetContract sets field value -func (o *CallTarget) SetContract(v uint32) { +func (o *CallTarget) SetContract(v int32) { o.Contract = v } // GetEntryPoint returns the EntryPoint field value -func (o *CallTarget) GetEntryPoint() uint32 { +func (o *CallTarget) GetEntryPoint() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -78,7 +78,7 @@ func (o *CallTarget) GetEntryPoint() uint32 { // GetEntryPointOk returns a tuple with the EntryPoint field value // and a boolean to check if the value has been set. -func (o *CallTarget) GetEntryPointOk() (*uint32, bool) { +func (o *CallTarget) GetEntryPointOk() (*int32, bool) { if o == nil { return nil, false } @@ -86,7 +86,7 @@ func (o *CallTarget) GetEntryPointOk() (*uint32, bool) { } // SetEntryPoint sets field value -func (o *CallTarget) SetEntryPoint(v uint32) { +func (o *CallTarget) SetEntryPoint(v int32) { o.EntryPoint = v } diff --git a/clients/apiclient/model_chain_info_response.go b/clients/apiclient/model_chain_info_response.go index 821d98b5e5..af9d72ba91 100644 --- a/clients/apiclient/model_chain_info_response.go +++ b/clients/apiclient/model_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go index f73bceeb1f..b34f7f67b7 100644 --- a/clients/apiclient/model_chain_metrics.go +++ b/clients/apiclient/model_chain_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_record.go b/clients/apiclient/model_chain_record.go index ec2911f443..1827ae5ac6 100644 --- a/clients/apiclient/model_chain_record.go +++ b/clients/apiclient/model_chain_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_info_response.go b/clients/apiclient/model_committee_info_response.go index abf0e51cba..c2964f1cee 100644 --- a/clients/apiclient/model_committee_info_response.go +++ b/clients/apiclient/model_committee_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_node.go b/clients/apiclient/model_committee_node.go index 1c3ffbe4e3..02a4fb9127 100644 --- a/clients/apiclient/model_committee_node.go +++ b/clients/apiclient/model_committee_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go index 9366935155..b8b3c21c89 100644 --- a/clients/apiclient/model_consensus_pipe_metrics.go +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,18 +19,18 @@ var _ MappedNullable = &ConsensusPipeMetrics{} // ConsensusPipeMetrics struct for ConsensusPipeMetrics type ConsensusPipeMetrics struct { - EventACSMsgPipeSize uint32 `json:"eventACSMsgPipeSize"` - EventPeerLogIndexMsgPipeSize uint32 `json:"eventPeerLogIndexMsgPipeSize"` - EventStateTransitionMsgPipeSize uint32 `json:"eventStateTransitionMsgPipeSize"` - EventTimerMsgPipeSize uint32 `json:"eventTimerMsgPipeSize"` - EventVMResultMsgPipeSize uint32 `json:"eventVMResultMsgPipeSize"` + EventACSMsgPipeSize int32 `json:"eventACSMsgPipeSize"` + EventPeerLogIndexMsgPipeSize int32 `json:"eventPeerLogIndexMsgPipeSize"` + EventStateTransitionMsgPipeSize int32 `json:"eventStateTransitionMsgPipeSize"` + EventTimerMsgPipeSize int32 `json:"eventTimerMsgPipeSize"` + EventVMResultMsgPipeSize int32 `json:"eventVMResultMsgPipeSize"` } // NewConsensusPipeMetrics instantiates a new ConsensusPipeMetrics object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConsensusPipeMetrics(eventACSMsgPipeSize uint32, eventPeerLogIndexMsgPipeSize uint32, eventStateTransitionMsgPipeSize uint32, eventTimerMsgPipeSize uint32, eventVMResultMsgPipeSize uint32) *ConsensusPipeMetrics { +func NewConsensusPipeMetrics(eventACSMsgPipeSize int32, eventPeerLogIndexMsgPipeSize int32, eventStateTransitionMsgPipeSize int32, eventTimerMsgPipeSize int32, eventVMResultMsgPipeSize int32) *ConsensusPipeMetrics { this := ConsensusPipeMetrics{} this.EventACSMsgPipeSize = eventACSMsgPipeSize this.EventPeerLogIndexMsgPipeSize = eventPeerLogIndexMsgPipeSize @@ -49,9 +49,9 @@ func NewConsensusPipeMetricsWithDefaults() *ConsensusPipeMetrics { } // GetEventACSMsgPipeSize returns the EventACSMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() uint32 { +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -60,7 +60,7 @@ func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSize() uint32 { // GetEventACSMsgPipeSizeOk returns a tuple with the EventACSMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*uint32, bool) { +func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -68,14 +68,14 @@ func (o *ConsensusPipeMetrics) GetEventACSMsgPipeSizeOk() (*uint32, bool) { } // SetEventACSMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v uint32) { +func (o *ConsensusPipeMetrics) SetEventACSMsgPipeSize(v int32) { o.EventACSMsgPipeSize = v } // GetEventPeerLogIndexMsgPipeSize returns the EventPeerLogIndexMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() uint32 { +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -84,7 +84,7 @@ func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSize() uint32 { // GetEventPeerLogIndexMsgPipeSizeOk returns a tuple with the EventPeerLogIndexMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*uint32, bool) { +func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -92,14 +92,14 @@ func (o *ConsensusPipeMetrics) GetEventPeerLogIndexMsgPipeSizeOk() (*uint32, boo } // SetEventPeerLogIndexMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v uint32) { +func (o *ConsensusPipeMetrics) SetEventPeerLogIndexMsgPipeSize(v int32) { o.EventPeerLogIndexMsgPipeSize = v } // GetEventStateTransitionMsgPipeSize returns the EventStateTransitionMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() uint32 { +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -108,7 +108,7 @@ func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSize() uint32 { // GetEventStateTransitionMsgPipeSizeOk returns a tuple with the EventStateTransitionMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*uint32, bool) { +func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -116,14 +116,14 @@ func (o *ConsensusPipeMetrics) GetEventStateTransitionMsgPipeSizeOk() (*uint32, } // SetEventStateTransitionMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v uint32) { +func (o *ConsensusPipeMetrics) SetEventStateTransitionMsgPipeSize(v int32) { o.EventStateTransitionMsgPipeSize = v } // GetEventTimerMsgPipeSize returns the EventTimerMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() uint32 { +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -132,7 +132,7 @@ func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSize() uint32 { // GetEventTimerMsgPipeSizeOk returns a tuple with the EventTimerMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*uint32, bool) { +func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -140,14 +140,14 @@ func (o *ConsensusPipeMetrics) GetEventTimerMsgPipeSizeOk() (*uint32, bool) { } // SetEventTimerMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v uint32) { +func (o *ConsensusPipeMetrics) SetEventTimerMsgPipeSize(v int32) { o.EventTimerMsgPipeSize = v } // GetEventVMResultMsgPipeSize returns the EventVMResultMsgPipeSize field value -func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() uint32 { +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -156,7 +156,7 @@ func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSize() uint32 { // GetEventVMResultMsgPipeSizeOk returns a tuple with the EventVMResultMsgPipeSize field value // and a boolean to check if the value has been set. -func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*uint32, bool) { +func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -164,7 +164,7 @@ func (o *ConsensusPipeMetrics) GetEventVMResultMsgPipeSizeOk() (*uint32, bool) { } // SetEventVMResultMsgPipeSize sets field value -func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v uint32) { +func (o *ConsensusPipeMetrics) SetEventVMResultMsgPipeSize(v int32) { o.EventVMResultMsgPipeSize = v } diff --git a/clients/apiclient/model_consensus_workflow_metrics.go b/clients/apiclient/model_consensus_workflow_metrics.go index 2a85e2148f..a39796295e 100644 --- a/clients/apiclient/model_consensus_workflow_metrics.go +++ b/clients/apiclient/model_consensus_workflow_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_call_view_request.go b/clients/apiclient/model_contract_call_view_request.go index a59e1e3738..2615e4c066 100644 --- a/clients/apiclient/model_contract_call_view_request.go +++ b/clients/apiclient/model_contract_call_view_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_info_response.go b/clients/apiclient/model_contract_info_response.go index d1e157d33e..5a2e8be6b8 100644 --- a/clients/apiclient/model_contract_info_response.go +++ b/clients/apiclient/model_contract_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -25,15 +25,15 @@ type ContractInfoResponse struct { HName string `json:"hName"` // The name of the contract. Name string `json:"name"` - // The hash of the contract. - ProgramHash []int32 `json:"programHash"` + // The hash of the contract. (Hex encoded) + ProgramHash string `json:"programHash"` } // NewContractInfoResponse instantiates a new ContractInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewContractInfoResponse(description string, hName string, name string, programHash []int32) *ContractInfoResponse { +func NewContractInfoResponse(description string, hName string, name string, programHash string) *ContractInfoResponse { this := ContractInfoResponse{} this.Description = description this.HName = hName @@ -123,9 +123,9 @@ func (o *ContractInfoResponse) SetName(v string) { } // GetProgramHash returns the ProgramHash field value -func (o *ContractInfoResponse) GetProgramHash() []int32 { +func (o *ContractInfoResponse) GetProgramHash() string { if o == nil { - var ret []int32 + var ret string return ret } @@ -134,15 +134,15 @@ func (o *ContractInfoResponse) GetProgramHash() []int32 { // GetProgramHashOk returns a tuple with the ProgramHash field value // and a boolean to check if the value has been set. -func (o *ContractInfoResponse) GetProgramHashOk() ([]int32, bool) { +func (o *ContractInfoResponse) GetProgramHashOk() (*string, bool) { if o == nil { return nil, false } - return o.ProgramHash, true + return &o.ProgramHash, true } // SetProgramHash sets field value -func (o *ContractInfoResponse) SetProgramHash(v []int32) { +func (o *ContractInfoResponse) SetProgramHash(v string) { o.ProgramHash = v } diff --git a/clients/apiclient/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go index b013f1decc..ea990b9dad 100644 --- a/clients/apiclient/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_info.go b/clients/apiclient/model_dk_shares_info.go index c7b8f7bb63..3c02ac8833 100644 --- a/clients/apiclient/model_dk_shares_info.go +++ b/clients/apiclient/model_dk_shares_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_post_request.go b/clients/apiclient/model_dk_shares_post_request.go index 5d1d325271..1355862e10 100644 --- a/clients/apiclient/model_dk_shares_post_request.go +++ b/clients/apiclient/model_dk_shares_post_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_error_message_format_response.go b/clients/apiclient/model_error_message_format_response.go index 07519d5112..198ff58281 100644 --- a/clients/apiclient/model_error_message_format_response.go +++ b/clients/apiclient/model_error_message_format_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_events_response.go b/clients/apiclient/model_events_response.go index c5d467bc2a..061a85df41 100644 --- a/clients/apiclient/model_events_response.go +++ b/clients/apiclient/model_events_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_foundry_output_response.go b/clients/apiclient/model_foundry_output_response.go index 49323eabe3..8b9dab5a54 100644 --- a/clients/apiclient/model_foundry_output_response.go +++ b/clients/apiclient/model_foundry_output_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index 85899f2c2d..ba04559058 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -24,14 +24,14 @@ type GasFeePolicy struct { // The amount of gas per token. GasPerToken int64 `json:"gasPerToken"` // The validator fee share. - ValidatorFeeShare uint32 `json:"validatorFeeShare"` + ValidatorFeeShare int32 `json:"validatorFeeShare"` } // NewGasFeePolicy instantiates a new GasFeePolicy object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare uint32) *GasFeePolicy { +func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32) *GasFeePolicy { this := GasFeePolicy{} this.GasFeeTokenId = gasFeeTokenId this.GasPerToken = gasPerToken @@ -96,9 +96,9 @@ func (o *GasFeePolicy) SetGasPerToken(v int64) { } // GetValidatorFeeShare returns the ValidatorFeeShare field value -func (o *GasFeePolicy) GetValidatorFeeShare() uint32 { +func (o *GasFeePolicy) GetValidatorFeeShare() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -107,7 +107,7 @@ func (o *GasFeePolicy) GetValidatorFeeShare() uint32 { // GetValidatorFeeShareOk returns a tuple with the ValidatorFeeShare field value // and a boolean to check if the value has been set. -func (o *GasFeePolicy) GetValidatorFeeShareOk() (*uint32, bool) { +func (o *GasFeePolicy) GetValidatorFeeShareOk() (*int32, bool) { if o == nil { return nil, false } @@ -115,7 +115,7 @@ func (o *GasFeePolicy) GetValidatorFeeShareOk() (*uint32, bool) { } // SetValidatorFeeShare sets field value -func (o *GasFeePolicy) SetValidatorFeeShare(v uint32) { +func (o *GasFeePolicy) SetValidatorFeeShare(v int32) { o.ValidatorFeeShare = v } diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go index 31fe738659..4e85c45cc9 100644 --- a/clients/apiclient/model_gov_chain_info_response.go +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -27,18 +27,18 @@ type GovChainInfoResponse struct { Description string `json:"description"` GasFeePolicy GasFeePolicy `json:"gasFeePolicy"` // The maximum contract blob size. - MaxBlobSize uint32 `json:"maxBlobSize"` + MaxBlobSize int32 `json:"maxBlobSize"` // The maximum event size. - MaxEventSize uint32 `json:"maxEventSize"` + MaxEventSize int32 `json:"maxEventSize"` // The maximum amount of events per request. - MaxEventsPerReq uint32 `json:"maxEventsPerReq"` + MaxEventsPerReq int32 `json:"maxEventsPerReq"` } // NewGovChainInfoResponse instantiates a new GovChainInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize uint32, maxEventSize uint32, maxEventsPerReq uint32) *GovChainInfoResponse { +func NewGovChainInfoResponse(chainID string, chainOwnerId string, description string, gasFeePolicy GasFeePolicy, maxBlobSize int32, maxEventSize int32, maxEventsPerReq int32) *GovChainInfoResponse { this := GovChainInfoResponse{} this.ChainID = chainID this.ChainOwnerId = chainOwnerId @@ -155,9 +155,9 @@ func (o *GovChainInfoResponse) SetGasFeePolicy(v GasFeePolicy) { } // GetMaxBlobSize returns the MaxBlobSize field value -func (o *GovChainInfoResponse) GetMaxBlobSize() uint32 { +func (o *GovChainInfoResponse) GetMaxBlobSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -166,7 +166,7 @@ func (o *GovChainInfoResponse) GetMaxBlobSize() uint32 { // GetMaxBlobSizeOk returns a tuple with the MaxBlobSize field value // and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool) { +func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -174,14 +174,14 @@ func (o *GovChainInfoResponse) GetMaxBlobSizeOk() (*uint32, bool) { } // SetMaxBlobSize sets field value -func (o *GovChainInfoResponse) SetMaxBlobSize(v uint32) { +func (o *GovChainInfoResponse) SetMaxBlobSize(v int32) { o.MaxBlobSize = v } // GetMaxEventSize returns the MaxEventSize field value -func (o *GovChainInfoResponse) GetMaxEventSize() uint32 { +func (o *GovChainInfoResponse) GetMaxEventSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -190,7 +190,7 @@ func (o *GovChainInfoResponse) GetMaxEventSize() uint32 { // GetMaxEventSizeOk returns a tuple with the MaxEventSize field value // and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool) { +func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -198,14 +198,14 @@ func (o *GovChainInfoResponse) GetMaxEventSizeOk() (*uint32, bool) { } // SetMaxEventSize sets field value -func (o *GovChainInfoResponse) SetMaxEventSize(v uint32) { +func (o *GovChainInfoResponse) SetMaxEventSize(v int32) { o.MaxEventSize = v } // GetMaxEventsPerReq returns the MaxEventsPerReq field value -func (o *GovChainInfoResponse) GetMaxEventsPerReq() uint32 { +func (o *GovChainInfoResponse) GetMaxEventsPerReq() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -214,7 +214,7 @@ func (o *GovChainInfoResponse) GetMaxEventsPerReq() uint32 { // GetMaxEventsPerReqOk returns a tuple with the MaxEventsPerReq field value // and a boolean to check if the value has been set. -func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool) { +func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*int32, bool) { if o == nil { return nil, false } @@ -222,7 +222,7 @@ func (o *GovChainInfoResponse) GetMaxEventsPerReqOk() (*uint32, bool) { } // SetMaxEventsPerReq sets field value -func (o *GovChainInfoResponse) SetMaxEventsPerReq(v uint32) { +func (o *GovChainInfoResponse) SetMaxEventsPerReq(v int32) { o.MaxEventsPerReq = v } diff --git a/clients/apiclient/model_in_output.go b/clients/apiclient/model_in_output.go index 5b0a03c280..b3de7acb19 100644 --- a/clients/apiclient/model_in_output.go +++ b/clients/apiclient/model_in_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output_metric_item.go b/clients/apiclient/model_in_output_metric_item.go index c92148503a..cf301ef547 100644 --- a/clients/apiclient/model_in_output_metric_item.go +++ b/clients/apiclient/model_in_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output.go b/clients/apiclient/model_in_state_output.go index 38c09de789..3e21334747 100644 --- a/clients/apiclient/model_in_state_output.go +++ b/clients/apiclient/model_in_state_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output_metric_item.go b/clients/apiclient/model_in_state_output_metric_item.go index fe4ed10571..c3571a95fa 100644 --- a/clients/apiclient/model_in_state_output_metric_item.go +++ b/clients/apiclient/model_in_state_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_info_response.go b/clients/apiclient/model_info_response.go index dc6bdd99e6..f6f21f625c 100644 --- a/clients/apiclient/model_info_response.go +++ b/clients/apiclient/model_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_interface_metric_item.go b/clients/apiclient/model_interface_metric_item.go index 255530c914..1a90127889 100644 --- a/clients/apiclient/model_interface_metric_item.go +++ b/clients/apiclient/model_interface_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_item.go b/clients/apiclient/model_item.go index 72691e4d4a..67d19182dc 100644 --- a/clients/apiclient/model_item.go +++ b/clients/apiclient/model_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_json_dict.go b/clients/apiclient/model_json_dict.go index ec6327597f..740515edaa 100644 --- a/clients/apiclient/model_json_dict.go +++ b/clients/apiclient/model_json_dict.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_l1_params.go b/clients/apiclient/model_l1_params.go index e2cad2d91f..10e8e546e8 100644 --- a/clients/apiclient/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,7 +21,7 @@ var _ MappedNullable = &L1Params{} type L1Params struct { BaseToken BaseToken `json:"baseToken"` // The max payload size - MaxPayloadSize uint32 `json:"maxPayloadSize"` + MaxPayloadSize int32 `json:"maxPayloadSize"` Protocol ProtocolParameters `json:"protocol"` } @@ -29,7 +29,7 @@ type L1Params struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewL1Params(baseToken BaseToken, maxPayloadSize uint32, protocol ProtocolParameters) *L1Params { +func NewL1Params(baseToken BaseToken, maxPayloadSize int32, protocol ProtocolParameters) *L1Params { this := L1Params{} this.BaseToken = baseToken this.MaxPayloadSize = maxPayloadSize @@ -70,9 +70,9 @@ func (o *L1Params) SetBaseToken(v BaseToken) { } // GetMaxPayloadSize returns the MaxPayloadSize field value -func (o *L1Params) GetMaxPayloadSize() uint32 { +func (o *L1Params) GetMaxPayloadSize() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -81,7 +81,7 @@ func (o *L1Params) GetMaxPayloadSize() uint32 { // GetMaxPayloadSizeOk returns a tuple with the MaxPayloadSize field value // and a boolean to check if the value has been set. -func (o *L1Params) GetMaxPayloadSizeOk() (*uint32, bool) { +func (o *L1Params) GetMaxPayloadSizeOk() (*int32, bool) { if o == nil { return nil, false } @@ -89,7 +89,7 @@ func (o *L1Params) GetMaxPayloadSizeOk() (*uint32, bool) { } // SetMaxPayloadSize sets field value -func (o *L1Params) SetMaxPayloadSize(v uint32) { +func (o *L1Params) SetMaxPayloadSize(v int32) { o.MaxPayloadSize = v } diff --git a/clients/apiclient/model_login_request.go b/clients/apiclient/model_login_request.go index d7cecc64c1..becb41c57a 100644 --- a/clients/apiclient/model_login_request.go +++ b/clients/apiclient/model_login_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_response.go b/clients/apiclient/model_login_response.go index fa81f98a5d..ba381dd941 100644 --- a/clients/apiclient/model_login_response.go +++ b/clients/apiclient/model_login_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go index 1e7e1ea36b..86d616d4a8 100644 --- a/clients/apiclient/model_milestone_info.go +++ b/clients/apiclient/model_milestone_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,9 +19,9 @@ var _ MappedNullable = &MilestoneInfo{} // MilestoneInfo struct for MilestoneInfo type MilestoneInfo struct { - Index *uint32 `json:"index,omitempty"` + Index *int32 `json:"index,omitempty"` MilestoneId *string `json:"milestoneId,omitempty"` - Timestamp *uint32 `json:"timestamp,omitempty"` + Timestamp *int32 `json:"timestamp,omitempty"` } // NewMilestoneInfo instantiates a new MilestoneInfo object @@ -42,9 +42,9 @@ func NewMilestoneInfoWithDefaults() *MilestoneInfo { } // GetIndex returns the Index field value if set, zero value otherwise. -func (o *MilestoneInfo) GetIndex() uint32 { +func (o *MilestoneInfo) GetIndex() int32 { if o == nil || isNil(o.Index) { - var ret uint32 + var ret int32 return ret } return *o.Index @@ -52,7 +52,7 @@ func (o *MilestoneInfo) GetIndex() uint32 { // GetIndexOk returns a tuple with the Index field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MilestoneInfo) GetIndexOk() (*uint32, bool) { +func (o *MilestoneInfo) GetIndexOk() (*int32, bool) { if o == nil || isNil(o.Index) { return nil, false } @@ -68,8 +68,8 @@ func (o *MilestoneInfo) HasIndex() bool { return false } -// SetIndex gets a reference to the given uint32 and assigns it to the Index field. -func (o *MilestoneInfo) SetIndex(v uint32) { +// SetIndex gets a reference to the given int32 and assigns it to the Index field. +func (o *MilestoneInfo) SetIndex(v int32) { o.Index = &v } @@ -106,9 +106,9 @@ func (o *MilestoneInfo) SetMilestoneId(v string) { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *MilestoneInfo) GetTimestamp() uint32 { +func (o *MilestoneInfo) GetTimestamp() int32 { if o == nil || isNil(o.Timestamp) { - var ret uint32 + var ret int32 return ret } return *o.Timestamp @@ -116,7 +116,7 @@ func (o *MilestoneInfo) GetTimestamp() uint32 { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MilestoneInfo) GetTimestampOk() (*uint32, bool) { +func (o *MilestoneInfo) GetTimestampOk() (*int32, bool) { if o == nil || isNil(o.Timestamp) { return nil, false } @@ -132,8 +132,8 @@ func (o *MilestoneInfo) HasTimestamp() bool { return false } -// SetTimestamp gets a reference to the given uint32 and assigns it to the Timestamp field. -func (o *MilestoneInfo) SetTimestamp(v uint32) { +// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field. +func (o *MilestoneInfo) SetTimestamp(v int32) { o.Timestamp = &v } diff --git a/clients/apiclient/model_milestone_metric_item.go b/clients/apiclient/model_milestone_metric_item.go index 35291ddc65..fe220ec11d 100644 --- a/clients/apiclient/model_milestone_metric_item.go +++ b/clients/apiclient/model_milestone_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token.go b/clients/apiclient/model_native_token.go index d0304a3837..82f785f610 100644 --- a/clients/apiclient/model_native_token.go +++ b/clients/apiclient/model_native_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token_id_registry_response.go b/clients/apiclient/model_native_token_id_registry_response.go index 6dcef76889..a4bcad4de0 100644 --- a/clients/apiclient/model_native_token_id_registry_response.go +++ b/clients/apiclient/model_native_token_id_registry_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_nft_data_response.go b/clients/apiclient/model_nft_data_response.go index 6e9b8717a4..9d0569c3f5 100644 --- a/clients/apiclient/model_nft_data_response.go +++ b/clients/apiclient/model_nft_data_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_request.go b/clients/apiclient/model_node_owner_certificate_request.go index 23151831cb..9e20c3c244 100644 --- a/clients/apiclient/model_node_owner_certificate_request.go +++ b/clients/apiclient/model_node_owner_certificate_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_response.go b/clients/apiclient/model_node_owner_certificate_response.go index 0df3e6dbd2..1ca36390f9 100644 --- a/clients/apiclient/model_node_owner_certificate_response.go +++ b/clients/apiclient/model_node_owner_certificate_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_off_ledger_request.go b/clients/apiclient/model_off_ledger_request.go index 2d836b0381..f5316f3d6a 100644 --- a/clients/apiclient/model_off_ledger_request.go +++ b/clients/apiclient/model_off_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request.go b/clients/apiclient/model_on_ledger_request.go index ef6e6216c9..cacbeab4b9 100644 --- a/clients/apiclient/model_on_ledger_request.go +++ b/clients/apiclient/model_on_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request_metric_item.go b/clients/apiclient/model_on_ledger_request_metric_item.go index 33bdb29c45..b9a1a73a86 100644 --- a/clients/apiclient/model_on_ledger_request_metric_item.go +++ b/clients/apiclient/model_on_ledger_request_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output.go b/clients/apiclient/model_output.go index b36fba4fe7..d84b29961b 100644 --- a/clients/apiclient/model_output.go +++ b/clients/apiclient/model_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ var _ MappedNullable = &Output{} // Output struct for Output type Output struct { // The output type - OutputType uint32 `json:"outputType"` + OutputType int32 `json:"outputType"` // The raw data of the output (Hex) Raw string `json:"raw"` } @@ -29,7 +29,7 @@ type Output struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewOutput(outputType uint32, raw string) *Output { +func NewOutput(outputType int32, raw string) *Output { this := Output{} this.OutputType = outputType this.Raw = raw @@ -45,9 +45,9 @@ func NewOutputWithDefaults() *Output { } // GetOutputType returns the OutputType field value -func (o *Output) GetOutputType() uint32 { +func (o *Output) GetOutputType() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -56,7 +56,7 @@ func (o *Output) GetOutputType() uint32 { // GetOutputTypeOk returns a tuple with the OutputType field value // and a boolean to check if the value has been set. -func (o *Output) GetOutputTypeOk() (*uint32, bool) { +func (o *Output) GetOutputTypeOk() (*int32, bool) { if o == nil { return nil, false } @@ -64,7 +64,7 @@ func (o *Output) GetOutputTypeOk() (*uint32, bool) { } // SetOutputType sets field value -func (o *Output) SetOutputType(v uint32) { +func (o *Output) SetOutputType(v int32) { o.OutputType = v } diff --git a/clients/apiclient/model_output_id.go b/clients/apiclient/model_output_id.go index b4e8473a67..9dab5aeb4b 100644 --- a/clients/apiclient/model_output_id.go +++ b/clients/apiclient/model_output_id.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_identity_response.go b/clients/apiclient/model_peering_node_identity_response.go index 581e8783da..8ab3913f6d 100644 --- a/clients/apiclient/model_peering_node_identity_response.go +++ b/clients/apiclient/model_peering_node_identity_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go index e40bb0bcd0..c6dfaeda2d 100644 --- a/clients/apiclient/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -25,7 +25,7 @@ type PeeringNodeStatusResponse struct { // The NetID of the peer NetId string `json:"netId"` // The amount of users attached to the peer - NumUsers uint32 `json:"numUsers"` + NumUsers int32 `json:"numUsers"` // The peers public key encoded in Hex PublicKey string `json:"publicKey"` } @@ -34,7 +34,7 @@ type PeeringNodeStatusResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers uint32, publicKey string) *PeeringNodeStatusResponse { +func NewPeeringNodeStatusResponse(isAlive bool, isTrusted bool, netId string, numUsers int32, publicKey string) *PeeringNodeStatusResponse { this := PeeringNodeStatusResponse{} this.IsAlive = isAlive this.IsTrusted = isTrusted @@ -125,9 +125,9 @@ func (o *PeeringNodeStatusResponse) SetNetId(v string) { } // GetNumUsers returns the NumUsers field value -func (o *PeeringNodeStatusResponse) GetNumUsers() uint32 { +func (o *PeeringNodeStatusResponse) GetNumUsers() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -136,7 +136,7 @@ func (o *PeeringNodeStatusResponse) GetNumUsers() uint32 { // GetNumUsersOk returns a tuple with the NumUsers field value // and a boolean to check if the value has been set. -func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*uint32, bool) { +func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*int32, bool) { if o == nil { return nil, false } @@ -144,7 +144,7 @@ func (o *PeeringNodeStatusResponse) GetNumUsersOk() (*uint32, bool) { } // SetNumUsers sets field value -func (o *PeeringNodeStatusResponse) SetNumUsers(v uint32) { +func (o *PeeringNodeStatusResponse) SetNumUsers(v int32) { o.NumUsers = v } diff --git a/clients/apiclient/model_peering_trust_request.go b/clients/apiclient/model_peering_trust_request.go index 40dccc5d2c..663ea66704 100644 --- a/clients/apiclient/model_peering_trust_request.go +++ b/clients/apiclient/model_peering_trust_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go index 8670370377..90bc1ebd5d 100644 --- a/clients/apiclient/model_protocol_parameters.go +++ b/clients/apiclient/model_protocol_parameters.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -31,14 +31,14 @@ type ProtocolParameters struct { // The token supply TokenSupply string `json:"tokenSupply"` // The protocol version - Version uint32 `json:"version"` + Version int32 `json:"version"` } // NewProtocolParameters instantiates a new ProtocolParameters object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version uint32) *ProtocolParameters { +func NewProtocolParameters(bech32Hrp string, belowMaxDepth uint32, minPowScore uint32, networkName string, rentStructure RentStructure, tokenSupply string, version int32) *ProtocolParameters { this := ProtocolParameters{} this.Bech32Hrp = bech32Hrp this.BelowMaxDepth = belowMaxDepth @@ -203,9 +203,9 @@ func (o *ProtocolParameters) SetTokenSupply(v string) { } // GetVersion returns the Version field value -func (o *ProtocolParameters) GetVersion() uint32 { +func (o *ProtocolParameters) GetVersion() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -214,7 +214,7 @@ func (o *ProtocolParameters) GetVersion() uint32 { // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. -func (o *ProtocolParameters) GetVersionOk() (*uint32, bool) { +func (o *ProtocolParameters) GetVersionOk() (*int32, bool) { if o == nil { return nil, false } @@ -222,7 +222,7 @@ func (o *ProtocolParameters) GetVersionOk() (*uint32, bool) { } // SetVersion sets field value -func (o *ProtocolParameters) SetVersion(v uint32) { +func (o *ProtocolParameters) SetVersion(v int32) { o.Version = v } diff --git a/clients/apiclient/model_publisher_state_transaction_item.go b/clients/apiclient/model_publisher_state_transaction_item.go index 46f0fd21ae..69d364d3b7 100644 --- a/clients/apiclient/model_publisher_state_transaction_item.go +++ b/clients/apiclient/model_publisher_state_transaction_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index ec31c93319..b4c73c3c85 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,7 +19,7 @@ var _ MappedNullable = &ReceiptError{} // ReceiptError struct for ReceiptError type ReceiptError struct { - ContractId uint32 `json:"contractId"` + ContractId int32 `json:"contractId"` ErrorCode string `json:"errorCode"` ErrorId uint32 `json:"errorId"` Message string `json:"message"` @@ -31,7 +31,7 @@ type ReceiptError struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewReceiptError(contractId uint32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { +func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { this := ReceiptError{} this.ContractId = contractId this.ErrorCode = errorCode @@ -51,9 +51,9 @@ func NewReceiptErrorWithDefaults() *ReceiptError { } // GetContractId returns the ContractId field value -func (o *ReceiptError) GetContractId() uint32 { +func (o *ReceiptError) GetContractId() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -62,7 +62,7 @@ func (o *ReceiptError) GetContractId() uint32 { // GetContractIdOk returns a tuple with the ContractId field value // and a boolean to check if the value has been set. -func (o *ReceiptError) GetContractIdOk() (*uint32, bool) { +func (o *ReceiptError) GetContractIdOk() (*int32, bool) { if o == nil { return nil, false } @@ -70,7 +70,7 @@ func (o *ReceiptError) GetContractIdOk() (*uint32, bool) { } // SetContractId sets field value -func (o *ReceiptError) SetContractId(v uint32) { +func (o *ReceiptError) SetContractId(v int32) { o.ContractId = v } diff --git a/clients/apiclient/model_receipt_response.go b/clients/apiclient/model_receipt_response.go index bd2bade3b7..6805b170db 100644 --- a/clients/apiclient/model_receipt_response.go +++ b/clients/apiclient/model_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,10 +21,13 @@ var _ MappedNullable = &ReceiptResponse{} type ReceiptResponse struct { BlockIndex uint32 `json:"blockIndex"` Error *ReceiptError `json:"error,omitempty"` - GasBudget int64 `json:"gasBudget"` + // The gas budget (uint64 as string) + GasBudget string `json:"gasBudget"` GasBurnLog []BurnRecord `json:"gasBurnLog"` - GasBurned int64 `json:"gasBurned"` - GasFeeCharged int64 `json:"gasFeeCharged"` + // The burned gas (uint64 as string) + GasBurned string `json:"gasBurned"` + // The charged gas fee (uint64 as string) + GasFeeCharged string `json:"gasFeeCharged"` Request string `json:"request"` RequestIndex uint32 `json:"requestIndex"` } @@ -33,7 +36,7 @@ type ReceiptResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog []BurnRecord, gasBurned int64, gasFeeCharged int64, request string, requestIndex uint32) *ReceiptResponse { +func NewReceiptResponse(blockIndex uint32, gasBudget string, gasBurnLog []BurnRecord, gasBurned string, gasFeeCharged string, request string, requestIndex uint32) *ReceiptResponse { this := ReceiptResponse{} this.BlockIndex = blockIndex this.GasBudget = gasBudget @@ -110,9 +113,9 @@ func (o *ReceiptResponse) SetError(v ReceiptError) { } // GetGasBudget returns the GasBudget field value -func (o *ReceiptResponse) GetGasBudget() int64 { +func (o *ReceiptResponse) GetGasBudget() string { if o == nil { - var ret int64 + var ret string return ret } @@ -121,7 +124,7 @@ func (o *ReceiptResponse) GetGasBudget() int64 { // GetGasBudgetOk returns a tuple with the GasBudget field value // and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool) { +func (o *ReceiptResponse) GetGasBudgetOk() (*string, bool) { if o == nil { return nil, false } @@ -129,7 +132,7 @@ func (o *ReceiptResponse) GetGasBudgetOk() (*int64, bool) { } // SetGasBudget sets field value -func (o *ReceiptResponse) SetGasBudget(v int64) { +func (o *ReceiptResponse) SetGasBudget(v string) { o.GasBudget = v } @@ -158,9 +161,9 @@ func (o *ReceiptResponse) SetGasBurnLog(v []BurnRecord) { } // GetGasBurned returns the GasBurned field value -func (o *ReceiptResponse) GetGasBurned() int64 { +func (o *ReceiptResponse) GetGasBurned() string { if o == nil { - var ret int64 + var ret string return ret } @@ -169,7 +172,7 @@ func (o *ReceiptResponse) GetGasBurned() int64 { // GetGasBurnedOk returns a tuple with the GasBurned field value // and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool) { +func (o *ReceiptResponse) GetGasBurnedOk() (*string, bool) { if o == nil { return nil, false } @@ -177,14 +180,14 @@ func (o *ReceiptResponse) GetGasBurnedOk() (*int64, bool) { } // SetGasBurned sets field value -func (o *ReceiptResponse) SetGasBurned(v int64) { +func (o *ReceiptResponse) SetGasBurned(v string) { o.GasBurned = v } // GetGasFeeCharged returns the GasFeeCharged field value -func (o *ReceiptResponse) GetGasFeeCharged() int64 { +func (o *ReceiptResponse) GetGasFeeCharged() string { if o == nil { - var ret int64 + var ret string return ret } @@ -193,7 +196,7 @@ func (o *ReceiptResponse) GetGasFeeCharged() int64 { // GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value // and a boolean to check if the value has been set. -func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { +func (o *ReceiptResponse) GetGasFeeChargedOk() (*string, bool) { if o == nil { return nil, false } @@ -201,7 +204,7 @@ func (o *ReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { } // SetGasFeeCharged sets field value -func (o *ReceiptResponse) SetGasFeeCharged(v int64) { +func (o *ReceiptResponse) SetGasFeeCharged(v string) { o.GasFeeCharged = v } diff --git a/clients/apiclient/model_rent_structure.go b/clients/apiclient/model_rent_structure.go index 862e5c4f08..233a1ff873 100644 --- a/clients/apiclient/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,16 +22,16 @@ type RentStructure struct { // The virtual byte cost VByteCost uint32 `json:"vByteCost"` // The virtual byte factor for data fields - VByteFactorData uint32 `json:"vByteFactorData"` + VByteFactorData int32 `json:"vByteFactorData"` // The virtual byte factor for key/lookup generating fields - VByteFactorKey uint32 `json:"vByteFactorKey"` + VByteFactorKey int32 `json:"vByteFactorKey"` } // NewRentStructure instantiates a new RentStructure object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRentStructure(vByteCost uint32, vByteFactorData uint32, vByteFactorKey uint32) *RentStructure { +func NewRentStructure(vByteCost uint32, vByteFactorData int32, vByteFactorKey int32) *RentStructure { this := RentStructure{} this.VByteCost = vByteCost this.VByteFactorData = vByteFactorData @@ -72,9 +72,9 @@ func (o *RentStructure) SetVByteCost(v uint32) { } // GetVByteFactorData returns the VByteFactorData field value -func (o *RentStructure) GetVByteFactorData() uint32 { +func (o *RentStructure) GetVByteFactorData() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -83,7 +83,7 @@ func (o *RentStructure) GetVByteFactorData() uint32 { // GetVByteFactorDataOk returns a tuple with the VByteFactorData field value // and a boolean to check if the value has been set. -func (o *RentStructure) GetVByteFactorDataOk() (*uint32, bool) { +func (o *RentStructure) GetVByteFactorDataOk() (*int32, bool) { if o == nil { return nil, false } @@ -91,14 +91,14 @@ func (o *RentStructure) GetVByteFactorDataOk() (*uint32, bool) { } // SetVByteFactorData sets field value -func (o *RentStructure) SetVByteFactorData(v uint32) { +func (o *RentStructure) SetVByteFactorData(v int32) { o.VByteFactorData = v } // GetVByteFactorKey returns the VByteFactorKey field value -func (o *RentStructure) GetVByteFactorKey() uint32 { +func (o *RentStructure) GetVByteFactorKey() int32 { if o == nil { - var ret uint32 + var ret int32 return ret } @@ -107,7 +107,7 @@ func (o *RentStructure) GetVByteFactorKey() uint32 { // GetVByteFactorKeyOk returns a tuple with the VByteFactorKey field value // and a boolean to check if the value has been set. -func (o *RentStructure) GetVByteFactorKeyOk() (*uint32, bool) { +func (o *RentStructure) GetVByteFactorKeyOk() (*int32, bool) { if o == nil { return nil, false } @@ -115,7 +115,7 @@ func (o *RentStructure) GetVByteFactorKeyOk() (*uint32, bool) { } // SetVByteFactorKey sets field value -func (o *RentStructure) SetVByteFactorKey(v uint32) { +func (o *RentStructure) SetVByteFactorKey(v int32) { o.VByteFactorKey = v } diff --git a/clients/apiclient/model_request_detail.go b/clients/apiclient/model_request_detail.go index 0720a98ca2..061f15d9d6 100644 --- a/clients/apiclient/model_request_detail.go +++ b/clients/apiclient/model_request_detail.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -22,7 +22,8 @@ type RequestDetail struct { Allowance Assets `json:"allowance"` CallTarget CallTarget `json:"callTarget"` FungibleTokens Assets `json:"fungibleTokens"` - GasGudget int64 `json:"gasGudget"` + // The gas budget (uint64 as string) + GasGudget string `json:"gasGudget"` IsEVM bool `json:"isEVM"` IsOffLedger bool `json:"isOffLedger"` Nft NFTDataResponse `json:"nft"` @@ -36,7 +37,7 @@ type RequestDetail struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRequestDetail(allowance Assets, callTarget CallTarget, fungibleTokens Assets, gasGudget int64, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string) *RequestDetail { +func NewRequestDetail(allowance Assets, callTarget CallTarget, fungibleTokens Assets, gasGudget string, isEVM bool, isOffLedger bool, nft NFTDataResponse, params JSONDict, requestId string, senderAccount string, targetAddress string) *RequestDetail { this := RequestDetail{} this.Allowance = allowance this.CallTarget = callTarget @@ -133,9 +134,9 @@ func (o *RequestDetail) SetFungibleTokens(v Assets) { } // GetGasGudget returns the GasGudget field value -func (o *RequestDetail) GetGasGudget() int64 { +func (o *RequestDetail) GetGasGudget() string { if o == nil { - var ret int64 + var ret string return ret } @@ -144,7 +145,7 @@ func (o *RequestDetail) GetGasGudget() int64 { // GetGasGudgetOk returns a tuple with the GasGudget field value // and a boolean to check if the value has been set. -func (o *RequestDetail) GetGasGudgetOk() (*int64, bool) { +func (o *RequestDetail) GetGasGudgetOk() (*string, bool) { if o == nil { return nil, false } @@ -152,7 +153,7 @@ func (o *RequestDetail) GetGasGudgetOk() (*int64, bool) { } // SetGasGudget sets field value -func (o *RequestDetail) SetGasGudget(v int64) { +func (o *RequestDetail) SetGasGudget(v string) { o.GasGudget = v } diff --git a/clients/apiclient/model_request_ids_response.go b/clients/apiclient/model_request_ids_response.go index b17a92d5a1..805f94071e 100644 --- a/clients/apiclient/model_request_ids_response.go +++ b/clients/apiclient/model_request_ids_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_processed_response.go b/clients/apiclient/model_request_processed_response.go index fb3d60a911..1c9ca0ae8f 100644 --- a/clients/apiclient/model_request_processed_response.go +++ b/clients/apiclient/model_request_processed_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_receipt_response.go b/clients/apiclient/model_request_receipt_response.go index f8e84d0bc7..0495df3ae9 100644 --- a/clients/apiclient/model_request_receipt_response.go +++ b/clients/apiclient/model_request_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,10 +21,13 @@ var _ MappedNullable = &RequestReceiptResponse{} type RequestReceiptResponse struct { BlockIndex uint32 `json:"blockIndex"` Error *BlockReceiptError `json:"error,omitempty"` - GasBudget int64 `json:"gasBudget"` + // The gas budget (uint64 as string) + GasBudget string `json:"gasBudget"` GasBurnLog BurnLog `json:"gasBurnLog"` - GasBurned int64 `json:"gasBurned"` - GasFeeCharged int64 `json:"gasFeeCharged"` + // The burned gas (uint64 as string) + GasBurned string `json:"gasBurned"` + // The charged gas fee (uint64 as string) + GasFeeCharged string `json:"gasFeeCharged"` Request RequestDetail `json:"request"` RequestIndex uint32 `json:"requestIndex"` } @@ -33,7 +36,7 @@ type RequestReceiptResponse struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRequestReceiptResponse(blockIndex uint32, gasBudget int64, gasBurnLog BurnLog, gasBurned int64, gasFeeCharged int64, request RequestDetail, requestIndex uint32) *RequestReceiptResponse { +func NewRequestReceiptResponse(blockIndex uint32, gasBudget string, gasBurnLog BurnLog, gasBurned string, gasFeeCharged string, request RequestDetail, requestIndex uint32) *RequestReceiptResponse { this := RequestReceiptResponse{} this.BlockIndex = blockIndex this.GasBudget = gasBudget @@ -110,9 +113,9 @@ func (o *RequestReceiptResponse) SetError(v BlockReceiptError) { } // GetGasBudget returns the GasBudget field value -func (o *RequestReceiptResponse) GetGasBudget() int64 { +func (o *RequestReceiptResponse) GetGasBudget() string { if o == nil { - var ret int64 + var ret string return ret } @@ -121,7 +124,7 @@ func (o *RequestReceiptResponse) GetGasBudget() int64 { // GetGasBudgetOk returns a tuple with the GasBudget field value // and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool) { +func (o *RequestReceiptResponse) GetGasBudgetOk() (*string, bool) { if o == nil { return nil, false } @@ -129,7 +132,7 @@ func (o *RequestReceiptResponse) GetGasBudgetOk() (*int64, bool) { } // SetGasBudget sets field value -func (o *RequestReceiptResponse) SetGasBudget(v int64) { +func (o *RequestReceiptResponse) SetGasBudget(v string) { o.GasBudget = v } @@ -158,9 +161,9 @@ func (o *RequestReceiptResponse) SetGasBurnLog(v BurnLog) { } // GetGasBurned returns the GasBurned field value -func (o *RequestReceiptResponse) GetGasBurned() int64 { +func (o *RequestReceiptResponse) GetGasBurned() string { if o == nil { - var ret int64 + var ret string return ret } @@ -169,7 +172,7 @@ func (o *RequestReceiptResponse) GetGasBurned() int64 { // GetGasBurnedOk returns a tuple with the GasBurned field value // and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool) { +func (o *RequestReceiptResponse) GetGasBurnedOk() (*string, bool) { if o == nil { return nil, false } @@ -177,14 +180,14 @@ func (o *RequestReceiptResponse) GetGasBurnedOk() (*int64, bool) { } // SetGasBurned sets field value -func (o *RequestReceiptResponse) SetGasBurned(v int64) { +func (o *RequestReceiptResponse) SetGasBurned(v string) { o.GasBurned = v } // GetGasFeeCharged returns the GasFeeCharged field value -func (o *RequestReceiptResponse) GetGasFeeCharged() int64 { +func (o *RequestReceiptResponse) GetGasFeeCharged() string { if o == nil { - var ret int64 + var ret string return ret } @@ -193,7 +196,7 @@ func (o *RequestReceiptResponse) GetGasFeeCharged() int64 { // GetGasFeeChargedOk returns a tuple with the GasFeeCharged field value // and a boolean to check if the value has been set. -func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { +func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*string, bool) { if o == nil { return nil, false } @@ -201,7 +204,7 @@ func (o *RequestReceiptResponse) GetGasFeeChargedOk() (*int64, bool) { } // SetGasFeeCharged sets field value -func (o *RequestReceiptResponse) SetGasFeeCharged(v int64) { +func (o *RequestReceiptResponse) SetGasFeeCharged(v string) { o.GasFeeCharged = v } diff --git a/clients/apiclient/model_state_response.go b/clients/apiclient/model_state_response.go index ca99e08b4f..9fc579743c 100644 --- a/clients/apiclient/model_state_response.go +++ b/clients/apiclient/model_state_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_transaction.go b/clients/apiclient/model_state_transaction.go index 08efa1cec4..38a35ddde3 100644 --- a/clients/apiclient/model_state_transaction.go +++ b/clients/apiclient/model_state_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction.go b/clients/apiclient/model_transaction.go index f34a58aab6..171c0c01dd 100644 --- a/clients/apiclient/model_transaction.go +++ b/clients/apiclient/model_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_id_metric_item.go b/clients/apiclient/model_transaction_id_metric_item.go index b3c73aee27..a8c9ae7b8a 100644 --- a/clients/apiclient/model_transaction_id_metric_item.go +++ b/clients/apiclient/model_transaction_id_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_metric_item.go b/clients/apiclient/model_transaction_metric_item.go index 3154d81b43..73026fbcc9 100644 --- a/clients/apiclient/model_transaction_metric_item.go +++ b/clients/apiclient/model_transaction_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg.go b/clients/apiclient/model_tx_inclusion_state_msg.go index c7ae482a7a..ba4e3eed65 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg.go +++ b/clients/apiclient/model_tx_inclusion_state_msg.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go index af4dec6c57..bb95ce206e 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go +++ b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_password_request.go b/clients/apiclient/model_update_user_password_request.go index b5ae414d7c..f8d0866e47 100644 --- a/clients/apiclient/model_update_user_password_request.go +++ b/clients/apiclient/model_update_user_password_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_permissions_request.go b/clients/apiclient/model_update_user_permissions_request.go index 4b127bf830..7e6ead6512 100644 --- a/clients/apiclient/model_update_user_permissions_request.go +++ b/clients/apiclient/model_update_user_permissions_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_user.go b/clients/apiclient/model_user.go index c2341646a7..7cc6c368a0 100644 --- a/clients/apiclient/model_user.go +++ b/clients/apiclient/model_user.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_utxo_input_metric_item.go b/clients/apiclient/model_utxo_input_metric_item.go index 58ba0c21e6..cc9f7339f1 100644 --- a/clients/apiclient/model_utxo_input_metric_item.go +++ b/clients/apiclient/model_utxo_input_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_validation_error.go b/clients/apiclient/model_validation_error.go index 318511c473..8bb3e5d5bb 100644 --- a/clients/apiclient/model_validation_error.go +++ b/clients/apiclient/model_validation_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_version_response.go b/clients/apiclient/model_version_response.go index d93aff41a5..2e631d1d52 100644 --- a/clients/apiclient/model_version_response.go +++ b/clients/apiclient/model_version_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/response.go b/clients/apiclient/response.go index 7adf029fbb..a1cfa4cb83 100644 --- a/clients/apiclient/response.go +++ b/clients/apiclient/response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/utils.go b/clients/apiclient/utils.go index 863a82efec..e6028e6e45 100644 --- a/clients/apiclient/utils.go +++ b/clients/apiclient/utils.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: 0.4.0-alpha.8-16-g83edf92b9 +API version: v0.4.0-alpha.8-60-g8b0f75e6d */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -23,7 +23,7 @@ func PtrBool(v bool) *bool { return &v } func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v uint32) *uint32 { return &v } +func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. func PtrInt64(v int64) *int64 { return &v } @@ -113,15 +113,15 @@ func (v *NullableInt) UnmarshalJSON(src []byte) error { } type NullableInt32 struct { - value *uint32 + value *int32 isSet bool } -func (v NullableInt32) Get() *uint32 { +func (v NullableInt32) Get() *int32 { return v.value } -func (v *NullableInt32) Set(val *uint32) { +func (v *NullableInt32) Set(val *int32) { v.value = val v.isSet = true } @@ -135,7 +135,7 @@ func (v *NullableInt32) Unset() { v.isSet = false } -func NewNullableInt32(val *uint32) *NullableInt32 { +func NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } diff --git a/clients/auth/auth.go b/clients/auth/auth.go deleted file mode 100644 index bbfa3ddf23..0000000000 --- a/clients/auth/auth.go +++ /dev/null @@ -1,47 +0,0 @@ -package auth - -import ( - "bytes" - "encoding/json" - "io" - "net/http" - - "github.com/iotaledger/wasp/packages/authentication/shared" -) - -// Login is a soon-to-be deprecated login function. It will be replaced by a generated client function. -func Login(client *http.Client, username, password string) (string, error) { - loginRequest := shared.LoginRequest{ - Username: username, - Password: password, - } - - requestBytes, err := json.Marshal(loginRequest) - - if err != nil { - return "", err - } - - request, err := http.NewRequest(http.MethodPost, "/auth", bytes.NewBuffer(requestBytes)) - if err != nil { - return "", err - } - - result, err := client.Do(request) - if err != nil { - return "", err - } - - resBody, err := io.ReadAll(result.Body) - if err != nil { - return "", err - } - - var loginResponse shared.LoginResponse - err = json.Unmarshal(resBody, &loginResponse) - if err != nil { - return "", err - } - - return loginResponse.JWT, nil -} diff --git a/packages/webapi/controllers/chain/contracts.go b/packages/webapi/controllers/chain/contracts.go index e3c16a2591..b09a487ea0 100644 --- a/packages/webapi/controllers/chain/contracts.go +++ b/packages/webapi/controllers/chain/contracts.go @@ -27,7 +27,7 @@ func (c *Controller) getContracts(e echo.Context) error { Description: contract.Description, HName: hName.String(), Name: contract.Name, - ProgramHash: contract.ProgramHash, + ProgramHash: contract.ProgramHash.String(), } contractList = append(contractList, contractInfo) diff --git a/packages/webapi/controllers/corecontracts/controller.go b/packages/webapi/controllers/corecontracts/controller.go index d4cd6011b1..c7ff18f268 100644 --- a/packages/webapi/controllers/corecontracts/controller.go +++ b/packages/webapi/controllers/corecontracts/controller.go @@ -198,8 +198,7 @@ func (c *Controller) addBlockLogContractRoutes(api echoswagger.ApiGroup, mocker SetSummary("Get the request ids for the latest block") api.GET("chains/:chainID/core/blocklog/blocks/:blockIndex/receipts", c.getRequestReceiptsForBlock). - AddParamPath("", "chainID", "ChainID (Bech32)"). - AddParamPath(0, "blockIndex", "Block Index (uint32)"). + AddParamPathNested(blocks{}). AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). AddResponse(http.StatusOK, "The receipts", mocker.Get(models.BlockReceiptsResponse{}), nil). SetOperationId("blocklogGetRequestReceiptsOfBlock"). diff --git a/packages/webapi/controllers/requests/controller.go b/packages/webapi/controllers/requests/controller.go index 6817900f68..b3137d273c 100644 --- a/packages/webapi/controllers/requests/controller.go +++ b/packages/webapi/controllers/requests/controller.go @@ -64,6 +64,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter SetOperationId("waitForRequest"). AddParamPath("", "chainID", "ChainID (Bech32)"). AddParamPath("", "requestID", "RequestID (Hex)"). + AddParamQuery(0, "timeoutSeconds", "The timeout in seconds", false). AddResponse(http.StatusNotFound, "The chain or request id is invalid", nil, nil). AddResponse(http.StatusRequestTimeout, "The waiting time has reached the defined limit", nil, nil). AddResponse(http.StatusOK, "The request receipt", mocker.Get(models.ReceiptResponse{}), nil) diff --git a/packages/webapi/controllers/requests/waitforrequest.go b/packages/webapi/controllers/requests/waitforrequest.go index 94e99fd68a..1286680cc8 100644 --- a/packages/webapi/controllers/requests/waitforrequest.go +++ b/packages/webapi/controllers/requests/waitforrequest.go @@ -2,6 +2,7 @@ package requests import ( "net/http" + "strconv" "time" "github.com/labstack/echo/v4" @@ -11,6 +12,9 @@ import ( ) func (c *Controller) waitForRequestToFinish(e echo.Context) error { + const maximumTimeoutSeconds = 60 + const defaultTimeoutSeconds = 30 + chainID, err := params.DecodeChainID(e) if err != nil { return err @@ -21,7 +25,22 @@ func (c *Controller) waitForRequestToFinish(e echo.Context) error { return err } - receipt, vmError, err := c.chainService.WaitForRequestProcessed(e.Request().Context(), chainID, requestID, 30*time.Second) + timeout := defaultTimeoutSeconds * time.Second + + timeoutInSeconds := e.QueryParam("timeoutSeconds") + if len(timeoutInSeconds) > 0 { + parsedTimeout, _ := strconv.Atoi(timeoutInSeconds) + + if err != nil { + if parsedTimeout > maximumTimeoutSeconds { + parsedTimeout = maximumTimeoutSeconds + } + + timeout = time.Duration(parsedTimeout) * time.Second + } + } + + receipt, vmError, err := c.chainService.WaitForRequestProcessed(e.Request().Context(), chainID, requestID, timeout) if err != nil { return err } diff --git a/packages/webapi/models/chain.go b/packages/webapi/models/chain.go index 193d6263ec..ec6b2844a2 100644 --- a/packages/webapi/models/chain.go +++ b/packages/webapi/models/chain.go @@ -2,7 +2,6 @@ package models import ( iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/isc" dto2 "github.com/iotaledger/wasp/packages/webapi/dto" ) @@ -45,10 +44,10 @@ type CommitteeInfoResponse struct { } type ContractInfoResponse struct { - Description string `json:"description" swagger:"desc(The description of the contract.),required"` - HName string `json:"hName" swagger:"desc(The id (HName as Hex)) of the contract.),required"` - Name string `json:"name" swagger:"desc(The name of the contract.),required"` - ProgramHash hashing.HashValue `json:"programHash" swagger:"desc(The hash of the contract.),required"` + Description string `json:"description" swagger:"desc(The description of the contract.),required"` + HName string `json:"hName" swagger:"desc(The id (HName as Hex)) of the contract.),required"` + Name string `json:"name" swagger:"desc(The name of the contract.),required"` + ProgramHash string `json:"programHash" swagger:"desc(The hash of the contract. (Hex encoded)),required"` } type gasFeePolicy struct { diff --git a/packages/webapi/services/chain.go b/packages/webapi/services/chain.go index 91906913ea..060419178c 100644 --- a/packages/webapi/services/chain.go +++ b/packages/webapi/services/chain.go @@ -20,8 +20,6 @@ import ( "github.com/iotaledger/wasp/packages/webapi/interfaces" ) -const MaxTimeout = 30 * time.Second - type ChainService struct { governance *corecontracts.Governance chainsProvider chains.Provider @@ -186,13 +184,7 @@ func (c *ChainService) WaitForRequestProcessed(ctx context.Context, chainID isc. return receipt, vmError, nil } - adjustedTimeout := timeout - - if timeout > MaxTimeout { - adjustedTimeout = MaxTimeout - } - - timeoutCtx, cancelCtx := context.WithTimeout(ctx, adjustedTimeout) + timeoutCtx, cancelCtx := context.WithTimeout(ctx, timeout) defer cancelCtx() receiptResponse := <-chain.AwaitRequestProcessed(timeoutCtx, requestID, true) diff --git a/tools/api-gen/apigen.sh b/tools/api-gen/apigen.sh new file mode 100644 index 0000000000..e47cd73ab5 --- /dev/null +++ b/tools/api-gen/apigen.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +GIT_REF_TAG=$(git describe --tags) +BUILD_LD_FLAGS="-X=github.com/iotaledger/wasp/core/app.Version=$GIT_REF_TAG" + +go run -ldflags="$BUILD_LD_FLAGS" ./main.go "$@" \ No newline at end of file diff --git a/tools/wasp-cli/chain/accounts.go b/tools/wasp-cli/chain/accounts.go index 707af0448e..eb50e42930 100644 --- a/tools/wasp-cli/chain/accounts.go +++ b/tools/wasp-cli/chain/accounts.go @@ -67,7 +67,7 @@ func initBalanceCmd() *cobra.Command { header := []string{"token", "amount"} rows := make([][]string, len(balance.NativeTokens)+1) - rows[0] = []string{"Base Token", iotago.EncodeUint64(uint64(balance.BaseTokens))} + rows[0] = []string{"Base Token", balance.BaseTokens} for k, v := range balance.NativeTokens { rows[k+1] = []string{v.Id, v.Amount} } diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index 4ec9925e3e..555730f288 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -63,7 +63,6 @@ func fetchBlockInfo(args []string) *apiclient.BlockInfoResponse { func logRequestsInBlock(index uint32) { client := cliclients.WaspClientForIndex() - // TODO: It should be uint32 here. Fix generator! receipts, _, err := client.CorecontractsApi. BlocklogGetRequestReceiptsOfBlock(context.Background(), config.GetCurrentChainID().String(), index). Execute() @@ -114,7 +113,6 @@ func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { func logEventsInBlock(index uint32) { client := cliclients.WaspClientForIndex() - // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. BlocklogGetEventsOfBlock(context.Background(), config.GetCurrentChainID().String(), index). Execute() @@ -151,7 +149,6 @@ func initRequestCmd() *cobra.Command { func logEventsInRequest(reqID isc.RequestID) { client := cliclients.WaspClientForIndex() - // TODO: It should be uint32 here. Fix generator! events, _, err := client.CorecontractsApi. BlocklogGetEventsOfRequest(context.Background(), config.GetCurrentChainID().String(), reqID.String()). Execute() diff --git a/tools/wasp-cli/chain/listcontracts.go b/tools/wasp-cli/chain/listcontracts.go index fef42b5f15..6b0dc78221 100644 --- a/tools/wasp-cli/chain/listcontracts.go +++ b/tools/wasp-cli/chain/listcontracts.go @@ -5,10 +5,6 @@ import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/clients" - "github.com/iotaledger/wasp/clients/apiclient" - "github.com/iotaledger/wasp/packages/kv/collections" - "github.com/iotaledger/wasp/packages/vm/core/root" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" @@ -21,22 +17,10 @@ func initListContractsCmd() *cobra.Command { Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { client := cliclients.WaspClientForIndex() + contracts, _, err := client.ChainsApi. + GetContracts(context.Background(), config.GetCurrentChainID().String()). + Execute() - // TODO: Implement root view calls into v2 api - records, _, err := client.RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ - ContractName: root.Contract.Name, - FunctionName: root.ViewGetContractRecords.Name, - ChainId: config.GetCurrentChainID().String(), - }).Execute() - - if records == nil { - log.Fatal("Could not fetch contract records") - } - - parsedRecords, err := clients.APIJsonDictToDict(*records) - log.Check(err) - - contracts, err := root.DecodeContractRegistry(collections.NewMapReadOnly(parsedRecords, root.StateVarContractRegistry)) log.Check(err) log.Printf("Total %d contracts in chain %s\n", len(contracts), config.GetCurrentChainID()) @@ -51,12 +35,12 @@ func initListContractsCmd() *cobra.Command { } rows := make([][]string, len(contracts)) i := 0 - for hname, c := range contracts { + for _, contract := range contracts { rows[i] = []string{ - hname.String(), - c.Name, - c.Description, - c.ProgramHash.String(), + contract.HName, + contract.Name, + contract.Description, + contract.ProgramHash, } i++ } diff --git a/tools/wasp-cli/util/tx.go b/tools/wasp-cli/util/tx.go index 0ad1dae957..71910b6bfd 100644 --- a/tools/wasp-cli/util/tx.go +++ b/tools/wasp-cli/util/tx.go @@ -13,20 +13,15 @@ import ( "github.com/iotaledger/wasp/tools/wasp-cli/log" ) -func PostTransaction(tx *iotago.Transaction) { - _, err := cliclients.L1Client().PostTxAndWaitUntilConfirmation(tx) - log.Check(err) -} - func WithOffLedgerRequest(chainID isc.ChainID, f func() (isc.OffLedgerRequest, error)) { req, err := f() log.Check(err) log.Printf("Posted off-ledger request (check result with: %s chain request %s)\n", os.Args[0], req.ID().String()) if config.WaitForCompletion { - // TODO: Add timeout again? 1*time.Minute _, _, err = cliclients.WaspClientForIndex().RequestsApi. WaitForRequest(context.Background(), chainID.String(), req.ID().String()). + TimeoutSeconds(60). Execute() log.Check(err) From 7ae02702ee59e06068945c8b4ab8485e1c663f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 23:11:41 +0100 Subject: [PATCH 22/39] Update wasmclient ts --- clients/apiclient/generate_client.sh | 8 +++-- .../wasmclient/ts/wasmclient/lib/isc/codec.ts | 12 +++++++ .../ts/wasmclient/lib/isc/waspclient.ts | 31 ++++++++++++++----- .../ts/wasmclient/package-lock.json | 8 +++++ .../wasmclient/ts/wasmclient/package.json | 1 + 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/clients/apiclient/generate_client.sh b/clients/apiclient/generate_client.sh index b8ce7fb8a5..7e6a860736 100644 --- a/clients/apiclient/generate_client.sh +++ b/clients/apiclient/generate_client.sh @@ -1,6 +1,8 @@ #!/bin/sh openapi-generator-cli generate -i http://localhost:9090/doc/swagger.json \ - -g go \ - --package-name=apiclient \ - --additional-properties preferUnsignedInt=TRUE + --global-property=models,supportingFiles,apis,modelTests=false,apiTests=false \ + -g go \ + -o /mnt/Dev/Coding/iota/wasp/clients/apiclient \ + --package-name=apiclient \ + --additional-properties preferUnsignedInt=TRUE \ No newline at end of file diff --git a/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/codec.ts b/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/codec.ts index 3e22f5a3f5..3e6537d0a4 100644 --- a/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/codec.ts +++ b/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/codec.ts @@ -14,6 +14,18 @@ export class JsonReq { Items: JsonItem[] = []; } +export interface APICallViewRequest { + contractHName: string; + functionHName: string; + chainId: string; + arguments: JsonReq; +} + +export interface APIOffLedgerRequest { + chainId: string; + request: string; +} + export class JsonResp { Items: JsonItem[] = []; Message = ''; diff --git a/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts b/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts index 2a59c0dc57..c17dc25fc1 100644 --- a/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts +++ b/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts @@ -5,7 +5,8 @@ import {Base64} from '@iota/util.js'; import * as wasmlib from 'wasmlib'; import {SyncRequestClient} from './ts-sync-request'; import {OffLedgerRequest} from './offledgerrequest'; -import {Codec, JsonReq, JsonResp} from './codec'; +import {APICallViewRequest, APIOffLedgerRequest, Codec, JsonReq, JsonResp} from './codec'; +import { encode, decode } from 'as-hex'; export type Error = string | null; @@ -20,12 +21,19 @@ export class WaspClient { } public callViewByHname(chainID: wasmlib.ScChainID, hContract: wasmlib.ScHname, hFunction: wasmlib.ScHname, args: Uint8Array): [Uint8Array, Error] { - const url = this.baseURL + '/chain/' + chainID.toString() + '/contract/' + hContract.toString() + '/callviewbyhname/' + hFunction.toString(); + const url = this.baseURL + '/requests/callview'; const req = new SyncRequestClient(); req.addHeader('Content-Type', 'application/json'); - const body = Codec.jsonEncode(args); + + const callViewRequest: APICallViewRequest = { + contractHName: hContract.toString(), + functionHName: hFunction.toString(), + chainId: chainID.toString(), + arguments: Codec.jsonEncode(args), + }; + try { - const resp = req.post(url, body); + const resp = req.post(url, callViewRequest); const result = Codec.jsonDecode(resp); return [result, null]; } catch (error) { @@ -36,13 +44,21 @@ export class WaspClient { } } + + public postOffLedgerRequest(chainID: wasmlib.ScChainID, signed: OffLedgerRequest): Error { const url = this.baseURL + '/chain/' + chainID.toString() + '/request'; const req = new SyncRequestClient(); req.addHeader('Content-Type', 'application/json'); - const body = {Request: Base64.encode(signed.bytes())}; + + const offLedgerRequest: APIOffLedgerRequest = { + chainId: chainID.toString(), + // Validate if this is actually valid to do. This byte array needs to be sent as hex. + request: encode(signed.bytes().toString()), + }; + try { - req.post(url, body); + req.post(url, offLedgerRequest); return null; } catch (error) { let message; @@ -53,7 +69,8 @@ export class WaspClient { } public waitUntilRequestProcessed(chainID: wasmlib.ScChainID, reqID: wasmlib.ScRequestID, timeout: u32): Error { - const url = this.baseURL + '/chain/' + chainID.toString() + '/request/' + reqID.toString() + '/wait'; + // Timeout of the wait can be set with `/wait?timeoutSeconds=`. Max seconds are 60secs. + const url = this.baseURL + '/chains/' + chainID.toString() + '/requests/' + reqID.toString() + '/wait'; const response = new SyncRequestClient().get(url); return null; } diff --git a/packages/wasmvm/wasmclient/ts/wasmclient/package-lock.json b/packages/wasmvm/wasmclient/ts/wasmclient/package-lock.json index 9988b770ad..f3476a39d9 100644 --- a/packages/wasmvm/wasmclient/ts/wasmclient/package-lock.json +++ b/packages/wasmvm/wasmclient/ts/wasmclient/package-lock.json @@ -8,6 +8,9 @@ "name": "wasmclient", "version": "1.0.0", "license": "ISC", + "dependencies": { + "as-hex": "^1.0.1" + }, "devDependencies": { "@babel/types": "^7.20.0", "@iota/iota.js": "^2.0.0-rc.1", @@ -1810,6 +1813,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/as-hex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/as-hex/-/as-hex-1.0.1.tgz", + "integrity": "sha512-bafVzM51AYyLzS2uQ2rsWfnWJARqGVxuiuLF7r3tIvi1UxHXy0FfHLtzo7o4F3Kk+uJhK9mLVaFmuFIa9C84GQ==" + }, "node_modules/asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", diff --git a/packages/wasmvm/wasmclient/ts/wasmclient/package.json b/packages/wasmvm/wasmclient/ts/wasmclient/package.json index 0002794255..c09b59168e 100644 --- a/packages/wasmvm/wasmclient/ts/wasmclient/package.json +++ b/packages/wasmvm/wasmclient/ts/wasmclient/package.json @@ -35,5 +35,6 @@ "typescript": "^4.8.4" }, "dependencies": { + "as-hex": "^1.0.1" } } From e66ce66c26a0cdd78e7ede065bd6db09b3225737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Mon, 6 Feb 2023 23:16:25 +0100 Subject: [PATCH 23/39] update client api --- clients/apiclient/.openapi-generator-ignore | 3 +- clients/apiclient/api/openapi.yaml | 4 +- clients/apiclient/api_auth.go | 2 +- clients/apiclient/api_chains.go | 2 +- clients/apiclient/api_corecontracts.go | 2 +- clients/apiclient/api_metrics.go | 2 +- clients/apiclient/api_node.go | 2 +- clients/apiclient/api_requests.go | 2 +- clients/apiclient/api_users.go | 2 +- clients/apiclient/client.go | 4 +- clients/apiclient/configuration.go | 2 +- .../apiclient/model_account_list_response.go | 2 +- .../apiclient/model_account_nfts_response.go | 2 +- .../apiclient/model_account_nonce_response.go | 2 +- clients/apiclient/model_add_user_request.go | 2 +- .../model_alias_output_metric_item.go | 2 +- clients/apiclient/model_assets.go | 2 +- clients/apiclient/model_assets_response.go | 2 +- clients/apiclient/model_auth_info_model.go | 2 +- clients/apiclient/model_base_token.go | 2 +- clients/apiclient/model_blob.go | 2 +- clients/apiclient/model_blob_info_response.go | 2 +- clients/apiclient/model_blob_list_response.go | 2 +- .../apiclient/model_blob_value_response.go | 2 +- .../apiclient/model_block_info_response.go | 2 +- .../apiclient/model_block_receipt_error.go | 2 +- .../model_block_receipts_response.go | 2 +- clients/apiclient/model_burn_log.go | 2 +- clients/apiclient/model_burn_record.go | 2 +- clients/apiclient/model_call_target.go | 2 +- .../apiclient/model_chain_info_response.go | 2 +- clients/apiclient/model_chain_metrics.go | 2 +- clients/apiclient/model_chain_record.go | 2 +- .../model_committee_info_response.go | 2 +- clients/apiclient/model_committee_node.go | 2 +- .../apiclient/model_consensus_pipe_metrics.go | 2 +- .../model_consensus_workflow_metrics.go | 2 +- .../model_contract_call_view_request.go | 2 +- .../apiclient/model_contract_info_response.go | 2 +- .../model_control_addresses_response.go | 2 +- clients/apiclient/model_dk_shares_info.go | 2 +- .../apiclient/model_dk_shares_post_request.go | 2 +- .../model_error_message_format_response.go | 2 +- clients/apiclient/model_events_response.go | 2 +- .../model_foundry_output_response.go | 2 +- clients/apiclient/model_gas_fee_policy.go | 2 +- .../model_gov_chain_info_response.go | 2 +- clients/apiclient/model_in_output.go | 2 +- .../apiclient/model_in_output_metric_item.go | 2 +- clients/apiclient/model_in_state_output.go | 2 +- .../model_in_state_output_metric_item.go | 2 +- clients/apiclient/model_info_response.go | 2 +- .../apiclient/model_interface_metric_item.go | 2 +- clients/apiclient/model_item.go | 2 +- clients/apiclient/model_json_dict.go | 2 +- clients/apiclient/model_l1_params.go | 2 +- clients/apiclient/model_login_request.go | 2 +- clients/apiclient/model_login_response.go | 2 +- clients/apiclient/model_milestone_info.go | 2 +- .../apiclient/model_milestone_metric_item.go | 2 +- clients/apiclient/model_native_token.go | 2 +- ...model_native_token_id_registry_response.go | 2 +- clients/apiclient/model_nft_data_response.go | 2 +- .../model_node_owner_certificate_request.go | 2 +- .../model_node_owner_certificate_response.go | 2 +- clients/apiclient/model_off_ledger_request.go | 2 +- clients/apiclient/model_on_ledger_request.go | 2 +- .../model_on_ledger_request_metric_item.go | 2 +- clients/apiclient/model_output.go | 2 +- clients/apiclient/model_output_id.go | 2 +- .../model_peering_node_identity_response.go | 2 +- .../model_peering_node_status_response.go | 2 +- .../apiclient/model_peering_trust_request.go | 2 +- .../apiclient/model_protocol_parameters.go | 2 +- .../model_publisher_state_transaction_item.go | 2 +- clients/apiclient/model_receipt_error.go | 2 +- clients/apiclient/model_receipt_response.go | 2 +- clients/apiclient/model_rent_structure.go | 2 +- clients/apiclient/model_request_detail.go | 2 +- .../apiclient/model_request_ids_response.go | 2 +- .../model_request_processed_response.go | 2 +- .../model_request_receipt_response.go | 2 +- clients/apiclient/model_state_response.go | 2 +- clients/apiclient/model_state_transaction.go | 2 +- clients/apiclient/model_transaction.go | 2 +- .../model_transaction_id_metric_item.go | 2 +- .../model_transaction_metric_item.go | 2 +- .../apiclient/model_tx_inclusion_state_msg.go | 2 +- ...odel_tx_inclusion_state_msg_metric_item.go | 2 +- .../model_update_user_password_request.go | 2 +- .../model_update_user_permissions_request.go | 2 +- clients/apiclient/model_user.go | 2 +- .../apiclient/model_utxo_input_metric_item.go | 2 +- clients/apiclient/model_validation_error.go | 2 +- clients/apiclient/model_version_response.go | 2 +- clients/apiclient/response.go | 2 +- clients/apiclient/test/api_admin_test.go | 321 -------------- clients/apiclient/test/api_auth_test.go | 49 --- clients/apiclient/test/api_chains_test.go | 181 -------- .../apiclient/test/api_corecontracts_test.go | 408 ------------------ clients/apiclient/test/api_metrics_test.go | 79 ---- clients/apiclient/test/api_node_test.go | 171 -------- clients/apiclient/test/api_public_test.go | 187 -------- clients/apiclient/test/api_requests_test.go | 79 ---- clients/apiclient/test/api_users_test.go | 105 ----- clients/apiclient/utils.go | 2 +- tools/api-gen/apigen.sh | 6 +- 107 files changed, 105 insertions(+), 1680 deletions(-) delete mode 100644 clients/apiclient/test/api_admin_test.go delete mode 100644 clients/apiclient/test/api_auth_test.go delete mode 100644 clients/apiclient/test/api_chains_test.go delete mode 100644 clients/apiclient/test/api_corecontracts_test.go delete mode 100644 clients/apiclient/test/api_metrics_test.go delete mode 100644 clients/apiclient/test/api_node_test.go delete mode 100644 clients/apiclient/test/api_public_test.go delete mode 100644 clients/apiclient/test/api_requests_test.go delete mode 100644 clients/apiclient/test/api_users_test.go diff --git a/clients/apiclient/.openapi-generator-ignore b/clients/apiclient/.openapi-generator-ignore index 3155096701..880b759c42 100644 --- a/clients/apiclient/.openapi-generator-ignore +++ b/clients/apiclient/.openapi-generator-ignore @@ -24,4 +24,5 @@ README.md generate_client.sh -go.mod \ No newline at end of file +go.mod +test \ No newline at end of file diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index a64a814090..c76b24d719 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2,7 +2,7 @@ openapi: 3.0.1 info: description: REST API for the Wasp node title: Wasp API - version: v0.4.0-alpha.8-60-g8b0f75e6d + version: "0" externalDocs: description: Find out more about Wasp url: https://wiki.iota.org/smart-contracts/overview @@ -1488,7 +1488,7 @@ paths: application/json: schema: additionalProperties: - example: info + example: "true" format: string type: string type: object diff --git a/clients/apiclient/api_auth.go b/clients/apiclient/api_auth.go index 79047ba43b..fbb50d3ec0 100644 --- a/clients/apiclient/api_auth.go +++ b/clients/apiclient/api_auth.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index b33c6dbb5a..79679ba70b 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index 590461ad9b..9c0563094f 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_metrics.go b/clients/apiclient/api_metrics.go index a7648beccf..073b3941e4 100644 --- a/clients/apiclient/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index 419a19bd94..cd0878fa0a 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index e0595e1ee4..b4b39ea3f5 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/api_users.go b/clients/apiclient/api_users.go index 8e76212aba..cc1581f186 100644 --- a/clients/apiclient/api_users.go +++ b/clients/apiclient/api_users.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/client.go b/clients/apiclient/client.go index 5ad5f85a4d..e716d4aaab 100644 --- a/clients/apiclient/client.go +++ b/clients/apiclient/client.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -42,7 +42,7 @@ var ( queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Wasp API API vv0.4.0-alpha.8-60-g8b0f75e6d +// APIClient manages communication with the Wasp API API v0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/clients/apiclient/configuration.go b/clients/apiclient/configuration.go index 17a4d18329..0498237422 100644 --- a/clients/apiclient/configuration.go +++ b/clients/apiclient/configuration.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_list_response.go b/clients/apiclient/model_account_list_response.go index 89f5cae8bf..bc4b90e400 100644 --- a/clients/apiclient/model_account_list_response.go +++ b/clients/apiclient/model_account_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nfts_response.go b/clients/apiclient/model_account_nfts_response.go index 2e62294668..909da3ada0 100644 --- a/clients/apiclient/model_account_nfts_response.go +++ b/clients/apiclient/model_account_nfts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_account_nonce_response.go b/clients/apiclient/model_account_nonce_response.go index 9b25e455a1..ba5595f732 100644 --- a/clients/apiclient/model_account_nonce_response.go +++ b/clients/apiclient/model_account_nonce_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_add_user_request.go b/clients/apiclient/model_add_user_request.go index 858182c202..74f19b40cc 100644 --- a/clients/apiclient/model_add_user_request.go +++ b/clients/apiclient/model_add_user_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_alias_output_metric_item.go b/clients/apiclient/model_alias_output_metric_item.go index 1c5ecf4146..34f6f32622 100644 --- a/clients/apiclient/model_alias_output_metric_item.go +++ b/clients/apiclient/model_alias_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets.go b/clients/apiclient/model_assets.go index c8b4136e57..f32e36b5dc 100644 --- a/clients/apiclient/model_assets.go +++ b/clients/apiclient/model_assets.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_assets_response.go b/clients/apiclient/model_assets_response.go index 079db2b8dc..65413bd8c2 100644 --- a/clients/apiclient/model_assets_response.go +++ b/clients/apiclient/model_assets_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_auth_info_model.go b/clients/apiclient/model_auth_info_model.go index c90608528a..37d4d0e653 100644 --- a/clients/apiclient/model_auth_info_model.go +++ b/clients/apiclient/model_auth_info_model.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_base_token.go b/clients/apiclient/model_base_token.go index eea7a76148..96f06aef92 100644 --- a/clients/apiclient/model_base_token.go +++ b/clients/apiclient/model_base_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index a82cdca887..33ce852a44 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go index 946fe486f0..0b38633055 100644 --- a/clients/apiclient/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_list_response.go b/clients/apiclient/model_blob_list_response.go index 4172c9e82e..c747d4098e 100644 --- a/clients/apiclient/model_blob_list_response.go +++ b/clients/apiclient/model_blob_list_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go index 9245f7213e..a2a397ff67 100644 --- a/clients/apiclient/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_info_response.go b/clients/apiclient/model_block_info_response.go index 8d217100c1..6a76a731f8 100644 --- a/clients/apiclient/model_block_info_response.go +++ b/clients/apiclient/model_block_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipt_error.go b/clients/apiclient/model_block_receipt_error.go index b32a933075..aa3a3e3d7d 100644 --- a/clients/apiclient/model_block_receipt_error.go +++ b/clients/apiclient/model_block_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_block_receipts_response.go b/clients/apiclient/model_block_receipts_response.go index bc8965a637..771b070172 100644 --- a/clients/apiclient/model_block_receipts_response.go +++ b/clients/apiclient/model_block_receipts_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_log.go b/clients/apiclient/model_burn_log.go index 487332605f..5f8843722f 100644 --- a/clients/apiclient/model_burn_log.go +++ b/clients/apiclient/model_burn_log.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_burn_record.go b/clients/apiclient/model_burn_record.go index 9075f8f5ee..65afb4ef93 100644 --- a/clients/apiclient/model_burn_record.go +++ b/clients/apiclient/model_burn_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index 43afa45660..cdcd063792 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_info_response.go b/clients/apiclient/model_chain_info_response.go index af9d72ba91..fad1ecbef0 100644 --- a/clients/apiclient/model_chain_info_response.go +++ b/clients/apiclient/model_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_metrics.go b/clients/apiclient/model_chain_metrics.go index b34f7f67b7..2645ef64c9 100644 --- a/clients/apiclient/model_chain_metrics.go +++ b/clients/apiclient/model_chain_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_chain_record.go b/clients/apiclient/model_chain_record.go index 1827ae5ac6..b8ab5fabc8 100644 --- a/clients/apiclient/model_chain_record.go +++ b/clients/apiclient/model_chain_record.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_info_response.go b/clients/apiclient/model_committee_info_response.go index c2964f1cee..0737021042 100644 --- a/clients/apiclient/model_committee_info_response.go +++ b/clients/apiclient/model_committee_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_committee_node.go b/clients/apiclient/model_committee_node.go index 02a4fb9127..d8b9942ce6 100644 --- a/clients/apiclient/model_committee_node.go +++ b/clients/apiclient/model_committee_node.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_pipe_metrics.go b/clients/apiclient/model_consensus_pipe_metrics.go index b8b3c21c89..5f73c2a7c5 100644 --- a/clients/apiclient/model_consensus_pipe_metrics.go +++ b/clients/apiclient/model_consensus_pipe_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_consensus_workflow_metrics.go b/clients/apiclient/model_consensus_workflow_metrics.go index a39796295e..67713008b8 100644 --- a/clients/apiclient/model_consensus_workflow_metrics.go +++ b/clients/apiclient/model_consensus_workflow_metrics.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_call_view_request.go b/clients/apiclient/model_contract_call_view_request.go index 2615e4c066..a364551e9e 100644 --- a/clients/apiclient/model_contract_call_view_request.go +++ b/clients/apiclient/model_contract_call_view_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_contract_info_response.go b/clients/apiclient/model_contract_info_response.go index 5a2e8be6b8..27ed53b743 100644 --- a/clients/apiclient/model_contract_info_response.go +++ b/clients/apiclient/model_contract_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go index ea990b9dad..41916f492a 100644 --- a/clients/apiclient/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_info.go b/clients/apiclient/model_dk_shares_info.go index 3c02ac8833..f93e55efe7 100644 --- a/clients/apiclient/model_dk_shares_info.go +++ b/clients/apiclient/model_dk_shares_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_dk_shares_post_request.go b/clients/apiclient/model_dk_shares_post_request.go index 1355862e10..cdc00779d9 100644 --- a/clients/apiclient/model_dk_shares_post_request.go +++ b/clients/apiclient/model_dk_shares_post_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_error_message_format_response.go b/clients/apiclient/model_error_message_format_response.go index 198ff58281..6361860fce 100644 --- a/clients/apiclient/model_error_message_format_response.go +++ b/clients/apiclient/model_error_message_format_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_events_response.go b/clients/apiclient/model_events_response.go index 061a85df41..9869a9c733 100644 --- a/clients/apiclient/model_events_response.go +++ b/clients/apiclient/model_events_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_foundry_output_response.go b/clients/apiclient/model_foundry_output_response.go index 8b9dab5a54..e95de04045 100644 --- a/clients/apiclient/model_foundry_output_response.go +++ b/clients/apiclient/model_foundry_output_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index ba04559058..48e32fedef 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_gov_chain_info_response.go b/clients/apiclient/model_gov_chain_info_response.go index 4e85c45cc9..5048003f09 100644 --- a/clients/apiclient/model_gov_chain_info_response.go +++ b/clients/apiclient/model_gov_chain_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output.go b/clients/apiclient/model_in_output.go index b3de7acb19..ed1f305cb3 100644 --- a/clients/apiclient/model_in_output.go +++ b/clients/apiclient/model_in_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_output_metric_item.go b/clients/apiclient/model_in_output_metric_item.go index cf301ef547..beb526e774 100644 --- a/clients/apiclient/model_in_output_metric_item.go +++ b/clients/apiclient/model_in_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output.go b/clients/apiclient/model_in_state_output.go index 3e21334747..96a04a6e90 100644 --- a/clients/apiclient/model_in_state_output.go +++ b/clients/apiclient/model_in_state_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_in_state_output_metric_item.go b/clients/apiclient/model_in_state_output_metric_item.go index c3571a95fa..3b4fbd71b6 100644 --- a/clients/apiclient/model_in_state_output_metric_item.go +++ b/clients/apiclient/model_in_state_output_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_info_response.go b/clients/apiclient/model_info_response.go index f6f21f625c..3681141679 100644 --- a/clients/apiclient/model_info_response.go +++ b/clients/apiclient/model_info_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_interface_metric_item.go b/clients/apiclient/model_interface_metric_item.go index 1a90127889..96cec1e0cb 100644 --- a/clients/apiclient/model_interface_metric_item.go +++ b/clients/apiclient/model_interface_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_item.go b/clients/apiclient/model_item.go index 67d19182dc..811b3e675f 100644 --- a/clients/apiclient/model_item.go +++ b/clients/apiclient/model_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_json_dict.go b/clients/apiclient/model_json_dict.go index 740515edaa..001c262dc9 100644 --- a/clients/apiclient/model_json_dict.go +++ b/clients/apiclient/model_json_dict.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_l1_params.go b/clients/apiclient/model_l1_params.go index 10e8e546e8..0804298c85 100644 --- a/clients/apiclient/model_l1_params.go +++ b/clients/apiclient/model_l1_params.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_request.go b/clients/apiclient/model_login_request.go index becb41c57a..558ab2f3c0 100644 --- a/clients/apiclient/model_login_request.go +++ b/clients/apiclient/model_login_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_login_response.go b/clients/apiclient/model_login_response.go index ba381dd941..d9f776d6a6 100644 --- a/clients/apiclient/model_login_response.go +++ b/clients/apiclient/model_login_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go index 86d616d4a8..b6fdba2306 100644 --- a/clients/apiclient/model_milestone_info.go +++ b/clients/apiclient/model_milestone_info.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_milestone_metric_item.go b/clients/apiclient/model_milestone_metric_item.go index fe220ec11d..3545b54274 100644 --- a/clients/apiclient/model_milestone_metric_item.go +++ b/clients/apiclient/model_milestone_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token.go b/clients/apiclient/model_native_token.go index 82f785f610..ce7292cd78 100644 --- a/clients/apiclient/model_native_token.go +++ b/clients/apiclient/model_native_token.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_native_token_id_registry_response.go b/clients/apiclient/model_native_token_id_registry_response.go index a4bcad4de0..310abdc330 100644 --- a/clients/apiclient/model_native_token_id_registry_response.go +++ b/clients/apiclient/model_native_token_id_registry_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_nft_data_response.go b/clients/apiclient/model_nft_data_response.go index 9d0569c3f5..aed23a2ca3 100644 --- a/clients/apiclient/model_nft_data_response.go +++ b/clients/apiclient/model_nft_data_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_request.go b/clients/apiclient/model_node_owner_certificate_request.go index 9e20c3c244..9c06ab95a0 100644 --- a/clients/apiclient/model_node_owner_certificate_request.go +++ b/clients/apiclient/model_node_owner_certificate_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_node_owner_certificate_response.go b/clients/apiclient/model_node_owner_certificate_response.go index 1ca36390f9..58cf929b4b 100644 --- a/clients/apiclient/model_node_owner_certificate_response.go +++ b/clients/apiclient/model_node_owner_certificate_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_off_ledger_request.go b/clients/apiclient/model_off_ledger_request.go index f5316f3d6a..43ae11d35a 100644 --- a/clients/apiclient/model_off_ledger_request.go +++ b/clients/apiclient/model_off_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request.go b/clients/apiclient/model_on_ledger_request.go index cacbeab4b9..27bcfd5cbe 100644 --- a/clients/apiclient/model_on_ledger_request.go +++ b/clients/apiclient/model_on_ledger_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_on_ledger_request_metric_item.go b/clients/apiclient/model_on_ledger_request_metric_item.go index b9a1a73a86..195838f75a 100644 --- a/clients/apiclient/model_on_ledger_request_metric_item.go +++ b/clients/apiclient/model_on_ledger_request_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output.go b/clients/apiclient/model_output.go index d84b29961b..3106771bbb 100644 --- a/clients/apiclient/model_output.go +++ b/clients/apiclient/model_output.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_output_id.go b/clients/apiclient/model_output_id.go index 9dab5aeb4b..e28f964889 100644 --- a/clients/apiclient/model_output_id.go +++ b/clients/apiclient/model_output_id.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_identity_response.go b/clients/apiclient/model_peering_node_identity_response.go index 8ab3913f6d..18c0a5dabd 100644 --- a/clients/apiclient/model_peering_node_identity_response.go +++ b/clients/apiclient/model_peering_node_identity_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_node_status_response.go b/clients/apiclient/model_peering_node_status_response.go index c6dfaeda2d..60026daa3d 100644 --- a/clients/apiclient/model_peering_node_status_response.go +++ b/clients/apiclient/model_peering_node_status_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_peering_trust_request.go b/clients/apiclient/model_peering_trust_request.go index 663ea66704..6857446fd7 100644 --- a/clients/apiclient/model_peering_trust_request.go +++ b/clients/apiclient/model_peering_trust_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_protocol_parameters.go b/clients/apiclient/model_protocol_parameters.go index 90bc1ebd5d..f4334ef408 100644 --- a/clients/apiclient/model_protocol_parameters.go +++ b/clients/apiclient/model_protocol_parameters.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_publisher_state_transaction_item.go b/clients/apiclient/model_publisher_state_transaction_item.go index 69d364d3b7..9c0b00e281 100644 --- a/clients/apiclient/model_publisher_state_transaction_item.go +++ b/clients/apiclient/model_publisher_state_transaction_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index b4c73c3c85..f2631506d2 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_receipt_response.go b/clients/apiclient/model_receipt_response.go index 6805b170db..6baeeae5ce 100644 --- a/clients/apiclient/model_receipt_response.go +++ b/clients/apiclient/model_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_rent_structure.go b/clients/apiclient/model_rent_structure.go index 233a1ff873..733386365d 100644 --- a/clients/apiclient/model_rent_structure.go +++ b/clients/apiclient/model_rent_structure.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_detail.go b/clients/apiclient/model_request_detail.go index 061f15d9d6..b1792f1756 100644 --- a/clients/apiclient/model_request_detail.go +++ b/clients/apiclient/model_request_detail.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_ids_response.go b/clients/apiclient/model_request_ids_response.go index 805f94071e..2ab4aea7c1 100644 --- a/clients/apiclient/model_request_ids_response.go +++ b/clients/apiclient/model_request_ids_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_processed_response.go b/clients/apiclient/model_request_processed_response.go index 1c9ca0ae8f..c02e6ee64b 100644 --- a/clients/apiclient/model_request_processed_response.go +++ b/clients/apiclient/model_request_processed_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_request_receipt_response.go b/clients/apiclient/model_request_receipt_response.go index 0495df3ae9..202b5a257a 100644 --- a/clients/apiclient/model_request_receipt_response.go +++ b/clients/apiclient/model_request_receipt_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_response.go b/clients/apiclient/model_state_response.go index 9fc579743c..cc6f783b83 100644 --- a/clients/apiclient/model_state_response.go +++ b/clients/apiclient/model_state_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_state_transaction.go b/clients/apiclient/model_state_transaction.go index 38a35ddde3..f183cc2840 100644 --- a/clients/apiclient/model_state_transaction.go +++ b/clients/apiclient/model_state_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction.go b/clients/apiclient/model_transaction.go index 171c0c01dd..336887f07b 100644 --- a/clients/apiclient/model_transaction.go +++ b/clients/apiclient/model_transaction.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_id_metric_item.go b/clients/apiclient/model_transaction_id_metric_item.go index a8c9ae7b8a..8385fa3ed6 100644 --- a/clients/apiclient/model_transaction_id_metric_item.go +++ b/clients/apiclient/model_transaction_id_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_transaction_metric_item.go b/clients/apiclient/model_transaction_metric_item.go index 73026fbcc9..5db3bb546e 100644 --- a/clients/apiclient/model_transaction_metric_item.go +++ b/clients/apiclient/model_transaction_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg.go b/clients/apiclient/model_tx_inclusion_state_msg.go index ba4e3eed65..5b4d029c11 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg.go +++ b/clients/apiclient/model_tx_inclusion_state_msg.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go index bb95ce206e..e1a3dda6e8 100644 --- a/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go +++ b/clients/apiclient/model_tx_inclusion_state_msg_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_password_request.go b/clients/apiclient/model_update_user_password_request.go index f8d0866e47..d778378a9b 100644 --- a/clients/apiclient/model_update_user_password_request.go +++ b/clients/apiclient/model_update_user_password_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_update_user_permissions_request.go b/clients/apiclient/model_update_user_permissions_request.go index 7e6ead6512..e349ec4635 100644 --- a/clients/apiclient/model_update_user_permissions_request.go +++ b/clients/apiclient/model_update_user_permissions_request.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_user.go b/clients/apiclient/model_user.go index 7cc6c368a0..c82e3cd5e1 100644 --- a/clients/apiclient/model_user.go +++ b/clients/apiclient/model_user.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_utxo_input_metric_item.go b/clients/apiclient/model_utxo_input_metric_item.go index cc9f7339f1..abf603200b 100644 --- a/clients/apiclient/model_utxo_input_metric_item.go +++ b/clients/apiclient/model_utxo_input_metric_item.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_validation_error.go b/clients/apiclient/model_validation_error.go index 8bb3e5d5bb..63ecdf16ad 100644 --- a/clients/apiclient/model_validation_error.go +++ b/clients/apiclient/model_validation_error.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/model_version_response.go b/clients/apiclient/model_version_response.go index 2e631d1d52..804d6e82e6 100644 --- a/clients/apiclient/model_version_response.go +++ b/clients/apiclient/model_version_response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/response.go b/clients/apiclient/response.go index a1cfa4cb83..a12348cba2 100644 --- a/clients/apiclient/response.go +++ b/clients/apiclient/response.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/clients/apiclient/test/api_admin_test.go b/clients/apiclient/test/api_admin_test.go deleted file mode 100644 index 5c992b96ac..0000000000 --- a/clients/apiclient/test/api_admin_test.go +++ /dev/null @@ -1,321 +0,0 @@ -/* -Wasp API - -Testing AdminApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apiclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" -) - -func Test_apiclient_AdminApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test AdminApiService AdmChainChainIDAccessNodePubKeyDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var pubKey string - - httpRes, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyDelete(context.Background(), chainID, pubKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDAccessNodePubKeyPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var pubKey string - - httpRes, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyPut(context.Background(), chainID, pubKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDActivatePost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - httpRes, err := apiClient.AdminApi.AdmChainChainIDActivatePost(context.Background(), chainID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDConsensusMetricsPipeGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.AdminApi.AdmChainChainIDConsensusMetricsPipeGet(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDConsensusStatusGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.AdminApi.AdmChainChainIDConsensusStatusGet(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDDeactivatePost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - httpRes, err := apiClient.AdminApi.AdmChainChainIDDeactivatePost(context.Background(), chainID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDInfoGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - httpRes, err := apiClient.AdminApi.AdmChainChainIDInfoGet(context.Background(), chainID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainChainIDNodeconnMetricsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.AdminApi.AdmChainChainIDNodeconnMetricsGet(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainNodeconnMetricsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmChainNodeconnMetricsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainrecordChainIDGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.AdminApi.AdmChainrecordChainIDGet(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainrecordPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - httpRes, err := apiClient.AdminApi.AdmChainrecordPost(context.Background()).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmChainrecordsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmChainrecordsGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmDksPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmDksPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmDksSharedAddressGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var sharedAddress string - - resp, httpRes, err := apiClient.AdminApi.AdmDksSharedAddressGet(context.Background(), sharedAddress).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmNodeOwnerCertificatePost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmNodeOwnerCertificatePost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringEstablishedGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmPeeringEstablishedGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringSelfGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmPeeringSelfGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringTrustedGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringTrustedPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPost(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringTrustedPubKeyDelete", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var pubKey string - - httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyDelete(context.Background(), pubKey).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringTrustedPubKeyGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var pubKey string - - resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyGet(context.Background(), pubKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmPeeringTrustedPubKeyPut", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var pubKey string - - resp, httpRes, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyPut(context.Background(), pubKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AdminApiService AdmShutdownGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - httpRes, err := apiClient.AdminApi.AdmShutdownGet(context.Background()).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_auth_test.go b/clients/apiclient/test/api_auth_test.go deleted file mode 100644 index da91d87620..0000000000 --- a/clients/apiclient/test/api_auth_test.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Wasp API - -Testing AuthApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apiclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" -) - -func Test_apiclient_AuthApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test AuthApiService AuthInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AuthApi.AuthInfo(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test AuthApiService Authenticate", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.AuthApi.Authenticate(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_chains_test.go b/clients/apiclient/test/api_chains_test.go deleted file mode 100644 index d697cbedb6..0000000000 --- a/clients/apiclient/test/api_chains_test.go +++ /dev/null @@ -1,181 +0,0 @@ -/* -Wasp API - -Testing ChainsApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package openapi - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "./openapi" -) - -func Test_openapi_ChainsApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test ChainsApiService ActivateChain", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.ChainsApi.ActivateChain(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService AddAccessNode", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var publicKey string - - resp, httpRes, err := apiClient.ChainsApi.AddAccessNode(context.Background(), chainID, publicKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService AttachToWebsocket", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.ChainsApi.AttachToWebsocket(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService DeactivateChain", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.ChainsApi.DeactivateChain(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService GetChainInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.ChainsApi.GetChainInfo(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService GetChains", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.ChainsApi.GetChains(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService GetCommitteeInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.ChainsApi.GetCommitteeInfo(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService GetContracts", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.ChainsApi.GetContracts(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService GetRequestIDFromEVMTransactionID", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var txHash string - - resp, httpRes, err := apiClient.ChainsApi.GetRequestIDFromEVMTransactionID(context.Background(), chainID, txHash).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService GetStateValue", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var stateKey string - - resp, httpRes, err := apiClient.ChainsApi.GetStateValue(context.Background(), chainID, stateKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test ChainsApiService RemoveAccessNode", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var publicKey string - - resp, httpRes, err := apiClient.ChainsApi.RemoveAccessNode(context.Background(), chainID, publicKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_corecontracts_test.go b/clients/apiclient/test/api_corecontracts_test.go deleted file mode 100644 index b786355779..0000000000 --- a/clients/apiclient/test/api_corecontracts_test.go +++ /dev/null @@ -1,408 +0,0 @@ -/* -Wasp API - -Testing CorecontractsApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package openapi - -import ( - "context" - "testing" - - openapiclient "./openapi" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func Test_openapi_CorecontractsApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test CorecontractsApiService AccountsGetAccountBalance", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var agentID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountBalance(context.Background(), chainID, agentID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetAccountNFTIDs", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var agentID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNFTIDs(context.Background(), chainID, agentID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetAccountNonce", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var agentID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccountNonce(context.Background(), chainID, agentID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetAccounts", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetAccounts(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetFoundryOutput", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var chainID2 string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetFoundryOutput(context.Background(), chainID, chainID2).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetNFTData", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var nftID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNFTData(context.Background(), chainID, nftID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetNativeTokenIDRegistry", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetNativeTokenIDRegistry(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService AccountsGetTotalAssets", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.AccountsGetTotalAssets(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlobsGetAllBlobs", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetAllBlobs(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlobsGetBlobInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var blobHash string - - resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobInfo(context.Background(), chainID, blobHash).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlobsGetBlobValue", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var blobHash string - var fieldKey string - - resp, httpRes, err := apiClient.CorecontractsApi.BlobsGetBlobValue(context.Background(), chainID, blobHash, fieldKey).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetBlockInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var blockIndex uint32 - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetBlockInfo(context.Background(), chainID, blockIndex).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetControlAddresses", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetControlAddresses(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetEventsOfBlock", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var blockIndex uint32 - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfBlock(context.Background(), chainID, blockIndex).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetEventsOfContract", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var contractHname string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfContract(context.Background(), chainID, contractHname).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetEventsOfLatestBlock", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetEventsOfRequest", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var requestID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetEventsOfRequest(context.Background(), chainID, requestID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetLatestBlockInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForBlock", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var blockIndex uint32 - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForBlock(context.Background(), chainID, blockIndex).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetRequestIDsForLatestBlock", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIDsForLatestBlock(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetRequestIsProcessed", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var requestID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestIsProcessed(context.Background(), chainID, requestID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetRequestReceipt", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var requestID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceipt(context.Background(), chainID, requestID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfBlock", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var blockIndex uint32 - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), chainID, blockIndex).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService BlocklogGetRequestReceiptsOfLatestBlock", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService ErrorsGetErrorMessageFormat", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var contractHname string - var errorID string - - resp, httpRes, err := apiClient.CorecontractsApi.ErrorsGetErrorMessageFormat(context.Background(), chainID, contractHname, errorID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test CorecontractsApiService GovernanceGetChainInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.CorecontractsApi.GovernanceGetChainInfo(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_metrics_test.go b/clients/apiclient/test/api_metrics_test.go deleted file mode 100644 index 1c5cf72d9e..0000000000 --- a/clients/apiclient/test/api_metrics_test.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Wasp API - -Testing MetricsApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package openapi - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "./openapi" -) - -func Test_openapi_MetricsApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test MetricsApiService GetChainMetrics", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.MetricsApi.GetChainMetrics(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test MetricsApiService GetChainPipeMetrics", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.MetricsApi.GetChainPipeMetrics(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test MetricsApiService GetChainWorkflowMetrics", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - resp, httpRes, err := apiClient.MetricsApi.GetChainWorkflowMetrics(context.Background(), chainID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test MetricsApiService GetL1Metrics", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.MetricsApi.GetL1Metrics(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_node_test.go b/clients/apiclient/test/api_node_test.go deleted file mode 100644 index c8c63278f4..0000000000 --- a/clients/apiclient/test/api_node_test.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -Wasp API - -Testing NodeApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package openapi - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "./openapi" -) - -func Test_openapi_NodeApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test NodeApiService DistrustPeer", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.DistrustPeer(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GenerateDKS", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GenerateDKS(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetAllPeers", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GetAllPeers(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetConfiguration", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GetConfiguration(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetDKSInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var sharedAddress string - - resp, httpRes, err := apiClient.NodeApi.GetDKSInfo(context.Background(), sharedAddress).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetInfo", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GetInfo(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetPeeringIdentity", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetTrustedPeers", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GetTrustedPeers(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService GetVersion", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.GetVersion(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService SetNodeOwner", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.SetNodeOwner(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService ShutdownNode", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.ShutdownNode(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test NodeApiService TrustPeer", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.NodeApi.TrustPeer(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_public_test.go b/clients/apiclient/test/api_public_test.go deleted file mode 100644 index 318a4673e5..0000000000 --- a/clients/apiclient/test/api_public_test.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Wasp API - -Testing PublicApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package apiclient - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" -) - -func Test_apiclient_PublicApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewFnameGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var contractHname string - var fname string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnameGet(context.Background(), chainID, contractHname, fname).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewFnamePost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var contractHname string - var fname string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnamePost(context.Background(), chainID, contractHname, fname).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var contractHname string - var functionHname string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(context.Background(), chainID, contractHname, functionHname).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var contractHname string - var functionHname string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(context.Background(), chainID, contractHname, functionHname).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDEvmReqidTxHashGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var txHash string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDEvmReqidTxHashGet(context.Background(), chainID, txHash).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDRequestPost", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - httpRes, err := apiClient.PublicApi.ChainChainIDRequestPost(context.Background(), chainID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDRequestReqIDReceiptGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var reqID string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDRequestReqIDReceiptGet(context.Background(), chainID, reqID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDRequestReqIDWaitGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var reqID string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDRequestReqIDWaitGet(context.Background(), chainID, reqID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDStateKeyGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var key string - - resp, httpRes, err := apiClient.PublicApi.ChainChainIDStateKeyGet(context.Background(), chainID, key).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService ChainChainIDWsGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - - httpRes, err := apiClient.PublicApi.ChainChainIDWsGet(context.Background(), chainID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PublicApiService InfoGet", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.PublicApi.InfoGet(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_requests_test.go b/clients/apiclient/test/api_requests_test.go deleted file mode 100644 index babcd723f3..0000000000 --- a/clients/apiclient/test/api_requests_test.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Wasp API - -Testing RequestsApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package openapi - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "./openapi" -) - -func Test_openapi_RequestsApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test RequestsApiService CallView", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.RequestsApi.CallView(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test RequestsApiService GetReceipt", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var requestID string - - resp, httpRes, err := apiClient.RequestsApi.GetReceipt(context.Background(), chainID, requestID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test RequestsApiService OffLedger", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.RequestsApi.OffLedger(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test RequestsApiService WaitForTransaction", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var chainID string - var requestID string - - resp, httpRes, err := apiClient.RequestsApi.WaitForTransaction(context.Background(), chainID, requestID).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/test/api_users_test.go b/clients/apiclient/test/api_users_test.go deleted file mode 100644 index f6d31e327f..0000000000 --- a/clients/apiclient/test/api_users_test.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -Wasp API - -Testing UsersApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package openapi - -import ( - "context" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "testing" - openapiclient "./openapi" -) - -func Test_openapi_UsersApiService(t *testing.T) { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - - t.Run("Test UsersApiService AddUser", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.UsersApi.AddUser(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersApiService ChangeUserPassword", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var username string - - resp, httpRes, err := apiClient.UsersApi.ChangeUserPassword(context.Background(), username).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersApiService ChangeUserPermissions", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var username string - - resp, httpRes, err := apiClient.UsersApi.ChangeUserPermissions(context.Background(), username).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersApiService DeleteUser", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var username string - - resp, httpRes, err := apiClient.UsersApi.DeleteUser(context.Background(), username).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersApiService GetUser", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var username string - - resp, httpRes, err := apiClient.UsersApi.GetUser(context.Background(), username).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test UsersApiService GetUsers", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.UsersApi.GetUsers(context.Background()).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - -} diff --git a/clients/apiclient/utils.go b/clients/apiclient/utils.go index e6028e6e45..6f6f128824 100644 --- a/clients/apiclient/utils.go +++ b/clients/apiclient/utils.go @@ -3,7 +3,7 @@ Wasp API REST API for the Wasp node -API version: v0.4.0-alpha.8-60-g8b0f75e6d +API version: 0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/tools/api-gen/apigen.sh b/tools/api-gen/apigen.sh index e47cd73ab5..e8779bdfe7 100644 --- a/tools/api-gen/apigen.sh +++ b/tools/api-gen/apigen.sh @@ -3,4 +3,8 @@ GIT_REF_TAG=$(git describe --tags) BUILD_LD_FLAGS="-X=github.com/iotaledger/wasp/core/app.Version=$GIT_REF_TAG" -go run -ldflags="$BUILD_LD_FLAGS" ./main.go "$@" \ No newline at end of file +# To generate with the current commit version: +# go run -ldflags="$BUILD_LD_FLAGS" ./main.go "$@" + +# During development the version is unset, therefore 0 to not commit a new api client each time. +go run ./main.go "$@" \ No newline at end of file From 9bee36b107fdef67cbc491c465559c99af59b90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Tue, 7 Feb 2023 00:17:20 +0100 Subject: [PATCH 24/39] Update tests --- clients/apiutils.go | 15 +++ clients/chainclient/callview.go | 10 +- clients/scclient/callview.go | 11 +++ .../go/wasmclient/wasmclientservice.go | 44 +++++++-- .../ts/wasmclient/test/wasmclient_test.go | 2 +- .../webapi/controllers/chain/controller.go | 12 ++- tools/cluster/tests/access_nodes_test.go | 13 ++- tools/cluster/tests/account_test.go | 5 +- tools/cluster/tests/evm_jsonrpc_test.go | 27 +++--- tools/cluster/tests/util.go | 95 +++++++++++++------ 10 files changed, 166 insertions(+), 68 deletions(-) create mode 100644 clients/scclient/callview.go diff --git a/clients/apiutils.go b/clients/apiutils.go index e791b2168e..2d74dc2a29 100644 --- a/clients/apiutils.go +++ b/clients/apiutils.go @@ -77,3 +77,18 @@ func WaspAPIClientByHostName(hostname string) (*apiclient.APIClient, error) { return apiclient.NewAPIClient(config), nil } + +func CallView(context context.Context, client *apiclient.APIClient, request apiclient.ContractCallViewRequest) (dict.Dict, error) { + result, _, err := client.RequestsApi. + CallView(context). + ContractCallViewRequest(request). + Execute() + + if err != nil { + return nil, err + } + + dictResult, err := dict.FromJSONDict(APIJsonDictToJSONDict(*result)) + + return dictResult, err +} diff --git a/clients/chainclient/callview.go b/clients/chainclient/callview.go index 46dbceb16a..4afdbb5000 100644 --- a/clients/chainclient/callview.go +++ b/clients/chainclient/callview.go @@ -11,7 +11,6 @@ import ( // CallView sends a request to call a view function of a given contract, and returns the result of the call func (c *Client) CallView(ctx context.Context, hContract isc.Hname, functionName string, args dict.Dict) (dict.Dict, error) { - request := apiclient.ContractCallViewRequest{ ChainId: c.ChainID.String(), ContractHName: hContract.String(), @@ -19,12 +18,5 @@ func (c *Client) CallView(ctx context.Context, hContract isc.Hname, functionName Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), } - result, _, err := c.WaspClient.RequestsApi. - CallView(ctx). - ContractCallViewRequest(request). - Execute() - - dictResult, err := dict.FromJSONDict(clients.APIJsonDictToJSONDict(*result)) - - return dictResult, err + return clients.CallView(ctx, c.WaspClient, request) } diff --git a/clients/scclient/callview.go b/clients/scclient/callview.go new file mode 100644 index 0000000000..ee64343753 --- /dev/null +++ b/clients/scclient/callview.go @@ -0,0 +1,11 @@ +package scclient + +import ( + "context" + + "github.com/iotaledger/wasp/packages/kv/dict" +) + +func (c *SCClient) CallView(context context.Context, functionName string, args dict.Dict) (dict.Dict, error) { + return c.ChainClient.CallView(context, c.ContractHname, functionName, args) +} diff --git a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go index a370afbbf1..bf0416bb25 100644 --- a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go +++ b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go @@ -4,8 +4,12 @@ package wasmclient import ( + "context" "time" + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" @@ -22,15 +26,19 @@ type IClientService interface { } type WasmClientService struct { - cvt wasmhost.WasmConvertor - waspClient *clients.WaspClient + waspClient *apiclient.APIClient eventPort string } var _ IClientService = new(WasmClientService) func NewWasmClientService(waspAPI, eventPort string) *WasmClientService { - return &WasmClientService{waspClient: clients.NewWaspClient(waspAPI), eventPort: eventPort} + client, err := clients.WaspAPIClientByHostName(waspAPI) + if err != nil { + panic(err.Error()) + } + + return &WasmClientService{waspClient: client, eventPort: eventPort} } func DefaultWasmClientService() *WasmClientService { @@ -45,11 +53,23 @@ func (sc *WasmClientService) CallViewByHname(chainID wasmtypes.ScChainID, hContr if err != nil { return nil, err } - res, err := sc.waspClient.CallViewByHname(iscChainID, iscContract, iscFunction, params) + res, _, err := sc.waspClient.RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + ContractHName: iscContract.String(), + FunctionHName: iscFunction.String(), + ChainId: iscChainID.String(), + Arguments: clients.JSONDictToAPIJSONDict(params.JSONDict()), + }).Execute() + if err != nil { return nil, err } - return res.Bytes(), nil + + decodedParams, err := clients.APIJsonDictToDict(*res) + if err != nil { + return nil, err + } + + return decodedParams.Bytes(), nil } func (sc *WasmClientService) PostRequest(chainID wasmtypes.ScChainID, hContract, hFunction wasmtypes.ScHname, args []byte, allowance *wasmlib.ScAssets, keyPair *cryptolib.KeyPair, nonce uint64) (reqID wasmtypes.ScRequestID, err error) { @@ -65,7 +85,12 @@ func (sc *WasmClientService) PostRequest(chainID wasmtypes.ScChainID, hContract, req.WithAllowance(iscAllowance) signed := req.Sign(keyPair) reqID = cvt.ScRequestID(signed.ID()) - err = sc.waspClient.PostOffLedgerRequest(iscChainID, signed) + + _, err = sc.waspClient.RequestsApi.OffLedger(context.Background()).OffLedgerRequest(apiclient.OffLedgerRequest{ + ChainId: iscChainID.String(), + Request: iotago.EncodeHex(signed.Bytes()), + }).Execute() + return reqID, err } @@ -76,6 +101,11 @@ func (sc *WasmClientService) SubscribeEvents(msg chan []string, done chan bool) func (sc *WasmClientService) WaitUntilRequestProcessed(chainID wasmtypes.ScChainID, reqID wasmtypes.ScRequestID, timeout time.Duration) error { iscChainID := cvt.IscChainID(&chainID) iscReqID := cvt.IscRequestID(&reqID) - _, err := sc.waspClient.WaitUntilRequestProcessed(iscChainID, iscReqID, timeout) + + _, _, err := sc.waspClient.RequestsApi. + WaitForRequest(context.Background(), iscChainID.String(), iscReqID.String()). + TimeoutSeconds(int32(timeout.Seconds())). + Execute() + return err } diff --git a/packages/wasmvm/wasmclient/ts/wasmclient/test/wasmclient_test.go b/packages/wasmvm/wasmclient/ts/wasmclient/test/wasmclient_test.go index e4fb7f0b4e..9208b359b5 100644 --- a/packages/wasmvm/wasmclient/ts/wasmclient/test/wasmclient_test.go +++ b/packages/wasmvm/wasmclient/ts/wasmclient/test/wasmclient_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/tools/cluster/templates" clustertests "github.com/iotaledger/wasp/tools/cluster/tests" diff --git a/packages/webapi/controllers/chain/controller.go b/packages/webapi/controllers/chain/controller.go index 869347048e..b771da4b91 100644 --- a/packages/webapi/controllers/chain/controller.go +++ b/packages/webapi/controllers/chain/controller.go @@ -46,7 +46,17 @@ func (c *Controller) Name() string { } func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker interfaces.Mocker) { - publicAPI.EchoGroup().Any("chains/:chainID/evm", c.handleJSONRPC) + // Echoswagger does not support ANY, so create a fake route, and overwrite it with Echo ANY afterwords. + evmURL := "chains/:chainID/evm" + publicAPI. + GET(evmURL, c.handleJSONRPC). + AddParamPath("", "chainID", "ChainID (Bech32)"). + AddResponse(http.StatusOK, "", "", nil). + AddResponse(http.StatusNotFound, "", "", nil) + + publicAPI. + EchoGroup().Any("chains/:chainID/evm", c.handleJSONRPC) + publicAPI.GET("chains/:chainID/evm/tx/:txHash", c.getRequestID). SetSummary("Get the ISC request ID for the given Ethereum transaction hash"). SetOperationId("getRequestIDFromEVMTransactionID"). diff --git a/tools/cluster/tests/access_nodes_test.go b/tools/cluster/tests/access_nodes_test.go index ee570d2cc7..bb9933e123 100644 --- a/tools/cluster/tests/access_nodes_test.go +++ b/tools/cluster/tests/access_nodes_test.go @@ -1,17 +1,17 @@ package tests import ( + "context" "testing" "time" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/contracts/native/inccounter" - "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/utxodb" "github.com/iotaledger/wasp/tools/cluster/templates" ) @@ -51,18 +51,21 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { // adds node #0 from cluster2 as access node of node #0 from cluster1 // trust setup between the two nodes - node0peerInfo, err := nodeClient.GetPeeringSelf() + node0peerInfo, _, err := nodeClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() require.NoError(t, err) err = clu2.AddTrustedNode(node0peerInfo) require.NoError(t, err) - accessNodePeerInfo, err := accessNodeClient.GetPeeringSelf() + accessNodePeerInfo, _, err := accessNodeClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() require.NoError(t, err) err = env.Clu.AddTrustedNode(accessNodePeerInfo, []int{0}) require.NoError(t, err) // activate the chain on the access node - err = accessNodeClient.PutChainRecord(registry.NewChainRecord(env.Chain.ChainID, true, []*cryptolib.PublicKey{})) + _, err = accessNodeClient.ChainsApi.SetChainRecord(context.Background(), env.Chain.ChainID.String()).ChainRecord(apiclient.ChainRecord{ + IsActive: true, + AccessNodes: []string{}, + }).Execute() require.NoError(t, err) // add node 0 from cluster 2 as a *permitionless* access node diff --git a/tools/cluster/tests/account_test.go b/tools/cluster/tests/account_test.go index c9fd38bce2..e198792d35 100644 --- a/tools/cluster/tests/account_test.go +++ b/tools/cluster/tests/account_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" @@ -90,7 +91,9 @@ func testAccounts(e *ChainEnv) { receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, reqTx, 10*time.Second) require.NoError(e.t, err) - fees := uint64(receipts[0].GasFeeCharged) + fees, err := iotago.DecodeUint64(receipts[0].GasFeeCharged) + require.NoError(e.t, err) + e.checkBalanceOnChain(isc.NewAgentID(myAddress), isc.BaseTokenID, transferBaseTokens-fees) for i := range e.Chain.CommitteeNodes { diff --git a/tools/cluster/tests/evm_jsonrpc_test.go b/tools/cluster/tests/evm_jsonrpc_test.go index ca630fb66a..21682b6a8c 100644 --- a/tools/cluster/tests/evm_jsonrpc_test.go +++ b/tools/cluster/tests/evm_jsonrpc_test.go @@ -4,7 +4,10 @@ package tests import ( + "context" "crypto/ecdsa" + "errors" + "fmt" "math" "testing" "time" @@ -21,11 +24,8 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv" "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/vm/core/accounts" - "github.com/iotaledger/wasp/packages/vm/core/errors" "github.com/iotaledger/wasp/packages/vm/core/evm" - "github.com/iotaledger/wasp/packages/webapi/v1/routes" ) type clusterTestEnv struct { @@ -36,7 +36,8 @@ type clusterTestEnv struct { func newClusterTestEnv(t *testing.T, env *ChainEnv, nodeIndex int) *clusterTestEnv { evmtest.InitGoEthLogger(t) - jsonRPCEndpoint := "http://" + env.Clu.Config.APIHost(nodeIndex) + routes.EVMJSONRPC(env.Chain.ChainID.String()) + evmJsonRPCPath := fmt.Sprintf("/chains/%v/evm", env.Chain.ChainID.String()) + jsonRPCEndpoint := "http://" + env.Clu.Config.APIHost(nodeIndex) + evmJsonRPCPath rawClient, err := rpc.DialHTTP(jsonRPCEndpoint) require.NoError(t, err) client := ethclient.NewClient(rawClient) @@ -44,23 +45,23 @@ func newClusterTestEnv(t *testing.T, env *ChainEnv, nodeIndex int) *clusterTestE waitTxConfirmed := func(txHash common.Hash) error { c := env.Chain.Client(nil, nodeIndex) - reqID, err := c.RequestIDByEVMTransactionHash(txHash) + reqID, err := c.RequestIDByEVMTransactionHash(context.Background(), txHash) if err != nil { return err } - receipt, err := c.WaspClient.WaitUntilRequestProcessed(env.Chain.ChainID, reqID, 1*time.Minute) + receipt, _, err := c.WaspClient.RequestsApi. + WaitForRequest(context.Background(), env.Chain.ChainID.String(), reqID.String()). + TimeoutSeconds(60). + Execute() + if err != nil { return err } + if receipt.Error != nil { - resolved, err := errors.Resolve(receipt.Error, func(contractName string, funcName string, params dict.Dict) (dict.Dict, error) { - return c.CallView(isc.Hn(contractName), funcName, params) - }) - if err != nil { - return err - } - return resolved + return errors.New(receipt.Error.Message) } + return nil } diff --git a/tools/cluster/tests/util.go b/tools/cluster/tests/util.go index 62e90d9571..ce6646b1aa 100644 --- a/tools/cluster/tests/util.go +++ b/tools/cluster/tests/util.go @@ -9,7 +9,8 @@ import ( "github.com/stretchr/testify/require" - iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" @@ -29,7 +30,7 @@ func (e *ChainEnv) checkCoreContracts() { require.EqualValues(e.t, []byte{0xFF}, b) cl := e.Chain.SCClient(governance.Contract.Hname(), nil, i) - ret, err := cl.CallView(governance.ViewGetChainInfo.Name, nil) + ret, err := cl.CallView(context.Background(), governance.ViewGetChainInfo.Name, nil) require.NoError(e.t, err) chainID, err := codec.DecodeChainID(ret.MustGet(governance.VarChainID)) @@ -45,7 +46,7 @@ func (e *ChainEnv) checkCoreContracts() { require.EqualValues(e.t, e.Chain.Description, desc) records, err := e.Chain.SCClient(root.Contract.Hname(), nil, i). - CallView(root.ViewGetContractRecords.Name, nil) + CallView(context.Background(), root.ViewGetContractRecords.Name, nil) require.NoError(e.t, err) contractRegistry, err := root.DecodeContractRegistry(collections.NewMapReadOnly(records, root.StateVarContractRegistry)) @@ -77,11 +78,18 @@ func (e *ChainEnv) getBalanceOnChain(agentID isc.AgentID, assetID []byte, nodeIn if len(nodeIndex) > 0 { idx = nodeIndex[0] } - ret, err := e.Chain.Cluster.WaspClient(idx).CallView( - e.Chain.ChainID, accounts.Contract.Hname(), accounts.ViewBalance.Name, - dict.Dict{ - accounts.ParamAgentID: agentID.Bytes(), - }) + + args := dict.Dict{ + accounts.ParamAgentID: agentID.Bytes(), + } + + ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(idx), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: accounts.Contract.Hname().String(), + FunctionHName: accounts.ViewBalance.Hname().String(), + Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), + }) + if err != nil { return 0 } @@ -125,26 +133,38 @@ func (e *ChainEnv) getBalancesOnChain() map[string]*isc.Assets { ret := make(map[string]*isc.Assets) acc := e.getAccountsOnChain() for _, agentID := range acc { - balance, _, err := e.Chain.Cluster. - WaspClient(0). - CorecontractsApi. - AccountsGetAccountBalance(context.Background(), e.Chain.ChainID.String(), agentID.String()). - Execute() + args := dict.Dict{ + accounts.ParamAgentID: agentID.Bytes(), + } - require.NoError(e.t, err) + // TODO: Validate with develop + r, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: accounts.Contract.Hname().String(), + FunctionHName: accounts.ViewBalance.Hname().String(), + Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), + }) - isc.NewAssets(balance.BaseTokens, balance.NativeTokens.([]*iotago.NativeToken), nil) + require.NoError(e.t, err) ret[string(agentID.Bytes())], err = isc.AssetsFromDict(r) + require.NoError(e.t, err) } return ret } func (e *ChainEnv) getTotalBalance() *isc.Assets { - r, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, accounts.Contract.Hname(), accounts.ViewTotalAssets.Name, nil, - ) + r, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: accounts.Contract.Hname().String(), + FunctionHName: accounts.ViewTotalAssets.Hname().String(), + }) + + if err != nil { + return nil + } + require.NoError(e.t, err) ret, err := isc.AssetsFromDict(r) require.NoError(e.t, err) @@ -173,9 +193,12 @@ func (e *ChainEnv) checkLedger() { } func (e *ChainEnv) getChainInfo() (isc.ChainID, isc.AgentID) { - ret, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, governance.Contract.Hname(), governance.ViewGetChainInfo.Name, nil, - ) + ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: governance.Contract.Hname().String(), + FunctionHName: governance.ViewGetChainInfo.Hname().String(), + }) + require.NoError(e.t, err) chainID, err := codec.DecodeChainID(ret.MustGet(governance.VarChainID)) @@ -193,14 +216,21 @@ func (e *ChainEnv) findContract(name string, nodeIndex ...int) (*root.ContractRe } hname := isc.Hn(name) - ret, err := e.Chain.Cluster.WaspClient(i).CallView( - e.Chain.ChainID, root.Contract.Hname(), root.ViewFindContract.Name, - dict.Dict{ - root.ParamHname: codec.EncodeHname(hname), - }) - if err != nil { - return nil, err + + args := dict.Dict{ + root.ParamHname: codec.EncodeHname(hname), } + + // TODO: Validate with develop + ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(i), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: root.Contract.Hname().String(), + FunctionHName: root.ViewFindContract.Hname().String(), + Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), + }) + + require.NoError(e.t, err) + recBin, err := ret.Get(root.ParamContractRecData) if err != nil { return nil, err @@ -227,9 +257,12 @@ func waitTrue(timeout time.Duration, fun func() bool) bool { func (e *ChainEnv) counterEquals(expected int64) conditionFn { return func(t *testing.T, nodeIndex int) bool { - ret, err := e.Chain.Cluster.WaspClient(nodeIndex).CallView( - e.Chain.ChainID, nativeIncCounterSCHname, inccounter.ViewGetCounter.Name, nil, - ) + ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(nodeIndex), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: nativeIncCounterSCHname.String(), + FunctionHName: inccounter.ViewGetCounter.Hname().String(), + }) + if err != nil { e.t.Logf("chainEnv::counterEquals: failed to call GetCounter: %v", err) return false From 8ee23de5b80de2a5095b8f631fe0d1773f60d98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Tue, 7 Feb 2023 13:13:43 +0100 Subject: [PATCH 25/39] Fix unit tests and make cluster tests compilable --- clients/apiclient/.openapi-generator/FILES | 4 + clients/apiclient/api/openapi.yaml | 131 ++++++++- clients/apiclient/api_chains.go | 125 +++++++++ clients/apiclient/api_corecontracts.go | 254 ++++++++++++++++++ clients/apiclient/docs/Blob.md | 10 +- clients/apiclient/docs/BlobValueResponse.md | 2 +- clients/apiclient/docs/ChainsApi.md | 69 +++++ .../docs/ControlAddressesResponse.md | 6 +- clients/apiclient/docs/CorecontractsApi.md | 142 ++++++++++ ...AllowedStateControllerAddressesResponse.md | 56 ++++ .../apiclient/docs/GovChainOwnerResponse.md | 56 ++++ clients/apiclient/model_blob.go | 12 +- clients/apiclient/model_blob_info_response.go | 12 +- .../apiclient/model_blob_value_response.go | 1 + .../model_control_addresses_response.go | 3 + ...wed_state_controller_addresses_response.go | 127 +++++++++ .../model_gov_chain_owner_response.go | 127 +++++++++ clients/apiextensions/assets.go | 42 +++ clients/apiextensions/client.go | 38 +++ .../{apiutils.go => apiextensions/dict.go} | 37 +-- clients/chainclient/callview.go | 6 +- clients/multiclient/reqstatus.go | 4 +- .../go/wasmclient/wasmclientservice.go | 8 +- .../webapi/controllers/chain/controller.go | 4 +- .../webapi/controllers/corecontracts/blob.go | 6 +- .../controllers/corecontracts/controller.go | 16 ++ .../controllers/corecontracts/governance.go | 51 ++++ packages/webapi/models/core_blocklog.go | 6 +- tools/cluster/chain.go | 6 +- tools/cluster/cluster.go | 11 +- tools/cluster/tests/access_nodes_test.go | 22 +- tools/cluster/tests/blob_test.go | 49 +--- tools/cluster/tests/deploy_test.go | 15 +- tools/cluster/tests/inccounter_test.go | 18 +- tools/cluster/tests/maintenance_test.go | 12 +- tools/cluster/tests/missing_requests_test.go | 16 +- .../cluster/tests/offledger_requests_test.go | 42 +-- tools/cluster/tests/post_test.go | 36 +-- tools/cluster/tests/reboot_test.go | 95 +++++-- tools/cluster/tests/rotation_test.go | 44 ++- tools/cluster/tests/spam_test.go | 20 +- tools/cluster/tests/transfer_test.go | 9 +- tools/cluster/tests/util.go | 105 ++++---- tools/cluster/tests/wasp-cli_rotation_test.go | 24 +- tools/wasp-cli/chain/blocklog.go | 4 +- tools/wasp-cli/chain/callview.go | 6 +- tools/wasp-cli/chain/rotate.go | 4 +- tools/wasp-cli/cli/cliclients/clients.go | 4 +- tools/wasp-cli/util/tx.go | 4 +- tools/wasp-cli/wallet/info.go | 7 +- tools/wasp-cli/wallet/send.go | 4 +- 51 files changed, 1584 insertions(+), 328 deletions(-) create mode 100644 clients/apiclient/docs/GovAllowedStateControllerAddressesResponse.md create mode 100644 clients/apiclient/docs/GovChainOwnerResponse.md create mode 100644 clients/apiclient/model_gov_allowed_state_controller_addresses_response.go create mode 100644 clients/apiclient/model_gov_chain_owner_response.go create mode 100644 clients/apiextensions/assets.go create mode 100644 clients/apiextensions/client.go rename clients/{apiutils.go => apiextensions/dict.go} (68%) diff --git a/clients/apiclient/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES index 705f4dc776..c5780145a8 100644 --- a/clients/apiclient/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -48,7 +48,9 @@ docs/ErrorMessageFormatResponse.md docs/EventsResponse.md docs/FoundryOutputResponse.md docs/GasFeePolicy.md +docs/GovAllowedStateControllerAddressesResponse.md docs/GovChainInfoResponse.md +docs/GovChainOwnerResponse.md docs/InOutput.md docs/InOutputMetricItem.md docs/InStateOutput.md @@ -138,7 +140,9 @@ model_error_message_format_response.go model_events_response.go model_foundry_output_response.go model_gas_fee_policy.go +model_gov_allowed_state_controller_addresses_response.go model_gov_chain_info_response.go +model_gov_chain_owner_response.go model_in_output.go model_in_output_metric_item.go model_in_state_output.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index c76b24d719..980dcb6183 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -1152,6 +1152,36 @@ paths: summary: Get the error message format of a specific error id tags: - corecontracts + /v2/chains/{chainID}/core/governance/allowedstatecontrollers: + get: + description: Returns the allowed state controller addresses + operationId: governanceGetAllowedStateControllerAddresses + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GovAllowedStateControllerAddressesResponse' + description: The state controller addresses + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get the allowed state controller addresses + tags: + - corecontracts /v2/chains/{chainID}/core/governance/chaininfo: get: description: "If you are using the common API functions, you most likely rather\ @@ -1183,6 +1213,36 @@ paths: summary: Get the chain info tags: - corecontracts + /v2/chains/{chainID}/core/governance/chainowner: + get: + description: Returns the chain owner + operationId: governanceGetChainOwner + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GovChainOwnerResponse' + description: The chain owner + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "Unauthorized (Wrong permissions, missing token)" + security: + - Authorization: [] + summary: Get the chain owner + tags: + - corecontracts /v2/chains/{chainID}/deactivate: post: operationId: deactivateChain @@ -1212,6 +1272,35 @@ paths: summary: Deactivate a chain tags: - chains + /v2/chains/{chainID}/evm: + get: + parameters: + - description: ChainID (Bech32) + in: path + name: chainID + required: true + schema: + format: string + type: string + responses: + "200": + content: + application/json: + schema: + format: string + type: string + description: The evm json RPC + "404": + content: + application/json: + schema: + format: string + type: string + description: The evm json RPC failure + security: + - Authorization: [] + tags: + - chains /v2/chains/{chainID}/evm/tx/{txHash}: get: operationId: getRequestIDFromEVMTransactionID @@ -2260,7 +2349,7 @@ components: name: BaseToken Blob: example: - size: 0 + size: 1 hash: hash properties: hash: @@ -2270,6 +2359,7 @@ components: name: Hash size: format: int32 + minimum: 1 type: integer xml: name: Size @@ -2299,9 +2389,9 @@ components: BlobListResponse: example: Blobs: - - size: 0 + - size: 1 hash: hash - - size: 0 + - size: 1 hash: hash properties: Blobs: @@ -2319,6 +2409,7 @@ components: valueData: valueData properties: valueData: + description: The blob data (Hex) format: string type: string xml: @@ -3341,17 +3432,20 @@ components: stateAddress: stateAddress properties: governingAddress: + description: The governing address (Bech32) format: string type: string xml: name: GoverningAddress sinceBlockIndex: + description: The block index (uint32 format: int32 minimum: 1 type: integer xml: name: SinceBlockIndex stateAddress: + description: The state address (Bech32) format: string type: string xml: @@ -3522,6 +3616,24 @@ components: type: object xml: name: FoundryOutputResponse + GovAllowedStateControllerAddressesResponse: + example: + addresses: + - addresses + - addresses + properties: + addresses: + description: The allowed state controller addresses (Bech32-encoded) + items: + format: string + type: string + type: array + xml: + name: Addresses + wrapped: true + type: object + xml: + name: GovAllowedStateControllerAddressesResponse GovChainInfoResponse: example: chainOwnerId: chainOwnerId @@ -3584,6 +3696,19 @@ components: type: object xml: name: GovChainInfoResponse + GovChainOwnerResponse: + example: + chainOwner: chainOwner + properties: + chainOwner: + description: The chain owner (Bech32-encoded) + format: string + type: string + xml: + name: ChainOwner + type: object + xml: + name: GovChainOwnerResponse InOutput: example: output: diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index 79679ba70b..fa3099ed1c 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -1460,3 +1460,128 @@ func (a *ChainsApiService) SetChainRecordExecute(r ApiSetChainRecordRequest) (*h return localVarHTTPResponse, nil } + +type ApiV2ChainsChainIDEvmGetRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiV2ChainsChainIDEvmGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.V2ChainsChainIDEvmGetExecute(r) +} + +/* +V2ChainsChainIDEvmGet Method for V2ChainsChainIDEvmGet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiV2ChainsChainIDEvmGetRequest +*/ +func (a *ChainsApiService) V2ChainsChainIDEvmGet(ctx context.Context, chainID string) ApiV2ChainsChainIDEvmGetRequest { + return ApiV2ChainsChainIDEvmGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return string +func (a *ChainsApiService) V2ChainsChainIDEvmGetExecute(r ApiV2ChainsChainIDEvmGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.V2ChainsChainIDEvmGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/evm" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index 9c0563094f..da23ae8eaa 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -3238,6 +3238,133 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGovernanceGetAllowedStateControllerAddressesRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiGovernanceGetAllowedStateControllerAddressesRequest) Execute() (*GovAllowedStateControllerAddressesResponse, *http.Response, error) { + return r.ApiService.GovernanceGetAllowedStateControllerAddressesExecute(r) +} + +/* +GovernanceGetAllowedStateControllerAddresses Get the allowed state controller addresses + +Returns the allowed state controller addresses + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGovernanceGetAllowedStateControllerAddressesRequest +*/ +func (a *CorecontractsApiService) GovernanceGetAllowedStateControllerAddresses(ctx context.Context, chainID string) ApiGovernanceGetAllowedStateControllerAddressesRequest { + return ApiGovernanceGetAllowedStateControllerAddressesRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return GovAllowedStateControllerAddressesResponse +func (a *CorecontractsApiService) GovernanceGetAllowedStateControllerAddressesExecute(r ApiGovernanceGetAllowedStateControllerAddressesRequest) (*GovAllowedStateControllerAddressesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GovAllowedStateControllerAddressesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.GovernanceGetAllowedStateControllerAddresses") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/allowedstatecontrollers" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGovernanceGetChainInfoRequest struct { ctx context.Context ApiService *CorecontractsApiService @@ -3364,3 +3491,130 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG return localVarReturnValue, localVarHTTPResponse, nil } + +type ApiGovernanceGetChainOwnerRequest struct { + ctx context.Context + ApiService *CorecontractsApiService + chainID string +} + +func (r ApiGovernanceGetChainOwnerRequest) Execute() (*GovChainOwnerResponse, *http.Response, error) { + return r.ApiService.GovernanceGetChainOwnerExecute(r) +} + +/* +GovernanceGetChainOwner Get the chain owner + +Returns the chain owner + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiGovernanceGetChainOwnerRequest +*/ +func (a *CorecontractsApiService) GovernanceGetChainOwner(ctx context.Context, chainID string) ApiGovernanceGetChainOwnerRequest { + return ApiGovernanceGetChainOwnerRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return GovChainOwnerResponse +func (a *CorecontractsApiService) GovernanceGetChainOwnerExecute(r ApiGovernanceGetChainOwnerRequest) (*GovChainOwnerResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GovChainOwnerResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CorecontractsApiService.GovernanceGetChainOwner") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/chainowner" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/clients/apiclient/docs/Blob.md b/clients/apiclient/docs/Blob.md index 6cd815d639..9c8f28c2a6 100644 --- a/clients/apiclient/docs/Blob.md +++ b/clients/apiclient/docs/Blob.md @@ -5,13 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Hash** | **string** | | -**Size** | **int32** | | +**Size** | **uint32** | | ## Methods ### NewBlob -`func NewBlob(hash string, size int32, ) *Blob` +`func NewBlob(hash string, size uint32, ) *Blob` NewBlob instantiates a new Blob object This constructor will assign default values to properties that have it defined, @@ -48,20 +48,20 @@ SetHash sets Hash field to given value. ### GetSize -`func (o *Blob) GetSize() int32` +`func (o *Blob) GetSize() uint32` GetSize returns the Size field if non-nil, zero value otherwise. ### GetSizeOk -`func (o *Blob) GetSizeOk() (*int32, bool)` +`func (o *Blob) GetSizeOk() (*uint32, bool)` GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSize -`func (o *Blob) SetSize(v int32)` +`func (o *Blob) SetSize(v uint32)` SetSize sets Size field to given value. diff --git a/clients/apiclient/docs/BlobValueResponse.md b/clients/apiclient/docs/BlobValueResponse.md index 7a2ad5e0ba..5c1c25766b 100644 --- a/clients/apiclient/docs/BlobValueResponse.md +++ b/clients/apiclient/docs/BlobValueResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ValueData** | **string** | | +**ValueData** | **string** | The blob data (Hex) | ## Methods diff --git a/clients/apiclient/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md index 2595d4d015..f7e34a8cec 100644 --- a/clients/apiclient/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -16,6 +16,7 @@ Method | HTTP request | Description [**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2/chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state [**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /v2/chains/{chainID}/access-node/{publicKey} | Remove an access node. [**SetChainRecord**](ChainsApi.md#SetChainRecord) | **Post** /v2/chains/{chainID}/chainrecord | Sets the chain record. +[**V2ChainsChainIDEvmGet**](ChainsApi.md#V2ChainsChainIDEvmGet) | **Get** /v2/chains/{chainID}/evm | @@ -827,3 +828,71 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## V2ChainsChainIDEvmGet + +> string V2ChainsChainIDEvmGet(ctx, chainID).Execute() + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.V2ChainsChainIDEvmGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.V2ChainsChainIDEvmGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `V2ChainsChainIDEvmGet`: string + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.V2ChainsChainIDEvmGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiV2ChainsChainIDEvmGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**string** + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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/clients/apiclient/docs/ControlAddressesResponse.md b/clients/apiclient/docs/ControlAddressesResponse.md index b948f47f2d..27e0a8771b 100644 --- a/clients/apiclient/docs/ControlAddressesResponse.md +++ b/clients/apiclient/docs/ControlAddressesResponse.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**GoverningAddress** | **string** | | -**SinceBlockIndex** | **uint32** | | -**StateAddress** | **string** | | +**GoverningAddress** | **string** | The governing address (Bech32) | +**SinceBlockIndex** | **uint32** | The block index (uint32 | +**StateAddress** | **string** | The state address (Bech32) | ## Methods diff --git a/clients/apiclient/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md index 5707bb3d5f..c9258b4748 100644 --- a/clients/apiclient/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -29,7 +29,9 @@ Method | HTTP request | Description [**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block [**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block [**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetAllowedStateControllerAddresses**](CorecontractsApi.md#GovernanceGetAllowedStateControllerAddresses) | **Get** /v2/chains/{chainID}/core/governance/allowedstatecontrollers | Get the allowed state controller addresses [**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2/chains/{chainID}/core/governance/chaininfo | Get the chain info +[**GovernanceGetChainOwner**](CorecontractsApi.md#GovernanceGetChainOwner) | **Get** /v2/chains/{chainID}/core/governance/chainowner | Get the chain owner @@ -1787,6 +1789,76 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GovernanceGetAllowedStateControllerAddresses + +> GovAllowedStateControllerAddressesResponse GovernanceGetAllowedStateControllerAddresses(ctx, chainID).Execute() + +Get the allowed state controller addresses + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.GovernanceGetAllowedStateControllerAddresses(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.GovernanceGetAllowedStateControllerAddresses``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GovernanceGetAllowedStateControllerAddresses`: GovAllowedStateControllerAddressesResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.GovernanceGetAllowedStateControllerAddresses`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGovernanceGetAllowedStateControllerAddressesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**GovAllowedStateControllerAddressesResponse**](GovAllowedStateControllerAddressesResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + ## GovernanceGetChainInfo > GovChainInfoResponse GovernanceGetChainInfo(ctx, chainID).Execute() @@ -1856,3 +1928,73 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## GovernanceGetChainOwner + +> GovChainOwnerResponse GovernanceGetChainOwner(ctx, chainID).Execute() + +Get the chain owner + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CorecontractsApi.GovernanceGetChainOwner(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CorecontractsApi.GovernanceGetChainOwner``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GovernanceGetChainOwner`: GovChainOwnerResponse + fmt.Fprintf(os.Stdout, "Response from `CorecontractsApi.GovernanceGetChainOwner`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGovernanceGetChainOwnerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**GovChainOwnerResponse**](GovChainOwnerResponse.md) + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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/clients/apiclient/docs/GovAllowedStateControllerAddressesResponse.md b/clients/apiclient/docs/GovAllowedStateControllerAddressesResponse.md new file mode 100644 index 0000000000..0e2e0d9699 --- /dev/null +++ b/clients/apiclient/docs/GovAllowedStateControllerAddressesResponse.md @@ -0,0 +1,56 @@ +# GovAllowedStateControllerAddressesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addresses** | Pointer to **[]string** | The allowed state controller addresses (Bech32-encoded) | [optional] + +## Methods + +### NewGovAllowedStateControllerAddressesResponse + +`func NewGovAllowedStateControllerAddressesResponse() *GovAllowedStateControllerAddressesResponse` + +NewGovAllowedStateControllerAddressesResponse instantiates a new GovAllowedStateControllerAddressesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGovAllowedStateControllerAddressesResponseWithDefaults + +`func NewGovAllowedStateControllerAddressesResponseWithDefaults() *GovAllowedStateControllerAddressesResponse` + +NewGovAllowedStateControllerAddressesResponseWithDefaults instantiates a new GovAllowedStateControllerAddressesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddresses + +`func (o *GovAllowedStateControllerAddressesResponse) GetAddresses() []string` + +GetAddresses returns the Addresses field if non-nil, zero value otherwise. + +### GetAddressesOk + +`func (o *GovAllowedStateControllerAddressesResponse) GetAddressesOk() (*[]string, bool)` + +GetAddressesOk returns a tuple with the Addresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddresses + +`func (o *GovAllowedStateControllerAddressesResponse) SetAddresses(v []string)` + +SetAddresses sets Addresses field to given value. + +### HasAddresses + +`func (o *GovAllowedStateControllerAddressesResponse) HasAddresses() bool` + +HasAddresses returns a boolean if a field has been set. + + +[[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/clients/apiclient/docs/GovChainOwnerResponse.md b/clients/apiclient/docs/GovChainOwnerResponse.md new file mode 100644 index 0000000000..deae81b68b --- /dev/null +++ b/clients/apiclient/docs/GovChainOwnerResponse.md @@ -0,0 +1,56 @@ +# GovChainOwnerResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ChainOwner** | Pointer to **string** | The chain owner (Bech32-encoded) | [optional] + +## Methods + +### NewGovChainOwnerResponse + +`func NewGovChainOwnerResponse() *GovChainOwnerResponse` + +NewGovChainOwnerResponse instantiates a new GovChainOwnerResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGovChainOwnerResponseWithDefaults + +`func NewGovChainOwnerResponseWithDefaults() *GovChainOwnerResponse` + +NewGovChainOwnerResponseWithDefaults instantiates a new GovChainOwnerResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChainOwner + +`func (o *GovChainOwnerResponse) GetChainOwner() string` + +GetChainOwner returns the ChainOwner field if non-nil, zero value otherwise. + +### GetChainOwnerOk + +`func (o *GovChainOwnerResponse) GetChainOwnerOk() (*string, bool)` + +GetChainOwnerOk returns a tuple with the ChainOwner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChainOwner + +`func (o *GovChainOwnerResponse) SetChainOwner(v string)` + +SetChainOwner sets ChainOwner field to given value. + +### HasChainOwner + +`func (o *GovChainOwnerResponse) HasChainOwner() bool` + +HasChainOwner returns a boolean if a field has been set. + + +[[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/clients/apiclient/model_blob.go b/clients/apiclient/model_blob.go index 33ce852a44..5fa2336c80 100644 --- a/clients/apiclient/model_blob.go +++ b/clients/apiclient/model_blob.go @@ -20,14 +20,14 @@ var _ MappedNullable = &Blob{} // Blob struct for Blob type Blob struct { Hash string `json:"hash"` - Size int32 `json:"size"` + Size uint32 `json:"size"` } // NewBlob instantiates a new Blob object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlob(hash string, size int32) *Blob { +func NewBlob(hash string, size uint32) *Blob { this := Blob{} this.Hash = hash this.Size = size @@ -67,9 +67,9 @@ func (o *Blob) SetHash(v string) { } // GetSize returns the Size field value -func (o *Blob) GetSize() int32 { +func (o *Blob) GetSize() uint32 { if o == nil { - var ret int32 + var ret uint32 return ret } @@ -78,7 +78,7 @@ func (o *Blob) GetSize() int32 { // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. -func (o *Blob) GetSizeOk() (*int32, bool) { +func (o *Blob) GetSizeOk() (*uint32, bool) { if o == nil { return nil, false } @@ -86,7 +86,7 @@ func (o *Blob) GetSizeOk() (*int32, bool) { } // SetSize sets field value -func (o *Blob) SetSize(v int32) { +func (o *Blob) SetSize(v uint32) { o.Size = v } diff --git a/clients/apiclient/model_blob_info_response.go b/clients/apiclient/model_blob_info_response.go index 0b38633055..44c3a222ca 100644 --- a/clients/apiclient/model_blob_info_response.go +++ b/clients/apiclient/model_blob_info_response.go @@ -19,14 +19,14 @@ var _ MappedNullable = &BlobInfoResponse{} // BlobInfoResponse struct for BlobInfoResponse type BlobInfoResponse struct { - Fields map[string]int32 `json:"fields"` + Fields map[string]uint32 `json:"fields"` } // NewBlobInfoResponse instantiates a new BlobInfoResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBlobInfoResponse(fields map[string]int32) *BlobInfoResponse { +func NewBlobInfoResponse(fields map[string]uint32) *BlobInfoResponse { this := BlobInfoResponse{} this.Fields = fields return &this @@ -41,9 +41,9 @@ func NewBlobInfoResponseWithDefaults() *BlobInfoResponse { } // GetFields returns the Fields field value -func (o *BlobInfoResponse) GetFields() map[string]int32 { +func (o *BlobInfoResponse) GetFields() map[string]uint32 { if o == nil { - var ret map[string]int32 + var ret map[string]uint32 return ret } @@ -52,7 +52,7 @@ func (o *BlobInfoResponse) GetFields() map[string]int32 { // GetFieldsOk returns a tuple with the Fields field value // and a boolean to check if the value has been set. -func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool) { +func (o *BlobInfoResponse) GetFieldsOk() (*map[string]uint32, bool) { if o == nil { return nil, false } @@ -60,7 +60,7 @@ func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool) { } // SetFields sets field value -func (o *BlobInfoResponse) SetFields(v map[string]int32) { +func (o *BlobInfoResponse) SetFields(v map[string]uint32) { o.Fields = v } diff --git a/clients/apiclient/model_blob_value_response.go b/clients/apiclient/model_blob_value_response.go index a2a397ff67..3ad0b563da 100644 --- a/clients/apiclient/model_blob_value_response.go +++ b/clients/apiclient/model_blob_value_response.go @@ -19,6 +19,7 @@ var _ MappedNullable = &BlobValueResponse{} // BlobValueResponse struct for BlobValueResponse type BlobValueResponse struct { + // The blob data (Hex) ValueData string `json:"valueData"` } diff --git a/clients/apiclient/model_control_addresses_response.go b/clients/apiclient/model_control_addresses_response.go index 41916f492a..d29d7f3622 100644 --- a/clients/apiclient/model_control_addresses_response.go +++ b/clients/apiclient/model_control_addresses_response.go @@ -19,8 +19,11 @@ var _ MappedNullable = &ControlAddressesResponse{} // ControlAddressesResponse struct for ControlAddressesResponse type ControlAddressesResponse struct { + // The governing address (Bech32) GoverningAddress string `json:"governingAddress"` + // The block index (uint32 SinceBlockIndex uint32 `json:"sinceBlockIndex"` + // The state address (Bech32) StateAddress string `json:"stateAddress"` } diff --git a/clients/apiclient/model_gov_allowed_state_controller_addresses_response.go b/clients/apiclient/model_gov_allowed_state_controller_addresses_response.go new file mode 100644 index 0000000000..5b3f97c5d9 --- /dev/null +++ b/clients/apiclient/model_gov_allowed_state_controller_addresses_response.go @@ -0,0 +1,127 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the GovAllowedStateControllerAddressesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GovAllowedStateControllerAddressesResponse{} + +// GovAllowedStateControllerAddressesResponse struct for GovAllowedStateControllerAddressesResponse +type GovAllowedStateControllerAddressesResponse struct { + // The allowed state controller addresses (Bech32-encoded) + Addresses []string `json:"addresses,omitempty"` +} + +// NewGovAllowedStateControllerAddressesResponse instantiates a new GovAllowedStateControllerAddressesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGovAllowedStateControllerAddressesResponse() *GovAllowedStateControllerAddressesResponse { + this := GovAllowedStateControllerAddressesResponse{} + return &this +} + +// NewGovAllowedStateControllerAddressesResponseWithDefaults instantiates a new GovAllowedStateControllerAddressesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGovAllowedStateControllerAddressesResponseWithDefaults() *GovAllowedStateControllerAddressesResponse { + this := GovAllowedStateControllerAddressesResponse{} + return &this +} + +// GetAddresses returns the Addresses field value if set, zero value otherwise. +func (o *GovAllowedStateControllerAddressesResponse) GetAddresses() []string { + if o == nil || isNil(o.Addresses) { + var ret []string + return ret + } + return o.Addresses +} + +// GetAddressesOk returns a tuple with the Addresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovAllowedStateControllerAddressesResponse) GetAddressesOk() ([]string, bool) { + if o == nil || isNil(o.Addresses) { + return nil, false + } + return o.Addresses, true +} + +// HasAddresses returns a boolean if a field has been set. +func (o *GovAllowedStateControllerAddressesResponse) HasAddresses() bool { + if o != nil && !isNil(o.Addresses) { + return true + } + + return false +} + +// SetAddresses gets a reference to the given []string and assigns it to the Addresses field. +func (o *GovAllowedStateControllerAddressesResponse) SetAddresses(v []string) { + o.Addresses = v +} + +func (o GovAllowedStateControllerAddressesResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GovAllowedStateControllerAddressesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Addresses) { + toSerialize["addresses"] = o.Addresses + } + return toSerialize, nil +} + +type NullableGovAllowedStateControllerAddressesResponse struct { + value *GovAllowedStateControllerAddressesResponse + isSet bool +} + +func (v NullableGovAllowedStateControllerAddressesResponse) Get() *GovAllowedStateControllerAddressesResponse { + return v.value +} + +func (v *NullableGovAllowedStateControllerAddressesResponse) Set(val *GovAllowedStateControllerAddressesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGovAllowedStateControllerAddressesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGovAllowedStateControllerAddressesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGovAllowedStateControllerAddressesResponse(val *GovAllowedStateControllerAddressesResponse) *NullableGovAllowedStateControllerAddressesResponse { + return &NullableGovAllowedStateControllerAddressesResponse{value: val, isSet: true} +} + +func (v NullableGovAllowedStateControllerAddressesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGovAllowedStateControllerAddressesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiclient/model_gov_chain_owner_response.go b/clients/apiclient/model_gov_chain_owner_response.go new file mode 100644 index 0000000000..9923c3b720 --- /dev/null +++ b/clients/apiclient/model_gov_chain_owner_response.go @@ -0,0 +1,127 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the GovChainOwnerResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GovChainOwnerResponse{} + +// GovChainOwnerResponse struct for GovChainOwnerResponse +type GovChainOwnerResponse struct { + // The chain owner (Bech32-encoded) + ChainOwner *string `json:"chainOwner,omitempty"` +} + +// NewGovChainOwnerResponse instantiates a new GovChainOwnerResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGovChainOwnerResponse() *GovChainOwnerResponse { + this := GovChainOwnerResponse{} + return &this +} + +// NewGovChainOwnerResponseWithDefaults instantiates a new GovChainOwnerResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGovChainOwnerResponseWithDefaults() *GovChainOwnerResponse { + this := GovChainOwnerResponse{} + return &this +} + +// GetChainOwner returns the ChainOwner field value if set, zero value otherwise. +func (o *GovChainOwnerResponse) GetChainOwner() string { + if o == nil || isNil(o.ChainOwner) { + var ret string + return ret + } + return *o.ChainOwner +} + +// GetChainOwnerOk returns a tuple with the ChainOwner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GovChainOwnerResponse) GetChainOwnerOk() (*string, bool) { + if o == nil || isNil(o.ChainOwner) { + return nil, false + } + return o.ChainOwner, true +} + +// HasChainOwner returns a boolean if a field has been set. +func (o *GovChainOwnerResponse) HasChainOwner() bool { + if o != nil && !isNil(o.ChainOwner) { + return true + } + + return false +} + +// SetChainOwner gets a reference to the given string and assigns it to the ChainOwner field. +func (o *GovChainOwnerResponse) SetChainOwner(v string) { + o.ChainOwner = &v +} + +func (o GovChainOwnerResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GovChainOwnerResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.ChainOwner) { + toSerialize["chainOwner"] = o.ChainOwner + } + return toSerialize, nil +} + +type NullableGovChainOwnerResponse struct { + value *GovChainOwnerResponse + isSet bool +} + +func (v NullableGovChainOwnerResponse) Get() *GovChainOwnerResponse { + return v.value +} + +func (v *NullableGovChainOwnerResponse) Set(val *GovChainOwnerResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGovChainOwnerResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGovChainOwnerResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGovChainOwnerResponse(val *GovChainOwnerResponse) *NullableGovChainOwnerResponse { + return &NullableGovChainOwnerResponse{value: val, isSet: true} +} + +func (v NullableGovChainOwnerResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGovChainOwnerResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiextensions/assets.go b/clients/apiextensions/assets.go new file mode 100644 index 0000000000..c415286d8d --- /dev/null +++ b/clients/apiextensions/assets.go @@ -0,0 +1,42 @@ +package apiextensions + +import ( + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/isc" +) + +func NewAssetsFromAPIResponse(assetsResponse *apiclient.AssetsResponse) (*isc.Assets, error) { + assets := isc.NewEmptyAssets() + + baseTokens, err := iotago.DecodeUint64(assetsResponse.BaseTokens) + if err != nil { + return nil, err + } + + assets.BaseTokens = baseTokens + + for _, nativeToken := range assetsResponse.NativeTokens { + nativeTokenIDHex, err := iotago.DecodeHex(nativeToken.Id) + if err != nil { + return nil, err + } + + nativeTokenID, err := isc.NativeTokenIDFromBytes(nativeTokenIDHex) + if err != nil { + return nil, err + } + + amount, err := iotago.DecodeUint256(nativeToken.Amount) + if err != nil { + return nil, err + } + + assets.NativeTokens = append(assets.NativeTokens, &iotago.NativeToken{ + ID: nativeTokenID, + Amount: amount, + }) + } + + return assets, err +} diff --git a/clients/apiextensions/client.go b/clients/apiextensions/client.go new file mode 100644 index 0000000000..392230c733 --- /dev/null +++ b/clients/apiextensions/client.go @@ -0,0 +1,38 @@ +package apiextensions + +import ( + "context" + "net/url" + + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/packages/kv/dict" +) + +func WaspAPIClientByHostName(hostname string) (*apiclient.APIClient, error) { + parsed, err := url.Parse(hostname) + + if err != nil { + return nil, err + } + + config := apiclient.NewConfiguration() + config.Host = parsed.Host + config.Scheme = parsed.Scheme + + return apiclient.NewAPIClient(config), nil +} + +func CallView(context context.Context, client *apiclient.APIClient, request apiclient.ContractCallViewRequest) (dict.Dict, error) { + result, _, err := client.RequestsApi. + CallView(context). + ContractCallViewRequest(request). + Execute() + + if err != nil { + return nil, err + } + + dictResult, err := APIJsonDictToDict(*result) + + return dictResult, err +} diff --git a/clients/apiutils.go b/clients/apiextensions/dict.go similarity index 68% rename from clients/apiutils.go rename to clients/apiextensions/dict.go index 2d74dc2a29..bf2524e153 100644 --- a/clients/apiutils.go +++ b/clients/apiextensions/dict.go @@ -1,8 +1,7 @@ -package clients +package apiextensions import ( "context" - "net/url" "time" iotago "github.com/iotaledger/iota.go/v3" @@ -24,6 +23,10 @@ func JSONDictToAPIJSONDict(jsonDict dict.JSONDict) apiclient.JSONDict { return *apiJSONDict } +func DictToAPIJsonDict(dict dict.Dict) apiclient.JSONDict { + return JSONDictToAPIJSONDict(dict.JSONDict()) +} + func APIJsonDictToJSONDict(apiJSONDict apiclient.JSONDict) dict.JSONDict { jsonDict := dict.JSONDict{ Items: make([]dict.Item, len(apiJSONDict.Items)), @@ -54,6 +57,7 @@ func APIWaitUntilAllRequestsProcessed(client *apiclient.APIClient, chainID isc.C for i, req := range reqs[chainID] { receipt, _, err := client.RequestsApi. WaitForRequest(context.Background(), chainID.String(), req.ID().String()). + TimeoutSeconds(int32(timeout.Seconds())). Execute() if err != nil { return nil, err @@ -63,32 +67,3 @@ func APIWaitUntilAllRequestsProcessed(client *apiclient.APIClient, chainID isc.C } return ret, nil } - -func WaspAPIClientByHostName(hostname string) (*apiclient.APIClient, error) { - parsed, err := url.Parse(hostname) - - if err != nil { - return nil, err - } - - config := apiclient.NewConfiguration() - config.Host = parsed.Host - config.Scheme = parsed.Scheme - - return apiclient.NewAPIClient(config), nil -} - -func CallView(context context.Context, client *apiclient.APIClient, request apiclient.ContractCallViewRequest) (dict.Dict, error) { - result, _, err := client.RequestsApi. - CallView(context). - ContractCallViewRequest(request). - Execute() - - if err != nil { - return nil, err - } - - dictResult, err := dict.FromJSONDict(APIJsonDictToJSONDict(*result)) - - return dictResult, err -} diff --git a/clients/chainclient/callview.go b/clients/chainclient/callview.go index 4afdbb5000..d5e2a5a47a 100644 --- a/clients/chainclient/callview.go +++ b/clients/chainclient/callview.go @@ -3,8 +3,8 @@ package chainclient import ( "context" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" ) @@ -15,8 +15,8 @@ func (c *Client) CallView(ctx context.Context, hContract isc.Hname, functionName ChainId: c.ChainID.String(), ContractHName: hContract.String(), FunctionName: functionName, - Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), + Arguments: apiextensions.JSONDictToAPIJSONDict(args.JSONDict()), } - return clients.CallView(ctx, c.WaspClient, request) + return apiextensions.CallView(ctx, c.WaspClient, request) } diff --git a/clients/multiclient/reqstatus.go b/clients/multiclient/reqstatus.go index 239a4c5b84..6798aff692 100644 --- a/clients/multiclient/reqstatus.go +++ b/clients/multiclient/reqstatus.go @@ -6,8 +6,8 @@ import ( "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/packages/isc" ) @@ -51,7 +51,7 @@ func (m *MultiClient) WaitUntilAllRequestsProcessed(chainID isc.ChainID, tx *iot var receipts []*apiclient.ReceiptResponse var err error err = m.Do(func(i int, w *apiclient.APIClient) error { - receipts, err = clients.APIWaitUntilAllRequestsProcessed(w, chainID, tx, timeout) + receipts, err = apiextensions.APIWaitUntilAllRequestsProcessed(w, chainID, tx, timeout) return err }) diff --git a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go index bf0416bb25..b383d610b2 100644 --- a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go +++ b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go @@ -8,8 +8,8 @@ import ( "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" @@ -33,7 +33,7 @@ type WasmClientService struct { var _ IClientService = new(WasmClientService) func NewWasmClientService(waspAPI, eventPort string) *WasmClientService { - client, err := clients.WaspAPIClientByHostName(waspAPI) + client, err := apiextensions.WaspAPIClientByHostName(waspAPI) if err != nil { panic(err.Error()) } @@ -57,14 +57,14 @@ func (sc *WasmClientService) CallViewByHname(chainID wasmtypes.ScChainID, hContr ContractHName: iscContract.String(), FunctionHName: iscFunction.String(), ChainId: iscChainID.String(), - Arguments: clients.JSONDictToAPIJSONDict(params.JSONDict()), + Arguments: apiextensions.JSONDictToAPIJSONDict(params.JSONDict()), }).Execute() if err != nil { return nil, err } - decodedParams, err := clients.APIJsonDictToDict(*res) + decodedParams, err := apiextensions.APIJsonDictToDict(*res) if err != nil { return nil, err } diff --git a/packages/webapi/controllers/chain/controller.go b/packages/webapi/controllers/chain/controller.go index b771da4b91..1f7ac78f09 100644 --- a/packages/webapi/controllers/chain/controller.go +++ b/packages/webapi/controllers/chain/controller.go @@ -51,8 +51,8 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter publicAPI. GET(evmURL, c.handleJSONRPC). AddParamPath("", "chainID", "ChainID (Bech32)"). - AddResponse(http.StatusOK, "", "", nil). - AddResponse(http.StatusNotFound, "", "", nil) + AddResponse(http.StatusOK, "The evm json RPC", "", nil). + AddResponse(http.StatusNotFound, "The evm json RPC failure", "", nil) publicAPI. EchoGroup().Any("chains/:chainID/evm", c.handleJSONRPC) diff --git a/packages/webapi/controllers/corecontracts/blob.go b/packages/webapi/controllers/corecontracts/blob.go index e478f50dc5..131dc3e8f1 100644 --- a/packages/webapi/controllers/corecontracts/blob.go +++ b/packages/webapi/controllers/corecontracts/blob.go @@ -12,7 +12,7 @@ import ( type Blob struct { Hash string `json:"hash" swagger:"required"` - Size uint32 `json:"size" swagger:"required"` + Size uint32 `json:"size" swagger:"required,min(1)"` } type BlobListResponse struct { @@ -45,7 +45,7 @@ func (c *Controller) listBlobs(e echo.Context) error { } type BlobValueResponse struct { - ValueData string `json:"valueData" swagger:"required"` + ValueData string `json:"valueData" swagger:"required,desc(The blob data (Hex))"` } func (c *Controller) getBlobValue(e echo.Context) error { @@ -74,7 +74,7 @@ func (c *Controller) getBlobValue(e echo.Context) error { } type BlobInfoResponse struct { - Fields map[string]uint32 `json:"fields" swagger:"required"` + Fields map[string]uint32 `json:"fields" swagger:"required,min(1)"` } func (c *Controller) getBlobInfo(e echo.Context) error { diff --git a/packages/webapi/controllers/corecontracts/controller.go b/packages/webapi/controllers/corecontracts/controller.go index c7ff18f268..fd27ada02e 100644 --- a/packages/webapi/controllers/corecontracts/controller.go +++ b/packages/webapi/controllers/corecontracts/controller.go @@ -153,6 +153,22 @@ func (c *Controller) addGovernanceContractRoutes(api echoswagger.ApiGroup, mocke SetOperationId("governanceGetChainInfo"). SetDescription("If you are using the common API functions, you most likely rather want to use '/chains/:chainID' to get information about a chain."). SetSummary("Get the chain info") + + api.GET("chains/:chainID/core/governance/chainowner", c.getChainOwner). + AddParamPath("", "chainID", "ChainID (Bech32)"). + AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). + AddResponse(http.StatusOK, "The chain owner", mocker.Get(GovChainOwnerResponse{}), nil). + SetOperationId("governanceGetChainOwner"). + SetDescription("Returns the chain owner"). + SetSummary("Get the chain owner") + + api.GET("chains/:chainID/core/governance/allowedstatecontrollers", c.getAllowedStateControllerAddresses). + AddParamPath("", "chainID", "ChainID (Bech32)"). + AddResponse(http.StatusUnauthorized, "Unauthorized (Wrong permissions, missing token)", authentication.ValidationError{}, nil). + AddResponse(http.StatusOK, "The state controller addresses", mocker.Get(GovAllowedStateControllerAddressesResponse{}), nil). + SetOperationId("governanceGetAllowedStateControllerAddresses"). + SetDescription("Returns the allowed state controller addresses"). + SetSummary("Get the allowed state controller addresses") } func (c *Controller) addBlockLogContractRoutes(api echoswagger.ApiGroup, mocker interfaces.Mocker) { diff --git a/packages/webapi/controllers/corecontracts/governance.go b/packages/webapi/controllers/corecontracts/governance.go index 572828a60b..a340e0cec2 100644 --- a/packages/webapi/controllers/corecontracts/governance.go +++ b/packages/webapi/controllers/corecontracts/governance.go @@ -6,6 +6,7 @@ import ( "github.com/labstack/echo/v4" "github.com/iotaledger/wasp/packages/isc" + "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/vm/core/governance" "github.com/iotaledger/wasp/packages/webapi/apierrors" "github.com/iotaledger/wasp/packages/webapi/params" @@ -27,6 +28,14 @@ type GovChainInfoResponse struct { MaxEventsPerReq uint16 `json:"maxEventsPerReq" swagger:"desc(The maximum amount of events per request.),required"` // TODO: Clarify } +type GovAllowedStateControllerAddressesResponse struct { + Addresses []string `json:"addresses" swagger:"desc(The allowed state controller addresses (Bech32-encoded))"` +} + +type GovChainOwnerResponse struct { + ChainOwner string `json:"chainOwner" swagger:"desc(The chain owner (Bech32-encoded))"` +} + func MapGovChainInfoResponse(chainInfo *governance.ChainInfo) GovChainInfoResponse { gasFeeTokenID := "" @@ -66,3 +75,45 @@ func (c *Controller) getChainInfo(e echo.Context) error { return e.JSON(http.StatusOK, chainInfoResponse) } + +func (c *Controller) getChainOwner(e echo.Context) error { + chainID, err := params.DecodeChainID(e) + if err != nil { + return err + } + + chainOwner, err := c.governance.GetChainOwner(chainID) + if err != nil { + return apierrors.ContractExecutionError(err) + } + + chainOwnerResponse := GovChainOwnerResponse{ + ChainOwner: chainOwner.String(), + } + + return e.JSON(http.StatusOK, chainOwnerResponse) +} + +func (c *Controller) getAllowedStateControllerAddresses(e echo.Context) error { + chainID, err := params.DecodeChainID(e) + if err != nil { + return err + } + + addresses, err := c.governance.GetAllowedStateControllerAddresses(chainID) + if err != nil { + return apierrors.ContractExecutionError(err) + } + + encodedAddresses := make([]string, len(addresses)) + + for k, v := range addresses { + encodedAddresses[k] = v.Bech32(parameters.L1().Protocol.Bech32HRP) + } + + addressesResponse := GovAllowedStateControllerAddressesResponse{ + Addresses: encodedAddresses, + } + + return e.JSON(http.StatusOK, addressesResponse) +} diff --git a/packages/webapi/models/core_blocklog.go b/packages/webapi/models/core_blocklog.go index 65ee5a5fb2..e4bf952322 100644 --- a/packages/webapi/models/core_blocklog.go +++ b/packages/webapi/models/core_blocklog.go @@ -12,9 +12,9 @@ import ( ) type ControlAddressesResponse struct { - GoverningAddress string `json:"governingAddress" swagger:"required"` - SinceBlockIndex uint32 `json:"sinceBlockIndex" swagger:"required,min(1)"` - StateAddress string `json:"stateAddress" swagger:"required"` + GoverningAddress string `json:"governingAddress" swagger:"required,desc(The governing address (Bech32))"` + SinceBlockIndex uint32 `json:"sinceBlockIndex" swagger:"required,min(1),desc(The block index (uint32)"` + StateAddress string `json:"stateAddress" swagger:"required,desc(The state address (Bech32))"` } type BlockInfoResponse struct { diff --git a/tools/cluster/chain.go b/tools/cluster/chain.go index 90038935f7..6d32deafb6 100644 --- a/tools/cluster/chain.go +++ b/tools/cluster/chain.go @@ -7,8 +7,8 @@ import ( "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/multiclient" "github.com/iotaledger/wasp/clients/scclient" @@ -185,7 +185,7 @@ func (ch *Chain) DeployWasmContract(name, description string, progBinary []byte, func (ch *Chain) GetBlobFieldValue(blobHash hashing.HashValue, field string) ([]byte, error) { v, _, err := ch.Cluster.WaspClient(0).CorecontractsApi. - BlobsGetBlobValue(context.Background(), ch.ChainID.String(), iotago.EncodeHex(blobHash[:]), field). + BlobsGetBlobValue(context.Background(), ch.ChainID.String(), blobHash.Hex(), field). Execute() if err != nil { @@ -255,7 +255,7 @@ func (ch *Chain) GetCounterValue(inccounterSCHname isc.Hname, nodeIndex ...int) return 0, err } - parsedDict, err := clients.APIJsonDictToDict(*result) + parsedDict, err := apiextensions.APIJsonDictToDict(*result) if err != nil { return 0, err } diff --git a/tools/cluster/cluster.go b/tools/cluster/cluster.go index 015c384bdc..da6df2f890 100644 --- a/tools/cluster/cluster.go +++ b/tools/cluster/cluster.go @@ -24,8 +24,8 @@ import ( "github.com/iotaledger/hive.go/core/logger" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/multiclient" "github.com/iotaledger/wasp/packages/apilib" @@ -107,7 +107,7 @@ func (clu *Cluster) L1Client() l1connection.Client { return clu.l1 } -func (clu *Cluster) AddTrustedNode(peerInfo *apiclient.PeeringTrustedNode, onNodes ...[]int) error { +func (clu *Cluster) AddTrustedNode(peerInfo apiclient.PeeringTrustRequest, onNodes ...[]int) error { nodes := clu.Config.AllNodes() if len(onNodes) > 0 { nodes = onNodes[0] @@ -116,10 +116,7 @@ func (clu *Cluster) AddTrustedNode(peerInfo *apiclient.PeeringTrustedNode, onNod for ni := range nodes { var err error if _, err = clu.WaspClient( - nodes[ni]).NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ - PublicKey: *peerInfo.PubKey, - NetId: *peerInfo.NetId, - }).Execute(); err != nil { + nodes[ni]).NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(peerInfo).Execute(); err != nil { return err } } @@ -376,7 +373,7 @@ func (clu *Cluster) MultiClient() *multiclient.MultiClient { } func (clu *Cluster) WaspClientFromHostName(hostName string) *apiclient.APIClient { - client, err := clients.WaspAPIClientByHostName(hostName) + client, err := apiextensions.WaspAPIClientByHostName(hostName) if err != nil { panic(err.Error()) diff --git a/tools/cluster/tests/access_nodes_test.go b/tools/cluster/tests/access_nodes_test.go index bb9933e123..4c3ab152fe 100644 --- a/tools/cluster/tests/access_nodes_test.go +++ b/tools/cluster/tests/access_nodes_test.go @@ -53,12 +53,20 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { // trust setup between the two nodes node0peerInfo, _, err := nodeClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() require.NoError(t, err) - err = clu2.AddTrustedNode(node0peerInfo) + + err = clu2.AddTrustedNode(apiclient.PeeringTrustRequest{ + PublicKey: node0peerInfo.PublicKey, + NetId: node0peerInfo.NetId, + }) require.NoError(t, err) accessNodePeerInfo, _, err := accessNodeClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() require.NoError(t, err) - err = env.Clu.AddTrustedNode(accessNodePeerInfo, []int{0}) + + err = clu2.AddTrustedNode(apiclient.PeeringTrustRequest{ + PublicKey: accessNodePeerInfo.PublicKey, + NetId: accessNodePeerInfo.NetId, + }, []int{0}) require.NoError(t, err) // activate the chain on the access node @@ -69,7 +77,7 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { require.NoError(t, err) // add node 0 from cluster 2 as a *permitionless* access node - err = nodeClient.AddAccessNode(env.Chain.ChainID, accessNodePeerInfo.PubKey) + _, err = nodeClient.ChainsApi.AddAccessNode(context.Background(), env.Chain.ChainID.String(), accessNodePeerInfo.PublicKey).Execute() require.NoError(t, err) // give some time for the access node to sync @@ -93,8 +101,9 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { require.NoError(t, err) // remove the access node from cluster1 node 0 - err = nodeClient.RemoveAccessNode(env.Chain.ChainID, accessNodePeerInfo.PubKey) + _, err = nodeClient.ChainsApi.RemoveAccessNode(context.Background(), env.Chain.ChainID.String(), accessNodePeerInfo.PublicKey).Execute() require.NoError(t, err) + time.Sleep(1 * time.Second) // Access/Server node info is exchanged asynchronously. // try sending the request again @@ -103,8 +112,9 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { // request is not processed after a while time.Sleep(2 * time.Second) - rec, err := nodeClient.RequestReceipt(env.Chain.ChainID, req.ID()) + receipt, _, err := nodeClient.RequestsApi.GetReceipt(context.Background(), env.Chain.ChainID.String(), req.ID().String()).Execute() + require.Error(t, err) require.Regexp(t, `"Code":404`, err.Error()) - require.Nil(t, rec) + require.Nil(t, receipt) } diff --git a/tools/cluster/tests/blob_test.go b/tools/cluster/tests/blob_test.go index 914fc30593..01a538a205 100644 --- a/tools/cluster/tests/blob_test.go +++ b/tools/cluster/tests/blob_test.go @@ -9,64 +9,33 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/clients" - "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/vm/core/blob" ) func (e *ChainEnv) getBlobInfo(hash hashing.HashValue) map[string]uint32 { - args := dict.Dict{ - blob.ParamHash: hash[:], - } - - jsonArgs := clients.JSONDictToAPIJSONDict(args.JSONDict()) - - result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ - ChainId: e.Chain.ChainID.String(), - ContractHName: blob.Contract.Hname().String(), - FunctionHName: blob.ViewGetBlobInfo.Hname().String(), - Arguments: jsonArgs, - }).Execute() + blobInfo, _, err := e.Chain.Cluster.WaspClient().CorecontractsApi. + BlobsGetBlobInfo(context.Background(), e.Chain.ChainID.String(), hash.Hex()). + Execute() - require.NoError(e.t, err) - decodedDict, err := clients.APIJsonDictToDict(*result) require.NoError(e.t, err) - decoded, err := blob.DecodeSizesMap(decodedDict) - require.NoError(e.t, err) - return decoded + return blobInfo.Fields } func (e *ChainEnv) getBlobFieldValue(blobHash hashing.HashValue, field string) []byte { - args := dict.Dict{ - blob.ParamHash: blobHash[:], - blob.ParamField: []byte(field), - } - - jsonArgs := clients.JSONDictToAPIJSONDict(args.JSONDict()) - - result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ - ChainId: e.Chain.ChainID.String(), - ContractHName: blob.Contract.Hname().String(), - FunctionHName: blob.ViewGetBlobField.Hname().String(), - Arguments: jsonArgs, - }).Execute() - - decodedDict, err := clients.APIJsonDictToDict(*result) + blobField, _, err := e.Chain.Cluster.WaspClient().CorecontractsApi. + BlobsGetBlobValue(context.Background(), e.Chain.ChainID.String(), blobHash.Hex(), field). + Execute() require.NoError(e.t, err) - require.NoError(e.t, err) - if decodedDict.IsEmpty() { + if blobField.ValueData == "" { return nil } - ret, err := decodedDict.Get(blob.ParamBytes) - require.NoError(e.t, err) - return ret + return []byte(blobField.ValueData) } // executed in cluster_test.go diff --git a/tools/cluster/tests/deploy_test.go b/tools/cluster/tests/deploy_test.go index cfadd0c2aa..e03860eb65 100644 --- a/tools/cluster/tests/deploy_test.go +++ b/tools/cluster/tests/deploy_test.go @@ -1,11 +1,14 @@ package tests import ( + "context" "testing" "time" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" @@ -40,11 +43,15 @@ func testDeployContractOnly(t *testing.T, env *ChainEnv) { env.deployNativeIncCounterSC() // test calling root.FuncFindContractByName view function using client - ret, err := env.Chain.Cluster.WaspClient(0).CallView( - env.Chain.ChainID, root.Contract.Hname(), root.ViewFindContract.Name, - dict.Dict{ + ret, err := apiextensions.CallView(context.Background(), env.Chain.Cluster.WaspClient(), apiclient.ContractCallViewRequest{ + ChainId: env.Chain.ChainID.String(), + ContractHName: root.Contract.Hname().String(), + FunctionHName: root.ViewFindContract.Hname().String(), + Arguments: apiextensions.DictToAPIJsonDict(dict.Dict{ root.ParamHname: isc.Hn(nativeIncCounterSCName).Bytes(), - }) + }), + }) + require.NoError(t, err) recb, err := ret.Get(root.ParamContractRecData) require.NoError(t, err) diff --git a/tools/cluster/tests/inccounter_test.go b/tools/cluster/tests/inccounter_test.go index 46ca945c96..f96c17327b 100644 --- a/tools/cluster/tests/inccounter_test.go +++ b/tools/cluster/tests/inccounter_test.go @@ -1,11 +1,14 @@ package tests import ( + "context" "testing" "time" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv" @@ -76,7 +79,7 @@ func (e *contractEnv) checkSC(numRequests int) { require.Greater(e.t, blockIndex, uint32(numRequests+4)) cl := e.Chain.SCClient(governance.Contract.Hname(), nil, i) - info, err := cl.CallView(governance.ViewGetChainInfo.Name, nil) + info, err := cl.CallView(context.Background(), governance.ViewGetChainInfo.Name, nil) require.NoError(e.t, err) chainID, err := codec.DecodeChainID(info.MustGet(governance.VarChainID)) @@ -91,7 +94,7 @@ func (e *contractEnv) checkSC(numRequests int) { require.NoError(e.t, err) require.EqualValues(e.t, e.Chain.Description, desc) - recs, err := e.Chain.SCClient(root.Contract.Hname(), nil, i).CallView(root.ViewGetContractRecords.Name, nil) + recs, err := e.Chain.SCClient(root.Contract.Hname(), nil, i).CallView(context.Background(), root.ViewGetContractRecords.Name, nil) require.NoError(e.t, err) contractRegistry, err := root.DecodeContractRegistry(collections.NewMapReadOnly(recs, root.StateVarContractRegistry)) @@ -125,7 +128,7 @@ func testInvalidEntrypoint(t *testing.T, env *ChainEnv) { receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessed(e.Chain.ChainID, tx, 30*time.Second) require.NoError(t, err) require.Equal(t, 1, len(receipts)) - require.Contains(t, receipts[0].ResolvedError, vm.ErrTargetEntryPointNotFound.MessageFormat()) + require.Contains(t, receipts[0].Error.MessageFormat, vm.ErrTargetEntryPointNotFound.MessageFormat()) } e.checkSC(numRequests) @@ -247,9 +250,12 @@ func testIncViewCounter(t *testing.T, env *ChainEnv) { entryPoint := isc.Hn("increment") e.postRequest(incHname, entryPoint, 0, nil) e.checkWasmContractCounter(1) - ret, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, incHname, "getCounter", nil, - ) + + ret, err := apiextensions.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: incHname.String(), + FunctionName: "getCounter", + }) require.NoError(t, err) counter, err := codec.DecodeInt64(ret.MustGet(varCounter), 0) diff --git a/tools/cluster/tests/maintenance_test.go b/tools/cluster/tests/maintenance_test.go index b9d983d27f..fd61127bb1 100644 --- a/tools/cluster/tests/maintenance_test.go +++ b/tools/cluster/tests/maintenance_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "testing" "time" @@ -52,7 +53,8 @@ func testMaintenance(t *testing.T, env *ChainEnv) { // call the gov "maintenance status view", check it is OFF { - ret, err := ownerSCClient.CallView(governance.ViewGetMaintenanceStatus.Name, nil) + //TODO: Add maintenance status to wrapped core contracts + ret, err := ownerSCClient.CallView(context.Background(), governance.ViewGetMaintenanceStatus.Name, nil) require.NoError(t, err) maintenanceStatus := codec.MustDecodeBool(ret.MustGet(governance.VarMaintenanceStatus)) require.False(t, maintenanceStatus) @@ -64,7 +66,7 @@ func testMaintenance(t *testing.T, env *ChainEnv) { require.NoError(t, err) rec, err := env.Clu.MultiClient().WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) require.NoError(t, err) - require.Error(t, rec.Error) + require.NotNil(t, rec.Error) } // owner can start maintenance mode @@ -77,7 +79,7 @@ func testMaintenance(t *testing.T, env *ChainEnv) { // call the gov "maintenance status view", check it is ON { - ret, err := ownerSCClient.CallView(governance.ViewGetMaintenanceStatus.Name, nil) + ret, err := ownerSCClient.CallView(context.Background(), governance.ViewGetMaintenanceStatus.Name, nil) require.NoError(t, err) maintenanceStatus := codec.MustDecodeBool(ret.MustGet(governance.VarMaintenanceStatus)) require.True(t, maintenanceStatus) @@ -135,7 +137,7 @@ func testMaintenance(t *testing.T, env *ChainEnv) { require.NoError(t, err) receipt, err := env.Clu.MultiClient().WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) require.NoError(t, err) - require.Error(t, receipt.Error) + require.NotNil(t, receipt.Error) } // test non-chain owner cannot call stop maintenance @@ -144,7 +146,7 @@ func testMaintenance(t *testing.T, env *ChainEnv) { require.NoError(t, err) rec, err := env.Clu.MultiClient().WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) require.NoError(t, err) - require.Error(t, rec.Error) + require.NotNil(t, rec.Error) } // owner can stop maintenance mode diff --git a/tools/cluster/tests/missing_requests_test.go b/tools/cluster/tests/missing_requests_test.go index 64e71a42e0..b56a6f589a 100644 --- a/tools/cluster/tests/missing_requests_test.go +++ b/tools/cluster/tests/missing_requests_test.go @@ -1,11 +1,13 @@ package tests import ( + "context" "testing" "time" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" @@ -44,18 +46,24 @@ func TestMissingRequests(t *testing.T) { _, err = chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(chainID, reqTx, 30*time.Second) require.NoError(t, err) + // TODO: Validate offleder logic // send off-ledger request to all nodes except #3 req := isc.NewOffLedgerRequest(chainID, nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), dict.Dict{}, 0).Sign(userWallet) - err = clu.WaspClient(0).PostOffLedgerRequest(chainID, req) - require.NoError(t, err) - err = clu.WaspClient(1).PostOffLedgerRequest(chainID, req) + _, err = clu.WaspClient(0).RequestsApi.OffLedger(context.Background()).OffLedgerRequest(apiclient.OffLedgerRequest{ + ChainId: chainID.String(), + Request: req.String(), + }).Execute() require.NoError(t, err) //------ // send a dummy request to node #3, so that it proposes a batch and the consensus hang is broken req2 := isc.NewOffLedgerRequest(chainID, isc.Hn("foo"), isc.Hn("bar"), nil, 1).Sign(userWallet) - err = clu.WaspClient(3).PostOffLedgerRequest(chainID, req2) + + _, err = clu.WaspClient(0).RequestsApi.OffLedger(context.Background()).OffLedgerRequest(apiclient.OffLedgerRequest{ + ChainId: chainID.String(), + Request: req2.String(), + }).Execute() require.NoError(t, err) //------- diff --git a/tools/cluster/tests/offledger_requests_test.go b/tools/cluster/tests/offledger_requests_test.go index f25b44bb9e..2704bd4197 100644 --- a/tools/cluster/tests/offledger_requests_test.go +++ b/tools/cluster/tests/offledger_requests_test.go @@ -1,12 +1,16 @@ package tests import ( + "context" "crypto/rand" "testing" "time" "github.com/stretchr/testify/require" + iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" @@ -46,9 +50,12 @@ func TestOffledgerRequestAccessNode(t *testing.T) { waitUntil(t, e.counterEquals(43), clu.Config.AllNodes(), 30*time.Second) // check off-ledger request was successfully processed (check by asking another access node) - ret, err := clu.WaspClient(6).CallView( - e.Chain.ChainID, nativeIncCounterSCHname, inccounter.ViewGetCounter.Name, nil, - ) + ret, err := apiextensions.CallView(context.Background(), clu.WaspClient(6), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: nativeIncCounterSCHname.String(), + FunctionHName: inccounter.ViewGetCounter.Hname().String(), + }) + require.NoError(t, err) resultint64, _ := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter)) require.EqualValues(t, 43, resultint64) @@ -69,10 +76,12 @@ func testOffledgerRequest(t *testing.T, e *ChainEnv) { _, err = e.Chain.CommitteeMultiClient().WaitUntilRequestProcessedSuccessfully(e.Chain.ChainID, offledgerReq.ID(), 30*time.Second) require.NoError(t, err) - // check off-ledger request was successfully processed - ret, err := e.Chain.Cluster.WaspClient(0).CallView( - e.Chain.ChainID, nativeIncCounterSCHname, inccounter.ViewGetCounter.Name, nil, - ) + ret, err := apiextensions.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: e.Chain.ChainID.String(), + ContractHName: nativeIncCounterSCHname.String(), + FunctionHName: inccounter.ViewGetCounter.Hname().String(), + }) + require.NoError(t, err) resultint64, err := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter)) require.NoError(t, err) @@ -104,14 +113,12 @@ func testOffledgerRequest900KB(t *testing.T, e *ChainEnv) { require.NoError(t, err) // ensure blob was stored by the cluster - res, err := e.Chain.Cluster.WaspClient(2).CallView( - e.Chain.ChainID, blob.Contract.Hname(), blob.ViewGetBlobField.Name, - dict.Dict{ - blob.ParamHash: expectedHash[:], - blob.ParamField: []byte("data"), - }) + res, _, err := e.Chain.Cluster.WaspClient(2).CorecontractsApi. + BlobsGetBlobValue(context.Background(), e.Chain.ChainID.String(), expectedHash.Hex(), "data"). + Execute() require.NoError(t, err) - binaryData, err := res.Get(blob.ParamBytes) + + binaryData, err := iotago.DecodeHex(res.ValueData) require.NoError(t, err) require.EqualValues(t, binaryData, randomData) } @@ -192,9 +199,14 @@ func newWalletWithFunds(e *ChainEnv, waspnode int, waitOnNodes ...int) *chaincli Transfer: isc.NewAssetsBaseTokens(baseTokes), }) require.NoError(e.t, err) + receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, reqTx, 30*time.Second) require.NoError(e.t, err) - expectedBaseTokens := baseTokes - receipts[0].GasFeeCharged + + gasFeeCharged, err := iotago.DecodeUint64(receipts[0].GasFeeCharged) + require.NoError(e.t, err) + + expectedBaseTokens := baseTokes - gasFeeCharged e.checkBalanceOnChain(userAgentID, isc.BaseTokenID, expectedBaseTokens) // wait until access node syncs with account diff --git a/tools/cluster/tests/post_test.go b/tools/cluster/tests/post_test.go index 452f73dd5b..ebdbf7a677 100644 --- a/tools/cluster/tests/post_test.go +++ b/tools/cluster/tests/post_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" @@ -51,23 +51,16 @@ func deployInccounter42(e *ChainEnv) *isc.ContractAgentID { require.EqualValues(e.t, 42, counterValue) } - args := dict.Dict{ - root.ParamHname: hname.Bytes(), - } - - jsonArgs := clients.JSONDictToAPIJSONDict(args.JSONDict()) - - result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + result, err := apiextensions.CallView(context.Background(), e.Chain.Cluster.WaspClient(), apiclient.ContractCallViewRequest{ ChainId: e.Chain.ChainID.String(), ContractHName: root.Contract.Hname().String(), FunctionHName: root.ViewFindContract.Hname().String(), - Arguments: jsonArgs, - }).Execute() - - decodedDict, err := clients.APIJsonDictToDict(*result) - require.NoError(e.t, err) + Arguments: apiextensions.DictToAPIJsonDict(dict.Dict{ + root.ParamHname: hname.Bytes(), + }), + }) - recb, err := decodedDict.Get(root.ParamContractRecData) + recb, err := result.Get(root.ParamContractRecData) require.NoError(e.t, err) rec, err := root.ContractRecordFromBytes(recb) @@ -94,7 +87,7 @@ func (e *ChainEnv) getCounterForNode(hname isc.Hname, nodeIndex int) int64 { FunctionName: "getCounter", }).Execute() - decodedDict, err := clients.APIJsonDictToDict(*result) + decodedDict, err := apiextensions.APIJsonDictToDict(*result) require.NoError(e.t, err) counter, err := codec.DecodeInt64(decodedDict.MustGet(inccounter.VarCounter), 0) @@ -197,9 +190,14 @@ func testPost5Requests(t *testing.T, e *ChainEnv) { Transfer: isc.NewAssets(baseTokesSent, nil), }) require.NoError(t, err) + receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, tx, 30*time.Second) require.NoError(t, err) - onChainBalance += baseTokesSent - uint64(receipts[0].GasFeeCharged) + + gasFeeCharged, err := iotago.DecodeUint64(receipts[0].GasFeeCharged) + require.NoError(t, err) + + onChainBalance += baseTokesSent - gasFeeCharged } e.expectCounter(contractID.Hname(), 42+5) @@ -232,7 +230,11 @@ func testPost5AsyncRequests(t *testing.T, e *ChainEnv) { for i := 0; i < 5; i++ { receipts, err := e.Chain.CommitteeMultiClient().WaitUntilAllRequestsProcessedSuccessfully(e.Chain.ChainID, tx[i], 30*time.Second) require.NoError(t, err) - onChainBalance += baseTokesSent - uint64(receipts[0].GasFeeCharged) + + gasFeeCharged, err := iotago.DecodeUint64(receipts[0].GasFeeCharged) + require.NoError(t, err) + + onChainBalance += baseTokesSent - gasFeeCharged } e.expectCounter(contractID.Hname(), 42+5) diff --git a/tools/cluster/tests/reboot_test.go b/tools/cluster/tests/reboot_test.go index 8acdcf512f..a302cd44bb 100644 --- a/tools/cluster/tests/reboot_test.go +++ b/tools/cluster/tests/reboot_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "testing" "time" @@ -8,6 +9,8 @@ import ( "github.com/samber/lo" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/contracts/native/inccounter" @@ -27,27 +30,34 @@ func TestReboot(t *testing.T) { client := env.createNewClient() // ------ TODO why does this make the test fail? - er := env.Clu.WaspClient(0).DeactivateChain(env.Chain.ChainID) + _, er := env.Clu.WaspClient(0).ChainsApi.DeactivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) - er = env.Clu.WaspClient(0).ActivateChain(env.Chain.ChainID) + _, er = env.Clu.WaspClient(0).ChainsApi.ActivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) - er = env.Clu.WaspClient(1).DeactivateChain(env.Chain.ChainID) + _, er = env.Clu.WaspClient(1).ChainsApi.DeactivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) - er = env.Clu.WaspClient(1).ActivateChain(env.Chain.ChainID) + _, er = env.Clu.WaspClient(1).ChainsApi.ActivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) //------- tx, err := client.PostRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilAllRequestsProcessed(env.Chain.ChainID, tx, 10*time.Second) + + _, err = apiextensions.APIWaitUntilAllRequestsProcessed(env.Clu.WaspClient(0), env.Chain.ChainID, tx, 10*time.Second) require.NoError(t, err) + env.expectCounter(nativeIncCounterSCHname, 1) req, err := client.PostOffLedgerRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) + + _, _, err = env.Clu.WaspClient(0).RequestsApi. + WaitForRequest(context.Background(), env.Chain.ChainID.String(), req.ID().String()). + TimeoutSeconds(10). + Execute() require.NoError(t, err) + env.expectCounter(nativeIncCounterSCHname, 2) // // ------ TODO why does this make the test fail? @@ -75,13 +85,19 @@ func TestReboot(t *testing.T) { // after rebooting, the chain should resume processing requests without issues tx, err = client.PostRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilAllRequestsProcessed(env.Chain.ChainID, tx, 10*time.Second) + + _, err = apiextensions.APIWaitUntilAllRequestsProcessed(env.Clu.WaspClient(0), env.Chain.ChainID, tx, 10*time.Second) require.NoError(t, err) env.expectCounter(nativeIncCounterSCHname, 3) + // ensure offledger requests are still working req, err = client.PostOffLedgerRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) + + _, _, err = env.Clu.WaspClient(0).RequestsApi. + WaitForRequest(context.Background(), env.Chain.ChainID.String(), req.ID().String()). + TimeoutSeconds(10). + Execute() require.NoError(t, err) env.expectCounter(nativeIncCounterSCHname, 4) } @@ -93,25 +109,33 @@ func TestReboot2(t *testing.T) { tx, err := client.PostRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilAllRequestsProcessed(env.Chain.ChainID, tx, 10*time.Second) + + _, err = apiextensions.APIWaitUntilAllRequestsProcessed(env.Clu.WaspClient(0), env.Chain.ChainID, tx, 10*time.Second) require.NoError(t, err) + env.expectCounter(nativeIncCounterSCHname, 1) req, err := client.PostOffLedgerRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) + + _, _, err = env.Clu.WaspClient(0).RequestsApi. + WaitForRequest(context.Background(), env.Chain.ChainID.String(), req.ID().String()). + TimeoutSeconds(10). + Execute() require.NoError(t, err) + env.expectCounter(nativeIncCounterSCHname, 2) // ------ TODO why does this make the test fail? - er := env.Clu.WaspClient(0).DeactivateChain(env.Chain.ChainID) + _, er := env.Clu.WaspClient(0).ChainsApi.DeactivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) - er = env.Clu.WaspClient(0).ActivateChain(env.Chain.ChainID) + + _, er = env.Clu.WaspClient(0).ChainsApi.ActivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) - er = env.Clu.WaspClient(1).DeactivateChain(env.Chain.ChainID) + _, er = env.Clu.WaspClient(1).ChainsApi.DeactivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) - er = env.Clu.WaspClient(1).ActivateChain(env.Chain.ChainID) + _, er = env.Clu.WaspClient(1).ChainsApi.ActivateChain(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, er) //------- @@ -140,14 +164,21 @@ func TestReboot2(t *testing.T) { // after rebooting, the chain should resume processing requests without issues tx, err = client.PostRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilAllRequestsProcessed(env.Chain.ChainID, tx, 10*time.Second) + + _, err = apiextensions.APIWaitUntilAllRequestsProcessed(env.Clu.WaspClient(0), env.Chain.ChainID, tx, 10*time.Second) require.NoError(t, err) + env.expectCounter(nativeIncCounterSCHname, 3) // ensure off-ledger requests are still working req, err = client.PostOffLedgerRequest(inccounter.FuncIncCounter.Name) require.NoError(t, err) - _, err = env.Clu.WaspClient(0).WaitUntilRequestProcessed(env.Chain.ChainID, req.ID(), 10*time.Second) + + _, _, err = env.Clu.WaspClient(0).RequestsApi. + WaitForRequest(context.Background(), env.Chain.ChainID.String(), req.ID().String()). + TimeoutSeconds(10). + Execute() require.NoError(t, err) + env.expectCounter(nativeIncCounterSCHname, 4) } @@ -165,8 +196,10 @@ func newIncCounterClient(t *testing.T, env *ChainEnv, client *scclient.SCClient) func (icc *incCounterClient) MustIncOnLedger() { tx, err := icc.client.PostRequest(inccounter.FuncIncCounter.Name) require.NoError(icc.t, err) - _, err = icc.env.Clu.WaspClient(0).WaitUntilAllRequestsProcessed(icc.env.Chain.ChainID, tx, 10*time.Second) + + _, err = apiextensions.APIWaitUntilAllRequestsProcessed(icc.env.Clu.WaspClient(0), icc.env.Chain.ChainID, tx, 10*time.Second) require.NoError(icc.t, err) + icc.expected++ icc.env.expectCounter(nativeIncCounterSCHname, icc.expected) } @@ -174,8 +207,13 @@ func (icc *incCounterClient) MustIncOnLedger() { func (icc *incCounterClient) MustIncOffLedger() { req, err := icc.client.PostOffLedgerRequest(inccounter.FuncIncCounter.Name) require.NoError(icc.t, err) - _, err = icc.env.Clu.WaspClient(0).WaitUntilRequestProcessed(icc.env.Chain.ChainID, req.ID(), 10*time.Second) + + _, _, err = icc.env.Clu.WaspClient(0).RequestsApi. + WaitForRequest(context.Background(), icc.env.Chain.ChainID.String(), req.ID().String()). + TimeoutSeconds(10). + Execute() require.NoError(icc.t, err) + icc.expected++ icc.env.expectCounter(nativeIncCounterSCHname, icc.expected) } @@ -284,15 +322,18 @@ func TestRebootDuringTasks(t *testing.T) { require.NoError(t, err) time.Sleep(20 * time.Second) - // after rebooting, the chain should resume processing requests/views without issues - ret, err := env.Clu.WaspClient(0).CallView( - env.Chain.ChainID, nativeIncCounterSCHname, inccounter.ViewGetCounter.Name, nil, - ) - require.NoError(t, err) - counter, err := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter), 0) - require.NoError(t, err) - require.Greater(t, counter, lastCounter) - lastCounter = counter + // after rebooting, the chain should resume processing requests/views without issues + ret, err := apiextensions.CallView(context.Background(), env.Clu.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: env.Chain.ChainID.String(), + ContractHName: nativeIncCounterSCHname.String(), + FunctionHName: inccounter.ViewGetCounter.Hname().String(), + }) + require.NoError(t, err) + + counter, err := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter), 0) + require.NoError(t, err) + require.Greater(t, counter, lastCounter) + lastCounter = counter // assert the node still processes on/off-ledger requests keyPair2, _, err := env.Clu.NewKeyPairWithFunds() diff --git a/tools/cluster/tests/rotation_test.go b/tools/cluster/tests/rotation_test.go index 5fe57e0b9d..b46c1c3361 100644 --- a/tools/cluster/tests/rotation_test.go +++ b/tools/cluster/tests/rotation_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "testing" "time" @@ -13,10 +14,8 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/isc/coreutil" "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/collections" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/testutil" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/vm/core/governance" "github.com/iotaledger/wasp/tools/cluster" ) @@ -323,18 +322,14 @@ func (e *ChainEnv) waitStateController(nodeIndex int, addr iotago.Address, timeo } func (e *ChainEnv) callGetStateController(nodeIndex int) (iotago.Address, error) { - ret, err := e.Chain.Cluster.WaspClient(nodeIndex).CallView( - e.Chain.ChainID, - blocklog.Contract.Hname(), - blocklog.ViewControlAddresses.Name, - nil, - ) - if err != nil { - return nil, err - } - addr, err := codec.DecodeAddress(ret.MustGet(blocklog.ParamStateControllerAddress)) + controlAddresses, _, err := e.Chain.Cluster.WaspClient(nodeIndex).CorecontractsApi. + BlocklogGetControlAddresses(context.Background(), e.Chain.ChainID.String()). + Execute() + + _, address, err := iotago.ParseBech32(controlAddresses.StateAddress) require.NoError(e.t, err) - return addr, nil + + return address, nil } func (e *ChainEnv) checkAllowedStateControllerAddressInAllNodes(addr iotago.Address) error { @@ -347,24 +342,23 @@ func (e *ChainEnv) checkAllowedStateControllerAddressInAllNodes(addr iotago.Addr } func isAllowedStateControllerAddress(t *testing.T, chain *cluster.Chain, nodeIndex int, addr iotago.Address) bool { - ret, err := chain.Cluster.WaspClient(nodeIndex).CallView( - chain.ChainID, - governance.Contract.Hname(), - governance.ViewGetAllowedStateControllerAddresses.Name, - nil, - ) + addresses, _, err := chain.Cluster.WaspClient(nodeIndex).CorecontractsApi. + GovernanceGetAllowedStateControllerAddresses(context.Background(), chain.ChainID.String()). + Execute() require.NoError(t, err) - arr := collections.NewArray16ReadOnly(ret, governance.ParamAllowedStateControllerAddresses) - arrlen := arr.MustLen() - if arrlen == 0 { + + if len(addresses.Addresses) == 0 { return false } - for i := uint16(0); i < arrlen; i++ { - a, err := codec.DecodeAddress(arr.MustGetAt(i)) + + for _, addressBech32 := range addresses.Addresses { + _, address, err := iotago.ParseBech32(addressBech32) require.NoError(t, err) - if a.Equal(addr) { + + if address.Equal(addr) { return true } } + return false } diff --git a/tools/cluster/tests/spam_test.go b/tools/cluster/tests/spam_test.go index e55b641606..d544f6af12 100644 --- a/tools/cluster/tests/spam_test.go +++ b/tools/cluster/tests/spam_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "errors" "fmt" "sync" @@ -14,11 +15,8 @@ import ( "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/testutil" "github.com/iotaledger/wasp/packages/utxodb" - "github.com/iotaledger/wasp/packages/vm/core/blocklog" - "github.com/iotaledger/wasp/packages/vm/core/testcore" ) // executed in cluster_test.go @@ -85,11 +83,10 @@ func testSpamOnledger(t *testing.T, env *ChainEnv) { waitUntil(t, env.counterEquals(int64(numRequests)), []int{0}, 5*time.Minute) - res, err := env.Chain.Cluster.WaspClient(0).CallView(env.Chain.ChainID, blocklog.Contract.Hname(), blocklog.ViewGetEventsForBlock.Name, dict.Dict{}) + res, _, err := env.Chain.Cluster.WaspClient(0).CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, err) - events, err := testcore.EventsViewResultToStringArray(res) - require.NoError(t, err) - println(events) + + println(res.Events) } // executed in cluster_test.go @@ -165,11 +162,10 @@ func testSpamOffLedger(t *testing.T, env *ChainEnv) { waitUntil(t, env.counterEquals(int64(numRequests)), []int{0}, 5*time.Minute) - res, err := env.Chain.Cluster.WaspClient(0).CallView(env.Chain.ChainID, blocklog.Contract.Hname(), blocklog.ViewGetEventsForBlock.Name, dict.Dict{}) + res, _, err := env.Chain.Cluster.WaspClient(0).CorecontractsApi.BlocklogGetEventsOfLatestBlock(context.Background(), env.Chain.ChainID.String()).Execute() require.NoError(t, err) - events, err := testcore.EventsViewResultToStringArray(res) - require.NoError(t, err) - require.Regexp(t, fmt.Sprintf("counter = %d", numRequests), events[len(events)-1]) + + require.Regexp(t, fmt.Sprintf("counter = %d", numRequests), res.Events[len(res.Events)-1]) avgProcessingDuration := processingDurationsSum / numRequests fmt.Printf("avg processing duration: %ds\n max: %ds\n", avgProcessingDuration, maxProcessingDuration) } @@ -194,7 +190,7 @@ func testSpamCallViewWasm(t *testing.T, env *ChainEnv) { for i := 0; i < n; i++ { go func() { - r, err := client.CallView("getCounter", nil) + r, err := client.CallView(context.Background(), "getCounter", nil) if err != nil { ch <- err return diff --git a/tools/cluster/tests/transfer_test.go b/tools/cluster/tests/transfer_test.go index 6b5156ef92..1074deacf3 100644 --- a/tools/cluster/tests/transfer_test.go +++ b/tools/cluster/tests/transfer_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/utxodb" @@ -48,7 +49,9 @@ func TestDepositWithdraw(t *testing.T) { chEnv.checkLedger() // chEnv.checkBalanceOnChain(origAgentID, isc.BaseTokenID, 0) - gasFees1 := receipts[0].GasFeeCharged + gasFees1, err := iotago.DecodeUint64(receipts[0].GasFeeCharged) + require.NoError(t, err) + onChainBalance := depositBaseTokens - gasFees1 chEnv.checkBalanceOnChain(myAgentID, isc.BaseTokenID, onChainBalance) @@ -68,7 +71,9 @@ func TestDepositWithdraw(t *testing.T) { require.NoError(t, err) chEnv.checkLedger() - gasFees2 := receipt.GasFeeCharged + gasFees2, err := iotago.DecodeUint64(receipt.GasFeeCharged) + require.NoError(t, err) + chEnv.checkBalanceOnChain(myAgentID, isc.BaseTokenID, onChainBalance-baseTokensToWithdraw-gasFees2) require.True(t, e.Clu.AssertAddressBalances(myAddress, isc.NewAssetsBaseTokens(utxodb.FundsFromFaucetAmount-depositBaseTokens+baseTokensToWithdraw)), diff --git a/tools/cluster/tests/util.go b/tools/cluster/tests/util.go index ce6646b1aa..c59b748cc6 100644 --- a/tools/cluster/tests/util.go +++ b/tools/cluster/tests/util.go @@ -9,15 +9,14 @@ import ( "github.com/stretchr/testify/require" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/collections" "github.com/iotaledger/wasp/packages/kv/dict" "github.com/iotaledger/wasp/packages/parameters" - "github.com/iotaledger/wasp/packages/vm/core/accounts" "github.com/iotaledger/wasp/packages/vm/core/corecontracts" "github.com/iotaledger/wasp/packages/vm/core/governance" "github.com/iotaledger/wasp/packages/vm/core/root" @@ -79,33 +78,29 @@ func (e *ChainEnv) getBalanceOnChain(agentID isc.AgentID, assetID []byte, nodeIn idx = nodeIndex[0] } - args := dict.Dict{ - accounts.ParamAgentID: agentID.Bytes(), - } - - ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(idx), apiclient.ContractCallViewRequest{ - ChainId: e.Chain.ChainID.String(), - ContractHName: accounts.Contract.Hname().String(), - FunctionHName: accounts.ViewBalance.Hname().String(), - Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), - }) - - if err != nil { - return 0 - } + balance, _, err := e.Chain.Cluster.WaspClient(idx).CorecontractsApi. + AccountsGetAccountBalance(context.Background(), e.Chain.ChainID.String(), agentID.String()). + Execute() + require.NoError(e.t, err) - actual, err := isc.AssetsFromDict(ret) + assets, err := apiextensions.NewAssetsFromAPIResponse(balance) require.NoError(e.t, err) if bytes.Equal(assetID, isc.BaseTokenID) { - return actual.BaseTokens + return assets.BaseTokens } - nativeTokensSet, err := actual.NativeTokens.Set() - require.NoError(e.t, err) nativeTokenID, err := isc.NativeTokenIDFromBytes(assetID) require.NoError(e.t, err) - return nativeTokensSet[nativeTokenID].Amount.Uint64() + + for _, nativeToken := range assets.NativeTokens { + if nativeToken.ID.Matches(nativeTokenID) { + // TODO: Validate bigint to uint64 behavior + return nativeToken.Amount.Uint64() + } + } + //TODO: Throw error when native token id wasn't found? + return 0 } func (e *ChainEnv) checkBalanceOnChain(agentID isc.AgentID, assetID []byte, expected uint64) { @@ -114,7 +109,10 @@ func (e *ChainEnv) checkBalanceOnChain(agentID isc.AgentID, assetID []byte, expe } func (e *ChainEnv) getAccountsOnChain() []isc.AgentID { - accounts, _, err := e.Chain.Cluster.WaspClient(0).CorecontractsApi.AccountsGetAccounts(context.Background(), e.Chain.ChainID.String()).Execute() + accounts, _, err := e.Chain.Cluster.WaspClient(0).CorecontractsApi. + AccountsGetAccounts(context.Background(), e.Chain.ChainID.String()). + Execute() + require.NoError(e.t, err) ret := make([]isc.AgentID, 0) @@ -132,43 +130,31 @@ func (e *ChainEnv) getAccountsOnChain() []isc.AgentID { func (e *ChainEnv) getBalancesOnChain() map[string]*isc.Assets { ret := make(map[string]*isc.Assets) acc := e.getAccountsOnChain() - for _, agentID := range acc { - args := dict.Dict{ - accounts.ParamAgentID: agentID.Bytes(), - } - - // TODO: Validate with develop - r, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ - ChainId: e.Chain.ChainID.String(), - ContractHName: accounts.Contract.Hname().String(), - FunctionHName: accounts.ViewBalance.Hname().String(), - Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), - }) + for _, agentID := range acc { + balance, _, err := e.Chain.Cluster.WaspClient().CorecontractsApi. + AccountsGetAccountBalance(context.Background(), e.Chain.ChainID.String(), agentID.String()). + Execute() require.NoError(e.t, err) - ret[string(agentID.Bytes())], err = isc.AssetsFromDict(r) - + assets, err := apiextensions.NewAssetsFromAPIResponse(balance) require.NoError(e.t, err) + + ret[string(agentID.Bytes())] = assets } return ret } func (e *ChainEnv) getTotalBalance() *isc.Assets { - r, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ - ChainId: e.Chain.ChainID.String(), - ContractHName: accounts.Contract.Hname().String(), - FunctionHName: accounts.ViewTotalAssets.Hname().String(), - }) - - if err != nil { - return nil - } - + totalAssets, _, err := e.Chain.Cluster.WaspClient().CorecontractsApi. + AccountsGetTotalAssets(context.Background(), e.Chain.ChainID.String()). + Execute() require.NoError(e.t, err) - ret, err := isc.AssetsFromDict(r) + + assets, err := apiextensions.NewAssetsFromAPIResponse(totalAssets) require.NoError(e.t, err) - return ret + + return assets } func (e *ChainEnv) printAccounts(title string) { @@ -193,19 +179,17 @@ func (e *ChainEnv) checkLedger() { } func (e *ChainEnv) getChainInfo() (isc.ChainID, isc.AgentID) { - ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(0), apiclient.ContractCallViewRequest{ - ChainId: e.Chain.ChainID.String(), - ContractHName: governance.Contract.Hname().String(), - FunctionHName: governance.ViewGetChainInfo.Hname().String(), - }) - + chainInfo, _, err := e.Chain.Cluster.WaspClient(0).ChainsApi. + GetChainInfo(context.Background(), e.Chain.ChainID.String()). + Execute() require.NoError(e.t, err) - chainID, err := codec.DecodeChainID(ret.MustGet(governance.VarChainID)) + chainID, err := isc.ChainIDFromString(chainInfo.ChainID) require.NoError(e.t, err) - ownerID, err := codec.DecodeAgentID(ret.MustGet(governance.VarChainOwnerID)) + ownerID, err := isc.NewAgentIDFromString(chainInfo.ChainOwnerId) require.NoError(e.t, err) + return chainID, ownerID } @@ -222,11 +206,11 @@ func (e *ChainEnv) findContract(name string, nodeIndex ...int) (*root.ContractRe } // TODO: Validate with develop - ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(i), apiclient.ContractCallViewRequest{ + ret, err := apiextensions.CallView(context.Background(), e.Chain.Cluster.WaspClient(i), apiclient.ContractCallViewRequest{ ChainId: e.Chain.ChainID.String(), ContractHName: root.Contract.Hname().String(), FunctionHName: root.ViewFindContract.Hname().String(), - Arguments: clients.JSONDictToAPIJSONDict(args.JSONDict()), + Arguments: apiextensions.JSONDictToAPIJSONDict(args.JSONDict()), }) require.NoError(e.t, err) @@ -235,6 +219,7 @@ func (e *ChainEnv) findContract(name string, nodeIndex ...int) (*root.ContractRe if err != nil { return nil, err } + return root.ContractRecordFromBytes(recBin) } @@ -257,12 +242,12 @@ func waitTrue(timeout time.Duration, fun func() bool) bool { func (e *ChainEnv) counterEquals(expected int64) conditionFn { return func(t *testing.T, nodeIndex int) bool { - ret, err := clients.CallView(context.Background(), e.Chain.Cluster.WaspClient(nodeIndex), apiclient.ContractCallViewRequest{ + ret, err := apiextensions.CallView(context.Background(), e.Chain.Cluster.WaspClient(nodeIndex), apiclient.ContractCallViewRequest{ ChainId: e.Chain.ChainID.String(), ContractHName: nativeIncCounterSCHname.String(), FunctionHName: inccounter.ViewGetCounter.Hname().String(), }) - + if err != nil { e.t.Logf("chainEnv::counterEquals: failed to call GetCounter: %v", err) return false diff --git a/tools/cluster/tests/wasp-cli_rotation_test.go b/tools/cluster/tests/wasp-cli_rotation_test.go index 979e15b5b8..15a3022e66 100644 --- a/tools/cluster/tests/wasp-cli_rotation_test.go +++ b/tools/cluster/tests/wasp-cli_rotation_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "regexp" "strings" @@ -9,6 +10,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/cryptolib" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/vm/core/governance" @@ -82,23 +84,33 @@ func testWaspCLIExternalRotation(t *testing.T, addAccessNode func(*WaspCLITest, // adds node #0 from cluster2 as access node of the chain { - node0peerInfo, err := w2.Cluster.WaspClient(0).GetPeeringSelf() + node0peerInfo, _, err := w2.Cluster.WaspClient(0).NodeApi. + GetPeeringIdentity(context.Background()). + Execute() require.NoError(t, err) // set trust relations between node0 of cluster 2 and all nodes of cluster 1 - w.Cluster.AddTrustedNode(node0peerInfo) + err = w.Cluster.AddTrustedNode(apiclient.PeeringTrustRequest{ + PublicKey: node0peerInfo.PublicKey, + NetId: node0peerInfo.NetId, + }) + require.NoError(t, err) + cluster1PubKeys := make([]*cryptolib.PublicKey, len(w.Cluster.AllNodes())) for _, nodeIndex := range w.Cluster.Config.AllNodes() { // equivalent of "wasp-cli peer info" - peerInfo, err := w.Cluster.WaspClient(nodeIndex).GetPeeringSelf() + peerInfo, _, err := w.Cluster.WaspClient(nodeIndex).NodeApi. + GetPeeringIdentity(context.Background()). + Execute() require.NoError(t, err) - w2.MustRun("peering", "trust", peerInfo.PubKey, peerInfo.NetID) - cluster1PubKeys[nodeIndex], err = cryptolib.NewPublicKeyFromString(peerInfo.PubKey) + + w2.MustRun("peering", "trust", peerInfo.PublicKey, peerInfo.NetId) + cluster1PubKeys[nodeIndex], err = cryptolib.NewPublicKeyFromString(peerInfo.PublicKey) require.NoError(t, err) } // add node 0 from cluster 2 as an access node in the governance contract - pubKey, err := cryptolib.NewPublicKeyFromString(node0peerInfo.PubKey) + pubKey, err := cryptolib.NewPublicKeyFromString(node0peerInfo.PublicKey) require.NoError(t, err) addAccessNode(w, pubKey.String()) diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index 555730f288..da00d13e9b 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -7,8 +7,8 @@ import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" @@ -82,7 +82,7 @@ func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { kind = "off-ledger" } - args, err := clients.APIJsonDictToDict(req.Params) + args, err := apiextensions.APIJsonDictToDict(req.Params) log.Check(err) var argsTree interface{} = "(empty)" diff --git a/tools/wasp-cli/chain/callview.go b/tools/wasp-cli/chain/callview.go index 78905396da..530033c2ee 100644 --- a/tools/wasp-cli/chain/callview.go +++ b/tools/wasp-cli/chain/callview.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" @@ -30,11 +30,11 @@ func initCallViewCmd() *cobra.Command { ChainId: config.GetCurrentChainID().String(), ContractName: contractName, FunctionName: funcName, - Arguments: clients.JSONDictToAPIJSONDict(params.JSONDict()), + Arguments: apiextensions.JSONDictToAPIJSONDict(params.JSONDict()), }).Execute() log.Check(err) - decodedResult, err := clients.APIJsonDictToDict(*result) + decodedResult, err := apiextensions.APIJsonDictToDict(*result) log.Check(err) util.PrintDictAsJSON(decodedResult) diff --git a/tools/wasp-cli/chain/rotate.go b/tools/wasp-cli/chain/rotate.go index 025fcacfdf..9b53e76090 100644 --- a/tools/wasp-cli/chain/rotate.go +++ b/tools/wasp-cli/chain/rotate.go @@ -14,7 +14,7 @@ import ( "github.com/iotaledger/wasp/packages/transaction" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" + cliwallet "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -31,7 +31,7 @@ func initRotateCmd() *cobra.Command { log.Fatalf("unexpected prefix. expected: %s, actual: %s", parameters.L1().Protocol.Bech32HRP, prefix) } - wallet := wallet.Load() + wallet := cliwallet.Load() aliasID := config.GetCurrentChainID().AsAliasID() chainOutputID, chainOutput, err := l1Client.GetAliasOutput(aliasID) diff --git a/tools/wasp-cli/cli/cliclients/clients.go b/tools/wasp-cli/cli/cliclients/clients.go index 0eeff53ed9..58d2a97b4c 100644 --- a/tools/wasp-cli/cli/cliclients/clients.go +++ b/tools/wasp-cli/cli/cliclients/clients.go @@ -1,8 +1,8 @@ package cliclients import ( - "github.com/iotaledger/wasp/clients" "github.com/iotaledger/wasp/clients/apiclient" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/clients/scclient" "github.com/iotaledger/wasp/packages/isc" @@ -16,7 +16,7 @@ func WaspClientForHostName(apiAddress string) *apiclient.APIClient { L1Client() // this will fill parameters.L1() with data from the L1 node log.Verbosef("using Wasp host %s\n", apiAddress) - client, err := clients.WaspAPIClientByHostName(apiAddress) + client, err := apiextensions.WaspAPIClientByHostName(apiAddress) log.Check(err) client.GetConfig().AddDefaultHeader("Authorization", "Bearer "+config.GetToken()) diff --git a/tools/wasp-cli/util/tx.go b/tools/wasp-cli/util/tx.go index 71910b6bfd..3b3056eb14 100644 --- a/tools/wasp-cli/util/tx.go +++ b/tools/wasp-cli/util/tx.go @@ -6,7 +6,7 @@ import ( "time" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/clients" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" @@ -37,7 +37,7 @@ func WithSCTransaction(chainID isc.ChainID, f func() (*iotago.Transaction, error if config.WaitForCompletion || len(forceWait) > 0 { log.Printf("Waiting for tx requests to be processed...\n") client := cliclients.WaspClientForIndex() - _, err := clients.APIWaitUntilAllRequestsProcessed(client, chainID, tx, 1*time.Minute) + _, err := apiextensions.APIWaitUntilAllRequestsProcessed(client, chainID, tx, 1*time.Minute) log.Check(err) } diff --git a/tools/wasp-cli/wallet/info.go b/tools/wasp-cli/wallet/info.go index 5ba4254c03..335363ffca 100644 --- a/tools/wasp-cli/wallet/info.go +++ b/tools/wasp-cli/wallet/info.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" + cliwallet "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) @@ -17,8 +17,7 @@ func initAddressCmd() *cobra.Command { Short: "Show the wallet address", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - wallet := wallet.Load() - + wallet := cliwallet.Load() address := wallet.Address() model := &AddressModel{Address: address.Bech32(parameters.L1().Protocol.Bech32HRP)} @@ -59,7 +58,7 @@ func initBalanceCmd() *cobra.Command { Short: "Show the wallet balance", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - wallet := wallet.Load() + wallet := cliwallet.Load() address := wallet.Address() outs, err := cliclients.L1Client().OutputMap(address) diff --git a/tools/wasp-cli/wallet/send.go b/tools/wasp-cli/wallet/send.go index a2b104ce1c..3d1f578223 100644 --- a/tools/wasp-cli/wallet/send.go +++ b/tools/wasp-cli/wallet/send.go @@ -7,7 +7,7 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/transaction" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" - "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" + cliwallet "github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet" "github.com/iotaledger/wasp/tools/wasp-cli/log" "github.com/iotaledger/wasp/tools/wasp-cli/util" ) @@ -28,7 +28,7 @@ func initSendFundsCmd() *cobra.Command { log.Printf("\nSending \n\t%v \n\tto: %v\n\n", tokens, args[0]) - wallet := wallet.Load() + wallet := cliwallet.Load() senderAddress := wallet.Address() client := cliclients.L1Client() From 371ae371148f332b0ab9f029ae18295c5171dad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Tue, 7 Feb 2023 14:46:45 +0100 Subject: [PATCH 26/39] Update API, fix cluster tests --- clients/apiclient/api/openapi.yaml | 191 +- clients/apiclient/api_admin.go | 2350 ----------------- clients/apiclient/api_chains.go | 274 +- clients/apiclient/api_corecontracts.go | 56 +- clients/apiclient/api_metrics.go | 8 +- clients/apiclient/api_node.go | 24 +- clients/apiclient/api_public.go | 1254 --------- clients/apiclient/api_requests.go | 8 +- clients/apiclient/api_users.go | 12 +- clients/apiclient/docs/AdminApi.md | 1517 ----------- clients/apiclient/docs/Allowance.md | 72 - clients/apiclient/docs/ChainsApi.md | 162 +- .../apiclient/docs/ConsensusWorkflowStatus.md | 498 ---- clients/apiclient/docs/CorecontractsApi.md | 56 +- clients/apiclient/docs/FungibleTokens.md | 72 - clients/apiclient/docs/MetricsApi.md | 8 +- clients/apiclient/docs/NodeApi.md | 24 +- .../docs/NodeConnectionMessageMetrics.md | 108 - .../docs/NodeConnectionMessagesMetrics.md | 290 -- .../apiclient/docs/NodeConnectionMetrics.md | 108 - .../apiclient/docs/OffLedgerRequestBody.md | 56 - clients/apiclient/docs/PeeringNodeStatus.md | 134 - clients/apiclient/docs/PeeringTrustedNode.md | 82 - clients/apiclient/docs/PublicApi.md | 802 ------ clients/apiclient/docs/RequestsApi.md | 8 +- clients/apiclient/docs/UsersApi.md | 12 +- .../docs/WaitRequestProcessedParams.md | 56 - clients/apiclient/model_allowance.go | 144 - .../model_consensus_workflow_status.go | 757 ------ clients/apiclient/model_fungible_tokens.go | 144 - .../model_node_connection_message_metrics.go | 202 -- .../model_node_connection_messages_metrics.go | 450 ---- .../model_node_connection_metrics.go | 199 -- .../model_off_ledger_request_body.go | 127 - .../apiclient/model_peering_node_status.go | 234 -- .../apiclient/model_peering_trusted_node.go | 164 -- .../model_wait_request_processed_params.go | 127 - clients/chainclient/stateget.go | 2 +- packages/webapi/api.go | 4 +- packages/webapi/services/chain.go | 18 +- tools/cluster/chain.go | 10 +- tools/cluster/cluster.go | 3 +- tools/cluster/config.go | 2 +- tools/cluster/tests/account_test.go | 11 +- 44 files changed, 425 insertions(+), 10415 deletions(-) delete mode 100644 clients/apiclient/api_admin.go delete mode 100644 clients/apiclient/api_public.go delete mode 100644 clients/apiclient/docs/AdminApi.md delete mode 100644 clients/apiclient/docs/Allowance.md delete mode 100644 clients/apiclient/docs/ConsensusWorkflowStatus.md delete mode 100644 clients/apiclient/docs/FungibleTokens.md delete mode 100644 clients/apiclient/docs/NodeConnectionMessageMetrics.md delete mode 100644 clients/apiclient/docs/NodeConnectionMessagesMetrics.md delete mode 100644 clients/apiclient/docs/NodeConnectionMetrics.md delete mode 100644 clients/apiclient/docs/OffLedgerRequestBody.md delete mode 100644 clients/apiclient/docs/PeeringNodeStatus.md delete mode 100644 clients/apiclient/docs/PeeringTrustedNode.md delete mode 100644 clients/apiclient/docs/PublicApi.md delete mode 100644 clients/apiclient/docs/WaitRequestProcessedParams.md delete mode 100644 clients/apiclient/model_allowance.go delete mode 100644 clients/apiclient/model_consensus_workflow_status.go delete mode 100644 clients/apiclient/model_fungible_tokens.go delete mode 100644 clients/apiclient/model_node_connection_message_metrics.go delete mode 100644 clients/apiclient/model_node_connection_messages_metrics.go delete mode 100644 clients/apiclient/model_node_connection_metrics.go delete mode 100644 clients/apiclient/model_off_ledger_request_body.go delete mode 100644 clients/apiclient/model_peering_node_status.go delete mode 100644 clients/apiclient/model_peering_trusted_node.go delete mode 100644 clients/apiclient/model_wait_request_processed_params.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 980dcb6183..c96ce9ca46 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -54,7 +54,7 @@ paths: summary: Get information about the current authentication mode tags: - auth - /v2/chains: + /chains: get: operationId: getChains responses: @@ -77,7 +77,7 @@ paths: summary: Get a list of all chains tags: - chains - /v2/chains/{chainID}: + /chains/{chainID}: get: operationId: getChainInfo parameters: @@ -106,7 +106,7 @@ paths: summary: Get information about a specific chain tags: - chains - /v2/chains/{chainID}/access-node/{publicKey}: + /chains/{chainID}/access-node/{publicKey}: delete: operationId: removeAccessNode parameters: @@ -171,7 +171,7 @@ paths: summary: Configure a trusted node to be an access node. tags: - chains - /v2/chains/{chainID}/activate: + /chains/{chainID}/activate: post: operationId: activateChain parameters: @@ -200,7 +200,7 @@ paths: summary: Activate a chain tags: - chains - /v2/chains/{chainID}/chainrecord: + /chains/{chainID}/chainrecord: post: operationId: setChainRecord parameters: @@ -234,7 +234,7 @@ paths: tags: - chains x-codegen-request-body-name: ChainRecord - /v2/chains/{chainID}/committee: + /chains/{chainID}/committee: get: operationId: getCommitteeInfo parameters: @@ -263,7 +263,7 @@ paths: summary: Get information about the deployed committee tags: - chains - /v2/chains/{chainID}/contracts: + /chains/{chainID}/contracts: get: operationId: getContracts parameters: @@ -294,7 +294,7 @@ paths: summary: Get all available chain contracts tags: - chains - /v2/chains/{chainID}/core/accounts: + /chains/{chainID}/core/accounts: get: operationId: accountsGetAccounts parameters: @@ -323,7 +323,7 @@ paths: summary: Get a list of all accounts tags: - corecontracts - /v2/chains/{chainID}/core/accounts/account/{agentID}/balance: + /chains/{chainID}/core/accounts/account/{agentID}/balance: get: operationId: accountsGetAccountBalance parameters: @@ -359,7 +359,7 @@ paths: summary: Get all assets belonging to an account tags: - corecontracts - /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts: + /chains/{chainID}/core/accounts/account/{agentID}/nfts: get: operationId: accountsGetAccountNFTIDs parameters: @@ -395,7 +395,7 @@ paths: summary: Get all NFT ids belonging to an account tags: - corecontracts - /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce: + /chains/{chainID}/core/accounts/account/{agentID}/nonce: get: operationId: accountsGetAccountNonce parameters: @@ -432,7 +432,7 @@ paths: summary: Get the current nonce of an account tags: - corecontracts - /v2/chains/{chainID}/core/accounts/foundry_output/{serialNumber}: + /chains/{chainID}/core/accounts/foundry_output/{serialNumber}: get: operationId: accountsGetFoundryOutput parameters: @@ -469,7 +469,7 @@ paths: summary: Get the foundry output tags: - corecontracts - /v2/chains/{chainID}/core/accounts/nftdata: + /chains/{chainID}/core/accounts/nftdata: get: operationId: accountsGetNFTData parameters: @@ -505,7 +505,7 @@ paths: summary: Get the NFT data by an ID tags: - corecontracts - /v2/chains/{chainID}/core/accounts/token_registry: + /chains/{chainID}/core/accounts/token_registry: get: operationId: accountsGetNativeTokenIDRegistry parameters: @@ -534,7 +534,7 @@ paths: summary: Get a list of all registries tags: - corecontracts - /v2/chains/{chainID}/core/accounts/total_assets: + /chains/{chainID}/core/accounts/total_assets: get: operationId: accountsGetTotalAssets parameters: @@ -563,7 +563,7 @@ paths: summary: Get all stored assets tags: - corecontracts - /v2/chains/{chainID}/core/blobs: + /chains/{chainID}/core/blobs: get: operationId: blobsGetAllBlobs parameters: @@ -592,7 +592,7 @@ paths: summary: Get all stored blobs tags: - corecontracts - /v2/chains/{chainID}/core/blobs/{blobHash}: + /chains/{chainID}/core/blobs/{blobHash}: get: operationId: blobsGetBlobInfo parameters: @@ -628,7 +628,7 @@ paths: summary: Get all fields of a blob tags: - corecontracts - /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: + /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}: get: operationId: blobsGetBlobValue parameters: @@ -671,7 +671,7 @@ paths: summary: Get the value of the supplied field (key) tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/latest: + /chains/{chainID}/core/blocklog/blocks/latest: get: operationId: blocklogGetLatestBlockInfo parameters: @@ -700,7 +700,7 @@ paths: summary: Get the block info of the latest block tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts: + /chains/{chainID}/core/blocklog/blocks/latest/receipts: get: operationId: blocklogGetRequestReceiptsOfLatestBlock parameters: @@ -729,7 +729,7 @@ paths: summary: Get all receipts of the latest block tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids: + /chains/{chainID}/core/blocklog/blocks/latest/requestids: get: operationId: blocklogGetRequestIDsForLatestBlock parameters: @@ -758,7 +758,7 @@ paths: summary: Get the request ids for the latest block tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}: + /chains/{chainID}/core/blocklog/blocks/{blockIndex}: get: operationId: blocklogGetBlockInfo parameters: @@ -795,7 +795,7 @@ paths: summary: Get the block info of a certain block index tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: + /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts: get: operationId: blocklogGetRequestReceiptsOfBlock parameters: @@ -832,7 +832,7 @@ paths: summary: Get all receipts of a certain block tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: + /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids: get: operationId: blocklogGetRequestIDsForBlock parameters: @@ -869,7 +869,7 @@ paths: summary: Get the request ids for a certain block index tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/controladdresses: + /chains/{chainID}/core/blocklog/controladdresses: get: operationId: blocklogGetControlAddresses parameters: @@ -898,7 +898,7 @@ paths: summary: Get the control addresses tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/events/block/latest: + /chains/{chainID}/core/blocklog/events/block/latest: get: operationId: blocklogGetEventsOfLatestBlock parameters: @@ -927,7 +927,7 @@ paths: summary: Get events of the latest block tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}: + /chains/{chainID}/core/blocklog/events/block/{blockIndex}: get: operationId: blocklogGetEventsOfBlock parameters: @@ -964,7 +964,7 @@ paths: summary: Get events of a block tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}: + /chains/{chainID}/core/blocklog/events/contract/{contractHname}: get: operationId: blocklogGetEventsOfContract parameters: @@ -1000,7 +1000,7 @@ paths: summary: Get events of a contract tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/events/request/{requestID}: + /chains/{chainID}/core/blocklog/events/request/{requestID}: get: operationId: blocklogGetEventsOfRequest parameters: @@ -1036,7 +1036,7 @@ paths: summary: Get events of a request tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/requests/{requestID}: + /chains/{chainID}/core/blocklog/requests/{requestID}: get: operationId: blocklogGetRequestReceipt parameters: @@ -1072,7 +1072,7 @@ paths: summary: Get the receipt of a certain request id tags: - corecontracts - /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: + /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed: get: operationId: blocklogGetRequestIsProcessed parameters: @@ -1108,7 +1108,7 @@ paths: summary: Get the request processing status tags: - corecontracts - /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}: + /chains/{chainID}/core/errors/{contractHname}/message/{errorID}: get: operationId: errorsGetErrorMessageFormat parameters: @@ -1152,7 +1152,7 @@ paths: summary: Get the error message format of a specific error id tags: - corecontracts - /v2/chains/{chainID}/core/governance/allowedstatecontrollers: + /chains/{chainID}/core/governance/allowedstatecontrollers: get: description: Returns the allowed state controller addresses operationId: governanceGetAllowedStateControllerAddresses @@ -1182,7 +1182,7 @@ paths: summary: Get the allowed state controller addresses tags: - corecontracts - /v2/chains/{chainID}/core/governance/chaininfo: + /chains/{chainID}/core/governance/chaininfo: get: description: "If you are using the common API functions, you most likely rather\ \ want to use '/chains/:chainID' to get information about a chain." @@ -1213,7 +1213,7 @@ paths: summary: Get the chain info tags: - corecontracts - /v2/chains/{chainID}/core/governance/chainowner: + /chains/{chainID}/core/governance/chainowner: get: description: Returns the chain owner operationId: governanceGetChainOwner @@ -1243,7 +1243,7 @@ paths: summary: Get the chain owner tags: - corecontracts - /v2/chains/{chainID}/deactivate: + /chains/{chainID}/deactivate: post: operationId: deactivateChain parameters: @@ -1272,7 +1272,7 @@ paths: summary: Deactivate a chain tags: - chains - /v2/chains/{chainID}/evm: + /chains/{chainID}/evm: get: parameters: - description: ChainID (Bech32) @@ -1301,7 +1301,7 @@ paths: - Authorization: [] tags: - chains - /v2/chains/{chainID}/evm/tx/{txHash}: + /chains/{chainID}/evm/tx/{txHash}: get: operationId: getRequestIDFromEVMTransactionID parameters: @@ -1339,7 +1339,7 @@ paths: summary: Get the ISC request ID for the given Ethereum transaction hash tags: - chains - /v2/chains/{chainID}/receipts/{requestID}: + /chains/{chainID}/receipts/{requestID}: get: operationId: getReceipt parameters: @@ -1369,7 +1369,7 @@ paths: summary: Get a receipt from a request ID tags: - requests - /v2/chains/{chainID}/requests/{requestID}/wait: + /chains/{chainID}/requests/{requestID}/wait: get: operationId: waitForRequest parameters: @@ -1411,7 +1411,7 @@ paths: summary: Wait until the given request has been processed by the node tags: - requests - /v2/chains/{chainID}/state/{stateKey}: + /chains/{chainID}/state/{stateKey}: get: operationId: getStateValue parameters: @@ -1441,7 +1441,7 @@ paths: summary: Fetch the raw value associated with the given key in the chain state tags: - chains - /v2/chains/{chainID}/ws: + /chains/{chainID}/ws: get: operationId: attachToWebsocket parameters: @@ -1460,7 +1460,7 @@ paths: - Authorization: [] tags: - chains - /v2/metrics/chain/{chainID}: + /metrics/chain/{chainID}: get: operationId: getChainMetrics parameters: @@ -1489,7 +1489,7 @@ paths: summary: Get chain specific metrics. tags: - metrics - /v2/metrics/chain/{chainID}/pipe: + /metrics/chain/{chainID}/pipe: get: operationId: getChainPipeMetrics parameters: @@ -1518,7 +1518,7 @@ paths: summary: Get chain pipe event metrics. tags: - metrics - /v2/metrics/chain/{chainID}/workflow: + /metrics/chain/{chainID}/workflow: get: operationId: getChainWorkflowMetrics parameters: @@ -1547,7 +1547,7 @@ paths: summary: Get chain workflow metrics. tags: - metrics - /v2/metrics/l1: + /metrics/l1: get: operationId: getL1Metrics responses: @@ -1568,7 +1568,7 @@ paths: summary: Get accumulated metrics. tags: - metrics - /v2/node/config: + /node/config: get: operationId: getConfiguration responses: @@ -1593,7 +1593,7 @@ paths: summary: Return the Wasp configuration tags: - node - /v2/node/dks: + /node/dks: post: operationId: generateDKS requestBody: @@ -1622,7 +1622,7 @@ paths: tags: - node x-codegen-request-body-name: DKSharesPostRequest - /v2/node/dks/{sharedAddress}: + /node/dks/{sharedAddress}: get: operationId: getDKSInfo parameters: @@ -1651,7 +1651,7 @@ paths: summary: Get information about the shared address DKS configuration tags: - node - /v2/node/info: + /node/info: get: operationId: getInfo responses: @@ -1672,7 +1672,7 @@ paths: summary: Returns private information about this node. tags: - node - /v2/node/owner/certificate: + /node/owner/certificate: post: operationId: setNodeOwner requestBody: @@ -1701,7 +1701,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /v2/node/peers: + /node/peers: get: operationId: getAllPeers responses: @@ -1710,7 +1710,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/PeeringNodeStatusResponse__' + $ref: '#/components/schemas/PeeringNodeStatusResponse_' type: array description: A list of all peers "401": @@ -1724,7 +1724,7 @@ paths: summary: Get basic information about all configured peers tags: - node - /v2/node/peers/identity: + /node/peers/identity: get: operationId: getPeeringIdentity responses: @@ -1745,7 +1745,7 @@ paths: summary: Get basic peer info of the current node tags: - node - /v2/node/peers/trusted: + /node/peers/trusted: delete: operationId: distrustPeer requestBody: @@ -1818,7 +1818,7 @@ paths: tags: - node x-codegen-request-body-name: "" - /v2/node/shutdown: + /node/shutdown: post: operationId: shutdownNode responses: @@ -1836,7 +1836,7 @@ paths: summary: Shut down the node tags: - node - /v2/node/version: + /node/version: get: operationId: getVersion responses: @@ -1851,7 +1851,7 @@ paths: summary: Returns the node version. tags: - node - /v2/requests/callview: + /requests/callview: post: description: "Execute a view call. Either use HName or Name properties. If both\ \ are supplied, HName are used." @@ -1876,7 +1876,7 @@ paths: tags: - requests x-codegen-request-body-name: "" - /v2/requests/offledger: + /requests/offledger: post: operationId: offLedger requestBody: @@ -1896,7 +1896,7 @@ paths: tags: - requests x-codegen-request-body-name: "" - /v2/users: + /users: get: operationId: getUsers responses: @@ -1947,7 +1947,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /v2/users/{username}: + /users/{username}: delete: operationId: deleteUser parameters: @@ -2007,7 +2007,7 @@ paths: summary: Get a user tags: - users - /v2/users/{username}/password: + /users/{username}/password: put: operationId: changeUserPassword parameters: @@ -2044,7 +2044,7 @@ paths: tags: - users x-codegen-request-body-name: "" - /v2/users/{username}/permissions: + /users/{username}/permissions: put: operationId: changeUserPermissions parameters: @@ -2989,16 +2989,16 @@ components: committeeNodes: - node: isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 isTrusted: true accessAPI: accessAPI - node: isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 isTrusted: true accessAPI: accessAPI chainId: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e @@ -3101,9 +3101,9 @@ components: example: node: isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 isTrusted: true accessAPI: accessAPI properties: @@ -4440,53 +4440,6 @@ components: xml: name: PeeringNodeStatusResponse PeeringNodeStatusResponse_: - example: - isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 - isTrusted: true - properties: - isAlive: - description: Whether or not the peer is activated - format: boolean - type: boolean - xml: - name: IsAlive - isTrusted: - format: boolean - type: boolean - xml: - name: IsTrusted - netId: - description: The NetID of the peer - format: string - type: string - xml: - name: NetID - numUsers: - description: The amount of users attached to the peer - format: int32 - type: integer - xml: - name: NumUsers - publicKey: - description: The peers public key encoded in Hex - example: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - format: string - type: string - xml: - name: PublicKey - required: - - isAlive - - isTrusted - - netId - - numUsers - - publicKey - type: object - xml: - name: PeeringNodeStatusResponse - PeeringNodeStatusResponse__: example: isAlive: true netId: localhost:4000 diff --git a/clients/apiclient/api_admin.go b/clients/apiclient/api_admin.go deleted file mode 100644 index e7b027308e..0000000000 --- a/clients/apiclient/api_admin.go +++ /dev/null @@ -1,2350 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/url" - "strings" -) - - -// AdminApiService AdminApi service -type AdminApiService service - -type ApiAdmChainChainIDAccessNodePubKeyDeleteRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string - pubKey string -} - -func (r ApiAdmChainChainIDAccessNodePubKeyDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmChainChainIDAccessNodePubKeyDeleteExecute(r) -} - -/* -AdmChainChainIDAccessNodePubKeyDelete Remove an access node from a chain - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32)) - @param pubKey PublicKey (hex string) - @return ApiAdmChainChainIDAccessNodePubKeyDeleteRequest -*/ -func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyDelete(ctx context.Context, chainID string, pubKey string) ApiAdmChainChainIDAccessNodePubKeyDeleteRequest { - return ApiAdmChainChainIDAccessNodePubKeyDeleteRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - pubKey: pubKey, - } -} - -// Execute executes the request -func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyDeleteExecute(r ApiAdmChainChainIDAccessNodePubKeyDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDAccessNodePubKeyDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/access-node/{pubKey}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDAccessNodePubKeyPutRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string - pubKey string -} - -func (r ApiAdmChainChainIDAccessNodePubKeyPutRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmChainChainIDAccessNodePubKeyPutExecute(r) -} - -/* -AdmChainChainIDAccessNodePubKeyPut Add an access node to a chain - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32)) - @param pubKey PublicKey (hex string) - @return ApiAdmChainChainIDAccessNodePubKeyPutRequest -*/ -func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyPut(ctx context.Context, chainID string, pubKey string) ApiAdmChainChainIDAccessNodePubKeyPutRequest { - return ApiAdmChainChainIDAccessNodePubKeyPutRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - pubKey: pubKey, - } -} - -// Execute executes the request -func (a *AdminApiService) AdmChainChainIDAccessNodePubKeyPutExecute(r ApiAdmChainChainIDAccessNodePubKeyPutRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDAccessNodePubKeyPut") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/access-node/{pubKey}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDActivatePostRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainChainIDActivatePostRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmChainChainIDActivatePostExecute(r) -} - -/* -AdmChainChainIDActivatePost Activate a chain - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32)) - @return ApiAdmChainChainIDActivatePostRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainChainIDActivatePost(ctx context.Context, chainID string) ApiAdmChainChainIDActivatePostRequest { - return ApiAdmChainChainIDActivatePostRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// Deprecated -func (a *AdminApiService) AdmChainChainIDActivatePostExecute(r ApiAdmChainChainIDActivatePostRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDActivatePost") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/activate" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDConsensusMetricsPipeGetRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainChainIDConsensusMetricsPipeGetRequest) Execute() (*ConsensusPipeMetrics, *http.Response, error) { - return r.ApiService.AdmChainChainIDConsensusMetricsPipeGetExecute(r) -} - -/* -AdmChainChainIDConsensusMetricsPipeGet Get consensus pipe metrics - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID chainID - @return ApiAdmChainChainIDConsensusMetricsPipeGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainChainIDConsensusMetricsPipeGet(ctx context.Context, chainID string) ApiAdmChainChainIDConsensusMetricsPipeGetRequest { - return ApiAdmChainChainIDConsensusMetricsPipeGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// @return ConsensusPipeMetrics -// Deprecated -func (a *AdminApiService) AdmChainChainIDConsensusMetricsPipeGetExecute(r ApiAdmChainChainIDConsensusMetricsPipeGetRequest) (*ConsensusPipeMetrics, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ConsensusPipeMetrics - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDConsensusMetricsPipeGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/consensus/metrics/pipe" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDConsensusStatusGetRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainChainIDConsensusStatusGetRequest) Execute() (*ConsensusWorkflowStatus, *http.Response, error) { - return r.ApiService.AdmChainChainIDConsensusStatusGetExecute(r) -} - -/* -AdmChainChainIDConsensusStatusGet Get chain state statistics for the given chain ID - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32) - @return ApiAdmChainChainIDConsensusStatusGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainChainIDConsensusStatusGet(ctx context.Context, chainID string) ApiAdmChainChainIDConsensusStatusGetRequest { - return ApiAdmChainChainIDConsensusStatusGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// @return ConsensusWorkflowStatus -// Deprecated -func (a *AdminApiService) AdmChainChainIDConsensusStatusGetExecute(r ApiAdmChainChainIDConsensusStatusGetRequest) (*ConsensusWorkflowStatus, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ConsensusWorkflowStatus - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDConsensusStatusGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/consensus/status" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDDeactivatePostRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainChainIDDeactivatePostRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmChainChainIDDeactivatePostExecute(r) -} - -/* -AdmChainChainIDDeactivatePost Deactivate a chain - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32)) - @return ApiAdmChainChainIDDeactivatePostRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainChainIDDeactivatePost(ctx context.Context, chainID string) ApiAdmChainChainIDDeactivatePostRequest { - return ApiAdmChainChainIDDeactivatePostRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// Deprecated -func (a *AdminApiService) AdmChainChainIDDeactivatePostExecute(r ApiAdmChainChainIDDeactivatePostRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDDeactivatePost") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/deactivate" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDInfoGetRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainChainIDInfoGetRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmChainChainIDInfoGetExecute(r) -} - -/* -AdmChainChainIDInfoGet Get basic chain info. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32)) - @return ApiAdmChainChainIDInfoGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainChainIDInfoGet(ctx context.Context, chainID string) ApiAdmChainChainIDInfoGetRequest { - return ApiAdmChainChainIDInfoGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// Deprecated -func (a *AdminApiService) AdmChainChainIDInfoGetExecute(r ApiAdmChainChainIDInfoGetRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDInfoGet") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/info" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmChainChainIDNodeconnMetricsGetRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainChainIDNodeconnMetricsGetRequest) Execute() (*NodeConnectionMessagesMetrics, *http.Response, error) { - return r.ApiService.AdmChainChainIDNodeconnMetricsGetExecute(r) -} - -/* -AdmChainChainIDNodeconnMetricsGet Get chain node connection metrics for the given chain ID - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32) - @return ApiAdmChainChainIDNodeconnMetricsGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainChainIDNodeconnMetricsGet(ctx context.Context, chainID string) ApiAdmChainChainIDNodeconnMetricsGetRequest { - return ApiAdmChainChainIDNodeconnMetricsGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// @return NodeConnectionMessagesMetrics -// Deprecated -func (a *AdminApiService) AdmChainChainIDNodeconnMetricsGetExecute(r ApiAdmChainChainIDNodeconnMetricsGetRequest) (*NodeConnectionMessagesMetrics, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *NodeConnectionMessagesMetrics - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainChainIDNodeconnMetricsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/{chainID}/nodeconn/metrics" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmChainNodeconnMetricsGetRequest struct { - ctx context.Context - ApiService *AdminApiService -} - -func (r ApiAdmChainNodeconnMetricsGetRequest) Execute() (*NodeConnectionMetrics, *http.Response, error) { - return r.ApiService.AdmChainNodeconnMetricsGetExecute(r) -} - -/* -AdmChainNodeconnMetricsGet Get cummulative chains node connection metrics - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmChainNodeconnMetricsGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainNodeconnMetricsGet(ctx context.Context) ApiAdmChainNodeconnMetricsGetRequest { - return ApiAdmChainNodeconnMetricsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return NodeConnectionMetrics -// Deprecated -func (a *AdminApiService) AdmChainNodeconnMetricsGetExecute(r ApiAdmChainNodeconnMetricsGetRequest) (*NodeConnectionMetrics, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *NodeConnectionMetrics - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainNodeconnMetricsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chain/nodeconn/metrics" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmChainrecordChainIDGetRequest struct { - ctx context.Context - ApiService *AdminApiService - chainID string -} - -func (r ApiAdmChainrecordChainIDGetRequest) Execute() (*ChainRecord, *http.Response, error) { - return r.ApiService.AdmChainrecordChainIDGetExecute(r) -} - -/* -AdmChainrecordChainIDGet Find the chain record for the given chain ID - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32) - @return ApiAdmChainrecordChainIDGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainrecordChainIDGet(ctx context.Context, chainID string) ApiAdmChainrecordChainIDGetRequest { - return ApiAdmChainrecordChainIDGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// @return ChainRecord -// Deprecated -func (a *AdminApiService) AdmChainrecordChainIDGetExecute(r ApiAdmChainrecordChainIDGetRequest) (*ChainRecord, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ChainRecord - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainrecordChainIDGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chainrecord/{chainID}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmChainrecordPostRequest struct { - ctx context.Context - ApiService *AdminApiService - record *ChainRecord -} - -// Chain record -func (r ApiAdmChainrecordPostRequest) Record(record ChainRecord) ApiAdmChainrecordPostRequest { - r.record = &record - return r -} - -func (r ApiAdmChainrecordPostRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmChainrecordPostExecute(r) -} - -/* -AdmChainrecordPost Create a new chain record - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmChainrecordPostRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainrecordPost(ctx context.Context) ApiAdmChainrecordPostRequest { - return ApiAdmChainrecordPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// Deprecated -func (a *AdminApiService) AdmChainrecordPostExecute(r ApiAdmChainrecordPostRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainrecordPost") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chainrecord" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.record == nil { - return nil, reportError("record is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.record - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmChainrecordsGetRequest struct { - ctx context.Context - ApiService *AdminApiService -} - -func (r ApiAdmChainrecordsGetRequest) Execute() ([]ChainRecord, *http.Response, error) { - return r.ApiService.AdmChainrecordsGetExecute(r) -} - -/* -AdmChainrecordsGet Get the list of chain records in the node - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmChainrecordsGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmChainrecordsGet(ctx context.Context) ApiAdmChainrecordsGetRequest { - return ApiAdmChainrecordsGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return []ChainRecord -// Deprecated -func (a *AdminApiService) AdmChainrecordsGetExecute(r ApiAdmChainrecordsGetRequest) ([]ChainRecord, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []ChainRecord - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmChainrecordsGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/chainrecords" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmDksPostRequest struct { - ctx context.Context - ApiService *AdminApiService - dKSharesPostRequest *DKSharesPostRequest -} - -// Request parameters -func (r ApiAdmDksPostRequest) DKSharesPostRequest(dKSharesPostRequest DKSharesPostRequest) ApiAdmDksPostRequest { - r.dKSharesPostRequest = &dKSharesPostRequest - return r -} - -func (r ApiAdmDksPostRequest) Execute() (*DKSharesInfo, *http.Response, error) { - return r.ApiService.AdmDksPostExecute(r) -} - -/* -AdmDksPost Generate a new distributed key - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmDksPostRequest - -Deprecated -*/ -func (a *AdminApiService) AdmDksPost(ctx context.Context) ApiAdmDksPostRequest { - return ApiAdmDksPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return DKSharesInfo -// Deprecated -func (a *AdminApiService) AdmDksPostExecute(r ApiAdmDksPostRequest) (*DKSharesInfo, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DKSharesInfo - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmDksPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/dks" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.dKSharesPostRequest == nil { - return localVarReturnValue, nil, reportError("dKSharesPostRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.dKSharesPostRequest - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmDksSharedAddressGetRequest struct { - ctx context.Context - ApiService *AdminApiService - sharedAddress string -} - -func (r ApiAdmDksSharedAddressGetRequest) Execute() (*DKSharesInfo, *http.Response, error) { - return r.ApiService.AdmDksSharedAddressGetExecute(r) -} - -/* -AdmDksSharedAddressGet Get distributed key properties - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param sharedAddress Address of the DK share (hex) - @return ApiAdmDksSharedAddressGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmDksSharedAddressGet(ctx context.Context, sharedAddress string) ApiAdmDksSharedAddressGetRequest { - return ApiAdmDksSharedAddressGetRequest{ - ApiService: a, - ctx: ctx, - sharedAddress: sharedAddress, - } -} - -// Execute executes the request -// @return DKSharesInfo -// Deprecated -func (a *AdminApiService) AdmDksSharedAddressGetExecute(r ApiAdmDksSharedAddressGetRequest) (*DKSharesInfo, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DKSharesInfo - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmDksSharedAddressGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/dks/{sharedAddress}" - localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmNodeOwnerCertificatePostRequest struct { - ctx context.Context - ApiService *AdminApiService - request *NodeOwnerCertificateRequest -} - -// Certificate request -func (r ApiAdmNodeOwnerCertificatePostRequest) Request(request NodeOwnerCertificateRequest) ApiAdmNodeOwnerCertificatePostRequest { - r.request = &request - return r -} - -func (r ApiAdmNodeOwnerCertificatePostRequest) Execute() (*NodeOwnerCertificateResponse, *http.Response, error) { - return r.ApiService.AdmNodeOwnerCertificatePostExecute(r) -} - -/* -AdmNodeOwnerCertificatePost Provides a certificate, if the node recognizes the owner. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmNodeOwnerCertificatePostRequest - -Deprecated -*/ -func (a *AdminApiService) AdmNodeOwnerCertificatePost(ctx context.Context) ApiAdmNodeOwnerCertificatePostRequest { - return ApiAdmNodeOwnerCertificatePostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return NodeOwnerCertificateResponse -// Deprecated -func (a *AdminApiService) AdmNodeOwnerCertificatePostExecute(r ApiAdmNodeOwnerCertificatePostRequest) (*NodeOwnerCertificateResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *NodeOwnerCertificateResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmNodeOwnerCertificatePost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/node/owner/certificate" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.request == nil { - return localVarReturnValue, nil, reportError("request is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.request - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmPeeringEstablishedGetRequest struct { - ctx context.Context - ApiService *AdminApiService -} - -func (r ApiAdmPeeringEstablishedGetRequest) Execute() ([]PeeringNodeStatus, *http.Response, error) { - return r.ApiService.AdmPeeringEstablishedGetExecute(r) -} - -/* -AdmPeeringEstablishedGet Basic information about all configured peers. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmPeeringEstablishedGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringEstablishedGet(ctx context.Context) ApiAdmPeeringEstablishedGetRequest { - return ApiAdmPeeringEstablishedGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return []PeeringNodeStatus -// Deprecated -func (a *AdminApiService) AdmPeeringEstablishedGetExecute(r ApiAdmPeeringEstablishedGetRequest) ([]PeeringNodeStatus, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []PeeringNodeStatus - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringEstablishedGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/established" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmPeeringSelfGetRequest struct { - ctx context.Context - ApiService *AdminApiService -} - -func (r ApiAdmPeeringSelfGetRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { - return r.ApiService.AdmPeeringSelfGetExecute(r) -} - -/* -AdmPeeringSelfGet Basic peer info of the current node. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmPeeringSelfGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringSelfGet(ctx context.Context) ApiAdmPeeringSelfGetRequest { - return ApiAdmPeeringSelfGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return PeeringTrustedNode -// Deprecated -func (a *AdminApiService) AdmPeeringSelfGetExecute(r ApiAdmPeeringSelfGetRequest) (*PeeringTrustedNode, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PeeringTrustedNode - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringSelfGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/self" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmPeeringTrustedGetRequest struct { - ctx context.Context - ApiService *AdminApiService -} - -func (r ApiAdmPeeringTrustedGetRequest) Execute() ([]PeeringTrustedNode, *http.Response, error) { - return r.ApiService.AdmPeeringTrustedGetExecute(r) -} - -/* -AdmPeeringTrustedGet Get a list of trusted peers. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmPeeringTrustedGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringTrustedGet(ctx context.Context) ApiAdmPeeringTrustedGetRequest { - return ApiAdmPeeringTrustedGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return []PeeringTrustedNode -// Deprecated -func (a *AdminApiService) AdmPeeringTrustedGetExecute(r ApiAdmPeeringTrustedGetRequest) ([]PeeringTrustedNode, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []PeeringTrustedNode - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/trusted" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmPeeringTrustedPostRequest struct { - ctx context.Context - ApiService *AdminApiService - peeringTrustedNode *PeeringTrustedNode -} - -// Info of the peer to trust. -func (r ApiAdmPeeringTrustedPostRequest) PeeringTrustedNode(peeringTrustedNode PeeringTrustedNode) ApiAdmPeeringTrustedPostRequest { - r.peeringTrustedNode = &peeringTrustedNode - return r -} - -func (r ApiAdmPeeringTrustedPostRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { - return r.ApiService.AdmPeeringTrustedPostExecute(r) -} - -/* -AdmPeeringTrustedPost Trust the specified peer. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmPeeringTrustedPostRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringTrustedPost(ctx context.Context) ApiAdmPeeringTrustedPostRequest { - return ApiAdmPeeringTrustedPostRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return PeeringTrustedNode -// Deprecated -func (a *AdminApiService) AdmPeeringTrustedPostExecute(r ApiAdmPeeringTrustedPostRequest) (*PeeringTrustedNode, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PeeringTrustedNode - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/trusted" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.peeringTrustedNode == nil { - return localVarReturnValue, nil, reportError("peeringTrustedNode is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.peeringTrustedNode - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmPeeringTrustedPubKeyDeleteRequest struct { - ctx context.Context - ApiService *AdminApiService - pubKey string -} - -func (r ApiAdmPeeringTrustedPubKeyDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmPeeringTrustedPubKeyDeleteExecute(r) -} - -/* -AdmPeeringTrustedPubKeyDelete Distrust the specified peer. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param pubKey Public key of the trusted peer (hex). - @return ApiAdmPeeringTrustedPubKeyDeleteRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringTrustedPubKeyDelete(ctx context.Context, pubKey string) ApiAdmPeeringTrustedPubKeyDeleteRequest { - return ApiAdmPeeringTrustedPubKeyDeleteRequest{ - ApiService: a, - ctx: ctx, - pubKey: pubKey, - } -} - -// Execute executes the request -// Deprecated -func (a *AdminApiService) AdmPeeringTrustedPubKeyDeleteExecute(r ApiAdmPeeringTrustedPubKeyDeleteRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPubKeyDelete") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/trusted/{pubKey}" - localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAdmPeeringTrustedPubKeyGetRequest struct { - ctx context.Context - ApiService *AdminApiService - pubKey string -} - -func (r ApiAdmPeeringTrustedPubKeyGetRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { - return r.ApiService.AdmPeeringTrustedPubKeyGetExecute(r) -} - -/* -AdmPeeringTrustedPubKeyGet Get details on a particular trusted peer. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param pubKey Public key of the trusted peer (hex). - @return ApiAdmPeeringTrustedPubKeyGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringTrustedPubKeyGet(ctx context.Context, pubKey string) ApiAdmPeeringTrustedPubKeyGetRequest { - return ApiAdmPeeringTrustedPubKeyGetRequest{ - ApiService: a, - ctx: ctx, - pubKey: pubKey, - } -} - -// Execute executes the request -// @return PeeringTrustedNode -// Deprecated -func (a *AdminApiService) AdmPeeringTrustedPubKeyGetExecute(r ApiAdmPeeringTrustedPubKeyGetRequest) (*PeeringTrustedNode, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PeeringTrustedNode - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPubKeyGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/trusted/{pubKey}" - localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmPeeringTrustedPubKeyPutRequest struct { - ctx context.Context - ApiService *AdminApiService - pubKey string - peeringTrustedNode *PeeringTrustedNode -} - -// Info of the peer to trust. -func (r ApiAdmPeeringTrustedPubKeyPutRequest) PeeringTrustedNode(peeringTrustedNode PeeringTrustedNode) ApiAdmPeeringTrustedPubKeyPutRequest { - r.peeringTrustedNode = &peeringTrustedNode - return r -} - -func (r ApiAdmPeeringTrustedPubKeyPutRequest) Execute() (*PeeringTrustedNode, *http.Response, error) { - return r.ApiService.AdmPeeringTrustedPubKeyPutExecute(r) -} - -/* -AdmPeeringTrustedPubKeyPut Trust the specified peer, the pub key is passed via the path. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param pubKey Public key of the trusted peer (hex). - @return ApiAdmPeeringTrustedPubKeyPutRequest - -Deprecated -*/ -func (a *AdminApiService) AdmPeeringTrustedPubKeyPut(ctx context.Context, pubKey string) ApiAdmPeeringTrustedPubKeyPutRequest { - return ApiAdmPeeringTrustedPubKeyPutRequest{ - ApiService: a, - ctx: ctx, - pubKey: pubKey, - } -} - -// Execute executes the request -// @return PeeringTrustedNode -// Deprecated -func (a *AdminApiService) AdmPeeringTrustedPubKeyPutExecute(r ApiAdmPeeringTrustedPubKeyPutRequest) (*PeeringTrustedNode, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PeeringTrustedNode - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmPeeringTrustedPubKeyPut") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/peering/trusted/{pubKey}" - localVarPath = strings.Replace(localVarPath, "{"+"pubKey"+"}", url.PathEscape(parameterValueToString(r.pubKey, "pubKey")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.peeringTrustedNode == nil { - return localVarReturnValue, nil, reportError("peeringTrustedNode is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.peeringTrustedNode - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiAdmShutdownGetRequest struct { - ctx context.Context - ApiService *AdminApiService -} - -func (r ApiAdmShutdownGetRequest) Execute() (*http.Response, error) { - return r.ApiService.AdmShutdownGetExecute(r) -} - -/* -AdmShutdownGet Shut down the node - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdmShutdownGetRequest - -Deprecated -*/ -func (a *AdminApiService) AdmShutdownGet(ctx context.Context) ApiAdmShutdownGetRequest { - return ApiAdmShutdownGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// Deprecated -func (a *AdminApiService) AdmShutdownGetExecute(r ApiAdmShutdownGetRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdmShutdownGet") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/adm/shutdown" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index fa3099ed1c..670b1da52e 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -61,7 +61,7 @@ func (a *ChainsApiService) ActivateChainExecute(r ApiActivateChainRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/activate" + localVarPath := localBasePath + "/chains/{chainID}/activate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -178,7 +178,7 @@ func (a *ChainsApiService) AddAccessNodeExecute(r ApiAddAccessNodeRequest) (*htt return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -293,7 +293,7 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/ws" + localVarPath := localBasePath + "/chains/{chainID}/ws" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -359,6 +359,131 @@ func (a *ChainsApiService) AttachToWebsocketExecute(r ApiAttachToWebsocketReques return localVarHTTPResponse, nil } +type ApiChainsChainIDEvmGetRequest struct { + ctx context.Context + ApiService *ChainsApiService + chainID string +} + +func (r ApiChainsChainIDEvmGetRequest) Execute() (string, *http.Response, error) { + return r.ApiService.ChainsChainIDEvmGetExecute(r) +} + +/* +ChainsChainIDEvmGet Method for ChainsChainIDEvmGet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param chainID ChainID (Bech32) + @return ApiChainsChainIDEvmGetRequest +*/ +func (a *ChainsApiService) ChainsChainIDEvmGet(ctx context.Context, chainID string) ApiChainsChainIDEvmGetRequest { + return ApiChainsChainIDEvmGetRequest{ + ApiService: a, + ctx: ctx, + chainID: chainID, + } +} + +// Execute executes the request +// @return string +func (a *ChainsApiService) ChainsChainIDEvmGetExecute(r ApiChainsChainIDEvmGetRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.ChainsChainIDEvmGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/chains/{chainID}/evm" + localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // 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 + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["Authorization"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiDeactivateChainRequest struct { ctx context.Context ApiService *ChainsApiService @@ -397,7 +522,7 @@ func (a *ChainsApiService) DeactivateChainExecute(r ApiDeactivateChainRequest) ( return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/deactivate" + localVarPath := localBasePath + "/chains/{chainID}/deactivate" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -513,7 +638,7 @@ func (a *ChainsApiService) GetChainInfoExecute(r ApiGetChainInfoRequest) (*Chain return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}" + localVarPath := localBasePath + "/chains/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -635,7 +760,7 @@ func (a *ChainsApiService) GetChainsExecute(r ApiGetChainsRequest) ([]ChainInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains" + localVarPath := localBasePath + "/chains" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -759,7 +884,7 @@ func (a *ChainsApiService) GetCommitteeInfoExecute(r ApiGetCommitteeInfoRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/committee" + localVarPath := localBasePath + "/chains/{chainID}/committee" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -884,7 +1009,7 @@ func (a *ChainsApiService) GetContractsExecute(r ApiGetContractsRequest) ([]Cont return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/contracts" + localVarPath := localBasePath + "/chains/{chainID}/contracts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1012,7 +1137,7 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetReque return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/evm/tx/{txHash}" + localVarPath := localBasePath + "/chains/{chainID}/evm/tx/{txHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) @@ -1141,7 +1266,7 @@ func (a *ChainsApiService) GetStateValueExecute(r ApiGetStateValueRequest) (*Sta return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/state/{stateKey}" + localVarPath := localBasePath + "/chains/{chainID}/state/{stateKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"stateKey"+"}", url.PathEscape(parameterValueToString(r.stateKey, "stateKey")), -1) @@ -1258,7 +1383,7 @@ func (a *ChainsApiService) RemoveAccessNodeExecute(r ApiRemoveAccessNodeRequest) return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/access-node/{publicKey}" + localVarPath := localBasePath + "/chains/{chainID}/access-node/{publicKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"publicKey"+"}", url.PathEscape(parameterValueToString(r.publicKey, "publicKey")), -1) @@ -1380,7 +1505,7 @@ func (a *ChainsApiService) SetChainRecordExecute(r ApiSetChainRecordRequest) (*h return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/chainrecord" + localVarPath := localBasePath + "/chains/{chainID}/chainrecord" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1460,128 +1585,3 @@ func (a *ChainsApiService) SetChainRecordExecute(r ApiSetChainRecordRequest) (*h return localVarHTTPResponse, nil } - -type ApiV2ChainsChainIDEvmGetRequest struct { - ctx context.Context - ApiService *ChainsApiService - chainID string -} - -func (r ApiV2ChainsChainIDEvmGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.V2ChainsChainIDEvmGetExecute(r) -} - -/* -V2ChainsChainIDEvmGet Method for V2ChainsChainIDEvmGet - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (Bech32) - @return ApiV2ChainsChainIDEvmGetRequest -*/ -func (a *ChainsApiService) V2ChainsChainIDEvmGet(ctx context.Context, chainID string) ApiV2ChainsChainIDEvmGetRequest { - return ApiV2ChainsChainIDEvmGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// @return string -func (a *ChainsApiService) V2ChainsChainIDEvmGetExecute(r ApiV2ChainsChainIDEvmGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.V2ChainsChainIDEvmGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v2/chains/{chainID}/evm" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["Authorization"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 404 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/clients/apiclient/api_corecontracts.go b/clients/apiclient/api_corecontracts.go index da23ae8eaa..b278982f4b 100644 --- a/clients/apiclient/api_corecontracts.go +++ b/clients/apiclient/api_corecontracts.go @@ -66,7 +66,7 @@ func (a *CorecontractsApiService) AccountsGetAccountBalanceExecute(r ApiAccounts return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/balance" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/balance" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -195,7 +195,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNFTIDsExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nfts" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nfts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -324,7 +324,7 @@ func (a *CorecontractsApiService) AccountsGetAccountNonceExecute(r ApiAccountsGe return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/account/{agentID}/nonce" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/account/{agentID}/nonce" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"agentID"+"}", url.PathEscape(parameterValueToString(r.agentID, "agentID")), -1) @@ -450,7 +450,7 @@ func (a *CorecontractsApiService) AccountsGetAccountsExecute(r ApiAccountsGetAcc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -578,7 +578,7 @@ func (a *CorecontractsApiService) AccountsGetFoundryOutputExecute(r ApiAccountsG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/foundry_output/{serialNumber}" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/foundry_output/{serialNumber}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"serialNumber"+"}", url.PathEscape(parameterValueToString(r.serialNumber, "serialNumber")), -1) @@ -710,7 +710,7 @@ func (a *CorecontractsApiService) AccountsGetNFTDataExecute(r ApiAccountsGetNFTD return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/nftdata" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/nftdata" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"nftID"+"}", url.PathEscape(parameterValueToString(r.nftID, "nftID")), -1) @@ -836,7 +836,7 @@ func (a *CorecontractsApiService) AccountsGetNativeTokenIDRegistryExecute(r ApiA return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/token_registry" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/token_registry" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -961,7 +961,7 @@ func (a *CorecontractsApiService) AccountsGetTotalAssetsExecute(r ApiAccountsGet return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/accounts/total_assets" + localVarPath := localBasePath + "/chains/{chainID}/core/accounts/total_assets" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1086,7 +1086,7 @@ func (a *CorecontractsApiService) BlobsGetAllBlobsExecute(r ApiBlobsGetAllBlobsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs" + localVarPath := localBasePath + "/chains/{chainID}/core/blobs" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1214,7 +1214,7 @@ func (a *CorecontractsApiService) BlobsGetBlobInfoExecute(r ApiBlobsGetBlobInfoR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}" + localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) @@ -1346,7 +1346,7 @@ func (a *CorecontractsApiService) BlobsGetBlobValueExecute(r ApiBlobsGetBlobValu return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" + localVarPath := localBasePath + "/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blobHash"+"}", url.PathEscape(parameterValueToString(r.blobHash, "blobHash")), -1) localVarPath = strings.Replace(localVarPath, "{"+"fieldKey"+"}", url.PathEscape(parameterValueToString(r.fieldKey, "fieldKey")), -1) @@ -1476,7 +1476,7 @@ func (a *CorecontractsApiService) BlocklogGetBlockInfoExecute(r ApiBlocklogGetBl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -1605,7 +1605,7 @@ func (a *CorecontractsApiService) BlocklogGetControlAddressesExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/controladdresses" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/controladdresses" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -1733,7 +1733,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfBlockExecute(r ApiBlocklogG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/{blockIndex}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/{blockIndex}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -1865,7 +1865,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfContractExecute(r ApiBlockl return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/contract/{contractHname}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/contract/{contractHname}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) @@ -1991,7 +1991,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfLatestBlockExecute(r ApiBlo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/block/latest" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/block/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2119,7 +2119,7 @@ func (a *CorecontractsApiService) BlocklogGetEventsOfRequestExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/events/request/{requestID}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/events/request/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2245,7 +2245,7 @@ func (a *CorecontractsApiService) BlocklogGetLatestBlockInfoExecute(r ApiBlocklo return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2373,7 +2373,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForBlockExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -2502,7 +2502,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIDsForLatestBlockExecute(r A return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/requestids" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/requestids" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -2630,7 +2630,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestIsProcessedExecute(r ApiBloc return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2759,7 +2759,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptExecute(r ApiBlocklog return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/requests/{requestID}" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/requests/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -2888,7 +2888,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfBlockExecute(r Api return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"blockIndex"+"}", url.PathEscape(parameterValueToString(r.blockIndex, "blockIndex")), -1) @@ -3017,7 +3017,7 @@ func (a *CorecontractsApiService) BlocklogGetRequestReceiptsOfLatestBlockExecute return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/blocklog/blocks/latest/receipts" + localVarPath := localBasePath + "/chains/{chainID}/core/blocklog/blocks/latest/receipts" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -3148,7 +3148,7 @@ func (a *CorecontractsApiService) ErrorsGetErrorMessageFormatExecute(r ApiErrors return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" + localVarPath := localBasePath + "/chains/{chainID}/core/errors/{contractHname}/message/{errorID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) localVarPath = strings.Replace(localVarPath, "{"+"errorID"+"}", url.PathEscape(parameterValueToString(r.errorID, "errorID")), -1) @@ -3280,7 +3280,7 @@ func (a *CorecontractsApiService) GovernanceGetAllowedStateControllerAddressesEx return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/allowedstatecontrollers" + localVarPath := localBasePath + "/chains/{chainID}/core/governance/allowedstatecontrollers" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -3407,7 +3407,7 @@ func (a *CorecontractsApiService) GovernanceGetChainInfoExecute(r ApiGovernanceG return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/chaininfo" + localVarPath := localBasePath + "/chains/{chainID}/core/governance/chaininfo" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -3534,7 +3534,7 @@ func (a *CorecontractsApiService) GovernanceGetChainOwnerExecute(r ApiGovernance return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/core/governance/chainowner" + localVarPath := localBasePath + "/chains/{chainID}/core/governance/chainowner" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) diff --git a/clients/apiclient/api_metrics.go b/clients/apiclient/api_metrics.go index 073b3941e4..3579e08e27 100644 --- a/clients/apiclient/api_metrics.go +++ b/clients/apiclient/api_metrics.go @@ -63,7 +63,7 @@ func (a *MetricsApiService) GetChainMetricsExecute(r ApiGetChainMetricsRequest) return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/metrics/chain/{chainID}" + localVarPath := localBasePath + "/metrics/chain/{chainID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -188,7 +188,7 @@ func (a *MetricsApiService) GetChainPipeMetricsExecute(r ApiGetChainPipeMetricsR return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/metrics/chain/{chainID}/pipe" + localVarPath := localBasePath + "/metrics/chain/{chainID}/pipe" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -313,7 +313,7 @@ func (a *MetricsApiService) GetChainWorkflowMetricsExecute(r ApiGetChainWorkflow return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/metrics/chain/{chainID}/workflow" + localVarPath := localBasePath + "/metrics/chain/{chainID}/workflow" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *MetricsApiService) GetL1MetricsExecute(r ApiGetL1MetricsRequest) (*Chai return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/metrics/l1" + localVarPath := localBasePath + "/metrics/l1" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_node.go b/clients/apiclient/api_node.go index cd0878fa0a..86de06825a 100644 --- a/clients/apiclient/api_node.go +++ b/clients/apiclient/api_node.go @@ -65,7 +65,7 @@ func (a *NodeApiService) DistrustPeerExecute(r ApiDistrustPeerRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/peers/trusted" + localVarPath := localBasePath + "/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -189,7 +189,7 @@ func (a *NodeApiService) GenerateDKSExecute(r ApiGenerateDKSRequest) (*DKSharesI return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/dks" + localVarPath := localBasePath + "/node/dks" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -315,7 +315,7 @@ func (a *NodeApiService) GetAllPeersExecute(r ApiGetAllPeersRequest) ([]PeeringN return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/peers" + localVarPath := localBasePath + "/node/peers" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -436,7 +436,7 @@ func (a *NodeApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/config" + localVarPath := localBasePath + "/node/config" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -560,7 +560,7 @@ func (a *NodeApiService) GetDKSInfoExecute(r ApiGetDKSInfoRequest) (*DKSharesInf return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/dks/{sharedAddress}" + localVarPath := localBasePath + "/node/dks/{sharedAddress}" localVarPath = strings.Replace(localVarPath, "{"+"sharedAddress"+"}", url.PathEscape(parameterValueToString(r.sharedAddress, "sharedAddress")), -1) localVarHeaderParams := make(map[string]string) @@ -682,7 +682,7 @@ func (a *NodeApiService) GetInfoExecute(r ApiGetInfoRequest) (*InfoResponse, *ht return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/info" + localVarPath := localBasePath + "/node/info" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -803,7 +803,7 @@ func (a *NodeApiService) GetPeeringIdentityExecute(r ApiGetPeeringIdentityReques return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/peers/identity" + localVarPath := localBasePath + "/node/peers/identity" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -924,7 +924,7 @@ func (a *NodeApiService) GetTrustedPeersExecute(r ApiGetTrustedPeersRequest) ([] return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/peers/trusted" + localVarPath := localBasePath + "/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1045,7 +1045,7 @@ func (a *NodeApiService) GetVersionExecute(r ApiGetVersionRequest) (*VersionResp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/version" + localVarPath := localBasePath + "/node/version" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1163,7 +1163,7 @@ func (a *NodeApiService) SetNodeOwnerExecute(r ApiSetNodeOwnerRequest) (*NodeOwn return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/owner/certificate" + localVarPath := localBasePath + "/node/owner/certificate" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1287,7 +1287,7 @@ func (a *NodeApiService) ShutdownNodeExecute(r ApiShutdownNodeRequest) (*http.Re return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/shutdown" + localVarPath := localBasePath + "/node/shutdown" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1404,7 +1404,7 @@ func (a *NodeApiService) TrustPeerExecute(r ApiTrustPeerRequest) (*http.Response return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/node/peers/trusted" + localVarPath := localBasePath + "/node/peers/trusted" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/api_public.go b/clients/apiclient/api_public.go deleted file mode 100644 index e05af06477..0000000000 --- a/clients/apiclient/api_public.go +++ /dev/null @@ -1,1254 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/url" - "strings" -) - - -// PublicApiService PublicApi service -type PublicApiService service - -type ApiChainChainIDContractContractHnameCallviewFnameGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - contractHname string - fname string - params *JSONDict -} - -// Parameters -func (r ApiChainChainIDContractContractHnameCallviewFnameGetRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewFnameGetRequest { - r.params = ¶ms - return r -} - -func (r ApiChainChainIDContractContractHnameCallviewFnameGetRequest) Execute() (*JSONDict, *http.Response, error) { - return r.ApiService.ChainChainIDContractContractHnameCallviewFnameGetExecute(r) -} - -/* -ChainChainIDContractContractHnameCallviewFnameGet Call a view function on a contract by name - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID - @param contractHname Contract Hname - @param fname Function name - @return ApiChainChainIDContractContractHnameCallviewFnameGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnameGet(ctx context.Context, chainID string, contractHname string, fname string) ApiChainChainIDContractContractHnameCallviewFnameGetRequest { - return ApiChainChainIDContractContractHnameCallviewFnameGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - contractHname: contractHname, - fname: fname, - } -} - -// Execute executes the request -// @return JSONDict -// Deprecated -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnameGetExecute(r ApiChainChainIDContractContractHnameCallviewFnameGetRequest) (*JSONDict, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *JSONDict - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewFnameGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callview/{fname}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"fname"+"}", url.PathEscape(parameterValueToString(r.fname, "fname")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.params - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDContractContractHnameCallviewFnamePostRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - contractHname string - fname string - params *JSONDict -} - -// Parameters -func (r ApiChainChainIDContractContractHnameCallviewFnamePostRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewFnamePostRequest { - r.params = ¶ms - return r -} - -func (r ApiChainChainIDContractContractHnameCallviewFnamePostRequest) Execute() (*JSONDict, *http.Response, error) { - return r.ApiService.ChainChainIDContractContractHnameCallviewFnamePostExecute(r) -} - -/* -ChainChainIDContractContractHnameCallviewFnamePost Call a view function on a contract by name - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID - @param contractHname Contract Hname - @param fname Function name - @return ApiChainChainIDContractContractHnameCallviewFnamePostRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnamePost(ctx context.Context, chainID string, contractHname string, fname string) ApiChainChainIDContractContractHnameCallviewFnamePostRequest { - return ApiChainChainIDContractContractHnameCallviewFnamePostRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - contractHname: contractHname, - fname: fname, - } -} - -// Execute executes the request -// @return JSONDict -// Deprecated -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewFnamePostExecute(r ApiChainChainIDContractContractHnameCallviewFnamePostRequest) (*JSONDict, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *JSONDict - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewFnamePost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callview/{fname}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"fname"+"}", url.PathEscape(parameterValueToString(r.fname, "fname")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.params - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - contractHname string - functionHname string - params *JSONDict -} - -// Parameters -func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest { - r.params = ¶ms - return r -} - -func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest) Execute() (*JSONDict, *http.Response, error) { - return r.ApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetExecute(r) -} - -/* -ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet Call a view function on a contract by Hname - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID - @param contractHname Contract Hname - @param functionHname Function Hname - @return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(ctx context.Context, chainID string, contractHname string, functionHname string) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest { - return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - contractHname: contractHname, - functionHname: functionHname, - } -} - -// Execute executes the request -// @return JSONDict -// Deprecated -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetExecute(r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest) (*JSONDict, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *JSONDict - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"functionHname"+"}", url.PathEscape(parameterValueToString(r.functionHname, "functionHname")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.params - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - contractHname string - functionHname string - params *JSONDict -} - -// Parameters -func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest) Params(params JSONDict) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest { - r.params = ¶ms - return r -} - -func (r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest) Execute() (*JSONDict, *http.Response, error) { - return r.ApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostExecute(r) -} - -/* -ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost Call a view function on a contract by Hname - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID - @param contractHname Contract Hname - @param functionHname Function Hname - @return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(ctx context.Context, chainID string, contractHname string, functionHname string) ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest { - return ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - contractHname: contractHname, - functionHname: functionHname, - } -} - -// Execute executes the request -// @return JSONDict -// Deprecated -func (a *PublicApiService) ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostExecute(r ApiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest) (*JSONDict, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *JSONDict - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"contractHname"+"}", url.PathEscape(parameterValueToString(r.contractHname, "contractHname")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"functionHname"+"}", url.PathEscape(parameterValueToString(r.functionHname, "functionHname")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.params - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDEvmReqidTxHashGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - txHash string -} - -func (r ApiChainChainIDEvmReqidTxHashGetRequest) Execute() (string, *http.Response, error) { - return r.ApiService.ChainChainIDEvmReqidTxHashGetExecute(r) -} - -/* -ChainChainIDEvmReqidTxHashGet Get the ISC request ID for the given Ethereum transaction hash - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32-encoded) - @param txHash Transaction hash (hex-encoded) - @return ApiChainChainIDEvmReqidTxHashGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDEvmReqidTxHashGet(ctx context.Context, chainID string, txHash string) ApiChainChainIDEvmReqidTxHashGetRequest { - return ApiChainChainIDEvmReqidTxHashGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - txHash: txHash, - } -} - -// Execute executes the request -// @return string -// Deprecated -func (a *PublicApiService) ChainChainIDEvmReqidTxHashGetExecute(r ApiChainChainIDEvmReqidTxHashGetRequest) (string, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDEvmReqidTxHashGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/evm/reqid/{txHash}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"txHash"+"}", url.PathEscape(parameterValueToString(r.txHash, "txHash")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 404 { - var v string - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDRequestPostRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - request *OffLedgerRequestBody -} - -// Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\" -func (r ApiChainChainIDRequestPostRequest) Request(request OffLedgerRequestBody) ApiChainChainIDRequestPostRequest { - r.request = &request - return r -} - -func (r ApiChainChainIDRequestPostRequest) Execute() (*http.Response, error) { - return r.ApiService.ChainChainIDRequestPostExecute(r) -} - -/* -ChainChainIDRequestPost Post an off-ledger request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID chainID - @return ApiChainChainIDRequestPostRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDRequestPost(ctx context.Context, chainID string) ApiChainChainIDRequestPostRequest { - return ApiChainChainIDRequestPostRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// Deprecated -func (a *PublicApiService) ChainChainIDRequestPostExecute(r ApiChainChainIDRequestPostRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDRequestPost") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/request" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.request - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiChainChainIDRequestReqIDReceiptGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - reqID string -} - -func (r ApiChainChainIDRequestReqIDReceiptGetRequest) Execute() (*RequestReceiptResponse, *http.Response, error) { - return r.ApiService.ChainChainIDRequestReqIDReceiptGetExecute(r) -} - -/* -ChainChainIDRequestReqIDReceiptGet Get the processing status of a given request in the node - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32) - @param reqID Request ID - @return ApiChainChainIDRequestReqIDReceiptGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDRequestReqIDReceiptGet(ctx context.Context, chainID string, reqID string) ApiChainChainIDRequestReqIDReceiptGetRequest { - return ApiChainChainIDRequestReqIDReceiptGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - reqID: reqID, - } -} - -// Execute executes the request -// @return RequestReceiptResponse -// Deprecated -func (a *PublicApiService) ChainChainIDRequestReqIDReceiptGetExecute(r ApiChainChainIDRequestReqIDReceiptGetRequest) (*RequestReceiptResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestReceiptResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDRequestReqIDReceiptGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/request/{reqID}/receipt" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"reqID"+"}", url.PathEscape(parameterValueToString(r.reqID, "reqID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDRequestReqIDWaitGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - reqID string - params *WaitRequestProcessedParams -} - -// Optional parameters -func (r ApiChainChainIDRequestReqIDWaitGetRequest) Params(params WaitRequestProcessedParams) ApiChainChainIDRequestReqIDWaitGetRequest { - r.params = ¶ms - return r -} - -func (r ApiChainChainIDRequestReqIDWaitGetRequest) Execute() (*RequestReceiptResponse, *http.Response, error) { - return r.ApiService.ChainChainIDRequestReqIDWaitGetExecute(r) -} - -/* -ChainChainIDRequestReqIDWaitGet Wait until the given request has been processed by the node - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32) - @param reqID Request ID - @return ApiChainChainIDRequestReqIDWaitGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDRequestReqIDWaitGet(ctx context.Context, chainID string, reqID string) ApiChainChainIDRequestReqIDWaitGetRequest { - return ApiChainChainIDRequestReqIDWaitGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - reqID: reqID, - } -} - -// Execute executes the request -// @return RequestReceiptResponse -// Deprecated -func (a *PublicApiService) ChainChainIDRequestReqIDWaitGetExecute(r ApiChainChainIDRequestReqIDWaitGetRequest) (*RequestReceiptResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *RequestReceiptResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDRequestReqIDWaitGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/request/{reqID}/wait" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"reqID"+"}", url.PathEscape(parameterValueToString(r.reqID, "reqID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.params - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDStateKeyGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string - key string -} - -func (r ApiChainChainIDStateKeyGetRequest) Execute() ([]int32, *http.Response, error) { - return r.ApiService.ChainChainIDStateKeyGetExecute(r) -} - -/* -ChainChainIDStateKeyGet Fetch the raw value associated with the given key in the chain state - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID - @param key Key (hex-encoded) - @return ApiChainChainIDStateKeyGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDStateKeyGet(ctx context.Context, chainID string, key string) ApiChainChainIDStateKeyGetRequest { - return ApiChainChainIDStateKeyGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - key: key, - } -} - -// Execute executes the request -// @return []int32 -// Deprecated -func (a *PublicApiService) ChainChainIDStateKeyGetExecute(r ApiChainChainIDStateKeyGetRequest) ([]int32, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue []int32 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDStateKeyGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/state/{key}" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", url.PathEscape(parameterValueToString(r.key, "key")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiChainChainIDWsGetRequest struct { - ctx context.Context - ApiService *PublicApiService - chainID string -} - -func (r ApiChainChainIDWsGetRequest) Execute() (*http.Response, error) { - return r.ApiService.ChainChainIDWsGetExecute(r) -} - -/* -ChainChainIDWsGet Method for ChainChainIDWsGet - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param chainID ChainID (bech32-encoded) - @return ApiChainChainIDWsGetRequest - -Deprecated -*/ -func (a *PublicApiService) ChainChainIDWsGet(ctx context.Context, chainID string) ApiChainChainIDWsGetRequest { - return ApiChainChainIDWsGetRequest{ - ApiService: a, - ctx: ctx, - chainID: chainID, - } -} - -// Execute executes the request -// Deprecated -func (a *PublicApiService) ChainChainIDWsGetExecute(r ApiChainChainIDWsGetRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.ChainChainIDWsGet") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/chain/{chainID}/ws" - localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiInfoGetRequest struct { - ctx context.Context - ApiService *PublicApiService -} - -func (r ApiInfoGetRequest) Execute() (*InfoResponse, *http.Response, error) { - return r.ApiService.InfoGetExecute(r) -} - -/* -InfoGet Get information about the node - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiInfoGetRequest - -Deprecated -*/ -func (a *PublicApiService) InfoGet(ctx context.Context) ApiInfoGetRequest { - return ApiInfoGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return InfoResponse -// Deprecated -func (a *PublicApiService) InfoGetExecute(r ApiInfoGetRequest) (*InfoResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *InfoResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PublicApiService.InfoGet") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/clients/apiclient/api_requests.go b/clients/apiclient/api_requests.go index b4b39ea3f5..47e6563f9f 100644 --- a/clients/apiclient/api_requests.go +++ b/clients/apiclient/api_requests.go @@ -69,7 +69,7 @@ func (a *RequestsApiService) CallViewExecute(r ApiCallViewRequest) (*JSONDict, * return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/requests/callview" + localVarPath := localBasePath + "/requests/callview" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -191,7 +191,7 @@ func (a *RequestsApiService) GetReceiptExecute(r ApiGetReceiptRequest) (*Receipt return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/receipts/{requestID}" + localVarPath := localBasePath + "/chains/{chainID}/receipts/{requestID}" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) @@ -309,7 +309,7 @@ func (a *RequestsApiService) OffLedgerExecute(r ApiOffLedgerRequest) (*http.Resp return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/requests/offledger" + localVarPath := localBasePath + "/requests/offledger" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -429,7 +429,7 @@ func (a *RequestsApiService) WaitForRequestExecute(r ApiWaitForRequestRequest) ( return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/chains/{chainID}/requests/{requestID}/wait" + localVarPath := localBasePath + "/chains/{chainID}/requests/{requestID}/wait" localVarPath = strings.Replace(localVarPath, "{"+"chainID"+"}", url.PathEscape(parameterValueToString(r.chainID, "chainID")), -1) localVarPath = strings.Replace(localVarPath, "{"+"requestID"+"}", url.PathEscape(parameterValueToString(r.requestID, "requestID")), -1) diff --git a/clients/apiclient/api_users.go b/clients/apiclient/api_users.go index cc1581f186..7957d7844f 100644 --- a/clients/apiclient/api_users.go +++ b/clients/apiclient/api_users.go @@ -65,7 +65,7 @@ func (a *UsersApiService) AddUserExecute(r ApiAddUserRequest) (*http.Response, e return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/users" + localVarPath := localBasePath + "/users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -190,7 +190,7 @@ func (a *UsersApiService) ChangeUserPasswordExecute(r ApiChangeUserPasswordReque return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/users/{username}/password" + localVarPath := localBasePath + "/users/{username}/password" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -316,7 +316,7 @@ func (a *UsersApiService) ChangeUserPermissionsExecute(r ApiChangeUserPermission return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/users/{username}/permissions" + localVarPath := localBasePath + "/users/{username}/permissions" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -435,7 +435,7 @@ func (a *UsersApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respo return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/users/{username}" + localVarPath := localBasePath + "/users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -552,7 +552,7 @@ func (a *UsersApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Resp return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/users/{username}" + localVarPath := localBasePath + "/users/{username}" localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) @@ -675,7 +675,7 @@ func (a *UsersApiService) GetUsersExecute(r ApiGetUsersRequest) ([]User, *http.R return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/v2/users" + localVarPath := localBasePath + "/users" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/clients/apiclient/docs/AdminApi.md b/clients/apiclient/docs/AdminApi.md deleted file mode 100644 index f2e0ef9113..0000000000 --- a/clients/apiclient/docs/AdminApi.md +++ /dev/null @@ -1,1517 +0,0 @@ -# \AdminApi - -All URIs are relative to *http://localhost:9090* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AdmChainChainIDAccessNodePubKeyDelete**](AdminApi.md#AdmChainChainIDAccessNodePubKeyDelete) | **Delete** /adm/chain/{chainID}/access-node/{pubKey} | Remove an access node from a chain -[**AdmChainChainIDAccessNodePubKeyPut**](AdminApi.md#AdmChainChainIDAccessNodePubKeyPut) | **Put** /adm/chain/{chainID}/access-node/{pubKey} | Add an access node to a chain -[**AdmChainChainIDActivatePost**](AdminApi.md#AdmChainChainIDActivatePost) | **Post** /adm/chain/{chainID}/activate | Activate a chain -[**AdmChainChainIDConsensusMetricsPipeGet**](AdminApi.md#AdmChainChainIDConsensusMetricsPipeGet) | **Get** /adm/chain/{chainID}/consensus/metrics/pipe | Get consensus pipe metrics -[**AdmChainChainIDConsensusStatusGet**](AdminApi.md#AdmChainChainIDConsensusStatusGet) | **Get** /adm/chain/{chainID}/consensus/status | Get chain state statistics for the given chain ID -[**AdmChainChainIDDeactivatePost**](AdminApi.md#AdmChainChainIDDeactivatePost) | **Post** /adm/chain/{chainID}/deactivate | Deactivate a chain -[**AdmChainChainIDInfoGet**](AdminApi.md#AdmChainChainIDInfoGet) | **Get** /adm/chain/{chainID}/info | Get basic chain info. -[**AdmChainChainIDNodeconnMetricsGet**](AdminApi.md#AdmChainChainIDNodeconnMetricsGet) | **Get** /adm/chain/{chainID}/nodeconn/metrics | Get chain node connection metrics for the given chain ID -[**AdmChainNodeconnMetricsGet**](AdminApi.md#AdmChainNodeconnMetricsGet) | **Get** /adm/chain/nodeconn/metrics | Get cummulative chains node connection metrics -[**AdmChainrecordChainIDGet**](AdminApi.md#AdmChainrecordChainIDGet) | **Get** /adm/chainrecord/{chainID} | Find the chain record for the given chain ID -[**AdmChainrecordPost**](AdminApi.md#AdmChainrecordPost) | **Post** /adm/chainrecord | Create a new chain record -[**AdmChainrecordsGet**](AdminApi.md#AdmChainrecordsGet) | **Get** /adm/chainrecords | Get the list of chain records in the node -[**AdmDksPost**](AdminApi.md#AdmDksPost) | **Post** /adm/dks | Generate a new distributed key -[**AdmDksSharedAddressGet**](AdminApi.md#AdmDksSharedAddressGet) | **Get** /adm/dks/{sharedAddress} | Get distributed key properties -[**AdmNodeOwnerCertificatePost**](AdminApi.md#AdmNodeOwnerCertificatePost) | **Post** /adm/node/owner/certificate | Provides a certificate, if the node recognizes the owner. -[**AdmPeeringEstablishedGet**](AdminApi.md#AdmPeeringEstablishedGet) | **Get** /adm/peering/established | Basic information about all configured peers. -[**AdmPeeringSelfGet**](AdminApi.md#AdmPeeringSelfGet) | **Get** /adm/peering/self | Basic peer info of the current node. -[**AdmPeeringTrustedGet**](AdminApi.md#AdmPeeringTrustedGet) | **Get** /adm/peering/trusted | Get a list of trusted peers. -[**AdmPeeringTrustedPost**](AdminApi.md#AdmPeeringTrustedPost) | **Post** /adm/peering/trusted | Trust the specified peer. -[**AdmPeeringTrustedPubKeyDelete**](AdminApi.md#AdmPeeringTrustedPubKeyDelete) | **Delete** /adm/peering/trusted/{pubKey} | Distrust the specified peer. -[**AdmPeeringTrustedPubKeyGet**](AdminApi.md#AdmPeeringTrustedPubKeyGet) | **Get** /adm/peering/trusted/{pubKey} | Get details on a particular trusted peer. -[**AdmPeeringTrustedPubKeyPut**](AdminApi.md#AdmPeeringTrustedPubKeyPut) | **Put** /adm/peering/trusted/{pubKey} | Trust the specified peer, the pub key is passed via the path. -[**AdmShutdownGet**](AdminApi.md#AdmShutdownGet) | **Get** /adm/shutdown | Shut down the node - - - -## AdmChainChainIDAccessNodePubKeyDelete - -> AdmChainChainIDAccessNodePubKeyDelete(ctx, chainID, pubKey).Execute() - -Remove an access node from a chain - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32)) - pubKey := "pubKey_example" // string | PublicKey (hex string) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyDelete(context.Background(), chainID, pubKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDAccessNodePubKeyDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32)) | -**pubKey** | **string** | PublicKey (hex string) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDAccessNodePubKeyDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AdmChainChainIDAccessNodePubKeyPut - -> AdmChainChainIDAccessNodePubKeyPut(ctx, chainID, pubKey).Execute() - -Add an access node to a chain - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32)) - pubKey := "pubKey_example" // string | PublicKey (hex string) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDAccessNodePubKeyPut(context.Background(), chainID, pubKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDAccessNodePubKeyPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32)) | -**pubKey** | **string** | PublicKey (hex string) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDAccessNodePubKeyPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AdmChainChainIDActivatePost - -> AdmChainChainIDActivatePost(ctx, chainID).Execute() - -Activate a chain - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32)) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDActivatePost(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDActivatePost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32)) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDActivatePostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AdmChainChainIDConsensusMetricsPipeGet - -> ConsensusPipeMetrics AdmChainChainIDConsensusMetricsPipeGet(ctx, chainID).Execute() - -Get consensus pipe metrics - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | chainID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDConsensusMetricsPipeGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDConsensusMetricsPipeGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmChainChainIDConsensusMetricsPipeGet`: ConsensusPipeMetrics - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainChainIDConsensusMetricsPipeGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | chainID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDConsensusMetricsPipeGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ConsensusPipeMetrics**](ConsensusPipeMetrics.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) - - -## AdmChainChainIDConsensusStatusGet - -> ConsensusWorkflowStatus AdmChainChainIDConsensusStatusGet(ctx, chainID).Execute() - -Get chain state statistics for the given chain ID - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDConsensusStatusGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDConsensusStatusGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmChainChainIDConsensusStatusGet`: ConsensusWorkflowStatus - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainChainIDConsensusStatusGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDConsensusStatusGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ConsensusWorkflowStatus**](ConsensusWorkflowStatus.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) - - -## AdmChainChainIDDeactivatePost - -> AdmChainChainIDDeactivatePost(ctx, chainID).Execute() - -Deactivate a chain - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32)) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDDeactivatePost(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDDeactivatePost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32)) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDDeactivatePostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AdmChainChainIDInfoGet - -> AdmChainChainIDInfoGet(ctx, chainID).Execute() - -Get basic chain info. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32)) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDInfoGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDInfoGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32)) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDInfoGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AdmChainChainIDNodeconnMetricsGet - -> NodeConnectionMessagesMetrics AdmChainChainIDNodeconnMetricsGet(ctx, chainID).Execute() - -Get chain node connection metrics for the given chain ID - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainChainIDNodeconnMetricsGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainChainIDNodeconnMetricsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmChainChainIDNodeconnMetricsGet`: NodeConnectionMessagesMetrics - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainChainIDNodeconnMetricsGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainChainIDNodeconnMetricsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**NodeConnectionMessagesMetrics**](NodeConnectionMessagesMetrics.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) - - -## AdmChainNodeconnMetricsGet - -> NodeConnectionMetrics AdmChainNodeconnMetricsGet(ctx).Execute() - -Get cummulative chains node connection metrics - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainNodeconnMetricsGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainNodeconnMetricsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmChainNodeconnMetricsGet`: NodeConnectionMetrics - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainNodeconnMetricsGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainNodeconnMetricsGetRequest struct via the builder pattern - - -### Return type - -[**NodeConnectionMetrics**](NodeConnectionMetrics.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) - - -## AdmChainrecordChainIDGet - -> ChainRecord AdmChainrecordChainIDGet(ctx, chainID).Execute() - -Find the chain record for the given chain ID - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainrecordChainIDGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainrecordChainIDGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmChainrecordChainIDGet`: ChainRecord - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainrecordChainIDGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainrecordChainIDGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ChainRecord**](ChainRecord.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) - - -## AdmChainrecordPost - -> AdmChainrecordPost(ctx).Record(record).Execute() - -Create a new chain record - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - record := *openapiclient.NewChainRecord() // ChainRecord | Chain record - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainrecordPost(context.Background()).Record(record).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainrecordPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainrecordPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **record** | [**ChainRecord**](ChainRecord.md) | Chain record | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[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) - - -## AdmChainrecordsGet - -> []ChainRecord AdmChainrecordsGet(ctx).Execute() - -Get the list of chain records in the node - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmChainrecordsGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmChainrecordsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmChainrecordsGet`: []ChainRecord - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmChainrecordsGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmChainrecordsGetRequest struct via the builder pattern - - -### Return type - -[**[]ChainRecord**](ChainRecord.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) - - -## AdmDksPost - -> DKSharesInfo AdmDksPost(ctx).DKSharesPostRequest(dKSharesPostRequest).Execute() - -Generate a new distributed key - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - dKSharesPostRequest := *openapiclient.NewDKSharesPostRequest([]string{"PeerIdentities_example"}, uint32(123), uint32(123)) // DKSharesPostRequest | Request parameters - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmDksPost(context.Background()).DKSharesPostRequest(dKSharesPostRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmDksPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmDksPost`: DKSharesInfo - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmDksPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmDksPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dKSharesPostRequest** | [**DKSharesPostRequest**](DKSharesPostRequest.md) | Request parameters | - -### Return type - -[**DKSharesInfo**](DKSharesInfo.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## AdmDksSharedAddressGet - -> DKSharesInfo AdmDksSharedAddressGet(ctx, sharedAddress).Execute() - -Get distributed key properties - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - sharedAddress := "sharedAddress_example" // string | Address of the DK share (hex) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmDksSharedAddressGet(context.Background(), sharedAddress).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmDksSharedAddressGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmDksSharedAddressGet`: DKSharesInfo - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmDksSharedAddressGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**sharedAddress** | **string** | Address of the DK share (hex) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmDksSharedAddressGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**DKSharesInfo**](DKSharesInfo.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) - - -## AdmNodeOwnerCertificatePost - -> NodeOwnerCertificateResponse AdmNodeOwnerCertificatePost(ctx).Request(request).Execute() - -Provides a certificate, if the node recognizes the owner. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - request := *openapiclient.NewNodeOwnerCertificateRequest("OwnerAddress_example", "PublicKey_example") // NodeOwnerCertificateRequest | Certificate request - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmNodeOwnerCertificatePost(context.Background()).Request(request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmNodeOwnerCertificatePost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmNodeOwnerCertificatePost`: NodeOwnerCertificateResponse - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmNodeOwnerCertificatePost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmNodeOwnerCertificatePostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request** | [**NodeOwnerCertificateRequest**](NodeOwnerCertificateRequest.md) | Certificate request | - -### Return type - -[**NodeOwnerCertificateResponse**](NodeOwnerCertificateResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## AdmPeeringEstablishedGet - -> []PeeringNodeStatus AdmPeeringEstablishedGet(ctx).Execute() - -Basic information about all configured peers. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringEstablishedGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringEstablishedGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmPeeringEstablishedGet`: []PeeringNodeStatus - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringEstablishedGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringEstablishedGetRequest struct via the builder pattern - - -### Return type - -[**[]PeeringNodeStatus**](PeeringNodeStatus.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) - - -## AdmPeeringSelfGet - -> PeeringTrustedNode AdmPeeringSelfGet(ctx).Execute() - -Basic peer info of the current node. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringSelfGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringSelfGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmPeeringSelfGet`: PeeringTrustedNode - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringSelfGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringSelfGetRequest struct via the builder pattern - - -### Return type - -[**PeeringTrustedNode**](PeeringTrustedNode.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) - - -## AdmPeeringTrustedGet - -> []PeeringTrustedNode AdmPeeringTrustedGet(ctx).Execute() - -Get a list of trusted peers. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringTrustedGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmPeeringTrustedGet`: []PeeringTrustedNode - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringTrustedGetRequest struct via the builder pattern - - -### Return type - -[**[]PeeringTrustedNode**](PeeringTrustedNode.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) - - -## AdmPeeringTrustedPost - -> PeeringTrustedNode AdmPeeringTrustedPost(ctx).PeeringTrustedNode(peeringTrustedNode).Execute() - -Trust the specified peer. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - peeringTrustedNode := *openapiclient.NewPeeringTrustedNode() // PeeringTrustedNode | Info of the peer to trust. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPost(context.Background()).PeeringTrustedNode(peeringTrustedNode).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmPeeringTrustedPost`: PeeringTrustedNode - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedPost`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringTrustedPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **peeringTrustedNode** | [**PeeringTrustedNode**](PeeringTrustedNode.md) | Info of the peer to trust. | - -### Return type - -[**PeeringTrustedNode**](PeeringTrustedNode.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## AdmPeeringTrustedPubKeyDelete - -> AdmPeeringTrustedPubKeyDelete(ctx, pubKey).Execute() - -Distrust the specified peer. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pubKey := "pubKey_example" // string | Public key of the trusted peer (hex). - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyDelete(context.Background(), pubKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPubKeyDelete``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pubKey** | **string** | Public key of the trusted peer (hex). | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringTrustedPubKeyDeleteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AdmPeeringTrustedPubKeyGet - -> PeeringTrustedNode AdmPeeringTrustedPubKeyGet(ctx, pubKey).Execute() - -Get details on a particular trusted peer. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pubKey := "pubKey_example" // string | Public key of the trusted peer (hex). - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyGet(context.Background(), pubKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPubKeyGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmPeeringTrustedPubKeyGet`: PeeringTrustedNode - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedPubKeyGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pubKey** | **string** | Public key of the trusted peer (hex). | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringTrustedPubKeyGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**PeeringTrustedNode**](PeeringTrustedNode.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) - - -## AdmPeeringTrustedPubKeyPut - -> PeeringTrustedNode AdmPeeringTrustedPubKeyPut(ctx, pubKey).PeeringTrustedNode(peeringTrustedNode).Execute() - -Trust the specified peer, the pub key is passed via the path. - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pubKey := "pubKey_example" // string | Public key of the trusted peer (hex). - peeringTrustedNode := *openapiclient.NewPeeringTrustedNode() // PeeringTrustedNode | Info of the peer to trust. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmPeeringTrustedPubKeyPut(context.Background(), pubKey).PeeringTrustedNode(peeringTrustedNode).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmPeeringTrustedPubKeyPut``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AdmPeeringTrustedPubKeyPut`: PeeringTrustedNode - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdmPeeringTrustedPubKeyPut`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pubKey** | **string** | Public key of the trusted peer (hex). | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmPeeringTrustedPubKeyPutRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **peeringTrustedNode** | [**PeeringTrustedNode**](PeeringTrustedNode.md) | Info of the peer to trust. | - -### Return type - -[**PeeringTrustedNode**](PeeringTrustedNode.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## AdmShutdownGet - -> AdmShutdownGet(ctx).Execute() - -Shut down the node - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdmShutdownGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdmShutdownGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiAdmShutdownGetRequest struct via the builder pattern - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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/clients/apiclient/docs/Allowance.md b/clients/apiclient/docs/Allowance.md deleted file mode 100644 index afe478f6d6..0000000000 --- a/clients/apiclient/docs/Allowance.md +++ /dev/null @@ -1,72 +0,0 @@ -# Allowance - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**FungibleTokens** | [**FungibleTokens**](FungibleTokens.md) | | -**Nfts** | **[]string** | | - -## Methods - -### NewAllowance - -`func NewAllowance(fungibleTokens FungibleTokens, nfts []string, ) *Allowance` - -NewAllowance instantiates a new Allowance object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAllowanceWithDefaults - -`func NewAllowanceWithDefaults() *Allowance` - -NewAllowanceWithDefaults instantiates a new Allowance object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetFungibleTokens - -`func (o *Allowance) GetFungibleTokens() FungibleTokens` - -GetFungibleTokens returns the FungibleTokens field if non-nil, zero value otherwise. - -### GetFungibleTokensOk - -`func (o *Allowance) GetFungibleTokensOk() (*FungibleTokens, bool)` - -GetFungibleTokensOk returns a tuple with the FungibleTokens field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFungibleTokens - -`func (o *Allowance) SetFungibleTokens(v FungibleTokens)` - -SetFungibleTokens sets FungibleTokens field to given value. - - -### GetNfts - -`func (o *Allowance) GetNfts() []string` - -GetNfts returns the Nfts field if non-nil, zero value otherwise. - -### GetNftsOk - -`func (o *Allowance) GetNftsOk() (*[]string, bool)` - -GetNftsOk returns a tuple with the Nfts field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNfts - -`func (o *Allowance) SetNfts(v []string)` - -SetNfts sets Nfts field to given value. - - - -[[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/clients/apiclient/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md index f7e34a8cec..5c203da9f3 100644 --- a/clients/apiclient/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -4,19 +4,19 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /v2/chains/{chainID}/activate | Activate a chain -[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /v2/chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. -[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /v2/chains/{chainID}/ws | -[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /v2/chains/{chainID}/deactivate | Deactivate a chain -[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /v2/chains/{chainID} | Get information about a specific chain -[**GetChains**](ChainsApi.md#GetChains) | **Get** /v2/chains | Get a list of all chains -[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /v2/chains/{chainID}/committee | Get information about the deployed committee -[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /v2/chains/{chainID}/contracts | Get all available chain contracts -[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /v2/chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash -[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /v2/chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state -[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /v2/chains/{chainID}/access-node/{publicKey} | Remove an access node. -[**SetChainRecord**](ChainsApi.md#SetChainRecord) | **Post** /v2/chains/{chainID}/chainrecord | Sets the chain record. -[**V2ChainsChainIDEvmGet**](ChainsApi.md#V2ChainsChainIDEvmGet) | **Get** /v2/chains/{chainID}/evm | +[**ActivateChain**](ChainsApi.md#ActivateChain) | **Post** /chains/{chainID}/activate | Activate a chain +[**AddAccessNode**](ChainsApi.md#AddAccessNode) | **Put** /chains/{chainID}/access-node/{publicKey} | Configure a trusted node to be an access node. +[**AttachToWebsocket**](ChainsApi.md#AttachToWebsocket) | **Get** /chains/{chainID}/ws | +[**ChainsChainIDEvmGet**](ChainsApi.md#ChainsChainIDEvmGet) | **Get** /chains/{chainID}/evm | +[**DeactivateChain**](ChainsApi.md#DeactivateChain) | **Post** /chains/{chainID}/deactivate | Deactivate a chain +[**GetChainInfo**](ChainsApi.md#GetChainInfo) | **Get** /chains/{chainID} | Get information about a specific chain +[**GetChains**](ChainsApi.md#GetChains) | **Get** /chains | Get a list of all chains +[**GetCommitteeInfo**](ChainsApi.md#GetCommitteeInfo) | **Get** /chains/{chainID}/committee | Get information about the deployed committee +[**GetContracts**](ChainsApi.md#GetContracts) | **Get** /chains/{chainID}/contracts | Get all available chain contracts +[**GetRequestIDFromEVMTransactionID**](ChainsApi.md#GetRequestIDFromEVMTransactionID) | **Get** /chains/{chainID}/evm/tx/{txHash} | Get the ISC request ID for the given Ethereum transaction hash +[**GetStateValue**](ChainsApi.md#GetStateValue) | **Get** /chains/{chainID}/state/{stateKey} | Fetch the raw value associated with the given key in the chain state +[**RemoveAccessNode**](ChainsApi.md#RemoveAccessNode) | **Delete** /chains/{chainID}/access-node/{publicKey} | Remove an access node. +[**SetChainRecord**](ChainsApi.md#SetChainRecord) | **Post** /chains/{chainID}/chainrecord | Sets the chain record. @@ -221,6 +221,74 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## ChainsChainIDEvmGet + +> string ChainsChainIDEvmGet(ctx, chainID).Execute() + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + chainID := "chainID_example" // string | ChainID (Bech32) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ChainsApi.ChainsChainIDEvmGet(context.Background(), chainID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.ChainsChainIDEvmGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ChainsChainIDEvmGet`: string + fmt.Fprintf(os.Stdout, "Response from `ChainsApi.ChainsChainIDEvmGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**chainID** | **string** | ChainID (Bech32) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiChainsChainIDEvmGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**string** + +### Authorization + +[Authorization](../README.md#Authorization) + +### 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) + + ## DeactivateChain > DeactivateChain(ctx, chainID).Execute() @@ -828,71 +896,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -## V2ChainsChainIDEvmGet - -> string V2ChainsChainIDEvmGet(ctx, chainID).Execute() - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (Bech32) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ChainsApi.V2ChainsChainIDEvmGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.V2ChainsChainIDEvmGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `V2ChainsChainIDEvmGet`: string - fmt.Fprintf(os.Stdout, "Response from `ChainsApi.V2ChainsChainIDEvmGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (Bech32) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiV2ChainsChainIDEvmGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -**string** - -### Authorization - -[Authorization](../README.md#Authorization) - -### 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/clients/apiclient/docs/ConsensusWorkflowStatus.md b/clients/apiclient/docs/ConsensusWorkflowStatus.md deleted file mode 100644 index bf51254bfb..0000000000 --- a/clients/apiclient/docs/ConsensusWorkflowStatus.md +++ /dev/null @@ -1,498 +0,0 @@ -# ConsensusWorkflowStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CurrentStateIndex** | Pointer to **uint32** | Shows current state index of the consensus | [optional] -**FlagBatchProposalSent** | Pointer to **bool** | Shows if batch proposal is sent out in current consensus iteration | [optional] -**FlagConsensusBatchKnown** | Pointer to **bool** | Shows if consensus on batch is reached and known in current consensus iteration | [optional] -**FlagInProgress** | Pointer to **bool** | Shows if consensus algorithm is still not completed in current consensus iteration | [optional] -**FlagStateReceived** | Pointer to **bool** | Shows if state output is received in current consensus iteration | [optional] -**FlagTransactionFinalized** | Pointer to **bool** | Shows if consensus on transaction is reached in current consensus iteration | [optional] -**FlagTransactionPosted** | Pointer to **bool** | Shows if transaction is posted to L1 in current consensus iteration | [optional] -**FlagTransactionSeen** | Pointer to **bool** | Shows if L1 reported that it has seen the transaction of current consensus iteration | [optional] -**FlagVMResultSigned** | Pointer to **bool** | Shows if virtual machine has returned its results in current consensus iteration | [optional] -**FlagVMStarted** | Pointer to **bool** | Shows if virtual machine is started in current consensus iteration | [optional] -**TimeBatchProposalSent** | Pointer to **time.Time** | Shows when batch proposal was last sent out in current consensus iteration | [optional] -**TimeCompleted** | Pointer to **time.Time** | Shows when algorithm was last completed in current consensus iteration | [optional] -**TimeConsensusBatchKnown** | Pointer to **time.Time** | Shows when ACS results of consensus on batch was last received in current consensus iteration | [optional] -**TimeTransactionFinalized** | Pointer to **time.Time** | Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration | [optional] -**TimeTransactionPosted** | Pointer to **time.Time** | Shows when transaction was last posted to L1 in current consensus iteration | [optional] -**TimeTransactionSeen** | Pointer to **time.Time** | Shows when algorithm last noted that transaction hadd been seen by L1 in current consensus iteration | [optional] -**TimeVMResultSigned** | Pointer to **time.Time** | Shows when virtual machine results were last received and signed in current consensus iteration | [optional] -**TimeVMStarted** | Pointer to **time.Time** | Shows when virtual machine was last started in current consensus iteration | [optional] - -## Methods - -### NewConsensusWorkflowStatus - -`func NewConsensusWorkflowStatus() *ConsensusWorkflowStatus` - -NewConsensusWorkflowStatus instantiates a new ConsensusWorkflowStatus object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewConsensusWorkflowStatusWithDefaults - -`func NewConsensusWorkflowStatusWithDefaults() *ConsensusWorkflowStatus` - -NewConsensusWorkflowStatusWithDefaults instantiates a new ConsensusWorkflowStatus object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCurrentStateIndex - -`func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() uint32` - -GetCurrentStateIndex returns the CurrentStateIndex field if non-nil, zero value otherwise. - -### GetCurrentStateIndexOk - -`func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*uint32, bool)` - -GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCurrentStateIndex - -`func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v uint32)` - -SetCurrentStateIndex sets CurrentStateIndex field to given value. - -### HasCurrentStateIndex - -`func (o *ConsensusWorkflowStatus) HasCurrentStateIndex() bool` - -HasCurrentStateIndex returns a boolean if a field has been set. - -### GetFlagBatchProposalSent - -`func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSent() bool` - -GetFlagBatchProposalSent returns the FlagBatchProposalSent field if non-nil, zero value otherwise. - -### GetFlagBatchProposalSentOk - -`func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSentOk() (*bool, bool)` - -GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagBatchProposalSent - -`func (o *ConsensusWorkflowStatus) SetFlagBatchProposalSent(v bool)` - -SetFlagBatchProposalSent sets FlagBatchProposalSent field to given value. - -### HasFlagBatchProposalSent - -`func (o *ConsensusWorkflowStatus) HasFlagBatchProposalSent() bool` - -HasFlagBatchProposalSent returns a boolean if a field has been set. - -### GetFlagConsensusBatchKnown - -`func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnown() bool` - -GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field if non-nil, zero value otherwise. - -### GetFlagConsensusBatchKnownOk - -`func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnownOk() (*bool, bool)` - -GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagConsensusBatchKnown - -`func (o *ConsensusWorkflowStatus) SetFlagConsensusBatchKnown(v bool)` - -SetFlagConsensusBatchKnown sets FlagConsensusBatchKnown field to given value. - -### HasFlagConsensusBatchKnown - -`func (o *ConsensusWorkflowStatus) HasFlagConsensusBatchKnown() bool` - -HasFlagConsensusBatchKnown returns a boolean if a field has been set. - -### GetFlagInProgress - -`func (o *ConsensusWorkflowStatus) GetFlagInProgress() bool` - -GetFlagInProgress returns the FlagInProgress field if non-nil, zero value otherwise. - -### GetFlagInProgressOk - -`func (o *ConsensusWorkflowStatus) GetFlagInProgressOk() (*bool, bool)` - -GetFlagInProgressOk returns a tuple with the FlagInProgress field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagInProgress - -`func (o *ConsensusWorkflowStatus) SetFlagInProgress(v bool)` - -SetFlagInProgress sets FlagInProgress field to given value. - -### HasFlagInProgress - -`func (o *ConsensusWorkflowStatus) HasFlagInProgress() bool` - -HasFlagInProgress returns a boolean if a field has been set. - -### GetFlagStateReceived - -`func (o *ConsensusWorkflowStatus) GetFlagStateReceived() bool` - -GetFlagStateReceived returns the FlagStateReceived field if non-nil, zero value otherwise. - -### GetFlagStateReceivedOk - -`func (o *ConsensusWorkflowStatus) GetFlagStateReceivedOk() (*bool, bool)` - -GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagStateReceived - -`func (o *ConsensusWorkflowStatus) SetFlagStateReceived(v bool)` - -SetFlagStateReceived sets FlagStateReceived field to given value. - -### HasFlagStateReceived - -`func (o *ConsensusWorkflowStatus) HasFlagStateReceived() bool` - -HasFlagStateReceived returns a boolean if a field has been set. - -### GetFlagTransactionFinalized - -`func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalized() bool` - -GetFlagTransactionFinalized returns the FlagTransactionFinalized field if non-nil, zero value otherwise. - -### GetFlagTransactionFinalizedOk - -`func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalizedOk() (*bool, bool)` - -GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagTransactionFinalized - -`func (o *ConsensusWorkflowStatus) SetFlagTransactionFinalized(v bool)` - -SetFlagTransactionFinalized sets FlagTransactionFinalized field to given value. - -### HasFlagTransactionFinalized - -`func (o *ConsensusWorkflowStatus) HasFlagTransactionFinalized() bool` - -HasFlagTransactionFinalized returns a boolean if a field has been set. - -### GetFlagTransactionPosted - -`func (o *ConsensusWorkflowStatus) GetFlagTransactionPosted() bool` - -GetFlagTransactionPosted returns the FlagTransactionPosted field if non-nil, zero value otherwise. - -### GetFlagTransactionPostedOk - -`func (o *ConsensusWorkflowStatus) GetFlagTransactionPostedOk() (*bool, bool)` - -GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagTransactionPosted - -`func (o *ConsensusWorkflowStatus) SetFlagTransactionPosted(v bool)` - -SetFlagTransactionPosted sets FlagTransactionPosted field to given value. - -### HasFlagTransactionPosted - -`func (o *ConsensusWorkflowStatus) HasFlagTransactionPosted() bool` - -HasFlagTransactionPosted returns a boolean if a field has been set. - -### GetFlagTransactionSeen - -`func (o *ConsensusWorkflowStatus) GetFlagTransactionSeen() bool` - -GetFlagTransactionSeen returns the FlagTransactionSeen field if non-nil, zero value otherwise. - -### GetFlagTransactionSeenOk - -`func (o *ConsensusWorkflowStatus) GetFlagTransactionSeenOk() (*bool, bool)` - -GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagTransactionSeen - -`func (o *ConsensusWorkflowStatus) SetFlagTransactionSeen(v bool)` - -SetFlagTransactionSeen sets FlagTransactionSeen field to given value. - -### HasFlagTransactionSeen - -`func (o *ConsensusWorkflowStatus) HasFlagTransactionSeen() bool` - -HasFlagTransactionSeen returns a boolean if a field has been set. - -### GetFlagVMResultSigned - -`func (o *ConsensusWorkflowStatus) GetFlagVMResultSigned() bool` - -GetFlagVMResultSigned returns the FlagVMResultSigned field if non-nil, zero value otherwise. - -### GetFlagVMResultSignedOk - -`func (o *ConsensusWorkflowStatus) GetFlagVMResultSignedOk() (*bool, bool)` - -GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagVMResultSigned - -`func (o *ConsensusWorkflowStatus) SetFlagVMResultSigned(v bool)` - -SetFlagVMResultSigned sets FlagVMResultSigned field to given value. - -### HasFlagVMResultSigned - -`func (o *ConsensusWorkflowStatus) HasFlagVMResultSigned() bool` - -HasFlagVMResultSigned returns a boolean if a field has been set. - -### GetFlagVMStarted - -`func (o *ConsensusWorkflowStatus) GetFlagVMStarted() bool` - -GetFlagVMStarted returns the FlagVMStarted field if non-nil, zero value otherwise. - -### GetFlagVMStartedOk - -`func (o *ConsensusWorkflowStatus) GetFlagVMStartedOk() (*bool, bool)` - -GetFlagVMStartedOk returns a tuple with the FlagVMStarted field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFlagVMStarted - -`func (o *ConsensusWorkflowStatus) SetFlagVMStarted(v bool)` - -SetFlagVMStarted sets FlagVMStarted field to given value. - -### HasFlagVMStarted - -`func (o *ConsensusWorkflowStatus) HasFlagVMStarted() bool` - -HasFlagVMStarted returns a boolean if a field has been set. - -### GetTimeBatchProposalSent - -`func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSent() time.Time` - -GetTimeBatchProposalSent returns the TimeBatchProposalSent field if non-nil, zero value otherwise. - -### GetTimeBatchProposalSentOk - -`func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSentOk() (*time.Time, bool)` - -GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeBatchProposalSent - -`func (o *ConsensusWorkflowStatus) SetTimeBatchProposalSent(v time.Time)` - -SetTimeBatchProposalSent sets TimeBatchProposalSent field to given value. - -### HasTimeBatchProposalSent - -`func (o *ConsensusWorkflowStatus) HasTimeBatchProposalSent() bool` - -HasTimeBatchProposalSent returns a boolean if a field has been set. - -### GetTimeCompleted - -`func (o *ConsensusWorkflowStatus) GetTimeCompleted() time.Time` - -GetTimeCompleted returns the TimeCompleted field if non-nil, zero value otherwise. - -### GetTimeCompletedOk - -`func (o *ConsensusWorkflowStatus) GetTimeCompletedOk() (*time.Time, bool)` - -GetTimeCompletedOk returns a tuple with the TimeCompleted field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeCompleted - -`func (o *ConsensusWorkflowStatus) SetTimeCompleted(v time.Time)` - -SetTimeCompleted sets TimeCompleted field to given value. - -### HasTimeCompleted - -`func (o *ConsensusWorkflowStatus) HasTimeCompleted() bool` - -HasTimeCompleted returns a boolean if a field has been set. - -### GetTimeConsensusBatchKnown - -`func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnown() time.Time` - -GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field if non-nil, zero value otherwise. - -### GetTimeConsensusBatchKnownOk - -`func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnownOk() (*time.Time, bool)` - -GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeConsensusBatchKnown - -`func (o *ConsensusWorkflowStatus) SetTimeConsensusBatchKnown(v time.Time)` - -SetTimeConsensusBatchKnown sets TimeConsensusBatchKnown field to given value. - -### HasTimeConsensusBatchKnown - -`func (o *ConsensusWorkflowStatus) HasTimeConsensusBatchKnown() bool` - -HasTimeConsensusBatchKnown returns a boolean if a field has been set. - -### GetTimeTransactionFinalized - -`func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalized() time.Time` - -GetTimeTransactionFinalized returns the TimeTransactionFinalized field if non-nil, zero value otherwise. - -### GetTimeTransactionFinalizedOk - -`func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalizedOk() (*time.Time, bool)` - -GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeTransactionFinalized - -`func (o *ConsensusWorkflowStatus) SetTimeTransactionFinalized(v time.Time)` - -SetTimeTransactionFinalized sets TimeTransactionFinalized field to given value. - -### HasTimeTransactionFinalized - -`func (o *ConsensusWorkflowStatus) HasTimeTransactionFinalized() bool` - -HasTimeTransactionFinalized returns a boolean if a field has been set. - -### GetTimeTransactionPosted - -`func (o *ConsensusWorkflowStatus) GetTimeTransactionPosted() time.Time` - -GetTimeTransactionPosted returns the TimeTransactionPosted field if non-nil, zero value otherwise. - -### GetTimeTransactionPostedOk - -`func (o *ConsensusWorkflowStatus) GetTimeTransactionPostedOk() (*time.Time, bool)` - -GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeTransactionPosted - -`func (o *ConsensusWorkflowStatus) SetTimeTransactionPosted(v time.Time)` - -SetTimeTransactionPosted sets TimeTransactionPosted field to given value. - -### HasTimeTransactionPosted - -`func (o *ConsensusWorkflowStatus) HasTimeTransactionPosted() bool` - -HasTimeTransactionPosted returns a boolean if a field has been set. - -### GetTimeTransactionSeen - -`func (o *ConsensusWorkflowStatus) GetTimeTransactionSeen() time.Time` - -GetTimeTransactionSeen returns the TimeTransactionSeen field if non-nil, zero value otherwise. - -### GetTimeTransactionSeenOk - -`func (o *ConsensusWorkflowStatus) GetTimeTransactionSeenOk() (*time.Time, bool)` - -GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeTransactionSeen - -`func (o *ConsensusWorkflowStatus) SetTimeTransactionSeen(v time.Time)` - -SetTimeTransactionSeen sets TimeTransactionSeen field to given value. - -### HasTimeTransactionSeen - -`func (o *ConsensusWorkflowStatus) HasTimeTransactionSeen() bool` - -HasTimeTransactionSeen returns a boolean if a field has been set. - -### GetTimeVMResultSigned - -`func (o *ConsensusWorkflowStatus) GetTimeVMResultSigned() time.Time` - -GetTimeVMResultSigned returns the TimeVMResultSigned field if non-nil, zero value otherwise. - -### GetTimeVMResultSignedOk - -`func (o *ConsensusWorkflowStatus) GetTimeVMResultSignedOk() (*time.Time, bool)` - -GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeVMResultSigned - -`func (o *ConsensusWorkflowStatus) SetTimeVMResultSigned(v time.Time)` - -SetTimeVMResultSigned sets TimeVMResultSigned field to given value. - -### HasTimeVMResultSigned - -`func (o *ConsensusWorkflowStatus) HasTimeVMResultSigned() bool` - -HasTimeVMResultSigned returns a boolean if a field has been set. - -### GetTimeVMStarted - -`func (o *ConsensusWorkflowStatus) GetTimeVMStarted() time.Time` - -GetTimeVMStarted returns the TimeVMStarted field if non-nil, zero value otherwise. - -### GetTimeVMStartedOk - -`func (o *ConsensusWorkflowStatus) GetTimeVMStartedOk() (*time.Time, bool)` - -GetTimeVMStartedOk returns a tuple with the TimeVMStarted field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeVMStarted - -`func (o *ConsensusWorkflowStatus) SetTimeVMStarted(v time.Time)` - -SetTimeVMStarted sets TimeVMStarted field to given value. - -### HasTimeVMStarted - -`func (o *ConsensusWorkflowStatus) HasTimeVMStarted() bool` - -HasTimeVMStarted returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/CorecontractsApi.md b/clients/apiclient/docs/CorecontractsApi.md index c9258b4748..6c24b28e67 100644 --- a/clients/apiclient/docs/CorecontractsApi.md +++ b/clients/apiclient/docs/CorecontractsApi.md @@ -4,34 +4,34 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account -[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account -[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /v2/chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account -[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /v2/chains/{chainID}/core/accounts | Get a list of all accounts -[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /v2/chains/{chainID}/core/accounts/foundry_output/{serialNumber} | Get the foundry output -[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /v2/chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID -[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /v2/chains/{chainID}/core/accounts/token_registry | Get a list of all registries -[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /v2/chains/{chainID}/core/accounts/total_assets | Get all stored assets -[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /v2/chains/{chainID}/core/blobs | Get all stored blobs -[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob -[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /v2/chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) -[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index -[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /v2/chains/{chainID}/core/blocklog/controladdresses | Get the control addresses -[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block -[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /v2/chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract -[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block -[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /v2/chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request -[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block -[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index -[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block -[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status -[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /v2/chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id -[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block -[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /v2/chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block -[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /v2/chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id -[**GovernanceGetAllowedStateControllerAddresses**](CorecontractsApi.md#GovernanceGetAllowedStateControllerAddresses) | **Get** /v2/chains/{chainID}/core/governance/allowedstatecontrollers | Get the allowed state controller addresses -[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /v2/chains/{chainID}/core/governance/chaininfo | Get the chain info -[**GovernanceGetChainOwner**](CorecontractsApi.md#GovernanceGetChainOwner) | **Get** /v2/chains/{chainID}/core/governance/chainowner | Get the chain owner +[**AccountsGetAccountBalance**](CorecontractsApi.md#AccountsGetAccountBalance) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/balance | Get all assets belonging to an account +[**AccountsGetAccountNFTIDs**](CorecontractsApi.md#AccountsGetAccountNFTIDs) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nfts | Get all NFT ids belonging to an account +[**AccountsGetAccountNonce**](CorecontractsApi.md#AccountsGetAccountNonce) | **Get** /chains/{chainID}/core/accounts/account/{agentID}/nonce | Get the current nonce of an account +[**AccountsGetAccounts**](CorecontractsApi.md#AccountsGetAccounts) | **Get** /chains/{chainID}/core/accounts | Get a list of all accounts +[**AccountsGetFoundryOutput**](CorecontractsApi.md#AccountsGetFoundryOutput) | **Get** /chains/{chainID}/core/accounts/foundry_output/{serialNumber} | Get the foundry output +[**AccountsGetNFTData**](CorecontractsApi.md#AccountsGetNFTData) | **Get** /chains/{chainID}/core/accounts/nftdata | Get the NFT data by an ID +[**AccountsGetNativeTokenIDRegistry**](CorecontractsApi.md#AccountsGetNativeTokenIDRegistry) | **Get** /chains/{chainID}/core/accounts/token_registry | Get a list of all registries +[**AccountsGetTotalAssets**](CorecontractsApi.md#AccountsGetTotalAssets) | **Get** /chains/{chainID}/core/accounts/total_assets | Get all stored assets +[**BlobsGetAllBlobs**](CorecontractsApi.md#BlobsGetAllBlobs) | **Get** /chains/{chainID}/core/blobs | Get all stored blobs +[**BlobsGetBlobInfo**](CorecontractsApi.md#BlobsGetBlobInfo) | **Get** /chains/{chainID}/core/blobs/{blobHash} | Get all fields of a blob +[**BlobsGetBlobValue**](CorecontractsApi.md#BlobsGetBlobValue) | **Get** /chains/{chainID}/core/blobs/{blobHash}/data/{fieldKey} | Get the value of the supplied field (key) +[**BlocklogGetBlockInfo**](CorecontractsApi.md#BlocklogGetBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex} | Get the block info of a certain block index +[**BlocklogGetControlAddresses**](CorecontractsApi.md#BlocklogGetControlAddresses) | **Get** /chains/{chainID}/core/blocklog/controladdresses | Get the control addresses +[**BlocklogGetEventsOfBlock**](CorecontractsApi.md#BlocklogGetEventsOfBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/{blockIndex} | Get events of a block +[**BlocklogGetEventsOfContract**](CorecontractsApi.md#BlocklogGetEventsOfContract) | **Get** /chains/{chainID}/core/blocklog/events/contract/{contractHname} | Get events of a contract +[**BlocklogGetEventsOfLatestBlock**](CorecontractsApi.md#BlocklogGetEventsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/events/block/latest | Get events of the latest block +[**BlocklogGetEventsOfRequest**](CorecontractsApi.md#BlocklogGetEventsOfRequest) | **Get** /chains/{chainID}/core/blocklog/events/request/{requestID} | Get events of a request +[**BlocklogGetLatestBlockInfo**](CorecontractsApi.md#BlocklogGetLatestBlockInfo) | **Get** /chains/{chainID}/core/blocklog/blocks/latest | Get the block info of the latest block +[**BlocklogGetRequestIDsForBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/requestids | Get the request ids for a certain block index +[**BlocklogGetRequestIDsForLatestBlock**](CorecontractsApi.md#BlocklogGetRequestIDsForLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/requestids | Get the request ids for the latest block +[**BlocklogGetRequestIsProcessed**](CorecontractsApi.md#BlocklogGetRequestIsProcessed) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID}/is_processed | Get the request processing status +[**BlocklogGetRequestReceipt**](CorecontractsApi.md#BlocklogGetRequestReceipt) | **Get** /chains/{chainID}/core/blocklog/requests/{requestID} | Get the receipt of a certain request id +[**BlocklogGetRequestReceiptsOfBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/{blockIndex}/receipts | Get all receipts of a certain block +[**BlocklogGetRequestReceiptsOfLatestBlock**](CorecontractsApi.md#BlocklogGetRequestReceiptsOfLatestBlock) | **Get** /chains/{chainID}/core/blocklog/blocks/latest/receipts | Get all receipts of the latest block +[**ErrorsGetErrorMessageFormat**](CorecontractsApi.md#ErrorsGetErrorMessageFormat) | **Get** /chains/{chainID}/core/errors/{contractHname}/message/{errorID} | Get the error message format of a specific error id +[**GovernanceGetAllowedStateControllerAddresses**](CorecontractsApi.md#GovernanceGetAllowedStateControllerAddresses) | **Get** /chains/{chainID}/core/governance/allowedstatecontrollers | Get the allowed state controller addresses +[**GovernanceGetChainInfo**](CorecontractsApi.md#GovernanceGetChainInfo) | **Get** /chains/{chainID}/core/governance/chaininfo | Get the chain info +[**GovernanceGetChainOwner**](CorecontractsApi.md#GovernanceGetChainOwner) | **Get** /chains/{chainID}/core/governance/chainowner | Get the chain owner diff --git a/clients/apiclient/docs/FungibleTokens.md b/clients/apiclient/docs/FungibleTokens.md deleted file mode 100644 index 6ed74faa17..0000000000 --- a/clients/apiclient/docs/FungibleTokens.md +++ /dev/null @@ -1,72 +0,0 @@ -# FungibleTokens - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BaseTokens** | **int64** | | -**NativeTokens** | [**[]NativeToken**](NativeToken.md) | | - -## Methods - -### NewFungibleTokens - -`func NewFungibleTokens(baseTokens int64, nativeTokens []NativeToken, ) *FungibleTokens` - -NewFungibleTokens instantiates a new FungibleTokens object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFungibleTokensWithDefaults - -`func NewFungibleTokensWithDefaults() *FungibleTokens` - -NewFungibleTokensWithDefaults instantiates a new FungibleTokens object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBaseTokens - -`func (o *FungibleTokens) GetBaseTokens() int64` - -GetBaseTokens returns the BaseTokens field if non-nil, zero value otherwise. - -### GetBaseTokensOk - -`func (o *FungibleTokens) GetBaseTokensOk() (*int64, bool)` - -GetBaseTokensOk returns a tuple with the BaseTokens field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBaseTokens - -`func (o *FungibleTokens) SetBaseTokens(v int64)` - -SetBaseTokens sets BaseTokens field to given value. - - -### GetNativeTokens - -`func (o *FungibleTokens) GetNativeTokens() []NativeToken` - -GetNativeTokens returns the NativeTokens field if non-nil, zero value otherwise. - -### GetNativeTokensOk - -`func (o *FungibleTokens) GetNativeTokensOk() (*[]NativeToken, bool)` - -GetNativeTokensOk returns a tuple with the NativeTokens field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNativeTokens - -`func (o *FungibleTokens) SetNativeTokens(v []NativeToken)` - -SetNativeTokens sets NativeTokens field to given value. - - - -[[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/clients/apiclient/docs/MetricsApi.md b/clients/apiclient/docs/MetricsApi.md index 0aeb805a57..46d92dd3bc 100644 --- a/clients/apiclient/docs/MetricsApi.md +++ b/clients/apiclient/docs/MetricsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /v2/metrics/chain/{chainID} | Get chain specific metrics. -[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /v2/metrics/chain/{chainID}/pipe | Get chain pipe event metrics. -[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /v2/metrics/chain/{chainID}/workflow | Get chain workflow metrics. -[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /v2/metrics/l1 | Get accumulated metrics. +[**GetChainMetrics**](MetricsApi.md#GetChainMetrics) | **Get** /metrics/chain/{chainID} | Get chain specific metrics. +[**GetChainPipeMetrics**](MetricsApi.md#GetChainPipeMetrics) | **Get** /metrics/chain/{chainID}/pipe | Get chain pipe event metrics. +[**GetChainWorkflowMetrics**](MetricsApi.md#GetChainWorkflowMetrics) | **Get** /metrics/chain/{chainID}/workflow | Get chain workflow metrics. +[**GetL1Metrics**](MetricsApi.md#GetL1Metrics) | **Get** /metrics/l1 | Get accumulated metrics. diff --git a/clients/apiclient/docs/NodeApi.md b/clients/apiclient/docs/NodeApi.md index 50fe8acaef..e1c6d8eed7 100644 --- a/clients/apiclient/docs/NodeApi.md +++ b/clients/apiclient/docs/NodeApi.md @@ -4,18 +4,18 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /v2/node/peers/trusted | Distrust a peering node -[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /v2/node/dks | Generate a new distributed key -[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /v2/node/peers | Get basic information about all configured peers -[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /v2/node/config | Return the Wasp configuration -[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /v2/node/dks/{sharedAddress} | Get information about the shared address DKS configuration -[**GetInfo**](NodeApi.md#GetInfo) | **Get** /v2/node/info | Returns private information about this node. -[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /v2/node/peers/identity | Get basic peer info of the current node -[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /v2/node/peers/trusted | Get trusted peers -[**GetVersion**](NodeApi.md#GetVersion) | **Get** /v2/node/version | Returns the node version. -[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /v2/node/owner/certificate | Sets the node owner -[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /v2/node/shutdown | Shut down the node -[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /v2/node/peers/trusted | Trust a peering node +[**DistrustPeer**](NodeApi.md#DistrustPeer) | **Delete** /node/peers/trusted | Distrust a peering node +[**GenerateDKS**](NodeApi.md#GenerateDKS) | **Post** /node/dks | Generate a new distributed key +[**GetAllPeers**](NodeApi.md#GetAllPeers) | **Get** /node/peers | Get basic information about all configured peers +[**GetConfiguration**](NodeApi.md#GetConfiguration) | **Get** /node/config | Return the Wasp configuration +[**GetDKSInfo**](NodeApi.md#GetDKSInfo) | **Get** /node/dks/{sharedAddress} | Get information about the shared address DKS configuration +[**GetInfo**](NodeApi.md#GetInfo) | **Get** /node/info | Returns private information about this node. +[**GetPeeringIdentity**](NodeApi.md#GetPeeringIdentity) | **Get** /node/peers/identity | Get basic peer info of the current node +[**GetTrustedPeers**](NodeApi.md#GetTrustedPeers) | **Get** /node/peers/trusted | Get trusted peers +[**GetVersion**](NodeApi.md#GetVersion) | **Get** /node/version | Returns the node version. +[**SetNodeOwner**](NodeApi.md#SetNodeOwner) | **Post** /node/owner/certificate | Sets the node owner +[**ShutdownNode**](NodeApi.md#ShutdownNode) | **Post** /node/shutdown | Shut down the node +[**TrustPeer**](NodeApi.md#TrustPeer) | **Post** /node/peers/trusted | Trust a peering node diff --git a/clients/apiclient/docs/NodeConnectionMessageMetrics.md b/clients/apiclient/docs/NodeConnectionMessageMetrics.md deleted file mode 100644 index e132d98041..0000000000 --- a/clients/apiclient/docs/NodeConnectionMessageMetrics.md +++ /dev/null @@ -1,108 +0,0 @@ -# NodeConnectionMessageMetrics - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**LastEvent** | Pointer to **time.Time** | Last time the message was sent/received | [optional] -**LastMessage** | Pointer to **string** | The print out of the last message | [optional] -**Total** | Pointer to **uint32** | Total number of messages sent/received | [optional] - -## Methods - -### NewNodeConnectionMessageMetrics - -`func NewNodeConnectionMessageMetrics() *NodeConnectionMessageMetrics` - -NewNodeConnectionMessageMetrics instantiates a new NodeConnectionMessageMetrics object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNodeConnectionMessageMetricsWithDefaults - -`func NewNodeConnectionMessageMetricsWithDefaults() *NodeConnectionMessageMetrics` - -NewNodeConnectionMessageMetricsWithDefaults instantiates a new NodeConnectionMessageMetrics object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetLastEvent - -`func (o *NodeConnectionMessageMetrics) GetLastEvent() time.Time` - -GetLastEvent returns the LastEvent field if non-nil, zero value otherwise. - -### GetLastEventOk - -`func (o *NodeConnectionMessageMetrics) GetLastEventOk() (*time.Time, bool)` - -GetLastEventOk returns a tuple with the LastEvent field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastEvent - -`func (o *NodeConnectionMessageMetrics) SetLastEvent(v time.Time)` - -SetLastEvent sets LastEvent field to given value. - -### HasLastEvent - -`func (o *NodeConnectionMessageMetrics) HasLastEvent() bool` - -HasLastEvent returns a boolean if a field has been set. - -### GetLastMessage - -`func (o *NodeConnectionMessageMetrics) GetLastMessage() string` - -GetLastMessage returns the LastMessage field if non-nil, zero value otherwise. - -### GetLastMessageOk - -`func (o *NodeConnectionMessageMetrics) GetLastMessageOk() (*string, bool)` - -GetLastMessageOk returns a tuple with the LastMessage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastMessage - -`func (o *NodeConnectionMessageMetrics) SetLastMessage(v string)` - -SetLastMessage sets LastMessage field to given value. - -### HasLastMessage - -`func (o *NodeConnectionMessageMetrics) HasLastMessage() bool` - -HasLastMessage returns a boolean if a field has been set. - -### GetTotal - -`func (o *NodeConnectionMessageMetrics) GetTotal() uint32` - -GetTotal returns the Total field if non-nil, zero value otherwise. - -### GetTotalOk - -`func (o *NodeConnectionMessageMetrics) GetTotalOk() (*uint32, bool)` - -GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTotal - -`func (o *NodeConnectionMessageMetrics) SetTotal(v uint32)` - -SetTotal sets Total field to given value. - -### HasTotal - -`func (o *NodeConnectionMessageMetrics) HasTotal() bool` - -HasTotal returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/NodeConnectionMessagesMetrics.md b/clients/apiclient/docs/NodeConnectionMessagesMetrics.md deleted file mode 100644 index f59c72c350..0000000000 --- a/clients/apiclient/docs/NodeConnectionMessagesMetrics.md +++ /dev/null @@ -1,290 +0,0 @@ -# NodeConnectionMessagesMetrics - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**InAliasOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**InOnLedgerRequest** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**InOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**InStateOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**InTxInclusionState** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**OutPublishGovernanceTransaction** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**OutPublishStateTransaction** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**OutPullLatestOutput** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**OutPullOutputByID** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**OutPullTxInclusionState** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] - -## Methods - -### NewNodeConnectionMessagesMetrics - -`func NewNodeConnectionMessagesMetrics() *NodeConnectionMessagesMetrics` - -NewNodeConnectionMessagesMetrics instantiates a new NodeConnectionMessagesMetrics object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNodeConnectionMessagesMetricsWithDefaults - -`func NewNodeConnectionMessagesMetricsWithDefaults() *NodeConnectionMessagesMetrics` - -NewNodeConnectionMessagesMetricsWithDefaults instantiates a new NodeConnectionMessagesMetrics object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInAliasOutput - -`func (o *NodeConnectionMessagesMetrics) GetInAliasOutput() NodeConnectionMessageMetrics` - -GetInAliasOutput returns the InAliasOutput field if non-nil, zero value otherwise. - -### GetInAliasOutputOk - -`func (o *NodeConnectionMessagesMetrics) GetInAliasOutputOk() (*NodeConnectionMessageMetrics, bool)` - -GetInAliasOutputOk returns a tuple with the InAliasOutput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInAliasOutput - -`func (o *NodeConnectionMessagesMetrics) SetInAliasOutput(v NodeConnectionMessageMetrics)` - -SetInAliasOutput sets InAliasOutput field to given value. - -### HasInAliasOutput - -`func (o *NodeConnectionMessagesMetrics) HasInAliasOutput() bool` - -HasInAliasOutput returns a boolean if a field has been set. - -### GetInOnLedgerRequest - -`func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequest() NodeConnectionMessageMetrics` - -GetInOnLedgerRequest returns the InOnLedgerRequest field if non-nil, zero value otherwise. - -### GetInOnLedgerRequestOk - -`func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequestOk() (*NodeConnectionMessageMetrics, bool)` - -GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInOnLedgerRequest - -`func (o *NodeConnectionMessagesMetrics) SetInOnLedgerRequest(v NodeConnectionMessageMetrics)` - -SetInOnLedgerRequest sets InOnLedgerRequest field to given value. - -### HasInOnLedgerRequest - -`func (o *NodeConnectionMessagesMetrics) HasInOnLedgerRequest() bool` - -HasInOnLedgerRequest returns a boolean if a field has been set. - -### GetInOutput - -`func (o *NodeConnectionMessagesMetrics) GetInOutput() NodeConnectionMessageMetrics` - -GetInOutput returns the InOutput field if non-nil, zero value otherwise. - -### GetInOutputOk - -`func (o *NodeConnectionMessagesMetrics) GetInOutputOk() (*NodeConnectionMessageMetrics, bool)` - -GetInOutputOk returns a tuple with the InOutput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInOutput - -`func (o *NodeConnectionMessagesMetrics) SetInOutput(v NodeConnectionMessageMetrics)` - -SetInOutput sets InOutput field to given value. - -### HasInOutput - -`func (o *NodeConnectionMessagesMetrics) HasInOutput() bool` - -HasInOutput returns a boolean if a field has been set. - -### GetInStateOutput - -`func (o *NodeConnectionMessagesMetrics) GetInStateOutput() NodeConnectionMessageMetrics` - -GetInStateOutput returns the InStateOutput field if non-nil, zero value otherwise. - -### GetInStateOutputOk - -`func (o *NodeConnectionMessagesMetrics) GetInStateOutputOk() (*NodeConnectionMessageMetrics, bool)` - -GetInStateOutputOk returns a tuple with the InStateOutput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInStateOutput - -`func (o *NodeConnectionMessagesMetrics) SetInStateOutput(v NodeConnectionMessageMetrics)` - -SetInStateOutput sets InStateOutput field to given value. - -### HasInStateOutput - -`func (o *NodeConnectionMessagesMetrics) HasInStateOutput() bool` - -HasInStateOutput returns a boolean if a field has been set. - -### GetInTxInclusionState - -`func (o *NodeConnectionMessagesMetrics) GetInTxInclusionState() NodeConnectionMessageMetrics` - -GetInTxInclusionState returns the InTxInclusionState field if non-nil, zero value otherwise. - -### GetInTxInclusionStateOk - -`func (o *NodeConnectionMessagesMetrics) GetInTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool)` - -GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInTxInclusionState - -`func (o *NodeConnectionMessagesMetrics) SetInTxInclusionState(v NodeConnectionMessageMetrics)` - -SetInTxInclusionState sets InTxInclusionState field to given value. - -### HasInTxInclusionState - -`func (o *NodeConnectionMessagesMetrics) HasInTxInclusionState() bool` - -HasInTxInclusionState returns a boolean if a field has been set. - -### GetOutPublishGovernanceTransaction - -`func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransaction() NodeConnectionMessageMetrics` - -GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field if non-nil, zero value otherwise. - -### GetOutPublishGovernanceTransactionOk - -`func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransactionOk() (*NodeConnectionMessageMetrics, bool)` - -GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOutPublishGovernanceTransaction - -`func (o *NodeConnectionMessagesMetrics) SetOutPublishGovernanceTransaction(v NodeConnectionMessageMetrics)` - -SetOutPublishGovernanceTransaction sets OutPublishGovernanceTransaction field to given value. - -### HasOutPublishGovernanceTransaction - -`func (o *NodeConnectionMessagesMetrics) HasOutPublishGovernanceTransaction() bool` - -HasOutPublishGovernanceTransaction returns a boolean if a field has been set. - -### GetOutPublishStateTransaction - -`func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransaction() NodeConnectionMessageMetrics` - -GetOutPublishStateTransaction returns the OutPublishStateTransaction field if non-nil, zero value otherwise. - -### GetOutPublishStateTransactionOk - -`func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransactionOk() (*NodeConnectionMessageMetrics, bool)` - -GetOutPublishStateTransactionOk returns a tuple with the OutPublishStateTransaction field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOutPublishStateTransaction - -`func (o *NodeConnectionMessagesMetrics) SetOutPublishStateTransaction(v NodeConnectionMessageMetrics)` - -SetOutPublishStateTransaction sets OutPublishStateTransaction field to given value. - -### HasOutPublishStateTransaction - -`func (o *NodeConnectionMessagesMetrics) HasOutPublishStateTransaction() bool` - -HasOutPublishStateTransaction returns a boolean if a field has been set. - -### GetOutPullLatestOutput - -`func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutput() NodeConnectionMessageMetrics` - -GetOutPullLatestOutput returns the OutPullLatestOutput field if non-nil, zero value otherwise. - -### GetOutPullLatestOutputOk - -`func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutputOk() (*NodeConnectionMessageMetrics, bool)` - -GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOutPullLatestOutput - -`func (o *NodeConnectionMessagesMetrics) SetOutPullLatestOutput(v NodeConnectionMessageMetrics)` - -SetOutPullLatestOutput sets OutPullLatestOutput field to given value. - -### HasOutPullLatestOutput - -`func (o *NodeConnectionMessagesMetrics) HasOutPullLatestOutput() bool` - -HasOutPullLatestOutput returns a boolean if a field has been set. - -### GetOutPullOutputByID - -`func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByID() NodeConnectionMessageMetrics` - -GetOutPullOutputByID returns the OutPullOutputByID field if non-nil, zero value otherwise. - -### GetOutPullOutputByIDOk - -`func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByIDOk() (*NodeConnectionMessageMetrics, bool)` - -GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOutPullOutputByID - -`func (o *NodeConnectionMessagesMetrics) SetOutPullOutputByID(v NodeConnectionMessageMetrics)` - -SetOutPullOutputByID sets OutPullOutputByID field to given value. - -### HasOutPullOutputByID - -`func (o *NodeConnectionMessagesMetrics) HasOutPullOutputByID() bool` - -HasOutPullOutputByID returns a boolean if a field has been set. - -### GetOutPullTxInclusionState - -`func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionState() NodeConnectionMessageMetrics` - -GetOutPullTxInclusionState returns the OutPullTxInclusionState field if non-nil, zero value otherwise. - -### GetOutPullTxInclusionStateOk - -`func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool)` - -GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOutPullTxInclusionState - -`func (o *NodeConnectionMessagesMetrics) SetOutPullTxInclusionState(v NodeConnectionMessageMetrics)` - -SetOutPullTxInclusionState sets OutPullTxInclusionState field to given value. - -### HasOutPullTxInclusionState - -`func (o *NodeConnectionMessagesMetrics) HasOutPullTxInclusionState() bool` - -HasOutPullTxInclusionState returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/NodeConnectionMetrics.md b/clients/apiclient/docs/NodeConnectionMetrics.md deleted file mode 100644 index fd7e035c0c..0000000000 --- a/clients/apiclient/docs/NodeConnectionMetrics.md +++ /dev/null @@ -1,108 +0,0 @@ -# NodeConnectionMetrics - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**InMilestone** | Pointer to [**NodeConnectionMessageMetrics**](NodeConnectionMessageMetrics.md) | | [optional] -**NodeConnectionMessagesMetrics** | Pointer to [**NodeConnectionMessagesMetrics**](NodeConnectionMessagesMetrics.md) | | [optional] -**Registered** | Pointer to **[]string** | Chain IDs of the chains registered to receiving L1 events | [optional] - -## Methods - -### NewNodeConnectionMetrics - -`func NewNodeConnectionMetrics() *NodeConnectionMetrics` - -NewNodeConnectionMetrics instantiates a new NodeConnectionMetrics object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNodeConnectionMetricsWithDefaults - -`func NewNodeConnectionMetricsWithDefaults() *NodeConnectionMetrics` - -NewNodeConnectionMetricsWithDefaults instantiates a new NodeConnectionMetrics object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInMilestone - -`func (o *NodeConnectionMetrics) GetInMilestone() NodeConnectionMessageMetrics` - -GetInMilestone returns the InMilestone field if non-nil, zero value otherwise. - -### GetInMilestoneOk - -`func (o *NodeConnectionMetrics) GetInMilestoneOk() (*NodeConnectionMessageMetrics, bool)` - -GetInMilestoneOk returns a tuple with the InMilestone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInMilestone - -`func (o *NodeConnectionMetrics) SetInMilestone(v NodeConnectionMessageMetrics)` - -SetInMilestone sets InMilestone field to given value. - -### HasInMilestone - -`func (o *NodeConnectionMetrics) HasInMilestone() bool` - -HasInMilestone returns a boolean if a field has been set. - -### GetNodeConnectionMessagesMetrics - -`func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetrics() NodeConnectionMessagesMetrics` - -GetNodeConnectionMessagesMetrics returns the NodeConnectionMessagesMetrics field if non-nil, zero value otherwise. - -### GetNodeConnectionMessagesMetricsOk - -`func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetricsOk() (*NodeConnectionMessagesMetrics, bool)` - -GetNodeConnectionMessagesMetricsOk returns a tuple with the NodeConnectionMessagesMetrics field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNodeConnectionMessagesMetrics - -`func (o *NodeConnectionMetrics) SetNodeConnectionMessagesMetrics(v NodeConnectionMessagesMetrics)` - -SetNodeConnectionMessagesMetrics sets NodeConnectionMessagesMetrics field to given value. - -### HasNodeConnectionMessagesMetrics - -`func (o *NodeConnectionMetrics) HasNodeConnectionMessagesMetrics() bool` - -HasNodeConnectionMessagesMetrics returns a boolean if a field has been set. - -### GetRegistered - -`func (o *NodeConnectionMetrics) GetRegistered() []string` - -GetRegistered returns the Registered field if non-nil, zero value otherwise. - -### GetRegisteredOk - -`func (o *NodeConnectionMetrics) GetRegisteredOk() (*[]string, bool)` - -GetRegisteredOk returns a tuple with the Registered field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRegistered - -`func (o *NodeConnectionMetrics) SetRegistered(v []string)` - -SetRegistered sets Registered field to given value. - -### HasRegistered - -`func (o *NodeConnectionMetrics) HasRegistered() bool` - -HasRegistered returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/OffLedgerRequestBody.md b/clients/apiclient/docs/OffLedgerRequestBody.md deleted file mode 100644 index b30c320031..0000000000 --- a/clients/apiclient/docs/OffLedgerRequestBody.md +++ /dev/null @@ -1,56 +0,0 @@ -# OffLedgerRequestBody - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Request** | Pointer to **string** | Offledger Request (base64) | [optional] - -## Methods - -### NewOffLedgerRequestBody - -`func NewOffLedgerRequestBody() *OffLedgerRequestBody` - -NewOffLedgerRequestBody instantiates a new OffLedgerRequestBody object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOffLedgerRequestBodyWithDefaults - -`func NewOffLedgerRequestBodyWithDefaults() *OffLedgerRequestBody` - -NewOffLedgerRequestBodyWithDefaults instantiates a new OffLedgerRequestBody object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetRequest - -`func (o *OffLedgerRequestBody) GetRequest() string` - -GetRequest returns the Request field if non-nil, zero value otherwise. - -### GetRequestOk - -`func (o *OffLedgerRequestBody) GetRequestOk() (*string, bool)` - -GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequest - -`func (o *OffLedgerRequestBody) SetRequest(v string)` - -SetRequest sets Request field to given value. - -### HasRequest - -`func (o *OffLedgerRequestBody) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/PeeringNodeStatus.md b/clients/apiclient/docs/PeeringNodeStatus.md deleted file mode 100644 index d2c7252ac1..0000000000 --- a/clients/apiclient/docs/PeeringNodeStatus.md +++ /dev/null @@ -1,134 +0,0 @@ -# PeeringNodeStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IsAlive** | Pointer to **bool** | | [optional] -**NetID** | Pointer to **string** | | [optional] -**NumUsers** | Pointer to **uint32** | | [optional] -**PubKey** | Pointer to **string** | | [optional] - -## Methods - -### NewPeeringNodeStatus - -`func NewPeeringNodeStatus() *PeeringNodeStatus` - -NewPeeringNodeStatus instantiates a new PeeringNodeStatus object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPeeringNodeStatusWithDefaults - -`func NewPeeringNodeStatusWithDefaults() *PeeringNodeStatus` - -NewPeeringNodeStatusWithDefaults instantiates a new PeeringNodeStatus object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetIsAlive - -`func (o *PeeringNodeStatus) GetIsAlive() bool` - -GetIsAlive returns the IsAlive field if non-nil, zero value otherwise. - -### GetIsAliveOk - -`func (o *PeeringNodeStatus) GetIsAliveOk() (*bool, bool)` - -GetIsAliveOk returns a tuple with the IsAlive field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIsAlive - -`func (o *PeeringNodeStatus) SetIsAlive(v bool)` - -SetIsAlive sets IsAlive field to given value. - -### HasIsAlive - -`func (o *PeeringNodeStatus) HasIsAlive() bool` - -HasIsAlive returns a boolean if a field has been set. - -### GetNetID - -`func (o *PeeringNodeStatus) GetNetID() string` - -GetNetID returns the NetID field if non-nil, zero value otherwise. - -### GetNetIDOk - -`func (o *PeeringNodeStatus) GetNetIDOk() (*string, bool)` - -GetNetIDOk returns a tuple with the NetID field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNetID - -`func (o *PeeringNodeStatus) SetNetID(v string)` - -SetNetID sets NetID field to given value. - -### HasNetID - -`func (o *PeeringNodeStatus) HasNetID() bool` - -HasNetID returns a boolean if a field has been set. - -### GetNumUsers - -`func (o *PeeringNodeStatus) GetNumUsers() uint32` - -GetNumUsers returns the NumUsers field if non-nil, zero value otherwise. - -### GetNumUsersOk - -`func (o *PeeringNodeStatus) GetNumUsersOk() (*uint32, bool)` - -GetNumUsersOk returns a tuple with the NumUsers field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumUsers - -`func (o *PeeringNodeStatus) SetNumUsers(v uint32)` - -SetNumUsers sets NumUsers field to given value. - -### HasNumUsers - -`func (o *PeeringNodeStatus) HasNumUsers() bool` - -HasNumUsers returns a boolean if a field has been set. - -### GetPubKey - -`func (o *PeeringNodeStatus) GetPubKey() string` - -GetPubKey returns the PubKey field if non-nil, zero value otherwise. - -### GetPubKeyOk - -`func (o *PeeringNodeStatus) GetPubKeyOk() (*string, bool)` - -GetPubKeyOk returns a tuple with the PubKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPubKey - -`func (o *PeeringNodeStatus) SetPubKey(v string)` - -SetPubKey sets PubKey field to given value. - -### HasPubKey - -`func (o *PeeringNodeStatus) HasPubKey() bool` - -HasPubKey returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/PeeringTrustedNode.md b/clients/apiclient/docs/PeeringTrustedNode.md deleted file mode 100644 index 9822d183bd..0000000000 --- a/clients/apiclient/docs/PeeringTrustedNode.md +++ /dev/null @@ -1,82 +0,0 @@ -# PeeringTrustedNode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**NetId** | Pointer to **string** | NetID of a peer to trust. | [optional] -**PubKey** | Pointer to **string** | Public key of the NetID. | [optional] - -## Methods - -### NewPeeringTrustedNode - -`func NewPeeringTrustedNode() *PeeringTrustedNode` - -NewPeeringTrustedNode instantiates a new PeeringTrustedNode object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPeeringTrustedNodeWithDefaults - -`func NewPeeringTrustedNodeWithDefaults() *PeeringTrustedNode` - -NewPeeringTrustedNodeWithDefaults instantiates a new PeeringTrustedNode object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetNetId - -`func (o *PeeringTrustedNode) GetNetId() string` - -GetNetId returns the NetId field if non-nil, zero value otherwise. - -### GetNetIdOk - -`func (o *PeeringTrustedNode) GetNetIdOk() (*string, bool)` - -GetNetIdOk returns a tuple with the NetId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNetId - -`func (o *PeeringTrustedNode) SetNetId(v string)` - -SetNetId sets NetId field to given value. - -### HasNetId - -`func (o *PeeringTrustedNode) HasNetId() bool` - -HasNetId returns a boolean if a field has been set. - -### GetPubKey - -`func (o *PeeringTrustedNode) GetPubKey() string` - -GetPubKey returns the PubKey field if non-nil, zero value otherwise. - -### GetPubKeyOk - -`func (o *PeeringTrustedNode) GetPubKeyOk() (*string, bool)` - -GetPubKeyOk returns a tuple with the PubKey field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPubKey - -`func (o *PeeringTrustedNode) SetPubKey(v string)` - -SetPubKey sets PubKey field to given value. - -### HasPubKey - -`func (o *PeeringTrustedNode) HasPubKey() bool` - -HasPubKey returns a boolean if a field has been set. - - -[[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/clients/apiclient/docs/PublicApi.md b/clients/apiclient/docs/PublicApi.md deleted file mode 100644 index 4e1bfbc118..0000000000 --- a/clients/apiclient/docs/PublicApi.md +++ /dev/null @@ -1,802 +0,0 @@ -# \PublicApi - -All URIs are relative to *http://localhost:9090* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ChainChainIDContractContractHnameCallviewFnameGet**](PublicApi.md#ChainChainIDContractContractHnameCallviewFnameGet) | **Get** /chain/{chainID}/contract/{contractHname}/callview/{fname} | Call a view function on a contract by name -[**ChainChainIDContractContractHnameCallviewFnamePost**](PublicApi.md#ChainChainIDContractContractHnameCallviewFnamePost) | **Post** /chain/{chainID}/contract/{contractHname}/callview/{fname} | Call a view function on a contract by name -[**ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet**](PublicApi.md#ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet) | **Get** /chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname} | Call a view function on a contract by Hname -[**ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost**](PublicApi.md#ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost) | **Post** /chain/{chainID}/contract/{contractHname}/callviewbyhname/{functionHname} | Call a view function on a contract by Hname -[**ChainChainIDEvmReqidTxHashGet**](PublicApi.md#ChainChainIDEvmReqidTxHashGet) | **Get** /chain/{chainID}/evm/reqid/{txHash} | Get the ISC request ID for the given Ethereum transaction hash -[**ChainChainIDRequestPost**](PublicApi.md#ChainChainIDRequestPost) | **Post** /chain/{chainID}/request | Post an off-ledger request -[**ChainChainIDRequestReqIDReceiptGet**](PublicApi.md#ChainChainIDRequestReqIDReceiptGet) | **Get** /chain/{chainID}/request/{reqID}/receipt | Get the processing status of a given request in the node -[**ChainChainIDRequestReqIDWaitGet**](PublicApi.md#ChainChainIDRequestReqIDWaitGet) | **Get** /chain/{chainID}/request/{reqID}/wait | Wait until the given request has been processed by the node -[**ChainChainIDStateKeyGet**](PublicApi.md#ChainChainIDStateKeyGet) | **Get** /chain/{chainID}/state/{key} | Fetch the raw value associated with the given key in the chain state -[**ChainChainIDWsGet**](PublicApi.md#ChainChainIDWsGet) | **Get** /chain/{chainID}/ws | -[**InfoGet**](PublicApi.md#InfoGet) | **Get** /info | Get information about the node - - - -## ChainChainIDContractContractHnameCallviewFnameGet - -> JSONDict ChainChainIDContractContractHnameCallviewFnameGet(ctx, chainID, contractHname, fname).Params(params).Execute() - -Call a view function on a contract by name - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID - contractHname := "contractHname_example" // string | Contract Hname - fname := "fname_example" // string | Function name - params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnameGet(context.Background(), chainID, contractHname, fname).Params(params).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewFnameGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDContractContractHnameCallviewFnameGet`: JSONDict - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewFnameGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID | -**contractHname** | **string** | Contract Hname | -**fname** | **string** | Function name | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewFnameGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **params** | [**JSONDict**](JSONDict.md) | Parameters | - -### Return type - -[**JSONDict**](JSONDict.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## ChainChainIDContractContractHnameCallviewFnamePost - -> JSONDict ChainChainIDContractContractHnameCallviewFnamePost(ctx, chainID, contractHname, fname).Params(params).Execute() - -Call a view function on a contract by name - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID - contractHname := "contractHname_example" // string | Contract Hname - fname := "fname_example" // string | Function name - params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewFnamePost(context.Background(), chainID, contractHname, fname).Params(params).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewFnamePost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDContractContractHnameCallviewFnamePost`: JSONDict - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewFnamePost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID | -**contractHname** | **string** | Contract Hname | -**fname** | **string** | Function name | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewFnamePostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **params** | [**JSONDict**](JSONDict.md) | Parameters | - -### Return type - -[**JSONDict**](JSONDict.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet - -> JSONDict ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(ctx, chainID, contractHname, functionHname).Params(params).Execute() - -Call a view function on a contract by Hname - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID - contractHname := "contractHname_example" // string | Contract Hname - functionHname := "functionHname_example" // string | Function Hname - params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet(context.Background(), chainID, contractHname, functionHname).Params(params).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet`: JSONDict - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID | -**contractHname** | **string** | Contract Hname | -**functionHname** | **string** | Function Hname | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewbyhnameFunctionHnameGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **params** | [**JSONDict**](JSONDict.md) | Parameters | - -### Return type - -[**JSONDict**](JSONDict.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost - -> JSONDict ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(ctx, chainID, contractHname, functionHname).Params(params).Execute() - -Call a view function on a contract by Hname - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID - contractHname := "contractHname_example" // string | Contract Hname - functionHname := "functionHname_example" // string | Function Hname - params := *openapiclient.NewJSONDict() // JSONDict | Parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost(context.Background(), chainID, contractHname, functionHname).Params(params).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost`: JSONDict - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePost`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID | -**contractHname** | **string** | Contract Hname | -**functionHname** | **string** | Function Hname | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDContractContractHnameCallviewbyhnameFunctionHnamePostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **params** | [**JSONDict**](JSONDict.md) | Parameters | - -### Return type - -[**JSONDict**](JSONDict.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## ChainChainIDEvmReqidTxHashGet - -> string ChainChainIDEvmReqidTxHashGet(ctx, chainID, txHash).Execute() - -Get the ISC request ID for the given Ethereum transaction hash - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32-encoded) - txHash := "txHash_example" // string | Transaction hash (hex-encoded) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDEvmReqidTxHashGet(context.Background(), chainID, txHash).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDEvmReqidTxHashGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDEvmReqidTxHashGet`: string - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDEvmReqidTxHashGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32-encoded) | -**txHash** | **string** | Transaction hash (hex-encoded) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDEvmReqidTxHashGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -**string** - -### 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) - - -## ChainChainIDRequestPost - -> ChainChainIDRequestPost(ctx, chainID).Request(request).Execute() - -Post an off-ledger request - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | chainID - request := *openapiclient.NewOffLedgerRequestBody() // OffLedgerRequestBody | Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\" (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDRequestPost(context.Background(), chainID).Request(request).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDRequestPost``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | chainID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDRequestPostRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **request** | [**OffLedgerRequestBody**](OffLedgerRequestBody.md) | Offledger Request encoded in base64. Optionally, the body can be the binary representation of the offledger request, but mime-type must be specified to \"application/octet-stream\" | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[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) - - -## ChainChainIDRequestReqIDReceiptGet - -> RequestReceiptResponse ChainChainIDRequestReqIDReceiptGet(ctx, chainID, reqID).Execute() - -Get the processing status of a given request in the node - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32) - reqID := "reqID_example" // string | Request ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDRequestReqIDReceiptGet(context.Background(), chainID, reqID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDRequestReqIDReceiptGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDRequestReqIDReceiptGet`: RequestReceiptResponse - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDRequestReqIDReceiptGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32) | -**reqID** | **string** | Request ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDRequestReqIDReceiptGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**RequestReceiptResponse**](RequestReceiptResponse.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) - - -## ChainChainIDRequestReqIDWaitGet - -> RequestReceiptResponse ChainChainIDRequestReqIDWaitGet(ctx, chainID, reqID).Params(params).Execute() - -Wait until the given request has been processed by the node - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32) - reqID := "reqID_example" // string | Request ID - params := *openapiclient.NewWaitRequestProcessedParams() // WaitRequestProcessedParams | Optional parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDRequestReqIDWaitGet(context.Background(), chainID, reqID).Params(params).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDRequestReqIDWaitGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDRequestReqIDWaitGet`: RequestReceiptResponse - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDRequestReqIDWaitGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32) | -**reqID** | **string** | Request ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDRequestReqIDWaitGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **params** | [**WaitRequestProcessedParams**](WaitRequestProcessedParams.md) | Optional parameters | - -### Return type - -[**RequestReceiptResponse**](RequestReceiptResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## ChainChainIDStateKeyGet - -> []int32 ChainChainIDStateKeyGet(ctx, chainID, key).Execute() - -Fetch the raw value associated with the given key in the chain state - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID - key := "key_example" // string | Key (hex-encoded) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDStateKeyGet(context.Background(), chainID, key).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDStateKeyGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ChainChainIDStateKeyGet`: []int32 - fmt.Fprintf(os.Stdout, "Response from `PublicApi.ChainChainIDStateKeyGet`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID | -**key** | **string** | Key (hex-encoded) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDStateKeyGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -**[]int32** - -### 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) - - -## ChainChainIDWsGet - -> ChainChainIDWsGet(ctx, chainID).Execute() - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - chainID := "chainID_example" // string | ChainID (bech32-encoded) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.ChainChainIDWsGet(context.Background(), chainID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.ChainChainIDWsGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**chainID** | **string** | ChainID (bech32-encoded) | - -### Other Parameters - -Other parameters are passed through a pointer to a apiChainChainIDWsGetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## InfoGet - -> InfoResponse InfoGet(ctx).Execute() - -Get information about the node - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PublicApi.InfoGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PublicApi.InfoGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `InfoGet`: InfoResponse - fmt.Fprintf(os.Stdout, "Response from `PublicApi.InfoGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiInfoGetRequest struct via the builder pattern - - -### Return type - -[**InfoResponse**](InfoResponse.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/clients/apiclient/docs/RequestsApi.md b/clients/apiclient/docs/RequestsApi.md index c01a93200c..616f6a60ea 100644 --- a/clients/apiclient/docs/RequestsApi.md +++ b/clients/apiclient/docs/RequestsApi.md @@ -4,10 +4,10 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CallView**](RequestsApi.md#CallView) | **Post** /v2/requests/callview | Call a view function on a contract by Hname -[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /v2/chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID -[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /v2/requests/offledger | Post an off-ledger request -[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /v2/chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node +[**CallView**](RequestsApi.md#CallView) | **Post** /requests/callview | Call a view function on a contract by Hname +[**GetReceipt**](RequestsApi.md#GetReceipt) | **Get** /chains/{chainID}/receipts/{requestID} | Get a receipt from a request ID +[**OffLedger**](RequestsApi.md#OffLedger) | **Post** /requests/offledger | Post an off-ledger request +[**WaitForRequest**](RequestsApi.md#WaitForRequest) | **Get** /chains/{chainID}/requests/{requestID}/wait | Wait until the given request has been processed by the node diff --git a/clients/apiclient/docs/UsersApi.md b/clients/apiclient/docs/UsersApi.md index ad340e348a..e8e49e2f5a 100644 --- a/clients/apiclient/docs/UsersApi.md +++ b/clients/apiclient/docs/UsersApi.md @@ -4,12 +4,12 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AddUser**](UsersApi.md#AddUser) | **Post** /v2/users | Add a user -[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /v2/users/{username}/password | Change user password -[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /v2/users/{username}/permissions | Change user permissions -[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /v2/users/{username} | Deletes a user -[**GetUser**](UsersApi.md#GetUser) | **Get** /v2/users/{username} | Get a user -[**GetUsers**](UsersApi.md#GetUsers) | **Get** /v2/users | Get a list of all users +[**AddUser**](UsersApi.md#AddUser) | **Post** /users | Add a user +[**ChangeUserPassword**](UsersApi.md#ChangeUserPassword) | **Put** /users/{username}/password | Change user password +[**ChangeUserPermissions**](UsersApi.md#ChangeUserPermissions) | **Put** /users/{username}/permissions | Change user permissions +[**DeleteUser**](UsersApi.md#DeleteUser) | **Delete** /users/{username} | Deletes a user +[**GetUser**](UsersApi.md#GetUser) | **Get** /users/{username} | Get a user +[**GetUsers**](UsersApi.md#GetUsers) | **Get** /users | Get a list of all users diff --git a/clients/apiclient/docs/WaitRequestProcessedParams.md b/clients/apiclient/docs/WaitRequestProcessedParams.md deleted file mode 100644 index e9c07f17ae..0000000000 --- a/clients/apiclient/docs/WaitRequestProcessedParams.md +++ /dev/null @@ -1,56 +0,0 @@ -# WaitRequestProcessedParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Timeout** | Pointer to **int64** | Timeout in nanoseconds | [optional] - -## Methods - -### NewWaitRequestProcessedParams - -`func NewWaitRequestProcessedParams() *WaitRequestProcessedParams` - -NewWaitRequestProcessedParams instantiates a new WaitRequestProcessedParams object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWaitRequestProcessedParamsWithDefaults - -`func NewWaitRequestProcessedParamsWithDefaults() *WaitRequestProcessedParams` - -NewWaitRequestProcessedParamsWithDefaults instantiates a new WaitRequestProcessedParams object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetTimeout - -`func (o *WaitRequestProcessedParams) GetTimeout() int64` - -GetTimeout returns the Timeout field if non-nil, zero value otherwise. - -### GetTimeoutOk - -`func (o *WaitRequestProcessedParams) GetTimeoutOk() (*int64, bool)` - -GetTimeoutOk returns a tuple with the Timeout field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeout - -`func (o *WaitRequestProcessedParams) SetTimeout(v int64)` - -SetTimeout sets Timeout field to given value. - -### HasTimeout - -`func (o *WaitRequestProcessedParams) HasTimeout() bool` - -HasTimeout returns a boolean if a field has been set. - - -[[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/clients/apiclient/model_allowance.go b/clients/apiclient/model_allowance.go deleted file mode 100644 index 2151db83a2..0000000000 --- a/clients/apiclient/model_allowance.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the Allowance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Allowance{} - -// Allowance struct for Allowance -type Allowance struct { - FungibleTokens FungibleTokens `json:"fungibleTokens"` - Nfts []string `json:"nfts"` -} - -// NewAllowance instantiates a new Allowance object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAllowance(fungibleTokens FungibleTokens, nfts []string) *Allowance { - this := Allowance{} - this.FungibleTokens = fungibleTokens - this.Nfts = nfts - return &this -} - -// NewAllowanceWithDefaults instantiates a new Allowance object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAllowanceWithDefaults() *Allowance { - this := Allowance{} - return &this -} - -// GetFungibleTokens returns the FungibleTokens field value -func (o *Allowance) GetFungibleTokens() FungibleTokens { - if o == nil { - var ret FungibleTokens - return ret - } - - return o.FungibleTokens -} - -// GetFungibleTokensOk returns a tuple with the FungibleTokens field value -// and a boolean to check if the value has been set. -func (o *Allowance) GetFungibleTokensOk() (*FungibleTokens, bool) { - if o == nil { - return nil, false - } - return &o.FungibleTokens, true -} - -// SetFungibleTokens sets field value -func (o *Allowance) SetFungibleTokens(v FungibleTokens) { - o.FungibleTokens = v -} - -// GetNfts returns the Nfts field value -func (o *Allowance) GetNfts() []string { - if o == nil { - var ret []string - return ret - } - - return o.Nfts -} - -// GetNftsOk returns a tuple with the Nfts field value -// and a boolean to check if the value has been set. -func (o *Allowance) GetNftsOk() ([]string, bool) { - if o == nil { - return nil, false - } - return o.Nfts, true -} - -// SetNfts sets field value -func (o *Allowance) SetNfts(v []string) { - o.Nfts = v -} - -func (o Allowance) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Allowance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["fungibleTokens"] = o.FungibleTokens - toSerialize["nfts"] = o.Nfts - return toSerialize, nil -} - -type NullableAllowance struct { - value *Allowance - isSet bool -} - -func (v NullableAllowance) Get() *Allowance { - return v.value -} - -func (v *NullableAllowance) Set(val *Allowance) { - v.value = val - v.isSet = true -} - -func (v NullableAllowance) IsSet() bool { - return v.isSet -} - -func (v *NullableAllowance) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAllowance(val *Allowance) *NullableAllowance { - return &NullableAllowance{value: val, isSet: true} -} - -func (v NullableAllowance) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAllowance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_consensus_workflow_status.go b/clients/apiclient/model_consensus_workflow_status.go deleted file mode 100644 index e400200968..0000000000 --- a/clients/apiclient/model_consensus_workflow_status.go +++ /dev/null @@ -1,757 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" - "time" -) - -// checks if the ConsensusWorkflowStatus type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ConsensusWorkflowStatus{} - -// ConsensusWorkflowStatus struct for ConsensusWorkflowStatus -type ConsensusWorkflowStatus struct { - // Shows current state index of the consensus - CurrentStateIndex *uint32 `json:"currentStateIndex,omitempty"` - // Shows if batch proposal is sent out in current consensus iteration - FlagBatchProposalSent *bool `json:"flagBatchProposalSent,omitempty"` - // Shows if consensus on batch is reached and known in current consensus iteration - FlagConsensusBatchKnown *bool `json:"flagConsensusBatchKnown,omitempty"` - // Shows if consensus algorithm is still not completed in current consensus iteration - FlagInProgress *bool `json:"flagInProgress,omitempty"` - // Shows if state output is received in current consensus iteration - FlagStateReceived *bool `json:"flagStateReceived,omitempty"` - // Shows if consensus on transaction is reached in current consensus iteration - FlagTransactionFinalized *bool `json:"flagTransactionFinalized,omitempty"` - // Shows if transaction is posted to L1 in current consensus iteration - FlagTransactionPosted *bool `json:"flagTransactionPosted,omitempty"` - // Shows if L1 reported that it has seen the transaction of current consensus iteration - FlagTransactionSeen *bool `json:"flagTransactionSeen,omitempty"` - // Shows if virtual machine has returned its results in current consensus iteration - FlagVMResultSigned *bool `json:"flagVMResultSigned,omitempty"` - // Shows if virtual machine is started in current consensus iteration - FlagVMStarted *bool `json:"flagVMStarted,omitempty"` - // Shows when batch proposal was last sent out in current consensus iteration - TimeBatchProposalSent *time.Time `json:"timeBatchProposalSent,omitempty"` - // Shows when algorithm was last completed in current consensus iteration - TimeCompleted *time.Time `json:"timeCompleted,omitempty"` - // Shows when ACS results of consensus on batch was last received in current consensus iteration - TimeConsensusBatchKnown *time.Time `json:"timeConsensusBatchKnown,omitempty"` - // Shows when algorithm last noted that all the data for consensus on transaction had been received in current consensus iteration - TimeTransactionFinalized *time.Time `json:"timeTransactionFinalized,omitempty"` - // Shows when transaction was last posted to L1 in current consensus iteration - TimeTransactionPosted *time.Time `json:"timeTransactionPosted,omitempty"` - // Shows when algorithm last noted that transaction hadd been seen by L1 in current consensus iteration - TimeTransactionSeen *time.Time `json:"timeTransactionSeen,omitempty"` - // Shows when virtual machine results were last received and signed in current consensus iteration - TimeVMResultSigned *time.Time `json:"timeVMResultSigned,omitempty"` - // Shows when virtual machine was last started in current consensus iteration - TimeVMStarted *time.Time `json:"timeVMStarted,omitempty"` -} - -// NewConsensusWorkflowStatus instantiates a new ConsensusWorkflowStatus object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewConsensusWorkflowStatus() *ConsensusWorkflowStatus { - this := ConsensusWorkflowStatus{} - return &this -} - -// NewConsensusWorkflowStatusWithDefaults instantiates a new ConsensusWorkflowStatus object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewConsensusWorkflowStatusWithDefaults() *ConsensusWorkflowStatus { - this := ConsensusWorkflowStatus{} - return &this -} - -// GetCurrentStateIndex returns the CurrentStateIndex field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetCurrentStateIndex() uint32 { - if o == nil || isNil(o.CurrentStateIndex) { - var ret uint32 - return ret - } - return *o.CurrentStateIndex -} - -// GetCurrentStateIndexOk returns a tuple with the CurrentStateIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetCurrentStateIndexOk() (*uint32, bool) { - if o == nil || isNil(o.CurrentStateIndex) { - return nil, false - } - return o.CurrentStateIndex, true -} - -// HasCurrentStateIndex returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasCurrentStateIndex() bool { - if o != nil && !isNil(o.CurrentStateIndex) { - return true - } - - return false -} - -// SetCurrentStateIndex gets a reference to the given uint32 and assigns it to the CurrentStateIndex field. -func (o *ConsensusWorkflowStatus) SetCurrentStateIndex(v uint32) { - o.CurrentStateIndex = &v -} - -// GetFlagBatchProposalSent returns the FlagBatchProposalSent field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSent() bool { - if o == nil || isNil(o.FlagBatchProposalSent) { - var ret bool - return ret - } - return *o.FlagBatchProposalSent -} - -// GetFlagBatchProposalSentOk returns a tuple with the FlagBatchProposalSent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagBatchProposalSentOk() (*bool, bool) { - if o == nil || isNil(o.FlagBatchProposalSent) { - return nil, false - } - return o.FlagBatchProposalSent, true -} - -// HasFlagBatchProposalSent returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagBatchProposalSent() bool { - if o != nil && !isNil(o.FlagBatchProposalSent) { - return true - } - - return false -} - -// SetFlagBatchProposalSent gets a reference to the given bool and assigns it to the FlagBatchProposalSent field. -func (o *ConsensusWorkflowStatus) SetFlagBatchProposalSent(v bool) { - o.FlagBatchProposalSent = &v -} - -// GetFlagConsensusBatchKnown returns the FlagConsensusBatchKnown field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnown() bool { - if o == nil || isNil(o.FlagConsensusBatchKnown) { - var ret bool - return ret - } - return *o.FlagConsensusBatchKnown -} - -// GetFlagConsensusBatchKnownOk returns a tuple with the FlagConsensusBatchKnown field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagConsensusBatchKnownOk() (*bool, bool) { - if o == nil || isNil(o.FlagConsensusBatchKnown) { - return nil, false - } - return o.FlagConsensusBatchKnown, true -} - -// HasFlagConsensusBatchKnown returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagConsensusBatchKnown() bool { - if o != nil && !isNil(o.FlagConsensusBatchKnown) { - return true - } - - return false -} - -// SetFlagConsensusBatchKnown gets a reference to the given bool and assigns it to the FlagConsensusBatchKnown field. -func (o *ConsensusWorkflowStatus) SetFlagConsensusBatchKnown(v bool) { - o.FlagConsensusBatchKnown = &v -} - -// GetFlagInProgress returns the FlagInProgress field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagInProgress() bool { - if o == nil || isNil(o.FlagInProgress) { - var ret bool - return ret - } - return *o.FlagInProgress -} - -// GetFlagInProgressOk returns a tuple with the FlagInProgress field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagInProgressOk() (*bool, bool) { - if o == nil || isNil(o.FlagInProgress) { - return nil, false - } - return o.FlagInProgress, true -} - -// HasFlagInProgress returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagInProgress() bool { - if o != nil && !isNil(o.FlagInProgress) { - return true - } - - return false -} - -// SetFlagInProgress gets a reference to the given bool and assigns it to the FlagInProgress field. -func (o *ConsensusWorkflowStatus) SetFlagInProgress(v bool) { - o.FlagInProgress = &v -} - -// GetFlagStateReceived returns the FlagStateReceived field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagStateReceived() bool { - if o == nil || isNil(o.FlagStateReceived) { - var ret bool - return ret - } - return *o.FlagStateReceived -} - -// GetFlagStateReceivedOk returns a tuple with the FlagStateReceived field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagStateReceivedOk() (*bool, bool) { - if o == nil || isNil(o.FlagStateReceived) { - return nil, false - } - return o.FlagStateReceived, true -} - -// HasFlagStateReceived returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagStateReceived() bool { - if o != nil && !isNil(o.FlagStateReceived) { - return true - } - - return false -} - -// SetFlagStateReceived gets a reference to the given bool and assigns it to the FlagStateReceived field. -func (o *ConsensusWorkflowStatus) SetFlagStateReceived(v bool) { - o.FlagStateReceived = &v -} - -// GetFlagTransactionFinalized returns the FlagTransactionFinalized field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalized() bool { - if o == nil || isNil(o.FlagTransactionFinalized) { - var ret bool - return ret - } - return *o.FlagTransactionFinalized -} - -// GetFlagTransactionFinalizedOk returns a tuple with the FlagTransactionFinalized field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagTransactionFinalizedOk() (*bool, bool) { - if o == nil || isNil(o.FlagTransactionFinalized) { - return nil, false - } - return o.FlagTransactionFinalized, true -} - -// HasFlagTransactionFinalized returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagTransactionFinalized() bool { - if o != nil && !isNil(o.FlagTransactionFinalized) { - return true - } - - return false -} - -// SetFlagTransactionFinalized gets a reference to the given bool and assigns it to the FlagTransactionFinalized field. -func (o *ConsensusWorkflowStatus) SetFlagTransactionFinalized(v bool) { - o.FlagTransactionFinalized = &v -} - -// GetFlagTransactionPosted returns the FlagTransactionPosted field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagTransactionPosted() bool { - if o == nil || isNil(o.FlagTransactionPosted) { - var ret bool - return ret - } - return *o.FlagTransactionPosted -} - -// GetFlagTransactionPostedOk returns a tuple with the FlagTransactionPosted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagTransactionPostedOk() (*bool, bool) { - if o == nil || isNil(o.FlagTransactionPosted) { - return nil, false - } - return o.FlagTransactionPosted, true -} - -// HasFlagTransactionPosted returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagTransactionPosted() bool { - if o != nil && !isNil(o.FlagTransactionPosted) { - return true - } - - return false -} - -// SetFlagTransactionPosted gets a reference to the given bool and assigns it to the FlagTransactionPosted field. -func (o *ConsensusWorkflowStatus) SetFlagTransactionPosted(v bool) { - o.FlagTransactionPosted = &v -} - -// GetFlagTransactionSeen returns the FlagTransactionSeen field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagTransactionSeen() bool { - if o == nil || isNil(o.FlagTransactionSeen) { - var ret bool - return ret - } - return *o.FlagTransactionSeen -} - -// GetFlagTransactionSeenOk returns a tuple with the FlagTransactionSeen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagTransactionSeenOk() (*bool, bool) { - if o == nil || isNil(o.FlagTransactionSeen) { - return nil, false - } - return o.FlagTransactionSeen, true -} - -// HasFlagTransactionSeen returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagTransactionSeen() bool { - if o != nil && !isNil(o.FlagTransactionSeen) { - return true - } - - return false -} - -// SetFlagTransactionSeen gets a reference to the given bool and assigns it to the FlagTransactionSeen field. -func (o *ConsensusWorkflowStatus) SetFlagTransactionSeen(v bool) { - o.FlagTransactionSeen = &v -} - -// GetFlagVMResultSigned returns the FlagVMResultSigned field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagVMResultSigned() bool { - if o == nil || isNil(o.FlagVMResultSigned) { - var ret bool - return ret - } - return *o.FlagVMResultSigned -} - -// GetFlagVMResultSignedOk returns a tuple with the FlagVMResultSigned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagVMResultSignedOk() (*bool, bool) { - if o == nil || isNil(o.FlagVMResultSigned) { - return nil, false - } - return o.FlagVMResultSigned, true -} - -// HasFlagVMResultSigned returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagVMResultSigned() bool { - if o != nil && !isNil(o.FlagVMResultSigned) { - return true - } - - return false -} - -// SetFlagVMResultSigned gets a reference to the given bool and assigns it to the FlagVMResultSigned field. -func (o *ConsensusWorkflowStatus) SetFlagVMResultSigned(v bool) { - o.FlagVMResultSigned = &v -} - -// GetFlagVMStarted returns the FlagVMStarted field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetFlagVMStarted() bool { - if o == nil || isNil(o.FlagVMStarted) { - var ret bool - return ret - } - return *o.FlagVMStarted -} - -// GetFlagVMStartedOk returns a tuple with the FlagVMStarted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetFlagVMStartedOk() (*bool, bool) { - if o == nil || isNil(o.FlagVMStarted) { - return nil, false - } - return o.FlagVMStarted, true -} - -// HasFlagVMStarted returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasFlagVMStarted() bool { - if o != nil && !isNil(o.FlagVMStarted) { - return true - } - - return false -} - -// SetFlagVMStarted gets a reference to the given bool and assigns it to the FlagVMStarted field. -func (o *ConsensusWorkflowStatus) SetFlagVMStarted(v bool) { - o.FlagVMStarted = &v -} - -// GetTimeBatchProposalSent returns the TimeBatchProposalSent field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSent() time.Time { - if o == nil || isNil(o.TimeBatchProposalSent) { - var ret time.Time - return ret - } - return *o.TimeBatchProposalSent -} - -// GetTimeBatchProposalSentOk returns a tuple with the TimeBatchProposalSent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeBatchProposalSentOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeBatchProposalSent) { - return nil, false - } - return o.TimeBatchProposalSent, true -} - -// HasTimeBatchProposalSent returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeBatchProposalSent() bool { - if o != nil && !isNil(o.TimeBatchProposalSent) { - return true - } - - return false -} - -// SetTimeBatchProposalSent gets a reference to the given time.Time and assigns it to the TimeBatchProposalSent field. -func (o *ConsensusWorkflowStatus) SetTimeBatchProposalSent(v time.Time) { - o.TimeBatchProposalSent = &v -} - -// GetTimeCompleted returns the TimeCompleted field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeCompleted() time.Time { - if o == nil || isNil(o.TimeCompleted) { - var ret time.Time - return ret - } - return *o.TimeCompleted -} - -// GetTimeCompletedOk returns a tuple with the TimeCompleted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeCompletedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeCompleted) { - return nil, false - } - return o.TimeCompleted, true -} - -// HasTimeCompleted returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeCompleted() bool { - if o != nil && !isNil(o.TimeCompleted) { - return true - } - - return false -} - -// SetTimeCompleted gets a reference to the given time.Time and assigns it to the TimeCompleted field. -func (o *ConsensusWorkflowStatus) SetTimeCompleted(v time.Time) { - o.TimeCompleted = &v -} - -// GetTimeConsensusBatchKnown returns the TimeConsensusBatchKnown field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnown() time.Time { - if o == nil || isNil(o.TimeConsensusBatchKnown) { - var ret time.Time - return ret - } - return *o.TimeConsensusBatchKnown -} - -// GetTimeConsensusBatchKnownOk returns a tuple with the TimeConsensusBatchKnown field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeConsensusBatchKnownOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeConsensusBatchKnown) { - return nil, false - } - return o.TimeConsensusBatchKnown, true -} - -// HasTimeConsensusBatchKnown returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeConsensusBatchKnown() bool { - if o != nil && !isNil(o.TimeConsensusBatchKnown) { - return true - } - - return false -} - -// SetTimeConsensusBatchKnown gets a reference to the given time.Time and assigns it to the TimeConsensusBatchKnown field. -func (o *ConsensusWorkflowStatus) SetTimeConsensusBatchKnown(v time.Time) { - o.TimeConsensusBatchKnown = &v -} - -// GetTimeTransactionFinalized returns the TimeTransactionFinalized field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalized() time.Time { - if o == nil || isNil(o.TimeTransactionFinalized) { - var ret time.Time - return ret - } - return *o.TimeTransactionFinalized -} - -// GetTimeTransactionFinalizedOk returns a tuple with the TimeTransactionFinalized field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeTransactionFinalizedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeTransactionFinalized) { - return nil, false - } - return o.TimeTransactionFinalized, true -} - -// HasTimeTransactionFinalized returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeTransactionFinalized() bool { - if o != nil && !isNil(o.TimeTransactionFinalized) { - return true - } - - return false -} - -// SetTimeTransactionFinalized gets a reference to the given time.Time and assigns it to the TimeTransactionFinalized field. -func (o *ConsensusWorkflowStatus) SetTimeTransactionFinalized(v time.Time) { - o.TimeTransactionFinalized = &v -} - -// GetTimeTransactionPosted returns the TimeTransactionPosted field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeTransactionPosted() time.Time { - if o == nil || isNil(o.TimeTransactionPosted) { - var ret time.Time - return ret - } - return *o.TimeTransactionPosted -} - -// GetTimeTransactionPostedOk returns a tuple with the TimeTransactionPosted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeTransactionPostedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeTransactionPosted) { - return nil, false - } - return o.TimeTransactionPosted, true -} - -// HasTimeTransactionPosted returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeTransactionPosted() bool { - if o != nil && !isNil(o.TimeTransactionPosted) { - return true - } - - return false -} - -// SetTimeTransactionPosted gets a reference to the given time.Time and assigns it to the TimeTransactionPosted field. -func (o *ConsensusWorkflowStatus) SetTimeTransactionPosted(v time.Time) { - o.TimeTransactionPosted = &v -} - -// GetTimeTransactionSeen returns the TimeTransactionSeen field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeTransactionSeen() time.Time { - if o == nil || isNil(o.TimeTransactionSeen) { - var ret time.Time - return ret - } - return *o.TimeTransactionSeen -} - -// GetTimeTransactionSeenOk returns a tuple with the TimeTransactionSeen field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeTransactionSeenOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeTransactionSeen) { - return nil, false - } - return o.TimeTransactionSeen, true -} - -// HasTimeTransactionSeen returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeTransactionSeen() bool { - if o != nil && !isNil(o.TimeTransactionSeen) { - return true - } - - return false -} - -// SetTimeTransactionSeen gets a reference to the given time.Time and assigns it to the TimeTransactionSeen field. -func (o *ConsensusWorkflowStatus) SetTimeTransactionSeen(v time.Time) { - o.TimeTransactionSeen = &v -} - -// GetTimeVMResultSigned returns the TimeVMResultSigned field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeVMResultSigned() time.Time { - if o == nil || isNil(o.TimeVMResultSigned) { - var ret time.Time - return ret - } - return *o.TimeVMResultSigned -} - -// GetTimeVMResultSignedOk returns a tuple with the TimeVMResultSigned field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeVMResultSignedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeVMResultSigned) { - return nil, false - } - return o.TimeVMResultSigned, true -} - -// HasTimeVMResultSigned returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeVMResultSigned() bool { - if o != nil && !isNil(o.TimeVMResultSigned) { - return true - } - - return false -} - -// SetTimeVMResultSigned gets a reference to the given time.Time and assigns it to the TimeVMResultSigned field. -func (o *ConsensusWorkflowStatus) SetTimeVMResultSigned(v time.Time) { - o.TimeVMResultSigned = &v -} - -// GetTimeVMStarted returns the TimeVMStarted field value if set, zero value otherwise. -func (o *ConsensusWorkflowStatus) GetTimeVMStarted() time.Time { - if o == nil || isNil(o.TimeVMStarted) { - var ret time.Time - return ret - } - return *o.TimeVMStarted -} - -// GetTimeVMStartedOk returns a tuple with the TimeVMStarted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ConsensusWorkflowStatus) GetTimeVMStartedOk() (*time.Time, bool) { - if o == nil || isNil(o.TimeVMStarted) { - return nil, false - } - return o.TimeVMStarted, true -} - -// HasTimeVMStarted returns a boolean if a field has been set. -func (o *ConsensusWorkflowStatus) HasTimeVMStarted() bool { - if o != nil && !isNil(o.TimeVMStarted) { - return true - } - - return false -} - -// SetTimeVMStarted gets a reference to the given time.Time and assigns it to the TimeVMStarted field. -func (o *ConsensusWorkflowStatus) SetTimeVMStarted(v time.Time) { - o.TimeVMStarted = &v -} - -func (o ConsensusWorkflowStatus) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o ConsensusWorkflowStatus) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.CurrentStateIndex) { - toSerialize["currentStateIndex"] = o.CurrentStateIndex - } - if !isNil(o.FlagBatchProposalSent) { - toSerialize["flagBatchProposalSent"] = o.FlagBatchProposalSent - } - if !isNil(o.FlagConsensusBatchKnown) { - toSerialize["flagConsensusBatchKnown"] = o.FlagConsensusBatchKnown - } - if !isNil(o.FlagInProgress) { - toSerialize["flagInProgress"] = o.FlagInProgress - } - if !isNil(o.FlagStateReceived) { - toSerialize["flagStateReceived"] = o.FlagStateReceived - } - if !isNil(o.FlagTransactionFinalized) { - toSerialize["flagTransactionFinalized"] = o.FlagTransactionFinalized - } - if !isNil(o.FlagTransactionPosted) { - toSerialize["flagTransactionPosted"] = o.FlagTransactionPosted - } - if !isNil(o.FlagTransactionSeen) { - toSerialize["flagTransactionSeen"] = o.FlagTransactionSeen - } - if !isNil(o.FlagVMResultSigned) { - toSerialize["flagVMResultSigned"] = o.FlagVMResultSigned - } - if !isNil(o.FlagVMStarted) { - toSerialize["flagVMStarted"] = o.FlagVMStarted - } - if !isNil(o.TimeBatchProposalSent) { - toSerialize["timeBatchProposalSent"] = o.TimeBatchProposalSent - } - if !isNil(o.TimeCompleted) { - toSerialize["timeCompleted"] = o.TimeCompleted - } - if !isNil(o.TimeConsensusBatchKnown) { - toSerialize["timeConsensusBatchKnown"] = o.TimeConsensusBatchKnown - } - if !isNil(o.TimeTransactionFinalized) { - toSerialize["timeTransactionFinalized"] = o.TimeTransactionFinalized - } - if !isNil(o.TimeTransactionPosted) { - toSerialize["timeTransactionPosted"] = o.TimeTransactionPosted - } - if !isNil(o.TimeTransactionSeen) { - toSerialize["timeTransactionSeen"] = o.TimeTransactionSeen - } - if !isNil(o.TimeVMResultSigned) { - toSerialize["timeVMResultSigned"] = o.TimeVMResultSigned - } - if !isNil(o.TimeVMStarted) { - toSerialize["timeVMStarted"] = o.TimeVMStarted - } - return toSerialize, nil -} - -type NullableConsensusWorkflowStatus struct { - value *ConsensusWorkflowStatus - isSet bool -} - -func (v NullableConsensusWorkflowStatus) Get() *ConsensusWorkflowStatus { - return v.value -} - -func (v *NullableConsensusWorkflowStatus) Set(val *ConsensusWorkflowStatus) { - v.value = val - v.isSet = true -} - -func (v NullableConsensusWorkflowStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableConsensusWorkflowStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConsensusWorkflowStatus(val *ConsensusWorkflowStatus) *NullableConsensusWorkflowStatus { - return &NullableConsensusWorkflowStatus{value: val, isSet: true} -} - -func (v NullableConsensusWorkflowStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConsensusWorkflowStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_fungible_tokens.go b/clients/apiclient/model_fungible_tokens.go deleted file mode 100644 index b524b670eb..0000000000 --- a/clients/apiclient/model_fungible_tokens.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the FungibleTokens type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &FungibleTokens{} - -// FungibleTokens struct for FungibleTokens -type FungibleTokens struct { - BaseTokens int64 `json:"baseTokens"` - NativeTokens []NativeToken `json:"nativeTokens"` -} - -// NewFungibleTokens instantiates a new FungibleTokens object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFungibleTokens(baseTokens int64, nativeTokens []NativeToken) *FungibleTokens { - this := FungibleTokens{} - this.BaseTokens = baseTokens - this.NativeTokens = nativeTokens - return &this -} - -// NewFungibleTokensWithDefaults instantiates a new FungibleTokens object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFungibleTokensWithDefaults() *FungibleTokens { - this := FungibleTokens{} - return &this -} - -// GetBaseTokens returns the BaseTokens field value -func (o *FungibleTokens) GetBaseTokens() int64 { - if o == nil { - var ret int64 - return ret - } - - return o.BaseTokens -} - -// GetBaseTokensOk returns a tuple with the BaseTokens field value -// and a boolean to check if the value has been set. -func (o *FungibleTokens) GetBaseTokensOk() (*int64, bool) { - if o == nil { - return nil, false - } - return &o.BaseTokens, true -} - -// SetBaseTokens sets field value -func (o *FungibleTokens) SetBaseTokens(v int64) { - o.BaseTokens = v -} - -// GetNativeTokens returns the NativeTokens field value -func (o *FungibleTokens) GetNativeTokens() []NativeToken { - if o == nil { - var ret []NativeToken - return ret - } - - return o.NativeTokens -} - -// GetNativeTokensOk returns a tuple with the NativeTokens field value -// and a boolean to check if the value has been set. -func (o *FungibleTokens) GetNativeTokensOk() ([]NativeToken, bool) { - if o == nil { - return nil, false - } - return o.NativeTokens, true -} - -// SetNativeTokens sets field value -func (o *FungibleTokens) SetNativeTokens(v []NativeToken) { - o.NativeTokens = v -} - -func (o FungibleTokens) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o FungibleTokens) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["baseTokens"] = o.BaseTokens - toSerialize["nativeTokens"] = o.NativeTokens - return toSerialize, nil -} - -type NullableFungibleTokens struct { - value *FungibleTokens - isSet bool -} - -func (v NullableFungibleTokens) Get() *FungibleTokens { - return v.value -} - -func (v *NullableFungibleTokens) Set(val *FungibleTokens) { - v.value = val - v.isSet = true -} - -func (v NullableFungibleTokens) IsSet() bool { - return v.isSet -} - -func (v *NullableFungibleTokens) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFungibleTokens(val *FungibleTokens) *NullableFungibleTokens { - return &NullableFungibleTokens{value: val, isSet: true} -} - -func (v NullableFungibleTokens) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFungibleTokens) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_node_connection_message_metrics.go b/clients/apiclient/model_node_connection_message_metrics.go deleted file mode 100644 index 9006df4f47..0000000000 --- a/clients/apiclient/model_node_connection_message_metrics.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" - "time" -) - -// checks if the NodeConnectionMessageMetrics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NodeConnectionMessageMetrics{} - -// NodeConnectionMessageMetrics struct for NodeConnectionMessageMetrics -type NodeConnectionMessageMetrics struct { - // Last time the message was sent/received - LastEvent *time.Time `json:"lastEvent,omitempty"` - // The print out of the last message - LastMessage *string `json:"lastMessage,omitempty"` - // Total number of messages sent/received - Total *uint32 `json:"total,omitempty"` -} - -// NewNodeConnectionMessageMetrics instantiates a new NodeConnectionMessageMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNodeConnectionMessageMetrics() *NodeConnectionMessageMetrics { - this := NodeConnectionMessageMetrics{} - return &this -} - -// NewNodeConnectionMessageMetricsWithDefaults instantiates a new NodeConnectionMessageMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNodeConnectionMessageMetricsWithDefaults() *NodeConnectionMessageMetrics { - this := NodeConnectionMessageMetrics{} - return &this -} - -// GetLastEvent returns the LastEvent field value if set, zero value otherwise. -func (o *NodeConnectionMessageMetrics) GetLastEvent() time.Time { - if o == nil || isNil(o.LastEvent) { - var ret time.Time - return ret - } - return *o.LastEvent -} - -// GetLastEventOk returns a tuple with the LastEvent field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessageMetrics) GetLastEventOk() (*time.Time, bool) { - if o == nil || isNil(o.LastEvent) { - return nil, false - } - return o.LastEvent, true -} - -// HasLastEvent returns a boolean if a field has been set. -func (o *NodeConnectionMessageMetrics) HasLastEvent() bool { - if o != nil && !isNil(o.LastEvent) { - return true - } - - return false -} - -// SetLastEvent gets a reference to the given time.Time and assigns it to the LastEvent field. -func (o *NodeConnectionMessageMetrics) SetLastEvent(v time.Time) { - o.LastEvent = &v -} - -// GetLastMessage returns the LastMessage field value if set, zero value otherwise. -func (o *NodeConnectionMessageMetrics) GetLastMessage() string { - if o == nil || isNil(o.LastMessage) { - var ret string - return ret - } - return *o.LastMessage -} - -// GetLastMessageOk returns a tuple with the LastMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessageMetrics) GetLastMessageOk() (*string, bool) { - if o == nil || isNil(o.LastMessage) { - return nil, false - } - return o.LastMessage, true -} - -// HasLastMessage returns a boolean if a field has been set. -func (o *NodeConnectionMessageMetrics) HasLastMessage() bool { - if o != nil && !isNil(o.LastMessage) { - return true - } - - return false -} - -// SetLastMessage gets a reference to the given string and assigns it to the LastMessage field. -func (o *NodeConnectionMessageMetrics) SetLastMessage(v string) { - o.LastMessage = &v -} - -// GetTotal returns the Total field value if set, zero value otherwise. -func (o *NodeConnectionMessageMetrics) GetTotal() uint32 { - if o == nil || isNil(o.Total) { - var ret uint32 - return ret - } - return *o.Total -} - -// GetTotalOk returns a tuple with the Total field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessageMetrics) GetTotalOk() (*uint32, bool) { - if o == nil || isNil(o.Total) { - return nil, false - } - return o.Total, true -} - -// HasTotal returns a boolean if a field has been set. -func (o *NodeConnectionMessageMetrics) HasTotal() bool { - if o != nil && !isNil(o.Total) { - return true - } - - return false -} - -// SetTotal gets a reference to the given uint32 and assigns it to the Total field. -func (o *NodeConnectionMessageMetrics) SetTotal(v uint32) { - o.Total = &v -} - -func (o NodeConnectionMessageMetrics) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NodeConnectionMessageMetrics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.LastEvent) { - toSerialize["lastEvent"] = o.LastEvent - } - if !isNil(o.LastMessage) { - toSerialize["lastMessage"] = o.LastMessage - } - if !isNil(o.Total) { - toSerialize["total"] = o.Total - } - return toSerialize, nil -} - -type NullableNodeConnectionMessageMetrics struct { - value *NodeConnectionMessageMetrics - isSet bool -} - -func (v NullableNodeConnectionMessageMetrics) Get() *NodeConnectionMessageMetrics { - return v.value -} - -func (v *NullableNodeConnectionMessageMetrics) Set(val *NodeConnectionMessageMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableNodeConnectionMessageMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableNodeConnectionMessageMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNodeConnectionMessageMetrics(val *NodeConnectionMessageMetrics) *NullableNodeConnectionMessageMetrics { - return &NullableNodeConnectionMessageMetrics{value: val, isSet: true} -} - -func (v NullableNodeConnectionMessageMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNodeConnectionMessageMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_node_connection_messages_metrics.go b/clients/apiclient/model_node_connection_messages_metrics.go deleted file mode 100644 index 16b127df9a..0000000000 --- a/clients/apiclient/model_node_connection_messages_metrics.go +++ /dev/null @@ -1,450 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the NodeConnectionMessagesMetrics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NodeConnectionMessagesMetrics{} - -// NodeConnectionMessagesMetrics struct for NodeConnectionMessagesMetrics -type NodeConnectionMessagesMetrics struct { - InAliasOutput *NodeConnectionMessageMetrics `json:"inAliasOutput,omitempty"` - InOnLedgerRequest *NodeConnectionMessageMetrics `json:"inOnLedgerRequest,omitempty"` - InOutput *NodeConnectionMessageMetrics `json:"inOutput,omitempty"` - InStateOutput *NodeConnectionMessageMetrics `json:"inStateOutput,omitempty"` - InTxInclusionState *NodeConnectionMessageMetrics `json:"inTxInclusionState,omitempty"` - OutPublishGovernanceTransaction *NodeConnectionMessageMetrics `json:"outPublishGovernanceTransaction,omitempty"` - OutPublishStateTransaction *NodeConnectionMessageMetrics `json:"outPublishStateTransaction,omitempty"` - OutPullLatestOutput *NodeConnectionMessageMetrics `json:"outPullLatestOutput,omitempty"` - OutPullOutputByID *NodeConnectionMessageMetrics `json:"outPullOutputByID,omitempty"` - OutPullTxInclusionState *NodeConnectionMessageMetrics `json:"outPullTxInclusionState,omitempty"` -} - -// NewNodeConnectionMessagesMetrics instantiates a new NodeConnectionMessagesMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNodeConnectionMessagesMetrics() *NodeConnectionMessagesMetrics { - this := NodeConnectionMessagesMetrics{} - return &this -} - -// NewNodeConnectionMessagesMetricsWithDefaults instantiates a new NodeConnectionMessagesMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNodeConnectionMessagesMetricsWithDefaults() *NodeConnectionMessagesMetrics { - this := NodeConnectionMessagesMetrics{} - return &this -} - -// GetInAliasOutput returns the InAliasOutput field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetInAliasOutput() NodeConnectionMessageMetrics { - if o == nil || isNil(o.InAliasOutput) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.InAliasOutput -} - -// GetInAliasOutputOk returns a tuple with the InAliasOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetInAliasOutputOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.InAliasOutput) { - return nil, false - } - return o.InAliasOutput, true -} - -// HasInAliasOutput returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasInAliasOutput() bool { - if o != nil && !isNil(o.InAliasOutput) { - return true - } - - return false -} - -// SetInAliasOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InAliasOutput field. -func (o *NodeConnectionMessagesMetrics) SetInAliasOutput(v NodeConnectionMessageMetrics) { - o.InAliasOutput = &v -} - -// GetInOnLedgerRequest returns the InOnLedgerRequest field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequest() NodeConnectionMessageMetrics { - if o == nil || isNil(o.InOnLedgerRequest) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.InOnLedgerRequest -} - -// GetInOnLedgerRequestOk returns a tuple with the InOnLedgerRequest field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetInOnLedgerRequestOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.InOnLedgerRequest) { - return nil, false - } - return o.InOnLedgerRequest, true -} - -// HasInOnLedgerRequest returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasInOnLedgerRequest() bool { - if o != nil && !isNil(o.InOnLedgerRequest) { - return true - } - - return false -} - -// SetInOnLedgerRequest gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InOnLedgerRequest field. -func (o *NodeConnectionMessagesMetrics) SetInOnLedgerRequest(v NodeConnectionMessageMetrics) { - o.InOnLedgerRequest = &v -} - -// GetInOutput returns the InOutput field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetInOutput() NodeConnectionMessageMetrics { - if o == nil || isNil(o.InOutput) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.InOutput -} - -// GetInOutputOk returns a tuple with the InOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetInOutputOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.InOutput) { - return nil, false - } - return o.InOutput, true -} - -// HasInOutput returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasInOutput() bool { - if o != nil && !isNil(o.InOutput) { - return true - } - - return false -} - -// SetInOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InOutput field. -func (o *NodeConnectionMessagesMetrics) SetInOutput(v NodeConnectionMessageMetrics) { - o.InOutput = &v -} - -// GetInStateOutput returns the InStateOutput field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetInStateOutput() NodeConnectionMessageMetrics { - if o == nil || isNil(o.InStateOutput) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.InStateOutput -} - -// GetInStateOutputOk returns a tuple with the InStateOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetInStateOutputOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.InStateOutput) { - return nil, false - } - return o.InStateOutput, true -} - -// HasInStateOutput returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasInStateOutput() bool { - if o != nil && !isNil(o.InStateOutput) { - return true - } - - return false -} - -// SetInStateOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InStateOutput field. -func (o *NodeConnectionMessagesMetrics) SetInStateOutput(v NodeConnectionMessageMetrics) { - o.InStateOutput = &v -} - -// GetInTxInclusionState returns the InTxInclusionState field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetInTxInclusionState() NodeConnectionMessageMetrics { - if o == nil || isNil(o.InTxInclusionState) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.InTxInclusionState -} - -// GetInTxInclusionStateOk returns a tuple with the InTxInclusionState field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetInTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.InTxInclusionState) { - return nil, false - } - return o.InTxInclusionState, true -} - -// HasInTxInclusionState returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasInTxInclusionState() bool { - if o != nil && !isNil(o.InTxInclusionState) { - return true - } - - return false -} - -// SetInTxInclusionState gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InTxInclusionState field. -func (o *NodeConnectionMessagesMetrics) SetInTxInclusionState(v NodeConnectionMessageMetrics) { - o.InTxInclusionState = &v -} - -// GetOutPublishGovernanceTransaction returns the OutPublishGovernanceTransaction field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransaction() NodeConnectionMessageMetrics { - if o == nil || isNil(o.OutPublishGovernanceTransaction) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.OutPublishGovernanceTransaction -} - -// GetOutPublishGovernanceTransactionOk returns a tuple with the OutPublishGovernanceTransaction field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetOutPublishGovernanceTransactionOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.OutPublishGovernanceTransaction) { - return nil, false - } - return o.OutPublishGovernanceTransaction, true -} - -// HasOutPublishGovernanceTransaction returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasOutPublishGovernanceTransaction() bool { - if o != nil && !isNil(o.OutPublishGovernanceTransaction) { - return true - } - - return false -} - -// SetOutPublishGovernanceTransaction gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPublishGovernanceTransaction field. -func (o *NodeConnectionMessagesMetrics) SetOutPublishGovernanceTransaction(v NodeConnectionMessageMetrics) { - o.OutPublishGovernanceTransaction = &v -} - -// GetOutPublishStateTransaction returns the OutPublishStateTransaction field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransaction() NodeConnectionMessageMetrics { - if o == nil || isNil(o.OutPublishStateTransaction) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.OutPublishStateTransaction -} - -// GetOutPublishStateTransactionOk returns a tuple with the OutPublishStateTransaction field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetOutPublishStateTransactionOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.OutPublishStateTransaction) { - return nil, false - } - return o.OutPublishStateTransaction, true -} - -// HasOutPublishStateTransaction returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasOutPublishStateTransaction() bool { - if o != nil && !isNil(o.OutPublishStateTransaction) { - return true - } - - return false -} - -// SetOutPublishStateTransaction gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPublishStateTransaction field. -func (o *NodeConnectionMessagesMetrics) SetOutPublishStateTransaction(v NodeConnectionMessageMetrics) { - o.OutPublishStateTransaction = &v -} - -// GetOutPullLatestOutput returns the OutPullLatestOutput field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutput() NodeConnectionMessageMetrics { - if o == nil || isNil(o.OutPullLatestOutput) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.OutPullLatestOutput -} - -// GetOutPullLatestOutputOk returns a tuple with the OutPullLatestOutput field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetOutPullLatestOutputOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.OutPullLatestOutput) { - return nil, false - } - return o.OutPullLatestOutput, true -} - -// HasOutPullLatestOutput returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasOutPullLatestOutput() bool { - if o != nil && !isNil(o.OutPullLatestOutput) { - return true - } - - return false -} - -// SetOutPullLatestOutput gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPullLatestOutput field. -func (o *NodeConnectionMessagesMetrics) SetOutPullLatestOutput(v NodeConnectionMessageMetrics) { - o.OutPullLatestOutput = &v -} - -// GetOutPullOutputByID returns the OutPullOutputByID field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByID() NodeConnectionMessageMetrics { - if o == nil || isNil(o.OutPullOutputByID) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.OutPullOutputByID -} - -// GetOutPullOutputByIDOk returns a tuple with the OutPullOutputByID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetOutPullOutputByIDOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.OutPullOutputByID) { - return nil, false - } - return o.OutPullOutputByID, true -} - -// HasOutPullOutputByID returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasOutPullOutputByID() bool { - if o != nil && !isNil(o.OutPullOutputByID) { - return true - } - - return false -} - -// SetOutPullOutputByID gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPullOutputByID field. -func (o *NodeConnectionMessagesMetrics) SetOutPullOutputByID(v NodeConnectionMessageMetrics) { - o.OutPullOutputByID = &v -} - -// GetOutPullTxInclusionState returns the OutPullTxInclusionState field value if set, zero value otherwise. -func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionState() NodeConnectionMessageMetrics { - if o == nil || isNil(o.OutPullTxInclusionState) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.OutPullTxInclusionState -} - -// GetOutPullTxInclusionStateOk returns a tuple with the OutPullTxInclusionState field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMessagesMetrics) GetOutPullTxInclusionStateOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.OutPullTxInclusionState) { - return nil, false - } - return o.OutPullTxInclusionState, true -} - -// HasOutPullTxInclusionState returns a boolean if a field has been set. -func (o *NodeConnectionMessagesMetrics) HasOutPullTxInclusionState() bool { - if o != nil && !isNil(o.OutPullTxInclusionState) { - return true - } - - return false -} - -// SetOutPullTxInclusionState gets a reference to the given NodeConnectionMessageMetrics and assigns it to the OutPullTxInclusionState field. -func (o *NodeConnectionMessagesMetrics) SetOutPullTxInclusionState(v NodeConnectionMessageMetrics) { - o.OutPullTxInclusionState = &v -} - -func (o NodeConnectionMessagesMetrics) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NodeConnectionMessagesMetrics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.InAliasOutput) { - toSerialize["inAliasOutput"] = o.InAliasOutput - } - if !isNil(o.InOnLedgerRequest) { - toSerialize["inOnLedgerRequest"] = o.InOnLedgerRequest - } - if !isNil(o.InOutput) { - toSerialize["inOutput"] = o.InOutput - } - if !isNil(o.InStateOutput) { - toSerialize["inStateOutput"] = o.InStateOutput - } - if !isNil(o.InTxInclusionState) { - toSerialize["inTxInclusionState"] = o.InTxInclusionState - } - if !isNil(o.OutPublishGovernanceTransaction) { - toSerialize["outPublishGovernanceTransaction"] = o.OutPublishGovernanceTransaction - } - if !isNil(o.OutPublishStateTransaction) { - toSerialize["outPublishStateTransaction"] = o.OutPublishStateTransaction - } - if !isNil(o.OutPullLatestOutput) { - toSerialize["outPullLatestOutput"] = o.OutPullLatestOutput - } - if !isNil(o.OutPullOutputByID) { - toSerialize["outPullOutputByID"] = o.OutPullOutputByID - } - if !isNil(o.OutPullTxInclusionState) { - toSerialize["outPullTxInclusionState"] = o.OutPullTxInclusionState - } - return toSerialize, nil -} - -type NullableNodeConnectionMessagesMetrics struct { - value *NodeConnectionMessagesMetrics - isSet bool -} - -func (v NullableNodeConnectionMessagesMetrics) Get() *NodeConnectionMessagesMetrics { - return v.value -} - -func (v *NullableNodeConnectionMessagesMetrics) Set(val *NodeConnectionMessagesMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableNodeConnectionMessagesMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableNodeConnectionMessagesMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNodeConnectionMessagesMetrics(val *NodeConnectionMessagesMetrics) *NullableNodeConnectionMessagesMetrics { - return &NullableNodeConnectionMessagesMetrics{value: val, isSet: true} -} - -func (v NullableNodeConnectionMessagesMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNodeConnectionMessagesMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_node_connection_metrics.go b/clients/apiclient/model_node_connection_metrics.go deleted file mode 100644 index fb0c19d15f..0000000000 --- a/clients/apiclient/model_node_connection_metrics.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the NodeConnectionMetrics type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &NodeConnectionMetrics{} - -// NodeConnectionMetrics struct for NodeConnectionMetrics -type NodeConnectionMetrics struct { - InMilestone *NodeConnectionMessageMetrics `json:"inMilestone,omitempty"` - NodeConnectionMessagesMetrics *NodeConnectionMessagesMetrics `json:"nodeConnectionMessagesMetrics,omitempty"` - // Chain IDs of the chains registered to receiving L1 events - Registered []string `json:"registered,omitempty"` -} - -// NewNodeConnectionMetrics instantiates a new NodeConnectionMetrics object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNodeConnectionMetrics() *NodeConnectionMetrics { - this := NodeConnectionMetrics{} - return &this -} - -// NewNodeConnectionMetricsWithDefaults instantiates a new NodeConnectionMetrics object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNodeConnectionMetricsWithDefaults() *NodeConnectionMetrics { - this := NodeConnectionMetrics{} - return &this -} - -// GetInMilestone returns the InMilestone field value if set, zero value otherwise. -func (o *NodeConnectionMetrics) GetInMilestone() NodeConnectionMessageMetrics { - if o == nil || isNil(o.InMilestone) { - var ret NodeConnectionMessageMetrics - return ret - } - return *o.InMilestone -} - -// GetInMilestoneOk returns a tuple with the InMilestone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMetrics) GetInMilestoneOk() (*NodeConnectionMessageMetrics, bool) { - if o == nil || isNil(o.InMilestone) { - return nil, false - } - return o.InMilestone, true -} - -// HasInMilestone returns a boolean if a field has been set. -func (o *NodeConnectionMetrics) HasInMilestone() bool { - if o != nil && !isNil(o.InMilestone) { - return true - } - - return false -} - -// SetInMilestone gets a reference to the given NodeConnectionMessageMetrics and assigns it to the InMilestone field. -func (o *NodeConnectionMetrics) SetInMilestone(v NodeConnectionMessageMetrics) { - o.InMilestone = &v -} - -// GetNodeConnectionMessagesMetrics returns the NodeConnectionMessagesMetrics field value if set, zero value otherwise. -func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetrics() NodeConnectionMessagesMetrics { - if o == nil || isNil(o.NodeConnectionMessagesMetrics) { - var ret NodeConnectionMessagesMetrics - return ret - } - return *o.NodeConnectionMessagesMetrics -} - -// GetNodeConnectionMessagesMetricsOk returns a tuple with the NodeConnectionMessagesMetrics field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMetrics) GetNodeConnectionMessagesMetricsOk() (*NodeConnectionMessagesMetrics, bool) { - if o == nil || isNil(o.NodeConnectionMessagesMetrics) { - return nil, false - } - return o.NodeConnectionMessagesMetrics, true -} - -// HasNodeConnectionMessagesMetrics returns a boolean if a field has been set. -func (o *NodeConnectionMetrics) HasNodeConnectionMessagesMetrics() bool { - if o != nil && !isNil(o.NodeConnectionMessagesMetrics) { - return true - } - - return false -} - -// SetNodeConnectionMessagesMetrics gets a reference to the given NodeConnectionMessagesMetrics and assigns it to the NodeConnectionMessagesMetrics field. -func (o *NodeConnectionMetrics) SetNodeConnectionMessagesMetrics(v NodeConnectionMessagesMetrics) { - o.NodeConnectionMessagesMetrics = &v -} - -// GetRegistered returns the Registered field value if set, zero value otherwise. -func (o *NodeConnectionMetrics) GetRegistered() []string { - if o == nil || isNil(o.Registered) { - var ret []string - return ret - } - return o.Registered -} - -// GetRegisteredOk returns a tuple with the Registered field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NodeConnectionMetrics) GetRegisteredOk() ([]string, bool) { - if o == nil || isNil(o.Registered) { - return nil, false - } - return o.Registered, true -} - -// HasRegistered returns a boolean if a field has been set. -func (o *NodeConnectionMetrics) HasRegistered() bool { - if o != nil && !isNil(o.Registered) { - return true - } - - return false -} - -// SetRegistered gets a reference to the given []string and assigns it to the Registered field. -func (o *NodeConnectionMetrics) SetRegistered(v []string) { - o.Registered = v -} - -func (o NodeConnectionMetrics) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o NodeConnectionMetrics) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.InMilestone) { - toSerialize["inMilestone"] = o.InMilestone - } - if !isNil(o.NodeConnectionMessagesMetrics) { - toSerialize["nodeConnectionMessagesMetrics"] = o.NodeConnectionMessagesMetrics - } - if !isNil(o.Registered) { - toSerialize["registered"] = o.Registered - } - return toSerialize, nil -} - -type NullableNodeConnectionMetrics struct { - value *NodeConnectionMetrics - isSet bool -} - -func (v NullableNodeConnectionMetrics) Get() *NodeConnectionMetrics { - return v.value -} - -func (v *NullableNodeConnectionMetrics) Set(val *NodeConnectionMetrics) { - v.value = val - v.isSet = true -} - -func (v NullableNodeConnectionMetrics) IsSet() bool { - return v.isSet -} - -func (v *NullableNodeConnectionMetrics) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNodeConnectionMetrics(val *NodeConnectionMetrics) *NullableNodeConnectionMetrics { - return &NullableNodeConnectionMetrics{value: val, isSet: true} -} - -func (v NullableNodeConnectionMetrics) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNodeConnectionMetrics) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_off_ledger_request_body.go b/clients/apiclient/model_off_ledger_request_body.go deleted file mode 100644 index 102781dc94..0000000000 --- a/clients/apiclient/model_off_ledger_request_body.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the OffLedgerRequestBody type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &OffLedgerRequestBody{} - -// OffLedgerRequestBody struct for OffLedgerRequestBody -type OffLedgerRequestBody struct { - // Offledger Request (base64) - Request *string `json:"request,omitempty"` -} - -// NewOffLedgerRequestBody instantiates a new OffLedgerRequestBody object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOffLedgerRequestBody() *OffLedgerRequestBody { - this := OffLedgerRequestBody{} - return &this -} - -// NewOffLedgerRequestBodyWithDefaults instantiates a new OffLedgerRequestBody object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOffLedgerRequestBodyWithDefaults() *OffLedgerRequestBody { - this := OffLedgerRequestBody{} - return &this -} - -// GetRequest returns the Request field value if set, zero value otherwise. -func (o *OffLedgerRequestBody) GetRequest() string { - if o == nil || isNil(o.Request) { - var ret string - return ret - } - return *o.Request -} - -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OffLedgerRequestBody) GetRequestOk() (*string, bool) { - if o == nil || isNil(o.Request) { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *OffLedgerRequestBody) HasRequest() bool { - if o != nil && !isNil(o.Request) { - return true - } - - return false -} - -// SetRequest gets a reference to the given string and assigns it to the Request field. -func (o *OffLedgerRequestBody) SetRequest(v string) { - o.Request = &v -} - -func (o OffLedgerRequestBody) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o OffLedgerRequestBody) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Request) { - toSerialize["request"] = o.Request - } - return toSerialize, nil -} - -type NullableOffLedgerRequestBody struct { - value *OffLedgerRequestBody - isSet bool -} - -func (v NullableOffLedgerRequestBody) Get() *OffLedgerRequestBody { - return v.value -} - -func (v *NullableOffLedgerRequestBody) Set(val *OffLedgerRequestBody) { - v.value = val - v.isSet = true -} - -func (v NullableOffLedgerRequestBody) IsSet() bool { - return v.isSet -} - -func (v *NullableOffLedgerRequestBody) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOffLedgerRequestBody(val *OffLedgerRequestBody) *NullableOffLedgerRequestBody { - return &NullableOffLedgerRequestBody{value: val, isSet: true} -} - -func (v NullableOffLedgerRequestBody) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOffLedgerRequestBody) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_peering_node_status.go b/clients/apiclient/model_peering_node_status.go deleted file mode 100644 index 037c053bd2..0000000000 --- a/clients/apiclient/model_peering_node_status.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the PeeringNodeStatus type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PeeringNodeStatus{} - -// PeeringNodeStatus struct for PeeringNodeStatus -type PeeringNodeStatus struct { - IsAlive *bool `json:"IsAlive,omitempty"` - NetID *string `json:"NetID,omitempty"` - NumUsers *uint32 `json:"NumUsers,omitempty"` - PubKey *string `json:"PubKey,omitempty"` -} - -// NewPeeringNodeStatus instantiates a new PeeringNodeStatus object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPeeringNodeStatus() *PeeringNodeStatus { - this := PeeringNodeStatus{} - return &this -} - -// NewPeeringNodeStatusWithDefaults instantiates a new PeeringNodeStatus object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPeeringNodeStatusWithDefaults() *PeeringNodeStatus { - this := PeeringNodeStatus{} - return &this -} - -// GetIsAlive returns the IsAlive field value if set, zero value otherwise. -func (o *PeeringNodeStatus) GetIsAlive() bool { - if o == nil || isNil(o.IsAlive) { - var ret bool - return ret - } - return *o.IsAlive -} - -// GetIsAliveOk returns a tuple with the IsAlive field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PeeringNodeStatus) GetIsAliveOk() (*bool, bool) { - if o == nil || isNil(o.IsAlive) { - return nil, false - } - return o.IsAlive, true -} - -// HasIsAlive returns a boolean if a field has been set. -func (o *PeeringNodeStatus) HasIsAlive() bool { - if o != nil && !isNil(o.IsAlive) { - return true - } - - return false -} - -// SetIsAlive gets a reference to the given bool and assigns it to the IsAlive field. -func (o *PeeringNodeStatus) SetIsAlive(v bool) { - o.IsAlive = &v -} - -// GetNetID returns the NetID field value if set, zero value otherwise. -func (o *PeeringNodeStatus) GetNetID() string { - if o == nil || isNil(o.NetID) { - var ret string - return ret - } - return *o.NetID -} - -// GetNetIDOk returns a tuple with the NetID field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PeeringNodeStatus) GetNetIDOk() (*string, bool) { - if o == nil || isNil(o.NetID) { - return nil, false - } - return o.NetID, true -} - -// HasNetID returns a boolean if a field has been set. -func (o *PeeringNodeStatus) HasNetID() bool { - if o != nil && !isNil(o.NetID) { - return true - } - - return false -} - -// SetNetID gets a reference to the given string and assigns it to the NetID field. -func (o *PeeringNodeStatus) SetNetID(v string) { - o.NetID = &v -} - -// GetNumUsers returns the NumUsers field value if set, zero value otherwise. -func (o *PeeringNodeStatus) GetNumUsers() uint32 { - if o == nil || isNil(o.NumUsers) { - var ret uint32 - return ret - } - return *o.NumUsers -} - -// GetNumUsersOk returns a tuple with the NumUsers field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PeeringNodeStatus) GetNumUsersOk() (*uint32, bool) { - if o == nil || isNil(o.NumUsers) { - return nil, false - } - return o.NumUsers, true -} - -// HasNumUsers returns a boolean if a field has been set. -func (o *PeeringNodeStatus) HasNumUsers() bool { - if o != nil && !isNil(o.NumUsers) { - return true - } - - return false -} - -// SetNumUsers gets a reference to the given uint32 and assigns it to the NumUsers field. -func (o *PeeringNodeStatus) SetNumUsers(v uint32) { - o.NumUsers = &v -} - -// GetPubKey returns the PubKey field value if set, zero value otherwise. -func (o *PeeringNodeStatus) GetPubKey() string { - if o == nil || isNil(o.PubKey) { - var ret string - return ret - } - return *o.PubKey -} - -// GetPubKeyOk returns a tuple with the PubKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PeeringNodeStatus) GetPubKeyOk() (*string, bool) { - if o == nil || isNil(o.PubKey) { - return nil, false - } - return o.PubKey, true -} - -// HasPubKey returns a boolean if a field has been set. -func (o *PeeringNodeStatus) HasPubKey() bool { - if o != nil && !isNil(o.PubKey) { - return true - } - - return false -} - -// SetPubKey gets a reference to the given string and assigns it to the PubKey field. -func (o *PeeringNodeStatus) SetPubKey(v string) { - o.PubKey = &v -} - -func (o PeeringNodeStatus) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PeeringNodeStatus) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.IsAlive) { - toSerialize["IsAlive"] = o.IsAlive - } - if !isNil(o.NetID) { - toSerialize["NetID"] = o.NetID - } - if !isNil(o.NumUsers) { - toSerialize["NumUsers"] = o.NumUsers - } - if !isNil(o.PubKey) { - toSerialize["PubKey"] = o.PubKey - } - return toSerialize, nil -} - -type NullablePeeringNodeStatus struct { - value *PeeringNodeStatus - isSet bool -} - -func (v NullablePeeringNodeStatus) Get() *PeeringNodeStatus { - return v.value -} - -func (v *NullablePeeringNodeStatus) Set(val *PeeringNodeStatus) { - v.value = val - v.isSet = true -} - -func (v NullablePeeringNodeStatus) IsSet() bool { - return v.isSet -} - -func (v *NullablePeeringNodeStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePeeringNodeStatus(val *PeeringNodeStatus) *NullablePeeringNodeStatus { - return &NullablePeeringNodeStatus{value: val, isSet: true} -} - -func (v NullablePeeringNodeStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePeeringNodeStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_peering_trusted_node.go b/clients/apiclient/model_peering_trusted_node.go deleted file mode 100644 index 09cc1850ea..0000000000 --- a/clients/apiclient/model_peering_trusted_node.go +++ /dev/null @@ -1,164 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the PeeringTrustedNode type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PeeringTrustedNode{} - -// PeeringTrustedNode struct for PeeringTrustedNode -type PeeringTrustedNode struct { - // NetID of a peer to trust. - NetId *string `json:"netId,omitempty"` - // Public key of the NetID. - PubKey *string `json:"pubKey,omitempty"` -} - -// NewPeeringTrustedNode instantiates a new PeeringTrustedNode object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPeeringTrustedNode() *PeeringTrustedNode { - this := PeeringTrustedNode{} - return &this -} - -// NewPeeringTrustedNodeWithDefaults instantiates a new PeeringTrustedNode object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPeeringTrustedNodeWithDefaults() *PeeringTrustedNode { - this := PeeringTrustedNode{} - return &this -} - -// GetNetId returns the NetId field value if set, zero value otherwise. -func (o *PeeringTrustedNode) GetNetId() string { - if o == nil || isNil(o.NetId) { - var ret string - return ret - } - return *o.NetId -} - -// GetNetIdOk returns a tuple with the NetId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PeeringTrustedNode) GetNetIdOk() (*string, bool) { - if o == nil || isNil(o.NetId) { - return nil, false - } - return o.NetId, true -} - -// HasNetId returns a boolean if a field has been set. -func (o *PeeringTrustedNode) HasNetId() bool { - if o != nil && !isNil(o.NetId) { - return true - } - - return false -} - -// SetNetId gets a reference to the given string and assigns it to the NetId field. -func (o *PeeringTrustedNode) SetNetId(v string) { - o.NetId = &v -} - -// GetPubKey returns the PubKey field value if set, zero value otherwise. -func (o *PeeringTrustedNode) GetPubKey() string { - if o == nil || isNil(o.PubKey) { - var ret string - return ret - } - return *o.PubKey -} - -// GetPubKeyOk returns a tuple with the PubKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PeeringTrustedNode) GetPubKeyOk() (*string, bool) { - if o == nil || isNil(o.PubKey) { - return nil, false - } - return o.PubKey, true -} - -// HasPubKey returns a boolean if a field has been set. -func (o *PeeringTrustedNode) HasPubKey() bool { - if o != nil && !isNil(o.PubKey) { - return true - } - - return false -} - -// SetPubKey gets a reference to the given string and assigns it to the PubKey field. -func (o *PeeringTrustedNode) SetPubKey(v string) { - o.PubKey = &v -} - -func (o PeeringTrustedNode) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o PeeringTrustedNode) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.NetId) { - toSerialize["netId"] = o.NetId - } - if !isNil(o.PubKey) { - toSerialize["pubKey"] = o.PubKey - } - return toSerialize, nil -} - -type NullablePeeringTrustedNode struct { - value *PeeringTrustedNode - isSet bool -} - -func (v NullablePeeringTrustedNode) Get() *PeeringTrustedNode { - return v.value -} - -func (v *NullablePeeringTrustedNode) Set(val *PeeringTrustedNode) { - v.value = val - v.isSet = true -} - -func (v NullablePeeringTrustedNode) IsSet() bool { - return v.isSet -} - -func (v *NullablePeeringTrustedNode) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePeeringTrustedNode(val *PeeringTrustedNode) *NullablePeeringTrustedNode { - return &NullablePeeringTrustedNode{value: val, isSet: true} -} - -func (v NullablePeeringTrustedNode) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePeeringTrustedNode) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/apiclient/model_wait_request_processed_params.go b/clients/apiclient/model_wait_request_processed_params.go deleted file mode 100644 index d1e2f7561f..0000000000 --- a/clients/apiclient/model_wait_request_processed_params.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Wasp API - -REST API for the Wasp node - -API version: 123 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package apiclient - -import ( - "encoding/json" -) - -// checks if the WaitRequestProcessedParams type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &WaitRequestProcessedParams{} - -// WaitRequestProcessedParams struct for WaitRequestProcessedParams -type WaitRequestProcessedParams struct { - // Timeout in nanoseconds - Timeout *int64 `json:"timeout,omitempty"` -} - -// NewWaitRequestProcessedParams instantiates a new WaitRequestProcessedParams object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWaitRequestProcessedParams() *WaitRequestProcessedParams { - this := WaitRequestProcessedParams{} - return &this -} - -// NewWaitRequestProcessedParamsWithDefaults instantiates a new WaitRequestProcessedParams object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWaitRequestProcessedParamsWithDefaults() *WaitRequestProcessedParams { - this := WaitRequestProcessedParams{} - return &this -} - -// GetTimeout returns the Timeout field value if set, zero value otherwise. -func (o *WaitRequestProcessedParams) GetTimeout() int64 { - if o == nil || isNil(o.Timeout) { - var ret int64 - return ret - } - return *o.Timeout -} - -// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *WaitRequestProcessedParams) GetTimeoutOk() (*int64, bool) { - if o == nil || isNil(o.Timeout) { - return nil, false - } - return o.Timeout, true -} - -// HasTimeout returns a boolean if a field has been set. -func (o *WaitRequestProcessedParams) HasTimeout() bool { - if o != nil && !isNil(o.Timeout) { - return true - } - - return false -} - -// SetTimeout gets a reference to the given int64 and assigns it to the Timeout field. -func (o *WaitRequestProcessedParams) SetTimeout(v int64) { - o.Timeout = &v -} - -func (o WaitRequestProcessedParams) MarshalJSON() ([]byte, error) { - toSerialize,err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o WaitRequestProcessedParams) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !isNil(o.Timeout) { - toSerialize["timeout"] = o.Timeout - } - return toSerialize, nil -} - -type NullableWaitRequestProcessedParams struct { - value *WaitRequestProcessedParams - isSet bool -} - -func (v NullableWaitRequestProcessedParams) Get() *WaitRequestProcessedParams { - return v.value -} - -func (v *NullableWaitRequestProcessedParams) Set(val *WaitRequestProcessedParams) { - v.value = val - v.isSet = true -} - -func (v NullableWaitRequestProcessedParams) IsSet() bool { - return v.isSet -} - -func (v *NullableWaitRequestProcessedParams) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWaitRequestProcessedParams(val *WaitRequestProcessedParams) *NullableWaitRequestProcessedParams { - return &NullableWaitRequestProcessedParams{value: val, isSet: true} -} - -func (v NullableWaitRequestProcessedParams) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWaitRequestProcessedParams) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/clients/chainclient/stateget.go b/clients/chainclient/stateget.go index 1ecc9e2540..0f8ca0f88a 100644 --- a/clients/chainclient/stateget.go +++ b/clients/chainclient/stateget.go @@ -8,7 +8,7 @@ import ( // StateGet fetches the raw value associated with the given key in the chain state func (c *Client) StateGet(ctx context.Context, key string) ([]byte, error) { - stateResponse, _, err := c.WaspClient.ChainsApi.GetStateValue(ctx, c.ChainID.String(), key).Execute() + stateResponse, _, err := c.WaspClient.ChainsApi.GetStateValue(ctx, c.ChainID.String(), iotago.EncodeHex([]byte(key))).Execute() if err != nil { return nil, err diff --git a/packages/webapi/api.go b/packages/webapi/api.go index 21946703a0..adc82b1470 100644 --- a/packages/webapi/api.go +++ b/packages/webapi/api.go @@ -27,7 +27,7 @@ import ( func loadControllers(server echoswagger.ApiRoot, mocker *Mocker, controllersToLoad []interfaces.APIController) { for _, controller := range controllersToLoad { - publicGroup := server.Group(controller.Name(), "/") + group := server.Group(controller.Name(), "/") controller.RegisterPublic(publicGroup, mocker) @@ -62,7 +62,7 @@ func Init( mocker.LoadMockFiles() vmService := services.NewVMService(chainsProvider) - chainService := services.NewChainService(chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) + chainService := services.NewChainService(logger, chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) committeeService := services.NewCommitteeService(chainsProvider, networkProvider, dkShareRegistryProvider) registryService := services.NewRegistryService(chainsProvider, chainRecordRegistryProvider) offLedgerService := services.NewOffLedgerService(chainService, networkProvider, requestCacheTTL) diff --git a/packages/webapi/services/chain.go b/packages/webapi/services/chain.go index 060419178c..3299a091ba 100644 --- a/packages/webapi/services/chain.go +++ b/packages/webapi/services/chain.go @@ -5,6 +5,7 @@ import ( "errors" "time" + "github.com/iotaledger/hive.go/core/logger" chainpkg "github.com/iotaledger/wasp/packages/chain" "github.com/iotaledger/wasp/packages/chains" "github.com/iotaledger/wasp/packages/isc" @@ -21,6 +22,7 @@ import ( ) type ChainService struct { + log *logger.Logger governance *corecontracts.Governance chainsProvider chains.Provider nodeConnectionMetrics nodeconnmetrics.NodeConnectionMetrics @@ -28,8 +30,9 @@ type ChainService struct { vmService interfaces.VMService } -func NewChainService(chainsProvider chains.Provider, nodeConnectionMetrics nodeconnmetrics.NodeConnectionMetrics, chainRecordRegistryProvider registry.ChainRecordRegistryProvider, vmService interfaces.VMService) interfaces.ChainService { +func NewChainService(logger *logger.Logger, chainsProvider chains.Provider, nodeConnectionMetrics nodeconnmetrics.NodeConnectionMetrics, chainRecordRegistryProvider registry.ChainRecordRegistryProvider, vmService interfaces.VMService) interfaces.ChainService { return &ChainService{ + log: logger, governance: corecontracts.NewGovernance(vmService), chainsProvider: chainsProvider, nodeConnectionMetrics: nodeConnectionMetrics, @@ -57,15 +60,12 @@ func (c *ChainService) DeactivateChain(chainID isc.ChainID) error { } func (c *ChainService) SetChainRecord(chainRecord *registry.ChainRecord) error { - err := c.chainRecordRegistryProvider.AddChainRecord(chainRecord) - if err != nil { - return err - } - storedChainRec, err := c.chainRecordRegistryProvider.ChainRecord(chainRecord.ChainID()) if err != nil { return err } + + c.log.Infof("StoredChainRec %v %v", storedChainRec, err) if storedChainRec != nil { _, err = c.chainRecordRegistryProvider.UpdateChainRecord( @@ -76,16 +76,22 @@ func (c *ChainService) SetChainRecord(chainRecord *registry.ChainRecord) error { return true }, ) + c.log.Infof("UpdatechainRec %v %v", chainRecord, err) + if err != nil { return err } } else { if err := c.chainRecordRegistryProvider.AddChainRecord(chainRecord); err != nil { + c.log.Infof("AddChainRec %v %v", chainRecord, err) + return err } } // Activate/deactivate the chain accordingly. + c.log.Infof("Chainrecord active %v", chainRecord.Active) + if chainRecord.Active { if err := c.chainsProvider().Activate(chainRecord.ChainID()); err != nil { return err diff --git a/tools/cluster/chain.go b/tools/cluster/chain.go index 6d32deafb6..4e77bb1896 100644 --- a/tools/cluster/chain.go +++ b/tools/cluster/chain.go @@ -266,15 +266,7 @@ func (ch *Chain) GetCounterValue(inccounterSCHname isc.Hname, nodeIndex ...int) func (ch *Chain) GetStateVariable(contractHname isc.Hname, key string, nodeIndex ...int) ([]byte, error) { cl := ch.SCClient(contractHname, nil, nodeIndex...) - result, _, err := ch.Cluster.WaspClient(nodeIndex...).ChainsApi. - GetStateValue(context.Background(), ch.ChainID.String(), key). - Execute() - - if err != nil { - return nil, err - } - - return cl.StateGet(context.Background(), result.State) + return cl.StateGet(context.Background(), key) } func (ch *Chain) GetRequestReceipt(reqID isc.RequestID, nodeIndex ...int) (*apiclient.ReceiptResponse, error) { diff --git a/tools/cluster/cluster.go b/tools/cluster/cluster.go index da6df2f890..ef8b186cf1 100644 --- a/tools/cluster/cluster.go +++ b/tools/cluster/cluster.go @@ -323,9 +323,10 @@ func (clu *Cluster) AddAccessNode(accessNodeIndex int, chain *Chain) (*iotago.Tr return nil, err } + clu.log.Infof("Node owner bech32: %v", chain.OriginatorAddress().Bech32(parameters.L1().Protocol.Bech32HRP)) cert, _, err := waspClient.NodeApi.SetNodeOwner(context.Background()).NodeOwnerCertificateRequest(apiclient.NodeOwnerCertificateRequest{ PublicKey: accessNodePubKey.String(), - OwnerAddress: chain.OriginatorAddress().String(), + OwnerAddress: chain.OriginatorAddress().Bech32(parameters.L1().Protocol.Bech32HRP), }).Execute() if err != nil { diff --git a/tools/cluster/config.go b/tools/cluster/config.go index 20174edda5..d10a5838fb 100644 --- a/tools/cluster/config.go +++ b/tools/cluster/config.go @@ -130,7 +130,7 @@ func (c *ClusterConfig) APIHosts(nodeIndexes ...[]int) []string { } func (c *ClusterConfig) APIHost(nodeIndex int) string { - return fmt.Sprintf("127.0.0.1:%d", c.APIPort(nodeIndex)) + return fmt.Sprintf("http://127.0.0.1:%d", c.APIPort(nodeIndex)) } func (c *ClusterConfig) APIPort(nodeIndex int) int { diff --git a/tools/cluster/tests/account_test.go b/tools/cluster/tests/account_test.go index e198792d35..071b4d23a8 100644 --- a/tools/cluster/tests/account_test.go +++ b/tools/cluster/tests/account_test.go @@ -5,9 +5,11 @@ import ( "testing" "time" + "github.com/samber/lo" "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" @@ -67,9 +69,12 @@ func testAccounts(e *ChainEnv) { contractRegistry, err := e.Chain.ContractRegistry(i) require.NoError(e.t, err) - cr := contractRegistry[hname] + cr, ok := lo.Find(contractRegistry, func(item apiclient.ContractInfoResponse) bool { + return item.HName == hname.String() + }) + require.True(e.t, ok) - require.EqualValues(e.t, programHash1, cr.ProgramHash) + require.EqualValues(e.t, programHash1.Hex(), cr.ProgramHash) require.EqualValues(e.t, description, cr.Description) require.EqualValues(e.t, nativeIncCounterSCName, cr.Name) @@ -93,7 +98,7 @@ func testAccounts(e *ChainEnv) { fees, err := iotago.DecodeUint64(receipts[0].GasFeeCharged) require.NoError(e.t, err) - + e.checkBalanceOnChain(isc.NewAgentID(myAddress), isc.BaseTokenID, transferBaseTokens-fees) for i := range e.Chain.CommitteeNodes { From 2fc91c2c6241b0eb748964a0b3df1546786c9269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Tue, 7 Feb 2023 23:19:01 +0100 Subject: [PATCH 27/39] Update cluster tests, some cli fixes --- clients/apiclient/.openapi-generator/FILES | 2 + clients/apiclient/api/openapi.yaml | 120 +++++++++++++----- clients/apiclient/api_chains.go | 8 +- clients/apiclient/docs/ChainsApi.md | 6 +- clients/apiclient/docs/GasFeePolicy.md | 10 +- clients/apiclient/docs/ReceiptError.md | 22 ++-- clients/apiclient/docs/RequestIDResponse.md | 51 ++++++++ clients/apiclient/model_gas_fee_policy.go | 14 +- clients/apiclient/model_receipt_error.go | 29 +++-- .../apiclient/model_request_id_response.go | 118 +++++++++++++++++ clients/apiextensions/apierror.go | 36 ++++++ clients/apiextensions/dict.go | 1 + clients/chainclient/evm.go | 4 +- clients/chainclient/uploadblob.go | 1 + packages/webapi/apierrors/errors.go | 4 + .../webapi/controllers/chain/controller.go | 2 +- packages/webapi/controllers/chain/evm.go | 7 +- .../webapi/controllers/corecontracts/blob.go | 13 +- .../controllers/corecontracts/blocklog.go | 5 + .../controllers/corecontracts/governance.go | 5 +- .../webapi/controllers/requests/receipt.go | 5 + packages/webapi/corecontracts/blob.go | 6 +- packages/webapi/corecontracts/blocklog.go | 6 +- packages/webapi/models/chain.go | 2 +- packages/webapi/models/vm.go | 4 +- packages/webapi/services/evm.go | 2 + tools/cluster/tests/access_nodes_test.go | 14 +- tools/cluster/tests/account_test.go | 8 +- tools/cluster/tests/blob_test.go | 8 +- tools/cluster/tests/cluster_test.go | 2 +- tools/cluster/tests/cluster_testutils.go | 9 +- tools/cluster/tests/deploy_test.go | 8 +- tools/cluster/tests/evm_jsonrpc_test.go | 2 +- tools/cluster/tests/maintenance_test.go | 5 +- .../cluster/tests/offledger_requests_test.go | 12 +- tools/cluster/tests/post_test.go | 10 +- tools/wasp-cli/chain/accounts.go | 2 +- tools/wasp-cli/cli/config/config.go | 2 +- tools/wasp-cli/cli/init/init.go | 3 + 39 files changed, 456 insertions(+), 112 deletions(-) create mode 100644 clients/apiclient/docs/RequestIDResponse.md create mode 100644 clients/apiclient/model_request_id_response.go create mode 100644 clients/apiextensions/apierror.go diff --git a/clients/apiclient/.openapi-generator/FILES b/clients/apiclient/.openapi-generator/FILES index c5780145a8..074e4295be 100644 --- a/clients/apiclient/.openapi-generator/FILES +++ b/clients/apiclient/.openapi-generator/FILES @@ -85,6 +85,7 @@ docs/ReceiptError.md docs/ReceiptResponse.md docs/RentStructure.md docs/RequestDetail.md +docs/RequestIDResponse.md docs/RequestIDsResponse.md docs/RequestProcessedResponse.md docs/RequestReceiptResponse.md @@ -175,6 +176,7 @@ model_receipt_error.go model_receipt_response.go model_rent_structure.go model_request_detail.go +model_request_id_response.go model_request_ids_response.go model_request_processed_response.go model_request_receipt_response.go diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index c96ce9ca46..0cf84b6d4c 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -1324,8 +1324,7 @@ paths: content: application/json: schema: - format: string - type: string + $ref: '#/components/schemas/RequestIDResponse' description: Request ID "404": content: @@ -1577,7 +1576,7 @@ paths: application/json: schema: additionalProperties: - example: "true" + example: "30" format: string type: string type: object @@ -1710,7 +1709,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/PeeringNodeStatusResponse_' + $ref: '#/components/schemas/PeeringNodeStatusResponse__' type: array description: A list of all peers "401": @@ -2989,16 +2988,16 @@ components: committeeNodes: - node: isAlive: true - netId: localhost:4000 - publicKey: 0x0000 - numUsers: 1 + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 isTrusted: true accessAPI: accessAPI - node: isAlive: true - netId: localhost:4000 - publicKey: 0x0000 - numUsers: 1 + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 isTrusted: true accessAPI: accessAPI chainId: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e @@ -3101,9 +3100,9 @@ components: example: node: isAlive: true - netId: localhost:4000 - publicKey: 0x0000 - numUsers: 1 + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 isTrusted: true accessAPI: accessAPI properties: @@ -3642,10 +3641,10 @@ components: description: description gasFeePolicy: gasFeeTokenId: gasFeeTokenId - gasPerToken: 0 - validatorFeeShare: 6 - maxBlobSize: 1 - maxEventSize: 5 + gasPerToken: gasPerToken + validatorFeeShare: 0 + maxBlobSize: 6 + maxEventSize: 1 properties: chainID: description: ChainID (Bech32-encoded). @@ -4440,6 +4439,53 @@ components: xml: name: PeeringNodeStatusResponse PeeringNodeStatusResponse_: + example: + isAlive: true + netId: netId + publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + numUsers: 6 + isTrusted: true + properties: + isAlive: + description: Whether or not the peer is activated + format: boolean + type: boolean + xml: + name: IsAlive + isTrusted: + format: boolean + type: boolean + xml: + name: IsTrusted + netId: + description: The NetID of the peer + format: string + type: string + xml: + name: NetID + numUsers: + description: The amount of users attached to the peer + format: int32 + type: integer + xml: + name: NumUsers + publicKey: + description: The peers public key encoded in Hex + example: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 + format: string + type: string + xml: + name: PublicKey + required: + - isAlive + - isTrusted + - netId + - numUsers + - publicKey + type: object + xml: + name: PeeringNodeStatusResponse + PeeringNodeStatusResponse__: example: isAlive: true netId: localhost:4000 @@ -4614,8 +4660,8 @@ components: name: PublisherStateTransactionItem ReceiptError: example: + contractHName: contractHName messageFormat: messageFormat - contractId: 6 errorCode: errorCode errorId: 1 message: message @@ -4623,11 +4669,12 @@ components: - parameters - parameters properties: - contractId: - format: int32 - type: integer + contractHName: + description: The contract hname (Hex) + format: string + type: string xml: - name: ContractID + name: ContractHName errorCode: format: string type: string @@ -4658,7 +4705,7 @@ components: name: Parameters wrapped: true required: - - contractId + - contractHName - errorCode - errorId - message @@ -4681,8 +4728,8 @@ components: gasBudget: gasBudget gasBurned: gasBurned error: + contractHName: contractHName messageFormat: messageFormat - contractId: 6 errorCode: errorCode errorId: 1 message: message @@ -4879,6 +4926,21 @@ components: type: object xml: name: RequestDetail + RequestIDResponse: + example: + requestId: requestId + properties: + requestId: + description: The request ID of the given transaction ID. (Hex) + format: string + type: string + xml: + name: RequestID + required: + - requestId + type: object + xml: + name: RequestIDResponse RequestIDsResponse: example: requestIds: @@ -5345,8 +5407,8 @@ components: gasFeePolicy_: example: gasFeeTokenId: gasFeeTokenId - gasPerToken: 0 - validatorFeeShare: 6 + gasPerToken: gasPerToken + validatorFeeShare: 0 properties: gasFeeTokenId: description: The gas fee token id. Empty if base token. @@ -5355,9 +5417,9 @@ components: xml: name: GasFeeTokenID gasPerToken: - description: The amount of gas per token. - format: int64 - type: integer + description: The amount of gas per token. (uint64 as string) + format: string + type: string xml: name: GasPerToken validatorFeeShare: diff --git a/clients/apiclient/api_chains.go b/clients/apiclient/api_chains.go index 670b1da52e..0df11ef9b1 100644 --- a/clients/apiclient/api_chains.go +++ b/clients/apiclient/api_chains.go @@ -1101,7 +1101,7 @@ type ApiGetRequestIDFromEVMTransactionIDRequest struct { txHash string } -func (r ApiGetRequestIDFromEVMTransactionIDRequest) Execute() (string, *http.Response, error) { +func (r ApiGetRequestIDFromEVMTransactionIDRequest) Execute() (*RequestIDResponse, *http.Response, error) { return r.ApiService.GetRequestIDFromEVMTransactionIDExecute(r) } @@ -1123,13 +1123,13 @@ func (a *ChainsApiService) GetRequestIDFromEVMTransactionID(ctx context.Context, } // Execute executes the request -// @return string -func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetRequestIDFromEVMTransactionIDRequest) (string, *http.Response, error) { +// @return RequestIDResponse +func (a *ChainsApiService) GetRequestIDFromEVMTransactionIDExecute(r ApiGetRequestIDFromEVMTransactionIDRequest) (*RequestIDResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue string + localVarReturnValue *RequestIDResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ChainsApiService.GetRequestIDFromEVMTransactionID") diff --git a/clients/apiclient/docs/ChainsApi.md b/clients/apiclient/docs/ChainsApi.md index 5c203da9f3..48a6f747fe 100644 --- a/clients/apiclient/docs/ChainsApi.md +++ b/clients/apiclient/docs/ChainsApi.md @@ -620,7 +620,7 @@ Name | Type | Description | Notes ## GetRequestIDFromEVMTransactionID -> string GetRequestIDFromEVMTransactionID(ctx, chainID, txHash).Execute() +> RequestIDResponse GetRequestIDFromEVMTransactionID(ctx, chainID, txHash).Execute() Get the ISC request ID for the given Ethereum transaction hash @@ -647,7 +647,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetRequestIDFromEVMTransactionID``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetRequestIDFromEVMTransactionID`: string + // response from `GetRequestIDFromEVMTransactionID`: RequestIDResponse fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetRequestIDFromEVMTransactionID`: %v\n", resp) } ``` @@ -673,7 +673,7 @@ Name | Type | Description | Notes ### Return type -**string** +[**RequestIDResponse**](RequestIDResponse.md) ### Authorization diff --git a/clients/apiclient/docs/GasFeePolicy.md b/clients/apiclient/docs/GasFeePolicy.md index e5338a955e..b9a62e55df 100644 --- a/clients/apiclient/docs/GasFeePolicy.md +++ b/clients/apiclient/docs/GasFeePolicy.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **GasFeeTokenId** | **string** | The gas fee token id. Empty if base token. | -**GasPerToken** | **int64** | The amount of gas per token. | +**GasPerToken** | **string** | The amount of gas per token. (uint64 as string) | **ValidatorFeeShare** | **int32** | The validator fee share. | ## Methods ### NewGasFeePolicy -`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32, ) *GasFeePolicy` +`func NewGasFeePolicy(gasFeeTokenId string, gasPerToken string, validatorFeeShare int32, ) *GasFeePolicy` NewGasFeePolicy instantiates a new GasFeePolicy object This constructor will assign default values to properties that have it defined, @@ -49,20 +49,20 @@ SetGasFeeTokenId sets GasFeeTokenId field to given value. ### GetGasPerToken -`func (o *GasFeePolicy) GetGasPerToken() int64` +`func (o *GasFeePolicy) GetGasPerToken() string` GetGasPerToken returns the GasPerToken field if non-nil, zero value otherwise. ### GetGasPerTokenOk -`func (o *GasFeePolicy) GetGasPerTokenOk() (*int64, bool)` +`func (o *GasFeePolicy) GetGasPerTokenOk() (*string, bool)` GetGasPerTokenOk returns a tuple with the GasPerToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGasPerToken -`func (o *GasFeePolicy) SetGasPerToken(v int64)` +`func (o *GasFeePolicy) SetGasPerToken(v string)` SetGasPerToken sets GasPerToken field to given value. diff --git a/clients/apiclient/docs/ReceiptError.md b/clients/apiclient/docs/ReceiptError.md index 960d58339d..405dc32901 100644 --- a/clients/apiclient/docs/ReceiptError.md +++ b/clients/apiclient/docs/ReceiptError.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ContractId** | **int32** | | +**ContractHName** | **string** | The contract hname (Hex) | **ErrorCode** | **string** | | **ErrorId** | **uint32** | | **Message** | **string** | | @@ -15,7 +15,7 @@ Name | Type | Description | Notes ### NewReceiptError -`func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` +`func NewReceiptError(contractHName string, errorCode string, errorId uint32, message string, messageFormat string, parameters []string, ) *ReceiptError` NewReceiptError instantiates a new ReceiptError object This constructor will assign default values to properties that have it defined, @@ -30,24 +30,24 @@ NewReceiptErrorWithDefaults instantiates a new ReceiptError object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetContractId +### GetContractHName -`func (o *ReceiptError) GetContractId() int32` +`func (o *ReceiptError) GetContractHName() string` -GetContractId returns the ContractId field if non-nil, zero value otherwise. +GetContractHName returns the ContractHName field if non-nil, zero value otherwise. -### GetContractIdOk +### GetContractHNameOk -`func (o *ReceiptError) GetContractIdOk() (*int32, bool)` +`func (o *ReceiptError) GetContractHNameOk() (*string, bool)` -GetContractIdOk returns a tuple with the ContractId field if it's non-nil, zero value otherwise +GetContractHNameOk returns a tuple with the ContractHName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetContractId +### SetContractHName -`func (o *ReceiptError) SetContractId(v int32)` +`func (o *ReceiptError) SetContractHName(v string)` -SetContractId sets ContractId field to given value. +SetContractHName sets ContractHName field to given value. ### GetErrorCode diff --git a/clients/apiclient/docs/RequestIDResponse.md b/clients/apiclient/docs/RequestIDResponse.md new file mode 100644 index 0000000000..c3518a7b19 --- /dev/null +++ b/clients/apiclient/docs/RequestIDResponse.md @@ -0,0 +1,51 @@ +# RequestIDResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestId** | **string** | The request ID of the given transaction ID. (Hex) | + +## Methods + +### NewRequestIDResponse + +`func NewRequestIDResponse(requestId string, ) *RequestIDResponse` + +NewRequestIDResponse instantiates a new RequestIDResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestIDResponseWithDefaults + +`func NewRequestIDResponseWithDefaults() *RequestIDResponse` + +NewRequestIDResponseWithDefaults instantiates a new RequestIDResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestId + +`func (o *RequestIDResponse) GetRequestId() string` + +GetRequestId returns the RequestId field if non-nil, zero value otherwise. + +### GetRequestIdOk + +`func (o *RequestIDResponse) GetRequestIdOk() (*string, bool)` + +GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestId + +`func (o *RequestIDResponse) SetRequestId(v string)` + +SetRequestId sets RequestId field to given value. + + + +[[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/clients/apiclient/model_gas_fee_policy.go b/clients/apiclient/model_gas_fee_policy.go index 48e32fedef..f283cb9553 100644 --- a/clients/apiclient/model_gas_fee_policy.go +++ b/clients/apiclient/model_gas_fee_policy.go @@ -21,8 +21,8 @@ var _ MappedNullable = &GasFeePolicy{} type GasFeePolicy struct { // The gas fee token id. Empty if base token. GasFeeTokenId string `json:"gasFeeTokenId"` - // The amount of gas per token. - GasPerToken int64 `json:"gasPerToken"` + // The amount of gas per token. (uint64 as string) + GasPerToken string `json:"gasPerToken"` // The validator fee share. ValidatorFeeShare int32 `json:"validatorFeeShare"` } @@ -31,7 +31,7 @@ type GasFeePolicy struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGasFeePolicy(gasFeeTokenId string, gasPerToken int64, validatorFeeShare int32) *GasFeePolicy { +func NewGasFeePolicy(gasFeeTokenId string, gasPerToken string, validatorFeeShare int32) *GasFeePolicy { this := GasFeePolicy{} this.GasFeeTokenId = gasFeeTokenId this.GasPerToken = gasPerToken @@ -72,9 +72,9 @@ func (o *GasFeePolicy) SetGasFeeTokenId(v string) { } // GetGasPerToken returns the GasPerToken field value -func (o *GasFeePolicy) GetGasPerToken() int64 { +func (o *GasFeePolicy) GetGasPerToken() string { if o == nil { - var ret int64 + var ret string return ret } @@ -83,7 +83,7 @@ func (o *GasFeePolicy) GetGasPerToken() int64 { // GetGasPerTokenOk returns a tuple with the GasPerToken field value // and a boolean to check if the value has been set. -func (o *GasFeePolicy) GetGasPerTokenOk() (*int64, bool) { +func (o *GasFeePolicy) GetGasPerTokenOk() (*string, bool) { if o == nil { return nil, false } @@ -91,7 +91,7 @@ func (o *GasFeePolicy) GetGasPerTokenOk() (*int64, bool) { } // SetGasPerToken sets field value -func (o *GasFeePolicy) SetGasPerToken(v int64) { +func (o *GasFeePolicy) SetGasPerToken(v string) { o.GasPerToken = v } diff --git a/clients/apiclient/model_receipt_error.go b/clients/apiclient/model_receipt_error.go index f2631506d2..ca7ab33036 100644 --- a/clients/apiclient/model_receipt_error.go +++ b/clients/apiclient/model_receipt_error.go @@ -19,7 +19,8 @@ var _ MappedNullable = &ReceiptError{} // ReceiptError struct for ReceiptError type ReceiptError struct { - ContractId int32 `json:"contractId"` + // The contract hname (Hex) + ContractHName string `json:"contractHName"` ErrorCode string `json:"errorCode"` ErrorId uint32 `json:"errorId"` Message string `json:"message"` @@ -31,9 +32,9 @@ type ReceiptError struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewReceiptError(contractId int32, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { +func NewReceiptError(contractHName string, errorCode string, errorId uint32, message string, messageFormat string, parameters []string) *ReceiptError { this := ReceiptError{} - this.ContractId = contractId + this.ContractHName = contractHName this.ErrorCode = errorCode this.ErrorId = errorId this.Message = message @@ -50,28 +51,28 @@ func NewReceiptErrorWithDefaults() *ReceiptError { return &this } -// GetContractId returns the ContractId field value -func (o *ReceiptError) GetContractId() int32 { +// GetContractHName returns the ContractHName field value +func (o *ReceiptError) GetContractHName() string { if o == nil { - var ret int32 + var ret string return ret } - return o.ContractId + return o.ContractHName } -// GetContractIdOk returns a tuple with the ContractId field value +// GetContractHNameOk returns a tuple with the ContractHName field value // and a boolean to check if the value has been set. -func (o *ReceiptError) GetContractIdOk() (*int32, bool) { +func (o *ReceiptError) GetContractHNameOk() (*string, bool) { if o == nil { return nil, false } - return &o.ContractId, true + return &o.ContractHName, true } -// SetContractId sets field value -func (o *ReceiptError) SetContractId(v int32) { - o.ContractId = v +// SetContractHName sets field value +func (o *ReceiptError) SetContractHName(v string) { + o.ContractHName = v } // GetErrorCode returns the ErrorCode field value @@ -204,7 +205,7 @@ func (o ReceiptError) MarshalJSON() ([]byte, error) { func (o ReceiptError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["contractId"] = o.ContractId + toSerialize["contractHName"] = o.ContractHName toSerialize["errorCode"] = o.ErrorCode toSerialize["errorId"] = o.ErrorId toSerialize["message"] = o.Message diff --git a/clients/apiclient/model_request_id_response.go b/clients/apiclient/model_request_id_response.go new file mode 100644 index 0000000000..97218c758a --- /dev/null +++ b/clients/apiclient/model_request_id_response.go @@ -0,0 +1,118 @@ +/* +Wasp API + +REST API for the Wasp node + +API version: 0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package apiclient + +import ( + "encoding/json" +) + +// checks if the RequestIDResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestIDResponse{} + +// RequestIDResponse struct for RequestIDResponse +type RequestIDResponse struct { + // The request ID of the given transaction ID. (Hex) + RequestId string `json:"requestId"` +} + +// NewRequestIDResponse instantiates a new RequestIDResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestIDResponse(requestId string) *RequestIDResponse { + this := RequestIDResponse{} + this.RequestId = requestId + return &this +} + +// NewRequestIDResponseWithDefaults instantiates a new RequestIDResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestIDResponseWithDefaults() *RequestIDResponse { + this := RequestIDResponse{} + return &this +} + +// GetRequestId returns the RequestId field value +func (o *RequestIDResponse) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *RequestIDResponse) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *RequestIDResponse) SetRequestId(v string) { + o.RequestId = v +} + +func (o RequestIDResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestIDResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["requestId"] = o.RequestId + return toSerialize, nil +} + +type NullableRequestIDResponse struct { + value *RequestIDResponse + isSet bool +} + +func (v NullableRequestIDResponse) Get() *RequestIDResponse { + return v.value +} + +func (v *NullableRequestIDResponse) Set(val *RequestIDResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRequestIDResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestIDResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestIDResponse(val *RequestIDResponse) *NullableRequestIDResponse { + return &NullableRequestIDResponse{value: val, isSet: true} +} + +func (v NullableRequestIDResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestIDResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/clients/apiextensions/apierror.go b/clients/apiextensions/apierror.go new file mode 100644 index 0000000000..a7ac16c45b --- /dev/null +++ b/clients/apiextensions/apierror.go @@ -0,0 +1,36 @@ +package apiextensions + +import ( + "encoding/json" + + "github.com/iotaledger/wasp/clients/apiclient" +) + +type APIDetailError struct { + Message string + Error string +} + +type APIError struct { + Error string + DetailError *APIDetailError +} + +func AsAPIError(err error) (*APIError, bool) { + genericError, ok := err.(*apiclient.GenericOpenAPIError) + + if !ok { + return nil, false + } + + apiError := APIError{ + Error: genericError.Error(), + } + + var detailError APIDetailError + if json.Unmarshal(genericError.Body(), &detailError) == nil { + apiError.DetailError = &detailError + } + + return &apiError, true +} diff --git a/clients/apiextensions/dict.go b/clients/apiextensions/dict.go index bf2524e153..3c2d02c9b8 100644 --- a/clients/apiextensions/dict.go +++ b/clients/apiextensions/dict.go @@ -12,6 +12,7 @@ import ( func JSONDictToAPIJSONDict(jsonDict dict.JSONDict) apiclient.JSONDict { apiJSONDict := apiclient.NewJSONDict() + apiJSONDict.Items = make([]apiclient.Item, len(jsonDict.Items)) for k, v := range jsonDict.Items { apiJSONDict.Items[k] = apiclient.Item{ diff --git a/clients/chainclient/evm.go b/clients/chainclient/evm.go index b6200f71ba..8aea674936 100644 --- a/clients/chainclient/evm.go +++ b/clients/chainclient/evm.go @@ -9,13 +9,13 @@ import ( ) func (c *Client) RequestIDByEVMTransactionHash(ctx context.Context, txHash common.Hash) (isc.RequestID, error) { - requestIDStr, _, err := c.WaspClient.ChainsApi.GetRequestIDFromEVMTransactionID(ctx, c.ChainID.String(), txHash.String()).Execute() + requestIDStr, _, err := c.WaspClient.ChainsApi.GetRequestIDFromEVMTransactionID(ctx, c.ChainID.String(), txHash.Hex()).Execute() if err != nil { return isc.RequestID{}, err } - requestID, err := isc.RequestIDFromString(requestIDStr) + requestID, err := isc.RequestIDFromString(requestIDStr.RequestId) return requestID, err } diff --git a/clients/chainclient/uploadblob.go b/clients/chainclient/uploadblob.go index fc6fc733fd..a87eb332b2 100644 --- a/clients/chainclient/uploadblob.go +++ b/clients/chainclient/uploadblob.go @@ -17,6 +17,7 @@ func (c *Client) UploadBlob(ctx context.Context, fields dict.Dict) (hashing.Hash req, err := c.PostOffLedgerRequest( blob.Contract.Hname(), blob.FuncStoreBlob.Hname(), + PostRequestParams{ Args: fields, }, diff --git a/packages/webapi/apierrors/errors.go b/packages/webapi/apierrors/errors.go index 8dbd25c735..818e011e0b 100644 --- a/packages/webapi/apierrors/errors.go +++ b/packages/webapi/apierrors/errors.go @@ -42,6 +42,10 @@ func InvalidOffLedgerRequestError(err error) *HTTPError { return NewHTTPError(http.StatusBadRequest, "Supplied offledger request is invalid", err) } +func NoRecordFoundErrror(err error) *HTTPError { + return NewHTTPError(http.StatusNotFound, "Record not found", err) +} + func ReceiptError(err error) *HTTPError { return NewHTTPError(http.StatusBadRequest, "Failed to get receipt", err) } diff --git a/packages/webapi/controllers/chain/controller.go b/packages/webapi/controllers/chain/controller.go index 1f7ac78f09..ae0ff7d4f6 100644 --- a/packages/webapi/controllers/chain/controller.go +++ b/packages/webapi/controllers/chain/controller.go @@ -62,7 +62,7 @@ func (c *Controller) RegisterPublic(publicAPI echoswagger.ApiGroup, mocker inter SetOperationId("getRequestIDFromEVMTransactionID"). AddParamPath("", "chainID", "ChainID (Bech32)"). AddParamPath("", "txHash", "Transaction hash (Hex-encoded)"). - AddResponse(http.StatusOK, "Request ID", "", nil). + AddResponse(http.StatusOK, "Request ID", mocker.Get(models.RequestIDResponse{}), nil). AddResponse(http.StatusNotFound, "Request ID not found", "", nil) publicAPI.GET("chains/:chainID/state/:stateKey", c.getState). diff --git a/packages/webapi/controllers/chain/evm.go b/packages/webapi/controllers/chain/evm.go index 7e67212beb..2278e6a10f 100644 --- a/packages/webapi/controllers/chain/evm.go +++ b/packages/webapi/controllers/chain/evm.go @@ -5,7 +5,9 @@ import ( "github.com/labstack/echo/v4" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/params" ) @@ -26,9 +28,12 @@ func (c *Controller) getRequestID(e echo.Context) error { txHash := e.Param("txHash") requestID, err := c.evmService.GetRequestID(chainID, txHash) + if err != nil { return apierrors.InvalidPropertyError("txHash", err) } - return e.JSON(http.StatusOK, requestID) + return e.JSON(http.StatusOK, models.RequestIDResponse{ + RequestID: iotago.EncodeHex(requestID.Bytes()), + }) } diff --git a/packages/webapi/controllers/corecontracts/blob.go b/packages/webapi/controllers/corecontracts/blob.go index 131dc3e8f1..6db25c3ec0 100644 --- a/packages/webapi/controllers/corecontracts/blob.go +++ b/packages/webapi/controllers/corecontracts/blob.go @@ -1,6 +1,7 @@ package corecontracts import ( + "fmt" "net/http" "github.com/labstack/echo/v4" @@ -78,6 +79,8 @@ type BlobInfoResponse struct { } func (c *Controller) getBlobInfo(e echo.Context) error { + fmt.Println("GET BLOB INFO") + chainID, err := params.DecodeChainID(e) if err != nil { return err @@ -93,14 +96,18 @@ func (c *Controller) getBlobInfo(e echo.Context) error { return apierrors.ContractExecutionError(err) } - if !ok { - return e.NoContent(http.StatusNotFound) - } + fmt.Printf("GET BLOB INFO: ok:%v, err:%v", ok, err) blobInfoResponse := &BlobInfoResponse{ Fields: map[string]uint32{}, } + // TODO: Validate this logic. Should an empty blob info result in a different http error code? + if !ok { + fmt.Printf("GET BLOB INFO return empty blobInfoResponse") + return e.JSON(http.StatusOK, blobInfoResponse) + } + for k, v := range blobInfo { blobInfoResponse.Fields[k] = v } diff --git a/packages/webapi/controllers/corecontracts/blocklog.go b/packages/webapi/controllers/corecontracts/blocklog.go index dd497f6291..d439152e87 100644 --- a/packages/webapi/controllers/corecontracts/blocklog.go +++ b/packages/webapi/controllers/corecontracts/blocklog.go @@ -1,6 +1,7 @@ package corecontracts import ( + goerrors "errors" "net/http" "strconv" @@ -14,6 +15,7 @@ import ( "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/vm/core/errors" "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/corecontracts" "github.com/iotaledger/wasp/packages/webapi/interfaces" "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/params" @@ -145,6 +147,9 @@ func (c *Controller) getRequestReceipt(e echo.Context) error { receipt, err := c.blocklog.GetRequestReceipt(chainID, requestID) if err != nil { + if goerrors.Is(err, corecontracts.ErrNoRecord) { + return apierrors.NoRecordFoundErrror(err) + } return apierrors.ContractExecutionError(err) } diff --git a/packages/webapi/controllers/corecontracts/governance.go b/packages/webapi/controllers/corecontracts/governance.go index a340e0cec2..cbd3f1fa2e 100644 --- a/packages/webapi/controllers/corecontracts/governance.go +++ b/packages/webapi/controllers/corecontracts/governance.go @@ -5,6 +5,7 @@ import ( "github.com/labstack/echo/v4" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/parameters" "github.com/iotaledger/wasp/packages/vm/core/governance" @@ -14,7 +15,7 @@ import ( type gasFeePolicy struct { GasFeeTokenID string `json:"gasFeeTokenId" swagger:"desc(The gas fee token id. Empty if base token.),required"` - GasPerToken uint64 `json:"gasPerToken" swagger:"desc(The amount of gas per token.),required"` + GasPerToken string `json:"gasPerToken" swagger:"desc(The amount of gas per token. (uint64 as string)),min(0),required"` ValidatorFeeShare uint8 `json:"validatorFeeShare" swagger:"desc(The validator fee share.),required"` } @@ -49,7 +50,7 @@ func MapGovChainInfoResponse(chainInfo *governance.ChainInfo) GovChainInfoRespon Description: chainInfo.Description, GasFeePolicy: gasFeePolicy{ GasFeeTokenID: gasFeeTokenID, - GasPerToken: chainInfo.GasFeePolicy.GasPerToken, + GasPerToken: iotago.EncodeUint64(chainInfo.GasFeePolicy.GasPerToken), ValidatorFeeShare: chainInfo.GasFeePolicy.ValidatorFeeShare, }, MaxBlobSize: chainInfo.MaxBlobSize, diff --git a/packages/webapi/controllers/requests/receipt.go b/packages/webapi/controllers/requests/receipt.go index ad9a492f5a..c741a7138b 100644 --- a/packages/webapi/controllers/requests/receipt.go +++ b/packages/webapi/controllers/requests/receipt.go @@ -1,11 +1,13 @@ package requests import ( + "errors" "net/http" "github.com/labstack/echo/v4" "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/corecontracts" "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/params" ) @@ -23,6 +25,9 @@ func (c *Controller) getReceipt(e echo.Context) error { receipt, vmError, err := c.vmService.GetReceipt(chainID, requestID) if err != nil { + if errors.Is(err, corecontracts.ErrNoRecord) { + return apierrors.NoRecordFoundErrror(err) + } return apierrors.ReceiptError(err) } diff --git a/packages/webapi/corecontracts/blob.go b/packages/webapi/corecontracts/blob.go index ca0d8524a5..0a73c8f747 100644 --- a/packages/webapi/corecontracts/blob.go +++ b/packages/webapi/corecontracts/blob.go @@ -20,7 +20,7 @@ func NewBlob(vmService interfaces.VMService) *Blob { func (b *Blob) GetBlobInfo(chainID isc.ChainID, blobHash hashing.HashValue) (map[string]uint32, bool, error) { ret, err := b.vmService.CallViewByChainID(chainID, blob.Contract.Hname(), blob.ViewGetBlobInfo.Hname(), codec.MakeDict(map[string]interface{}{ - blob.ParamHash: blobHash[:], + blob.ParamHash: blobHash.Bytes(), })) if err != nil { return nil, false, err @@ -39,8 +39,8 @@ func (b *Blob) GetBlobInfo(chainID isc.ChainID, blobHash hashing.HashValue) (map } func (b *Blob) GetBlobValue(chainID isc.ChainID, blobHash hashing.HashValue, key string) ([]byte, error) { - ret, err := b.vmService.CallViewByChainID(chainID, blob.Contract.Hname(), blob.ViewGetBlobInfo.Hname(), codec.MakeDict(map[string]interface{}{ - blob.ParamHash: blobHash[:], + ret, err := b.vmService.CallViewByChainID(chainID, blob.Contract.Hname(), blob.ViewGetBlobField.Hname(), codec.MakeDict(map[string]interface{}{ + blob.ParamHash: blobHash.Bytes(), blob.ParamField: []byte(key), })) if err != nil { diff --git a/packages/webapi/corecontracts/blocklog.go b/packages/webapi/corecontracts/blocklog.go index d4359e47c4..6afce04c2f 100644 --- a/packages/webapi/corecontracts/blocklog.go +++ b/packages/webapi/corecontracts/blocklog.go @@ -1,6 +1,8 @@ package corecontracts import ( + "errors" + "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/codec" "github.com/iotaledger/wasp/packages/kv/collections" @@ -137,6 +139,8 @@ func (b *BlockLog) GetRequestIDsForBlock(chainID isc.ChainID, blockIndex uint32) return handleRequestIDs(ret) } +var ErrNoRecord = errors.New("no request record") + func (b *BlockLog) GetRequestReceipt(chainID isc.ChainID, requestID isc.RequestID) (*blocklog.RequestReceipt, error) { ret, err := b.vmService.CallViewByChainID(chainID, blocklog.Contract.Hname(), blocklog.ViewGetRequestReceipt.Hname(), codec.MakeDict(map[string]interface{}{ blocklog.ParamRequestID: requestID, @@ -148,7 +152,7 @@ func (b *BlockLog) GetRequestReceipt(chainID isc.ChainID, requestID isc.RequestI resultDecoder := kvdecoder.New(ret) binRec, err := resultDecoder.GetBytes(blocklog.ParamRequestRecord) if err != nil || binRec == nil { - return nil, err + return nil, ErrNoRecord } requestReceipt, err := blocklog.RequestReceiptFromBytes(binRec) diff --git a/packages/webapi/models/chain.go b/packages/webapi/models/chain.go index ec6b2844a2..f6bd1e5a59 100644 --- a/packages/webapi/models/chain.go +++ b/packages/webapi/models/chain.go @@ -99,7 +99,7 @@ func MapChainInfoResponse(chainInfo *dto2.ChainInfo, evmChainID uint16) ChainInf } type RequestIDResponse struct { - RequestID string `json:"requestId" swagger:"desc(The request ID of the given transaction ID.)"` + RequestID string `json:"requestId" swagger:"desc(The request ID of the given transaction ID. (Hex)),required"` } type ChainRecord struct { diff --git a/packages/webapi/models/vm.go b/packages/webapi/models/vm.go index c31b239eab..4d0a027586 100644 --- a/packages/webapi/models/vm.go +++ b/packages/webapi/models/vm.go @@ -7,7 +7,7 @@ import ( ) type ReceiptError struct { - ContractID isc.Hname `json:"contractId" swagger:"required"` + ContractHName string `json:"contractHName" swagger:"required,desc(The contract hname (Hex))"` ErrorID uint16 `json:"errorId" swagger:"required,min(1)"` ErrorCode string `json:"errorCode" swagger:"required"` Message string `json:"message" swagger:"required"` @@ -21,7 +21,7 @@ func MapReceiptError(err *isc.VMError) *ReceiptError { } return &ReceiptError{ - ContractID: err.Code().ContractID, + ContractHName: err.Code().ContractID.String(), ErrorID: err.Code().ID, ErrorCode: err.Code().String(), Message: err.Error(), diff --git a/packages/webapi/services/evm.go b/packages/webapi/services/evm.go index f6998edbf4..73030f32a0 100644 --- a/packages/webapi/services/evm.go +++ b/packages/webapi/services/evm.go @@ -32,6 +32,8 @@ type EVMService struct { func NewEVMService(chainService interfaces.ChainService, networkProvider peering.NetworkProvider) interfaces.EVMService { return &EVMService{ chainService: chainService, + evmChainServers: map[isc.ChainID]*chainServer{}, + evmBackendMutex: sync.Mutex{}, networkProvider: networkProvider, } } diff --git a/tools/cluster/tests/access_nodes_test.go b/tools/cluster/tests/access_nodes_test.go index 4c3ab152fe..48063a0850 100644 --- a/tools/cluster/tests/access_nodes_test.go +++ b/tools/cluster/tests/access_nodes_test.go @@ -63,17 +63,19 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { accessNodePeerInfo, _, err := accessNodeClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() require.NoError(t, err) - err = clu2.AddTrustedNode(apiclient.PeeringTrustRequest{ + err = env.Clu.AddTrustedNode(apiclient.PeeringTrustRequest{ PublicKey: accessNodePeerInfo.PublicKey, NetId: accessNodePeerInfo.NetId, }, []int{0}) require.NoError(t, err) // activate the chain on the access node - _, err = accessNodeClient.ChainsApi.SetChainRecord(context.Background(), env.Chain.ChainID.String()).ChainRecord(apiclient.ChainRecord{ - IsActive: true, - AccessNodes: []string{}, - }).Execute() + _, err = accessNodeClient.ChainsApi. + SetChainRecord(context.Background(), env.Chain.ChainID.String()). + ChainRecord(apiclient.ChainRecord{ + IsActive: true, + AccessNodes: []string{}, + }).Execute() require.NoError(t, err) // add node 0 from cluster 2 as a *permitionless* access node @@ -115,6 +117,6 @@ func testPermitionlessAccessNode(t *testing.T, env *ChainEnv) { receipt, _, err := nodeClient.RequestsApi.GetReceipt(context.Background(), env.Chain.ChainID.String(), req.ID().String()).Execute() require.Error(t, err) - require.Regexp(t, `"Code":404`, err.Error()) + require.Regexp(t, `404`, err.Error()) require.Nil(t, receipt) } diff --git a/tools/cluster/tests/account_test.go b/tools/cluster/tests/account_test.go index 071b4d23a8..bf1e15be89 100644 --- a/tools/cluster/tests/account_test.go +++ b/tools/cluster/tests/account_test.go @@ -142,9 +142,13 @@ func testBasic2Accounts(t *testing.T, env *ChainEnv) { require.NoError(t, err) t.Logf("%+v", contractRegistry) - cr := contractRegistry[hname] + cr, ok := lo.Find(contractRegistry, func(item apiclient.ContractInfoResponse) bool { + return item.HName == hname.String() + }) + require.True(t, ok) + require.NotNil(t, cr) - require.EqualValues(t, programHash1, cr.ProgramHash) + require.EqualValues(t, programHash1.Hex(), cr.ProgramHash) require.EqualValues(t, description, cr.Description) require.EqualValues(t, nativeIncCounterSCName, cr.Name) diff --git a/tools/cluster/tests/blob_test.go b/tools/cluster/tests/blob_test.go index 01a538a205..913f616ece 100644 --- a/tools/cluster/tests/blob_test.go +++ b/tools/cluster/tests/blob_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/kv/codec" @@ -32,10 +33,13 @@ func (e *ChainEnv) getBlobFieldValue(blobHash hashing.HashValue, field string) [ require.NoError(e.t, err) if blobField.ValueData == "" { - return nil + return []byte{} } - return []byte(blobField.ValueData) + value, err := iotago.DecodeHex(blobField.ValueData) + + require.NoError(e.t, err) + return value } // executed in cluster_test.go diff --git a/tools/cluster/tests/cluster_test.go b/tools/cluster/tests/cluster_test.go index 01ae3f0a2c..84d1b23c2a 100644 --- a/tools/cluster/tests/cluster_test.go +++ b/tools/cluster/tests/cluster_test.go @@ -32,7 +32,7 @@ func TestClusterMultiNodeCommittee(t *testing.T) { if testing.Short() { t.Skip("Skipping cluster tests in short mode") } - // setup a cluster with a 4 nodes + // setup a cluster with 4 nodes run := createTestWrapper(t, 4, []int{0, 1, 2, 3}) t.Run("deploy basic", func(t *testing.T) { run(t, testDeployChain) }) diff --git a/tools/cluster/tests/cluster_testutils.go b/tools/cluster/tests/cluster_testutils.go index 4744d4af00..7966e92654 100644 --- a/tools/cluster/tests/cluster_testutils.go +++ b/tools/cluster/tests/cluster_testutils.go @@ -3,8 +3,10 @@ package tests import ( "time" + "github.com/samber/lo" "github.com/stretchr/testify/require" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/contracts/native/inccounter" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/vm/core/root" @@ -59,10 +61,13 @@ func (e *ChainEnv) deployNativeIncCounterSC(initCounter ...int) { contractRegistry, err := e.Chain.ContractRegistry(i) require.NoError(e.t, err) - cr := contractRegistry[nativeIncCounterSCHname] + cr, ok := lo.Find(contractRegistry, func(item apiclient.ContractInfoResponse) bool { + return item.HName == nativeIncCounterSCHname.String() + }) + require.True(e.t, ok) require.NotNil(e.t, cr) - require.EqualValues(e.t, programHash, cr.ProgramHash) + require.EqualValues(e.t, programHash.Hex(), cr.ProgramHash) require.EqualValues(e.t, description, cr.Description) require.EqualValues(e.t, cr.Name, nativeIncCounterSCName) diff --git a/tools/cluster/tests/deploy_test.go b/tools/cluster/tests/deploy_test.go index e03860eb65..f573fe948b 100644 --- a/tools/cluster/tests/deploy_test.go +++ b/tools/cluster/tests/deploy_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/samber/lo" "github.com/stretchr/testify/require" "github.com/iotaledger/wasp/clients/apiclient" @@ -91,7 +92,12 @@ func testDeployContractAndSpawn(t *testing.T, env *ChainEnv) { require.NoError(t, err) require.EqualValues(t, len(corecontracts.All)+2, len(contractRegistry)) - cr := contractRegistry[hnameNew] + cr, ok := lo.Find(contractRegistry, func(item apiclient.ContractInfoResponse) bool { + return item.HName == hnameNew.String() + }) + require.True(t, ok) + require.NotNil(t, cr) + require.EqualValues(t, dscrNew, cr.Description) require.EqualValues(t, nameNew, cr.Name) diff --git a/tools/cluster/tests/evm_jsonrpc_test.go b/tools/cluster/tests/evm_jsonrpc_test.go index 21682b6a8c..65f7bfbdfb 100644 --- a/tools/cluster/tests/evm_jsonrpc_test.go +++ b/tools/cluster/tests/evm_jsonrpc_test.go @@ -37,7 +37,7 @@ func newClusterTestEnv(t *testing.T, env *ChainEnv, nodeIndex int) *clusterTestE evmtest.InitGoEthLogger(t) evmJsonRPCPath := fmt.Sprintf("/chains/%v/evm", env.Chain.ChainID.String()) - jsonRPCEndpoint := "http://" + env.Clu.Config.APIHost(nodeIndex) + evmJsonRPCPath + jsonRPCEndpoint := env.Clu.Config.APIHost(nodeIndex) + evmJsonRPCPath rawClient, err := rpc.DialHTTP(jsonRPCEndpoint) require.NoError(t, err) client := ethclient.NewClient(rawClient) diff --git a/tools/cluster/tests/maintenance_test.go b/tools/cluster/tests/maintenance_test.go index fd61127bb1..a05b4c45bc 100644 --- a/tools/cluster/tests/maintenance_test.go +++ b/tools/cluster/tests/maintenance_test.go @@ -94,7 +94,8 @@ func testMaintenance(t *testing.T, env *ChainEnv) { require.NoError(t, err) time.Sleep(10 * time.Second) // not ideal, but I don't think there is a good way to wait for something that will NOT be processed rec, err := env.Chain.GetRequestReceipt(notProccessedReq1.ID()) - require.Regexp(t, `.*"Code":404.*`, err.Error()) + + require.EqualValues(t, `404 Not Found`, err.Error()) require.Nil(t, rec) // calls to non-maintenance endpoints are not processed, even when done by the chain owner @@ -102,7 +103,7 @@ func testMaintenance(t *testing.T, env *ChainEnv) { require.NoError(t, err) time.Sleep(10 * time.Second) // not ideal, but I don't think there is a good way to wait for something that will NOT be processed rec, err = env.Chain.GetRequestReceipt(notProccessedReq2.ID()) - require.Regexp(t, `.*"Code":404.*`, err.Error()) + require.EqualValues(t, `404 Not Found`, err.Error()) require.Nil(t, rec) // assert that block number is still the same diff --git a/tools/cluster/tests/offledger_requests_test.go b/tools/cluster/tests/offledger_requests_test.go index 2704bd4197..f9c44f0e50 100644 --- a/tools/cluster/tests/offledger_requests_test.go +++ b/tools/cluster/tests/offledger_requests_test.go @@ -161,7 +161,11 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { Nonce: 1, }, ) - require.Regexp(t, "invalid nonce", err.Error()) + + apiError, ok := apiextensions.AsAPIError(err) + require.True(t, ok) + require.NotNil(t, apiError.DetailError) + require.Regexp(t, "invalid nonce", apiError.DetailError.Error) // try replaying the initial request _, err = chClient.PostOffLedgerRequest( @@ -171,7 +175,11 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { Nonce: 1_000_000, }, ) - require.Regexp(t, "request already processed", err.Error()) + + apiError, ok = apiextensions.AsAPIError(err) + require.True(t, ok) + require.NotNil(t, apiError.DetailError) + require.Regexp(t, "request already processed", apiError.DetailError.Error) // send a request with a higher nonce offledgerReq, err = chClient.PostOffLedgerRequest( diff --git a/tools/cluster/tests/post_test.go b/tools/cluster/tests/post_test.go index ebdbf7a677..24805f2338 100644 --- a/tools/cluster/tests/post_test.go +++ b/tools/cluster/tests/post_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/samber/lo" "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" @@ -40,9 +41,14 @@ func deployInccounter42(e *ChainEnv) *isc.ContractAgentID { contractRegistry, err := e.Chain.ContractRegistry(i) require.NoError(e.t, err) - cr := contractRegistry[hname] - require.EqualValues(e.t, programHash, cr.ProgramHash) + cr, ok := lo.Find(contractRegistry, func(item apiclient.ContractInfoResponse) bool { + return item.HName == hname.String() + }) + require.True(e.t, ok) + require.NotNil(e.t, cr) + + require.EqualValues(e.t, programHash.Hex(), cr.ProgramHash) require.EqualValues(e.t, description, cr.Description) require.EqualValues(e.t, cr.Name, inccounterName) diff --git a/tools/wasp-cli/chain/accounts.go b/tools/wasp-cli/chain/accounts.go index eb50e42930..172cece77f 100644 --- a/tools/wasp-cli/chain/accounts.go +++ b/tools/wasp-cli/chain/accounts.go @@ -67,7 +67,7 @@ func initBalanceCmd() *cobra.Command { header := []string{"token", "amount"} rows := make([][]string, len(balance.NativeTokens)+1) - rows[0] = []string{"Base Token", balance.BaseTokens} + rows[0] = []string{"base", balance.BaseTokens} for k, v := range balance.NativeTokens { rows[k+1] = []string{v.Id, v.Amount} } diff --git a/tools/wasp-cli/cli/config/config.go b/tools/wasp-cli/cli/config/config.go index f0ab61829c..8904449c60 100644 --- a/tools/wasp-cli/cli/config/config.go +++ b/tools/wasp-cli/cli/config/config.go @@ -38,7 +38,7 @@ func RefreshL1ParamsFromNode() { log.Printf("Getting L1 params from node at %s...\n", L1APIAddress()) } //TODO: Move to a proper place - //cliclients.L1Client() // this will call parameters.InitL1() + // this will call parameters.InitL1() Set(l1ParamsKey, parameters.L1NoLock()) Set(l1ParamsTimestampKey, time.Now()) } diff --git a/tools/wasp-cli/cli/init/init.go b/tools/wasp-cli/cli/init/init.go index d35ed5718e..18a0649ae4 100644 --- a/tools/wasp-cli/cli/init/init.go +++ b/tools/wasp-cli/cli/init/init.go @@ -4,6 +4,7 @@ import ( "github.com/spf13/cobra" "github.com/iotaledger/wasp/packages/parameters" + "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" ) @@ -47,6 +48,8 @@ func Init(rootCmd *cobra.Command, waspVersion string) { // The first time parameters.L1() is called, it will be initialized with this function parameters.InitL1Lazy(func() { + cliclients.L1Client() + if config.L1ParamsExpired() { config.RefreshL1ParamsFromNode() } else { From 3700b0ee5521f9d96d7093c3d9a8e4494fe23dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Tue, 7 Feb 2023 23:42:53 +0100 Subject: [PATCH 28/39] Fix clients --- client/chainclient/chainclient.go | 236 ----------------------------- clients/chainclient/chainclient.go | 12 +- packages/webapi/api.go | 2 +- 3 files changed, 7 insertions(+), 243 deletions(-) delete mode 100644 client/chainclient/chainclient.go diff --git a/client/chainclient/chainclient.go b/client/chainclient/chainclient.go deleted file mode 100644 index c77bc25868..0000000000 --- a/client/chainclient/chainclient.go +++ /dev/null @@ -1,236 +0,0 @@ -package chainclient - -import ( - "sync" - - iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client" - "github.com/iotaledger/wasp/packages/cryptolib" - "github.com/iotaledger/wasp/packages/isc" - "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/kv/dict" - "github.com/iotaledger/wasp/packages/l1connection" - "github.com/iotaledger/wasp/packages/transaction" - "github.com/iotaledger/wasp/packages/vm/core/accounts" - "github.com/iotaledger/wasp/packages/vm/gas" -) - -// Client allows to interact with a specific chain in the node, for example to send on-ledger or off-ledger requests -type Client struct { - Layer1Client l1connection.Client - WaspClient *client.WaspClient - ChainID isc.ChainID - KeyPair *cryptolib.KeyPair - nonces map[string]uint64 - noncesMutex sync.Mutex -} - -// New creates a new chainclient.Client -func New( - layer1Client l1connection.Client, - waspClient *client.WaspClient, - chainID isc.ChainID, - keyPair *cryptolib.KeyPair, -) *Client { - return &Client{ - Layer1Client: layer1Client, - WaspClient: waspClient, - ChainID: chainID, - KeyPair: keyPair, - nonces: make(map[string]uint64), - } -} - -type PostRequestParams struct { - Transfer *isc.Assets - Args dict.Dict - Nonce uint64 - NFT *isc.NFT - Allowance *isc.Assets - GasBudget *uint64 - AutoAdjustStorageDeposit bool -} - -func defaultParams(params ...PostRequestParams) PostRequestParams { - if len(params) > 0 { - return params[0] - } - return PostRequestParams{} -} - -// Post1Request sends an on-ledger transaction with one request on it to the chain -func (c *Client) Post1Request( - contractHname isc.Hname, - entryPoint isc.Hname, - params ...PostRequestParams, -) (*iotago.Transaction, error) { - outputsSet, err := c.Layer1Client.OutputMap(c.KeyPair.Address()) - if err != nil { - return nil, err - } - return c.post1RequestWithOutputs(contractHname, entryPoint, outputsSet, params...) -} - -// PostNRequest sends n consecutive on-ledger transactions with one request on each, to the chain -func (c *Client) PostNRequests( - contractHname isc.Hname, - entryPoint isc.Hname, - requestsCount int, - params ...PostRequestParams, -) ([]*iotago.Transaction, error) { - var err error - outputs, err := c.Layer1Client.OutputMap(c.KeyPair.Address()) - if err != nil { - return nil, err - } - transactions := make([]*iotago.Transaction, requestsCount) - for i := 0; i < requestsCount; i++ { - transactions[i], err = c.post1RequestWithOutputs(contractHname, entryPoint, outputs, params...) - if err != nil { - return nil, err - } - txID, err := transactions[i].ID() - if err != nil { - return nil, err - } - for _, input := range transactions[i].Essence.Inputs { - if utxoInput, ok := input.(*iotago.UTXOInput); ok { - delete(outputs, utxoInput.ID()) - } - } - for index, output := range transactions[i].Essence.Outputs { - if basicOutput, ok := output.(*iotago.BasicOutput); ok { - if basicOutput.Ident().Equal(c.KeyPair.Address()) { - outputID := iotago.OutputIDFromTransactionIDAndIndex(txID, uint16(index)) - outputs[outputID] = transactions[i].Essence.Outputs[index] - } - } - } - } - return transactions, nil -} - -func (c *Client) post1RequestWithOutputs( - contractHname isc.Hname, - entryPoint isc.Hname, - outputs iotago.OutputSet, - params ...PostRequestParams, -) (*iotago.Transaction, error) { - par := defaultParams(params...) - var gasBudget uint64 - if par.GasBudget == nil { - gasBudget = gas.MaxGasPerRequest - } else { - gasBudget = *par.GasBudget - } - tx, err := transaction.NewRequestTransaction( - transaction.NewRequestTransactionParams{ - SenderKeyPair: c.KeyPair, - SenderAddress: c.KeyPair.Address(), - UnspentOutputs: outputs, - UnspentOutputIDs: isc.OutputSetToOutputIDs(outputs), - Request: &isc.RequestParameters{ - TargetAddress: c.ChainID.AsAddress(), - Assets: par.Transfer, - AdjustToMinimumStorageDeposit: par.AutoAdjustStorageDeposit, - Metadata: &isc.SendMetadata{ - TargetContract: contractHname, - EntryPoint: entryPoint, - Params: par.Args, - Allowance: par.Allowance, - GasBudget: gasBudget, - }, - }, - NFT: par.NFT, - }, - ) - if err != nil { - return nil, err - } - _, err = c.Layer1Client.PostTxAndWaitUntilConfirmation(tx) - return tx, err -} - -// PostOffLedgerRequest sends an off-ledger tx via the wasp node web api -func (c *Client) PostOffLedgerRequest( - contractHname isc.Hname, - entrypoint isc.Hname, - params ...PostRequestParams, -) (isc.OffLedgerRequest, error) { - par := defaultParams(params...) - if par.Nonce == 0 { - c.noncesMutex.Lock() - c.nonces[c.KeyPair.Address().Key()]++ - par.Nonce = c.nonces[c.KeyPair.Address().Key()] - c.noncesMutex.Unlock() - } - var gasBudget uint64 - if par.GasBudget == nil { - gasBudget = gas.MaxGasPerRequest - } else { - gasBudget = *par.GasBudget - } - req := isc.NewOffLedgerRequest(c.ChainID, contractHname, entrypoint, par.Args, par.Nonce) - req.WithAllowance(par.Allowance) - if par.GasBudget != nil { - req = req.WithGasBudget(gasBudget) - } - req.WithNonce(par.Nonce) - signed := req.Sign(c.KeyPair) - return signed, c.WaspClient.PostOffLedgerRequest(c.ChainID, signed) -} - -func (c *Client) DepositFunds(n uint64) (*iotago.Transaction, error) { - return c.Post1Request(accounts.Contract.Hname(), accounts.FuncDeposit.Hname(), PostRequestParams{ - Transfer: isc.NewAssets(n, nil), - }) -} - -// NewPostRequestParams simplifies encoding of request parameters -func NewPostRequestParams(p ...interface{}) *PostRequestParams { - return &PostRequestParams{ - Args: parseParams(p), - Transfer: isc.NewAssets(0, nil), - } -} - -func (par *PostRequestParams) WithTransfer(transfer *isc.Assets) *PostRequestParams { - par.Transfer = transfer - return par -} - -func (par *PostRequestParams) WithBaseTokens(i uint64) *PostRequestParams { - par.Transfer.AddBaseTokens(i) - return par -} - -func (par *PostRequestParams) WithGasBudget(budget uint64) *PostRequestParams { - par.GasBudget = &budget - return par -} - -func parseParams(params []interface{}) dict.Dict { - if len(params) == 1 { - return params[0].(dict.Dict) - } - return codec.MakeDict(toMap(params)) -} - -// makes map without hashing -func toMap(params []interface{}) map[string]interface{} { - par := make(map[string]interface{}) - if len(params) == 0 { - return par - } - if len(params)%2 != 0 { - panic("toMap: len(params) % 2 != 0") - } - for i := 0; i < len(params)/2; i++ { - key, ok := params[2*i].(string) - if !ok { - panic("toMap: string expected") - } - par[key] = params[2*i+1] - } - return par -} diff --git a/clients/chainclient/chainclient.go b/clients/chainclient/chainclient.go index 399d3fdba7..51592a8067 100644 --- a/clients/chainclient/chainclient.go +++ b/clients/chainclient/chainclient.go @@ -41,11 +41,11 @@ func New( } type PostRequestParams struct { - Transfer *isc.FungibleTokens + Transfer *isc.Assets Args dict.Dict Nonce uint64 NFT *isc.NFT - Allowance *isc.Allowance + Allowance *isc.Assets GasBudget *uint64 AutoAdjustStorageDeposit bool } @@ -130,7 +130,7 @@ func (c *Client) post1RequestWithOutputs( UnspentOutputIDs: isc.OutputSetToOutputIDs(outputs), Request: &isc.RequestParameters{ TargetAddress: c.ChainID.AsAddress(), - FungibleTokens: par.Transfer, + Assets: par.Transfer, AdjustToMinimumStorageDeposit: par.AutoAdjustStorageDeposit, Metadata: &isc.SendMetadata{ TargetContract: contractHname, @@ -191,7 +191,7 @@ func (c *Client) PostOffLedgerRequest( func (c *Client) DepositFunds(n uint64) (*iotago.Transaction, error) { return c.Post1Request(accounts.Contract.Hname(), accounts.FuncDeposit.Hname(), PostRequestParams{ - Transfer: isc.NewFungibleTokens(n, nil), + Transfer: isc.NewAssets(n, nil), }) } @@ -199,11 +199,11 @@ func (c *Client) DepositFunds(n uint64) (*iotago.Transaction, error) { func NewPostRequestParams(p ...interface{}) *PostRequestParams { return &PostRequestParams{ Args: parseParams(p), - Transfer: isc.NewFungibleTokens(0, nil), + Transfer: isc.NewAssets(0, nil), } } -func (par *PostRequestParams) WithTransfer(transfer *isc.FungibleTokens) *PostRequestParams { +func (par *PostRequestParams) WithTransfer(transfer *isc.Assets) *PostRequestParams { par.Transfer = transfer return par } diff --git a/packages/webapi/api.go b/packages/webapi/api.go index adc82b1470..ded29caf96 100644 --- a/packages/webapi/api.go +++ b/packages/webapi/api.go @@ -29,7 +29,7 @@ func loadControllers(server echoswagger.ApiRoot, mocker *Mocker, controllersToLo for _, controller := range controllersToLoad { group := server.Group(controller.Name(), "/") - controller.RegisterPublic(publicGroup, mocker) + controller.RegisterPublic(group, mocker) adminGroup := server.Group(controller.Name(), "/"). SetSecurity("Authorization") From dba1da1c5ca412b4879e8e5f3004da2619defd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 8 Feb 2023 10:09:59 +0100 Subject: [PATCH 29/39] Fix rebase errors --- clients/chainclient/chainclient.go | 4 ++++ packages/webapi/api.go | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/clients/chainclient/chainclient.go b/clients/chainclient/chainclient.go index 51592a8067..1526f6a19c 100644 --- a/clients/chainclient/chainclient.go +++ b/clients/chainclient/chainclient.go @@ -2,6 +2,7 @@ package chainclient import ( "context" + "sync" iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/apiclient" @@ -22,6 +23,7 @@ type Client struct { ChainID isc.ChainID KeyPair *cryptolib.KeyPair nonces map[string]uint64 + noncesMutex sync.Mutex } // New creates a new chainclient.Client @@ -158,8 +160,10 @@ func (c *Client) PostOffLedgerRequest( ) (isc.OffLedgerRequest, error) { par := defaultParams(params...) if par.Nonce == 0 { + c.noncesMutex.Lock() c.nonces[c.KeyPair.Address().Key()]++ par.Nonce = c.nonces[c.KeyPair.Address().Key()] + c.noncesMutex.Unlock() } var gasBudget uint64 if par.GasBudget == nil { diff --git a/packages/webapi/api.go b/packages/webapi/api.go index ded29caf96..90aa6ffe91 100644 --- a/packages/webapi/api.go +++ b/packages/webapi/api.go @@ -31,8 +31,7 @@ func loadControllers(server echoswagger.ApiRoot, mocker *Mocker, controllersToLo controller.RegisterPublic(group, mocker) - adminGroup := server.Group(controller.Name(), "/"). - SetSecurity("Authorization") + adminGroup := group.SetSecurity("Authorization") controller.RegisterAdmin(adminGroup, mocker) } From 82594c37720184def0779e20ffd32ea239c20a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 8 Feb 2023 11:54:54 +0100 Subject: [PATCH 30/39] Update documentation, update client generation script --- clients/apiclient/.openapi-generator/VERSION | 2 +- clients/apiclient/api/openapi.yaml | 14 +- clients/apiclient/docs/BlobInfoResponse.md | 10 +- clients/apiclient/docs/MilestoneInfo.md | 16 +-- clients/apiclient/generate_client.sh | 26 +++- clients/apiclient/model_milestone_info.go | 24 ++-- .../test/testwasmlib_client_test.go | 2 +- packages/webapi/SWAGGER_TRAPS.md | 30 ---- packages/webapi/WEBAPI_OVERVIEW.md | 128 ++++++++++++++++++ packages/webapi/models/L1.go | 4 +- 10 files changed, 188 insertions(+), 68 deletions(-) delete mode 100644 packages/webapi/SWAGGER_TRAPS.md create mode 100644 packages/webapi/WEBAPI_OVERVIEW.md diff --git a/clients/apiclient/.openapi-generator/VERSION b/clients/apiclient/.openapi-generator/VERSION index 717311e32e..d6b4ec4aa7 100644 --- a/clients/apiclient/.openapi-generator/VERSION +++ b/clients/apiclient/.openapi-generator/VERSION @@ -1 +1 @@ -unset \ No newline at end of file +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 0cf84b6d4c..0c23f1cd3a 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -2860,8 +2860,8 @@ components: inMilestone: lastMessage: milestoneId: milestoneId - index: 1 - timestamp: 5 + index: 0 + timestamp: 0 messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 inAliasOutput: @@ -4065,11 +4065,12 @@ components: MilestoneInfo: example: milestoneId: milestoneId - index: 1 - timestamp: 5 + index: 0 + timestamp: 0 properties: index: format: int32 + minimum: 0 type: integer xml: name: Index @@ -4080,6 +4081,7 @@ components: name: MilestoneID timestamp: format: int32 + minimum: 0 type: integer xml: name: Timestamp @@ -4090,8 +4092,8 @@ components: example: lastMessage: milestoneId: milestoneId - index: 1 - timestamp: 5 + index: 0 + timestamp: 0 messages: 1 timestamp: 2000-01-23T04:56:07.000+00:00 properties: diff --git a/clients/apiclient/docs/BlobInfoResponse.md b/clients/apiclient/docs/BlobInfoResponse.md index 81aecc6485..b2521b6511 100644 --- a/clients/apiclient/docs/BlobInfoResponse.md +++ b/clients/apiclient/docs/BlobInfoResponse.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Fields** | **map[string]int32** | | +**Fields** | **map[string]uint32** | | ## Methods ### NewBlobInfoResponse -`func NewBlobInfoResponse(fields map[string]int32, ) *BlobInfoResponse` +`func NewBlobInfoResponse(fields map[string]uint32, ) *BlobInfoResponse` NewBlobInfoResponse instantiates a new BlobInfoResponse object This constructor will assign default values to properties that have it defined, @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetFields -`func (o *BlobInfoResponse) GetFields() map[string]int32` +`func (o *BlobInfoResponse) GetFields() map[string]uint32` GetFields returns the Fields field if non-nil, zero value otherwise. ### GetFieldsOk -`func (o *BlobInfoResponse) GetFieldsOk() (*map[string]int32, bool)` +`func (o *BlobInfoResponse) GetFieldsOk() (*map[string]uint32, bool)` GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFields -`func (o *BlobInfoResponse) SetFields(v map[string]int32)` +`func (o *BlobInfoResponse) SetFields(v map[string]uint32)` SetFields sets Fields field to given value. diff --git a/clients/apiclient/docs/MilestoneInfo.md b/clients/apiclient/docs/MilestoneInfo.md index c2845fce4b..657d661fca 100644 --- a/clients/apiclient/docs/MilestoneInfo.md +++ b/clients/apiclient/docs/MilestoneInfo.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Index** | Pointer to **int32** | | [optional] +**Index** | Pointer to **uint32** | | [optional] **MilestoneId** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **int32** | | [optional] +**Timestamp** | Pointer to **uint32** | | [optional] ## Methods @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetIndex -`func (o *MilestoneInfo) GetIndex() int32` +`func (o *MilestoneInfo) GetIndex() uint32` GetIndex returns the Index field if non-nil, zero value otherwise. ### GetIndexOk -`func (o *MilestoneInfo) GetIndexOk() (*int32, bool)` +`func (o *MilestoneInfo) GetIndexOk() (*uint32, bool)` GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetIndex -`func (o *MilestoneInfo) SetIndex(v int32)` +`func (o *MilestoneInfo) SetIndex(v uint32)` SetIndex sets Index field to given value. @@ -79,20 +79,20 @@ HasMilestoneId returns a boolean if a field has been set. ### GetTimestamp -`func (o *MilestoneInfo) GetTimestamp() int32` +`func (o *MilestoneInfo) GetTimestamp() uint32` GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. ### GetTimestampOk -`func (o *MilestoneInfo) GetTimestampOk() (*int32, bool)` +`func (o *MilestoneInfo) GetTimestampOk() (*uint32, bool)` GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimestamp -`func (o *MilestoneInfo) SetTimestamp(v int32)` +`func (o *MilestoneInfo) SetTimestamp(v uint32)` SetTimestamp sets Timestamp field to given value. diff --git a/clients/apiclient/generate_client.sh b/clients/apiclient/generate_client.sh index 7e6a860736..231bc8ce30 100644 --- a/clients/apiclient/generate_client.sh +++ b/clients/apiclient/generate_client.sh @@ -1,8 +1,28 @@ #!/bin/sh -openapi-generator-cli generate -i http://localhost:9090/doc/swagger.json \ +function finish { + rm -f "$SCRIPTPATH/wasp_swagger_schema.json" +} +trap finish EXIT + + +APIGEN_FOLDER="../../tools/api-gen/" +APIGEN_SCRIPT="apigen.sh" + +SCRIPT=$(readlink -f "$0") +SCRIPTPATH=$(dirname "$SCRIPT") + +(cd "$SCRIPTPATH/$APIGEN_FOLDER"; sh -c "./$APIGEN_SCRIPT >| $SCRIPTPATH/wasp_swagger_schema.json") + +openapi-generator-cli generate -i "$SCRIPTPATH/wasp_swagger_schema.json" \ --global-property=models,supportingFiles,apis,modelTests=false,apiTests=false \ -g go \ - -o /mnt/Dev/Coding/iota/wasp/clients/apiclient \ + -o "$SCRIPTPATH" \ --package-name=apiclient \ - --additional-properties preferUnsignedInt=TRUE \ No newline at end of file + --additional-properties preferUnsignedInt=TRUE + +## This is a temporary fix for the blob info response. +## The Schema generator does not properly handle the uint32 type and this is adjusted manually for now. + +sed -i 's/int32/uint32/' "$SCRIPTPATH/model_blob_info_response.go" +sed -i 's/int32/uint32/' "$SCRIPTPATH/docs/BlobInfoResponse.md" \ No newline at end of file diff --git a/clients/apiclient/model_milestone_info.go b/clients/apiclient/model_milestone_info.go index b6fdba2306..7788349e0c 100644 --- a/clients/apiclient/model_milestone_info.go +++ b/clients/apiclient/model_milestone_info.go @@ -19,9 +19,9 @@ var _ MappedNullable = &MilestoneInfo{} // MilestoneInfo struct for MilestoneInfo type MilestoneInfo struct { - Index *int32 `json:"index,omitempty"` + Index *uint32 `json:"index,omitempty"` MilestoneId *string `json:"milestoneId,omitempty"` - Timestamp *int32 `json:"timestamp,omitempty"` + Timestamp *uint32 `json:"timestamp,omitempty"` } // NewMilestoneInfo instantiates a new MilestoneInfo object @@ -42,9 +42,9 @@ func NewMilestoneInfoWithDefaults() *MilestoneInfo { } // GetIndex returns the Index field value if set, zero value otherwise. -func (o *MilestoneInfo) GetIndex() int32 { +func (o *MilestoneInfo) GetIndex() uint32 { if o == nil || isNil(o.Index) { - var ret int32 + var ret uint32 return ret } return *o.Index @@ -52,7 +52,7 @@ func (o *MilestoneInfo) GetIndex() int32 { // GetIndexOk returns a tuple with the Index field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MilestoneInfo) GetIndexOk() (*int32, bool) { +func (o *MilestoneInfo) GetIndexOk() (*uint32, bool) { if o == nil || isNil(o.Index) { return nil, false } @@ -68,8 +68,8 @@ func (o *MilestoneInfo) HasIndex() bool { return false } -// SetIndex gets a reference to the given int32 and assigns it to the Index field. -func (o *MilestoneInfo) SetIndex(v int32) { +// SetIndex gets a reference to the given uint32 and assigns it to the Index field. +func (o *MilestoneInfo) SetIndex(v uint32) { o.Index = &v } @@ -106,9 +106,9 @@ func (o *MilestoneInfo) SetMilestoneId(v string) { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *MilestoneInfo) GetTimestamp() int32 { +func (o *MilestoneInfo) GetTimestamp() uint32 { if o == nil || isNil(o.Timestamp) { - var ret int32 + var ret uint32 return ret } return *o.Timestamp @@ -116,7 +116,7 @@ func (o *MilestoneInfo) GetTimestamp() int32 { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *MilestoneInfo) GetTimestampOk() (*int32, bool) { +func (o *MilestoneInfo) GetTimestampOk() (*uint32, bool) { if o == nil || isNil(o.Timestamp) { return nil, false } @@ -132,8 +132,8 @@ func (o *MilestoneInfo) HasTimestamp() bool { return false } -// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field. -func (o *MilestoneInfo) SetTimestamp(v int32) { +// SetTimestamp gets a reference to the given uint32 and assigns it to the Timestamp field. +func (o *MilestoneInfo) SetTimestamp(v uint32) { o.Timestamp = &v } diff --git a/contracts/wasm/testwasmlib/test/testwasmlib_client_test.go b/contracts/wasm/testwasmlib/test/testwasmlib_client_test.go index 2913f3bb7e..553b277dec 100644 --- a/contracts/wasm/testwasmlib/test/testwasmlib_client_test.go +++ b/contracts/wasm/testwasmlib/test/testwasmlib_client_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" iotago "github.com/iotaledger/iota.go/v3" - "github.com/iotaledger/wasp/client/chainclient" + "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/wasm/testwasmlib/go/testwasmlib" "github.com/iotaledger/wasp/contracts/wasm/testwasmlib/go/testwasmlibimpl" "github.com/iotaledger/wasp/packages/cryptolib" diff --git a/packages/webapi/SWAGGER_TRAPS.md b/packages/webapi/SWAGGER_TRAPS.md deleted file mode 100644 index 2b1d2e35fa..0000000000 --- a/packages/webapi/SWAGGER_TRAPS.md +++ /dev/null @@ -1,30 +0,0 @@ -This page contains requirements to create a proper API documentation and client generation. - -# uints (16, 32) - -UInts are unsupported by the Swagger standard. It only knows signed integers and floats. - -Usually openapi generators have defined the rule, that if the documented property contains a min value of at least 0, it is treated as an uint. -This allows generation of clients with proper uint typing. - -Therefore, all Uints of any size need to have a min(0) or min(1) documented. See: `models/chain.go` => `ChainInfoResponse`: `MaxBlobSize` - -## uints in path parameters - -Paths like `/accounts/account/:id` are mostly documented with `.AddParamPath`. It automatically gets the proper type and documents it. - -Except for uints. If the query path requires uints, it is required to use `.AddParamPathNested` instead. Those properties require a `min(0)` or `min(1)`. - -See: `controllers/corecontracts/controller.go` at route `chains/:chainID/core/blocklog/blocks/:blockIndex` => `getBlockInfo`: `blockIndex`. - -Those properties need to be named the same way as the parameters in the route. The linter will complain about unused properties. -Therefore, a `//nolint:unused` is required in these cases. - -## uint 64 - -UInt64s are unsupported in JavaScript when consumed via JSON. Therefore, all uint64s are serialized as strings by the server. - -The documentation should point out, that these strings are to be treated as uint64s. - -See: `models/core_accounts.go` => `AccountNonceResponse`: `Nonce` - diff --git a/packages/webapi/WEBAPI_OVERVIEW.md b/packages/webapi/WEBAPI_OVERVIEW.md new file mode 100644 index 0000000000..c9ac07a92c --- /dev/null +++ b/packages/webapi/WEBAPI_OVERVIEW.md @@ -0,0 +1,128 @@ +This page contains requirements to create a proper API documentation and client generation. + +# Setup / Workflow + +The webapi uses Swagger to document all routes, http codes and request/response models. + +This gives an overview of the whole API on a separate website, which is to be found on `http://localhost:9090/doc`. + +Furthermore, the Swagger standard allows the generation of client libraries. + +It's not required to create an API client manually. + +Inside the Wasp repository, the generated client can be found inside `clients/apiclient`. + +It is mainly used by the cluster tests and the `wasp-cli`. + +## Ensuring consistency + +The API uses `echoswagger` which wraps around the Echo routing system. It automatically adds a new documentation for each (`.GET`|`.POST`...) definition. + +Request and response models, returned status codes, query and path variables _need_ to be defined manually. + +If this definition is missing, it will result in an incomplete api client and the new feature is unusable from generated clients. + +Adding the documentation is simple though. See: `controllers/chains/controller.go`: `RegisterAdmin`: `adminAPI.GET("chains", c.getChainList,` + +### Model declaration + +Whenever a new request or response model is required, make sure to follow this layout: + +```go +type ContractInfoResponse struct { + Description string `json:"description" swagger:"desc(The description of the contract.),required"` + HName string `json:"hName" swagger:"desc(The id (HName as Hex)) of the contract.),required"` + Name string `json:"name" swagger:"desc(The name of the contract.),required"` + ProgramHash string `json:"programHash" swagger:"desc(The hash of the contract. (Hex encoded)),required"` +} +``` +Adding the `json` tag is mandatory. Always define the name in camelCase. + +The `required` tag is needed when the returned property is not nullable, which is mostly the case in the API. + + +If possible, add a description (`desc`) to the property. + +`uint` types have a special tag requirement which, if missed, will be interpreted as `int`. See [#uints (16, 32)](uints (16, 32))) +`int64` types are unsupported, as JavaScript does not offer the precision required to parse it from JSON. + +`int64`, `uint64` and above types need to be sent as `string`, and the documentation should point that out: + +```go +type AssetsResponse struct { + BaseTokens string `json:"baseTokens" swagger:"required,desc(The base tokens (uint64 as string))"` + NativeTokens []*NativeToken `json:"nativeTokens" swagger:"required"` +} +``` + + +## Regenerating the client + +If the webapi was changed, a regeneration of the client libraries is required. + +To be able to generate the client, `openapi-generator` is required to be installed on your system. + +Temporarily this version of the generator is mandatory: https://github.com/lmoe/openapi-generator/tree/feature/go_gen_unsigned_int + +After installing, the api client can be regenerated by calling `clients/apiclient/generate_client.sh`. + +# Swagger documentation pitfalls + +To ensure a properly generated api client, a few common pitfalls are documented here and need to be considered when changing the API. + +## uints (16, 32) + +UInts are unsupported by the Swagger standard. It only knows signed integers and decimals. + +Usually openapi api generators will treat swagger integers as uint types, if the documented property contains a min value of at least 0. +This allows generation of clients with proper uint typing. + +Therefore, all Uints (8-32) need to have a min(0) or min(1) documented. See: `models/chain.go` => `ChainInfoResponse`: `MaxBlobSize` + +Example model: + +```go +type StateTransaction struct { + StateIndex uint32 `json:"stateIndex" swagger:"desc(The state index),required,min(1)"` + TransactionID string `json:"txId" swagger:"desc(The transaction ID),required"` +} +``` + +### uints in path parameters + +Paths like `/accounts/account/:id` are mostly documented with `.AddParamPath`. It automatically gets the proper type and documents it. + +The only exception are uints. If the query path requires uints, it is mandatory to use `.AddParamPathNested` instead. + +Those properties also require a `min(0)` or `min(1)`. + +See: `controllers/corecontracts/controller.go` at route `chains/:chainID/core/blocklog/blocks/:blockIndex` => `getBlockInfo`: `blockIndex`. + +Those properties need to be named the same way as the parameters in the route. The linter will complain about unused properties. +Therefore, a `//nolint:unused` is required in these cases. + +### (u)int 64 / big.Int + +All number types above 58 bit are unsupported in JavaScript when consumed via JSON. Therefore, those types need to be sent as strings by the server. + +Unfortunately, this means the client has to decode these string numbers as a proper integer types. + +The documentation should point out that these strings are actually numbers and should be treated as such. + +See: `models/core_accounts.go` => `AccountNonceResponse`: `Nonce` + +## Pointers and 'required' + +By default, all properties are generated as pointers. Even if the webapi models are only using references. + +This can be changed by supplying a 'required' tag in the swagger section. + +See: `models/vm.go` => `ReceiptResponse`: `Request` (string) + +Sometimes having an explicit nullable type is required though. + +In this example, the receipt response sometimes has an error, sometimes not. + +See: `models/vm.go` => `ReceiptResponse`: `Error` (*ReceiptError) + +By omitting the `required` tag, the property is marked as nullable and the error can be properly checked by `Error == nil` by the client. \ No newline at end of file diff --git a/packages/webapi/models/L1.go b/packages/webapi/models/L1.go index 5477255588..5b2170a6a9 100644 --- a/packages/webapi/models/L1.go +++ b/packages/webapi/models/L1.go @@ -113,8 +113,8 @@ func TxInclusionStateMsgFromISCTxInclusionStateMsg(inclusionState *nodeconnmetri } type MilestoneInfo struct { - Index uint32 `json:"index"` - Timestamp uint32 `json:"timestamp"` + Index uint32 `json:"index" swagger:"min(0)"` + Timestamp uint32 `json:"timestamp" swagger:"min(0)"` MilestoneID string `json:"milestoneId"` } From b8093e98519815204742c6eafc20469f3f5f4114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 8 Feb 2023 12:37:10 +0100 Subject: [PATCH 31/39] Update documentation --- packages/webapi/WEBAPI_OVERVIEW.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/webapi/WEBAPI_OVERVIEW.md b/packages/webapi/WEBAPI_OVERVIEW.md index c9ac07a92c..433cc7f8c8 100644 --- a/packages/webapi/WEBAPI_OVERVIEW.md +++ b/packages/webapi/WEBAPI_OVERVIEW.md @@ -43,10 +43,11 @@ The `required` tag is needed when the returned property is not nullable, which i If possible, add a description (`desc`) to the property. -`uint` types have a special tag requirement which, if missed, will be interpreted as `int`. See [#uints (16, 32)](uints (16, 32))) -`int64` types are unsupported, as JavaScript does not offer the precision required to parse it from JSON. +`uint` types have a special tag requirement which, if missed, will be interpreted as `int`. See [#Uints](#Uints)) -`int64`, `uint64` and above types need to be sent as `string`, and the documentation should point that out: +`int64`, `uint64` and types above are unsupported, as JavaScript does not offer the precision required to parse it from JSON. + +They need to be sent as `string`, and the documentation should point that out: ```go type AssetsResponse struct { @@ -70,7 +71,7 @@ After installing, the api client can be regenerated by calling `clients/apiclien To ensure a properly generated api client, a few common pitfalls are documented here and need to be considered when changing the API. -## uints (16, 32) +## Uints UInts are unsupported by the Swagger standard. It only knows signed integers and decimals. From 964e3b3b19803a3c5d419a1cb97d907c1791d21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 8 Feb 2023 16:09:41 +0100 Subject: [PATCH 32/39] Update clients and generation script --- clients/apiclient/api/openapi.yaml | 44 ++++++++++---------- clients/apiclient/docs/CallTarget.md | 42 +++++++++---------- clients/apiclient/generate_client.sh | 7 +++- clients/apiclient/model_call_target.go | 56 +++++++++++++------------- 4 files changed, 78 insertions(+), 71 deletions(-) diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index 0c23f1cd3a..fcb7083d4b 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -1576,7 +1576,7 @@ paths: application/json: schema: additionalProperties: - example: "30" + example: "true" format: string type: string type: object @@ -2570,8 +2570,8 @@ components: gasGudget: gasGudget requestId: requestId callTarget: - contract: 5 - entryPoint: 5 + contractHName: contractHName + functionHName: functionHName targetAddress: targetAddress allowance: nfts: @@ -2625,8 +2625,8 @@ components: gasGudget: gasGudget requestId: requestId callTarget: - contract: 5 - entryPoint: 5 + contractHName: contractHName + functionHName: functionHName targetAddress: targetAddress allowance: nfts: @@ -2714,22 +2714,24 @@ components: name: BurnRecord CallTarget: example: - contract: 5 - entryPoint: 5 + contractHName: contractHName + functionHName: functionHName properties: - contract: - format: int32 - type: integer + contractHName: + description: The contract name as HName (Hex) + format: string + type: string xml: - name: Contract - entryPoint: - format: int32 - type: integer + name: ContractHName + functionHName: + description: The function name as HName (Hex) + format: string + type: string xml: - name: EntryPoint + name: FunctionHName required: - - contract - - entryPoint + - contractHName + - functionHName type: object xml: name: CallTarget @@ -4846,8 +4848,8 @@ components: gasGudget: gasGudget requestId: requestId callTarget: - contract: 5 - entryPoint: 5 + contractHName: contractHName + functionHName: functionHName targetAddress: targetAddress allowance: nfts: @@ -5014,8 +5016,8 @@ components: gasGudget: gasGudget requestId: requestId callTarget: - contract: 5 - entryPoint: 5 + contractHName: contractHName + functionHName: functionHName targetAddress: targetAddress allowance: nfts: diff --git a/clients/apiclient/docs/CallTarget.md b/clients/apiclient/docs/CallTarget.md index ded8ac46dd..d472416851 100644 --- a/clients/apiclient/docs/CallTarget.md +++ b/clients/apiclient/docs/CallTarget.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Contract** | **int32** | | -**EntryPoint** | **int32** | | +**ContractHName** | **string** | The contract name as HName (Hex) | +**FunctionHName** | **string** | The function name as HName (Hex) | ## Methods ### NewCallTarget -`func NewCallTarget(contract int32, entryPoint int32, ) *CallTarget` +`func NewCallTarget(contractHName string, functionHName string, ) *CallTarget` NewCallTarget instantiates a new CallTarget object This constructor will assign default values to properties that have it defined, @@ -26,44 +26,44 @@ NewCallTargetWithDefaults instantiates a new CallTarget object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetContract +### GetContractHName -`func (o *CallTarget) GetContract() int32` +`func (o *CallTarget) GetContractHName() string` -GetContract returns the Contract field if non-nil, zero value otherwise. +GetContractHName returns the ContractHName field if non-nil, zero value otherwise. -### GetContractOk +### GetContractHNameOk -`func (o *CallTarget) GetContractOk() (*int32, bool)` +`func (o *CallTarget) GetContractHNameOk() (*string, bool)` -GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise +GetContractHNameOk returns a tuple with the ContractHName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetContract +### SetContractHName -`func (o *CallTarget) SetContract(v int32)` +`func (o *CallTarget) SetContractHName(v string)` -SetContract sets Contract field to given value. +SetContractHName sets ContractHName field to given value. -### GetEntryPoint +### GetFunctionHName -`func (o *CallTarget) GetEntryPoint() int32` +`func (o *CallTarget) GetFunctionHName() string` -GetEntryPoint returns the EntryPoint field if non-nil, zero value otherwise. +GetFunctionHName returns the FunctionHName field if non-nil, zero value otherwise. -### GetEntryPointOk +### GetFunctionHNameOk -`func (o *CallTarget) GetEntryPointOk() (*int32, bool)` +`func (o *CallTarget) GetFunctionHNameOk() (*string, bool)` -GetEntryPointOk returns a tuple with the EntryPoint field if it's non-nil, zero value otherwise +GetFunctionHNameOk returns a tuple with the FunctionHName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetEntryPoint +### SetFunctionHName -`func (o *CallTarget) SetEntryPoint(v int32)` +`func (o *CallTarget) SetFunctionHName(v string)` -SetEntryPoint sets EntryPoint field to given value. +SetFunctionHName sets FunctionHName field to given value. diff --git a/clients/apiclient/generate_client.sh b/clients/apiclient/generate_client.sh index 231bc8ce30..a8a857db50 100644 --- a/clients/apiclient/generate_client.sh +++ b/clients/apiclient/generate_client.sh @@ -2,6 +2,7 @@ function finish { rm -f "$SCRIPTPATH/wasp_swagger_schema.json" + echo "Done" } trap finish EXIT @@ -24,5 +25,7 @@ openapi-generator-cli generate -i "$SCRIPTPATH/wasp_swagger_schema.json" \ ## This is a temporary fix for the blob info response. ## The Schema generator does not properly handle the uint32 type and this is adjusted manually for now. -sed -i 's/int32/uint32/' "$SCRIPTPATH/model_blob_info_response.go" -sed -i 's/int32/uint32/' "$SCRIPTPATH/docs/BlobInfoResponse.md" \ No newline at end of file +echo "Patching blob info response int=>uint" + +sed -i "/uint32/! s/int32/uint32/g" "$SCRIPTPATH/model_blob_info_response.go" +sed -i "/uint32/! s/int32/uint32/g" "$SCRIPTPATH/docs/BlobInfoResponse.md" diff --git a/clients/apiclient/model_call_target.go b/clients/apiclient/model_call_target.go index cdcd063792..63152740ff 100644 --- a/clients/apiclient/model_call_target.go +++ b/clients/apiclient/model_call_target.go @@ -19,18 +19,20 @@ var _ MappedNullable = &CallTarget{} // CallTarget struct for CallTarget type CallTarget struct { - Contract int32 `json:"contract"` - EntryPoint int32 `json:"entryPoint"` + // The contract name as HName (Hex) + ContractHName string `json:"contractHName"` + // The function name as HName (Hex) + FunctionHName string `json:"functionHName"` } // NewCallTarget instantiates a new CallTarget object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCallTarget(contract int32, entryPoint int32) *CallTarget { +func NewCallTarget(contractHName string, functionHName string) *CallTarget { this := CallTarget{} - this.Contract = contract - this.EntryPoint = entryPoint + this.ContractHName = contractHName + this.FunctionHName = functionHName return &this } @@ -42,52 +44,52 @@ func NewCallTargetWithDefaults() *CallTarget { return &this } -// GetContract returns the Contract field value -func (o *CallTarget) GetContract() int32 { +// GetContractHName returns the ContractHName field value +func (o *CallTarget) GetContractHName() string { if o == nil { - var ret int32 + var ret string return ret } - return o.Contract + return o.ContractHName } -// GetContractOk returns a tuple with the Contract field value +// GetContractHNameOk returns a tuple with the ContractHName field value // and a boolean to check if the value has been set. -func (o *CallTarget) GetContractOk() (*int32, bool) { +func (o *CallTarget) GetContractHNameOk() (*string, bool) { if o == nil { return nil, false } - return &o.Contract, true + return &o.ContractHName, true } -// SetContract sets field value -func (o *CallTarget) SetContract(v int32) { - o.Contract = v +// SetContractHName sets field value +func (o *CallTarget) SetContractHName(v string) { + o.ContractHName = v } -// GetEntryPoint returns the EntryPoint field value -func (o *CallTarget) GetEntryPoint() int32 { +// GetFunctionHName returns the FunctionHName field value +func (o *CallTarget) GetFunctionHName() string { if o == nil { - var ret int32 + var ret string return ret } - return o.EntryPoint + return o.FunctionHName } -// GetEntryPointOk returns a tuple with the EntryPoint field value +// GetFunctionHNameOk returns a tuple with the FunctionHName field value // and a boolean to check if the value has been set. -func (o *CallTarget) GetEntryPointOk() (*int32, bool) { +func (o *CallTarget) GetFunctionHNameOk() (*string, bool) { if o == nil { return nil, false } - return &o.EntryPoint, true + return &o.FunctionHName, true } -// SetEntryPoint sets field value -func (o *CallTarget) SetEntryPoint(v int32) { - o.EntryPoint = v +// SetFunctionHName sets field value +func (o *CallTarget) SetFunctionHName(v string) { + o.FunctionHName = v } func (o CallTarget) MarshalJSON() ([]byte, error) { @@ -100,8 +102,8 @@ func (o CallTarget) MarshalJSON() ([]byte, error) { func (o CallTarget) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["contract"] = o.Contract - toSerialize["entryPoint"] = o.EntryPoint + toSerialize["contractHName"] = o.ContractHName + toSerialize["functionHName"] = o.FunctionHName return toSerialize, nil } From 2d8cb35c867f81f3b62f710fa5ccbe93a0c17a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 8 Feb 2023 16:09:53 +0100 Subject: [PATCH 33/39] Update webapi --- packages/webapi/WEBAPI_OVERVIEW.md | 2 +- packages/webapi/api.go | 2 +- packages/webapi/apierrors/errorhandler.go | 5 ++- .../webapi/compatibility_error_handler.go | 2 +- packages/webapi/controllers/chain/chain.go | 39 ++++++++++++---- packages/webapi/corecontracts/blocklog.go | 2 +- packages/webapi/interfaces/interfaces.go | 45 ++++++++++--------- packages/webapi/models/chain.go | 42 +++++++++-------- packages/webapi/models/core_blocklog.go | 16 ++++++- packages/webapi/services/chain.go | 10 +++-- packages/webapi/services/committee.go | 24 +++++----- packages/webapi/services/vm.go | 12 +++-- packages/webapi/test/mock_test.go | 24 +++++----- 13 files changed, 139 insertions(+), 86 deletions(-) diff --git a/packages/webapi/WEBAPI_OVERVIEW.md b/packages/webapi/WEBAPI_OVERVIEW.md index 433cc7f8c8..88ab201ef4 100644 --- a/packages/webapi/WEBAPI_OVERVIEW.md +++ b/packages/webapi/WEBAPI_OVERVIEW.md @@ -106,7 +106,7 @@ Therefore, a `//nolint:unused` is required in these cases. All number types above 58 bit are unsupported in JavaScript when consumed via JSON. Therefore, those types need to be sent as strings by the server. -Unfortunately, this means the client has to decode these string numbers as a proper integer types. +Unfortunately, this means the client has to decode these string numbers as a proper integer type. The documentation should point out that these strings are actually numbers and should be treated as such. diff --git a/packages/webapi/api.go b/packages/webapi/api.go index 90aa6ffe91..e50227f7cd 100644 --- a/packages/webapi/api.go +++ b/packages/webapi/api.go @@ -60,7 +60,7 @@ func Init( mocker := NewMocker() mocker.LoadMockFiles() - vmService := services.NewVMService(chainsProvider) + vmService := services.NewVMService(chainsProvider, chainRecordRegistryProvider) chainService := services.NewChainService(logger, chainsProvider, nodeConnectionMetrics, chainRecordRegistryProvider, vmService) committeeService := services.NewCommitteeService(chainsProvider, networkProvider, dkShareRegistryProvider) registryService := services.NewRegistryService(chainsProvider, chainRecordRegistryProvider) diff --git a/packages/webapi/apierrors/errorhandler.go b/packages/webapi/apierrors/errorhandler.go index 2239ff823c..82a93886df 100644 --- a/packages/webapi/apierrors/errorhandler.go +++ b/packages/webapi/apierrors/errorhandler.go @@ -4,6 +4,8 @@ import ( "net/http" "github.com/labstack/echo/v4" + + "github.com/iotaledger/hive.go/core/logger" ) type GenericError struct { @@ -12,7 +14,7 @@ type GenericError struct { // HTTPErrorHandler must be hooked to an echo server to render instances // of HTTPError as JSON -func HTTPErrorHandler(err error, c echo.Context) error { +func HTTPErrorHandler(logger *logger.Logger, err error, c echo.Context) error { if echoError, ok := err.(*echo.HTTPError); ok { mappedError := HTTPErrorFromEchoError(echoError) return c.JSON(mappedError.HTTPCode, mappedError.GetErrorResult()) @@ -23,6 +25,7 @@ func HTTPErrorHandler(err error, c echo.Context) error { if c.Request().Method == http.MethodHead { // Issue #608 return c.NoContent(apiError.HTTPCode) } + logger.Errorf("HTTP Error: code:[%v], msg:[%v], detail:[%v]", apiError.HTTPCode, apiError.Message, apiError.AdditionalError) return c.JSON(apiError.HTTPCode, apiError.GetErrorResult()) } } diff --git a/packages/webapi/compatibility_error_handler.go b/packages/webapi/compatibility_error_handler.go index 5a4979261c..f1c8fa57ef 100644 --- a/packages/webapi/compatibility_error_handler.go +++ b/packages/webapi/compatibility_error_handler.go @@ -12,6 +12,6 @@ func CompatibilityHTTPErrorHandler(logger *logger.Logger) func(error, echo.Conte return func(err error, c echo.Context) { logger.Errorf("Compatibility Error Handler: %v", err) // Use V2 error handler otherwise. This is also a catch-all for any other error type. - _ = apierrors.HTTPErrorHandler(err, c) + _ = apierrors.HTTPErrorHandler(logger, err, c) } } diff --git a/packages/webapi/controllers/chain/chain.go b/packages/webapi/controllers/chain/chain.go index 5c0ca8f7ea..71a2f6c02c 100644 --- a/packages/webapi/controllers/chain/chain.go +++ b/packages/webapi/controllers/chain/chain.go @@ -1,12 +1,14 @@ package chain import ( + "errors" "net/http" "github.com/labstack/echo/v4" iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/webapi/apierrors" + "github.com/iotaledger/wasp/packages/webapi/interfaces" "github.com/iotaledger/wasp/packages/webapi/models" "github.com/iotaledger/wasp/packages/webapi/params" ) @@ -46,13 +48,18 @@ func (c *Controller) getChainInfo(e echo.Context) error { } chainInfo, err := c.chainService.GetChainInfoByChainID(chainID) - if err != nil { + if errors.Is(err, interfaces.ErrChainNotFound) { + return e.NoContent(http.StatusNotFound) + } else if err != nil { return err } - evmChainID, err := c.chainService.GetEVMChainID(chainID) - if err != nil { - return err + evmChainID := uint16(0) + if chainInfo.IsActive { + evmChainID, err = c.chainService.GetEVMChainID(chainID) + if err != nil { + return err + } } chainInfoResponse := models.MapChainInfoResponse(chainInfo, evmChainID) @@ -62,6 +69,7 @@ func (c *Controller) getChainInfo(e echo.Context) error { func (c *Controller) getChainList(e echo.Context) error { chainIDs, err := c.chainService.GetAllChainIDs() + c.log.Info("After allChainIDS %v", err) if err != nil { return err } @@ -70,16 +78,31 @@ func (c *Controller) getChainList(e echo.Context) error { for _, chainID := range chainIDs { chainInfo, err := c.chainService.GetChainInfoByChainID(chainID) - if err != nil { + c.log.Info("getchaininfo %v", err) + + if errors.Is(err, interfaces.ErrChainNotFound) { + // TODO: Validate this logic here. Is it possible to still get more chain info? + chainList = append(chainList, models.ChainInfoResponse{ + IsActive: false, + ChainID: chainID.String(), + }) + continue + } else if err != nil { return err } - evmChainID, err := c.chainService.GetEVMChainID(chainID) - if err != nil { - return err + evmChainID := uint16(0) + if chainInfo.IsActive { + evmChainID, err = c.chainService.GetEVMChainID(chainID) + c.log.Info("getevmchainid %v", err) + + if err != nil { + return err + } } chainInfoResponse := models.MapChainInfoResponse(chainInfo, evmChainID) + c.log.Info("mapchaininfo %v", err) chainList = append(chainList, chainInfoResponse) } diff --git a/packages/webapi/corecontracts/blocklog.go b/packages/webapi/corecontracts/blocklog.go index 6afce04c2f..674816b118 100644 --- a/packages/webapi/corecontracts/blocklog.go +++ b/packages/webapi/corecontracts/blocklog.go @@ -248,7 +248,7 @@ func eventsFromViewResult(viewResult dict.Dict) ([]string, error) { func (b *BlockLog) GetEventsForRequest(chainID isc.ChainID, requestID isc.RequestID) ([]string, error) { ret, err := b.vmService.CallViewByChainID(chainID, blocklog.Contract.Hname(), blocklog.ViewGetEventsForRequest.Hname(), codec.MakeDict(map[string]interface{}{ - blocklog.ParamRequestRecord: requestID, + blocklog.ParamRequestID: requestID, })) if err != nil { return nil, err diff --git a/packages/webapi/interfaces/interfaces.go b/packages/webapi/interfaces/interfaces.go index 78add2ea27..eac8bbaeec 100644 --- a/packages/webapi/interfaces/interfaces.go +++ b/packages/webapi/interfaces/interfaces.go @@ -8,8 +8,8 @@ import ( "github.com/iotaledger/wasp/packages/state" "github.com/iotaledger/wasp/packages/vm/core/blocklog" - dto2 "github.com/iotaledger/wasp/packages/webapi/dto" - models2 "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi/dto" + "github.com/iotaledger/wasp/packages/webapi/models" "github.com/labstack/echo/v4" "github.com/pangpanglabs/echoswagger/v2" @@ -23,6 +23,13 @@ import ( "github.com/iotaledger/wasp/packages/registry" ) +var ErrUnableToGetLatestState = errors.New("unable to get latest state") +var ErrUnableToGetReceipt = errors.New("unable to get request receipt from block state") +var ErrAlreadyProcessed = errors.New("request already processed") +var ErrNoBalanceOnAccount = errors.New("no balance on account") +var ErrInvalidNonce = errors.New("invalid nonce") +var ErrChainNotFound = errors.New("chain not found") + type APIController interface { Name() string RegisterPublic(publicAPI echoswagger.ApiGroup, mocker Mocker) @@ -36,8 +43,8 @@ type ChainService interface { GetAllChainIDs() ([]isc.ChainID, error) HasChain(chainID isc.ChainID) bool GetChainByID(chainID isc.ChainID) chain.Chain - GetChainInfoByChainID(chainID isc.ChainID) (*dto2.ChainInfo, error) - GetContracts(chainID isc.ChainID) (dto2.ContractsMap, error) + GetChainInfoByChainID(chainID isc.ChainID) (*dto.ChainInfo, error) + GetContracts(chainID isc.ChainID) (dto.ContractsMap, error) GetEVMChainID(chainID isc.ChainID) (uint16, error) GetState(chainID isc.ChainID, stateKey []byte) (state []byte, err error) WaitForRequestProcessed(ctx context.Context, chainID isc.ChainID, requestID isc.RequestID, timeout time.Duration) (*isc.Receipt, *isc.VMError, error) @@ -49,10 +56,10 @@ type EVMService interface { } type MetricsService interface { - GetAllChainsMetrics() *dto2.ChainMetrics - GetChainConsensusPipeMetrics(chainID isc.ChainID) *models2.ConsensusPipeMetrics - GetChainConsensusWorkflowMetrics(chainID isc.ChainID) *models2.ConsensusWorkflowMetrics - GetChainMetrics(chainID isc.ChainID) *dto2.ChainMetrics + GetAllChainsMetrics() *dto.ChainMetrics + GetChainConsensusPipeMetrics(chainID isc.ChainID) *models.ConsensusPipeMetrics + GetChainConsensusWorkflowMetrics(chainID isc.ChainID) *models.ConsensusWorkflowMetrics + GetChainMetrics(chainID isc.ChainID) *dto.ChainMetrics } var ErrPeerNotFound = errors.New("couldn't find peer") @@ -69,25 +76,19 @@ type RegistryService interface { } type CommitteeService interface { - GetCommitteeInfo(chainID isc.ChainID) (*dto2.ChainNodeInfo, error) + GetCommitteeInfo(chainID isc.ChainID) (*dto.ChainNodeInfo, error) GetPublicKey() *cryptolib.PublicKey } type PeeringService interface { - DistrustPeer(publicKey *cryptolib.PublicKey) (*dto2.PeeringNodeIdentity, error) - GetIdentity() *dto2.PeeringNodeIdentity - GetRegisteredPeers() []*dto2.PeeringNodeStatus - GetTrustedPeers() ([]*dto2.PeeringNodeIdentity, error) + DistrustPeer(publicKey *cryptolib.PublicKey) (*dto.PeeringNodeIdentity, error) + GetIdentity() *dto.PeeringNodeIdentity + GetRegisteredPeers() []*dto.PeeringNodeStatus + GetTrustedPeers() ([]*dto.PeeringNodeIdentity, error) IsPeerTrusted(publicKey *cryptolib.PublicKey) error - TrustPeer(peer *cryptolib.PublicKey, netID string) (*dto2.PeeringNodeIdentity, error) + TrustPeer(peer *cryptolib.PublicKey, netID string) (*dto.PeeringNodeIdentity, error) } -var ErrUnableToGetLatestState = errors.New("unable to get latest state") -var ErrUnableToGetReceipt = errors.New("unable to get request receipt from block state") -var ErrAlreadyProcessed = errors.New("request already processed") -var ErrNoBalanceOnAccount = errors.New("no balance on account") -var ErrInvalidNonce = errors.New("invalid nonce") - type OffLedgerService interface { EnqueueOffLedgerRequest(chainID isc.ChainID, request []byte) error ParseRequest(payload []byte) (isc.OffLedgerRequest, error) @@ -96,8 +97,8 @@ type OffLedgerService interface { type UserService interface { AddUser(username string, password string, permissions []string) error DeleteUser(username string) error - GetUser(username string) (*models2.User, error) - GetUsers() []*models2.User + GetUser(username string) (*models.User, error) + GetUsers() []*models.User UpdateUserPassword(username string, password string) error UpdateUserPermissions(username string, permissions []string) error } diff --git a/packages/webapi/models/chain.go b/packages/webapi/models/chain.go index f6bd1e5a59..953429a4c9 100644 --- a/packages/webapi/models/chain.go +++ b/packages/webapi/models/chain.go @@ -3,7 +3,7 @@ package models import ( iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/packages/isc" - dto2 "github.com/iotaledger/wasp/packages/webapi/dto" + "github.com/iotaledger/wasp/packages/webapi/dto" ) type CommitteeNode struct { @@ -11,7 +11,7 @@ type CommitteeNode struct { Node PeeringNodeStatusResponse `json:"node" swagger:"required"` } -func MapCommitteeNode(status *dto2.ChainNodeStatus) CommitteeNode { +func MapCommitteeNode(status *dto.ChainNodeStatus) CommitteeNode { return CommitteeNode{ AccessAPI: status.AccessAPI, Node: PeeringNodeStatusResponse{ @@ -24,7 +24,7 @@ func MapCommitteeNode(status *dto2.ChainNodeStatus) CommitteeNode { } } -func MapCommitteeNodes(status []*dto2.ChainNodeStatus) []CommitteeNode { +func MapCommitteeNodes(status []*dto.ChainNodeStatus) []CommitteeNode { nodes := make([]CommitteeNode, 0) for _, node := range status { @@ -72,27 +72,33 @@ type StateResponse struct { State string `json:"state" swagger:"desc(The state of the requested key (Hex-encoded)),required"` } -func MapChainInfoResponse(chainInfo *dto2.ChainInfo, evmChainID uint16) ChainInfoResponse { - gasFeeTokenID := "" +func MapChainInfoResponse(chainInfo *dto.ChainInfo, evmChainID uint16) ChainInfoResponse { + chainInfoResponse := ChainInfoResponse{ + IsActive: chainInfo.IsActive, + ChainID: chainInfo.ChainID.String(), + EVMChainID: evmChainID, + Description: chainInfo.Description, + MaxBlobSize: chainInfo.MaxBlobSize, + MaxEventSize: chainInfo.MaxEventSize, + MaxEventsPerReq: chainInfo.MaxEventsPerReq, + } - if !isc.IsEmptyNativeTokenID(chainInfo.GasFeePolicy.GasFeeTokenID) { - gasFeeTokenID = chainInfo.GasFeePolicy.GasFeeTokenID.String() + if chainInfo.ChainOwnerID != nil { + chainInfoResponse.ChainOwnerID = chainInfo.ChainOwnerID.String() } - chainInfoResponse := ChainInfoResponse{ - IsActive: chainInfo.IsActive, - ChainID: chainInfo.ChainID.String(), - EVMChainID: evmChainID, - ChainOwnerID: chainInfo.ChainOwnerID.String(), - Description: chainInfo.Description, - GasFeePolicy: gasFeePolicy{ + if chainInfo.GasFeePolicy != nil { + gasFeeTokenID := "" + + if !isc.IsEmptyNativeTokenID(chainInfo.GasFeePolicy.GasFeeTokenID) { + gasFeeTokenID = chainInfo.GasFeePolicy.GasFeeTokenID.String() + } + + chainInfoResponse.GasFeePolicy = gasFeePolicy{ GasFeeTokenID: gasFeeTokenID, GasPerToken: iotago.EncodeUint64(chainInfo.GasFeePolicy.GasPerToken), ValidatorFeeShare: chainInfo.GasFeePolicy.ValidatorFeeShare, - }, - MaxBlobSize: chainInfo.MaxBlobSize, - MaxEventSize: chainInfo.MaxEventSize, - MaxEventsPerReq: chainInfo.MaxEventsPerReq, + } } return chainInfoResponse diff --git a/packages/webapi/models/core_blocklog.go b/packages/webapi/models/core_blocklog.go index e4bf952322..fb05c2fac5 100644 --- a/packages/webapi/models/core_blocklog.go +++ b/packages/webapi/models/core_blocklog.go @@ -90,9 +90,21 @@ func mapAssets(assets *isc.Assets) *Assets { return ret } +type CallTarget struct { + ContractHName string `json:"contractHName" swagger:"desc(The contract name as HName (Hex)),required"` + FunctionHName string `json:"functionHName" swagger:"desc(The function name as HName (Hex)),required"` +} + +func MapCallTarget(target isc.CallTarget) CallTarget { + return CallTarget{ + ContractHName: target.Contract.String(), + FunctionHName: target.EntryPoint.String(), + } +} + type RequestDetail struct { Allowance *Assets `json:"allowance" swagger:"required"` - CallTarget isc.CallTarget `json:"callTarget" swagger:"required"` + CallTarget CallTarget `json:"callTarget" swagger:"required"` Assets *Assets `json:"fungibleTokens" swagger:"required"` GasGudget string `json:"gasGudget,string" swagger:"required,desc(The gas budget (uint64 as string))"` IsEVM bool `json:"isEVM" swagger:"required"` @@ -109,7 +121,7 @@ func MapRequestDetail(request isc.Request) *RequestDetail { return &RequestDetail{ Allowance: mapAssets(request.Allowance()), - CallTarget: request.CallTarget(), + CallTarget: MapCallTarget(request.CallTarget()), Assets: mapAssets(request.Assets()), GasGudget: iotago.EncodeUint64(gasBudget), IsEVM: isEVM, diff --git a/packages/webapi/services/chain.go b/packages/webapi/services/chain.go index 3299a091ba..4a375fe583 100644 --- a/packages/webapi/services/chain.go +++ b/packages/webapi/services/chain.go @@ -64,7 +64,7 @@ func (c *ChainService) SetChainRecord(chainRecord *registry.ChainRecord) error { if err != nil { return err } - + c.log.Infof("StoredChainRec %v %v", storedChainRec, err) if storedChainRec != nil { @@ -138,13 +138,17 @@ func (c *ChainService) GetAllChainIDs() ([]isc.ChainID, error) { } func (c *ChainService) GetChainInfoByChainID(chainID isc.ChainID) (*dto.ChainInfo, error) { - governanceChainInfo, err := c.governance.GetChainInfo(chainID) + chainRecord, err := c.chainRecordRegistryProvider.ChainRecord(chainID) if err != nil { return nil, err } - chainRecord, err := c.chainRecordRegistryProvider.ChainRecord(chainID) + governanceChainInfo, err := c.governance.GetChainInfo(chainID) if err != nil { + if chainRecord != nil && errors.Is(err, interfaces.ErrChainNotFound) { + return &dto.ChainInfo{ChainID: chainID, IsActive: false}, nil + } + return nil, err } diff --git a/packages/webapi/services/committee.go b/packages/webapi/services/committee.go index 978038e026..3d1e01a580 100644 --- a/packages/webapi/services/committee.go +++ b/packages/webapi/services/committee.go @@ -10,7 +10,7 @@ import ( "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/tcrypto" "github.com/iotaledger/wasp/packages/vm/core/governance" - dto2 "github.com/iotaledger/wasp/packages/webapi/dto" + "github.com/iotaledger/wasp/packages/webapi/dto" "github.com/iotaledger/wasp/packages/webapi/interfaces" ) @@ -32,7 +32,7 @@ func (c *CommitteeService) GetPublicKey() *cryptolib.PublicKey { return c.networkProvider.Self().PubKey() } -func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto2.ChainNodeInfo, error) { +func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto.ChainNodeInfo, error) { chain := c.chainsProvider().Get(chainID) if chain == nil { return nil, errors.New("chain does not exist") @@ -69,7 +69,7 @@ func (c *CommitteeService) GetCommitteeInfo(chainID isc.ChainID) (*dto2.ChainNod return nil, err } - chainNodeInfo := dto2.ChainNodeInfo{ + chainNodeInfo := dto.ChainNodeInfo{ Address: committeeInfo.Address, AccessNodes: accessNodes, CandidateNodes: filteredCandidateNodes, @@ -84,8 +84,8 @@ func getCommitteeNodes( peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, inChainNodes map[cryptolib.PublicKeyKey]bool, -) []*dto2.ChainNodeStatus { - nodes := make([]*dto2.ChainNodeStatus, 0) +) []*dto.ChainNodeStatus { + nodes := make([]*dto.ChainNodeStatus, 0) for _, cmtNodePubKey := range dkShare.GetNodePubKeys() { nodes = append(nodes, makeChainNodeStatus(cmtNodePubKey, peeringStatus, candidateNodes)) @@ -101,8 +101,8 @@ func getAccessNodes( peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, inChainNodes map[cryptolib.PublicKeyKey]bool, -) []*dto2.ChainNodeStatus { - nodes := make([]*dto2.ChainNodeStatus, 0) +) []*dto.ChainNodeStatus { + nodes := make([]*dto.ChainNodeStatus, 0) for _, chainNode := range chainNodes { acnPubKey := chainNode.PubKey() @@ -127,8 +127,8 @@ func getCandidateNodes( peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, inChainNodes map[cryptolib.PublicKeyKey]bool, -) ([]*dto2.ChainNodeStatus, error) { - nodes := make([]*dto2.ChainNodeStatus, 0) +) ([]*dto.ChainNodeStatus, error) { + nodes := make([]*dto.ChainNodeStatus, 0) for _, c := range candidateNodes { pubKey, err := cryptolib.NewPublicKeyFromBytes(c.NodePubKey) @@ -163,9 +163,9 @@ func makeChainNodeStatus( pubKey *cryptolib.PublicKey, peeringStatus map[cryptolib.PublicKeyKey]peering.PeerStatusProvider, candidateNodes map[cryptolib.PublicKeyKey]*governance.AccessNodeInfo, -) *dto2.ChainNodeStatus { - cns := dto2.ChainNodeStatus{ - Node: dto2.PeeringNodeStatus{ +) *dto.ChainNodeStatus { + cns := dto.ChainNodeStatus{ + Node: dto.PeeringNodeStatus{ PublicKey: pubKey, }, } diff --git a/packages/webapi/services/vm.go b/packages/webapi/services/vm.go index a34865c435..f279909b10 100644 --- a/packages/webapi/services/vm.go +++ b/packages/webapi/services/vm.go @@ -8,6 +8,7 @@ import ( "github.com/iotaledger/wasp/packages/chainutil" "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv/dict" + "github.com/iotaledger/wasp/packages/registry" "github.com/iotaledger/wasp/packages/state" "github.com/iotaledger/wasp/packages/vm/core/blocklog" "github.com/iotaledger/wasp/packages/webapi/corecontracts" @@ -15,12 +16,14 @@ import ( ) type VMService struct { - chainsProvider chains.Provider + chainsProvider chains.Provider + chainRecordRegistryProvider registry.ChainRecordRegistryProvider } -func NewVMService(chainsProvider chains.Provider) interfaces.VMService { +func NewVMService(chainsProvider chains.Provider, chainRecordRegistryProvider registry.ChainRecordRegistryProvider) interfaces.VMService { return &VMService{ - chainsProvider: chainsProvider, + chainsProvider: chainsProvider, + chainRecordRegistryProvider: chainRecordRegistryProvider, } } @@ -52,8 +55,9 @@ func (v *VMService) GetReceipt(chainID isc.ChainID, requestID isc.RequestID) (*i func (v *VMService) CallViewByChainID(chainID isc.ChainID, contractName, functionName isc.Hname, params dict.Dict) (dict.Dict, error) { ch := v.chainsProvider().Get(chainID) + if ch == nil { - return nil, errors.New("chain not found") + return nil, interfaces.ErrChainNotFound } // TODO: should blockIndex be an optional parameter of this endpoint? diff --git a/packages/webapi/test/mock_test.go b/packages/webapi/test/mock_test.go index 73f73788cf..32e5fe845c 100644 --- a/packages/webapi/test/mock_test.go +++ b/packages/webapi/test/mock_test.go @@ -6,50 +6,50 @@ import ( "github.com/stretchr/testify/require" - v2 "github.com/iotaledger/wasp/packages/webapi" - models2 "github.com/iotaledger/wasp/packages/webapi/models" + "github.com/iotaledger/wasp/packages/webapi" + "github.com/iotaledger/wasp/packages/webapi/models" ) func TestMockingOfPtrStructure(t *testing.T) { - mock := v2.NewMocker() + mock := webapi.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get(&models2.PeeringNodeStatusResponse{}) + mockedChainInfoResponse := mock.Get(&models.PeeringNodeStatusResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) } func TestMockingOfStructure(t *testing.T) { - mock := v2.NewMocker() + mock := webapi.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get(models2.PeeringNodeStatusResponse{}) + mockedChainInfoResponse := mock.Get(models.PeeringNodeStatusResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) } func TestMockingOfStructureArray(t *testing.T) { - mock := v2.NewMocker() + mock := webapi.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get([]models2.PeeringNodeStatusResponse{}) + mockedChainInfoResponse := mock.Get([]models.PeeringNodeStatusResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) } func TestMockingOfChainInfo(t *testing.T) { - mock := v2.NewMocker() + mock := webapi.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get([]models2.ChainInfoResponse{}) + mockedChainInfoResponse := mock.Get([]models.ChainInfoResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) } func TestMockingOfCommitteeInfo(t *testing.T) { - mock := v2.NewMocker() + mock := webapi.NewMocker() mock.LoadMockFiles() - mockedChainInfoResponse := mock.Get(models2.CommitteeInfoResponse{}) + mockedChainInfoResponse := mock.Get(models.CommitteeInfoResponse{}) _, err := json.Marshal(mockedChainInfoResponse) require.NoError(t, err) From eea81b590cd921b7c2ec2ab6a0d3543b2b9dcf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Wed, 8 Feb 2023 16:10:03 +0100 Subject: [PATCH 34/39] Fix wasp-cli --- tools/wasp-cli/chain/activate.go | 25 ++++++++++++++++++------- tools/wasp-cli/chain/blobs.go | 7 ++++++- tools/wasp-cli/chain/blocklog.go | 4 ++-- tools/wasp-cli/log/log.go | 10 ++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/tools/wasp-cli/chain/activate.go b/tools/wasp-cli/chain/activate.go index 9a88d0bc2e..b5b9549065 100644 --- a/tools/wasp-cli/chain/activate.go +++ b/tools/wasp-cli/chain/activate.go @@ -2,17 +2,16 @@ package chain import ( "context" - "regexp" + "net/http" "github.com/spf13/cobra" + "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/tools/wasp-cli/cli/cliclients" "github.com/iotaledger/wasp/tools/wasp-cli/cli/config" "github.com/iotaledger/wasp/tools/wasp-cli/log" ) -var HTTP404ErrRegexp = regexp.MustCompile(`"Code":404`) - func initActivateCmd() *cobra.Command { var nodes []int cmd := &cobra.Command{ @@ -27,9 +26,9 @@ func initActivateCmd() *cobra.Command { for _, nodeIdx := range nodes { client := cliclients.WaspClientForIndex(nodeIdx) - r, _, err := client.ChainsApi.GetChainInfo(context.Background(), chainID.String()).Execute() + r, httpStatus, err := client.ChainsApi.GetChainInfo(context.Background(), chainID.String()).Execute() - if err != nil && !HTTP404ErrRegexp.MatchString(err.Error()) { + if err != nil && httpStatus.StatusCode != http.StatusNotFound { log.Check(err) } @@ -37,9 +36,21 @@ func initActivateCmd() *cobra.Command { continue } - _, err = client.ChainsApi.ActivateChain(context.Background(), chainID.String()).Execute() - log.Check(err) + if r == nil { + _, err := client.ChainsApi.SetChainRecord(context.Background(), chainID.String()).ChainRecord(apiclient.ChainRecord{ + IsActive: true, + AccessNodes: []string{}, + }).Execute() + + log.Check(err) + } else { + _, err = client.ChainsApi.ActivateChain(context.Background(), chainID.String()).Execute() + + log.Check(err) + } } + + log.Printf("Chain activated") }, } diff --git a/tools/wasp-cli/chain/blobs.go b/tools/wasp-cli/chain/blobs.go index d0b6b6a0c4..a6a26d677c 100644 --- a/tools/wasp-cli/chain/blobs.go +++ b/tools/wasp-cli/chain/blobs.go @@ -6,6 +6,7 @@ import ( "github.com/spf13/cobra" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/packages/hashing" "github.com/iotaledger/wasp/packages/kv" @@ -68,7 +69,11 @@ func initShowBlobCmd() *cobra.Command { Execute() log.Check(err) - values.Set(kv.Key(field), []byte(value.ValueData)) + + decodedValue, err := iotago.DecodeHex(value.ValueData) + log.Check(err) + + values.Set(kv.Key(field), []byte(decodedValue)) } util.PrintDictAsJSON(values) }, diff --git a/tools/wasp-cli/chain/blocklog.go b/tools/wasp-cli/chain/blocklog.go index da00d13e9b..ca3d1cbde9 100644 --- a/tools/wasp-cli/chain/blocklog.go +++ b/tools/wasp-cli/chain/blocklog.go @@ -98,8 +98,8 @@ func logReceipt(receipt *apiclient.RequestReceiptResponse, index ...int) { tree := []log.TreeItem{ {K: "Kind", V: kind}, {K: "Sender", V: req.SenderAccount}, - {K: "Contract Hname", V: isc.Hname(req.CallTarget.Contract).String()}, - {K: "Entry point", V: isc.Hname(req.CallTarget.EntryPoint).String()}, + {K: "Contract Hname", V: req.CallTarget.ContractHName}, + {K: "Function Hname", V: req.CallTarget.FunctionHName}, {K: "Arguments", V: argsTree}, {K: "Error", V: errMsg}, } diff --git a/tools/wasp-cli/log/log.go b/tools/wasp-cli/log/log.go index 8c6851cddf..477099324b 100644 --- a/tools/wasp-cli/log/log.go +++ b/tools/wasp-cli/log/log.go @@ -13,6 +13,7 @@ import ( "github.com/iotaledger/hive.go/core/logger" iotago "github.com/iotaledger/iota.go/v3" + "github.com/iotaledger/wasp/clients/apiextensions" "github.com/iotaledger/wasp/packages/kv/dict" ) @@ -147,6 +148,15 @@ func Check(err error) { }*/ errorModel := &ErrorModel{err.Error()} + apiError, ok := apiextensions.AsAPIError(err) + if ok { + errorModel.Error = apiError.Error + + if apiError.DetailError != nil { + errorModel.Error += "\n" + apiError.DetailError.Error + "\n" + apiError.DetailError.Message + } + } + message, _ := GetCLIOutputText(errorModel) Fatalf("%v", message) } From 88a6f19c9df0ffb6a027d452fd8452233a72e08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 9 Feb 2023 10:59:23 +0100 Subject: [PATCH 35/39] Fix test, update wasmclient go --- clients/apiclient/api/openapi.yaml | 67 +++---------------- packages/isc/request_target.go | 4 +- .../ts/wasmclient/lib/isc/waspclient.ts | 2 +- tools/cluster/tests/missing_requests_test.go | 5 +- 4 files changed, 16 insertions(+), 62 deletions(-) diff --git a/clients/apiclient/api/openapi.yaml b/clients/apiclient/api/openapi.yaml index fcb7083d4b..b49d860b5d 100644 --- a/clients/apiclient/api/openapi.yaml +++ b/clients/apiclient/api/openapi.yaml @@ -1709,7 +1709,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/PeeringNodeStatusResponse__' + $ref: '#/components/schemas/PeeringNodeStatusResponse_' type: array description: A list of all peers "401": @@ -2990,16 +2990,16 @@ components: committeeNodes: - node: isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 isTrusted: true accessAPI: accessAPI - node: isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 isTrusted: true accessAPI: accessAPI chainId: tst1pqm5ckama06xhkl080mmvz6l3xy8c8lulrwy7mx4ll0fc69krxfgka70j0e @@ -3102,9 +3102,9 @@ components: example: node: isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 + netId: localhost:4000 + publicKey: 0x0000 + numUsers: 1 isTrusted: true accessAPI: accessAPI properties: @@ -4443,53 +4443,6 @@ components: xml: name: PeeringNodeStatusResponse PeeringNodeStatusResponse_: - example: - isAlive: true - netId: netId - publicKey: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - numUsers: 6 - isTrusted: true - properties: - isAlive: - description: Whether or not the peer is activated - format: boolean - type: boolean - xml: - name: IsAlive - isTrusted: - format: boolean - type: boolean - xml: - name: IsTrusted - netId: - description: The NetID of the peer - format: string - type: string - xml: - name: NetID - numUsers: - description: The amount of users attached to the peer - format: int32 - type: integer - xml: - name: NumUsers - publicKey: - description: The peers public key encoded in Hex - example: 61270151fbd8c71e43c17e0eff8c76c1ba991be28f088f72a05d790f302d67c7 - format: string - type: string - xml: - name: PublicKey - required: - - isAlive - - isTrusted - - netId - - numUsers - - publicKey - type: object - xml: - name: PeeringNodeStatusResponse - PeeringNodeStatusResponse__: example: isAlive: true netId: localhost:4000 diff --git a/packages/isc/request_target.go b/packages/isc/request_target.go index f08d409272..707d4e16dd 100644 --- a/packages/isc/request_target.go +++ b/packages/isc/request_target.go @@ -2,8 +2,8 @@ package isc // CallTarget the target representation of the request type CallTarget struct { - Contract Hname `json:"contract" swagger:"required"` - EntryPoint Hname `json:"entryPoint" swagger:"required"` + Contract Hname `json:"contract"` + EntryPoint Hname `json:"entryPoint"` } func NewCallTarget(contract, entryPoint Hname) CallTarget { diff --git a/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts b/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts index c17dc25fc1..1185add57b 100644 --- a/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts +++ b/packages/wasmvm/wasmclient/ts/wasmclient/lib/isc/waspclient.ts @@ -47,7 +47,7 @@ export class WaspClient { public postOffLedgerRequest(chainID: wasmlib.ScChainID, signed: OffLedgerRequest): Error { - const url = this.baseURL + '/chain/' + chainID.toString() + '/request'; + const url = this.baseURL + '/requests/offledger'; const req = new SyncRequestClient(); req.addHeader('Content-Type', 'application/json'); diff --git a/tools/cluster/tests/missing_requests_test.go b/tools/cluster/tests/missing_requests_test.go index b56a6f589a..0f11099c92 100644 --- a/tools/cluster/tests/missing_requests_test.go +++ b/tools/cluster/tests/missing_requests_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/apiclient" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/contracts/native/inccounter" @@ -52,7 +53,7 @@ func TestMissingRequests(t *testing.T) { _, err = clu.WaspClient(0).RequestsApi.OffLedger(context.Background()).OffLedgerRequest(apiclient.OffLedgerRequest{ ChainId: chainID.String(), - Request: req.String(), + Request: iotago.EncodeHex(req.Bytes()), }).Execute() require.NoError(t, err) @@ -62,7 +63,7 @@ func TestMissingRequests(t *testing.T) { _, err = clu.WaspClient(0).RequestsApi.OffLedger(context.Background()).OffLedgerRequest(apiclient.OffLedgerRequest{ ChainId: chainID.String(), - Request: req2.String(), + Request: iotago.EncodeHex(req2.Bytes()), }).Execute() require.NoError(t, err) //------- From 742a4db0cdea125cc859dd8ef90db06bbd404eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 9 Feb 2023 11:35:33 +0100 Subject: [PATCH 36/39] Fix linter issues --- clients/apiextensions/client.go | 2 -- clients/chainclient/chainclient.go | 4 ++-- clients/chainclient/checkrequest.go | 2 +- clients/chainclient/evm.go | 1 - clients/chainclient/stateget.go | 1 - clients/chainclient/uploadblob.go | 2 +- clients/scclient/postrequest.go | 4 +++- clients/scclient/scclient.go | 3 --- packages/apilib/rundkg.go | 1 - packages/dashboard/testutil/httptest.go | 2 +- .../go/wasmclient/wasmclientservice.go | 1 - packages/webapi/controllers/chain/evm.go | 1 - packages/webapi/interfaces/interfaces.go | 14 +++++++------ packages/webapi/services/offledger.go | 10 +++++----- plugins/webapi/component.go | 1 - tools/cluster/chain.go | 20 ++++++++----------- tools/cluster/cluster.go | 13 ++++++++---- tools/cluster/tests/account_test.go | 3 ++- tools/cluster/tests/evm_jsonrpc_test.go | 5 ++--- tools/cluster/tests/maintenance_test.go | 2 +- .../cluster/tests/offledger_requests_test.go | 16 +++++++-------- tools/cluster/tests/post_test.go | 5 ++++- tools/cluster/tests/rotation_test.go | 3 +++ tools/cluster/tests/transfer_test.go | 3 ++- tools/cluster/tests/util.go | 3 +-- tools/wasp-cli/chain/deploycontract.go | 4 +++- 26 files changed, 64 insertions(+), 62 deletions(-) diff --git a/clients/apiextensions/client.go b/clients/apiextensions/client.go index 392230c733..4c1f3ae2f4 100644 --- a/clients/apiextensions/client.go +++ b/clients/apiextensions/client.go @@ -10,7 +10,6 @@ import ( func WaspAPIClientByHostName(hostname string) (*apiclient.APIClient, error) { parsed, err := url.Parse(hostname) - if err != nil { return nil, err } @@ -27,7 +26,6 @@ func CallView(context context.Context, client *apiclient.APIClient, request apic CallView(context). ContractCallViewRequest(request). Execute() - if err != nil { return nil, err } diff --git a/clients/chainclient/chainclient.go b/clients/chainclient/chainclient.go index 1526f6a19c..8472a32ab0 100644 --- a/clients/chainclient/chainclient.go +++ b/clients/chainclient/chainclient.go @@ -153,7 +153,7 @@ func (c *Client) post1RequestWithOutputs( } // PostOffLedgerRequest sends an off-ledger tx via the wasp node web api -func (c *Client) PostOffLedgerRequest( +func (c *Client) PostOffLedgerRequest(context context.Context, contractHname isc.Hname, entrypoint isc.Hname, params ...PostRequestParams, @@ -186,7 +186,7 @@ func (c *Client) PostOffLedgerRequest( Request: request, } _, err := c.WaspClient.RequestsApi. - OffLedger(context.Background()). + OffLedger(context). OffLedgerRequest(offLedgerRequest). Execute() diff --git a/clients/chainclient/checkrequest.go b/clients/chainclient/checkrequest.go index 8f8528e3c5..0b9818c12a 100644 --- a/clients/chainclient/checkrequest.go +++ b/clients/chainclient/checkrequest.go @@ -19,6 +19,6 @@ func (c *Client) CheckRequestResult(ctx context.Context, reqID isc.RequestID) er if receipt.Error != nil { return fmt.Errorf("the request was rejected: %v", receipt.Error.ErrorMessage) } - + return nil } diff --git a/clients/chainclient/evm.go b/clients/chainclient/evm.go index 8aea674936..b60640b167 100644 --- a/clients/chainclient/evm.go +++ b/clients/chainclient/evm.go @@ -10,7 +10,6 @@ import ( func (c *Client) RequestIDByEVMTransactionHash(ctx context.Context, txHash common.Hash) (isc.RequestID, error) { requestIDStr, _, err := c.WaspClient.ChainsApi.GetRequestIDFromEVMTransactionID(ctx, c.ChainID.String(), txHash.Hex()).Execute() - if err != nil { return isc.RequestID{}, err } diff --git a/clients/chainclient/stateget.go b/clients/chainclient/stateget.go index 0f8ca0f88a..8193510815 100644 --- a/clients/chainclient/stateget.go +++ b/clients/chainclient/stateget.go @@ -9,7 +9,6 @@ import ( // StateGet fetches the raw value associated with the given key in the chain state func (c *Client) StateGet(ctx context.Context, key string) ([]byte, error) { stateResponse, _, err := c.WaspClient.ChainsApi.GetStateValue(ctx, c.ChainID.String(), iotago.EncodeHex([]byte(key))).Execute() - if err != nil { return nil, err } diff --git a/clients/chainclient/uploadblob.go b/clients/chainclient/uploadblob.go index a87eb332b2..3d19133934 100644 --- a/clients/chainclient/uploadblob.go +++ b/clients/chainclient/uploadblob.go @@ -14,7 +14,7 @@ import ( func (c *Client) UploadBlob(ctx context.Context, fields dict.Dict) (hashing.HashValue, isc.OffLedgerRequest, *apiclient.ReceiptResponse, error) { blobHash := blob.MustGetBlobHash(fields) - req, err := c.PostOffLedgerRequest( + req, err := c.PostOffLedgerRequest(ctx, blob.Contract.Hname(), blob.FuncStoreBlob.Hname(), diff --git a/clients/scclient/postrequest.go b/clients/scclient/postrequest.go index 79eb32c12b..9bd1511a27 100644 --- a/clients/scclient/postrequest.go +++ b/clients/scclient/postrequest.go @@ -1,6 +1,8 @@ package scclient import ( + "context" + iotago "github.com/iotaledger/iota.go/v3" "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" @@ -15,5 +17,5 @@ func (c *SCClient) PostNRequests(fname string, n int, params ...chainclient.Post } func (c *SCClient) PostOffLedgerRequest(fname string, params ...chainclient.PostRequestParams) (isc.OffLedgerRequest, error) { - return c.ChainClient.PostOffLedgerRequest(c.ContractHname, isc.Hn(fname), params...) + return c.ChainClient.PostOffLedgerRequest(context.Background(), c.ContractHname, isc.Hn(fname), params...) } diff --git a/clients/scclient/scclient.go b/clients/scclient/scclient.go index c1bc013312..d6bf33b765 100644 --- a/clients/scclient/scclient.go +++ b/clients/scclient/scclient.go @@ -1,15 +1,12 @@ package scclient import ( - "context" - "github.com/iotaledger/wasp/clients/chainclient" "github.com/iotaledger/wasp/packages/isc" ) // SCClient allows to send webapi requests targeted to a specific contract type SCClient struct { - context context.Context ChainClient *chainclient.Client ContractHname isc.Hname } diff --git a/packages/apilib/rundkg.go b/packages/apilib/rundkg.go index 4bf0524ff6..d67f15d6a9 100644 --- a/packages/apilib/rundkg.go +++ b/packages/apilib/rundkg.go @@ -35,7 +35,6 @@ func RunDKG(clientResolver multiclient.ClientResolver, apiHosts, peerPubKeys []s TimeoutMS: to, PeerIdentities: peerPubKeys, }).Execute() - if err != nil { return nil, err } diff --git a/packages/dashboard/testutil/httptest.go b/packages/dashboard/testutil/httptest.go index 753e5b821f..f73ff90a90 100644 --- a/packages/dashboard/testutil/httptest.go +++ b/packages/dashboard/testutil/httptest.go @@ -74,7 +74,7 @@ func CallWebAPIRequestHandler( if exptectedStatus >= 400 { require.Error(t, err) // TODO: Add error declaration - //require.Equal(t, exptectedStatus, err.(*httperrors.HTTPError).Code) + // require.Equal(t, exptectedStatus, err.(*httperrors.HTTPError).Code) } else { require.NoError(t, err) require.Equal(t, exptectedStatus, rec.Code) diff --git a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go index b383d610b2..ab22f7a1d8 100644 --- a/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go +++ b/packages/wasmvm/wasmclient/go/wasmclient/wasmclientservice.go @@ -59,7 +59,6 @@ func (sc *WasmClientService) CallViewByHname(chainID wasmtypes.ScChainID, hContr ChainId: iscChainID.String(), Arguments: apiextensions.JSONDictToAPIJSONDict(params.JSONDict()), }).Execute() - if err != nil { return nil, err } diff --git a/packages/webapi/controllers/chain/evm.go b/packages/webapi/controllers/chain/evm.go index 2278e6a10f..1ef6a3e7bb 100644 --- a/packages/webapi/controllers/chain/evm.go +++ b/packages/webapi/controllers/chain/evm.go @@ -28,7 +28,6 @@ func (c *Controller) getRequestID(e echo.Context) error { txHash := e.Param("txHash") requestID, err := c.evmService.GetRequestID(chainID, txHash) - if err != nil { return apierrors.InvalidPropertyError("txHash", err) } diff --git a/packages/webapi/interfaces/interfaces.go b/packages/webapi/interfaces/interfaces.go index eac8bbaeec..0e7a59c4a3 100644 --- a/packages/webapi/interfaces/interfaces.go +++ b/packages/webapi/interfaces/interfaces.go @@ -23,12 +23,14 @@ import ( "github.com/iotaledger/wasp/packages/registry" ) -var ErrUnableToGetLatestState = errors.New("unable to get latest state") -var ErrUnableToGetReceipt = errors.New("unable to get request receipt from block state") -var ErrAlreadyProcessed = errors.New("request already processed") -var ErrNoBalanceOnAccount = errors.New("no balance on account") -var ErrInvalidNonce = errors.New("invalid nonce") -var ErrChainNotFound = errors.New("chain not found") +var ( + ErrUnableToGetLatestState = errors.New("unable to get latest state") + ErrUnableToGetReceipt = errors.New("unable to get request receipt from block state") + ErrAlreadyProcessed = errors.New("request already processed") + ErrNoBalanceOnAccount = errors.New("no balance on account") + ErrInvalidNonce = errors.New("invalid nonce") + ErrChainNotFound = errors.New("chain not found") +) type APIController interface { Name() string diff --git a/packages/webapi/services/offledger.go b/packages/webapi/services/offledger.go index 9c227dcd62..4edd5c3f1a 100644 --- a/packages/webapi/services/offledger.go +++ b/packages/webapi/services/offledger.go @@ -89,19 +89,19 @@ func (c *OffLedgerService) EnqueueOffLedgerRequest(chainID isc.ChainID, binaryRe func ShouldBeProcessed(ch chain.ChainCore, req isc.OffLedgerRequest) error { state, err := ch.LatestState(chain.ActiveOrCommittedState) if err != nil { - //ServerError + // ServerError return interfaces.ErrUnableToGetLatestState } // query blocklog contract processed, err := blocklog.IsRequestProcessed(state, req.ID()) if err != nil { - //ServerError + // ServerError return interfaces.ErrUnableToGetReceipt } if processed { - //BadRequest + // BadRequest return interfaces.ErrAlreadyProcessed } @@ -110,14 +110,14 @@ func ShouldBeProcessed(ch chain.ChainCore, req isc.OffLedgerRequest) error { accountsPartition := subrealm.NewReadOnly(state, kv.Key(accounts.Contract.Hname().Bytes())) // check user has on-chain balance if !accounts.AccountExists(accountsPartition, req.SenderAccount()) { - //BadRequest + // BadRequest return interfaces.ErrNoBalanceOnAccount } accountNonce := accounts.GetMaxAssumedNonce(accountsPartition, req.SenderAccount()) if err := vmcontext.CheckNonce(req, accountNonce); err != nil { - //BadRequest + // BadRequest return interfaces.ErrInvalidNonce } diff --git a/plugins/webapi/component.go b/plugins/webapi/component.go index 70408f9f41..a5bee6b06c 100644 --- a/plugins/webapi/component.go +++ b/plugins/webapi/component.go @@ -89,7 +89,6 @@ func CreateEchoSwagger(e *echo.Echo, version string) echoswagger.ApiRoot { return echoSwagger } -//nolint:funlen func provide(c *dig.Container) error { type webapiServerDeps struct { dig.In diff --git a/tools/cluster/chain.go b/tools/cluster/chain.go index 4e77bb1896..c60777c41f 100644 --- a/tools/cluster/chain.go +++ b/tools/cluster/chain.go @@ -186,8 +186,7 @@ func (ch *Chain) DeployWasmContract(name, description string, progBinary []byte, func (ch *Chain) GetBlobFieldValue(blobHash hashing.HashValue, field string) ([]byte, error) { v, _, err := ch.Cluster.WaspClient(0).CorecontractsApi. BlobsGetBlobValue(context.Background(), ch.ChainID.String(), blobHash.Hex(), field). - Execute() - + Execute() //nolint:bodyclose // false positive if err != nil { return nil, err } @@ -203,8 +202,7 @@ func (ch *Chain) GetBlobFieldValue(blobHash hashing.HashValue, field string) ([] func (ch *Chain) BlockIndex(nodeIndex ...int) (uint32, error) { blockInfo, _, err := ch.Cluster. WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetLatestBlockInfo(context.Background(), ch.ChainID.String()). - Execute() - + Execute() //nolint:bodyclose // false positive if err != nil { return 0, err } @@ -221,8 +219,7 @@ func (ch *Chain) GetAllBlockInfoRecordsReverse(nodeIndex ...int) ([]*apiclient.B for idx := int(blockIndex); idx >= 0; idx-- { blockInfo, _, err := ch.Cluster. WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetBlockInfo(context.Background(), ch.ChainID.String(), uint32(idx)). - Execute() - + Execute() //nolint:bodyclose // false positive if err != nil { return nil, err } @@ -235,8 +232,7 @@ func (ch *Chain) GetAllBlockInfoRecordsReverse(nodeIndex ...int) ([]*apiclient.B func (ch *Chain) ContractRegistry(nodeIndex ...int) ([]apiclient.ContractInfoResponse, error) { contracts, _, err := ch.Cluster. WaspClient(nodeIndex...).ChainsApi.GetContracts(context.Background(), ch.ChainID.String()). - Execute() - + Execute() //nolint:bodyclose // false positive if err != nil { return nil, err } @@ -250,7 +246,7 @@ func (ch *Chain) GetCounterValue(inccounterSCHname isc.Hname, nodeIndex ...int) ChainId: ch.ChainID.String(), ContractHName: inccounterSCHname.String(), FunctionHName: inccounter.ViewGetCounter.Hname().String(), - }).Execute() + }).Execute() //nolint:bodyclose // false positive if err != nil { return 0, err } @@ -271,7 +267,7 @@ func (ch *Chain) GetStateVariable(contractHname isc.Hname, key string, nodeIndex func (ch *Chain) GetRequestReceipt(reqID isc.RequestID, nodeIndex ...int) (*apiclient.ReceiptResponse, error) { receipt, _, err := ch.Cluster.WaspClient(nodeIndex...).RequestsApi.GetReceipt(context.Background(), ch.ChainID.String(), reqID.String()). - Execute() + Execute() //nolint:bodyclose // false positive return receipt, err } @@ -282,10 +278,10 @@ func (ch *Chain) GetRequestReceiptsForBlock(blockIndex *uint32, nodeIndex ...int if blockIndex != nil { receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfBlock(context.Background(), ch.ChainID.String(), *blockIndex). - Execute() + Execute() //nolint:bodyclose // false positive } else { receipts, _, err = ch.Cluster.WaspClient(nodeIndex...).CorecontractsApi.BlocklogGetRequestReceiptsOfLatestBlock(context.Background(), ch.ChainID.String()). - Execute() + Execute() //nolint:bodyclose // false positive } if err != nil { diff --git a/tools/cluster/cluster.go b/tools/cluster/cluster.go index ef8b186cf1..665e44e6c5 100644 --- a/tools/cluster/cluster.go +++ b/tools/cluster/cluster.go @@ -115,7 +115,9 @@ func (clu *Cluster) AddTrustedNode(peerInfo apiclient.PeeringTrustRequest, onNod for ni := range nodes { var err error + if _, err = clu.WaspClient( + //nolint:bodyclose // false positive nodes[ni]).NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(peerInfo).Execute(); err != nil { return err } @@ -128,6 +130,7 @@ func (clu *Cluster) TrustAll() error { allPeers := make([]*apiclient.PeeringNodeIdentityResponse, len(allNodes)) for ni := range allNodes { var err error + //nolint:bodyclose // false positive if allPeers[ni], _, err = clu.WaspClient(allNodes[ni]).NodeApi.GetPeeringIdentity(context.Background()).Execute(); err != nil { return err } @@ -139,7 +142,7 @@ func (clu *Cluster) TrustAll() error { allNodes[ni]).NodeApi.TrustPeer(context.Background()).PeeringTrustRequest(apiclient.PeeringTrustRequest{ PublicKey: allPeers[pi].PublicKey, NetId: allPeers[pi].NetId, - }).Execute(); err != nil { + }).Execute(); err != nil { //nolint:bodyclose // false positive return err } } @@ -175,6 +178,7 @@ func (clu *Cluster) RunDKG(committeeNodes []int, threshold uint16, timeout ...ti peerPubKeys := make([]string, 0) for _, i := range committeeNodes { + //nolint:bodyclose // false positive peeringNodeInfo, _, err := clu.WaspClient(i).NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return nil, err @@ -219,6 +223,7 @@ func (clu *Cluster) DeployChain(description string, allPeers, committeeNodes []i committeePubKeys := make([]string, len(chain.CommitteeNodes)) for i, nodeIndex := range chain.CommitteeNodes { + //nolint:bodyclose // false positive peeringNode, _, err := clu.WaspClient(nodeIndex).NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return nil, err @@ -276,6 +281,7 @@ func (clu *Cluster) addAllAccessNodes(chain *Chain, accessNodes []int) error { for _, a := range accessNodes { waspClient := clu.WaspClient(a) + //nolint:bodyclose // false positive accessNodePeering, _, err := waspClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return err @@ -313,6 +319,7 @@ func (clu *Cluster) AddAccessNode(accessNodeIndex int, chain *Chain) (*iotago.Tr return nil, err } + //nolint:bodyclose // false positive accessNodePeering, _, err := waspClient.NodeApi.GetPeeringIdentity(context.Background()).Execute() if err != nil { return nil, err @@ -327,8 +334,7 @@ func (clu *Cluster) AddAccessNode(accessNodeIndex int, chain *Chain) (*iotago.Tr cert, _, err := waspClient.NodeApi.SetNodeOwner(context.Background()).NodeOwnerCertificateRequest(apiclient.NodeOwnerCertificateRequest{ PublicKey: accessNodePubKey.String(), OwnerAddress: chain.OriginatorAddress().Bech32(parameters.L1().Protocol.Bech32HRP), - }).Execute() - + }).Execute() //nolint:bodyclose // false positive if err != nil { return nil, err } @@ -375,7 +381,6 @@ func (clu *Cluster) MultiClient() *multiclient.MultiClient { func (clu *Cluster) WaspClientFromHostName(hostName string) *apiclient.APIClient { client, err := apiextensions.WaspAPIClientByHostName(hostName) - if err != nil { panic(err.Error()) } diff --git a/tools/cluster/tests/account_test.go b/tools/cluster/tests/account_test.go index bf1e15be89..19f61a4031 100644 --- a/tools/cluster/tests/account_test.go +++ b/tools/cluster/tests/account_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "testing" "time" @@ -192,7 +193,7 @@ func testBasic2Accounts(t *testing.T, env *ChainEnv) { origL1Balance := env.Clu.AddressBalances(originatorAddress).BaseTokens originatorClient := chainclient.New(env.Clu.L1Client(), env.Clu.WaspClient(0), chain.ChainID, originatorSigScheme) allowanceBaseTokens := uint64(800_000) - req2, err := originatorClient.PostOffLedgerRequest(accounts.Contract.Hname(), accounts.FuncWithdraw.Hname(), + req2, err := originatorClient.PostOffLedgerRequest(context.Background(), accounts.Contract.Hname(), accounts.FuncWithdraw.Hname(), chainclient.PostRequestParams{ Allowance: isc.NewAssetsBaseTokens(allowanceBaseTokens), }, diff --git a/tools/cluster/tests/evm_jsonrpc_test.go b/tools/cluster/tests/evm_jsonrpc_test.go index 65f7bfbdfb..4a0c4b6a00 100644 --- a/tools/cluster/tests/evm_jsonrpc_test.go +++ b/tools/cluster/tests/evm_jsonrpc_test.go @@ -36,8 +36,8 @@ type clusterTestEnv struct { func newClusterTestEnv(t *testing.T, env *ChainEnv, nodeIndex int) *clusterTestEnv { evmtest.InitGoEthLogger(t) - evmJsonRPCPath := fmt.Sprintf("/chains/%v/evm", env.Chain.ChainID.String()) - jsonRPCEndpoint := env.Clu.Config.APIHost(nodeIndex) + evmJsonRPCPath + evmJSONRPCPath := fmt.Sprintf("/chains/%v/evm", env.Chain.ChainID.String()) + jsonRPCEndpoint := env.Clu.Config.APIHost(nodeIndex) + evmJSONRPCPath rawClient, err := rpc.DialHTTP(jsonRPCEndpoint) require.NoError(t, err) client := ethclient.NewClient(rawClient) @@ -53,7 +53,6 @@ func newClusterTestEnv(t *testing.T, env *ChainEnv, nodeIndex int) *clusterTestE WaitForRequest(context.Background(), env.Chain.ChainID.String(), reqID.String()). TimeoutSeconds(60). Execute() - if err != nil { return err } diff --git a/tools/cluster/tests/maintenance_test.go b/tools/cluster/tests/maintenance_test.go index a05b4c45bc..e60607f026 100644 --- a/tools/cluster/tests/maintenance_test.go +++ b/tools/cluster/tests/maintenance_test.go @@ -53,7 +53,7 @@ func testMaintenance(t *testing.T, env *ChainEnv) { // call the gov "maintenance status view", check it is OFF { - //TODO: Add maintenance status to wrapped core contracts + // TODO: Add maintenance status to wrapped core contracts ret, err := ownerSCClient.CallView(context.Background(), governance.ViewGetMaintenanceStatus.Name, nil) require.NoError(t, err) maintenanceStatus := codec.MustDecodeBool(ret.MustGet(governance.VarMaintenanceStatus)) diff --git a/tools/cluster/tests/offledger_requests_test.go b/tools/cluster/tests/offledger_requests_test.go index f9c44f0e50..49e60d168e 100644 --- a/tools/cluster/tests/offledger_requests_test.go +++ b/tools/cluster/tests/offledger_requests_test.go @@ -41,7 +41,7 @@ func TestOffledgerRequestAccessNode(t *testing.T) { chClient := newWalletWithFunds(e, 5, 0, 2, 4, 5, 7) // send off-ledger request via Web API (to the access node) - _, err = chClient.PostOffLedgerRequest( + _, err = chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), ) @@ -68,7 +68,7 @@ func testOffledgerRequest(t *testing.T, e *ChainEnv) { chClient := newWalletWithFunds(e, 0, 0, 1, 2, 3) // send off-ledger request via Web API - offledgerReq, err := chClient.PostOffLedgerRequest( + offledgerReq, err := chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), ) @@ -101,7 +101,7 @@ func testOffledgerRequest900KB(t *testing.T, e *ChainEnv) { paramsDict := dict.Dict{"data": randomData} expectedHash := blob.MustGetBlobHash(paramsDict) - offledgerReq, err := chClient.PostOffLedgerRequest( + offledgerReq, err := chClient.PostOffLedgerRequest(context.Background(), blob.Contract.Hname(), blob.FuncStoreBlob.Hname(), chainclient.PostRequestParams{ @@ -130,7 +130,7 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { chClient := newWalletWithFunds(e, 0, 0, 1, 2, 3) // send off-ledger request with a high nonce - offledgerReq, err := chClient.PostOffLedgerRequest( + offledgerReq, err := chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), chainclient.PostRequestParams{ @@ -142,7 +142,7 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { require.NoError(t, err) // send off-ledger request with a high nonce -1 - offledgerReq, err = chClient.PostOffLedgerRequest( + offledgerReq, err = chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), chainclient.PostRequestParams{ @@ -154,7 +154,7 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { require.NoError(t, err) // send off-ledger request with a much lower nonce - _, err = chClient.PostOffLedgerRequest( + _, err = chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), chainclient.PostRequestParams{ @@ -168,7 +168,7 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { require.Regexp(t, "invalid nonce", apiError.DetailError.Error) // try replaying the initial request - _, err = chClient.PostOffLedgerRequest( + _, err = chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), chainclient.PostRequestParams{ @@ -182,7 +182,7 @@ func testOffledgerNonce(t *testing.T, e *ChainEnv) { require.Regexp(t, "request already processed", apiError.DetailError.Error) // send a request with a higher nonce - offledgerReq, err = chClient.PostOffLedgerRequest( + offledgerReq, err = chClient.PostOffLedgerRequest(context.Background(), nativeIncCounterSCHname, inccounter.FuncIncCounter.Hname(), chainclient.PostRequestParams{ diff --git a/tools/cluster/tests/post_test.go b/tools/cluster/tests/post_test.go index 24805f2338..0dcc4571be 100644 --- a/tools/cluster/tests/post_test.go +++ b/tools/cluster/tests/post_test.go @@ -65,6 +65,7 @@ func deployInccounter42(e *ChainEnv) *isc.ContractAgentID { root.ParamHname: hname.Bytes(), }), }) + require.NoError(e.t, err) recb, err := result.Get(root.ParamContractRecData) require.NoError(e.t, err) @@ -87,11 +88,13 @@ func (e *ChainEnv) getNativeContractCounter(hname isc.Hname) int64 { } func (e *ChainEnv) getCounterForNode(hname isc.Hname, nodeIndex int) int64 { - result, _, err := e.Chain.Cluster.WaspClient().RequestsApi.CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ + result, _, err := e.Chain.Cluster.WaspClient(nodeIndex).RequestsApi. + CallView(context.Background()).ContractCallViewRequest(apiclient.ContractCallViewRequest{ ChainId: e.Chain.ChainID.String(), ContractHName: hname.String(), FunctionName: "getCounter", }).Execute() + require.NoError(e.t, err) decodedDict, err := apiextensions.APIJsonDictToDict(*result) require.NoError(e.t, err) diff --git a/tools/cluster/tests/rotation_test.go b/tools/cluster/tests/rotation_test.go index b46c1c3361..e8d3c71208 100644 --- a/tools/cluster/tests/rotation_test.go +++ b/tools/cluster/tests/rotation_test.go @@ -325,6 +325,9 @@ func (e *ChainEnv) callGetStateController(nodeIndex int) (iotago.Address, error) controlAddresses, _, err := e.Chain.Cluster.WaspClient(nodeIndex).CorecontractsApi. BlocklogGetControlAddresses(context.Background(), e.Chain.ChainID.String()). Execute() + if err != nil { + return nil, err + } _, address, err := iotago.ParseBech32(controlAddresses.StateAddress) require.NoError(e.t, err) diff --git a/tools/cluster/tests/transfer_test.go b/tools/cluster/tests/transfer_test.go index 1074deacf3..31e718c1e0 100644 --- a/tools/cluster/tests/transfer_test.go +++ b/tools/cluster/tests/transfer_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "testing" "time" @@ -61,7 +62,7 @@ func TestDepositWithdraw(t *testing.T) { // withdraw some base tokens back baseTokensToWithdraw := 1 * isc.Million - req, err := chClient.PostOffLedgerRequest(accounts.Contract.Hname(), accounts.FuncWithdraw.Hname(), + req, err := chClient.PostOffLedgerRequest(context.Background(), accounts.Contract.Hname(), accounts.FuncWithdraw.Hname(), chainclient.PostRequestParams{ Allowance: isc.NewAssetsBaseTokens(baseTokensToWithdraw), }, diff --git a/tools/cluster/tests/util.go b/tools/cluster/tests/util.go index c59b748cc6..6a6a958d5c 100644 --- a/tools/cluster/tests/util.go +++ b/tools/cluster/tests/util.go @@ -99,7 +99,7 @@ func (e *ChainEnv) getBalanceOnChain(agentID isc.AgentID, assetID []byte, nodeIn return nativeToken.Amount.Uint64() } } - //TODO: Throw error when native token id wasn't found? + // TODO: Throw error when native token id wasn't found? return 0 } @@ -247,7 +247,6 @@ func (e *ChainEnv) counterEquals(expected int64) conditionFn { ContractHName: nativeIncCounterSCHname.String(), FunctionHName: inccounter.ViewGetCounter.Hname().String(), }) - if err != nil { e.t.Logf("chainEnv::counterEquals: failed to call GetCounter: %v", err) return false diff --git a/tools/wasp-cli/chain/deploycontract.go b/tools/wasp-cli/chain/deploycontract.go index 652fa08b13..074b413292 100644 --- a/tools/wasp-cli/chain/deploycontract.go +++ b/tools/wasp-cli/chain/deploycontract.go @@ -1,6 +1,8 @@ package chain import ( + "context" + "github.com/spf13/cobra" "github.com/iotaledger/wasp/clients/apiclient" @@ -63,7 +65,7 @@ func deployContract(client *apiclient.APIClient, name, description string, progH root.ParamProgramHash: progHash, }) args.Extend(initParams) - return cliclients.ChainClient(client).PostOffLedgerRequest( + return cliclients.ChainClient(client).PostOffLedgerRequest(context.Background(), root.Contract.Hname(), root.FuncDeployContract.Hname(), chainclient.PostRequestParams{ From 2870ec9e17928844155cd6bf2cd663b39d97abe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 9 Feb 2023 12:40:12 +0100 Subject: [PATCH 37/39] Fix rust schema cargo template --- tools/schema/generator/rstemplates/cargotoml.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/schema/generator/rstemplates/cargotoml.go b/tools/schema/generator/rstemplates/cargotoml.go index e485bc99d8..ae911a09a8 100644 --- a/tools/schema/generator/rstemplates/cargotoml.go +++ b/tools/schema/generator/rstemplates/cargotoml.go @@ -43,14 +43,14 @@ description = "Wasm VM host stub for: $scDesc" // ******************************* "dependenciesLib": ` [dependencies] -wasmlib = { git = "https://github.com/iotaledger/wasp", branch = "wasmclient" } +wasmlib = { git = "https://github.com/iotaledger/wasp", branch = "develop" } `, // ******************************* "dependenciesImpl": ` [dependencies] $package = { path = "../$package" } $#if packagetestwasmlib dependencyErc721 -wasmlib = { git = "https://github.com/iotaledger/wasp", branch = "wasmclient" } +wasmlib = { git = "https://github.com/iotaledger/wasp", branch = "develop" } `, // ******************************* "dependencyErc721": ` @@ -63,7 +63,7 @@ default = ["console_error_panic_hook"] [dependencies] $package$+impl = { path = "../$package$+impl" } -wasmvmhost = { git = "https://github.com/iotaledger/wasp", branch = "wasmclient" } +wasmvmhost = { git = "https://github.com/iotaledger/wasp", branch = "develop" } console_error_panic_hook = { version = "0.1.7", optional = true } wee_alloc = { version = "0.4.5", optional = true } `, From 4ddf7fd74f8c1920ed4dcb60c816cc0bde7cc4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 9 Feb 2023 12:54:09 +0100 Subject: [PATCH 38/39] Fix rust schema cargo template --- tools/wasp-cli/cli/config/config.go | 3 +-- tools/wasp-cli/cli/init/init.go | 4 ++-- tools/wasp-cli/log/log.go | 17 +++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/wasp-cli/cli/config/config.go b/tools/wasp-cli/cli/config/config.go index 8904449c60..c69f766a34 100644 --- a/tools/wasp-cli/cli/config/config.go +++ b/tools/wasp-cli/cli/config/config.go @@ -37,8 +37,7 @@ func RefreshL1ParamsFromNode() { if log.VerboseFlag { log.Printf("Getting L1 params from node at %s...\n", L1APIAddress()) } - //TODO: Move to a proper place - // this will call parameters.InitL1() + Set(l1ParamsKey, parameters.L1NoLock()) Set(l1ParamsTimestampKey, time.Now()) } diff --git a/tools/wasp-cli/cli/init/init.go b/tools/wasp-cli/cli/init/init.go index 18a0649ae4..272a76ad8a 100644 --- a/tools/wasp-cli/cli/init/init.go +++ b/tools/wasp-cli/cli/init/init.go @@ -42,14 +42,14 @@ func Init(rootCmd *cobra.Command, waspVersion string) { rootCmd.PersistentFlags().StringVarP(&config.ConfigPath, "config", "c", "wasp-cli.json", "path to wasp-cli.json") rootCmd.PersistentFlags().BoolVarP(&config.WaitForCompletion, "wait", "w", true, "wait for request completion") + cliclients.L1Client() + rootCmd.AddCommand(initCheckVersionsCmd(waspVersion)) rootCmd.AddCommand(initConfigSetCmd()) rootCmd.AddCommand(initRefreshL1ParamsCmd()) // The first time parameters.L1() is called, it will be initialized with this function parameters.InitL1Lazy(func() { - cliclients.L1Client() - if config.L1ParamsExpired() { config.RefreshL1ParamsFromNode() } else { diff --git a/tools/wasp-cli/log/log.go b/tools/wasp-cli/log/log.go index 477099324b..559cc56e30 100644 --- a/tools/wasp-cli/log/log.go +++ b/tools/wasp-cli/log/log.go @@ -3,6 +3,7 @@ package log import ( "bytes" "encoding/json" + "errors" "fmt" "os" "strings" @@ -142,18 +143,18 @@ func PrintCLIOutput(output CLIOutput) { func Check(err error) { if err != nil { - // TODO: Debug error type here. - /*if errors.Is(err, apiclient.error) { - err = errors.New("unauthorized request: are you logged in? (wasp-cli login)") - }*/ - errorModel := &ErrorModel{err.Error()} apiError, ok := apiextensions.AsAPIError(err) + if ok { - errorModel.Error = apiError.Error + if strings.Contains(apiError.Error, "404") { + err = errors.New("unauthorized request: are you logged in? (wasp-cli login)") + } else { + errorModel.Error = apiError.Error - if apiError.DetailError != nil { - errorModel.Error += "\n" + apiError.DetailError.Error + "\n" + apiError.DetailError.Message + if apiError.DetailError != nil { + errorModel.Error += "\n" + apiError.DetailError.Error + "\n" + apiError.DetailError.Message + } } } From 3df8f8263662de6c8f8bdb55c4123fb778f69d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20M=C3=B6ller?= Date: Thu, 9 Feb 2023 13:13:07 +0100 Subject: [PATCH 39/39] Merge reboot test --- tools/cluster/tests/reboot_test.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tools/cluster/tests/reboot_test.go b/tools/cluster/tests/reboot_test.go index a302cd44bb..a745f5f568 100644 --- a/tools/cluster/tests/reboot_test.go +++ b/tools/cluster/tests/reboot_test.go @@ -17,7 +17,6 @@ import ( "github.com/iotaledger/wasp/packages/isc" "github.com/iotaledger/wasp/packages/kv" "github.com/iotaledger/wasp/packages/kv/codec" - "github.com/iotaledger/wasp/packages/testutil" "github.com/iotaledger/wasp/packages/util" "github.com/iotaledger/wasp/packages/utxodb" "github.com/iotaledger/wasp/packages/vm/core/accounts" @@ -284,7 +283,7 @@ func TestRebootN3TwoNodes(t *testing.T) { // Test rebooting nodes during operation. func TestRebootDuringTasks(t *testing.T) { - testutil.RunHeavy(t) + // testutil.RunHeavy(t) env := setupNativeInccounterTest(t, 4, []int{0, 1, 2, 3}) // keep the nodes spammed @@ -322,18 +321,18 @@ func TestRebootDuringTasks(t *testing.T) { require.NoError(t, err) time.Sleep(20 * time.Second) - // after rebooting, the chain should resume processing requests/views without issues - ret, err := apiextensions.CallView(context.Background(), env.Clu.WaspClient(0), apiclient.ContractCallViewRequest{ - ChainId: env.Chain.ChainID.String(), - ContractHName: nativeIncCounterSCHname.String(), - FunctionHName: inccounter.ViewGetCounter.Hname().String(), - }) - require.NoError(t, err) + // after rebooting, the chain should resume processing requests/views without issues + ret, err := apiextensions.CallView(context.Background(), env.Clu.WaspClient(0), apiclient.ContractCallViewRequest{ + ChainId: env.Chain.ChainID.String(), + ContractHName: nativeIncCounterSCHname.String(), + FunctionHName: inccounter.ViewGetCounter.Hname().String(), + }) + require.NoError(t, err) - counter, err := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter), 0) - require.NoError(t, err) - require.Greater(t, counter, lastCounter) - lastCounter = counter + counter, err := codec.DecodeInt64(ret.MustGet(inccounter.VarCounter), 0) + require.NoError(t, err) + require.Greater(t, counter, lastCounter) + lastCounter = counter // assert the node still processes on/off-ledger requests keyPair2, _, err := env.Clu.NewKeyPairWithFunds()