Skip to content

Commit 293d078

Browse files
committed
Merge remote-tracking branch 'upstream/main' into dev and updated translations
2 parents a8ff411 + b4b7b62 commit 293d078

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1980
-2313
lines changed

.sqlx/query-864efa77c492e3809b2502e3564eed0a613d7cc152c02fcd3b1fa32e8409b8d7.json

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-d6843923b016d591d12131ddd71ccbedb934d85bd953f25c176dec8bdf1afccd.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
# Sage Wallet
22

3-
The sagest wallet for the Chia blockchain.
3+
A high-performance light wallet that offers users the ability to connect directly to peers on the Chia blockchain or to a trusted full node. Key features include WalletConnect for integration with decentralized applications (dApps) and DeFi services, support for Chia offer files, and compatibility with Chia's standards for NFTs and Asset Tokens (CATs). This wallet also facilitates the creation, viewing, and management of NFTs, the minting of new tokens, and the management of Decentralized Identifiers (DIDs). Sage Wallet is designed for ease of use, security, and future extensibility. It is currently available in beta, so it should be used with caution.
44

5-
Sage is:
6-
7-
1. A high-performance light wallet that can connect directly to peers on the Chia network.
8-
2. Built upon the reliable foundation of [chia_rs](https://github.com/Chia-Network/chia_rs), [clvm_rs](https://github.com/Chia-Network/clvm_rs), and the [Chia Wallet SDK](https://github.com/xch-dev/chia-wallet-sdk).
9-
3. Designed with maintainability and future extensibility in mind from the beginning.
10-
11-
## Disclaimer
12-
13-
Sage is still in beta testing and isn't guaranteed to be stable, so it should be used with caution. Please make sure you backup your keys and don't put too much XCH in mainnet wallets.
5+
Sage is built upon the reliable foundation of [chia_rs](https://github.com/Chia-Network/chia_rs), [clvm_rs](https://github.com/Chia-Network/clvm_rs), and the [Chia Wallet SDK](https://github.com/xch-dev/chia-wallet-sdk). It's designed with maintainability and future extensibility in mind from the beginning.
146

157
## Installation
168

@@ -22,14 +14,16 @@ If you want to build from source, see the [Development](#development) section fo
2214

2315
This is an open source project, and we welcome pull requests to improve any part of the wallet.
2416

25-
The frontend is currently written in TypeScript with [React](https://react.dev/) and [Material UI](https://mui.com/), and can be found in the `src` directory.
17+
The frontend is currently written in TypeScript with [React](https://react.dev/) and [Shadcn UI](https://ui.shadcn.com/), and can be found in the `src` directory.
2618

27-
The backend is written in Rust, powered by [Tauri v2](https://v2.tauri.app/). The frontend and backend communicate via serialized commands and events over IPC.
19+
The backend is written in Rust, powered by [Tauri v2](https://v2.tauri.app/). The frontend and backend communicate via serialized commands and events over IPC. The `src-tauri` directory contains the backend wrapper code, and `crates` is the individual libraries that make up the wallet backend.
2820

2921
Finally, the wallet driver code is written on the backend using the [Chia Wallet SDK](https://github.com/xch-dev/chia-wallet-sdk).
3022

3123
## Development
3224

25+
### Setting up the environment
26+
3327
These instructions should get you up and running with a source installation.
3428

3529
First, there are some prerequisites:
@@ -45,10 +39,16 @@ Install the frontend dependencies:
4539
pnpm install
4640
```
4741

48-
You can run the app in development mode with:
42+
### Starting the app
43+
44+
You can run the app with:
4945

5046
```bash
47+
# For development purposes:
5148
pnpm tauri dev
49+
50+
# If you need optimizations:
51+
pnpm tauri dev --release
5252
```
5353

5454
And build the application with:
@@ -63,3 +63,15 @@ You can also run the app in the iOS or Android simulator, though it may take som
6363
pnpm tauri ios dev
6464
pnpm tauri android dev
6565
```
66+
67+
### Testing
68+
69+
Currently, only the wallet driver code has tests. These can be run with:
70+
71+
```bash
72+
RUST_LOG=debug,sqlx=off cargo t -p sage-wallet
73+
```
74+
75+
The `sqlx=off` portion gets rid of noisy log spam from SQLx.
76+
77+
Most of the tests for the underlying coin spend implementations live in the Wallet SDK repo.

crates/sage-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sage-api"
3-
version = "0.8.3"
3+
version = "0.8.6"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "API definitions for the Sage wallet."

crates/sage-api/src/requests/offers.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use specta::Type;
33

44
use crate::{Amount, OfferRecord, OfferSummary, SpendBundleJson, TransactionSummary};
55

6+
use super::TransactionResponse;
7+
68
#[derive(Debug, Clone, Serialize, Deserialize, Type)]
79
pub struct MakeOffer {
810
pub requested_assets: Assets,
@@ -88,3 +90,13 @@ pub struct DeleteOffer {
8890

8991
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Type)]
9092
pub struct DeleteOfferResponse {}
93+
94+
#[derive(Debug, Clone, Serialize, Deserialize, Type)]
95+
pub struct CancelOffer {
96+
pub offer_id: String,
97+
pub fee: Amount,
98+
#[serde(default)]
99+
pub auto_submit: bool,
100+
}
101+
102+
pub type CancelOfferResponse = TransactionResponse;

crates/sage-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sage-cli"
3-
version = "0.8.3"
3+
version = "0.8.6"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "A CLI and RPC for Sage wallet."

crates/sage-cli/src/router.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ routes!(
111111
get_offers await: GetOffers = "/get_offers",
112112
get_offer await: GetOffer = "/get_offer",
113113
delete_offer await: DeleteOffer = "/delete_offer",
114+
cancel_offer await: CancelOffer = "/cancel_offer",
114115

115116
get_peers await: GetPeers = "/get_peers",
116117
remove_peer await: RemovePeer = "/remove_peer",
@@ -132,11 +133,7 @@ async fn start_rpc(path: PathBuf) -> Result<()> {
132133
let mut app = Sage::new(&path);
133134
let mut receiver = app.initialize().await?;
134135

135-
tokio::spawn(async move {
136-
while let Some(message) = receiver.recv().await {
137-
println!("{message:?}");
138-
}
139-
});
136+
tokio::spawn(async move { while let Some(_message) = receiver.recv().await {} });
140137

141138
let addr: SocketAddr = ([127, 0, 0, 1], app.config.rpc.server_port).into();
142139
info!("RPC server is listening at {addr}");

crates/sage-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sage-config"
3-
version = "0.8.3"
3+
version = "0.8.6"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "Configuration for the Sage wallet."

crates/sage-database/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sage-database"
3-
version = "0.8.3"
3+
version = "0.8.6"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "The SQLite database for Sage."

0 commit comments

Comments
 (0)