create-sia-app 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +179 -0
  3. package/package.json +29 -0
  4. package/template/CLAUDE.md +160 -0
  5. package/template/README.md +102 -0
  6. package/template/_gitignore +5 -0
  7. package/template/biome.json +40 -0
  8. package/template/index.html +13 -0
  9. package/template/package.json +30 -0
  10. package/template/rust/README.md +16 -0
  11. package/template/rust/sia-sdk-rs/.changeset/added_cancel_function_to_cancel_inflight_packed_uploads.md +6 -0
  12. package/template/rust/sia-sdk-rs/.changeset/check_if_we_have_enough_hosts_prior_to_encoding_in_upload_slabs.md +16 -0
  13. package/template/rust/sia-sdk-rs/.changeset/fix_slab_length_in_packed_object.md +5 -0
  14. package/template/rust/sia-sdk-rs/.changeset/fix_upload_racing_race_conditon.md +13 -0
  15. package/template/rust/sia-sdk-rs/.changeset/improved_parallelism_of_packed_uploads.md +5 -0
  16. package/template/rust/sia-sdk-rs/.changeset/progress_callback_will_now_be_called_as_expected_for_packed_uploads.md +5 -0
  17. package/template/rust/sia-sdk-rs/.github/dependabot.yml +10 -0
  18. package/template/rust/sia-sdk-rs/.github/workflows/main.yml +36 -0
  19. package/template/rust/sia-sdk-rs/.github/workflows/prepare-release.yml +34 -0
  20. package/template/rust/sia-sdk-rs/.github/workflows/release.yml +30 -0
  21. package/template/rust/sia-sdk-rs/.rustfmt.toml +4 -0
  22. package/template/rust/sia-sdk-rs/Cargo.lock +4127 -0
  23. package/template/rust/sia-sdk-rs/Cargo.toml +3 -0
  24. package/template/rust/sia-sdk-rs/LICENSE +21 -0
  25. package/template/rust/sia-sdk-rs/README.md +30 -0
  26. package/template/rust/sia-sdk-rs/indexd/CHANGELOG.md +79 -0
  27. package/template/rust/sia-sdk-rs/indexd/Cargo.toml +79 -0
  28. package/template/rust/sia-sdk-rs/indexd/benches/upload.rs +258 -0
  29. package/template/rust/sia-sdk-rs/indexd/src/app_client.rs +1710 -0
  30. package/template/rust/sia-sdk-rs/indexd/src/builder.rs +354 -0
  31. package/template/rust/sia-sdk-rs/indexd/src/download.rs +379 -0
  32. package/template/rust/sia-sdk-rs/indexd/src/hosts.rs +659 -0
  33. package/template/rust/sia-sdk-rs/indexd/src/lib.rs +827 -0
  34. package/template/rust/sia-sdk-rs/indexd/src/mock.rs +162 -0
  35. package/template/rust/sia-sdk-rs/indexd/src/object_encryption.rs +125 -0
  36. package/template/rust/sia-sdk-rs/indexd/src/quic.rs +575 -0
  37. package/template/rust/sia-sdk-rs/indexd/src/rhp4.rs +52 -0
  38. package/template/rust/sia-sdk-rs/indexd/src/slabs.rs +497 -0
  39. package/template/rust/sia-sdk-rs/indexd/src/upload.rs +629 -0
  40. package/template/rust/sia-sdk-rs/indexd/src/wasm_time.rs +41 -0
  41. package/template/rust/sia-sdk-rs/indexd/src/web_transport.rs +398 -0
  42. package/template/rust/sia-sdk-rs/indexd_ffi/CHANGELOG.md +76 -0
  43. package/template/rust/sia-sdk-rs/indexd_ffi/Cargo.toml +47 -0
  44. package/template/rust/sia-sdk-rs/indexd_ffi/examples/python/README.md +10 -0
  45. package/template/rust/sia-sdk-rs/indexd_ffi/examples/python/example.py +130 -0
  46. package/template/rust/sia-sdk-rs/indexd_ffi/src/bin/uniffi-bindgen.rs +3 -0
  47. package/template/rust/sia-sdk-rs/indexd_ffi/src/builder.rs +377 -0
  48. package/template/rust/sia-sdk-rs/indexd_ffi/src/io.rs +155 -0
  49. package/template/rust/sia-sdk-rs/indexd_ffi/src/lib.rs +1039 -0
  50. package/template/rust/sia-sdk-rs/indexd_ffi/src/logging.rs +58 -0
  51. package/template/rust/sia-sdk-rs/indexd_ffi/src/tls.rs +23 -0
  52. package/template/rust/sia-sdk-rs/indexd_wasm/Cargo.toml +33 -0
  53. package/template/rust/sia-sdk-rs/indexd_wasm/src/lib.rs +818 -0
  54. package/template/rust/sia-sdk-rs/knope.toml +54 -0
  55. package/template/rust/sia-sdk-rs/sia_derive/CHANGELOG.md +38 -0
  56. package/template/rust/sia-sdk-rs/sia_derive/Cargo.toml +19 -0
  57. package/template/rust/sia-sdk-rs/sia_derive/src/lib.rs +278 -0
  58. package/template/rust/sia-sdk-rs/sia_sdk/CHANGELOG.md +91 -0
  59. package/template/rust/sia-sdk-rs/sia_sdk/Cargo.toml +59 -0
  60. package/template/rust/sia-sdk-rs/sia_sdk/benches/merkle_root.rs +12 -0
  61. package/template/rust/sia-sdk-rs/sia_sdk/src/blake2.rs +22 -0
  62. package/template/rust/sia-sdk-rs/sia_sdk/src/consensus.rs +767 -0
  63. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding/v1.rs +257 -0
  64. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding/v2.rs +291 -0
  65. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding.rs +26 -0
  66. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding_async/v2.rs +367 -0
  67. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding_async.rs +6 -0
  68. package/template/rust/sia-sdk-rs/sia_sdk/src/encryption.rs +303 -0
  69. package/template/rust/sia-sdk-rs/sia_sdk/src/erasure_coding.rs +347 -0
  70. package/template/rust/sia-sdk-rs/sia_sdk/src/lib.rs +15 -0
  71. package/template/rust/sia-sdk-rs/sia_sdk/src/macros.rs +435 -0
  72. package/template/rust/sia-sdk-rs/sia_sdk/src/merkle.rs +112 -0
  73. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/merkle.rs +357 -0
  74. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/rpc.rs +1507 -0
  75. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/types.rs +146 -0
  76. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp.rs +7 -0
  77. package/template/rust/sia-sdk-rs/sia_sdk/src/seed.rs +278 -0
  78. package/template/rust/sia-sdk-rs/sia_sdk/src/signing.rs +236 -0
  79. package/template/rust/sia-sdk-rs/sia_sdk/src/types/common.rs +677 -0
  80. package/template/rust/sia-sdk-rs/sia_sdk/src/types/currency.rs +450 -0
  81. package/template/rust/sia-sdk-rs/sia_sdk/src/types/specifier.rs +110 -0
  82. package/template/rust/sia-sdk-rs/sia_sdk/src/types/spendpolicy.rs +778 -0
  83. package/template/rust/sia-sdk-rs/sia_sdk/src/types/utils.rs +117 -0
  84. package/template/rust/sia-sdk-rs/sia_sdk/src/types/v1.rs +1737 -0
  85. package/template/rust/sia-sdk-rs/sia_sdk/src/types/v2.rs +1726 -0
  86. package/template/rust/sia-sdk-rs/sia_sdk/src/types/work.rs +59 -0
  87. package/template/rust/sia-sdk-rs/sia_sdk/src/types.rs +16 -0
  88. package/template/scripts/setup-rust.js +29 -0
  89. package/template/src/App.tsx +13 -0
  90. package/template/src/components/DevNote.tsx +21 -0
  91. package/template/src/components/auth/ApproveScreen.tsx +84 -0
  92. package/template/src/components/auth/AuthFlow.tsx +77 -0
  93. package/template/src/components/auth/ConnectScreen.tsx +214 -0
  94. package/template/src/components/auth/LoadingScreen.tsx +8 -0
  95. package/template/src/components/auth/RecoveryScreen.tsx +182 -0
  96. package/template/src/components/upload/UploadZone.tsx +314 -0
  97. package/template/src/index.css +9 -0
  98. package/template/src/lib/constants.ts +8 -0
  99. package/template/src/lib/format.ts +35 -0
  100. package/template/src/lib/hex.ts +13 -0
  101. package/template/src/lib/sdk.ts +25 -0
  102. package/template/src/lib/wasm-env.ts +5 -0
  103. package/template/src/main.tsx +12 -0
  104. package/template/src/stores/auth.ts +86 -0
  105. package/template/tsconfig.app.json +31 -0
  106. package/template/tsconfig.json +7 -0
  107. package/template/tsconfig.node.json +26 -0
  108. package/template/vite.config.ts +18 -0
  109. package/template/wasm/indexd_wasm/indexd_wasm.d.ts +309 -0
  110. package/template/wasm/indexd_wasm/indexd_wasm.js +1507 -0
  111. package/template/wasm/indexd_wasm/indexd_wasm_bg.wasm +0 -0
  112. package/template/wasm/indexd_wasm/package.json +31 -0
@@ -0,0 +1,54 @@
1
+ [packages.sia_sdk]
2
+ versioned_files = [
3
+ "sia_sdk/Cargo.toml",
4
+ { path = "indexd/Cargo.toml", dependency = "sia_sdk" },
5
+ { path = "indexd_ffi/Cargo.toml", dependency = "sia_sdk" },
6
+ { path = "Cargo.lock", dependency = "sia_sdk" }
7
+ ]
8
+ changelog = "sia_sdk/CHANGELOG.md"
9
+
10
+ [packages.sia_sdk_derive]
11
+ versioned_files = [
12
+ "sia_derive/Cargo.toml",
13
+ { path = "sia_sdk/Cargo.toml", dependency = "sia-sdk-derive" },
14
+ { path = "Cargo.lock", dependency = "sia-sdk-derive" }
15
+ ]
16
+ changelog = "sia_derive/CHANGELOG.md"
17
+
18
+ [packages.indexd]
19
+ versioned_files = [
20
+ "indexd/Cargo.toml",
21
+ { path = "indexd_ffi/Cargo.toml", dependency = "indexd" },
22
+ { path = "Cargo.lock", dependency = "indexd" }
23
+ ]
24
+ changelog = "indexd/CHANGELOG.md"
25
+
26
+ [packages.indexd_ffi]
27
+ versioned_files = [
28
+ "indexd_ffi/Cargo.toml",
29
+ { path = "Cargo.lock", dependency = "indexd_ffi" }
30
+ ]
31
+ changelog = "indexd_ffi/CHANGELOG.md"
32
+
33
+ [[workflows]]
34
+ name = "document-change"
35
+
36
+ [[workflows.steps]]
37
+ type = "CreateChangeFile"
38
+
39
+ [[workflows]]
40
+ name = "prepare-release"
41
+ ignore_conventional_commits = true
42
+
43
+ [[workflows.steps]]
44
+ type = "PrepareRelease"
45
+
46
+ [[workflows]]
47
+ name = "release"
48
+
49
+ [[workflows.steps]]
50
+ type = "Release"
51
+
52
+ [github]
53
+ owner = "SiaFoundation"
54
+ repo = "sia-sdk-rs"
@@ -0,0 +1,38 @@
1
+ ## 0.0.6 (2025-10-04)
2
+
3
+ ### Features
4
+
5
+ - Add JSON serialization to ChainState
6
+
7
+ ## 0.0.5 (2025-10-04)
8
+
9
+ ### Features
10
+
11
+ - Add JSON serialization to ChainState
12
+
13
+ ## 0.0.4 (2025-10-04)
14
+
15
+ ### Features
16
+
17
+ - Add JSON serialization to ChainState
18
+
19
+ ## 0.0.3 (2025-10-04)
20
+
21
+ ### Features
22
+
23
+ - Add JSON serialization to ChainState
24
+ - Add account API endpoint to app_client and FFI implementation.
25
+ - Add pin_slab and unpin_slab to FFI.
26
+ - Added AsyncSiaEncodable and AsyncSiaDecodable traits.
27
+ - Use randomly generated encryption keys.
28
+
29
+ ### Fixes
30
+
31
+ - Swap out 'time' dependency for 'chrono'.
32
+ - Use PublicKey for account key type.
33
+
34
+ ## 0.0.2 (2025-07-21)
35
+
36
+ ### Features
37
+
38
+ - Add JSON serialization to ChainState
@@ -0,0 +1,19 @@
1
+ [package]
2
+ name = "sia-sdk-derive"
3
+ version = "0.0.6"
4
+ edition = "2024"
5
+ repository = "https://github.com/SiaFoundation/sia-sdk-rs"
6
+ license = "MIT"
7
+ description = "Macro implementations for sia-sdk"
8
+ authors = ["The Sia Foundation"]
9
+ categories = ["cryptography::cryptocurrencies"]
10
+ keywords = ["sia", "decentralized", "blockchain", "depin", "storage"]
11
+
12
+ [lib]
13
+ proc-macro = true
14
+ name = "sia_derive"
15
+
16
+ [dependencies]
17
+ syn = "2.0"
18
+ quote = "1.0"
19
+ proc-macro2 = "1.0"
@@ -0,0 +1,278 @@
1
+ use proc_macro::TokenStream;
2
+ use quote::quote;
3
+ use syn::{Data, DeriveInput, Fields, parse_macro_input};
4
+
5
+ #[proc_macro_derive(SiaEncode)]
6
+ pub fn derive_sia_encode(input: TokenStream) -> TokenStream {
7
+ let input = parse_macro_input!(input as DeriveInput);
8
+ let name = &input.ident;
9
+
10
+ let encode_impl = match &input.data {
11
+ Data::Struct(data) => {
12
+ let fields = match &data.fields {
13
+ Fields::Named(fields) => {
14
+ let encodes = fields.named.iter().filter_map(|f| match f.vis {
15
+ syn::Visibility::Public(_) => {
16
+ let name = &f.ident;
17
+ Some(quote! { self.#name.encode(w)?; })
18
+ }
19
+ _ => None,
20
+ });
21
+ quote! { #(#encodes)* }
22
+ }
23
+ Fields::Unnamed(fields) => {
24
+ let encodes = fields.unnamed.iter().enumerate().map(|(i, _)| {
25
+ let index = syn::Index::from(i);
26
+ quote! { self.#index.encode(w)?; }
27
+ });
28
+ quote! { #(#encodes)* }
29
+ }
30
+ Fields::Unit => quote! {},
31
+ };
32
+ quote! {
33
+ #fields
34
+ Ok(())
35
+ }
36
+ }
37
+ Data::Enum(_) => panic!("enums not supported"),
38
+ Data::Union(_) => panic!("unions not supported"),
39
+ };
40
+
41
+ let expanded = quote! {
42
+ impl SiaEncodable for #name {
43
+ fn encode<W: std::io::Write>(&self, w: &mut W) -> sia::encoding::Result<()> {
44
+ #encode_impl
45
+ }
46
+ }
47
+ };
48
+
49
+ TokenStream::from(expanded)
50
+ }
51
+
52
+ #[proc_macro_derive(SiaDecode)]
53
+ pub fn derive_sia_decode(input: TokenStream) -> TokenStream {
54
+ let input = parse_macro_input!(input as DeriveInput);
55
+ let name = &input.ident;
56
+
57
+ let decode_impl = match &input.data {
58
+ Data::Struct(data) => match &data.fields {
59
+ Fields::Named(fields) => {
60
+ let decodes = fields.named.iter().filter_map(|f| match f.vis {
61
+ syn::Visibility::Public(_) => {
62
+ let name = &f.ident;
63
+ let ty = &f.ty;
64
+ Some(quote! { #name: <#ty>::decode(r)?, })
65
+ }
66
+ _ => None,
67
+ });
68
+ quote! {
69
+ Ok(Self {
70
+ #(#decodes)*
71
+ })
72
+ }
73
+ }
74
+ Fields::Unnamed(fields) => {
75
+ let decodes = fields.unnamed.iter().map(|f| {
76
+ let ty = &f.ty;
77
+ quote! { <#ty>::decode(r)?, }
78
+ });
79
+ quote! {
80
+ Ok(Self(#(#decodes)*))
81
+ }
82
+ }
83
+ Fields::Unit => quote! { Ok(Self) },
84
+ },
85
+ Data::Enum(_) => panic!("enums not supported"),
86
+ Data::Union(_) => panic!("unions not supported"),
87
+ };
88
+
89
+ let expanded = quote! {
90
+ impl SiaDecodable for #name {
91
+ fn decode<R: std::io::Read>(r: &mut R) -> sia::encoding::Result<Self> {
92
+ #decode_impl
93
+ }
94
+ }
95
+ };
96
+ TokenStream::from(expanded)
97
+ }
98
+
99
+ #[proc_macro_derive(V1SiaEncode)]
100
+ pub fn derive_v1_sia_encode(input: TokenStream) -> TokenStream {
101
+ let input = parse_macro_input!(input as DeriveInput);
102
+ let name = &input.ident;
103
+
104
+ let encode_impl = match &input.data {
105
+ Data::Struct(data) => {
106
+ let fields = match &data.fields {
107
+ Fields::Named(fields) => {
108
+ let encodes = fields.named.iter().map(|f| {
109
+ let name = &f.ident;
110
+ quote! { self.#name.encode_v1(enc)?; }
111
+ });
112
+ quote! { #(#encodes)* }
113
+ }
114
+ Fields::Unnamed(fields) => {
115
+ let encodes = fields.unnamed.iter().enumerate().map(|(i, _)| {
116
+ let index = syn::Index::from(i);
117
+ quote! { self.#index.encode_v1(enc)?; }
118
+ });
119
+ quote! { #(#encodes)* }
120
+ }
121
+ Fields::Unit => quote! {},
122
+ };
123
+ quote! {
124
+ #fields
125
+ Ok(())
126
+ }
127
+ }
128
+ Data::Enum(_) => panic!("enums not supported"),
129
+ Data::Union(_) => panic!("unions not supported"),
130
+ };
131
+
132
+ let expanded = quote! {
133
+ impl V1SiaEncodable for #name {
134
+ fn encode_v1<W: std::io::Write>(&self, enc: &mut W) -> crate::encoding::Result<()> {
135
+ #encode_impl
136
+ }
137
+ }
138
+ };
139
+ TokenStream::from(expanded)
140
+ }
141
+
142
+ #[proc_macro_derive(V1SiaDecode)]
143
+ pub fn derive_v1_sia_decode(input: TokenStream) -> TokenStream {
144
+ let input = parse_macro_input!(input as DeriveInput);
145
+ let name = &input.ident;
146
+
147
+ let decode_impl = match &input.data {
148
+ Data::Struct(data) => match &data.fields {
149
+ Fields::Named(fields) => {
150
+ let decodes = fields.named.iter().map(|f| {
151
+ let name = &f.ident;
152
+ let ty = &f.ty;
153
+ quote! { #name: <#ty>::decode_v1(r)?, }
154
+ });
155
+ quote! {
156
+ Ok(Self {
157
+ #(#decodes)*
158
+ })
159
+ }
160
+ }
161
+ Fields::Unnamed(fields) => {
162
+ let decodes = fields.unnamed.iter().map(|f| {
163
+ let ty = &f.ty;
164
+ quote! { <#ty>::decode_v1(r)?, }
165
+ });
166
+ quote! {
167
+ Ok(Self(#(#decodes)*))
168
+ }
169
+ }
170
+ Fields::Unit => quote! { Ok(Self) },
171
+ },
172
+ Data::Enum(_) => panic!("enums not supported"),
173
+ Data::Union(_) => panic!("unions not supported"),
174
+ };
175
+
176
+ let expanded = quote! {
177
+ impl V1SiaDecodable for #name {
178
+ fn decode_v1<R: std::io::Read>(r: &mut R) -> crate::encoding::Result<Self> {
179
+ #decode_impl
180
+ }
181
+ }
182
+ };
183
+ TokenStream::from(expanded)
184
+ }
185
+
186
+ #[proc_macro_derive(AsyncSiaEncode)]
187
+ pub fn derive_async_sia_encode(input: TokenStream) -> TokenStream {
188
+ let input = parse_macro_input!(input as DeriveInput);
189
+ let name = &input.ident;
190
+
191
+ let encode_impl = match &input.data {
192
+ Data::Struct(data) => {
193
+ let fields = match &data.fields {
194
+ Fields::Named(fields) => {
195
+ let encodes = fields.named.iter().filter_map(|f| match f.vis {
196
+ syn::Visibility::Public(_) => {
197
+ let name = &f.ident;
198
+ Some(quote! { self.#name.encode_async(e).await?; })
199
+ }
200
+ _ => None,
201
+ });
202
+ quote! { #(#encodes)* }
203
+ }
204
+ Fields::Unnamed(fields) => {
205
+ let encodes = fields.unnamed.iter().enumerate().map(|(i, _)| {
206
+ let index = syn::Index::from(i);
207
+ quote! { self.#index.encode_async(e).await?; }
208
+ });
209
+ quote! { #(#encodes)* }
210
+ }
211
+ Fields::Unit => quote! {},
212
+ };
213
+ quote! {
214
+ #fields
215
+ Ok(())
216
+ }
217
+ }
218
+ Data::Enum(_) => panic!("enums not supported"),
219
+ Data::Union(_) => panic!("unions not supported"),
220
+ };
221
+
222
+ let expanded = quote! {
223
+ impl AsyncSiaEncodable for #name {
224
+ async fn encode_async<E: crate::encoding_async::AsyncEncoder>(&self, e: &mut E) -> Result<(), E::Error> {
225
+ #encode_impl
226
+ }
227
+ }
228
+ };
229
+
230
+ TokenStream::from(expanded)
231
+ }
232
+
233
+ #[proc_macro_derive(AsyncSiaDecode)]
234
+ pub fn derive_async_sia_decode(input: TokenStream) -> TokenStream {
235
+ let input = parse_macro_input!(input as DeriveInput);
236
+ let name = &input.ident;
237
+
238
+ let decode_impl = match &input.data {
239
+ Data::Struct(data) => match &data.fields {
240
+ Fields::Named(fields) => {
241
+ let decodes = fields.named.iter().filter_map(|f| match f.vis {
242
+ syn::Visibility::Public(_) => {
243
+ let name = &f.ident;
244
+ let ty = &f.ty;
245
+ Some(quote! { #name: <#ty>::decode_async(d).await?, })
246
+ }
247
+ _ => None,
248
+ });
249
+ quote! {
250
+ Ok(Self {
251
+ #(#decodes)*
252
+ })
253
+ }
254
+ }
255
+ Fields::Unnamed(fields) => {
256
+ let decodes = fields.unnamed.iter().map(|f| {
257
+ let ty = &f.ty;
258
+ quote! { <#ty>::decode_async(d).await?, }
259
+ });
260
+ quote! {
261
+ Ok(Self(#(#decodes)*))
262
+ }
263
+ }
264
+ Fields::Unit => quote! { Ok(Self) },
265
+ },
266
+ Data::Enum(_) => panic!("enums not supported"),
267
+ Data::Union(_) => panic!("unions not supported"),
268
+ };
269
+
270
+ let expanded = quote! {
271
+ impl AsyncSiaDecodable for #name {
272
+ async fn decode_async<D: crate::encoding_async::AsyncDecoder>(d: &mut D) -> Result<Self, D::Error> {
273
+ #decode_impl
274
+ }
275
+ }
276
+ };
277
+ TokenStream::from(expanded)
278
+ }
@@ -0,0 +1,91 @@
1
+ ## 0.2.0 (2026-01-28)
2
+
3
+ ### Breaking Changes
4
+
5
+ - Changes the Seed constructor to accept a mnemonic instead of raw entropy and adds `Seed::from_seed` to replace the old constructor.
6
+ - Merge SlabSlice and Slab types.
7
+
8
+ ### Features
9
+
10
+ - Added signature macro for testing.
11
+
12
+ ### Fixes
13
+
14
+ - Fix release registry
15
+ - Make use of goodForUpload field
16
+
17
+ ## 0.1.3 (2025-10-04)
18
+
19
+ ### Features
20
+
21
+ - Add JSON serialization to ChainState
22
+
23
+ ### Fixes
24
+
25
+ - Fixed release workflow.
26
+
27
+ ## 0.1.2 (2025-10-04)
28
+
29
+ ### Features
30
+
31
+ - Add JSON serialization to ChainState
32
+
33
+ ### Fixes
34
+
35
+ - Fix path dependency versions.
36
+
37
+ ## 0.1.1 (2025-10-04)
38
+
39
+ ### Features
40
+
41
+ - Add JSON serialization to ChainState
42
+
43
+ ## 0.1.0 (2025-10-04)
44
+
45
+ ### Breaking Changes
46
+
47
+ - Change signing code to borrow.
48
+
49
+ ### Features
50
+
51
+ - Add JSON serialization to ChainState
52
+ - Add account API endpoint to app_client and FFI implementation.
53
+ - Add generic support for reading and writing erasure-coded slabs.
54
+ - Add method to generate object URLs.
55
+ - Add object methods to FFI crate.
56
+ - Add pin_slab and unpin_slab to FFI.
57
+ - Add an SDK client that exposes an upload and download method.
58
+ - Add slab downloader.
59
+ - Add support for encrypting and decrypting shards.
60
+ - Add support for ReedSolomon erasure coding.
61
+ - Added AsyncSiaEncodable and AsyncSiaDecodable traits.
62
+ - Added object uploading.
63
+ - Added RHP4 request and response types.
64
+ - Added RHP4 RPC usage and helpers.
65
+ - Implement client-side encryption for quic uploads and downloads.
66
+ - Support download range requests.
67
+ - Use randomly generated encryption keys.
68
+ - Verify proofs in RPCWriteSector and RPCReadSector.
69
+
70
+ ### Fixes
71
+
72
+ - Add V2 host announcement support.
73
+ - Fixed RPC write sector encoding.
74
+ - Swap out 'time' dependency for 'chrono'.
75
+ - Use PublicKey for account key type.
76
+
77
+ ## 0.0.2 (2025-07-21)
78
+
79
+ ### Features
80
+
81
+ - Add JSON serialization to ChainState
82
+ - Add ID derivation helpers to transactions, blocks, and siafund claims
83
+ - v2 signing implemented
84
+
85
+ #### Refactor V1 transaction signing
86
+
87
+ Replaced `v1::Transaction::sign` with `v1::Transaction::whole_sig_hash` and `v1::Transaction::partial_sig_hash`. This change is primarily to provide a more consistent experience with `core` and the V2::Transaction API.
88
+
89
+ ### Fixes
90
+
91
+ - Fix element accumulator encoding
@@ -0,0 +1,59 @@
1
+ [package]
2
+ name = "sia_sdk"
3
+ version = "0.2.0"
4
+ edition = "2024"
5
+ repository = "https://github.com/SiaFoundation/sia-sdk-rs"
6
+ license = "MIT"
7
+ description = "Low-level SDK for interacting with the Sia decentralized storage network"
8
+ authors = ["The Sia Foundation"]
9
+ categories = ["cryptography::cryptocurrencies"]
10
+ keywords = ["sia", "decentralized", "blockchain", "depin", "storage"]
11
+
12
+ [lib]
13
+ name = "sia"
14
+ path = "src/lib.rs"
15
+
16
+ [dependencies]
17
+ base64 = "0.22.1"
18
+ bip39 = "2.2.2"
19
+ blake2 = "0.10.6"
20
+ blake2b_simd = "1.0.4"
21
+ bytes = "1.11.1"
22
+ chacha20 = { version = "0.10.0", features = ["xchacha"] }
23
+ chrono = { version = "0.4.43", features = ["serde"] }
24
+ ed25519-dalek = "2.2.0"
25
+ hex = "0.4.3"
26
+ num-bigint = "0.4.6"
27
+ num-rational = { version = "0.4.2", features = ["num-bigint"] }
28
+ num-traits = "0.2.19"
29
+ rayon = "1.11.0"
30
+ reed-solomon-erasure = "6.0.0"
31
+ serde = { version = "1.0.228", features = ["derive"] }
32
+ serde_json = "1.0.149"
33
+ sha2 = "0.10.9"
34
+ sia-sdk-derive = { version = "0.0.6", path = "../sia_derive" }
35
+ thiserror = "2.0.18"
36
+ tokio = { version = "1.49.0", features = [
37
+ "macros",
38
+ "rt",
39
+ "sync",
40
+ "io-util",
41
+ "time",
42
+ ] }
43
+ uint = "0.10.0"
44
+ zeroize = { version = "1.8.1", features = ["zeroize_derive"] }
45
+
46
+ [dev-dependencies]
47
+ criterion = { version = "0.8", features = ["async_tokio"] }
48
+ tokio = { version = "1.49.0", features = [
49
+ "macros",
50
+ "rt-multi-thread",
51
+ "sync",
52
+ "io-util",
53
+ ] }
54
+ rustls-platform-verifier = "0.6.2"
55
+ rand = "0.10.0"
56
+
57
+ [[bench]]
58
+ name = "merkle_root"
59
+ harness = false
@@ -0,0 +1,12 @@
1
+ use criterion::{Criterion, criterion_group, criterion_main};
2
+ use std::hint::black_box;
3
+
4
+ fn criterion_benchmark(c: &mut Criterion) {
5
+ let sector = [0u8; 1 << 22];
6
+ c.bench_function("sector_root", |b| {
7
+ b.iter(|| sia::rhp::sector_root(black_box(&sector)))
8
+ });
9
+ }
10
+
11
+ criterion_group!(benches, criterion_benchmark);
12
+ criterion_main!(benches);
@@ -0,0 +1,22 @@
1
+ use blake2::Blake2b;
2
+ use blake2::digest::consts::U32;
3
+
4
+ pub use blake2::digest::Digest;
5
+ pub type Output = blake2::digest::Output<Blake2b256>;
6
+ pub type Blake2b256 = Blake2b<U32>;
7
+
8
+ #[cfg(test)]
9
+ mod test {
10
+ use super::*;
11
+
12
+ #[test]
13
+ pub fn test_blake2b256() {
14
+ let mut hasher = Blake2b256::new();
15
+ hasher.update(b"hello, world!");
16
+ let result = hasher.finalize();
17
+ let expected =
18
+ hex::decode("480a927c7e3f9430f03141250f1def67380fec3943accb4575e568750a103638")
19
+ .unwrap();
20
+ assert_eq!(result.to_vec(), expected);
21
+ }
22
+ }