# Models

## The AccountLimits object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"AccountLimits":{"type":"object","description":"The representation of a limit for a specific account.","properties":{"pegCap":{"type":"integer","format":"int64","description":"Represents the current sBTC limits.","nullable":true,"minimum":0},"perDepositCap":{"type":"integer","format":"int64","description":"Per deposit cap. If none then the cap is the same as the global per deposit cap.","nullable":true,"minimum":0},"perDepositMinimum":{"type":"integer","format":"int64","description":"Per deposit minimum. If none then there is no minimum.","nullable":true,"minimum":0},"perWithdrawalCap":{"type":"integer","format":"int64","description":"Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.","nullable":true,"minimum":0},"rollingWithdrawalBlocks":{"type":"integer","format":"int64","description":"Number of blocks that define the rolling withdrawal window.","nullable":true,"minimum":0},"rollingWithdrawalCap":{"type":"integer","format":"int64","description":"Maximum total sBTC that can be withdrawn within the rolling withdrawal window.","nullable":true,"minimum":0},"throttleModeInitiator":{"type":"string","description":"Throttle key initiated throttle","nullable":true}}}}}}
```

## The Chainstate object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"Chainstate":{"type":"object","description":"Chainstate.","required":["stacksBlockHeight","stacksBlockHash"],"properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height","nullable":true,"minimum":0},"stacksBlockHash":{"type":"string","description":"Stacks block hash at the height."},"stacksBlockHeight":{"type":"integer","format":"int64","description":"Stacks block height.","minimum":0}}}}}}
```

## The CreateDepositRequestBody object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"CreateDepositRequestBody":{"type":"object","description":"Request structure for create deposit request.","required":["bitcoinTxid","bitcoinTxOutputIndex","reclaimScript","depositScript","transactionHex"],"properties":{"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Deposit script."},"reclaimScript":{"type":"string","description":"Reclaim script."},"transactionHex":{"type":"string","description":"The raw transaction hex."}}}}}}
```

## The Deposit object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"Deposit":{"type":"object","description":"Deposit.","required":["bitcoinTxid","bitcoinTxOutputIndex","recipient","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","reclaimScript","depositScript"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being deposited in satoshis.","minimum":0},"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Raw deposit script binary in hex."},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/DepositParameters"},"recipient":{"type":"string","description":"Stacks address to received the deposited sBTC."},"reclaimScript":{"type":"string","description":"Raw reclaim script binary in hex."},"replacedByTx":{"type":"string","description":"Transaction ID of the transaction that replaced this one via RBF.","nullable":true},"status":{"$ref":"#/components/schemas/DepositStatus"},"statusMessage":{"type":"string","description":"The status message of the deposit."}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"DepositParameters":{"type":"object","description":"Deposit parameters.","required":["maxFee","lockTime"],"properties":{"lockTime":{"type":"integer","format":"int32","description":"Bitcoin block height at which the reclaim script becomes executable.","minimum":0},"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the deposit to facilitate\nthe transaction.","minimum":0}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The DepositInfo object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"DepositInfo":{"type":"object","description":"Reduced version of the Deposit data.","required":["bitcoinTxid","bitcoinTxOutputIndex","recipient","amount","lastUpdateHeight","lastUpdateBlockHash","status","reclaimScript","depositScript"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being deposited in satoshis.","minimum":0},"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Raw deposit script binary in hex."},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"recipient":{"type":"string","description":"Stacks address to received the deposited sBTC."},"reclaimScript":{"type":"string","description":"Raw reclaim script binary in hex."},"status":{"$ref":"#/components/schemas/DepositStatus"}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The DepositParameters object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"DepositParameters":{"type":"object","description":"Deposit parameters.","required":["maxFee","lockTime"],"properties":{"lockTime":{"type":"integer","format":"int32","description":"Bitcoin block height at which the reclaim script becomes executable.","minimum":0},"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the deposit to facilitate\nthe transaction.","minimum":0}}}}}}
```

## The DepositStatus object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The DepositUpdate object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"DepositUpdate":{"type":"object","description":"A singular Deposit update that contains only the fields pertinent\nto updating the status of a deposit. This includes the key related\ndata in addition to status history related data.","required":["bitcoinTxid","bitcoinTxOutputIndex","status","statusMessage"],"properties":{"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"replacedByTx":{"type":"string","description":"Transaction ID of the transaction that replaced this one via RBF.","nullable":true},"status":{"$ref":"#/components/schemas/DepositStatus"},"statusMessage":{"type":"string","description":"The status message of the deposit."}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The DepositWithStatus object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"DepositWithStatus":{"type":"object","description":"Wrapper for deposit with status code. Used for multi-status responses.\nNote: logically, exactly one field among `error` and `deposit` should be `None`,\nand exactly one should be `Some`, so, storing them as `Result` would be more correct.\nHowever, utopia, which we use for openAPI schema generation, does not allow `Result`\nusage in its structs, and we have to use two `Option`s","required":["status"],"properties":{"deposit":{"allOf":[{"$ref":"#/components/schemas/Deposit"}],"nullable":true},"error":{"type":"string","description":"A string explaining the error that occurred during the deposit update.","nullable":true},"status":{"type":"integer","format":"int32","description":"HTTP status code for the deposit processing result.","minimum":0}}},"Deposit":{"type":"object","description":"Deposit.","required":["bitcoinTxid","bitcoinTxOutputIndex","recipient","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","reclaimScript","depositScript"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being deposited in satoshis.","minimum":0},"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Raw deposit script binary in hex."},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/DepositParameters"},"recipient":{"type":"string","description":"Stacks address to received the deposited sBTC."},"reclaimScript":{"type":"string","description":"Raw reclaim script binary in hex."},"replacedByTx":{"type":"string","description":"Transaction ID of the transaction that replaced this one via RBF.","nullable":true},"status":{"$ref":"#/components/schemas/DepositStatus"},"statusMessage":{"type":"string","description":"The status message of the deposit."}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"DepositParameters":{"type":"object","description":"Deposit parameters.","required":["maxFee","lockTime"],"properties":{"lockTime":{"type":"integer","format":"int32","description":"Bitcoin block height at which the reclaim script becomes executable.","minimum":0},"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the deposit to facilitate\nthe transaction.","minimum":0}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","description":"Structure representing an error response\nThis is used to serialize error messages in HTTP responses","required":["message"],"properties":{"message":{"type":"string"}}}}}}
```

## The ExpectedFulfillmentInfo object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"ExpectedFulfillmentInfo":{"type":"object","description":"Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.","properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.","nullable":true,"minimum":0},"bitcoinTxid":{"type":"string","description":"The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.","nullable":true}}}}}}
```

## The Fulfillment object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}}}}}
```

## The GetDepositsForTransactionResponse object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"GetDepositsForTransactionResponse":{"type":"object","description":"Response to get deposits for transaction request.","required":["deposits"],"properties":{"deposits":{"type":"array","items":{"$ref":"#/components/schemas/Deposit"},"description":"Deposits."},"nextToken":{"type":"string","description":"Next token for the search.","nullable":true}}},"Deposit":{"type":"object","description":"Deposit.","required":["bitcoinTxid","bitcoinTxOutputIndex","recipient","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","reclaimScript","depositScript"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being deposited in satoshis.","minimum":0},"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Raw deposit script binary in hex."},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/DepositParameters"},"recipient":{"type":"string","description":"Stacks address to received the deposited sBTC."},"reclaimScript":{"type":"string","description":"Raw reclaim script binary in hex."},"replacedByTx":{"type":"string","description":"Transaction ID of the transaction that replaced this one via RBF.","nullable":true},"status":{"$ref":"#/components/schemas/DepositStatus"},"statusMessage":{"type":"string","description":"The status message of the deposit."}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"DepositParameters":{"type":"object","description":"Deposit parameters.","required":["maxFee","lockTime"],"properties":{"lockTime":{"type":"integer","format":"int32","description":"Bitcoin block height at which the reclaim script becomes executable.","minimum":0},"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the deposit to facilitate\nthe transaction.","minimum":0}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The GetDepositsResponse object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"GetDepositsResponse":{"type":"object","description":"Response to get deposits request.","required":["deposits"],"properties":{"deposits":{"type":"array","items":{"$ref":"#/components/schemas/DepositInfo"},"description":"Deposit infos: deposits with a little less data."},"nextToken":{"type":"string","description":"Next token for the search.","nullable":true}}},"DepositInfo":{"type":"object","description":"Reduced version of the Deposit data.","required":["bitcoinTxid","bitcoinTxOutputIndex","recipient","amount","lastUpdateHeight","lastUpdateBlockHash","status","reclaimScript","depositScript"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being deposited in satoshis.","minimum":0},"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Raw deposit script binary in hex."},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"recipient":{"type":"string","description":"Stacks address to received the deposited sBTC."},"reclaimScript":{"type":"string","description":"Raw reclaim script binary in hex."},"status":{"$ref":"#/components/schemas/DepositStatus"}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The GetWithdrawalsResponse object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"GetWithdrawalsResponse":{"type":"object","description":"Response to get withdrawals request.","required":["withdrawals"],"properties":{"nextToken":{"type":"string","description":"Next token for the search.","nullable":true},"withdrawals":{"type":"array","items":{"$ref":"#/components/schemas/WithdrawalInfo"},"description":"Withdrawal infos: withdrawals with a little less data."}}},"WithdrawalInfo":{"type":"object","description":"Reduced version of the Withdrawal.","required":["requestId","stacksBlockHash","stacksBlockHeight","recipient","sender","amount","lastUpdateHeight","lastUpdateBlockHash","status","txid"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being withdrawn in satoshis.","minimum":0},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"recipient":{"type":"string","description":"The recipient's hex-encoded Bitcoin scriptPubKey."},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"sender":{"type":"string","description":"The sender's hex-encoded Stacks principal."},"stacksBlockHash":{"type":"string","description":"The stacks block hash in which this request id was initiated."},"stacksBlockHeight":{"type":"integer","format":"int64","description":"The height of the Stacks block in which this request id was initiated.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"txid":{"type":"string","description":"The hex encoded txid of the stacks transaction that generated this event."}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The HealthData object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"HealthData":{"type":"object","description":"Struct that represents the current status of the API.","required":["version"],"properties":{"version":{"type":"string","description":"The version of the API."}}}}}}
```

## The Limits object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"Limits":{"type":"object","description":"Represents the current sBTC limits.","required":["accountCaps"],"properties":{"accountCaps":{"type":"object","description":"Represents the individual limits for requests coming from different accounts.","additionalProperties":{"$ref":"#/components/schemas/AccountLimits"}},"availableToWithdraw":{"type":"integer","format":"int64","description":"Total amount sBTC still available for withdrawals in current window. All withdrawals except rejected\ncounted here","nullable":true,"minimum":0},"pegCap":{"type":"integer","format":"int64","description":"Represents the total cap for all pegged-in BTC/sBTC.","nullable":true,"minimum":0},"perDepositCap":{"type":"integer","format":"int64","description":"Per deposit cap. If none then there is no cap.","nullable":true,"minimum":0},"perDepositMinimum":{"type":"integer","format":"int64","description":"Per deposit minimum. If none then there is no minimum.","nullable":true,"minimum":0},"perWithdrawalCap":{"type":"integer","format":"int64","description":"Per withdrawal cap. If none then there is no cap.","nullable":true,"minimum":0},"rollingWithdrawalBlocks":{"type":"integer","format":"int64","description":"Number of blocks that define the rolling withdrawal window.","nullable":true,"minimum":0},"rollingWithdrawalCap":{"type":"integer","format":"int64","description":"Maximum total sBTC that can be withdrawn within the rolling withdrawal window.","nullable":true,"minimum":0},"throttleModeInitiator":{"type":"string","description":"Name of key which triggered throttle mode (if throttle mode is active)","nullable":true}}},"AccountLimits":{"type":"object","description":"The representation of a limit for a specific account.","properties":{"pegCap":{"type":"integer","format":"int64","description":"Represents the current sBTC limits.","nullable":true,"minimum":0},"perDepositCap":{"type":"integer","format":"int64","description":"Per deposit cap. If none then the cap is the same as the global per deposit cap.","nullable":true,"minimum":0},"perDepositMinimum":{"type":"integer","format":"int64","description":"Per deposit minimum. If none then there is no minimum.","nullable":true,"minimum":0},"perWithdrawalCap":{"type":"integer","format":"int64","description":"Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.","nullable":true,"minimum":0},"rollingWithdrawalBlocks":{"type":"integer","format":"int64","description":"Number of blocks that define the rolling withdrawal window.","nullable":true,"minimum":0},"rollingWithdrawalCap":{"type":"integer","format":"int64","description":"Maximum total sBTC that can be withdrawn within the rolling withdrawal window.","nullable":true,"minimum":0},"throttleModeInitiator":{"type":"string","description":"Throttle key initiated throttle","nullable":true}}}}}}
```

## The ThrottleRequest object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"ThrottleRequest":{"type":"object","description":"Represents the throttle reqwest","required":["name","secret"],"properties":{"name":{"type":"string","description":"The name of the key."},"secret":{"type":"string","description":"The secret associated with this key."}}}}}}
```

## The UpdateDepositsRequestBody object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"UpdateDepositsRequestBody":{"type":"object","description":"Request structure for update deposit request.","required":["deposits"],"properties":{"deposits":{"type":"array","items":{"$ref":"#/components/schemas/DepositUpdate"},"description":"Bitcoin transaction id."}}},"DepositUpdate":{"type":"object","description":"A singular Deposit update that contains only the fields pertinent\nto updating the status of a deposit. This includes the key related\ndata in addition to status history related data.","required":["bitcoinTxid","bitcoinTxOutputIndex","status","statusMessage"],"properties":{"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"replacedByTx":{"type":"string","description":"Transaction ID of the transaction that replaced this one via RBF.","nullable":true},"status":{"$ref":"#/components/schemas/DepositStatus"},"statusMessage":{"type":"string","description":"The status message of the deposit."}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The UpdateDepositsResponse object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"UpdateDepositsResponse":{"type":"object","description":"Response to update deposits request.","required":["deposits"],"properties":{"deposits":{"type":"array","items":{"$ref":"#/components/schemas/DepositWithStatus"},"description":"Deposit infos: deposits with a little less data."}}},"DepositWithStatus":{"type":"object","description":"Wrapper for deposit with status code. Used for multi-status responses.\nNote: logically, exactly one field among `error` and `deposit` should be `None`,\nand exactly one should be `Some`, so, storing them as `Result` would be more correct.\nHowever, utopia, which we use for openAPI schema generation, does not allow `Result`\nusage in its structs, and we have to use two `Option`s","required":["status"],"properties":{"deposit":{"allOf":[{"$ref":"#/components/schemas/Deposit"}],"nullable":true},"error":{"type":"string","description":"A string explaining the error that occurred during the deposit update.","nullable":true},"status":{"type":"integer","format":"int32","description":"HTTP status code for the deposit processing result.","minimum":0}}},"Deposit":{"type":"object","description":"Deposit.","required":["bitcoinTxid","bitcoinTxOutputIndex","recipient","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","reclaimScript","depositScript"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being deposited in satoshis.","minimum":0},"bitcoinTxOutputIndex":{"type":"integer","format":"int32","description":"Output index on the bitcoin transaction associated with this specific deposit.","minimum":0},"bitcoinTxid":{"type":"string","description":"Bitcoin transaction id."},"depositScript":{"type":"string","description":"Raw deposit script binary in hex."},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the deposit was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/DepositParameters"},"recipient":{"type":"string","description":"Stacks address to received the deposited sBTC."},"reclaimScript":{"type":"string","description":"Raw reclaim script binary in hex."},"replacedByTx":{"type":"string","description":"Transaction ID of the transaction that replaced this one via RBF.","nullable":true},"status":{"$ref":"#/components/schemas/DepositStatus"},"statusMessage":{"type":"string","description":"The status message of the deposit."}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"DepositParameters":{"type":"object","description":"Deposit parameters.","required":["maxFee","lockTime"],"properties":{"lockTime":{"type":"integer","format":"int32","description":"Bitcoin block height at which the reclaim script becomes executable.","minimum":0},"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the deposit to facilitate\nthe transaction.","minimum":0}}},"DepositStatus":{"type":"string","description":"The status of the in-flight sBTC deposit.","enum":["pending","accepted","confirmed","failed","rbf"]}}}}
```

## The UpdateWithdrawalsRequestBody object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"UpdateWithdrawalsRequestBody":{"type":"object","description":"Request structure for the create withdrawal request.","required":["withdrawals"],"properties":{"withdrawals":{"type":"array","items":{"$ref":"#/components/schemas/WithdrawalUpdate"},"description":"Withdrawal updates to execute."}}},"WithdrawalUpdate":{"type":"object","description":"A singular Withdrawal update that contains only the fields pertinent\nto updating the status of a withdrawal. This includes the key related\ndata in addition to status history related data.","required":["requestId","status","statusMessage"],"properties":{"expectedFulfillmentInfo":{"allOf":[{"$ref":"#/components/schemas/ExpectedFulfillmentInfo"}],"nullable":true},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"statusMessage":{"type":"string","description":"The status message of the withdrawal."}}},"ExpectedFulfillmentInfo":{"type":"object","description":"Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.","properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.","nullable":true,"minimum":0},"bitcoinTxid":{"type":"string","description":"The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.","nullable":true}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The UpdateWithdrawalsResponse object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"UpdateWithdrawalsResponse":{"type":"object","description":"Response to update withdrawals request.","required":["withdrawals"],"properties":{"withdrawals":{"type":"array","items":{"$ref":"#/components/schemas/WithdrawalWithStatus"},"description":"Updated withdrawals."}}},"WithdrawalWithStatus":{"type":"object","description":"Wrapper for withdrawal with status code. Used for multi-status responses.\nNote: logically, exactly one field among `error` and `withdrawal` should be `None`,\nand exactly one should be `Some`, so, storing them as `Result` would be more correct.\nHowever, utopia, which we use for openAPI schema generation, does not allow `Result`\nusage in its structs, and we have to use two `Option`s","required":["status"],"properties":{"error":{"type":"string","description":"String explaining error occured during updating the withdrawal.","nullable":true},"status":{"type":"integer","format":"int32","description":"HTTP status code for the withdrawal processing result.","minimum":0},"withdrawal":{"allOf":[{"$ref":"#/components/schemas/Withdrawal"}],"nullable":true}}},"Withdrawal":{"type":"object","description":"Withdrawal.","required":["requestId","stacksBlockHash","stacksBlockHeight","recipient","sender","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","expectedFulfillmentInfo","txid"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being withdrawn in satoshis.","minimum":0},"expectedFulfillmentInfo":{"$ref":"#/components/schemas/ExpectedFulfillmentInfo"},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/WithdrawalParameters"},"recipient":{"type":"string","description":"The recipient's hex-encoded Bitcoin scriptPubKey."},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"sender":{"type":"string","description":"The sender's hex-encoded Stacks principal."},"stacksBlockHash":{"type":"string","description":"The stacks block hash in which this request id was initiated."},"stacksBlockHeight":{"type":"integer","format":"int64","description":"The height of the Stacks block in which this request id was initiated.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"statusMessage":{"type":"string","description":"The status message of the withdrawal."},"txid":{"type":"string","description":"The hex encoded txid of the stacks transaction that generated this event."}}},"ExpectedFulfillmentInfo":{"type":"object","description":"Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.","properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.","nullable":true,"minimum":0},"bitcoinTxid":{"type":"string","description":"The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.","nullable":true}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"WithdrawalParameters":{"type":"object","description":"Withdrawal parameters.","required":["maxFee"],"properties":{"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the withdrawal to facilitate\nthe inclusion of the transaction onto the Bitcoin blockchain.","minimum":0}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The Withdrawal object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"Withdrawal":{"type":"object","description":"Withdrawal.","required":["requestId","stacksBlockHash","stacksBlockHeight","recipient","sender","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","expectedFulfillmentInfo","txid"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being withdrawn in satoshis.","minimum":0},"expectedFulfillmentInfo":{"$ref":"#/components/schemas/ExpectedFulfillmentInfo"},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/WithdrawalParameters"},"recipient":{"type":"string","description":"The recipient's hex-encoded Bitcoin scriptPubKey."},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"sender":{"type":"string","description":"The sender's hex-encoded Stacks principal."},"stacksBlockHash":{"type":"string","description":"The stacks block hash in which this request id was initiated."},"stacksBlockHeight":{"type":"integer","format":"int64","description":"The height of the Stacks block in which this request id was initiated.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"statusMessage":{"type":"string","description":"The status message of the withdrawal."},"txid":{"type":"string","description":"The hex encoded txid of the stacks transaction that generated this event."}}},"ExpectedFulfillmentInfo":{"type":"object","description":"Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.","properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.","nullable":true,"minimum":0},"bitcoinTxid":{"type":"string","description":"The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.","nullable":true}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"WithdrawalParameters":{"type":"object","description":"Withdrawal parameters.","required":["maxFee"],"properties":{"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the withdrawal to facilitate\nthe inclusion of the transaction onto the Bitcoin blockchain.","minimum":0}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The WithdrawalInfo object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"WithdrawalInfo":{"type":"object","description":"Reduced version of the Withdrawal.","required":["requestId","stacksBlockHash","stacksBlockHeight","recipient","sender","amount","lastUpdateHeight","lastUpdateBlockHash","status","txid"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being withdrawn in satoshis.","minimum":0},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"recipient":{"type":"string","description":"The recipient's hex-encoded Bitcoin scriptPubKey."},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"sender":{"type":"string","description":"The sender's hex-encoded Stacks principal."},"stacksBlockHash":{"type":"string","description":"The stacks block hash in which this request id was initiated."},"stacksBlockHeight":{"type":"integer","format":"int64","description":"The height of the Stacks block in which this request id was initiated.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"txid":{"type":"string","description":"The hex encoded txid of the stacks transaction that generated this event."}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The WithdrawalParameters object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"WithdrawalParameters":{"type":"object","description":"Withdrawal parameters.","required":["maxFee"],"properties":{"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the withdrawal to facilitate\nthe inclusion of the transaction onto the Bitcoin blockchain.","minimum":0}}}}}}
```

## The WithdrawalStatus object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The WithdrawalUpdate object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"WithdrawalUpdate":{"type":"object","description":"A singular Withdrawal update that contains only the fields pertinent\nto updating the status of a withdrawal. This includes the key related\ndata in addition to status history related data.","required":["requestId","status","statusMessage"],"properties":{"expectedFulfillmentInfo":{"allOf":[{"$ref":"#/components/schemas/ExpectedFulfillmentInfo"}],"nullable":true},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"statusMessage":{"type":"string","description":"The status message of the withdrawal."}}},"ExpectedFulfillmentInfo":{"type":"object","description":"Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.","properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.","nullable":true,"minimum":0},"bitcoinTxid":{"type":"string","description":"The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.","nullable":true}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```

## The WithdrawalWithStatus object

```json
{"openapi":"3.0.3","info":{"title":"emily-openapi-spec","version":"0.1.0"},"components":{"schemas":{"WithdrawalWithStatus":{"type":"object","description":"Wrapper for withdrawal with status code. Used for multi-status responses.\nNote: logically, exactly one field among `error` and `withdrawal` should be `None`,\nand exactly one should be `Some`, so, storing them as `Result` would be more correct.\nHowever, utopia, which we use for openAPI schema generation, does not allow `Result`\nusage in its structs, and we have to use two `Option`s","required":["status"],"properties":{"error":{"type":"string","description":"String explaining error occured during updating the withdrawal.","nullable":true},"status":{"type":"integer","format":"int32","description":"HTTP status code for the withdrawal processing result.","minimum":0},"withdrawal":{"allOf":[{"$ref":"#/components/schemas/Withdrawal"}],"nullable":true}}},"Withdrawal":{"type":"object","description":"Withdrawal.","required":["requestId","stacksBlockHash","stacksBlockHeight","recipient","sender","amount","lastUpdateHeight","lastUpdateBlockHash","status","statusMessage","parameters","expectedFulfillmentInfo","txid"],"properties":{"amount":{"type":"integer","format":"int64","description":"Amount of BTC being withdrawn in satoshis.","minimum":0},"expectedFulfillmentInfo":{"$ref":"#/components/schemas/ExpectedFulfillmentInfo"},"fulfillment":{"allOf":[{"$ref":"#/components/schemas/Fulfillment"}],"nullable":true},"lastUpdateBlockHash":{"type":"string","description":"The most recent Stacks block hash the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this hash is the Stacks block hash that contains that artifact."},"lastUpdateHeight":{"type":"integer","format":"int64","description":"The most recent Stacks block height the API was aware of when the withdrawal was last\nupdated. If the most recent update is tied to an artifact on the Stacks blockchain\nthen this height is the Stacks block height that contains that artifact.","minimum":0},"parameters":{"$ref":"#/components/schemas/WithdrawalParameters"},"recipient":{"type":"string","description":"The recipient's hex-encoded Bitcoin scriptPubKey."},"requestId":{"type":"integer","format":"int64","description":"The id of the Stacks withdrawal request that initiated the sBTC operation.","minimum":0},"sender":{"type":"string","description":"The sender's hex-encoded Stacks principal."},"stacksBlockHash":{"type":"string","description":"The stacks block hash in which this request id was initiated."},"stacksBlockHeight":{"type":"integer","format":"int64","description":"The height of the Stacks block in which this request id was initiated.","minimum":0},"status":{"$ref":"#/components/schemas/WithdrawalStatus"},"statusMessage":{"type":"string","description":"The status message of the withdrawal."},"txid":{"type":"string","description":"The hex encoded txid of the stacks transaction that generated this event."}}},"ExpectedFulfillmentInfo":{"type":"object","description":"Expected information about future fulfillment of the withdrawal.\nThis struct represents _estimate_ of how fulfillment for the\nwithdrawal will look like. This estimation is for reference only,\nand does not provide any guarantees.","properties":{"bitcoinBlockHeight":{"type":"integer","format":"int64","description":"The estimated bitcoin block height for the bitcoin block confirming\nthe transaction fulling the withdrawal request. This value is\nestimated by Emily once when the withdrawal request is initially\nreceived.","nullable":true,"minimum":0},"bitcoinTxid":{"type":"string","description":"The expected txid of the sweep transaction fulfilling the withdrawal\nrequest. This field is populated once, it is not updated if there is\nan RBF transaction that also fulfills the request.","nullable":true}}},"Fulfillment":{"type":"object","description":"Data about the fulfillment of an sBTC Operation.","required":["BitcoinTxid","BitcoinTxIndex","StacksTxid","BitcoinBlockHash","BitcoinBlockHeight","BtcFee"],"properties":{"BitcoinBlockHash":{"type":"string","description":"Bitcoin block hash of the block that contains the bitcoin transaction that fulfilled\nthis transaction."},"BitcoinBlockHeight":{"type":"integer","format":"int64","description":"Bitcoin block height of the block that contains the bitcoin transaction that fulfilled\nthis transaction.","minimum":0},"BitcoinTxIndex":{"type":"integer","format":"int32","description":"Bitcoin transaction output index of the Bitcoin transaction that fulfilled the\noperation that corresponds to the fulfillment of this specific operation.","minimum":0},"BitcoinTxid":{"type":"string","description":"Bitcoin transaction id of the Bitcoin transaction that fulfilled the operation."},"BtcFee":{"type":"integer","format":"int64","description":"Satoshis consumed to fulfill the sBTC operation.","minimum":0},"StacksTxid":{"type":"string","description":"Stacks transaction Id that fulfilled this operation."}}},"WithdrawalParameters":{"type":"object","description":"Withdrawal parameters.","required":["maxFee"],"properties":{"maxFee":{"type":"integer","format":"int64","description":"Maximum fee the signers are allowed to take from the withdrawal to facilitate\nthe inclusion of the transaction onto the Bitcoin blockchain.","minimum":0}}},"WithdrawalStatus":{"type":"string","description":"The status of the in-flight sBTC withdrawal.","enum":["pending","accepted","confirmed","failed"]}}}}
```
