Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation of anonymous object schemas doesn't seem to work #626

Open
jamietanna opened this issue Jun 10, 2022 · 3 comments · May be fixed by #648
Open

Generation of anonymous object schemas doesn't seem to work #626

jamietanna opened this issue Jun 10, 2022 · 3 comments · May be fixed by #648

Comments

@jamietanna
Copy link
Collaborator

Given the following OpenAPI:

openapi: '3.1.0'
info:
  title: ''
  version: ''
servers: []
paths:
  "/healthcheck":
    get:
      summary: "Healthcheck endpoint"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  health:
                    type: string
                    enum:
                      - "ok"

We'll get generated the following struct:

type GetHealthcheckResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Health *N200Health `json:"health,omitempty"`
	}
}

However, N200Health isn't defined anywhere 😅

@jamietanna
Copy link
Collaborator Author

Currently investigating at https://github.com/jamietanna/oapi-codegen/tree/defect/626

@maceip
Copy link

maceip commented Jul 4, 2022

this schema also causes the same issue:

large schema file:
openapi: 3.0.0
info:
  title: Fireblocks API
  version: "1.5.1"
  contact:
    email: support@fireblocks.com
servers:
  - url: 'https://api.fireblocks.io/v1'
x-readme:
  explorer-enabled: false
paths:
  #  VAULT
  '/vault/accounts':
    get:
      summary: Retrieves all vault accounts for the specified filter.
      tags:
        - Vaults
      parameters:
        - in: query
          name: namePrefix
          required: false
          schema:
            type: string
        - in: query
          name: nameSuffix
          required: false
          schema:
            type: string
        - in: query
          name: minAmountThreshold
          required: false
          schema:
            type: number
        - in: query
          name: assetId
          required: false
          schema:
            type: string
            x-fb-entity: asset
        - in: query
          name: maxBip44AddressIndexUsed
          required: false
          schema:
            type: number
        - in: query
          name: maxBip44ChangeAddressIndexUsed
          required: false
          schema:
            type: number
      responses:
        '200':
          description: A list of vault accounts
          content:
            '*/*':
              schema:
                  type: array
                  items:
                    $ref: '#/components/schemas/VaultAccount'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Creates a new vault account
      tags:
        - Vaults
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  description: Account Name
                  type: string
                hiddenOnUI:
                  description: >-
                    Optional - if true, the created account and all related transactions will not be shown on Fireblocks console
                  type: boolean
                customerRefId:
                  description: >-
                    Optional - Sets a customer reference ID
                  type: string
                autoFuel:
                  description:
                    Optional - Sets the autoFuel property of the vault account
                  type: boolean
      responses:
        '200':
          description: A Vault Account object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/VaultAccount'
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts_paged':
    get:
      summary: Retrieves all vault accounts in your workspace. This command is limited up to a certain amount of results to ensure response time is received in a timely manner
      tags:
        - Vaults
      parameters:
        - in: query
          name: namePrefix
          required: false
          schema:
            type: string
        - in: query
          name: nameSuffix
          required: false
          schema:
            type: string
        - in: query
          name: minAmountThreshold
          required: false
          schema:
            type: number
        - in: query
          name: assetId
          required: false
          schema:
            type: string
            x-fb-entity: asset
        - in: query
          name: maxBip44AddressIndexUsed
          required: false
          schema:
            type: number
        - in: query
          name: maxBip44ChangeAddressIndexUsed
          required: false
          schema:
            type: number
        - in: query
          name: orderBy
          required: false
          schema:
            type: string
            enum: ["ASC", "DESC"]
            default: "DESC"
        - in: query
          name: before
          required: false
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            type: string
        - in: query
          name: limit
          required: false
          schema:
            type: number
            minimum: 1
            maximum: 500
            default: 200
      responses:
        '200':
          description: A VaultAccountsPagedResponse object
          content:
            '*/*':
              schema:
                  $ref: '#/components/schemas/VaultAccountsPagedResponse'
  '/vault/accounts/{vaultAccountId}':
    get:
      summary: Returns a Fireblock Vault account by ID
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return
            type: string
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
      responses:
        '200':
          description: A Vault Account object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/VaultAccount'
        default:
          $ref: '#/components/responses/Error'
    put:
      summary: Edit a Fireblock Vault account
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to edit
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  description: Account Name
                  type: string
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/hide':
    post:
      summary: Hides a vault account on Fireblocks console
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The vault account to hide
          schema:
            type: string
            minimum: 1
            format: numeric
            x-fb-entity: vault_account
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/unhide':
    post:
      summary: Reveals a hidden vault account on Fireblocks console
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The vault account to unhide
          schema:
            type: string
            minimum: 1
            format: numeric
            x-fb-entity: vault_account
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  /vault/accounts/{vaultAccountId}/{assetId}/activate:
    post:
      summary: Activate a wallet in a Vault account
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return, or 'default' for the default vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateVaultAssetResponse'
        default:
          $ref: '#/components/responses/Error'
  /vault/accounts/{vaultAccountId}/{assetId}/lock_allocation:
    post:
      summary: Allocate funds to private ledger
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The vault account to allocate funds in
          schema:
            type: string
            minimum: 1
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The allocation asset id
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '200':
          description: A transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateTransactionResponse'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AllocateFundsRequest'
  /vault/accounts/{vaultAccountId}/{assetId}/release_allocation:
    post:
      summary: Deallocate funds from private ledger
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The vault account to allocate funds in
          schema:
            type: string
            minimum: 1
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The allocation asset id
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '200':
          description: A transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateTransactionResponse'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeallocateFundsRequest'
  '/vault/accounts/{vaultAccountId}/set_customer_ref_id':
    post:
      summary: Sets a reference customer ID for AML
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The vault account ID
          schema:
            type: string
            minimum: 1
            format: numeric
            x-fb-entity: vault_account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                customerRefId:
                  description: Customer reference ID
                  type: string
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/set_auto_fuel':
    post:
      summary: Sets the autoFuel property of the vault account to true or false
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The vault account ID
          schema:
            type: string
            minimum: 1
            format: numeric
            x-fb-entity: vault_account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                autoFuel:
                  description: Auto Fuel
                  type: boolean
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}':
    get:
      summary: Returns a wallet of a specific asset inside a Fireblocks Vault account
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: A VaultAsset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/VaultAsset'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Creates a new wallet in a Vault account
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return, or 'default' for the default vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      requestBody:
        required: false
        content:
          application/json:
            schema:
              properties:
                eosAccountName:
                  description: Optional - when creating an EOS wallet, the account name. If not provided, a random name will be generated
                  type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateVaultAssetResponse'
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/balance':
    post:
      summary: Update balance and returns a wallet of a specific asset inside a Fireblocks Vault account
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      requestBody:
        required: false
        content:
          '*/*':
            schema:
              type: object
      responses:
        '200':
          description: A VaultAsset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/VaultAsset'
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/addresses':
    get:
      summary: Returns all addresses generated for a Vault wallet
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: A list of deposit addresses
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VaultWalletAddress'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Generate a new deposit address for a Vault wallet
      tags:
        - Vaults
      requestBody:
        required: false
        content:
          application/json:
            schema:
              properties:
                description:
                  description: (Optional) Attach a description to the new address
                  type: string
                customerRefId:
                  description: >-
                    Optional - Sets a customer reference ID
                  type: string
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account to return
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: The created address
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateAddressResponse'
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/addresses/{addressId}':
    put:
      summary: Update the description of an existing address within a vault wallet
      tags:
        - Vaults
      requestBody:
        required: false
        content:
          application/json:
            schema:
              properties:
                description:
                  description: The address description
                  type: string
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
        - in: path
          name: addressId
          required: true
          description: >-
            The address for which to add a description. For XRP, use <address>:<tag>, for all other assets, use only the address
          schema:
            type: string
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/addresses/{addressId}/set_customer_ref_id':
    post:
      summary: Sets a reference customer ID for AML
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
        - in: path
          name: addressId
          required: true
          description: >-
            The address for which to add a description. For XRP, use <address>:<tag>, for all other assets, use only the address
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                customerRefId:
                  description: Customer reference ID
                  type: string
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/addresses/{addressId}/create_legacy':
    post:
      summary: Translates an existing segwit address to the legacy format
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
        - in: path
          name: addressId
          required: true
          description: >-
            The segwit address to translate
          schema:
            type: string
      responses:
        '200':
          description: The created address
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateAddressResponse'
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/unspent_inputs':
    get:
      summary: Gets UTXO unspent inputs information
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: >-
            The ID of the vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: List of Unspent information per input
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/unspentInputsData'
        default:
          $ref: '#/components/responses/Error'
  '/vault/public_key_info/':
    get:
      summary: Gets the public key information based on derivationPath and signing algorithm
      tags:
        - Vaults
      parameters:
        - in: query
          name: derivationPath
          required: true
          schema:
            type: string
        - in: query
          name: algorithm
          required: true
          schema:
            type: string
        - in: query
          name: compressed
          schema:
            type: boolean
      responses:
        '200':
          description: Public key information
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicKeyInformation'
        default:
          $ref: '#/components/responses/Error'
  '/vault/accounts/{vaultAccountId}/{assetId}/{change}/{addressIndex}/public_key_info':
    get:
      summary: Gets the public key information for vault account
      tags:
        - Vaults
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          schema:
            type: string
            x-fb-entity: asset
        - in: path
          name: change
          required: true
          schema:
            type: number
        - in: path
          name: addressIndex
          required: true
          schema:
            type: number
        - in: query
          name: compressed
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Public Key Information
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicKeyInformation'
        default:
          $ref: '#/components/responses/Error'
  '/vault/assets':
    get:
      summary: Gets the assets amount summary for all \ filtered accounts.
      tags:
        - Vaults
      parameters:
        - in: query
          name: accountNamePrefix
          required: false
          schema:
            type: string
        - in: query
          name: accountNameSuffix
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Amount by asset
          content:
            '*/*':
              schema:
                  type: array
                  items:
                    $ref: '#/components/schemas/VaultAsset'
        default:
          $ref: '#/components/responses/Error'
  '/vault/assets/{assetId}':
    get:
      summary: Gets vault balance summary by asset.
      tags:
        - Vaults
      parameters:
        - in: path
          name: assetId
          required: true
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: Vault amount by asset
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/VaultAsset'
        default:
          $ref: '#/components/responses/Error'
  #  INTERNAL WALLETS
  /internal_wallets:
    get:
      summary: List internal wallets
      description: Gets a list of internal wallets.
      responses:
        '200':
          description: A list of internal wallets
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Create an internal wallet
      description: Creates a new internal wallet with the requested name.
      responses:
        '200':
          description: A new wallet object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                  description: the wallet's display name
                customerRefId:
                  description: >-
                    Optional - Sets a customer reference ID
                  type: string
  '/internal_wallets/{walletId}':
    get:
      summary: Get assets for internal wallet
      description: Returns all assets in an internal wallet by ID.
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A Wallet object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
    delete:
      summary: Delete an internal wallet
      description: Deletes an internal wallet by ID.
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet to delete
          schema:
            type: string
            minimum: 1
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/internal_wallets/{walletId}/set_customer_ref_id':
    post:
      summary: Set an AML/KYT customer reference ID for an internal wallet
      description: Sets an AML/KYT customer reference ID for the specific internal wallet.
      parameters:
        - in: path
          name: walletId
          required: true
          description: The wallet ID
          schema:
            type: string
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                customerRefId:
                  description: Customer reference ID
                  type: string
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/internal_wallets/{walletId}/{assetId}':
    get:
      summary: Get an asset from an internal wallet
      description: Returns information for an asset in an internal wallet.
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to return
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '200':
          description: A Wallet Asset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/WalletAsset'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Add an asset to an internal wallet
      description: Adds an asset to an existing internal wallet.
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet
          schema:
            type: string
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to add
          schema:
            type: string
      responses:
        '200':
          description: A Wallet Asset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/WalletAsset'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                address:
                  type: string
                  description: The wallet's address or, for EOS wallets, the account name
                tag:
                  type: string
                  description: for XRP wallets, the destination tag; for EOS, the memo; for the fiat providers (Signet by Signature, SEN by Silvergate, or BLINC by BCB Group), the Bank Transfer Description
              required:
                - address
    delete:
      summary: Delete a whitelisted address from an internal wallet
      description: Deletes a whitelisted address (for an asset) from an internal wallet.
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to delete
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  # EXTERNAL WALLETS
  /external_wallets:
    get:
      summary: Gets a list of external wallets under the tenant
      tags:
        - External wallets
      responses:
        '200':
          description: A list of external wallets
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Creates a new external wallet
      tags:
        - External wallets
      responses:
        '200':
          description: A Wallet object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                  description: the wallet's display name
                customerRefId:
                  description: >-
                    Optional - Sets a customer reference ID
                  type: string
  '/external_wallets/{walletId}':
    get:
      summary: Returns an external wallet by ID
      tags:
        - External wallets
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A Wallet object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
    delete:
      summary: Deletes an external wallet by ID
      tags:
        - External wallets
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet to delete
          schema:
            type: string
            minimum: 1
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/external_wallets/{walletId}/set_customer_ref_id':
    post:
      summary: Sets a reference customer ID for AML
      tags:
        - External wallets
      parameters:
        - in: path
          name: walletId
          required: true
          description: The wallet ID
          schema:
            type: string
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                customerRefId:
                  description: Customer reference ID
                  type: string
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/external_wallets/{walletId}/{assetId}':
    get:
      summary: Returns an external wallet asset by ID
      tags:
        - External wallets
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to return
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '200':
          description: A Wallet Asset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalWalletAsset'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Adds an asset to an existing external wallet
      tags:
        - External wallets
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet
          schema:
            type: string
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to add
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: A Wallet Asset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalWalletAsset'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                address:
                  type: string
                  description: The wallet's address (or xpub) of the wallet
                tag:
                  type: string
                  description: For XRP wallets, the destination tag; for EOS/XLM, the memo; for the fiat providers (Signet by Signature, SEN by Silvergate, or BLINC by BCB Group), the Bank Transfer Description
              required:
                - address
    delete:
      summary: Deletes an external wallet asset by ID
      tags:
        - External wallets
      parameters:
        - in: path
          name: walletId
          required: true
          description: The ID of the wallet
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to delete
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  # CONTRACTS
  /contracts:
    get:
      summary: Gets a list of contracts under the tenant
      tags:
        - Contracts
      responses:
        '200':
          description: A list of contracts
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Creates a new contract
      tags:
        - Contracts
      responses:
        '200':
          description: A Wallet object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                  description: the contract's display name
  '/contracts/{contractId}':
    get:
      summary: Returns a contract by ID
      tags:
        - Contracts
      parameters:
        - in: path
          name: contractId
          required: true
          description: The ID of the contract to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A Wallet object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnmanagedWallet'
        default:
          $ref: '#/components/responses/Error'
    delete:
      summary: Deletes a contract by ID
      tags:
        - Contracts
      parameters:
        - in: path
          name: contractId
          required: true
          description: The ID of the contract to delete
          schema:
            type: string
            minimum: 1
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/contracts/{contractId}/{assetId}':
    get:
      summary: Returns a contract asset by ID
      tags:
        - Contracts
      parameters:
        - in: path
          name: contractId
          required: true
          description: The ID of the contract
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to return
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '200':
          description: A Wallet Asset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalWalletAsset'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Adds an asset to an existing contract
      tags:
        - Contracts
      parameters:
        - in: path
          name: contractId
          required: true
          description: The ID of the contract
          schema:
            type: string
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to add
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: A Wallet Asset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalWalletAsset'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                address:
                  type: string
                  description: The contract's address (or xpub) of the wallet
                tag:
                  type: string
                  description: The destination tag, for XRP wallets
              required:
                - address
    delete:
      summary: Deletes a contract asset by ID
      tags:
        - Contracts
      parameters:
        - in: path
          name: contractId
          required: true
          description: The ID of the contract
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to delete
          schema:
            type: string
            minimum: 1
            x-fb-entity: asset
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  # EXCHANGE ACCOUNTS
  /exchange_accounts:
    get:
      summary: Returns all exchange accounts
      tags:
        - Exchange accounts
      responses:
        '200':
          description: An ExchangeAccount object
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExchangeAccount'
        default:
          $ref: '#/components/responses/Error'
  '/exchange_accounts/{exchangeAccountId}':
    get:
      summary: Returns an exchange account by ID
      tags:
        - Exchange accounts
      parameters:
        - in: path
          name: exchangeAccountId
          required: true
          description: The ID of the exchange account to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: An ExchangeAccount object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExchangeAccount'
        default:
          $ref: '#/components/responses/Error'
  '/exchange_accounts/{exchangeAccountId}/internal_transfer':
    post:
      summary: Transfers funds between trading accounts under the same exchange account
      tags:
        - Exchange accounts
      parameters:
        - in: path
          name: exchangeAccountId
          required: true
          description: The ID of the exchange account to return
          schema:
            type: string
            minimum: 1
      responses:
        '201':
          description: Transfer succeeded
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                asset:
                  type: string
                amount:
                  type: string
                sourceType:
                  $ref: '#/components/schemas/TradingAccountType'
                destType:
                  $ref: '#/components/schemas/TradingAccountType'
  '/exchange_accounts/{exchangeAccountId}/convert':
    post:
      summary: Convert exchange account funds from the source asset to the destination asset. Coinbase (USD to USDC, USDC to USD) and Bitso (MXN to USD) are supported conversions.
      tags:
        - Exchange accounts
      parameters:
        - in: path
          name: exchangeAccountId
          required: true
          description: The ID of the exchange account. Please make sure the exchange supports conversions. To find the ID of your exchange account, use GET/exchange_accounts.
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: Conversion successful
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                srcAsset:
                  type: string
                  description: Name of the source asset (must be in a currency that is supported for conversions in the selected exchange type that corresponds to your exchange ID)
                destAsset:
                  type: string
                  description: Name of the destination asset (must be in a currency that is supported for conversions in the selected exchange type that corresponds to your exchange ID)
                amount:
                  type: number
                  description: The amount to transfer (in the currency of the source asset)
              required:
                - srcAsset
                - destAsset
                - amount
  '/exchange_accounts/{exchangeAccountId}/{assetId}':
    get:
      summary: Returns a single asset within an exchange account
      tags:
        - Exchange accounts
      parameters:
        - in: path
          name: exchangeAccountId
          required: true
          description: The ID of the exchange account to return
          schema:
            type: string
            minimum: 1
        - in: path
          name: assetId
          required: true
          description: The ID of the asset to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: An ExchangeAccountAsset object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExchangeAsset'
        default:
          $ref: '#/components/responses/Error'
  # FIAT ACCOUNTS
  /fiat_accounts:
    get:
      summary: Returns all fiat accounts
      tags:
        - Fiat accounts
      responses:
        '200':
          description: A fiat account object
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FiatAccount'
        default:
          $ref: '#/components/responses/Error'
  '/fiat_accounts/{accountId}':
    get:
      summary: Returns a fiat account by ID
      tags:
        - Fiat accounts
      parameters:
        - in: path
          name: accountId
          required: true
          description: The ID of the fiat account to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A fiat account object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/FiatAccount'
        default:
          $ref: '#/components/responses/Error'
  '/fiat_accounts/{accountId}/redeem_to_linked_dda':
    post:
      summary: Redeem funds to DDA
      tags:
        - Fiat accounts
      parameters:
        - in: path
          name: accountId
          required: true
          description: The ID of the fiat account to use
          schema:
            type: string
            minimum: 1
      responses:
        '201':
          description: Transfer succeeded
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                amount:
                  type: number
  '/fiat_accounts/{accountId}/deposit_from_linked_dda':
    post:
      summary: Deposit funds from DDA
      tags:
        - Fiat accounts
      parameters:
        - in: path
          name: accountId
          required: true
          description: The ID of the fiat account to use
          schema:
            type: string
            minimum: 1
      responses:
        '201':
          description: Transfer succeeded
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                amount:
                  type: number
  # TRANSACTIONS
  /transactions:
    get:
      summary: Gets a list of transactions under the tenant
      tags:
        - Transactions
      parameters:
        - in: query
          name: before
          description: >-
            Unix timestamp in milliseconds. Returns only transactions created before the
            specified date
          required: false
          schema:
            type: string
        - in: query
          name: after
          description: >-
            Unix timestamp in milliseconds. Returns only transactions created after the
            specified date
          required: false
          schema:
            type: string
        - in: query
          name: status
          description: >-
            Comma-separated list of statuses. Returns only transactions with
            one of the specified statuses
          required: false
          schema:
            type: string
        - in: query
          name: orderBy
          description: The field to order the results by
          required: false
          schema:
            type: string
            enum:
              - createdAt
              - lastUpdated
        - in: query
          name: sort
          description: The direction to order the results by
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
        - in: query
          name: limit
          description: >-
            Limits the number of results. If not provided, a limit of 200 will be used. The maximum allowed limit is 500
          required: false
          schema:
            type: integer
            minimum: 1
            default: 200
        - in: query
          name: sourceType
          description: The source type of the transaction
          required: false
          schema:
            type: string
            enum:
              - VAULT_ACCOUNT
              - EXCHANGE_ACCOUNT
              - INTERNAL_WALLET
              - EXTERNAL_WALLET
              - FIAT_ACCOUNT
              - NETWORK_CONNECTION
              - COMPOUND
              - UNKNOWN
              - GAS_STATION
              - OEC_PARTNER
        - in: query
          name: sourceId
          description: The source ID of the transaction
          required: false
          schema:
            type: string
        - in: query
          name: destType
          description: The destination type of the transaction
          required: false
          schema:
            type: string
            enum:
              - VAULT_ACCOUNT
              - EXCHANGE_ACCOUNT
              - INTERNAL_WALLET
              - EXTERNAL_WALLET
              - FIAT_ACCOUNT
              - NETWORK_CONNECTION
              - COMPOUND
              - ONE_TIME_ADDRESS
              - OEC_PARTNER
        - in: query
          name: destId
          description: The destination ID of the transaction
          required: false
          schema:
            type: string
        - in: query
          name: assets
          description: A list of assets to filter by, seperated by commas
          required: false
          schema:
            type: string
        - in: query
          name: txHash
          description: Returns only results with a specified txHash
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A list of transactions
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransactionResponse'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Creates a new transaction
      tags:
        - Transactions
      responses:
        '200':
          description: A transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateTransactionResponse'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRequest'
  '/transactions/estimate_fee':
    post:
      summary: >-
        Estimates the transaction fee for a given transaction request
      tags:
        - Transactions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRequest'
      responses:
        '200':
          description: Estimated fees respose
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EstimatedTransactionFeeResponse'
        default:
          $ref: '#/components/responses/Error'
  '/transactions/{txId}':
    get:
      summary: Returns a transaction by ID
      tags:
        - Transactions
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: An Transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        default:
          $ref: '#/components/responses/Error'
  '/transactions/external_tx_id/{externalTxId}/':
    get:
      summary: Returns transaction by external transaction ID
      tags:
        - Transactions
      parameters:
        - in: path
          name: externalTxId
          required: true
          description: The external ID of the transaction to return
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: An Transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        default:
          $ref: '#/components/responses/Error'
  '/transactions/{txId}/set_confirmation_threshold':
    post:
      summary: Overrides the required number of confirmations for a transaction completion by transaction ID
      tags:
        - Transactions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetConfirmationsThresholdRequest'
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: Set successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SetConfirmationsThresholdResponse'
        default:
          $ref: '#/components/responses/Error'
  '/transactions/{txId}/drop':
    post:
      summary: Drop ETH based transaction by ID
      tags:
        - Transactions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DropTransactionRequest'
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: Created successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DropTransactionResponse'
        default:
          $ref: '#/components/responses/Error'
  '/transactions/{txId}/cancel':
    post:
      summary: Cancels a transaction by ID
      tags:
        - Transactions
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction to cancel
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: An Transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CancelTransactionResponse'
        default:
          $ref: '#/components/responses/Error'
  '/transactions/{txId}/freeze':
    post:
      summary: Freezes a transaction by ID
      tags:
        - Transactions
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction to freeze
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: freeze response
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/FreezeTransactionResponse'
  '/transactions/{txId}/unfreeze':
    post:
      summary: Unfreezes a transaction by ID
      tags:
        - Transactions
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction to unfreeze
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: Unfreeze response
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UnfreezeTransactionResponse'
  '/transactions/validate_address/{assetId}/{address}':
    get:
      summary: Check if given address is valid
      tags:
        - Transactions
      parameters:
        - in: path
          name: assetId
          required: true
          description: The asset of the address
          schema:
            type: string
            x-fb-entity: asset
        - in: path
          name: address
          required: true
          description: The address to validate
          schema:
            type: string
      responses:
        '200':
          description: An Transaction object
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ValidateAddressResponse'
        default:
          $ref: '#/components/responses/Error'
  # TXHASH
  '/txHash/{txHash}/set_confirmation_threshold':
    post:
      summary: Overrides the required number of confirmations for a transaction completion by its TxHash
      tags:
        - Transactions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetConfirmationsThresholdRequest'
      parameters:
        - in: path
          name: txHash
          required: true
          description: The TxHash
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A list of transactions affected by the change
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SetConfirmationsThresholdResponse'
        default:
          $ref: '#/components/responses/Error'
  # SUPPORTED ASSETS
  '/supported_assets':
    get:
      summary: Returns all asset types supported by Fireblocks
      tags:
        - Supported assets
      responses:
        '200':
          description: A Transaction object
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssetTypeResponse'
        default:
          $ref: '#/components/responses/Error'
  # NETWORK CONNECTIONS
  '/network_connections':
    get:
      summary: Returns all network connections
      tags:
        - Network connections
      responses:
        '200':
          description: A list of network connections
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NetworkConnectionResponse'
        default:
          $ref: '#/components/responses/Error'
  '/network_connections/{connectionId}':
    get:
      summary: Gets a network connection by ID
      tags:
        - Network connections
      parameters:
        - in: path
          name: connectionId
          required: true
          description: The ID of the connection
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A network connection
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/NetworkConnectionResponse'
        default:
          $ref: '#/components/responses/Error'
  # TRANSFER TICKETS
  '/transfer_tickets':
    get:
      summary: Gets a list of transfer tickets
      tags:
        - Transfer tickets
      responses:
        '200':
          description: A list of transafer tickets
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TransferTicketResponse'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Creates a new transfer ticket
      tags:
        - Transfer tickets
      responses:
        '200':
          description: A transfer object with ticket id
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateTransferTicketResponse'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                terms:
                  type: array
                  items:
                    $ref: '#/components/schemas/Term'
                externalTicketId:
                  type: string
                description:
                  type: string
              required:
                - terms
  '/transfer_tickets/{ticketId}':
    get:
      summary: Get a specific ticket by ticket ID
      tags:
        - Transfer tickets
      parameters:
        - in: path
          name: ticketId
          required: true
          description: The ID of the ticket
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A transfer ticket
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransferTicketResponse'
        default:
          $ref: '#/components/responses/Error'
  /transfer_tickets/{ticketId}/cancel:
    post:
      summary: Cancel a transfer request
      tags:
        - Transfer tickets
      parameters:
        - in: path
          name: ticketId
          required: true
          description: The ID of the ticket
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/transfer_tickets/{ticketId}/{termId}':
    get:
      summary: Get a term by ticket ID and term ID
      tags:
        - Transfer tickets
      parameters:
        - in: path
          name: ticketId
          required: true
          description: The ID of the ticket
          schema:
            type: string
            minimum: 1
        - in: path
          name: termId
          required: true
          description: The ID of the term
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A term
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/TransferTicketTermResponse'
        default:
          $ref: '#/components/responses/Error'
  /transfer_tickets/{ticketId}/{termId}/transfer:
    post:
      summary: Triggers a transfer for a term in ticket
      tags:
        - Transfer tickets
      parameters:
        - in: path
          name: ticketId
          required: true
          description: The ID of the ticket
          schema:
            type: string
            minimum: 1
        - in: path
          name: termId
          required: true
          description: The ID of the term
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: OK
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        content:
          application/json:
            schema:
              properties:
                source:
                  $ref: '#/components/schemas/TransferPeerPath'
  # ESTIMATE NETWORK FEE
  '/estimate_network_fee':
    get:
      summary: >-
        Estimates the required fee for a given asset.
        For UTXO based assets, the response will contain the suggested fee per byte,
        for ETH/ETC based assets, the suggested gas price, and for XRP/XLM, the transaction fee
      tags:
        - Transactions
      parameters:
        - in: query
          name: assetId
          description: >-
            The asset for which to estimate the fee
          required: true
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: Estimated fees respose
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EstimatedNetworkFeeResponse'
        default:
          $ref: '#/components/responses/Error'
  '/gas_station':
    get:
      summary: >-
        Returns a summary of Gas Station configuration and balances for ETH.
      tags:
        - Gas stations
      responses:
        '200':
          description: Gas Station properties
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/GasStationPropertiesResponse'
        default:
          $ref: '#/components/responses/Error'
  '/gas_station/{assetId}':
    get:
      summary: >-
        Returns a summary of Gas Station configuration and balances for requested asset.
      tags:
        - Gas stations
      parameters:
        - in: path
          required: true
          name: assetId
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      responses:
        '200':
          description: Gas Station properties
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/GasStationPropertiesResponse'
        default:
          $ref: '#/components/responses/Error'
  '/gas_station/configuration':
    put:
      summary: >-
        Sets Gas Station configuration for ETH.
      tags:
        - Gas stations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GasStationConfiguration'
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  '/gas_station/configuration/{assetId}':
    put:
      summary: >-
        Sets Gas Station configuration for requested asset.
      tags:
        - Gas stations
      parameters:
        - in: path
          required: true
          name: assetId
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GasStationConfiguration'
      responses:
        '201':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  # WEBHOOKS
  '/webhooks/resend':
    post:
      summary: Resend failed webhooks
      tags:
        - Webhooks
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ResendWebhooksResponse'
        default:
          $ref: '#/components/responses/Error'
  '/webhooks/resend/{txId}':
    post:
      summary: Resend failed webhooks for transaction by ID
      tags:
        - Webhooks
      parameters:
        - in: path
          name: txId
          required: true
          description: The ID of the transaction for webhooks
          schema:
            type: string
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                resendCreated:
                  type: boolean
                resendStatusUpdated:
                  type: boolean
      responses:
        '200':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  # USERS
  '/users':
    get:
      summary: >-
        Returns a list of users
      tags:
        - Users
      responses:
        '200':
          description: List of users
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/GetUsersResponse'
        default:
          $ref: '#/components/responses/Error'
  # OFF EXCHANGE
  '/off_exchange_accounts':
    get:
      summary: Get off exchanges
      tags:
        - Off exchanges
      responses:
        '200':
          description: A list of off exchange entities
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OffExchangeEntityResponse'
        default:
          $ref: '#/components/responses/Error'
  '/off_exchange_accounts/{virtualAccountId}':
    get:
      summary: Get off exchange by it's ID
      tags:
        - Off exchanges
      parameters:
        - in: path
          name: virtualAccountId
          required: true
          description: The ID of the off exchange entity
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: An off exchange entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/OffExchangeEntityResponse'
        default:
          $ref: '#/components/responses/Error'
  '/off_exchange_accounts/{virtualAccountId}/settle':
    post:
      summary: Settle an off exchange entity
      tags:
        - Off exchanges
      parameters:
        - in: path
          name: virtualAccountId
          required: true
          description: The ID of the off exchange entity
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: A settle succeeded
        default:
          $ref: '#/components/responses/Error'
  '/audits':
    get:
      summary: Get audit logs
      parameters:
        - in: query
          name: timePeriod
          required: true
          description: The last time period to fetch audit logs
          schema:
            type: string
            enum:
              - DAY
              - WEEK
      responses:
        '200':
          description: Audit logs from requested time period
        default:
          $ref: '#/components/responses/Error'
  '/payments/payout/{payoutId}':
    get:
      summary: Get specific payout
      tags:
        - Payments
      parameters:
        - in: path
          name: payoutId
          required: true
          description: The ID of the payout
          schema:
            type: string
      responses:
        '200':
          description: Returns a payout
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Payout'
        default:
          $ref: '#/components/responses/Error'
    put:
      summary: Update payout status
      tags:
        - Payments
      parameters:
        - in: path
          name: payoutId
          required: true
          description: The ID of the payout request
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                status:
                  description: Payout request status
                  type: string
                  enum:
                  - SUBMITTED
                  - PROCESSING
                  - REJECTED
                  - COMPLETED
              required:
                - status
      responses:
        '200':
          description: Returns a payout
          content:
            'application/json':
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - SUBMITTED
                      - PROCESSING
                      - REJECTED
                      - COMPLETED
                  payoutId:
                    type: string
                required:
                  - status
                  - payoutId
        default:
          $ref: '#/components/responses/Error'
  '/payments/payout':
    get:
      summary: Get payouts
      tags:
        - Payments
      parameters:
        - in: query
          name: status
          required: false
          schema:
            type: string
            enum: ["SUBMITTED", "PROCESSING", "REJECTED", "COMPLETED"]
      responses:
        '200':
          description: Returns a list of payouts
          content:
            'application/json':
              schema:
                type: object
                properties:
                  payouts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payout'
                required:
                  - payouts
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Create a payout
      tags:
        - Payments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutResponse'
      responses:
        '200':
          description: Returns a payout
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/Payout'
        default:
          $ref: '#/components/responses/Error'
  # FEE PAYER
  '/fee_payer/{baseAsset}':
    get:
      summary: Get fee payer configuration
      tags:
        - Fee payer
      parameters:
        - in: path
          name: baseAsset
          required: true
          description: The ID of the base asset for fee payer configruation
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: Fee Payer Configuration
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/FeePayerResponse'
        default:
          $ref: '#/components/responses/Error'
    post:
      summary: Set Fee Payer configuration
      tags:
        - Fee payer
      parameters:
        - in: path
          name: baseAsset
          required: true
          description: The ID of the base asset for fee payer configruation
          schema:
            type: string
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetFeePayerConfiguration'
      responses:
        '200':
          description: Fee Payer Configuration
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/FeePayerResponse'
        default:
          $ref: '#/components/responses/Error'
    delete:
      summary: Remove fee payer configuration
      tags:
        - Fee payer
      parameters:
        - in: path
          name: baseAsset
          required: true
          description: The ID of the base asset for fee payer configruation
          schema:
            type: string
            minimum: 1
      responses:
        '200':
          description: Fee Payer Configuration
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RemoveFeePayerResponse'
        default:
          $ref: '#/components/responses/Error'

security:
  - bearerTokenAuth: [ ]
  - ApiKeyAuth: [ ]
components:
  responses:
    Error:
      description: Error Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  requestBodies:
    NewWallet:
      content:
        application/json:
          schema:
            properties:
              name:
                type: string
                description: the wallet's display name
    WalletAddressProperties:
      content:
        application/json:
          schema:
            properties:
              address:
                type: string
                description: The wallet's address (or xpub) of the wallet
  securitySchemes:
    bearerTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
  schemas:
    WalletAsset:
      type: object
      properties:
        id:
          type: string
        balance:
          type: string
        lockedAmount:
          type: string
        status:
          $ref: '#/components/schemas/ConfigChangeRequestStatus'
        address:
          type: string
        tag:
          type: string
        activationTime:
          type: string
    ExternalWalletAsset:
      type: object
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/ConfigChangeRequestStatus'
        address:
          type: string
        tag:
          type: string
        activationTime:
          type: string
    ExchangeAsset:
      type: object
      properties:
        id:
          type: string
        balance:
          type: string
        lockedAmount:
          type: string
        total:
          type: string
        available:
          type: string
    ExchangeTradingAccount:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/ExchangeAsset'
    FiatAsset:
      type: object
      properties:
        id:
          type: string
        balance:
          type: string
    CreateVaultAssetResponse:
      type: object
      properties:
        id:
          type: string
        address:
          type: string
        legacyAddress:
          type: string
        enterpriseAddress:
          type: string
        tag:
          type: string
        eosAccountName:
          type: string
        status:
          type: string
        activationTxId:
          type: string
    AllocatedBalance:
      type: object
      properties:
        allocationId:
          type: string
        thirdPartyAccountId:
          type: string
        affiliation:
          type: string
        virtualType:
          type: string
        total:
          type: string
        available:
          type: string
        pending:
          type: string
        frozen:
          type: string
        locked:
          type: string
        staked:
          type: string
    RewardsInfo:
      type: object
      properties:
        pendingRewards:
          description: Amount that is pending for rewards
          type: string
    VaultAsset:
      type: object
      properties:
        id:
          type: string
        total:
          description: The total wallet balance. In EOS this value includes the network balance, self staking and pending refund. For all other coins it is the balance as it appears on the blockchain.
          type: string
        balance:
          deprecated: true
          description: Deprecated - replaced by "total"
          type: string
        available:
          description: Funds available for transfer. Equals the blockchain balance minus any locked amounts
          type: string
        pending:
          description: The cumulative balance of all transactions pending to be cleared
          type: string
        frozen:
          description: The cumulative frozen balance
          type: string
        lockedAmount:
          description: Funds in outgoing transactions that are not yet published to the network
          type: string
        staked:
          description: Staked balance
          type: string
        maxBip44AddressIndexUsed:
          description: The maximum BIP44 index used in deriving addresses for this wallet
          type: number
        maxBip44ChangeAddressIndexUsed:
          description: The maximum BIP44 index used in deriving change addresses for this wallet
          type: number
        totalStakedCPU:
          type: number
          description: Deprecated
        totalStakedNetwork:
          type: string
          description: Deprecated
        selfStakedCPU:
          type: string
          description: Deprecated
        selfStakedNetwork:
          type: string
          description: Deprecated
        pendingRefundCPU:
          type: string
          description: Deprecated
        pendingRefundNetwork:
          type: string
          description: Deprecated
        blockHeight:
          type: string
        blockHash:
          type: string
        allocatedBalances:
          type: array
          items:
            $ref: '#/components/schemas/AllocatedBalance'
        rewardsInfo:
          $ref: '#/components/schemas/RewardsInfo'
    VaultWalletAddress:
      type: object
      properties:
        assetId:
          type: string
          x-fb-entity: asset
        address:
          type: string
        description:
          type: string
        tag:
          type: string
        type:
          type: string
        customerRefId:
          type: string
        addressFormat:
          type: string
          enum:
            - SEGWIT
            - LEGACY
        legacyAddress:
          type: string
        enterpriseAddress:
          type: string
        bip44AddressIndex:
          type: integer
    CreateAddressResponse:
      type: object
      properties:
        address:
          type: string
        legacyAddress:
          type: string
        enterpriseAddress:
          type: string
        tag:
          type: string
        bip44AddressIndex:
          type: integer
    VaultAccountsPagedResponse:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/VaultAccount'
        paging:
          type: object
          properties:
            before:
              type: string
            after:
              type: string
        previousUrl:
          type: string
        nextUrl:
          type: string
    VaultAccount:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/VaultAsset'
        hiddenOnUI:
          type: boolean
        customerRefId:
          type: string
        autoFuel:
          type: boolean
    UnmanagedWallet:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        customerRefId:
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/WalletAsset'
      required:
        - id
        - name
        - status
    ExchangeAccount:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/ExchangeType'
        name:
          type: string
          description: Display name of the exchange account
        status:
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/ExchangeAsset'
        tradingAccounts:
          type: array
          items:
            $ref: '#/components/schemas/ExchangeTradingAccount'
        isSubaccount:
          description: True if the account is a subaccount in an exchange
          type: boolean
        mainAccountId:
          description: if the account is a sub-account, the ID of the main account
          type: string
    FiatAccount:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/FiatAccountType'
        name:
          type: string
          description: Display name of the fiat account
        address:
          type: string
        assets:
          type: array
          items:
            $ref: '#/components/schemas/FiatAsset'
    OneTimeAddress:
      type: object
      properties:
        address:
          type: string
        tag:
          type: string
      required:
        - address
    TransferPeerPath:
      type: object
      properties:
        type:
          type: string
          enum:
            - VAULT_ACCOUNT
            - EXCHANGE_ACCOUNT
            - INTERNAL_WALLET
            - EXTERNAL_WALLET
            - NETWORK_CONNECTION
            - FIAT_ACCOUNT
            - COMPOUND
            - GAS_STATION
            - ONE_TIME_ADDRESS
            - UNKNOWN
        id:
          type: string
      required:
        - type
    DestinationTransferPeerPath:
      allOf:
        - $ref: '#/components/schemas/TransferPeerPath'
        - type: object
          properties:
            oneTimeAddress:
              $ref: '#/components/schemas/OneTimeAddress'
    CreateTransactionResponse:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
    CancelTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
    UnfreezeTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
    FreezeTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
    AmlScreeningResult:
      type: object
      properties:
        provider:
          type: string
        payload:
          type: object
    FeeInfo:
      type: object
      properties:
        networkFee:
          type: string
        serviceFee:
          type: string
        gasPrice:
          type: string
    BlockInfo:
      type: object
      properties:
        blockHeight:
          type: string
        blockHash:
          type: string
    AuthorizationInfo:
      type: object
      properties:
        allowOperatorAsAuthorizer:
          type: boolean
        logic:
          type: string
          enum:
            - AND
            - OR
        groups:
          type: array
          items:
            $ref: '#/components/schemas/AuthorizationGroups'
    AuthorizationGroups:
      type: object
      properties:
        th:
          type: number
        users:
          type: object
          additionalProperties:
            type: string
            enum:
              - PENDING_AUTHORIZATION
              - APPROVED
              - REJECTED
              - NA
    AmountInfo:
      type: object
      properties:
        amount:
          type: string
        requestedAmount:
          type: string
        netAmount:
          type: string
        amountUSD:
          type: string
    RewardInfo:
      type: object
      properties:
        srcRewards:
          type: string
        destRewards:
          type: string
    TransferPeerPathResponse:
      allOf:
        - $ref: '#/components/schemas/TransferPeerPath'
        - type: object
          properties:
            name:
              type: string
            subType:
              type: string
            virtualType:
              type: string
              enum:
                - OFF_EXCHANGE
                - DEFAULT
                - UNKNOWN
            virtualId:
              type: string
    TransactionResponse:
      type: object
      properties:
        id:
          type: string
        assetId:
          type: string
          x-fb-entity: asset
        source:
          $ref: '#/components/schemas/TransferPeerPathResponse'
        destination:
          $ref: '#/components/schemas/TransferPeerPathResponse'
        requestedAmount:
          description: The amount requested by the user
          type: number
        amount:
          description: If the transfer is a withdrawal from an exchange, the actual amount that was requested to be transferred. Otherwise, the requested amount
          type: number
        netAmount:
          description: The net amount of the transaction, after fee deduction
          type: number
        amountUSD:
          description: The USD value of the requested amount
          type: number
          nullable: true
        serviceFee:
          description: The total fee deducted by the exchange from the actual requested amount (serviceFee = amount - netAmount)
          type: number
        fee:
          description: Deprecated - replaced by "networkFee"
          type: number
          deprecated: true
        networkFee:
          description: The fee paid to the network
          type: number
        createdAt:
          type: number
          description: Unix timestamp
        lastUpdated:
          type: number
          description: Unix timestamp
        status:
          type: string
          enum:
            - SUBMITTED
            - PENDING_SIGNATURE
            - PENDING_AUTHORIZATION
            - COMPLETED
            - CONFIRMING
            - FAILED
            - REJECTED
            - CANCELLING
            - CANCELLED
            - BROADCASTING
            - BLOCKED
            - TIMEOUT
            - QUEUED
            - PENDING_3RD_PARTY
            - PENDING_3RD_PARTY_MANUAL_APPROVAL
            - PENDING_AML_SCREENING
            - PARTIALLY_COMPLETED
        txHash:
          type: string
        tag:
          type: string
        subStatus:
          $ref: '#/components/schemas/TransactionSubStatus'
        destinationAddress:
          type: string
        sourceAddress:
          type: string
        destinationAddressDescription:
          type: string
        destinationTag:
          type: string
        signedBy:
          type: array
          items:
            type: string
        createdBy:
          type: string
        rejectedBy:
          type: string
        addressType:
          type: string
        note:
          type: string
        exchangeTxId:
          type: string
        feeCurrency:
          type: string
        operation:
          $ref: '#/components/schemas/TransactionOperation'
        networkRecords:
          type: array
          items:
            $ref: '#/components/schemas/NetworkRecord'
        amlScreeningResult:
          $ref: '#/components/schemas/AmlScreeningResult'
        customerRefId:
          type: string
        numOfConfirmations:
          type: number
        amountInfo:
          $ref: '#/components/schemas/AmountInfo'
        feeInfo:
          $ref: '#/components/schemas/FeeInfo'
        signedMessages:
          type: array
          items:
            $ref: '#/components/schemas/SignedMessage'
        extraParameters:
          type: object
          properties: {}
        externalTxId:
          type: string
        destinations:
          type: array
          items:
            $ref: '#/components/schemas/TransactionResponseDestination'
        blockInfo:
          $ref: '#/components/schemas/BlockInfo'
        authorizationInfo:
          $ref: '#/components/schemas/AuthorizationInfo'
        index:
          type: number
        rewardInfo:
          $ref: '#/components/schemas/RewardInfo'
        feePayerInfo:
          type: object
          properties:
            feePayerAccountId:
              type: string
        treatAsGrossAmount:
          type: boolean
    TransactionResponseDestination:
      type: object
      properties:
        amount:
          type: string
        amountUSD:
          type: string
        amlScreeningResult:
          $ref: '#/components/schemas/AmlScreeningResult'
        destination:
          $ref: '#/components/schemas/TransferPeerPathResponse'
        authorizationInfo:
          $ref: '#/components/schemas/AuthorizationInfo'
    NetworkRecord:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/TransferPeerPathResponse'
        destination:
          $ref: '#/components/schemas/TransferPeerPathResponse'
        txHash:
          type: string
        networkFee:
          type: string
        assetId:
          type: string
          x-fb-entity: asset
        netAmount:
          description: The net amount of the transaction, after fee deduction
          type: string
        isDropped:
          type: boolean
        type:
          type: string
        destinationAddress:
          type: string
        sourceAddress:
          type: string
        amountUSD:
          type: string
        index:
          type: number
        rewardInfo:
          $ref: '#/components/schemas/RewardInfo'
    AssetTypeResponse:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
            - ALGO_ASSET
            - BASE_ASSET
            - BEP20
            - COMPOUND
            - ERC20
            - FIAT
            - SOL_ASSET
            - TRON_TRC20
            - XLM_ASSET
        contractAddress:
          type: string
        nativeAsset:
          type: string
        decimals:
          type: number
      required:
        - id
        - name
        - type
    NetworkConnectionResponse:
      type: object
      properties:
        id:
          type: string
        localChannel:
          $ref: '#/components/schemas/Channel'
        remoteChannel:
          $ref: '#/components/schemas/Channel'
      required:
        - id
        - localChannel
        - remoteChannel
    EstimatedTransactionFeeResponse:
      type: object
      properties:
        low:
          $ref: '#/components/schemas/TransactionFee'
        medium:
          $ref: '#/components/schemas/TransactionFee'
        high:
          $ref: '#/components/schemas/TransactionFee'
      required:
        - low
        - medium
        - high
    EstimatedNetworkFeeResponse:
      type: object
      properties:
        low:
          $ref: '#/components/schemas/NetworkFee'
        medium:
          $ref: '#/components/schemas/NetworkFee'
        high:
          $ref: '#/components/schemas/NetworkFee'
      required:
        - low
        - medium
        - high
    GasStationPropertiesResponse:
      type: object
      properties:
        balance:
          type: object
        configuration:
          $ref: '#/components/schemas/GasStationConfiguration'
      required:
        - low
        - medium
        - high
    TransactionFee:
      type: object
      properties:
        feePerByte:
          type: string
        gasPrice:
          type: string
        gasLimit:
          type: string
        networkFee:
          type: string
        baseFee:
          description: (optional) Base Fee according to EIP-1559 (ETH assets)
          type: string
        priorityFee:
          description: (optional) Priority Fee according to EIP-1559 (ETH assets)
          type: string
    NetworkFee:
      type: object
      properties:
        feePerByte:
          type: string
        gasPrice:
          type: string
        networkFee:
          type: string
        baseFee:
          description: (optional) Base Fee according to EIP-1559 (ETH assets)
          type: string
        priorityFee:
          description: (optional) Priority Fee according to EIP-1559 (ETH assets)
          type: string
    GasStationConfiguration:
      type: object
      properties:
        gasThreshold:
          type: string
        gasCap:
          type: string
        maxGasPrice:
          type: string
    Channel:
      type: object
      properties:
        networkId:
          type: string
        name:
          type: string
    TransactionRequest:
      type: object
      properties:
        assetId:
          type: string
          x-fb-entity: asset
        source:
          $ref: '#/components/schemas/TransferPeerPath'
        destination:
          $ref: '#/components/schemas/DestinationTransferPeerPath'
        amount:
          oneOf:
            - type: number
            - type: string
        fee:
          description: >-
            - For BTC based assets, the fee per bytes in the asset's smallest unit (Satoshi/Latoshi etc.)

            - For XRP, the fee for the transaction
          oneOf:
            - type: number
            - type: string
        feeLevel:
          type: string
          enum:
            - LOW
            - MEDIUM
            - HIGH
        priorityFee:
          description: >-
            - For ETH based assets only, the fee for eip-1559 transaction pricing mechanism. Value is in gwei.
          oneOf:
            - type: number
            - type: string
        failOnLowFee:
          type: boolean
        maxFee:
          description: >-
            - For ETH based assets only, must be provided when using the priorityFee parameter. This will be used to limit the fee max possible fee (according to eip-1559). Value is in gwei.

            - For other assets, it fails a transaction when the automatically selected fee is higher than the provided value.
          type: string
        gasPrice:
          description: >-
            For ETH based asset only. this will be used instead of the fee property. Value is in gwei
          oneOf:
            - type: number
            - type: string
        gasLimit:
          oneOf:
            - type: number
            - type: string
        networkFee:
          oneOf:
            - type: number
            - type: string
        note:
          type: string
        autoStaking:
          type: boolean
        networkStaking:
          oneOf:
            - type: number
            - type: string
        cpuStaking:
          oneOf:
            - type: number
            - type: string
        extraParameters:
          type: object
          properties: {}
        operation:
          $ref: '#/components/schemas/TransactionOperation'
        customerRefId:
          type: string
        replaceTxByHash:
          type: string
        externalTxId:
          type: string
        destinations:
          type: array
          items:
            $ref: '#/components/schemas/TransactionRequestDestination'
        treatAsGrossAmount:
          type: boolean
        forceSweep:
          type: boolean
        feePayerInfo:
          type: object
          properties:
            feePayerAccountId:
              type: string
    TransactionRequestDestination:
      type: object
      properties:
        amount:
          type: string
        destination:
          $ref: '#/components/schemas/DestinationTransferPeerPath'
    ExchangeType:
      type: string
      enum:
      - BINANCE
      - BINANCEUS
      - BITFINEX
      - BITHUMB
      - BITMEX
      - BITSO
      - BITSTAMP
      - BITTREX
      - CIRCLE
      - COINBASEPRO
      - COINMETRO
      - COINSPRO
      - CRYPTOCOM
      - DERIBIT
      - FTX
      - FIXUS
      - GEMINI
      - HITBTC
      - HUOBI
      - KORBIT
      - KRAKEN
      - LIQUID
      - POLONIEX
      - OKCOIN
      - OKEX
      - SEEDCX
    FiatAccountType:
      type: string
      enum:
        - SIGNET
        - BLINC
        - SILVERGATE
    ConfigChangeRequestStatus:
      type: string
      enum:
        - WAITING_FOR_APPROVAL
        - APPROVED
        - CANCELLED
        - REJECTED
        - FAILED
    TransactionOperation:
      type: string
      enum:
        - TRANSFER
        - MINT
        - BURN
        - SUPPLY_TO_COMPOUND
        - REDEEM_FROM_COMPOUND
        - RAW
        - CONTRACT_CALL
        - INTERNAL_LEDGER_TRANSFER
        - TYPED_MESSAGE
      default: TRANSFER
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
    TransactionSubStatus:
      type: string
      enum:
        - INSUFFICIENT_FUNDS
        - AMOUNT_TOO_SMALL
        - UNSUPPORTED_ASSET
        - UNAUTHORISED__MISSING_PERMISSION
        - INVALID_SIGNATURE
        - API_INVALID_SIGNATURE
        - UNAUTHORISED__MISSING_CREDENTIALS
        - UNAUTHORISED__USER
        - UNAUTHORISED__DEVICE
        - INVALID_UNMANAGED_WALLET
        - INVALID_EXCHANGE_ACCOUNT
        - INSUFFICIENT_FUNDS_FOR_FEE
        - INVALID_ADDRESS
        - WITHDRAW_LIMIT
        - API_CALL_LIMIT
        - ADDRESS_NOT_WHITELISTED
        - TIMEOUT
        - CONNECTIVITY_ERROR
        - THIRD_PARTY_INTERNAL_ERROR
        - CANCELLED_EXTERNALLY
        - INVALID_THIRD_PARTY_RESPONSE
        - VAULT_WALLET_NOT_READY
        - MISSING_DEPOSIT_ADDRESS
        - ONE_TIME_ADDRESS_DISABLED
        - INTERNAL_ERROR
        - UNKNOWN_ERROR
        - AUTHORIZER_NOT_FOUND
        - INSUFFICIENT_RESERVED_FUNDING
        - MANUAL_DEPOSIT_ADDRESS_REQUIRED
        - INVALID_FEE
        - ERROR_UNSUPPORTED_TRANSACTION_TYPE
        - UNSUPPORTED_OPERATION
        - 3RD_PARTY_PROCESSING
        - PENDING_BLOCKCHAIN_CONFIRMATIONS
        - 3RD_PARTY_CONFIRMING
        - CONFIRMED
        - 3RD_PARTY_COMPLETED
        - CANCELLED_BY_USER
        - 3RD_PARTY_CANCELLED
        - 3RD_PARTY_REJECTED
        - AML_SCREENING_REJECTED
        - BLOCKED_BY_POLICY
        - FAILED_AML_SCREENING
        - PARTIALLY_FAILED
        - 3RD_PARTY_FAILED
        - ZERO_BALANCE_IN_PERMANENT_ADDRESS
        - GAS_PRICE_TOO_LOW_FOR_RBF
        - DROPPED_BY_BLOCKCHAIN
        - INVALID_FEE_PARAMS
        - MISSING_TAG_OR_MEMO
        - SIGNING_ERROR
        - GAS_LIMIT_TOO_LOW
        - TOO_MANY_INPUTS
        - MAX_FEE_EXCEEDED
        - ACTUAL_FEE_TOO_HIGH
        - INVALID_CONTRACT_CALL_DATA
        - INVALID_NONCE_TOO_LOW
        - INVALID_NONCE_TOO_HIGH
        - INVALID_NONCE_FOR_RBF
        - FAIL_ON_LOW_FEE
        - TOO_LONG_MEMPOOL_CHAIN
        - TX_OUTDATED
        - INCOMPLETE_USER_SETUP
        - SIGNER_NOT_FOUND
        - INVALID_TAG_OR_MEMO
        - NEED_MORE_TO_CREATE_DESTINATION
        - NON_EXISTING_ACCOUNT_NAME
        - ENV_UNSUPPORTED_ASSET
        - DEST_TYPE_NOT_SUPPORTED
      description: >
        - `INSUFFICIENT_FUNDS` - Not enough funds to fulfill the withdraw request

        - `AMOUNT_TOO_SMALL` - Attempt to withdraw an amount below the allowed minimum

        - `UNSUPPORTED_ASSET` - Asset is not supported

        - `UNAUTHORISED__MISSING_PERMISSION` - Third party (e.g. exchange) API missing permission

        - `INVALID_SIGNATURE` - Invalid transaction signature

        - `API_INVALID_SIGNATURE` - Third party (e.g. exchange) API call invalid signature

        - `UNAUTHORISED__MISSING_CREDENTIALS` - Missing third party (e.g. exchange) credentials

        - `UNAUTHORISED__USER` - Attempt to initiate or approve a transaction by an unauthorised user

        - `UNAUTHORISED__DEVICE` - Unauthorised user's device

        - `INVALID_UNMANAGED_WALLET` - Unmanaged wallet is disabled or does not exist

        - `INVALID_EXCHANGE_ACCOUNT` - Exchange account is disabled or does not exist

        - `INSUFFICIENT_FUNDS_FOR_FEE` - Not enough balance to fund the requested transaction

        - `INVALID_ADDRESS` - Unsupported address format

        - `WITHDRAW_LIMIT` - Transaction exceeds the exchange's withdraw limit

        - `API_CALL_LIMIT` - Exceeded third party (e.g. exchange) API call limit

        - `ADDRESS_NOT_WHITELISTED` - Attempt to withdraw from an exchange to a non whitelisted address

        - `TIMEOUT` - Request timeout

        - `CONNECTIVITY_ERROR` - Network error

        - `THIRD_PARTY_INTERNAL_ERROR` - Received an internal error response from a third party service

        - `CANCELLED_EXTERNALLY` - Transaction was canceled by a third party service

        - `INVALID_THIRD_PARTY_RESPONSE` - Unrecognized third party response

        - `VAULT_WALLET_NOT_READY` - Vault wallet is not ready

        - `MISSING_DEPOSIT_ADDRESS` - Could not retrieve a deposit address from the exchange

        - `INTERNAL_ERROR` - Internal error while processing the transaction

        - `UNKNOWN_ERROR` - Unexpected error

        - `AUTHORIZER_NOT_FOUND` - No authorizer found to approve the operation or the only authorizer found is the initiator

        - `INSUFFICIENT_RESERVED_FUNDING` - Some assets require a minimum of reserved funds being kept on the account

        - `MANUAL_DEPOSIT_ADDRESS_REQUIRED` - Error while retrieving a deposit address from an exchange. Please generate a deposit address for your exchange account

        - `INVALID_FEE` - Transaction fee is not in the allowed range

        - `ERROR_UNSUPPORTED_TRANSACTION_TYPE` - Attempt to execute an unsupported transaction type

        - `UNSUPPORTED_OPERATION` - Unsupported operation

        - `3RD_PARTY_PROCESSING` - The transaction is pending approval by the 3rd party service (e.g exchange)

        - `PENDING_BLOCKCHAIN_CONFIRMATIONS` - Pending Blockchain confirmations

        - `3RD_PARTY_CONFIRMING` - Pending confirmation on the exchange

        - `CONFIRMED` - Confirmed on the blockchain

        - `3RD_PARTY_COMPLETED` - Completed on the 3rd party service (e.g exchange)

        - `PENDING_BLOCKCHAIN_CONFIRMATIONSREJECTED_BY_USER` - The transaction was rejected by one of the signers

        - `CANCELLED_BY_USER` - The transaction was canceled via the Console or the API

        - `3RD_PARTY_CANCELLED` - Cancelled on the exchange

        - `3RD_PARTY_REJECTED` - Rejected or not approved in time by user

        - `AML_SCREENING_REJECTED` - Rejected on AML Screening

        - `BLOCKED_BY_POLICY` - Transaction is blocked due to a policy rule

        - `FAILED_AML_SCREENING` - AML Screening failed

        - `PARTIALLY_FAILED` - Only for Aggregated transactions. One or more of the associated transaction records failed

        - `3RD_PARTY_FAILED` - Transaction failed at the exchange

        - `ZERO_BALANCE_IN_PERMANENT_ADDRESS` - Not enough BTC balance to fund the requested transaction in legacy address

        - 'DROPPED_BY_BLOCKCHAIN' - The transaction was replaced by another transaction with higher fee

        - 'INVALID_FEE_PARAMS' - Fee parameters are inconsistent or unknown

        - 'MISSING_TAG_OR_MEMO' - A tag or memo is required to send funds to a third party address, including all exchanges

        - 'SIGNING_ERROR' - The transaction signing failed, resubmit the transaction to sign again

        - 'GAS_LIMIT_TOO_LOW' - The transaction was rejected because the gas limit was set too low

        -  'MAX_FEE_EXCEEDED' - Gas price is currently above selected max fee

        - 'ACTUAL_FEE_TOO_HIGH' - Chosen fee is below current price

        - 'INVALID_CONTRACT_CALL_DATA' - Transaction data was not encoded properly

        - 'INVALID_NONCE_TOO_LOW' - Illegal nonce

        - 'INVALID_NONCE_TOO_HIGH' - Illegal nonce

        - 'INVALID_NONCE_FOR_RBF' - No matching nonce

        - 'FAIL_ON_LOW_FEE' - Current blockchain fee is higher than selected

        - 'TOO_LONG_MEMPOOL_CHAIN' - Too many unconfirmed transactions from this address

        - 'TX_OUTDATED' - Nonce already used

        - 'INCOMPLETE_USER_SETUP' - MPC setup was not completed

        - 'SIGNER_NOT_FOUND' - Signer not found

        - 'INVALID_TAG_OR_MEMO' - Invalid Tag or Memo

        - 'ZERO_BALANCE_IN_PERMANENT_ADDRESS' - Not enough BTC on legacy permanent address

        - 'NEED_MORE_TO_CREATE_DESTINATION' - Insufficient funds for creating destination account

        - 'NON_EXISTING_ACCOUNT_NAME' - Account does not exist

        - 'ENV_UNSUPPORTED_ASSET' - Asset is not supported under this workspace settings
        
        - 'DEST_TYPE_NOT_SUPPORTED' - Withdrawal from this third party account to this destination is not supported. This sub-status appears for withdrawals from a Paxos exchange account to a one-time address
    TransferTicketTermResponse:
      type: object
      properties:
        termId:
          type: string
        networkConnectionId:
          type: string
        outgoing:
          type: boolean
        asset:
          type: string
        amount:
          type: string
        txIds:
          type: array
          items:
            type: string
        operation:
          type: string
        status:
          type: string
          enum:
            - OPEN
            - FULFILLED
        note:
          type: string
    CreateTransferTicketResponse:
      type: object
      properties:
        ticketId:
          type: string
    TransferTicketResponse:
      type: object
      properties:
        ticketId:
          type: string
        externalTicketId:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - OPEN
            - PARTIALLY_FULFILLED
            - FULFILLED
            - FAILED
            - CANCELED
        terms:
          type: array
          items:
            $ref: '#/components/schemas/TransferTicketTermResponse'
    Term:
      type: object
      properties:
        networkConnectionId:
          type: string
        outgoing:
          type: boolean
        asset:
          type: string
        amount:
          type: string
        note:
          type: string
        operation:
          type: string
    SetConfirmationsThresholdRequest:
      type: object
      properties:
        numOfConfirmations:
          type: number
    SetConfirmationsThresholdResponse:
      type: object
      properties:
        success:
          type: boolean
        transactions:
          type: array
          items:
            type: string
    DropTransactionRequest:
      type: object
      properties:
        txId:
          type: string
        feeLevel:
          type: string
        gasPrice:
          type: string
    DropTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
        transactions:
          type: array
          items:
            type: string
    UnsignedMessage:
      type: object
      properties:
        content:
          type: string
        bip44addressIndex:
          type: integer
        bip44change:
          type: number
        derivationPath:
          type: array
          items:
            type: number
      required:
        - content
    SignedMessage:
      type: object
      properties:
        content:
          type: string
        algorithm:
          type: string
          enum:
            - MPC_ECDSA_SECP256K1
            - MPC_ECDSA_SECP256R1
            - MPC_EDDSA_ED25519
        derivationPath:
          type: array
          items:
            type: number
        signature:
          type: object
          properties:
            fullSig:
              type: string
            r:
              type: string
            s:
              type: string
            v:
              type: number
        publicKey:
          type: string
    PublicKeyInformation:
      type: object
      properties:
        algorithm:
          type: string
        derivationPath:
          type: array
          items:
            type: number
        publicKey:
          type: string
    TradingAccountType:
      type: string
      enum:
        - COIN_FUTURES
        - COIN_MARGINED_SWAP
        - EXCHANGE
        - FUNDING
        - FUNDABLE
        - FUTURES
        - FUTURES_CROSS
        - MARGIN
        - MARGIN_CROSS
        - OPTIONS
        - SPOT
        - USDT_MARGINED_SWAP_CROSS
        - USDT_FUTURES
        - UNIFIED
    ValidateAddressResponse:
      type: object
      properties:
        isValid:
          type: boolean
        isActive:
          type: boolean
        requiresTag:
          type: boolean
    AllocateFundsRequest:
      type: object
      properties:
        allocationId:
          type: string
        amount:
          type: string
        treatAsGrossAmount:
          type: boolean
    DeallocateFundsRequest:
      type: object
      properties:
        allocationId:
          type: string
        amount:
          type: string
    ResendWebhooksResponse:
      type: object
      properties:
        webhooksCount:
          type: number
    OffExchangeEntityResponse:
      type: object
      properties:
        id:
          type: string
        vaultAccountId:
          type: string
        thirdPartyAccountId:
          type: string
        balance:
          type: object
          additionalProperties:
            type: object
            properties:
              total:
                type: string
              locked:
                type: string
              pending:
                type: string
              frozen:
                type: string
    unspentInputsData:
      type: object
      properties:
        input:
          type: string
        address:
          type: string
        amount:
          type: string
        confirmations:
          type: number
        status:
          type: string
    GetUsersResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/UserResponse'
    UserResponse:
      type: object
      properties:
        id:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        role:
          type: string
        email:
          type: string
        enabled:
          type: boolean
    Payout:
      type: object
      properties:
        id:
          type: string
        asset:
          type: string
        status:
          type: string
          enum:
          - SUBMITTED
          - PROCESSING
          - REJECTED
          - COMPLETED
        instructions:
          type: array
          items:
            $ref: '#/components/schemas/PayoutInstruction'
      required:
        - asset
        - instructions
    PayoutInstruction:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - SUBMITTED
            - PROCESSING
            - REJECTED
            - COMPLETED
        displayName:
          type: string
        legalName:
          type: string
        legalEntityId:
          type: string
        mcc:
          type: string
        address1:
          type: string
        address2:
          type: string
        country:
          type: string
        state:
          type: string
        zipCode:
          type: string
        email:
          type: string
        phoneNumber:
          type: string
        bankName:
          type: string
        bankCountry:
          type: string
        bankState:
          type: string
        bankAccountNumber:
          type: string
        bankSecondaryNumber:
          type: string
        amount:
          type: string
        description:
          type: string
      required:
        - displayName
        - legalName
        - legalEntityId
        - bankName
        - bankCountry
        - bankState
        - bankAccountNumber
        - bankSecondaryNumber
        - amount
        - description
    PayoutResponse:
      type: object
      properties:
        payouts:
          type: array
          items:
            $ref: '#/components/schemas/Payout'

    FeePayerResponse:
      type: object
      properties:
        feePayerAccountId:
          type: string
    SetFeePayerConfiguration:
      type: object
      properties:
        feePayerAccountId:
          type: string
    RemoveFeePayerResponse:
      type: object
      properties:
        baseAssetId:
          type: string
          x-fb-entity: asset

@jamietanna
Copy link
Collaborator Author

FYI of my initial spec, it appears that when removing the enum portion, we get the below generated:

type GetHealthcheckResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Health *string `json:"health,omitempty"`
	}
}

So looks like this could be the way that enums are not generated for anonymous objects may be at fault here.

jamietanna pushed a commit that referenced this issue Nov 23, 2022
Previously, there was no way to render any anonymous types that are
referenced in the `paths` of an OpenAPI specification.

Although there is a strong preference in the community to use the
`/components/schemas/`, there are times that it's out of our control to
move objects around.

Closes #626.
jamietanna pushed a commit to jamietanna/oapi-codegen that referenced this issue Nov 23, 2022
Previously, there was no way to render any anonymous types that are
referenced in the `paths` of an OpenAPI specification.

Although there is a strong preference in the community to use the
`/components/schemas/`, there are times that it's out of our control to
move objects around.

Closes deepmap#626.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants