# Get maximum delegatable resource size

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize

Returns the maximum amount of resources (in SUN) that can be delegated by a given account.   The type can be 0 for BANDWIDTH or 1 for ENERGY.


Reference: https://www.alchemy.com/docs/chains/tron/tron-http-api-endpoints/tron-http-api-endpoints/get-maximum-delegatable-resource-size

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize \
  --header 'Content-Type: application/json' \
  --data '{
  "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "type": 0,
  "visible": true
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({owner_address: 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', type: 0, visible: true})
};

fetch('https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize"

payload = {
    "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
    "type": 0,
    "visible": True
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize"

	payload := strings.NewReader("{\n  \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\",\n  \"type\": 0,\n  \"visible\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize")
  .header("Content-Type", "application/json")
  .body("{\n  \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\",\n  \"type\": 0,\n  \"visible\": true\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/getcandelegatedmaxsize");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\",\n  \"type\": 0,\n  \"visible\": true\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /wallet/getcandelegatedmaxsize
method: POST
operation:
  summary: Get maximum delegatable resource size
  description: |
    Returns the maximum amount of resources (in SUN) that can be delegated by a given account.   The type can be 0 for BANDWIDTH or 1 for ENERGY.
  tags:
    - Tron HTTP API Endpoints
  security:
    - apiKey: []
  requestBody:
    required: true
    content:
      application/json:
        schema:
          type: object
          required:
            - owner_address
            - type
          properties:
            owner_address:
              type: string
              description: Base58 address of the delegating account.
              example: TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g
            type:
              type: integer
              enum:
                - 0
                - 1
              description: 0 for BANDWIDTH, 1 for ENERGY.
              example: 0
            visible:
              type: boolean
              description: Indicates if the address is base58 (true) or hex (false).
              example: true
  responses:
    '200':
      description: Maximum delegatable size.
      content:
        application/json:
          schema:
            type: object
            properties:
              max_size:
                type: integer
                description: Maximum size in SUN that can be delegated.
          examples:
            response:
              value:
                max_size: 3000000
```
