# suix_getCoins

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

POST https://sui-mainnet.g.alchemy.com/v2/{apiKey}

Returns all Coin objects of the specified coin type owned by the given address. If the coin type is not provided, defaults to `0x2::sui::SUI`.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/suix-get-coins

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| owner | string | Yes | The owner's Sui address. |
| coin_type | string | No | Fully qualified type name of the coin (e.g., `0x2::sui::SUI`). Defaults to `0x2::sui::SUI` if omitted.  |
| cursor | string | No | Optional paging cursor to paginate results. |
| limit | integer | No | Maximum number of items to return in a single page. |

## Result

**result** (object): A page of Coin objects and pagination metadata.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "suix_getCoins",
  "params": [
    "0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6",
    "0x2::sui::SUI",
    "0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb",
    3
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "coinType": "0x2::sui::SUI",
        "coinObjectId": "0xb770280feece9abe5f4683ee9a1b5baa76e3426d3dd46e9e17ae45a294d8a486",
        "version": "2960614",
        "digest": "CwcAqcZsw9toDkJjg2WjUvdY5U8o914CwzbTSUeEgPRR",
        "balance": "1000000000",
        "lockedUntilEpoch": null,
        "previousTransaction": "DsYAh2efV1nD4UuEQXMeicPBgeYD4UbQSDpLg9mKTMzc"
      }
    ],
    "nextCursor": "0xb770280feece9abe5f4683ee9a1b5baa76e3426d3dd46e9e17ae45a294d8a486",
    "hasNextPage": false
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://sui-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_getCoins",
  "params": [
    "0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6",
    "0x2::sui::SUI",
    "0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb",
    3
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'suix_getCoins',
    params: [
      '0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6',
      '0x2::sui::SUI',
      '0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb',
      3
    ]
  })
};

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

### Python

```python
import requests

url = "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_getCoins",
    "params": ["0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6", "0x2::sui::SUI", "0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb", 3]
}
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://sui-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getCoins\",\n  \"params\": [\n    \"0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6\",\n    \"0x2::sui::SUI\",\n    \"0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb\",\n    3\n  ]\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://sui-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getCoins\",\n  \"params\": [\n    \"0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6\",\n    \"0x2::sui::SUI\",\n    \"0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb\",\n    3\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://sui-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"suix_getCoins\",\n  \"params\": [\n    \"0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6\",\n    \"0x2::sui::SUI\",\n    \"0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb\",\n    3\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: suix_getCoins
summary: Get Coin objects for a specific coin type owned by an address
description: |
  Returns all Coin objects of the specified coin type owned by the given address. If the coin type is not provided, defaults to `0x2::sui::SUI`.
params:
  - name: owner
    required: true
    description: The owner's Sui address.
    schema:
      type: string
  - name: coin_type
    required: false
    description: |
      Fully qualified type name of the coin (e.g., `0x2::sui::SUI`). Defaults to `0x2::sui::SUI` if omitted.
    schema:
      type: string
  - name: cursor
    required: false
    description: Optional paging cursor to paginate results.
    schema:
      type: string
  - name: limit
    required: false
    description: Maximum number of items to return in a single page.
    schema:
      type: integer
result:
  name: result
  description: A page of Coin objects and pagination metadata.
  schema:
    type: object
    properties:
      data:
        type: array
        description: List of Coin objects.
        items:
          type: object
          properties:
            coinType:
              type: string
              description: Type of the coin.
            coinObjectId:
              type: string
              description: Object ID of the coin.
            version:
              type: string
              description: Version of the coin object.
            digest:
              type: string
              description: Digest of the coin object.
            balance:
              type: string
              description: Balance of the coin object.
            lockedUntilEpoch:
              type: string
              nullable: true
              description: Optional epoch number until which the coin is locked.
            previousTransaction:
              type: string
              description: Digest of the previous transaction affecting this coin.
      nextCursor:
        type: string
        nullable: true
        description: Cursor pointing to the next page of results, if any.
      hasNextPage:
        type: boolean
        description: Whether there are more results available after this page.
examples:
  - name: Get SUI coins owned by an address
    params:
      - name: owner
        value: '0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6'
      - name: coin_type
        value: 0x2::sui::SUI
      - name: cursor
        value: '0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb'
      - name: limit
        value: 3
    result:
      name: result
      value:
        data:
          - coinType: 0x2::sui::SUI
            coinObjectId: '0xb770280feece9abe5f4683ee9a1b5baa76e3426d3dd46e9e17ae45a294d8a486'
            version: '2960614'
            digest: CwcAqcZsw9toDkJjg2WjUvdY5U8o914CwzbTSUeEgPRR
            balance: '1000000000'
            lockedUntilEpoch: null
            previousTransaction: DsYAh2efV1nD4UuEQXMeicPBgeYD4UbQSDpLg9mKTMzc
        nextCursor: '0xb770280feece9abe5f4683ee9a1b5baa76e3426d3dd46e9e17ae45a294d8a486'
        hasNextPage: false
```
