Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stacks-network/sbtc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.0.9-rc5p
Choose a base ref
...
head repository: stacks-network/sbtc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: test-docker-release
Choose a head ref

Commits on Jan 9, 2025

  1. fix: enforce codec deserialization (#1188)

    * Add an outlined description of the sBTC code specification
    * Enforce field order deserialization for proto::Signed messages
    * Update the docstrings
    djordon authored Jan 9, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d462888 View commit details
  2. fix: increase the event observer max body size (#1195)

    * fix: increase the event observer max body size
    
    * chore: add missing codegen(?)
    
    * chore: fmt
    matteojug authored Jan 9, 2025
    Copy the full SHA
    9755139 View commit details

Commits on Jan 10, 2025

  1. refactor: better integration test db instantiation (#1206)

    * refactor integration test db stuff
    
    * remove extra signer db and move flyway to bottom of compose
    
    * fix flyway url in test compose
    
    * remove extra signer db from ci compose
    
    * add whitespace
    
    * remove whitespace
    
    * add whitespace
    
    * remove whitespace
    
    * add whitespace
    
    * remove whitespace
    
    * add whitespace
    
    * remove whitespace
    cylewitruk authored Jan 10, 2025
    Copy the full SHA
    14ef98e View commit details

Commits on Jan 14, 2025

  1. feat: additional logging for new_block handler (#1203)

    * logging tweaks for new_block endpoint
    
    * fmt lint
    
    * tweaks
    
    * remove scoping around span/record
    
    * fix typo
    
    * use actual event names in a separate tracing field
    
    * use outpoint instead of txid+vout
    cylewitruk authored Jan 14, 2025
    Copy the full SHA
    1c964ee View commit details
  2. fix: continue processing events in new block after unknown events (#1198

    )
    
    * fix: continue processing events in new block after unknown events
    
    * chore: simplify test & nits
    matteojug authored Jan 14, 2025
    Copy the full SHA
    619f9b4 View commit details
  3. feat: add config params for dkg-rerun bitcoin block height and target…

    … rounds (#1204)
    
    * add config var
    
    * add 'dkg_rounds_target' config param
    
    * use u32 instead of u16 for simplicity
    
    * pr comments
    
    * fix comments/test names
    cylewitruk authored Jan 14, 2025
    Copy the full SHA
    c35c82b View commit details
  4. feat: #1200 feature signers allow second dkg after specific block hei…

    …ght (#1205)
    
    * allow at most 2 dkg runs
    
    * db int bug
    
    * fmt
    
    * lint
    
    * use dkg rounds target config parameter
    
    * add tests, pr comments
    
    * logging
    
    * test explicitly for the expected err
    
    * additional test
    
    * remove whitespace
    
    * dkg_share to dkg_shares
    
    * more naming
    
    * update match
    
    * update match
    cylewitruk authored Jan 14, 2025
    Copy the full SHA
    1774855 View commit details
  5. feat: Query By Recipient (#1125)

    * feat: get deposits by recipient.
    
    * chore: Fix linter error
    
    * add generated sources changes
    
    * Change internal Emily code to use u16s instead of i32s
    
    * fix linter complaint
    
    * Fix test
    AshtonStephens authored Jan 14, 2025
    Copy the full SHA
    2d1249e View commit details
  6. feat: #1199 feature coordinator attempts subsequent DKG run according…

    … to configuration (#1212)
    
    * add placeholder config vars
    
    * update config
    
    * coordinator coordinates DKG again if configured to do so
    
    * pr comments
    cylewitruk authored Jan 14, 2025
    Copy the full SHA
    593e952 View commit details
  7. fix: exit early if no requests during presign request creation (#1215)

    * return early when there are no requests when constructing a BitcoinPreSignRequest
    djordon authored Jan 14, 2025
    Copy the full SHA
    8c1ad1b View commit details

Commits on Jan 15, 2025

  1. feat: always create new state machines (#1209)

    * Updating the signers to create a new state machine all the time
    * Use an LruCache for keeping signer state machines
    * Use the bitcoin block hash as the key ID for the signer state machine used during DKG
    djordon authored Jan 15, 2025
    Copy the full SHA
    c3aabae View commit details

Commits on Jan 16, 2025

  1. feat: load aggregate key dependent signer state machines (#1210)

    * Add an aggregate key field to the bitcoin sig hash object
    * Add a SQL migration for the new column and make sure we write to it in our query
    * Return the aggregate key in the will sign query
    * Load the secret shares based on the aggregate key associated with the sighash
    * Add a new end-to-end test for signing bitcoin transactions with multiple locking keys.
    djordon authored Jan 16, 2025
    Copy the full SHA
    7040848 View commit details
  2. [feature] return a proper errors instead of debug asserts (#1165)

    * Enriched error message in handle_stacks_transaction_sign_request
    
    * fmt
    
    * add TweakCheck error
    
    * Enriched scripts checks in CreateDepositRequest::validate_tx
    
    * get_tenure_raw error message upgrade
    
    * remove unnecessary debug assert
    
    * review fixes
    
    * Prettify comment
    
    Co-authored-by: Daniel Jordon <djordon@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Daniel Jordon <djordon@users.noreply.github.com>
    MCJOHN974 and djordon authored Jan 16, 2025
    Copy the full SHA
    d80f097 View commit details
  3. fix: validate network recipient stacks address (#1229)

    * Add a check for the network of the recipient address embedded in the deposit script
    djordon authored Jan 16, 2025
    Copy the full SHA
    55ffd37 View commit details

Commits on Jan 20, 2025

  1. Add locker flag (#1239)

    - Add locked option in the docker build
    fabergat authored Jan 20, 2025
    Copy the full SHA
    32752a3 View commit details
  2. fix elecrs to use nightly (#1241)

    cylewitruk authored Jan 20, 2025
    Copy the full SHA
    dfddc97 View commit details

Commits on Jan 21, 2025

  1. feat: Add Artifact attestation for CI builds (#1240)

    * Add gh artifcat attestation
    
    * Fix subject name with tags
    
    * Remove tags from the name
    
    * Add index in front of the name
    fabergat authored Jan 21, 2025
    Copy the full SHA
    9a61457 View commit details
  2. Specify workflows permissions (#1247)

    - Add permission block to enforce permission visibility
    fabergat authored Jan 21, 2025
    Copy the full SHA
    a53ab63 View commit details

Commits on Jan 22, 2025

  1. feat: Pin action by hash in CI workflows (#1249)

    - Add hash to every CI action
    fabergat authored Jan 22, 2025
    Copy the full SHA
    f53b9bf View commit details
  2. feat: use conservative default sBTC limits (#1254)

    * feat: use conservative default sBTC limits
    
    * chore: restore trait import
    
    * chore: use max money as minimum
    
    * chore: remove default in favor of explicit methods
    matteojug authored Jan 22, 2025
    Copy the full SHA
    84541ed View commit details
  3. Add draft version

    fabergat committed Jan 22, 2025
    Copy the full SHA
    adebf67 View commit details

Commits on Jan 23, 2025

  1. Update action version

    fabergat committed Jan 23, 2025
    Copy the full SHA
    102c220 View commit details
  2. Update action version

    fabergat committed Jan 23, 2025
    Copy the full SHA
    f03e7bc View commit details
  3. Fix workflow link

    fabergat committed Jan 23, 2025
    Copy the full SHA
    03b0e4d View commit details
  4. Fix yaml extension

    fabergat committed Jan 23, 2025
    Copy the full SHA
    6329a25 View commit details
  5. Test add link

    fabergat committed Jan 23, 2025
    Copy the full SHA
    940bcdc View commit details
  6. Add test link

    fabergat committed Jan 23, 2025
    Copy the full SHA
    1895953 View commit details
  7. Fix Add test link

    fabergat committed Jan 23, 2025
    Copy the full SHA
    14ef9ea View commit details
  8. Fix github api

    fabergat committed Jan 23, 2025
    Copy the full SHA
    c6e1d38 View commit details
  9. Add permissions

    fabergat committed Jan 23, 2025
    Copy the full SHA
    298a58d View commit details
  10. Remove test code

    fabergat committed Jan 23, 2025
    Copy the full SHA
    ff763f8 View commit details
  11. Refactor release workflow

    fabergat committed Jan 23, 2025
    Copy the full SHA
    a4f19b3 View commit details
  12. Add attestation guide

    fabergat committed Jan 23, 2025
    Copy the full SHA
    8ec2935 View commit details
  13. Remove unused action

    fabergat committed Jan 23, 2025
    Copy the full SHA
    3b40c69 View commit details
Showing with 5,901 additions and 1,366 deletions.
  1. +2 −0 .generated-sources/emily/client/rust/private/README.md
  2. +31 −0 .generated-sources/emily/client/rust/private/docs/CorsApi.md
  3. +31 −0 .generated-sources/emily/client/rust/private/docs/DepositApi.md
  4. +49 −0 .generated-sources/emily/client/rust/private/src/apis/cors_api.rs
  5. +63 −0 .generated-sources/emily/client/rust/private/src/apis/deposit_api.rs
  6. +2 −0 .generated-sources/emily/client/rust/public/README.md
  7. +31 −0 .generated-sources/emily/client/rust/public/docs/CorsApi.md
  8. +31 −0 .generated-sources/emily/client/rust/public/docs/DepositApi.md
  9. +49 −0 .generated-sources/emily/client/rust/public/src/apis/cors_api.rs
  10. +63 −0 .generated-sources/emily/client/rust/public/src/apis/deposit_api.rs
  11. +2 −0 .generated-sources/emily/client/rust/testing/README.md
  12. +31 −0 .generated-sources/emily/client/rust/testing/docs/CorsApi.md
  13. +31 −0 .generated-sources/emily/client/rust/testing/docs/DepositApi.md
  14. +49 −0 .generated-sources/emily/client/rust/testing/src/apis/cors_api.rs
  15. +63 −0 .generated-sources/emily/client/rust/testing/src/apis/deposit_api.rs
  16. +126 −0 .generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json
  17. +126 −0 .generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json
  18. +126 −0 .generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json
  19. +1 −0 .generated-sources/emily/openapi/generators/private.rs
  20. +1 −0 .generated-sources/emily/openapi/generators/public.rs
  21. +1 −0 .generated-sources/emily/openapi/generators/testing.rs
  22. +1 −1 .github/actions/dockerfiles/Dockerfile.blocklist-client.debian
  23. +1 −1 .github/actions/dockerfiles/Dockerfile.signer.debian
  24. +5 −2 .github/workflows/buf-ci.yaml
  25. +6 −3 .github/workflows/contract-tests.yaml
  26. +14 −1 .github/workflows/image-build.yaml
  27. +65 −0 .github/workflows/release.yaml
  28. +11 −7 .github/workflows/unit-tests.yaml
  29. +8 −5 Cargo.lock
  30. +2 −1 Cargo.toml
  31. +0 −1 docker/docker-compose.ci.yml
  32. +17 −18 docker/docker-compose.test.yml
  33. +5 −2 docker/electrs/Dockerfile
  34. +16 −0 docker/mainnet/sbtc-signer/signer-config.toml.in
  35. +16 −0 docker/sbtc/signer/signer-config.toml
  36. +25 −2 emily/cdk/lib/emily-stack.ts
  37. +53 −0 emily/handler/src/api/handlers/deposit.rs
  38. +1 −1 emily/handler/src/api/models/common/requests.rs
  39. +14 −2 emily/handler/src/api/models/deposit/requests.rs
  40. +1 −1 emily/handler/src/api/models/withdrawal/requests.rs
  41. +13 −0 emily/handler/src/api/routes/deposit.rs
  42. +5 −0 emily/handler/src/common/error.rs
  43. +30 −11 emily/handler/src/database/accessors.rs
  44. +107 −0 emily/handler/src/database/entries/deposit.rs
  45. +4 −4 emily/handler/src/database/entries/mod.rs
  46. +146 −14 emily/handler/tests/integration/deposit.rs
  47. +5 −5 emily/handler/tests/integration/withdrawal.rs
  48. +51 −12 sbtc/src/deposits.rs
  49. +4 −0 sbtc/src/error.rs
  50. +34 −0 sbtc/src/testing/deposits.rs
  51. +2 −2 sbtc/tests/integration/validation.rs
  52. +1 −0 signer/Cargo.toml
  53. +15 −0 signer/migrations/0011__add_aggregate_key_sighashes_table.sql
  54. +186 −15 signer/src/api/new_block.rs
  55. +6 −1 signer/src/api/router.rs
  56. +40 −17 signer/src/bitcoin/utxo.rs
  57. +1 −0 signer/src/bitcoin/validation.rs
  58. +9 −4 signer/src/block_observer.rs
  59. +272 −7 signer/src/codec.rs
  60. +16 −0 signer/src/config/default.toml
  61. +52 −0 signer/src/config/mod.rs
  62. +30 −2 signer/src/context/signer_state.rs
  63. +144 −7 signer/src/ecdsa.rs
  64. +40 −0 signer/src/error.rs
  65. +3 −1 signer/src/keys.rs
  66. +18 −0 signer/src/lib.rs
  67. +9 −2 signer/src/main.rs
  68. +1 −2 signer/src/message.rs
  69. +6 −3 signer/src/network/in_memory2.rs
  70. +2 −362 signer/src/proto/convert.rs
  71. +2 −2 signer/src/signature.rs
  72. +10 −5 signer/src/stacks/api.rs
  73. +6 −2 signer/src/storage/in_memory.rs
  74. +4 −1 signer/src/storage/mod.rs
  75. +3 −0 signer/src/storage/model.rs
  76. +24 −4 signer/src/storage/postgres.rs
  77. +1 −1 signer/src/testing/block_observer.rs
  78. +16 −0 signer/src/testing/btc.rs
  79. +387 −6 signer/src/testing/dummy.rs
  80. +26 −56 signer/src/testing/storage.rs
  81. +3 −2 signer/src/testing/transaction_signer.rs
  82. +143 −20 signer/src/transaction_coordinator.rs
  83. +347 −115 signer/src/transaction_signer.rs
  84. +34 −3 signer/src/wsts_state_machine.rs
  85. +380 −0 signer/tests/fixtures/rotate-keys-and-invalid-event.json
  86. +13 −16 signer/tests/integration/bitcoin_validation.rs
  87. +11 −21 signer/tests/integration/block_observer.rs
  88. +11 −25 signer/tests/integration/complete_deposit.rs
  89. +0 −1 signer/tests/integration/contracts.rs
  90. +1 −4 signer/tests/integration/emily.rs
  91. +49 −98 signer/tests/integration/postgres.rs
  92. +1 −1 signer/tests/integration/rbf.rs
  93. +4 −11 signer/tests/integration/request_decider.rs
  94. +7 −18 signer/tests/integration/rotate_keys.rs
  95. +31 −4 signer/tests/integration/setup.rs
  96. +1,692 −387 signer/tests/integration/transaction_coordinator.rs
  97. +258 −14 signer/tests/integration/transaction_signer.rs
  98. +3 −3 signer/tests/integration/utxo_construction.rs
  99. +12 −27 signer/tests/integration/withdrawal_accept.rs
2 changes: 2 additions & 0 deletions .generated-sources/emily/client/rust/private/README.md
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ Class | Method | HTTP request | Description
*CorsApi* | [**chainstate_height_options**](docs/CorsApi.md#chainstate_height_options) | **OPTIONS** /chainstate/{height} | CORS support
*CorsApi* | [**chainstate_options**](docs/CorsApi.md#chainstate_options) | **OPTIONS** /chainstate | CORS support
*CorsApi* | [**deposit_options**](docs/CorsApi.md#deposit_options) | **OPTIONS** /deposit | CORS support
*CorsApi* | [**deposit_recipient_recipient_options**](docs/CorsApi.md#deposit_recipient_recipient_options) | **OPTIONS** /deposit/recipient/{recipient} | CORS support
*CorsApi* | [**deposit_txid_index_options**](docs/CorsApi.md#deposit_txid_index_options) | **OPTIONS** /deposit/{txid}/{index} | CORS support
*CorsApi* | [**deposit_txid_options**](docs/CorsApi.md#deposit_txid_options) | **OPTIONS** /deposit/{txid} | CORS support
*CorsApi* | [**health_options**](docs/CorsApi.md#health_options) | **OPTIONS** /health | CORS support
@@ -43,6 +44,7 @@ Class | Method | HTTP request | Description
*DepositApi* | [**create_deposit**](docs/DepositApi.md#create_deposit) | **POST** /deposit | Create deposit handler.
*DepositApi* | [**get_deposit**](docs/DepositApi.md#get_deposit) | **GET** /deposit/{txid}/{index} | Get deposit handler.
*DepositApi* | [**get_deposits**](docs/DepositApi.md#get_deposits) | **GET** /deposit | Get deposits handler.
*DepositApi* | [**get_deposits_for_recipient**](docs/DepositApi.md#get_deposits_for_recipient) | **GET** /deposit/recipient/{recipient} | Get deposits by recipient handler.
*DepositApi* | [**get_deposits_for_transaction**](docs/DepositApi.md#get_deposits_for_transaction) | **GET** /deposit/{txid} | Get deposits for transaction handler.
*DepositApi* | [**update_deposits**](docs/DepositApi.md#update_deposits) | **PUT** /deposit | Update deposits handler.
*HealthApi* | [**check_health**](docs/HealthApi.md#check_health) | **GET** /health | Get health handler.
31 changes: 31 additions & 0 deletions .generated-sources/emily/client/rust/private/docs/CorsApi.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ Method | HTTP request | Description
[**chainstate_height_options**](CorsApi.md#chainstate_height_options) | **OPTIONS** /chainstate/{height} | CORS support
[**chainstate_options**](CorsApi.md#chainstate_options) | **OPTIONS** /chainstate | CORS support
[**deposit_options**](CorsApi.md#deposit_options) | **OPTIONS** /deposit | CORS support
[**deposit_recipient_recipient_options**](CorsApi.md#deposit_recipient_recipient_options) | **OPTIONS** /deposit/recipient/{recipient} | CORS support
[**deposit_txid_index_options**](CorsApi.md#deposit_txid_index_options) | **OPTIONS** /deposit/{txid}/{index} | CORS support
[**deposit_txid_options**](CorsApi.md#deposit_txid_options) | **OPTIONS** /deposit/{txid} | CORS support
[**health_options**](CorsApi.md#health_options) | **OPTIONS** /health | CORS support
@@ -101,6 +102,36 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## deposit_recipient_recipient_options

> deposit_recipient_recipient_options(recipient)
CORS support

Handles CORS preflight requests

### Parameters


Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**recipient** | **String** | the status to search by when getting all deposits. | [required] |

### Return type

(empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## deposit_txid_index_options

> deposit_txid_index_options(txid, index)
31 changes: 31 additions & 0 deletions .generated-sources/emily/client/rust/private/docs/DepositApi.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ Method | HTTP request | Description
[**create_deposit**](DepositApi.md#create_deposit) | **POST** /deposit | Create deposit handler.
[**get_deposit**](DepositApi.md#get_deposit) | **GET** /deposit/{txid}/{index} | Get deposit handler.
[**get_deposits**](DepositApi.md#get_deposits) | **GET** /deposit | Get deposits handler.
[**get_deposits_for_recipient**](DepositApi.md#get_deposits_for_recipient) | **GET** /deposit/recipient/{recipient} | Get deposits by recipient handler.
[**get_deposits_for_transaction**](DepositApi.md#get_deposits_for_transaction) | **GET** /deposit/{txid} | Get deposits for transaction handler.
[**update_deposits**](DepositApi.md#update_deposits) | **PUT** /deposit | Update deposits handler.

@@ -99,6 +100,36 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_deposits_for_recipient

> models::GetDepositsResponse get_deposits_for_recipient(recipient, next_token, page_size)
Get deposits by recipient handler.

### Parameters


Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**recipient** | **String** | the status to search by when getting all deposits. | [required] |
**next_token** | Option<**String**> | the next token value from the previous return of this api call. | |
**page_size** | Option<**i32**> | the maximum number of items in the response list. | |

### Return type

[**models::GetDepositsResponse**](GetDepositsResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_deposits_for_transaction

> models::GetDepositsForTransactionResponse get_deposits_for_transaction(txid, next_token, page_size)
49 changes: 49 additions & 0 deletions .generated-sources/emily/client/rust/private/src/apis/cors_api.rs
Original file line number Diff line number Diff line change
@@ -34,6 +34,13 @@ pub enum DepositOptionsError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`deposit_recipient_recipient_options`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DepositRecipientRecipientOptionsError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`deposit_txid_index_options`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -199,6 +206,48 @@ pub async fn deposit_options(
}
}

/// Handles CORS preflight requests
pub async fn deposit_recipient_recipient_options(
configuration: &configuration::Configuration,
recipient: &str,
) -> Result<(), Error<DepositRecipientRecipientOptionsError>> {
let local_var_configuration = configuration;

let local_var_client = &local_var_configuration.client;

let local_var_uri_str = format!(
"{}/deposit/recipient/{recipient}",
local_var_configuration.base_path,
recipient = crate::apis::urlencode(recipient)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::OPTIONS, local_var_uri_str.as_str());

if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}

let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DepositRecipientRecipientOptionsError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}

/// Handles CORS preflight requests
pub async fn deposit_txid_index_options(
configuration: &configuration::Configuration,
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ pub enum CreateDepositError {
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status405(models::ErrorResponse),
Status409(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
@@ -46,6 +47,17 @@ pub enum GetDepositsError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_deposits_for_recipient`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDepositsForRecipientError {
Status400(models::ErrorResponse),
Status404(models::ErrorResponse),
Status405(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_deposits_for_transaction`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -197,6 +209,57 @@ pub async fn get_deposits(
}
}

pub async fn get_deposits_for_recipient(
configuration: &configuration::Configuration,
recipient: &str,
next_token: Option<&str>,
page_size: Option<i32>,
) -> Result<models::GetDepositsResponse, Error<GetDepositsForRecipientError>> {
let local_var_configuration = configuration;

let local_var_client = &local_var_configuration.client;

let local_var_uri_str = format!(
"{}/deposit/recipient/{recipient}",
local_var_configuration.base_path,
recipient = crate::apis::urlencode(recipient)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

if let Some(ref local_var_str) = next_token {
local_var_req_builder =
local_var_req_builder.query(&[("nextToken", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page_size {
local_var_req_builder =
local_var_req_builder.query(&[("pageSize", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}

let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<GetDepositsForRecipientError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}

pub async fn get_deposits_for_transaction(
configuration: &configuration::Configuration,
txid: &str,
2 changes: 2 additions & 0 deletions .generated-sources/emily/client/rust/public/README.md
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ Class | Method | HTTP request | Description
*CorsApi* | [**chainstate_height_options**](docs/CorsApi.md#chainstate_height_options) | **OPTIONS** /chainstate/{height} | CORS support
*CorsApi* | [**chainstate_options**](docs/CorsApi.md#chainstate_options) | **OPTIONS** /chainstate | CORS support
*CorsApi* | [**deposit_options**](docs/CorsApi.md#deposit_options) | **OPTIONS** /deposit | CORS support
*CorsApi* | [**deposit_recipient_recipient_options**](docs/CorsApi.md#deposit_recipient_recipient_options) | **OPTIONS** /deposit/recipient/{recipient} | CORS support
*CorsApi* | [**deposit_txid_index_options**](docs/CorsApi.md#deposit_txid_index_options) | **OPTIONS** /deposit/{txid}/{index} | CORS support
*CorsApi* | [**deposit_txid_options**](docs/CorsApi.md#deposit_txid_options) | **OPTIONS** /deposit/{txid} | CORS support
*CorsApi* | [**health_options**](docs/CorsApi.md#health_options) | **OPTIONS** /health | CORS support
@@ -43,6 +44,7 @@ Class | Method | HTTP request | Description
*DepositApi* | [**create_deposit**](docs/DepositApi.md#create_deposit) | **POST** /deposit | Create deposit handler.
*DepositApi* | [**get_deposit**](docs/DepositApi.md#get_deposit) | **GET** /deposit/{txid}/{index} | Get deposit handler.
*DepositApi* | [**get_deposits**](docs/DepositApi.md#get_deposits) | **GET** /deposit | Get deposits handler.
*DepositApi* | [**get_deposits_for_recipient**](docs/DepositApi.md#get_deposits_for_recipient) | **GET** /deposit/recipient/{recipient} | Get deposits by recipient handler.
*DepositApi* | [**get_deposits_for_transaction**](docs/DepositApi.md#get_deposits_for_transaction) | **GET** /deposit/{txid} | Get deposits for transaction handler.
*DepositApi* | [**update_deposits**](docs/DepositApi.md#update_deposits) | **PUT** /deposit | Update deposits handler.
*HealthApi* | [**check_health**](docs/HealthApi.md#check_health) | **GET** /health | Get health handler.
31 changes: 31 additions & 0 deletions .generated-sources/emily/client/rust/public/docs/CorsApi.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ Method | HTTP request | Description
[**chainstate_height_options**](CorsApi.md#chainstate_height_options) | **OPTIONS** /chainstate/{height} | CORS support
[**chainstate_options**](CorsApi.md#chainstate_options) | **OPTIONS** /chainstate | CORS support
[**deposit_options**](CorsApi.md#deposit_options) | **OPTIONS** /deposit | CORS support
[**deposit_recipient_recipient_options**](CorsApi.md#deposit_recipient_recipient_options) | **OPTIONS** /deposit/recipient/{recipient} | CORS support
[**deposit_txid_index_options**](CorsApi.md#deposit_txid_index_options) | **OPTIONS** /deposit/{txid}/{index} | CORS support
[**deposit_txid_options**](CorsApi.md#deposit_txid_options) | **OPTIONS** /deposit/{txid} | CORS support
[**health_options**](CorsApi.md#health_options) | **OPTIONS** /health | CORS support
@@ -102,6 +103,36 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## deposit_recipient_recipient_options

> deposit_recipient_recipient_options(recipient)
CORS support

Handles CORS preflight requests

### Parameters


Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**recipient** | **String** | the status to search by when getting all deposits. | [required] |

### Return type

(empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## deposit_txid_index_options

> deposit_txid_index_options(txid, index)
31 changes: 31 additions & 0 deletions .generated-sources/emily/client/rust/public/docs/DepositApi.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ Method | HTTP request | Description
[**create_deposit**](DepositApi.md#create_deposit) | **POST** /deposit | Create deposit handler.
[**get_deposit**](DepositApi.md#get_deposit) | **GET** /deposit/{txid}/{index} | Get deposit handler.
[**get_deposits**](DepositApi.md#get_deposits) | **GET** /deposit | Get deposits handler.
[**get_deposits_for_recipient**](DepositApi.md#get_deposits_for_recipient) | **GET** /deposit/recipient/{recipient} | Get deposits by recipient handler.
[**get_deposits_for_transaction**](DepositApi.md#get_deposits_for_transaction) | **GET** /deposit/{txid} | Get deposits for transaction handler.
[**update_deposits**](DepositApi.md#update_deposits) | **PUT** /deposit | Update deposits handler.

@@ -99,6 +100,36 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_deposits_for_recipient

> models::GetDepositsResponse get_deposits_for_recipient(recipient, next_token, page_size)
Get deposits by recipient handler.

### Parameters


Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**recipient** | **String** | the status to search by when getting all deposits. | [required] |
**next_token** | Option<**String**> | the next token value from the previous return of this api call. | |
**page_size** | Option<**i32**> | the maximum number of items in the response list. | |

### Return type

[**models::GetDepositsResponse**](GetDepositsResponse.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_deposits_for_transaction

> models::GetDepositsForTransactionResponse get_deposits_for_transaction(txid, next_token, page_size)
Loading