# Flex

## Create RPC Node Flex

`$ nirvana rpc-nodes:flex create`

**post** `/v1/rpc_nodes/flex`

Create a new RPC Node Flex

### Parameters

- `--blockchain: string`

  Blockchain.

- `--name: string`

  Name of the RPC Node Flex.

- `--network: string`

  Network type (e.g., mainnet, testnet).

- `--project-id: string`

  Project ID to associate with the RPC Node Flex.

- `--tag: optional array of string`

  Tags to attach to the RPC Node Flex (optional, max 50).

### Returns

- `flex: object { id, blockchain, created_at, 6 more }`

  RPC Node Flex details.

  - `id: string`

    Unique identifier for the RPC Node Flex.

  - `blockchain: string`

    Blockchain type.

  - `created_at: string`

    When the RPC Node Flex was created.

  - `endpoint: string`

    RPC endpoint URL.

  - `name: string`

    Name of the RPC Node Flex.

  - `network: string`

    Network type (e.g., mainnet, testnet).

  - `project_id: string`

    Project identifier associated with the RPC Node Flex.

  - `tags: array of string`

    Tags to attach to the RPC Node Flex.

  - `updated_at: string`

    When the RPC Node Flex was updated.

### Example

```cli
nirvana rpc-nodes:flex create \
  --api-key 'My API Key' \
  --blockchain ethereum \
  --name my-ethereum-node \
  --network mainnet \
  --project-id 123e4567-e89b-12d3-a456-426614174000
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "blockchain": "ethereum",
  "created_at": "2025-01-01T00:00:00Z",
  "endpoint": "https://ethereum-mainnet.nirvanalabs.xyz/my-ethereum-node-abc12?apikey=apiKey",
  "name": "my-ethereum-node",
  "network": "mainnet",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Get RPC Node Flex Details

`$ nirvana rpc-nodes:flex get`

**get** `/v1/rpc_nodes/flex/{node_id}`

Get details about an RPC Node Flex

### Parameters

- `--node-id: string`

  Node ID

### Returns

- `flex: object { id, blockchain, created_at, 6 more }`

  RPC Node Flex details.

  - `id: string`

    Unique identifier for the RPC Node Flex.

  - `blockchain: string`

    Blockchain type.

  - `created_at: string`

    When the RPC Node Flex was created.

  - `endpoint: string`

    RPC endpoint URL.

  - `name: string`

    Name of the RPC Node Flex.

  - `network: string`

    Network type (e.g., mainnet, testnet).

  - `project_id: string`

    Project identifier associated with the RPC Node Flex.

  - `tags: array of string`

    Tags to attach to the RPC Node Flex.

  - `updated_at: string`

    When the RPC Node Flex was updated.

### Example

```cli
nirvana rpc-nodes:flex get \
  --api-key 'My API Key' \
  --node-id node_id
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "blockchain": "ethereum",
  "created_at": "2025-01-01T00:00:00Z",
  "endpoint": "https://ethereum-mainnet.nirvanalabs.xyz/my-ethereum-node-abc12?apikey=apiKey",
  "name": "my-ethereum-node",
  "network": "mainnet",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Update RPC Node Flex

`$ nirvana rpc-nodes:flex update`

**patch** `/v1/rpc_nodes/flex/{node_id}`

Update an existing RPC Node Flex

### Parameters

- `--node-id: string`

  Node ID

- `--name: optional string`

  Name of the RPC Node Flex.

- `--tag: optional array of string`

  Tags to attach to the RPC Node Flex (optional, max 50).

### Returns

- `flex: object { id, blockchain, created_at, 6 more }`

  RPC Node Flex details.

  - `id: string`

    Unique identifier for the RPC Node Flex.

  - `blockchain: string`

    Blockchain type.

  - `created_at: string`

    When the RPC Node Flex was created.

  - `endpoint: string`

    RPC endpoint URL.

  - `name: string`

    Name of the RPC Node Flex.

  - `network: string`

    Network type (e.g., mainnet, testnet).

  - `project_id: string`

    Project identifier associated with the RPC Node Flex.

  - `tags: array of string`

    Tags to attach to the RPC Node Flex.

  - `updated_at: string`

    When the RPC Node Flex was updated.

### Example

```cli
nirvana rpc-nodes:flex update \
  --api-key 'My API Key' \
  --node-id node_id
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "blockchain": "ethereum",
  "created_at": "2025-01-01T00:00:00Z",
  "endpoint": "https://ethereum-mainnet.nirvanalabs.xyz/my-ethereum-node-abc12?apikey=apiKey",
  "name": "my-ethereum-node",
  "network": "mainnet",
  "project_id": "123e4567-e89b-12d3-a456-426614174000",
  "tags": [
    "production",
    "ethereum"
  ],
  "updated_at": "2025-01-01T00:00:00Z"
}
```

## Delete RPC Node Flex

`$ nirvana rpc-nodes:flex delete`

**delete** `/v1/rpc_nodes/flex/{node_id}`

Delete an RPC Node Flex

### Parameters

- `--node-id: string`

  Node ID

### Example

```cli
nirvana rpc-nodes:flex delete \
  --api-key 'My API Key' \
  --node-id node_id
```

## List RPC Node Flex

`$ nirvana rpc-nodes:flex list`

**get** `/v1/rpc_nodes/flex`

List all RPC Node Flex you created

### Parameters

- `--project-id: string`

  Project ID of resources to request

- `--cursor: optional string`

  Pagination cursor returned by a previous request

- `--limit: optional number`

  Maximum number of items to return

### Returns

- `flex_list: object { items, pagination }`

  - `items: array of Flex`

    - `id: string`

      Unique identifier for the RPC Node Flex.

    - `blockchain: string`

      Blockchain type.

    - `created_at: string`

      When the RPC Node Flex was created.

    - `endpoint: string`

      RPC endpoint URL.

    - `name: string`

      Name of the RPC Node Flex.

    - `network: string`

      Network type (e.g., mainnet, testnet).

    - `project_id: string`

      Project identifier associated with the RPC Node Flex.

    - `tags: array of string`

      Tags to attach to the RPC Node Flex.

    - `updated_at: string`

      When the RPC Node Flex was updated.

  - `pagination: object { next_cursor, previous_cursor, total_count }`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Example

```cli
nirvana rpc-nodes:flex list \
  --api-key 'My API Key' \
  --project-id project_id
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "blockchain": "ethereum",
      "created_at": "2025-01-01T00:00:00Z",
      "endpoint": "https://ethereum-mainnet.nirvanalabs.xyz/my-ethereum-node-abc12?apikey=apiKey",
      "name": "my-ethereum-node",
      "network": "mainnet",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "tags": [
        "production",
        "ethereum"
      ],
      "updated_at": "2025-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```

## Domain Types

### Flex

- `flex: object { id, blockchain, created_at, 6 more }`

  RPC Node Flex details.

  - `id: string`

    Unique identifier for the RPC Node Flex.

  - `blockchain: string`

    Blockchain type.

  - `created_at: string`

    When the RPC Node Flex was created.

  - `endpoint: string`

    RPC endpoint URL.

  - `name: string`

    Name of the RPC Node Flex.

  - `network: string`

    Network type (e.g., mainnet, testnet).

  - `project_id: string`

    Project identifier associated with the RPC Node Flex.

  - `tags: array of string`

    Tags to attach to the RPC Node Flex.

  - `updated_at: string`

    When the RPC Node Flex was updated.

### Flex Blockchain

- `flex_blockchain: object { blockchain, network }`

  Blockchain supported by the RPC Node Flex.

  - `blockchain: string`

    Blockchain type.

  - `network: string`

    Network type (e.g., mainnet, testnet).

### Flex Blockchain List

- `flex_blockchain_list: object { items, pagination }`

  - `items: array of FlexBlockchain`

    - `blockchain: string`

      Blockchain type.

    - `network: string`

      Network type (e.g., mainnet, testnet).

  - `pagination: object { next_cursor, previous_cursor, total_count }`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Flex List

- `flex_list: object { items, pagination }`

  - `items: array of Flex`

    - `id: string`

      Unique identifier for the RPC Node Flex.

    - `blockchain: string`

      Blockchain type.

    - `created_at: string`

      When the RPC Node Flex was created.

    - `endpoint: string`

      RPC endpoint URL.

    - `name: string`

      Name of the RPC Node Flex.

    - `network: string`

      Network type (e.g., mainnet, testnet).

    - `project_id: string`

      Project identifier associated with the RPC Node Flex.

    - `tags: array of string`

      Tags to attach to the RPC Node Flex.

    - `updated_at: string`

      When the RPC Node Flex was updated.

  - `pagination: object { next_cursor, previous_cursor, total_count }`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

# Blockchains

## List Flex Blockchains

`$ nirvana rpc-nodes:flex:blockchains list`

**get** `/v1/rpc_nodes/flex/blockchains`

List all Flex Blockchains

### Parameters

- `--cursor: optional string`

  Pagination cursor returned by a previous request

- `--limit: optional number`

  Maximum number of items to return

### Returns

- `flex_blockchain_list: object { items, pagination }`

  - `items: array of FlexBlockchain`

    - `blockchain: string`

      Blockchain type.

    - `network: string`

      Network type (e.g., mainnet, testnet).

  - `pagination: object { next_cursor, previous_cursor, total_count }`

    Pagination response details.

    - `next_cursor: string`

    - `previous_cursor: string`

    - `total_count: number`

### Example

```cli
nirvana rpc-nodes:flex:blockchains list \
  --api-key 'My API Key'
```

#### Response

```json
{
  "items": [
    {
      "blockchain": "ethereum",
      "network": "mainnet"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
