# suix_getAllCoins

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

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

Returns a paginated list of all Coin objects owned by the specified address. Each Coin object includes metadata such as coin type, balance, and transaction history.


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

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| owner | string | Yes | The owner's Sui address. |
| cursor | string | No | Optional paging cursor from a previous response. |
| limit | integer | No | Maximum number of results to return. |

## Result

**result** (object): Paginated list of coin objects for the given address.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "suix_getAllCoins",
  "params": [
    "0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6",
    "0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb",
    3
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "coinType": "0x2::sui::SUI",
        "coinObjectId": "0x861c5e055605b2bb1199faf653a8771e448930bc95a0369fad43a9870a2e5878",
        "version": "103626",
        "digest": "Ao1QyN9UTmYzb2ead3D5xhSBk7TvACRvmnJW8gRbwP99",
        "balance": "200000000",
        "previousTransaction": "7dp5WtTmtGp83EXYYFMzjBJRFeSgR67AzqMETLrfgeFx"
      },
      {
        "coinType": "0x2::sui::SUI",
        "coinObjectId": "0x7e769678d059761bff8a8f3944642e4c33a6e4fb0b55f8face36fadaa22f2a0d",
        "version": "103626",
        "digest": "5taVxHU9QLQD5cNdqxt8kNGAab93GMG4vX7zYDxEaohx",
        "balance": "200000000",
        "previousTransaction": "9xLdMXezY8d1yRA2TtN6pYjapyy2EVKHWNriGPFGCFvd"
      },
      {
        "coinType": "0x2::sui::SUI",
        "coinObjectId": "0xa323d541ba5cf9e34919d2644cda38a263f69f47ae954dec65295231e0d2c7c8",
        "version": "103626",
        "digest": "82ZNKSSueWUQkpFNbBZGHSr3sUL5Rxfr7ucVRsvgQzz2",
        "balance": "200000000",
        "previousTransaction": "5xexWFq6QpGHBQyC9P2cbAJXq9qm2EjzfuRM9NwS1uyG"
      }
    ],
    "nextCursor": "abcd",
    "hasNextPage": true
  },
  "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_getAllCoins",
  "params": [
    "0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6",
    "0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb",
    3
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'suix_getAllCoins',
    params: [
      '0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6',
      '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_getAllCoins",
    "params": ["0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6", "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_getAllCoins\",\n  \"params\": [\n    \"0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6\",\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_getAllCoins\",\n  \"params\": [\n    \"0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6\",\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_getAllCoins\",\n  \"params\": [\n    \"0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6\",\n    \"0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb\",\n    3\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: suix_getAllCoins
summary: Get all coin objects owned by an address
description: |
  Returns a paginated list of all Coin objects owned by the specified address. Each Coin object includes metadata such as coin type, balance, and transaction history.
params:
  - name: owner
    required: true
    description: The owner's Sui address.
    schema:
      type: string
  - name: cursor
    required: false
    description: Optional paging cursor from a previous response.
    schema:
      type: string
      nullable: true
  - name: limit
    required: false
    description: Maximum number of results to return.
    schema:
      type: integer
result:
  name: result
  description: Paginated list of coin objects for the given address.
  schema:
    type: object
    properties:
      data:
        type: array
        description: The list of Coin objects owned by the address.
        items:
          type: object
          properties:
            coinType:
              type: string
              description: The full type tag of the coin.
            coinObjectId:
              type: string
              description: The object ID of the coin.
            version:
              type: string
              description: The object version.
            digest:
              type: string
              description: Digest of the coin object.
            balance:
              type: string
              description: The coin balance.
            previousTransaction:
              type: string
              description: The transaction digest that last modified this coin.
      nextCursor:
        type: string
        nullable: true
        description: Cursor for the next page.
      hasNextPage:
        type: boolean
        description: Whether more pages are available.
examples:
  - name: Get all coin objects
    params:
      - name: owner
        value: '0xe883a1df96561884e46d8e29cfb4e127bb6fd2719c33af1c16239a25a469e0a6'
      - name: cursor
        value: '0x1c574d9f2db5f293a799cc82795486aa8ce2962f831c7c6a433cbdcd84639acb'
      - name: limit
        value: 3
    result:
      name: result
      value:
        data:
          - coinType: 0x2::sui::SUI
            coinObjectId: '0x861c5e055605b2bb1199faf653a8771e448930bc95a0369fad43a9870a2e5878'
            version: '103626'
            digest: Ao1QyN9UTmYzb2ead3D5xhSBk7TvACRvmnJW8gRbwP99
            balance: '200000000'
            previousTransaction: 7dp5WtTmtGp83EXYYFMzjBJRFeSgR67AzqMETLrfgeFx
          - coinType: 0x2::sui::SUI
            coinObjectId: '0x7e769678d059761bff8a8f3944642e4c33a6e4fb0b55f8face36fadaa22f2a0d'
            version: '103626'
            digest: 5taVxHU9QLQD5cNdqxt8kNGAab93GMG4vX7zYDxEaohx
            balance: '200000000'
            previousTransaction: 9xLdMXezY8d1yRA2TtN6pYjapyy2EVKHWNriGPFGCFvd
          - coinType: 0x2::sui::SUI
            coinObjectId: '0xa323d541ba5cf9e34919d2644cda38a263f69f47ae954dec65295231e0d2c7c8'
            version: '103626'
            digest: 82ZNKSSueWUQkpFNbBZGHSr3sUL5Rxfr7ucVRsvgQzz2
            balance: '200000000'
            previousTransaction: 5xexWFq6QpGHBQyC9P2cbAJXq9qm2EjzfuRM9NwS1uyG
        nextCursor: abcd
        hasNextPage: true
```
