# Internal transfers

Move trading balances between Polyester accounts without touching a chain.

`client.internal_transfers` moves funds between Polyester accounts without touching a chain: from your source scope to another root account, a subaccount, or a smart-account address.

Transfers are idempotent on `idempotency_key`: repeat requests with the same key return the existing transfer instead of creating a second one.

## Methods

| Method   | Summary                                             |
| -------- | --------------------------------------------------- |
| `create` | Create (or return) an idempotent internal transfer. |

### Create

Provide exactly one destination: `destination_account_id`, `destination_subaccount_id`, or `destination_smart_account_address`.

```python
result = await client.internal_transfers.create(
    asset_id=2,
    quantity="125.50",
    idempotency_key="xfer-stable-1",
    destination_subaccount_id="123",
)
print(result.transfer_id, result.request_id, result.quantity)
```

| Field                        | Required | Notes                                        |
| ---------------------------- | -------- | -------------------------------------------- |
| `asset_id`                   | yes      | Ledger asset id                              |
| `quantity`                   | yes      | Decimal string or `AssetAmount`              |
| `idempotency_key`            | yes      | Reuse on retry                               |
| destination (one of three)   | yes      | Account / subaccount / smart-account address |
| `account` / `sub_account_id` | no       | Source scope override                        |
| `quantity_scale`             | no       | Default ledger scale `18`                    |

The request wire field is always `amount_e18`. `quantity_scale` declares the input scale and the SDK rescales exactly to scale 18, with checked overflow and no rounding. For example, `AssetAmount.from_scaled(125, scale=2)` is encoded as `1_250_000_000_000_000_000` (`1.25e18`). Inexact downscales are rejected.

## Related

- [Deposits & withdrawals guide](https://testnet.polyester.com/docs/sdk/python/guides/deposits-and-withdrawals)
- [Balances](https://testnet.polyester.com/docs/sdk/python/reference/balances)
- [Withdrawals](https://testnet.polyester.com/docs/sdk/python/reference/withdrawals)
- [Requests & idempotency](https://testnet.polyester.com/docs/sdk/python/concepts/requests-and-idempotency)
