<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Bitcoin",
  "identifier" : "/documentation/Bitcoin/BTCAmount",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Bitcoin"
    ],
    "preciseIdentifier" : "s:7Bitcoin9BTCAmountV"
  },
  "title" : "BTCAmount"
}
-->

# BTCAmount

Single Bitcoin amount type. Stores satoshis, decodes/encodes BTC decimal.

```
struct BTCAmount
```

## Overview

Fields in sat-denominated Core JSON use plain `Int64` instead.
Negative amounts are valid and expected (e.g., `fee` in wallet transactions).

```swift
let amount = BTCAmount(satoshis: 100_000_000) // 1 BTC
print(amount.btc) // 1
print(amount)      // "1 BTC"

let fee = BTCAmount(btc: Decimal(string: "0.0001")!)
print(fee.satoshis) // 10000
```

> Note: Targets Bitcoin Core v31.x.