create-sia-app 0.1.7 → 0.1.9

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 (114) hide show
  1. package/package.json +2 -6
  2. package/template/AGENTS.md +143 -0
  3. package/template/CLAUDE.md +25 -46
  4. package/template/README.md +6 -12
  5. package/template/_gitignore +0 -1
  6. package/template/dist/assets/index-BEylY2j7.css +1 -0
  7. package/template/dist/assets/index-CnYqArKN.js +8741 -0
  8. package/template/dist/assets/sia_bg-BTOHUC1A.wasm +0 -0
  9. package/template/dist/assets/slab-download-worker-DhW6ZBJs.js +2 -0
  10. package/template/dist/assets/slab-upload-worker-B2uSB2iY.js +2 -0
  11. package/template/dist/index.html +13 -0
  12. package/template/e2e/smoke.spec.ts +20 -0
  13. package/template/index.html +0 -1
  14. package/template/package.json +2 -2
  15. package/template/playwright.config.ts +13 -0
  16. package/template/src/components/Navbar.tsx +3 -3
  17. package/template/src/components/auth/ApproveScreen.tsx +10 -13
  18. package/template/src/components/auth/AuthFlow.tsx +13 -10
  19. package/template/src/components/auth/ConnectScreen.tsx +2 -3
  20. package/template/src/components/auth/RecoveryScreen.tsx +7 -7
  21. package/template/src/components/upload/UploadZone.tsx +192 -74
  22. package/template/src/index.css +14 -4
  23. package/template/src/stores/auth.ts +6 -12
  24. package/template/test-results/.last-run.json +4 -0
  25. package/template/tsconfig.app.json +1 -1
  26. package/template/tsconfig.node.json +0 -1
  27. package/template/vite.config.ts +2 -3
  28. package/template/rust/README.md +0 -16
  29. package/template/rust/sia-sdk-rs/.changeset/added_cancel_function_to_cancel_inflight_packed_uploads.md +0 -6
  30. package/template/rust/sia-sdk-rs/.changeset/check_if_we_have_enough_hosts_prior_to_encoding_in_upload_slabs.md +0 -16
  31. package/template/rust/sia-sdk-rs/.changeset/fix_slab_length_in_packed_object.md +0 -5
  32. package/template/rust/sia-sdk-rs/.changeset/fix_upload_racing_race_conditon.md +0 -13
  33. package/template/rust/sia-sdk-rs/.changeset/improved_parallelism_of_packed_uploads.md +0 -5
  34. package/template/rust/sia-sdk-rs/.changeset/progress_callback_will_now_be_called_as_expected_for_packed_uploads.md +0 -5
  35. package/template/rust/sia-sdk-rs/.github/dependabot.yml +0 -10
  36. package/template/rust/sia-sdk-rs/.github/workflows/main.yml +0 -36
  37. package/template/rust/sia-sdk-rs/.github/workflows/prepare-release.yml +0 -34
  38. package/template/rust/sia-sdk-rs/.github/workflows/release.yml +0 -30
  39. package/template/rust/sia-sdk-rs/.rustfmt.toml +0 -4
  40. package/template/rust/sia-sdk-rs/Cargo.lock +0 -4127
  41. package/template/rust/sia-sdk-rs/Cargo.toml +0 -3
  42. package/template/rust/sia-sdk-rs/LICENSE +0 -21
  43. package/template/rust/sia-sdk-rs/README.md +0 -30
  44. package/template/rust/sia-sdk-rs/indexd/CHANGELOG.md +0 -79
  45. package/template/rust/sia-sdk-rs/indexd/Cargo.toml +0 -79
  46. package/template/rust/sia-sdk-rs/indexd/benches/upload.rs +0 -258
  47. package/template/rust/sia-sdk-rs/indexd/src/app_client.rs +0 -1710
  48. package/template/rust/sia-sdk-rs/indexd/src/builder.rs +0 -354
  49. package/template/rust/sia-sdk-rs/indexd/src/download.rs +0 -379
  50. package/template/rust/sia-sdk-rs/indexd/src/hosts.rs +0 -659
  51. package/template/rust/sia-sdk-rs/indexd/src/lib.rs +0 -827
  52. package/template/rust/sia-sdk-rs/indexd/src/mock.rs +0 -162
  53. package/template/rust/sia-sdk-rs/indexd/src/object_encryption.rs +0 -125
  54. package/template/rust/sia-sdk-rs/indexd/src/quic.rs +0 -575
  55. package/template/rust/sia-sdk-rs/indexd/src/rhp4.rs +0 -52
  56. package/template/rust/sia-sdk-rs/indexd/src/slabs.rs +0 -497
  57. package/template/rust/sia-sdk-rs/indexd/src/upload.rs +0 -629
  58. package/template/rust/sia-sdk-rs/indexd/src/wasm_time.rs +0 -41
  59. package/template/rust/sia-sdk-rs/indexd/src/web_transport.rs +0 -398
  60. package/template/rust/sia-sdk-rs/indexd_ffi/CHANGELOG.md +0 -76
  61. package/template/rust/sia-sdk-rs/indexd_ffi/Cargo.toml +0 -47
  62. package/template/rust/sia-sdk-rs/indexd_ffi/examples/python/README.md +0 -10
  63. package/template/rust/sia-sdk-rs/indexd_ffi/examples/python/example.py +0 -130
  64. package/template/rust/sia-sdk-rs/indexd_ffi/src/bin/uniffi-bindgen.rs +0 -3
  65. package/template/rust/sia-sdk-rs/indexd_ffi/src/builder.rs +0 -377
  66. package/template/rust/sia-sdk-rs/indexd_ffi/src/io.rs +0 -155
  67. package/template/rust/sia-sdk-rs/indexd_ffi/src/lib.rs +0 -1039
  68. package/template/rust/sia-sdk-rs/indexd_ffi/src/logging.rs +0 -58
  69. package/template/rust/sia-sdk-rs/indexd_ffi/src/tls.rs +0 -23
  70. package/template/rust/sia-sdk-rs/indexd_wasm/Cargo.toml +0 -33
  71. package/template/rust/sia-sdk-rs/indexd_wasm/src/lib.rs +0 -818
  72. package/template/rust/sia-sdk-rs/knope.toml +0 -54
  73. package/template/rust/sia-sdk-rs/sia_derive/CHANGELOG.md +0 -38
  74. package/template/rust/sia-sdk-rs/sia_derive/Cargo.toml +0 -19
  75. package/template/rust/sia-sdk-rs/sia_derive/src/lib.rs +0 -278
  76. package/template/rust/sia-sdk-rs/sia_sdk/CHANGELOG.md +0 -91
  77. package/template/rust/sia-sdk-rs/sia_sdk/Cargo.toml +0 -59
  78. package/template/rust/sia-sdk-rs/sia_sdk/benches/merkle_root.rs +0 -12
  79. package/template/rust/sia-sdk-rs/sia_sdk/src/blake2.rs +0 -22
  80. package/template/rust/sia-sdk-rs/sia_sdk/src/consensus.rs +0 -767
  81. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding/v1.rs +0 -257
  82. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding/v2.rs +0 -291
  83. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding.rs +0 -26
  84. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding_async/v2.rs +0 -367
  85. package/template/rust/sia-sdk-rs/sia_sdk/src/encoding_async.rs +0 -6
  86. package/template/rust/sia-sdk-rs/sia_sdk/src/encryption.rs +0 -303
  87. package/template/rust/sia-sdk-rs/sia_sdk/src/erasure_coding.rs +0 -347
  88. package/template/rust/sia-sdk-rs/sia_sdk/src/lib.rs +0 -15
  89. package/template/rust/sia-sdk-rs/sia_sdk/src/macros.rs +0 -435
  90. package/template/rust/sia-sdk-rs/sia_sdk/src/merkle.rs +0 -112
  91. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/merkle.rs +0 -357
  92. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/rpc.rs +0 -1507
  93. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp/types.rs +0 -146
  94. package/template/rust/sia-sdk-rs/sia_sdk/src/rhp.rs +0 -7
  95. package/template/rust/sia-sdk-rs/sia_sdk/src/seed.rs +0 -278
  96. package/template/rust/sia-sdk-rs/sia_sdk/src/signing.rs +0 -236
  97. package/template/rust/sia-sdk-rs/sia_sdk/src/types/common.rs +0 -677
  98. package/template/rust/sia-sdk-rs/sia_sdk/src/types/currency.rs +0 -450
  99. package/template/rust/sia-sdk-rs/sia_sdk/src/types/specifier.rs +0 -110
  100. package/template/rust/sia-sdk-rs/sia_sdk/src/types/spendpolicy.rs +0 -778
  101. package/template/rust/sia-sdk-rs/sia_sdk/src/types/utils.rs +0 -117
  102. package/template/rust/sia-sdk-rs/sia_sdk/src/types/v1.rs +0 -1737
  103. package/template/rust/sia-sdk-rs/sia_sdk/src/types/v2.rs +0 -1726
  104. package/template/rust/sia-sdk-rs/sia_sdk/src/types/work.rs +0 -59
  105. package/template/rust/sia-sdk-rs/sia_sdk/src/types.rs +0 -16
  106. package/template/scripts/setup-rust.js +0 -29
  107. package/template/src/lib/format.ts +0 -35
  108. package/template/src/lib/hex.ts +0 -13
  109. package/template/src/lib/sdk.ts +0 -25
  110. package/template/src/lib/wasm-env.ts +0 -5
  111. package/template/wasm/indexd_wasm/indexd_wasm.d.ts +0 -309
  112. package/template/wasm/indexd_wasm/indexd_wasm.js +0 -1507
  113. package/template/wasm/indexd_wasm/indexd_wasm_bg.wasm +0 -0
  114. package/template/wasm/indexd_wasm/package.json +0 -31
@@ -1,58 +0,0 @@
1
- use std::sync::{Arc, Mutex, Once};
2
-
3
- static LOGGER: Mutex<Option<Arc<dyn Logger>>> = Mutex::new(None);
4
- static LOGGER_SET: Once = Once::new();
5
-
6
- static FORWARDER: ForwardLogger = ForwardLogger;
7
-
8
- struct ForwardLogger;
9
-
10
- impl log::Log for ForwardLogger {
11
- fn enabled(&self, meta: &log::Metadata) -> bool {
12
- for target in ["indexd", "app_client", "indexd_ffi"] {
13
- if meta.target().contains(target) {
14
- return true;
15
- }
16
- }
17
- false
18
- }
19
-
20
- fn log(&self, record: &log::Record) {
21
- if !self.enabled(record.metadata()) {
22
- return;
23
- }
24
- if let Some(logger) = { LOGGER.lock().unwrap().clone() } {
25
- let msg = format!("{}", record.args());
26
- match record.level() {
27
- log::Level::Error => logger.error(msg),
28
- log::Level::Warn => logger.warn(msg),
29
- log::Level::Info => logger.info(msg),
30
- log::Level::Debug => logger.debug(msg),
31
- log::Level::Trace => logger.debug(msg),
32
- }
33
- }
34
- }
35
-
36
- fn flush(&self) {}
37
- }
38
-
39
- /// Sets a foreign logger to receive log messages from the SDK.
40
- #[uniffi::export]
41
- pub fn set_logger(logger: Arc<dyn Logger>, level: String) {
42
- LOGGER_SET.call_once(|| {
43
- // lazy init the logger
44
- log::set_logger(&FORWARDER).unwrap();
45
- });
46
- LOGGER.lock().unwrap().replace(logger.clone());
47
- if let Ok(level) = level.parse::<log::LevelFilter>() {
48
- log::set_max_level(level);
49
- }
50
- }
51
-
52
- #[uniffi::export(with_foreign)]
53
- pub trait Logger: Send + Sync {
54
- fn info(&self, msg: String);
55
- fn warn(&self, msg: String);
56
- fn error(&self, msg: String);
57
- fn debug(&self, msg: String);
58
- }
@@ -1,23 +0,0 @@
1
- use rustls::ClientConfig;
2
-
3
- /// Returns a rustls ClientConfig that uses the webpki roots
4
- /// on Android
5
- ///
6
- /// Avoid [rustls-platform-verifier] until https://github.com/rustls/rustls-platform-verifier/issues/115 is resolved
7
- #[cfg(target_os = "android")]
8
- pub fn tls_config() -> ClientConfig {
9
- use rustls::RootCertStore;
10
- let roots = RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.to_vec());
11
- ClientConfig::builder()
12
- .with_root_certificates(roots)
13
- .with_no_client_auth()
14
- }
15
-
16
- /// Returns a rustls ClientConfig that uses the platform trust store
17
- /// on non-Android OSes using [rustls-platform-verifier]
18
- #[cfg(not(target_os = "android"))]
19
- pub fn tls_config() -> ClientConfig {
20
- use rustls_platform_verifier::ConfigVerifierExt; // adds with_platform_verifier()
21
- // Uses platform trust store on non-Android OSes.
22
- ClientConfig::with_platform_verifier().expect("failed to create tls config")
23
- }
@@ -1,33 +0,0 @@
1
- [package]
2
- name = "indexd_wasm"
3
- version = "0.2.0"
4
- edition = "2024"
5
- repository = "https://github.com/SiaFoundation/sia-sdk-rs"
6
- license = "MIT"
7
- description = "WASM SDK for interacting with a Sia network indexer"
8
- authors = ["The Sia Foundation"]
9
- categories = ["cryptography::cryptocurrencies"]
10
- keywords = ["sia", "decentralized", "blockchain", "depin", "storage"]
11
-
12
- [lib]
13
- crate-type = ["cdylib", "rlib"]
14
-
15
- [dependencies]
16
- indexd = { version = "0.2.0", path = "../indexd" }
17
- sia_sdk = { version = "0.2.0", path = "../sia_sdk" }
18
- wasm-bindgen = "0.2"
19
- wasm-bindgen-futures = "0.4"
20
- serde = { version = "1.0", features = ["derive"] }
21
- serde_json = "1.0"
22
- serde-wasm-bindgen = "0.6"
23
- js-sys = "0.3"
24
- web-sys = { version = "0.3", features = ["console"] }
25
- thiserror = "2.0"
26
- rand = "0.10.0"
27
- getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] }
28
- getrandom = { version = "0.4", features = ["wasm_js"] }
29
- tokio = { version = "1.49.0", features = ["rt"] }
30
- console_error_panic_hook = "0.1"
31
- log = "0.4"
32
- console_log = "1"
33
- chrono = "0.4"