("navigator.clipboard.readText");
19 | }
20 |
21 | public async Task Copy(string text)
22 | {
23 | await _jsRuntime.InvokeVoidAsync("navigator.clipboard.writeText", text);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Chaincase.SSB/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 |
3 |
4 | Error.
5 | An error occurred while processing your request.
6 |
7 | Development Mode
8 |
9 | Swapping to Development environment will display more detailed information about the error that occurred.
10 |
11 |
12 | The Development environment shouldn't be enabled for deployed applications.
13 | It can result in displaying sensitive information from exceptions to end users.
14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
15 | and restarting the app.
16 |
--------------------------------------------------------------------------------
/Chaincase.SSB/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Microsoft.AspNetCore.Hosting;
3 | using Microsoft.Extensions.Hosting;
4 |
5 | namespace Chaincase.SSB
6 | {
7 | // his class is responsible for launching the UI of the appliication,
8 | // as well as listening (and optionally responding) to application events
9 | // from Server Side Blazor
10 | public class Program
11 | {
12 | public static async Task Main(string[] args)
13 | {
14 | // analagous to new BlazorApp()
15 | await CreateHostBuilder(args).RunConsoleAsync();
16 | }
17 |
18 | public static IHostBuilder CreateHostBuilder(string[] args)
19 | {
20 | return Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); });
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Chaincase.SSB/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:43250",
7 | "sslPort": 44364
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Chaincase.SSB": {
19 | "commandName": "Project",
20 | "dotnetRunMessages": "true",
21 | "launchBrowser": true,
22 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Chaincase.SSB/SSBDataDirProvider.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using Chaincase.Common.Contracts;
3 | using WalletWasabi.Helpers;
4 |
5 | namespace Chaincase.SSB
6 | {
7 | public class SSBDataDirProvider:IDataDirProvider
8 | {
9 | protected string SubDirectory;
10 |
11 | public SSBDataDirProvider()
12 | {
13 | SubDirectory = Path.Combine("Chaincase", "Client");
14 | Directory.CreateDirectory(Get());
15 | }
16 | public string Get()
17 | {
18 | return EnvironmentHelpers.GetDataDir(SubDirectory);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Chaincase.SSB/SSBMainThreadInvoker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Chaincase.Common.Contracts;
4 |
5 | namespace Chaincase.SSB
6 | {
7 | public class SSBMainThreadInvoker:IMainThreadInvoker
8 | {
9 | public void Invoke(Action action)
10 | {
11 | Task.Run(action);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Chaincase.SSB/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using Microsoft.AspNetCore.Authorization
3 | @using Microsoft.AspNetCore.Components.Authorization
4 | @using Microsoft.AspNetCore.Components.Forms
5 | @using Microsoft.AspNetCore.Components.Routing
6 | @using Microsoft.AspNetCore.Components.Web
7 | @using Microsoft.JSInterop
8 | @using Chaincase.UI
9 |
--------------------------------------------------------------------------------
/Chaincase.SSB/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "DetailedErrors": true,
3 | "Logging": {
4 | "LogLevel": {
5 | "Default": "Information",
6 | "Microsoft": "Warning",
7 | "Microsoft.Hosting.Lifetime": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Chaincase.SSB/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/Chaincase.Tests/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.dockerignore
2 | **/.env
3 | **/.git
4 | **/.gitignore
5 | **/.project
6 | **/.settings
7 | **/.toolstarget
8 | **/.vs
9 | **/.vscode
10 | **/.idea
11 | **/*.*proj.user
12 | **/*.dbmdl
13 | **/*.jfm
14 | **/azds.yaml
15 | **/bin
16 | **/charts
17 | **/docker-compose*
18 | **/Dockerfile*
19 | **/node_modules
20 | **/npm-debug.log
21 | **/obj
22 | **/secrets.dev.yaml
23 | **/values.dev.yaml
24 | LICENSE
25 | README.md
--------------------------------------------------------------------------------
/Chaincase.Tests/Dockerfile:
--------------------------------------------------------------------------------
1 |
2 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1.415-focal
3 | WORKDIR /src
4 | COPY . .
5 |
6 | RUN apt update && apt install nodejs npm libbrotli1 libmbedtls12 -y
7 | RUN dotnet restore "Chaincase.Tests/Chaincase.Tests.csproj"
8 | ENV IN_CI="true"
9 | WORKDIR "/src/Chaincase.Tests"
10 | RUN dotnet build "Chaincase.Tests.csproj"
11 |
12 | RUN dotnet playwright install chromium
13 | RUN dotnet playwright install-deps chromium
14 | ENTRYPOINT ["./docker-entrypoint.sh"]
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Chaincase.Tests/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3"
2 | services:
3 |
4 | tests:
5 | build:
6 | context: ..
7 | dockerfile: Chaincase.Tests/Dockerfile
8 | links:
9 | - bitcoind
10 | - postgres
11 |
12 | volumes:
13 | postgres_datadir:
14 | bitcoin_datadir:
15 |
--------------------------------------------------------------------------------
/Chaincase.Tests/docker-entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | FILTERS=" "
5 | if [ ! -z "$TEST_FILTERS" ]; then
6 | FILTERS="--filter $TEST_FILTERS"
7 | fi
8 |
9 | dotnet test $FILTERS --no-build -v n
10 |
--------------------------------------------------------------------------------
/Chaincase.Tests/readme:
--------------------------------------------------------------------------------
1 | To run the tests:
2 | `docker compose -f WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml up -d`
3 | `dotnet tool install --global Microsoft.Playwright.CLI`
4 | `playwright install`
5 |
6 |
7 | To assist with test creation:
8 | * Run chaincase ssb
9 | * playwright codegen --target csharp https://localhost:5001
10 |
11 |
--------------------------------------------------------------------------------
/Chaincase.Tests/run-tests.ps1:
--------------------------------------------------------------------------------
1 | docker-compose -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" -f "docker-compose.yml" down -v
2 | docker-compose -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" -f "docker-compose.yml" pull
3 | docker-compose -f "docker-compose.yml" -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" build
4 | docker-compose -f "docker-compose.yml" -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" run tests
5 |
6 |
--------------------------------------------------------------------------------
/Chaincase.Tests/run-tests.sh:
--------------------------------------------------------------------------------
1 | docker-compose -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" -f "docker-compose.yml" down -v
2 | docker-compose -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" -f "docker-compose.yml" pull
3 | docker-compose -f "docker-compose.yml" -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" build
4 | docker-compose -f "docker-compose.yml" -f "../WalletWasabi.SDK/WalletWasabi.Backend/docker-compose.yml" run tests
5 |
6 |
--------------------------------------------------------------------------------
/Chaincase.UI/App.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Sorry, there's nothing at this address.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Chaincase.UI/Components/ClipboardToast.razor:
--------------------------------------------------------------------------------
1 | @inherits IonToast
2 |
3 |
4 | @code {
5 |
6 | protected override void OnParametersSet()
7 | {
8 | InputAttributes = new Dictionary()
9 | {
10 | { "style", "text-align: center;" },
11 | { "message", "Copied to clipboard" },
12 | { "color", "light" },
13 | { "position", "top" },
14 | { "duration", 1000 }
15 | };
16 | base.OnParametersSet();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Chaincase.UI/Components/QRCode.razor:
--------------------------------------------------------------------------------
1 | @using QRCoder
2 | @using System.Drawing
3 | @inject QRCodeGenerator QrCodeGenerator
4 | @((MarkupString) svgHtml)
5 |
6 | @code {
7 |
8 | [Parameter]
9 | public string Data
10 | {
11 | get => _data;
12 | set
13 | {
14 | var qrCodeData = QrCodeGenerator.CreateQrCode(value, QRCodeGenerator.ECCLevel.Q);
15 | var qrCode = new SvgQRCode(qrCodeData);
16 | svgHtml = qrCode.GetGraphic(new Size(256, 256), "#000", "#fff", true, SvgQRCode.SizingMode.ViewBoxAttribute);
17 | _data = value;
18 | }
19 | }
20 |
21 | private string svgHtml = "";
22 | private string _data;
23 | }
24 |
--------------------------------------------------------------------------------
/Chaincase.UI/Components/SplashLogo.razor:
--------------------------------------------------------------------------------
1 | @using Chaincase.UI.Services
2 | @inject UIStateService UiStateService
3 |
5 |
--------------------------------------------------------------------------------
/Chaincase.UI/Services/ThemeSwitcher.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Microsoft.JSInterop;
3 |
4 | namespace Chaincase.UI.Services
5 | {
6 | public class ThemeSwitcher
7 | {
8 | private readonly IJSRuntime _jsRuntime;
9 |
10 | public ThemeSwitcher(IJSRuntime jsRuntime)
11 | {
12 | _jsRuntime = jsRuntime;
13 | }
14 |
15 | public async Task ToggleDark(bool val)
16 | {
17 | await _jsRuntime.InvokeVoidAsync("document.body.classList.toggle", "dark", val);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Chaincase.UI/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using Blazor.Ionic
2 | @using Chaincase.UI.Shared
3 | @using Chaincase.UI.ViewModels
4 | @using Chaincase.UI.Components
5 | @using Microsoft.AspNetCore.Components.Forms
6 | @using Microsoft.AspNetCore.Components.Routing
7 | @using Microsoft.AspNetCore.Components.Web
8 | @using Microsoft.JSInterop
9 | @using ReactiveUI.Blazor
10 | @using System.Net.Http
11 |
--------------------------------------------------------------------------------
/Chaincase.UI/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Chaincase.UI",
3 | "version": "1.0.0",
4 | "description": "js deps for UI",
5 | "license": "GPL-3.0",
6 | "repository": "https://github.com/chaincase-app/chaincase",
7 | "dependencies": {
8 | "@ionic/core": "^5.5.1",
9 | "copyfiles": "^2.4.1",
10 | "npm-run-all": "^4.1.5",
11 | "rimraf": "^3.0.2"
12 | },
13 | "scripts": {
14 | "clean": "rimraf wwwroot/ionic",
15 | "copyionicjs": "copyfiles -u 5 \"node_modules/@ionic/core/dist/ionic/**/*\" wwwroot/ionic",
16 | "copyioniccss": "copyfiles -u 4 \"node_modules/@ionic/core/css/ionic.bundle.*\" wwwroot/ionic",
17 | "prepare": "npm-run-all clean copyionicjs copyioniccss"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Chaincase.UI/wwwroot/fetchfix.js:
--------------------------------------------------------------------------------
1 | var originalFetch = window.fetch;
2 |
3 | window.fetch = function () {
4 | var args = [];
5 | for (var _i = 0; _i < arguments.length; _i++) {
6 | args[_i] = arguments[_i];
7 | }
8 | var url = args[0];
9 | if (typeof url === 'string' && url.match(/\.svg/)) {
10 | return new Promise(function (resolve, reject) {
11 | var req = new XMLHttpRequest();
12 | req.open('GET', url, true);
13 | req.addEventListener('load', function () {
14 | resolve({ ok: true, status: 200, text: function () { return Promise.resolve(req.responseText); } });
15 | });
16 | req.addEventListener('error', reject);
17 | req.send();
18 | });
19 | }
20 | else {
21 | return originalFetch.apply(void 0, args);
22 | }
23 | };
24 |
--------------------------------------------------------------------------------
/Chaincase.UI/wwwroot/global.js:
--------------------------------------------------------------------------------
1 | function dispatchEventWrapper(evt) {
2 | window.dispatchEvent(new CustomEvent(evt))
3 | }
4 |
5 | if (!navigator.share && navigator.clipboard) {
6 | navigator.share = (data) => {
7 | const toast = document.createElement('ion-toast');
8 | toast.message = data.title ? `${data.title} copied to clipboard` : 'Copied to clipboard';
9 | toast.duration = 2000;
10 | navigator.clipboard.writeText(data.text || data.url).catch(reason => console.error(reason));
11 | document.body.appendChild(toast);
12 | return toast.present();
13 | }
14 | } else if (!navigator.share) {
15 | navigator.share = (data) => {
16 | console.warn("Wanted to use share API but not supported on this platform.", data);
17 | return Promise.resolve();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Chaincase.UI/wwwroot/img/logo_vertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.UI/wwwroot/img/logo_vertical.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Assets.xcassets/logo_vertical.imageset/logo_vertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Assets.xcassets/logo_vertical.imageset/logo_vertical.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Entitlements.developer.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Chaincase.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | production
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Chaincase.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Foundation;
5 | using Microsoft.MobileBlazorBindings.WebView.iOS;
6 | using UIKit;
7 |
8 | namespace Chaincase.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | BlazorHybridIOS.Init();
16 |
17 | // if you want to use a different Application Delegate class from "AppDelegate"
18 | // you can specify it here.
19 | UIApplication.Main(args, null, "AppDelegate");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Chaincase.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/Chaincase.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/Chaincase.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/Chaincase/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
--------------------------------------------------------------------------------
/Chaincase/Background/BackgroundMessages.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Chaincase.Background
4 | {
5 | public class OnSleepingTaskMessage { }
6 |
7 | public class InitializeNoWalletTaskMessage { }
8 | }
9 |
--------------------------------------------------------------------------------
/Chaincase/Main.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Chaincase/Services/XamarinClipboard.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Chaincase.Common.Contracts;
3 | using Xamarin.Essentials;
4 |
5 | namespace Chaincase.Services
6 | {
7 | public class XamarinClipboard : IClipboard
8 | {
9 | public async Task Copy(string text)
10 | {
11 | await Clipboard.SetTextAsync(text);
12 | }
13 |
14 | public async Task Paste()
15 | {
16 | return await Clipboard.GetTextAsync();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Chaincase/Services/XamarinDataDirProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using Chaincase.Common.Contracts;
4 | using WalletWasabi.Helpers;
5 | using Xamarin.Forms;
6 |
7 | namespace Chaincase.Services
8 | {
9 | public class XamarinDataDirProvider : IDataDirProvider
10 | {
11 | public string Get()
12 | {
13 | string dataDir;
14 | if (Device.RuntimePlatform == Device.iOS)
15 | {
16 | var library = Environment.GetFolderPath(Environment.SpecialFolder.Resources);
17 | var client = Path.Combine(library, "Client");
18 | dataDir = client;
19 | }
20 | else
21 | {
22 | dataDir = EnvironmentHelpers.GetDataDir(Path.Combine("Chaincase", "Client"));
23 | }
24 |
25 | return dataDir;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Chaincase/Services/XamarinHsmStorage.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Chaincase.Common.Contracts;
3 | using Xamarin.Essentials;
4 |
5 | namespace Chaincase.Services
6 | {
7 | public class XamarinHsmStorage : IHsmStorage
8 | {
9 | public Task SetAsync(string key, string value)
10 | {
11 | return SecureStorage.SetAsync(key, value);
12 | }
13 |
14 | public Task GetAsync(string key)
15 | {
16 | return SecureStorage.GetAsync(key);
17 | }
18 |
19 | public bool Remove(string key)
20 | {
21 | return SecureStorage.Remove(key);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/Chaincase/Services/XamarinMainThreadInvoker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Chaincase.Common.Contracts;
3 | using Xamarin.Forms;
4 |
5 | namespace Chaincase.Services
6 | {
7 | public class XamarinMainThreadInvoker : IMainThreadInvoker
8 | {
9 | public void Invoke(Action action)
10 | {
11 | Device.BeginInvokeOnMainThread(action);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Chaincase/Services/XamarinShare.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Chaincase.Common.Contracts;
4 | using Xamarin.Essentials;
5 | using Xamarin.Forms;
6 |
7 | namespace Chaincase.Services
8 | {
9 | public class XamarinShare : IShare
10 | {
11 | public async Task ShareText(string text, string title = "Share")
12 | {
13 | await Share.RequestAsync(new ShareTextRequest
14 | {
15 | Title = title,
16 | Text = text
17 | });
18 | }
19 | public async Task ShareFile(string file, string title)
20 | {
21 | await Share.RequestAsync(new ShareFileRequest
22 | {
23 | Title = title,
24 | File = new ShareFile(file)
25 | });
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Chaincase/Services/XamarinThemeManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Chaincase.Common.Contracts;
3 | using Xamarin.Forms;
4 |
5 | namespace Chaincase.Services
6 | {
7 | public class XamarinThemeManager : IThemeManager
8 | {
9 | public bool IsDarkTheme() => Xamarin.Forms.Application.Current.RequestedTheme == OSAppTheme.Dark;
10 |
11 | public void SubscribeToThemeChanged(Action handler)
12 | {
13 | Xamarin.Forms.Application.Current.RequestedThemeChanged += (s, a) =>
14 | {
15 | handler.Invoke();
16 | };
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Chaincase/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using Microsoft.MobileBlazorBindings
2 | @using Microsoft.MobileBlazorBindings.Elements
3 | @using Xamarin.Essentials
4 | @using Xamarin.Forms
5 | @using Blazor.Ionic
6 | @using Chaincase.UI
7 | @using Chaincase.UI.Shared
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/.coverage.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | COLLECT_COVERAGE="//p:CollectCoverage=true"
3 | OUTPUT_FORMAT="//p:CoverletOutputFormat=lcov"
4 | FILE_NAME="//p:CoverletOutputName=lcov"
5 |
6 | dotnet restore --locked-mode && dotnet build
7 |
8 | cd WalletWasabi.Tests
9 | dotnet test --no-build $COLLECT_COVERAGE $OUTPUT_FORMAT $FILE_NAME
--------------------------------------------------------------------------------
/WalletWasabi.SDK/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | ### Is your feature request related to a problem? Please describe.
8 |
9 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10 |
11 | ### Describe the solution you'd like
12 |
13 | A clear and concise description of what you want to happen.
14 |
15 | ### Describe alternatives you've considered
16 |
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/.github/ISSUE_TEMPLATE/general-issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: General Issue
3 | about: Submit a general issue
4 |
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/.gitrepo:
--------------------------------------------------------------------------------
1 | ; DO NOT EDIT (unless you know what you are doing)
2 | ;
3 | ; This subdirectory is a git "subrepo", and this file is maintained by the
4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5 | ;
6 | [subrepo]
7 | remote = https://github.com/chaincase-app/WalletWasabi.Standard
8 | branch = sdk
9 | commit = 7c2ebfacdfaac63bad4e2f3a2cc49f2486943e47
10 | parent = ca9d6dcde92de4425544e2d7ec219c7afdc4e04b
11 | method = merge
12 | cmdver = 0.4.3
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
5 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
2 | ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
3 | WORKDIR /app
4 | EXPOSE 37127
5 |
6 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
7 | WORKDIR /src
8 | COPY . ./
9 | RUN dotnet restore
10 |
11 | WORKDIR "/src/WalletWasabi.Backend"
12 | RUN dotnet build "WalletWasabi.Backend.csproj" -c Release -o /app/build
13 |
14 | FROM build AS publish
15 | RUN dotnet publish "WalletWasabi.Backend.csproj" -c Release -o /app/publish
16 |
17 | FROM base AS final
18 | WORKDIR /app
19 | COPY --from=publish /app/publish .
20 | ENTRYPOINT ["dotnet", "WalletWasabi.Backend.dll"]
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.dockerignore
2 | **/.env
3 | **/.git
4 | **/.gitignore
5 | **/.project
6 | **/.settings
7 | **/.toolstarget
8 | **/.vs
9 | **/.vscode
10 | **/.idea
11 | **/*.*proj.user
12 | **/*.dbmdl
13 | **/*.jfm
14 | **/azds.yaml
15 | **/bin
16 | **/charts
17 | **/docker-compose*
18 | **/Dockerfile*
19 | **/node_modules
20 | **/npm-debug.log
21 | **/obj
22 | **/secrets.dev.yaml
23 | **/values.dev.yaml
24 | LICENSE
25 | README.md
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Chaincase/LatestMatureHeaderResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using NBitcoin;
3 | using NBitcoin.JsonConverters;
4 | using Newtonsoft.Json;
5 | using WalletWasabi.JsonConverters;
6 |
7 | namespace Chaincase.Common.Models
8 | {
9 | public class LatestMatureHeaderResponse
10 | {
11 | [JsonConverter(typeof(Uint256JsonConverter))]
12 | public uint256 MatureHeaderHash { get; set; }
13 |
14 | [JsonConverter(typeof(DateTimeOffsetUnixSecondsConverter))]
15 | public DateTimeOffset MatureHeaderTime { get; set; }
16 | [JsonConverter(typeof(Uint256JsonConverter))]
17 | public uint256 MatureHeaderPrevHash { get; set; }
18 | [JsonConverter(typeof(Uint256JsonConverter))]
19 | public uint256 BestHeaderHash { get; set; }
20 | public uint MatureHeight { get; set; }
21 | public uint BestHeight { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using System;
3 |
4 | namespace WalletWasabi.Backend.Controllers
5 | {
6 | [Route("")]
7 | public class HomeController : Controller
8 | {
9 | [HttpGet("")]
10 | public IActionResult Index()
11 | {
12 | string host = HttpContext?.Request?.Host.Host;
13 |
14 | VirtualFileResult response = !string.IsNullOrWhiteSpace(host) && host.TrimEnd('/').EndsWith(".onion", StringComparison.OrdinalIgnoreCase)
15 | ? File("onion-index.html", "text/html")
16 | : File("index.html", "text/html");
17 |
18 | response.LastModified = DateTimeOffset.UtcNow;
19 | return response;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Data/WasabiBackendContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 | using WalletWasabi.Backend.Models;
3 |
4 | namespace WalletWasabi.Backend.Data
5 | {
6 | public class WasabiBackendContext : DbContext
7 | {
8 | public DbSet Tokens { get; set; }
9 |
10 | public WasabiBackendContext(DbContextOptions options) : base(options)
11 | {
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Data/WasabiDesignTimeDbContextFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 |
3 | namespace WalletWasabi.Backend.Data
4 | {
5 | public class WasabiDesignTimeDbContextFactory :
6 | DesignTimeDbContextFactoryBase
7 | {
8 | protected override WasabiBackendContext CreateNewInstance(DbContextOptions options)
9 | {
10 | return new WasabiBackendContext(options);
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/IStartupTask.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 |
7 | namespace WalletWasabi.Backend
8 | {
9 | public interface IStartupTask
10 | {
11 | Task ExecuteAsync(CancellationToken cancellationToken = default);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Polyfills/DbContextFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.EntityFrameworkCore;
3 | using Microsoft.Extensions.DependencyInjection;
4 |
5 | namespace WalletWasabi.Backend.Polyfills
6 | {
7 | public class DbContextFactory
8 | : IDbContextFactory where TContext : DbContext
9 | {
10 | private readonly IServiceProvider _provider;
11 |
12 | public DbContextFactory(IServiceProvider provider)
13 | {
14 | _provider = provider;
15 | }
16 |
17 | public TContext CreateDbContext()
18 | {
19 | if (_provider == null)
20 | {
21 | throw new InvalidOperationException(
22 | $"You must configure an instance of IServiceProvider");
23 | }
24 |
25 | return ActivatorUtilities.CreateInstance(_provider);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Polyfills/IDbContextFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 |
3 | namespace WalletWasabi.Backend.Polyfills
4 | {
5 | public interface IDbContextFactorywhere TContext : DbContext
6 | {
7 | TContext CreateDbContext();
8 | }
9 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "WalletWasabi.Backend": {
4 | "commandName": "Project",
5 | "launchBrowser": true,
6 | "launchUrl": "swagger",
7 | "environmentVariables": {
8 | "ASPNETCORE_ENVIRONMENT": "Development",
9 |
10 | "WASABI_BIND": "http://0.0.0.0:37127"
11 | },
12 | "applicationUrl": "http://localhost:37127"
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/ZoneLimits.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Backend
2 | {
3 | public class ZoneLimits
4 | {
5 | public const string NotificationTokens = nameof(NotificationTokens);
6 | }
7 |
8 |
9 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "Debug": {
5 | "LogLevel": {
6 | "Default": "Warning",
7 | "Microsoft": "Warning"
8 | }
9 | },
10 | "Console": {
11 | "LogLevel": {
12 | "Default": "Warning",
13 | "Microsoft": "Warning"
14 | }
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/css/_variables.scss:
--------------------------------------------------------------------------------
1 | // Wasabi Wallet CSS Theme
2 | // Compile Bootstrap 4.3+ with these variables
3 |
4 | $green: #58A567;
5 | $dark: #211B24;
6 | $blue: #3B83F7;
7 | $body-color: $dark;
8 | $headings-font-family: 'Playfair Display', serif;
9 | $font-family-monospace: Inconsolata, monospace;
10 | $font-family-base: $font-family-monospace;
11 | $headings-font-weight: 600;
12 | $border-radius: .2rem;
13 | $h1-font-size: $font-size-base * 4;
14 | $h2-font-size: $font-size-base * 4;
15 | $font-weight-bold: 600;
16 | $text-muted: #716686;
17 | $spacer: 3rem;
18 | $navbar-nav-link-padding-x: 2rem;
19 | $navbar-dark-color: $white;
20 | $list-group-bg: $dark;
21 | $list-group-color: $white;
22 | $list-group-border-color: rgba($white, .125);
23 | $input-btn-padding-y: .5rem;
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-700.woff
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-700.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-700.woff2
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-regular.woff
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/inconsolata-v18-latin_vietnamese_latin-ext-regular.woff2
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/playfair-display-v15-latin_vietnamese_latin-ext_cyrillic-700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/playfair-display-v15-latin_vietnamese_latin-ext_cyrillic-700.woff
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/playfair-display-v15-latin_vietnamese_latin-ext_cyrillic-700.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/fonts/playfair-display-v15-latin_vietnamese_latin-ext_cyrillic-700.woff2
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/favicon.ico
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/hero-off.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/hero-off.jpg
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/hero-on.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/hero-on.jpg
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/icon-colored-onion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/icon-colored-onion.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/icon-external.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/infographics.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/infographics.jpg
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/wasabi-social.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/wasabi-social.jpg
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/wasabi-wallet-laptop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/wasabi-wallet-laptop.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/wasabi_wallet_logo_2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Backend/wwwroot/images/wasabi_wallet_logo_2-1.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Community/Dojo.md:
--------------------------------------------------------------------------------
1 | The dojo can be found in the [documentation](https://docs.wasabiwallet.io/building-wasabi/Dojo.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/FAQ.md:
--------------------------------------------------------------------------------
1 | The frequently asked questions can be found in the [documentation](https://docs.wasabiwallet.io/FAQ).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/Guides/20180719DemoGuide.md:
--------------------------------------------------------------------------------
1 | The demo guide can be found in the [documentation](https://docs.wasabiwallet.io/building-wasabi/DemoGuide.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/Guides/20190416HardwareWalletTestingGuide.md:
--------------------------------------------------------------------------------
1 | The hardware wallet testing guide can be found in the [documentation](https://docs.wasabiwallet.io/building-wasabi/HardwareWalletTestingGuide.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/Guides/20190617ContributionGame.md:
--------------------------------------------------------------------------------
1 | The contribution game can be found in the [documentation](https://docs.wasabiwallet.io/building-wasabi/ContributionGame.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/Guides/InstallInstructions.md:
--------------------------------------------------------------------------------
1 | The step-by-step PGP verification and package installation guide can be found in the [documentation](https://docs.wasabiwallet.io/using-wasabi/InstallPackage.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/PasswordFinder.md:
--------------------------------------------------------------------------------
1 | The step-by-step guide of the password finder is in the [documentation](https://docs.wasabiwallet.io/using-wasabi/PasswordFinder.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Documentation/RPC.md:
--------------------------------------------------------------------------------
1 | The RPC documentation can be found in the [documentation](https://docs.wasabiwallet.io/using-wasabi/RPC.html).
2 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/CascadiaMono.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/CascadiaMono.ttf
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo.icns
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo.ico
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo128.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo16.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo192.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo22.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo24.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo256.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo32.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo36.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo42.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo48.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo512.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo52.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo64.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo72.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo8.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Gui/Assets/WasabiLogo96.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Behaviors/CommandOnClickBehavior.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Input;
3 | using System.Reactive.Disposables;
4 |
5 | namespace WalletWasabi.Gui.Behaviors
6 | {
7 | public class CommandOnClickBehavior : CommandBasedBehavior
8 | {
9 | private CompositeDisposable Disposables { get; set; }
10 |
11 | protected override void OnAttached()
12 | {
13 | Disposables = new CompositeDisposable();
14 |
15 | base.OnAttached();
16 |
17 | Disposables.Add(AssociatedObject.AddHandler(InputElement.PointerPressedEvent, (sender, e) => e.Handled = ExecuteCommand()));
18 | }
19 |
20 | protected override void OnDetaching()
21 | {
22 | base.OnDetaching();
23 |
24 | Disposables?.Dispose();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Behaviors/CommandOnClickReleaseBehavior.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Input;
3 | using System.Reactive.Disposables;
4 |
5 | namespace WalletWasabi.Gui.Behaviors
6 | {
7 | public class CommandOnClickReleaseBehavior : CommandBasedBehavior
8 | {
9 | private CompositeDisposable Disposables { get; set; }
10 |
11 | protected override void OnAttached()
12 | {
13 | Disposables = new CompositeDisposable();
14 |
15 | base.OnAttached();
16 |
17 | Disposables.Add(AssociatedObject.AddHandler(InputElement.PointerReleasedEvent, (sender, e) => e.Handled = ExecuteCommand()));
18 | }
19 |
20 | protected override void OnDetaching()
21 | {
22 | base.OnDetaching();
23 |
24 | Disposables?.Dispose();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Behaviors/CommandOnDoubleClickBehavior.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Input;
3 | using System.Reactive.Disposables;
4 |
5 | namespace WalletWasabi.Gui.Behaviors
6 | {
7 | public class CommandOnDoubleClickBehavior : CommandBasedBehavior
8 | {
9 | private CompositeDisposable Disposables { get; set; }
10 |
11 | protected override void OnAttached()
12 | {
13 | Disposables = new CompositeDisposable();
14 |
15 | base.OnAttached();
16 |
17 | Disposables.Add(AssociatedObject.AddHandler(InputElement.DoubleTappedEvent, (sender, e) => e.Handled = ExecuteCommand()));
18 | }
19 |
20 | protected override void OnDetaching()
21 | {
22 | base.OnDetaching();
23 |
24 | Disposables?.Dispose();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Behaviors/FocusOnAttachedBehavior.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Threading;
3 | using Avalonia.Xaml.Interactivity;
4 |
5 | namespace WalletWasabi.Gui.Behaviors
6 | {
7 | public class FocusOnAttachedBehavior : Behavior
8 | {
9 | protected override void OnAttached()
10 | {
11 | base.OnAttached();
12 |
13 | Dispatcher.UIThread.Post(() => AssociatedObject.Focus(), DispatcherPriority.Layout);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Behaviors/PreventTooltipStuckBehavior.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Xaml.Interactivity;
3 |
4 | namespace WalletWasabi.Gui.Behaviors
5 | {
6 | ///
7 | /// Ensures Tooltips are closed when parent control is removed from visual tree.
8 | /// This is a workaround and should be removed when Avalonia 0.10.0 upgrade is complete. TODO
9 | ///
10 | public class PreventTooltipStuckBehavior : Behavior
11 | {
12 | protected override void OnDetaching()
13 | {
14 | base.OnDetaching();
15 |
16 | ToolTip.SetIsOpen(AssociatedObject, false);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/GroupBox.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Controls.Presenters;
4 | using Avalonia.Controls.Primitives;
5 | using Avalonia.Media;
6 | using Avalonia.Styling;
7 | using System;
8 | using System.Collections.Generic;
9 | using System.Text;
10 |
11 | namespace WalletWasabi.Gui.Controls
12 | {
13 | public class GroupBox : ContentControl
14 | {
15 | public static readonly StyledProperty TitleProperty =
16 | AvaloniaProperty.Register(nameof(Title));
17 |
18 | public object Title
19 | {
20 | get => GetValue(TitleProperty);
21 | set => SetValue(TitleProperty, value);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/LockScreen/LockScreen.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/LockScreen/LockScreen.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reactive.Disposables;
3 | using System.Reactive.Linq;
4 | using Avalonia;
5 | using Avalonia.Controls;
6 | using Avalonia.Markup.Xaml;
7 |
8 | namespace WalletWasabi.Gui.Controls.LockScreen
9 | {
10 | public class LockScreen : UserControl
11 | {
12 | public LockScreen() : base()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void InitializeComponent()
18 | {
19 | AvaloniaXamlLoader.Load(this);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/LockScreen/PinLockScreenView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Controls.LockScreen
5 | {
6 | public class PinLockScreenView : UserControl
7 | {
8 | public PinLockScreenView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/LockScreen/SlideLockScreenView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Controls.LockScreen
5 | {
6 | public class SlideLockScreenView : UserControl
7 | {
8 | public SlideLockScreenView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/LockScreen/SlideLockScreenViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using ReactiveUI;
3 | using System.Reactive.Linq;
4 |
5 | namespace WalletWasabi.Gui.Controls.LockScreen
6 | {
7 | public class SlideLockScreenViewModel : WasabiLockScreenViewModelBase
8 | {
9 | public readonly double ThresholdPercent = 1 / 6d;
10 |
11 | public SlideLockScreenViewModel() : base()
12 | {
13 | CanSlide = true;
14 |
15 | this.WhenAnyValue(x => x.IsLocked)
16 | .Where(x => !x)
17 | .Take(1)
18 | .Subscribe(x => Close());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/LockScreen/WasabiLockScreenViewModelBase.cs:
--------------------------------------------------------------------------------
1 | using ReactiveUI;
2 | using Splat;
3 | using System.Reactive.Disposables;
4 | using System.Reactive.Linq;
5 |
6 | namespace WalletWasabi.Gui.Controls.LockScreen
7 | {
8 | public abstract class WasabiLockScreenViewModelBase : LockScreenViewModelBase
9 | {
10 | protected override void OnInitialize(CompositeDisposable disposables)
11 | {
12 | base.OnInitialize(disposables);
13 |
14 | var global = Locator.Current.GetService();
15 |
16 | global.UiConfig.LockScreenActive = true;
17 |
18 | Disposable.Create(() =>
19 | {
20 | var global = Locator.Current.GetService();
21 |
22 | global.UiConfig.LockScreenActive = false;
23 | })
24 | .DisposeWith(disposables);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/ModalDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Gui.Controls
8 | {
9 | internal class ModalDialog : UserControl
10 | {
11 | public ModalDialog()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void InitializeComponent()
17 | {
18 | AvaloniaXamlLoader.Load(this);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/Spinner.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
15 |
16 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/Spinner.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Gui.Controls
8 | {
9 | internal class Spinner : UserControl
10 | {
11 | public Spinner()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void InitializeComponent()
17 | {
18 | AvaloniaXamlLoader.Load(this);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/StatusBar.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Gui.Controls
8 | {
9 | internal class StatusBar : UserControl
10 | {
11 | public StatusBar()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void InitializeComponent()
17 | {
18 | AvaloniaXamlLoader.Load(this);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/TransactionDetails/Views/TransactionDetails.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Data;
4 | using Avalonia.Markup.Xaml;
5 | using ReactiveUI;
6 | using System.Reactive.Linq;
7 |
8 | namespace WalletWasabi.Gui.Controls.TransactionDetails.Views
9 | {
10 | public class TransactionDetails : UserControl
11 | {
12 | public TransactionDetails()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void InitializeComponent()
18 | {
19 | AvaloniaXamlLoader.Load(this);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/BuildTabView.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/BuildTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class BuildTabView : UserControl
8 | {
9 | public BuildTabView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/ClosedHardwareWalletViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Wallets;
2 |
3 | namespace WalletWasabi.Gui.Controls.WalletExplorer
4 | {
5 | public class ClosedHardwareWalletViewModel : ClosedWalletViewModel
6 | {
7 | internal ClosedHardwareWalletViewModel(Wallet wallet) : base(wallet)
8 | {
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/ClosedWatchOnlyWalletViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Wallets;
2 |
3 | namespace WalletWasabi.Gui.Controls.WalletExplorer
4 | {
5 | public class ClosedWatchOnlyWalletViewModel : ClosedWalletViewModel
6 | {
7 | internal ClosedWatchOnlyWalletViewModel(Wallet wallet) : base(wallet)
8 | {
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Data;
4 | using Avalonia.Markup.Xaml;
5 | using ReactiveUI;
6 | using System.Reactive.Linq;
7 |
8 | namespace WalletWasabi.Gui.Controls.WalletExplorer
9 | {
10 | public class CoinInfoTabView : UserControl
11 | {
12 | public CoinInfoTabView()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void InitializeComponent()
18 | {
19 | AvaloniaXamlLoader.Load(this);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/CoinInfoTabViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Gui.ViewModels;
2 |
3 | namespace WalletWasabi.Gui.Controls.WalletExplorer
4 | {
5 | public class CoinInfoTabViewModel : WasabiDocumentTabViewModel
6 | {
7 | public CoinInfoTabViewModel(CoinViewModel coin) : base("")
8 | {
9 | Coin = coin;
10 | Title = $"Coin ({coin.Amount.ToString(false, true)}) Details";
11 | }
12 |
13 | public CoinViewModel Coin { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Controls.WalletExplorer
5 | {
6 | public class CoinJoinTabView : UserControl
7 | {
8 | public CoinJoinTabView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/HardwareWalletViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Wallets;
2 |
3 | namespace WalletWasabi.Gui.Controls.WalletExplorer
4 | {
5 | public class HardwareWalletViewModel : WalletViewModel
6 | {
7 | internal HardwareWalletViewModel(Wallet wallet) : base(wallet)
8 | {
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Controls.WalletExplorer
5 | {
6 | public class HistoryTabView : UserControl
7 | {
8 | public HistoryTabView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/PinPadView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class PinPadView : UserControl
8 | {
9 | public PinPadView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Controls.WalletExplorer
5 | {
6 | public class ReceiveTabView : UserControl
7 | {
8 | public ReceiveTabView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/SendControlView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class SendControlView : UserControl
8 | {
9 | public SendControlView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/SendTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class SendTabView : UserControl
8 | {
9 | public SendTabView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/TransactionBroadcasterView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class TransactionBroadcasterView : UserControl
8 | {
9 | public TransactionBroadcasterView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Data;
4 | using Avalonia.Markup.Xaml;
5 | using ReactiveUI;
6 | using System.Reactive.Linq;
7 |
8 | namespace WalletWasabi.Gui.Controls.WalletExplorer
9 | {
10 | public class TransactionInfoTabView : UserControl
11 | {
12 | public TransactionInfoTabView()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void InitializeComponent()
18 | {
19 | AvaloniaXamlLoader.Load(this);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/TransactionInfoTabViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Gui.Controls.TransactionDetails;
2 | using WalletWasabi.Gui.Controls.TransactionDetails.ViewModels;
3 | using WalletWasabi.Gui.ViewModels;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class TransactionInfoTabViewModel : WasabiDocumentTabViewModel
8 | {
9 | public TransactionInfoTabViewModel(TransactionDetailsViewModel transaction) : base("")
10 | {
11 | Transaction = transaction;
12 | Title = $"Transaction ({transaction.TransactionId[0..10]}) Details";
13 | }
14 |
15 | public TransactionDetailsViewModel Transaction { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class TransactionViewerView : UserControl
8 | {
9 | public TransactionViewerView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Controls.WalletExplorer
5 | {
6 | public class WalletExplorerView : UserControl
7 | {
8 | public WalletExplorerView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Controls.WalletExplorer
6 | {
7 | public class WalletInfoView : UserControl
8 | {
9 | public WalletInfoView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Controls/WalletExplorer/WatchOnlyWalletViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Wallets;
2 |
3 | namespace WalletWasabi.Gui.Controls.WalletExplorer
4 | {
5 | public class WatchOnlyWalletViewModel : WalletViewModel
6 | {
7 | internal WatchOnlyWalletViewModel(Wallet wallet) : base(wallet)
8 | {
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Converters/FileSizeStringConverter.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Data.Converters;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Text;
6 | using WalletWasabi.Gui.Helpers;
7 |
8 | namespace WalletWasabi.Gui.Converters
9 | {
10 | public class FileSizeStringConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | if (value is long size && size > 0)
15 | {
16 | return ByteSizeHelper.ToString(size);
17 | }
18 |
19 | return "";
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Converters/InverseBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Data.Converters;
2 | using System;
3 | using System.Globalization;
4 | using WalletWasabi.Exceptions;
5 |
6 | namespace WalletWasabi.Gui.Converters
7 | {
8 | public class InverseBooleanConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | if (value is bool boolean)
13 | {
14 | return !boolean;
15 | }
16 | else
17 | {
18 | throw new TypeArgumentException(value, typeof(bool), nameof(value));
19 | }
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotSupportedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Converters/ShouldDisplayValueConverter.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Data.Converters;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Gui.Converters
8 | {
9 | public class ShouldDisplayValueConverter : IValueConverter
10 | {
11 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
12 | {
13 | if (value is int integer && integer <= 0)
14 | {
15 | return false;
16 | }
17 |
18 | return true;
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | throw new NotSupportedException();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Converters/ShowCursorConverter.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Data.Converters;
2 | using Avalonia.Input;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Globalization;
6 | using System.Text;
7 |
8 | namespace WalletWasabi.Gui.Converters
9 | {
10 | public class ShowCursorConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | if (value is bool boolean && boolean)
15 | {
16 | return new Cursor(StandardCursorType.Hand);
17 | }
18 |
19 | return new Cursor(StandardCursorType.Arrow);
20 | }
21 |
22 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23 | {
24 | throw new NotSupportedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/CrashReport/Views/CrashReportWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using Avalonia;
4 | using Avalonia.Markup.Xaml;
5 | using AvalonStudio.Shell.Controls;
6 | using Splat;
7 |
8 | namespace WalletWasabi.Gui.CrashReport.Views
9 | {
10 | public class CrashReportWindow : WasabiWindow
11 | {
12 | public CrashReportWindow()
13 | {
14 | InitializeComponent();
15 | #if DEBUG
16 | this.AttachDevTools();
17 | #endif
18 | }
19 |
20 | private void InitializeComponent()
21 | {
22 | AvaloniaXamlLoader.Load(this);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Dialogs/CannotCloseDialogView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Gui.Dialogs
8 | {
9 | internal class CannotCloseDialogView : UserControl
10 | {
11 | public CannotCloseDialogView()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void InitializeComponent()
17 | {
18 | AvaloniaXamlLoader.Load(this);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Dialogs/GenSocksServFailDialogView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Dialogs
6 | {
7 | public class GenSocksServFailDialogView : UserControl
8 | {
9 | public GenSocksServFailDialogView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Dialogs/GenSocksServFailDialogViewModel.cs:
--------------------------------------------------------------------------------
1 | using AvalonStudio.Extensibility.Dialogs;
2 | using ReactiveUI;
3 | using WalletWasabi.Logging;
4 | using System.Reactive.Linq;
5 | using System;
6 |
7 | namespace WalletWasabi.Gui.Dialogs
8 | {
9 | public class GenSocksServFailDialogViewModel : ModalDialogViewModelBase
10 | {
11 | public GenSocksServFailDialogViewModel() : base("", true, false)
12 | {
13 | OKCommand = ReactiveCommand.Create(() => Close(true)); // OK pressed.
14 | OKCommand.ThrownExceptions
15 | .ObserveOn(RxApp.TaskpoolScheduler)
16 | .Subscribe(ex => Logger.LogError(ex));
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Dialogs/TextInputDialogView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Dialogs
6 | {
7 | public class TextInputDialogView : UserControl
8 | {
9 | public TextInputDialogView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Extensions/DummyHack.txt:
--------------------------------------------------------------------------------
1 | This file is necessary to have in the publish folder, otherwise Avalonia or AvalonStudio and Wix won't work together.
2 | It matters on Windows. It may or may not make a difference in Linux and OSX.
3 | For more info see: https://github.com/VitalElement/AvalonStudio.Shell/issues/11
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Helpers/ByteSizeHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Helpers
6 | {
7 | public static class ByteSizeHelper
8 | {
9 | private static readonly string[] Prefixes =
10 | {
11 | "B",
12 | "KB",
13 | "MB",
14 | "GB",
15 | "TB"
16 | };
17 |
18 | public static string ToString(long bytes)
19 | {
20 | var index = 0;
21 | while (bytes >= 1000)
22 | {
23 | bytes /= 1000;
24 | ++index;
25 | }
26 | return $"{bytes:N} {Prefixes[index]}";
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Helpers/NullNotificationManager.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls.Notifications;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace WalletWasabi.Gui.Helpers
7 | {
8 | public class NullNotificationManager : INotificationManager
9 | {
10 | public void Show(INotification notification)
11 | {
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Helpers/ShellExecuteResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Helpers
6 | {
7 | public struct ShellExecuteResult
8 | {
9 | public int ExitCode { get; set; }
10 | public string Output { get; set; }
11 | public string ErrorOutput { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Helpers/ShellType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Helpers
6 | {
7 | public enum ShellType
8 | {
9 | Generic,
10 | Windows,
11 | Unix
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Helpers/Utils.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Threading;
2 | using System;
3 | using System.IO;
4 | using System.Threading.Tasks;
5 |
6 | namespace WalletWasabi.Gui.Helpers
7 | {
8 | public static class Utils
9 | {
10 | public static bool DetectLLVMPipeRasterizer()
11 | {
12 | try
13 | {
14 | var shellResult = ShellUtils.ExecuteShellCommand("glxinfo | grep renderer", "");
15 |
16 | if (!string.IsNullOrWhiteSpace(shellResult.Output) && shellResult.Output.Contains("llvmpipe"))
17 | {
18 | return true;
19 | }
20 | }
21 | catch
22 | {
23 | // do nothing
24 | }
25 |
26 | return false;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Models/FeeDisplayFormat.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Models
6 | {
7 | public enum FeeDisplayFormat
8 | {
9 | USD,
10 | BTC,
11 | SatoshiPerByte,
12 | Percentage
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Models/JsonRpcServerConfiguration.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Gui.Models
2 | {
3 | public class JsonRpcServerConfiguration
4 | {
5 | private Config _config;
6 |
7 | public JsonRpcServerConfiguration(Config config)
8 | {
9 | _config = config;
10 | }
11 |
12 | public bool IsEnabled => _config.JsonRpcServerEnabled;
13 | public string JsonRpcUser => _config.JsonRpcUser;
14 | public string JsonRpcPassword => _config.JsonRpcPassword;
15 | public string[] Prefixes => _config.JsonRpcServerPrefixes;
16 |
17 | public bool RequiresCredentials => !string.IsNullOrEmpty(JsonRpcUser) && !string.IsNullOrEmpty(JsonRpcPassword);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Models/LockScreenType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Models
6 | {
7 | public enum LockScreenType
8 | {
9 | SlideLock,
10 | PinLock
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Models/RoundPhaseState.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.CoinJoin.Common.Models;
2 |
3 | namespace WalletWasabi.Gui.Models
4 | {
5 | public struct RoundPhaseState
6 | {
7 | public RoundPhaseState(RoundPhase phase, bool error)
8 | {
9 | Phase = phase;
10 | Error = error;
11 | }
12 |
13 | public RoundPhase Phase { get; }
14 |
15 | public bool Error { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Models/Sorting/SortOrder.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Gui.Models.Sorting
2 | {
3 | public enum SortOrder
4 | {
5 | None,
6 | Increasing,
7 | Decreasing
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Models/StatusBarStatuses/StatusType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Models.StatusBarStatuses
6 | {
7 | ///
8 | /// Order: priority the lower.
9 | ///
10 | public enum StatusType
11 | {
12 | CriticalUpdate,
13 | OptionalUpdate,
14 | Connecting,
15 | WalletProcessingFilters,
16 | WalletProcessingTransactions,
17 | WalletLoading,
18 | Synchronizing,
19 | Loading,
20 | BroadcastingTransaction,
21 | SigningTransaction,
22 | AcquiringSignatureFromHardwareWallet,
23 | AcquiringXpubFromHardwareWallet,
24 | ConnectingToHardwareWallet,
25 | SettingUpHardwareWallet,
26 | BuildingTransaction,
27 | DequeuingSelectedCoins,
28 | Ready
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "WalletWasabi.Gui": {
4 | "commandName": "Project"
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Rpc/JsonRpcErrorCodes.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Gui.Rpc
2 | {
3 | public enum JsonRpcErrorCodes
4 | {
5 | ParseError = -32700, // Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
6 | InvalidRequest = -32600, // The JSON sent is not a valid Request object.
7 | MethodNotFound = -32601, // The method does not exist / is not available.
8 | InvalidParams = -32602, // Invalid method parameter(s).
9 | InternalError = -32603 // Internal JSON-RPC error.
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Rpc/JsonRpcMethodAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WalletWasabi.Gui.Rpc
4 | {
5 | ///
6 | /// Class used to decorate service methods and map them with their rpc method name.
7 | ///
8 | [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
9 | public sealed class JsonRpcMethodAttribute : Attribute
10 | {
11 | public JsonRpcMethodAttribute(string name)
12 | {
13 | Name = name;
14 | }
15 |
16 | public string Name { get; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Rpc/PaymentInfo.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 |
3 | namespace WalletWasabi.Gui.Rpc
4 | {
5 | public class PaymentInfo
6 | {
7 | public BitcoinAddress Sendto { get; set; }
8 | public Money Amount { get; set; }
9 | public string Label { get; set; }
10 | public bool SubtractFee { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Suggestions/SuggestLabelView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Suggestions
6 | {
7 | public class SuggestLabelView : UserControl
8 | {
9 | public SuggestLabelView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Suggestions/SuggestionViewModel.cs:
--------------------------------------------------------------------------------
1 | using ReactiveUI;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 |
6 | namespace WalletWasabi.Gui.Suggestions
7 | {
8 | public class SuggestionViewModel : ReactiveObject
9 | {
10 | private bool _isHighLighted;
11 |
12 | public SuggestionViewModel(string word, Action onSeleted)
13 | {
14 | Word = word;
15 | OnSelection = onSeleted;
16 | }
17 |
18 | public string Word { get; }
19 | public Action OnSelection { get; }
20 |
21 | public bool IsHighLighted
22 | {
23 | get => _isHighLighted;
24 | set => this.RaiseAndSetIfChanged(ref _isHighLighted, value);
25 | }
26 |
27 | public void OnSelected()
28 | {
29 | OnSelection?.Invoke(Word);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/AboutView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Gui.Tabs
8 | {
9 | internal class AboutView : UserControl
10 | {
11 | public AboutView()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | private void InitializeComponent()
17 | {
18 | AvaloniaXamlLoader.Load(this);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/LegalDocumentsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Tabs
6 | {
7 | public class LegalDocumentsView : UserControl
8 | {
9 | public LegalDocumentsView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/SettingsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Tabs
5 | {
6 | internal class SettingsView : UserControl
7 | {
8 | public SettingsView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletSuccessView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Tabs.WalletManager.GenerateWallets
5 | {
6 | public class GenerateWalletSuccessView : UserControl
7 | {
8 | public GenerateWalletSuccessView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/GenerateWallets/GenerateWalletView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Tabs.WalletManager.GenerateWallets
5 | {
6 | internal class GenerateWalletView : UserControl
7 | {
8 | public GenerateWalletView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/HardwareWallets/ConnectHardwareWalletView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 |
5 | namespace WalletWasabi.Gui.Tabs.WalletManager.HardwareWallets
6 | {
7 | public class ConnectHardwareWalletView : UserControl
8 | {
9 | public ConnectHardwareWalletView()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | AvaloniaXamlLoader.Load(this);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
6 | {
7 | public enum LoadWalletType
8 | {
9 | Desktop,
10 | Password
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/LoadWallets/LoadWalletView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Tabs.WalletManager.LoadWallets
5 | {
6 | internal class LoadWalletView : UserControl
7 | {
8 | public LoadWalletView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/RecoverWallets/RecoverWalletView.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 |
4 | namespace WalletWasabi.Gui.Tabs.WalletManager.RecoverWallets
5 | {
6 | internal class RecoverWalletView : UserControl
7 | {
8 | public RecoverWalletView()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Tabs/WalletManager/WalletManagerView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using Avalonia.Controls;
5 | using Avalonia.Markup.Xaml;
6 | using AvalonStudio.Extensibility;
7 | using AvalonStudio.Shell;
8 |
9 | namespace WalletWasabi.Gui.Tabs.WalletManager
10 | {
11 | internal class WalletManagerView : UserControl
12 | {
13 | public WalletManagerView()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void InitializeComponent()
19 | {
20 | AvaloniaXamlLoader.Load(this);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Validation/IRegisterValidationMethod.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Gui.Validation
2 | {
3 | public interface IRegisterValidationMethod
4 | {
5 | void RegisterValidationMethod(string propertyName, ValidateMethod validateMethod);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Validation/IValidations.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace WalletWasabi.Gui.Validation
4 | {
5 | public interface IValidations
6 | {
7 | bool Any { get; }
8 |
9 | bool AnyErrors { get; }
10 |
11 | bool AnyWarnings { get; }
12 |
13 | bool AnyInfos { get; }
14 |
15 | IEnumerable Infos { get; }
16 |
17 | IEnumerable Warnings { get; }
18 |
19 | IEnumerable Errors { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/Validation/ValidationExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq.Expressions;
3 | using WalletWasabi.Models;
4 |
5 | namespace WalletWasabi.Gui.Validation
6 | {
7 | public delegate void ValidateMethod(IValidationErrors errors);
8 |
9 | public static class ValidationExtensions
10 | {
11 | public static void ValidateProperty(this TSender viewModel, Expression> property, ValidateMethod validateMethod) where TSender : IRegisterValidationMethod
12 | {
13 | var expression = (MemberExpression)property.Body;
14 |
15 | viewModel.RegisterValidationMethod(expression.Member.Name, validateMethod);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/ViewModels/CategoryViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Gui.ViewModels
6 | {
7 | public class CategoryViewModel : ViewModelBase
8 | {
9 | public CategoryViewModel(string title)
10 | {
11 | Title = title;
12 | }
13 |
14 | public string Title { get; }
15 |
16 | public virtual void OnCategorySelected()
17 | {
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/ViewModels/IWalletViewModel.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Wallets;
2 |
3 | namespace WalletWasabi.Gui.ViewModels
4 | {
5 | public interface IWalletViewModel
6 | {
7 | Wallet Wallet { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/WasabiWindow.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Gui/WasabiWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Markup.Xaml;
3 | using AvalonStudio.Shell.Controls;
4 |
5 | namespace WalletWasabi.Gui
6 | {
7 | public class WasabiWindow : MetroWindow
8 | {
9 | public WasabiWindow()
10 | {
11 | InitializeComponent();
12 | #if DEBUG
13 | this.AttachDevTools();
14 | #endif
15 | }
16 |
17 | private void InitializeComponent()
18 | {
19 | AvaloniaXamlLoader.Load(this);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/App/Contents/Resources/WasabiLogo.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/App/Contents/Resources/WasabiLogo.icns
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.DS_Store.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.DS_Store.dat
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.background/Logo_with_text_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.background/Logo_with_text_small.png
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.fseventsd/000000000081abf0:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.fseventsd/000000000081abf0
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.fseventsd/000000000081abf1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.fseventsd/000000000081abf1
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/Dmg/.fseventsd/fseventsd-uuid:
--------------------------------------------------------------------------------
1 | 5D4F6D41-8967-4D1E-9953-35A263D5EFDF
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/WasabiLogo.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/WasabiLogo.icns
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/addcert.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | key_chain="build.keychain"
4 | key_chain_pass="mysecretpassword"
5 | security create-keychain -p "$key_chain_pass" "$key_chain"
6 | security default-keychain -s "$key_chain"
7 | security unlock-keychain -p "$key_chain_pass" "$key_chain"
8 | security import macdevsign.p12 -k "$key_chain" -P "alma" -A
9 | security set-key-partition-list -S apple-tool:,apple: -s -k "$key_chain_pass" "$key_chain"
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Packager/Content/Osx/entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.cs.allow-jit
6 |
7 | com.apple.security.cs.allow-unsigned-executable-memory
8 |
9 | com.apple.security.cs.allow-dyld-environment-variables
10 |
11 | com.apple.security.cs.disable-library-validation
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/Helpers/StringNoWhiteSpaceEqualityComparer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics.CodeAnalysis;
4 | using System.Linq;
5 |
6 | namespace WalletWasabi.Tests.Helpers
7 | {
8 | public class StringNoWhiteSpaceEqualityComparer : IEqualityComparer
9 | {
10 | public bool Equals([AllowNull] string x, [AllowNull] string y)
11 | {
12 | if (x == y)
13 | {
14 | return true;
15 | }
16 |
17 | if (x is null || y is null)
18 | {
19 | return false;
20 | }
21 |
22 | return Enumerable.SequenceEqual(
23 | x.Where(c => !char.IsWhiteSpace(c)),
24 | y.Where(c => !char.IsWhiteSpace(c)));
25 | }
26 |
27 | public int GetHashCode([DisallowNull] string obj)
28 | {
29 | throw new NotImplementedException();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/Helpers/TransactionProcessorExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using WalletWasabi.Blockchain.Keys;
5 |
6 | namespace WalletWasabi.Blockchain.TransactionProcessing
7 | {
8 | public static class TransactionProcessorExtensions
9 | {
10 | public static HdPubKey NewKey(this TransactionProcessor me, string label)
11 | {
12 | return me.KeyManager.GenerateNewKey(label, KeyState.Clean, true);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/README.md:
--------------------------------------------------------------------------------
1 | # Tests
2 |
3 | We divide tests into 4 different categories. **Unit Tests**, **Integration Tests**, **Regression Tests** and **Acceptance Tests**.
4 |
5 | We define **Unit Tests** as tests that have no **external dependencies**, however **local dependencies** are allowed. **Unit Tests** run on CI.
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/UnitTests/InputsResponseTests.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using WalletWasabi.CoinJoin.Common.Models;
6 | using Xunit;
7 |
8 | namespace WalletWasabi.Tests.UnitTests
9 | {
10 | public class InputsResponseTests
11 | {
12 | [Fact]
13 | public void InputsResponseSerialization()
14 | {
15 | var resp = new InputsResponse
16 | {
17 | UniqueId = Guid.NewGuid(),
18 | RoundId = 1,
19 | };
20 | var serialized = JsonConvert.SerializeObject(resp);
21 | var deserialized = JsonConvert.DeserializeObject(serialized);
22 |
23 | Assert.Equal(resp.RoundId, deserialized.RoundId);
24 | Assert.Equal(resp.UniqueId, deserialized.UniqueId);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/XunitConfiguration/CollectionDefinitions.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace WalletWasabi.Tests.XunitConfiguration
4 | {
5 | [CollectionDefinition("RegTest collection")]
6 | public class RegTestCollection : ICollectionFixture
7 | {
8 | // This class has no code, and is never created. Its purpose is simply
9 | // to be the place to apply [CollectionDefinition] and all the
10 | // ICollectionFixture<> interfaces.
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/XunitConfiguration/LiverServerTestsCollections.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Xunit;
5 |
6 | namespace WalletWasabi.Tests.XunitConfiguration
7 | {
8 | [CollectionDefinition("LiveServerTests collection")]
9 | public class LiverServerTestsCollections : ICollectionFixture
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.Tests/xunit.runner.json:
--------------------------------------------------------------------------------
1 | {
2 | "methodDisplay": "method"
3 | }
4 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.WindowsInstaller/Common.wxl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Wasabi Wallet
5 | WasabiWallet
6 | zkSNACKs
7 |
8 | 1033
9 |
10 | Privacy focused Bitcoin wallet.
11 | bitcoin,cryptocurrency,blockchain,privacy,fungibility,anonymity
12 |
13 |
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.WindowsInstaller/ComponentsGenerated.wxs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi.WindowsInstaller/Directories.wxs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("WalletWasabi.Tests")]
4 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/DeviceToken.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 | using Newtonsoft.Json;
4 | using Newtonsoft.Json.Converters;
5 |
6 | namespace WalletWasabi.Backend.Models
7 | {
8 | public class DeviceToken
9 | {
10 | [Key]
11 | [Required]
12 | [DatabaseGenerated(DatabaseGeneratedOption.None)]
13 | public string Token { get; set; }
14 |
15 | [JsonConverter(typeof(StringEnumConverter))]
16 | public TokenType Type { get; set; }
17 |
18 | [JsonIgnore]
19 | public TokenStatus Status { get; set; } = TokenStatus.New;
20 | }
21 |
22 | public enum TokenStatus
23 | {
24 | New,
25 | Valid,
26 | Invalid
27 | }
28 |
29 | public enum TokenType
30 | {
31 | Apple,
32 | AppleDebug
33 | }
34 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/ExchangeRate.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace WalletWasabi.Backend.Models
4 | {
5 | public class ExchangeRate
6 | {
7 | [Required]
8 | public string Ticker { get; set; }
9 |
10 | [Required]
11 | public decimal Rate { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/FeeEstimationPair.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace WalletWasabi.Backend.Models
4 | {
5 | ///
6 | /// Satoshi per byte.
7 | ///
8 | public class FeeEstimationPair
9 | {
10 | [Required]
11 | public long Economical { get; set; }
12 |
13 | [Required]
14 | public long Conservative { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/FiltersResponseState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Backend.Models
6 | {
7 | public enum FiltersResponseState
8 | {
9 | BestKnownHashNotFound, // When this happens, it's a reorg.
10 | NoNewFilter,
11 | NewFilters
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/Requests/BroadcastRequest.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace WalletWasabi.Backend.Models.Requests
4 | {
5 | public class BroadcastRequest
6 | {
7 | [Required]
8 | public string Hex { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/Responses/FiltersResponse.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System.Collections.Generic;
3 | using WalletWasabi.JsonConverters;
4 |
5 | namespace WalletWasabi.Backend.Models.Responses
6 | {
7 | public class FiltersResponse
8 | {
9 | public int BestHeight { get; set; }
10 |
11 | [JsonProperty(ItemConverterType = typeof(FilterModelJsonConverter))] // Do not use the default jsonifyer, because that's too much data.
12 | public IEnumerable Filters { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/Responses/StatusResponse.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Backend.Models.Responses
2 | {
3 | public class StatusResponse
4 | {
5 | public bool FilterCreationActive { get; set; }
6 | public bool CoinJoinCreationActive { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Backend/Models/Responses/VersionsResponse.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace WalletWasabi.Backend.Models.Responses
4 | {
5 | public class VersionsResponse
6 | {
7 | public string ClientVersion { get; set; }
8 |
9 | // KEEP THE TYPO IN IT! Otherwise the response would not be backwards compatible.
10 | [JsonProperty(PropertyName = "BackenMajordVersion")]
11 | public string BackendMajorVersion { get; set; }
12 |
13 | public string LegalDocumentsVersion { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/Configuration/Whitening/WhiteBind.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Net;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.BitcoinCore.Configuration.Whitening
8 | {
9 | public class WhiteBind : WhiteEntry
10 | {
11 | public static bool TryParse(string value, Network network, out WhiteBind white)
12 | => TryParse(value, network, out white);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/Configuration/Whitening/WhiteList.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Net;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.BitcoinCore.Configuration.Whitening
8 | {
9 | public class WhiteList : WhiteEntry
10 | {
11 | public static bool TryParse(string value, Network network, out WhiteList white)
12 | => TryParse(value, network, out white);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/Endpointing/EndPointStrategyType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.BitcoinCore.Endpointing
6 | {
7 | public enum EndPointStrategyType
8 | {
9 | Default,
10 | Custom,
11 | Random
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/Endpointing/EndPointType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.BitcoinCore.Endpointing
6 | {
7 | public enum EndPointType
8 | {
9 | P2p,
10 | Rpc
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/Processes/BitcoindException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.BitcoinCore.Processes
6 | {
7 | public class BitcoindException : Exception
8 | {
9 | public BitcoindException(string message) : base(message)
10 | {
11 | }
12 |
13 | public BitcoindException(string message, Exception innerException) : base(message, innerException)
14 | {
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/Processes/BitcoindProcessBridge.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using WalletWasabi.Microservices;
5 |
6 | namespace WalletWasabi.BitcoinCore.Processes
7 | {
8 | public class BitcoindProcessBridge : ProcessBridge
9 | {
10 | public BitcoindProcessBridge() : base(MicroserviceHelpers.GetBinaryPath("bitcoind"))
11 | {
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/RpcModels/RpcPubkeyType.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.BitcoinCore.RpcModels
2 | {
3 | public enum RpcPubkeyType
4 | {
5 | Unknown,
6 | TxNonstandard,
7 | TxPubkey,
8 | TxPubkeyhash,
9 | TxScripthash,
10 | TxMultisig,
11 | TxNullData,
12 | TxWitnessV0Keyhash,
13 | TxWitnessV0Scripthash,
14 | TxWitnessUnknown,
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/RpcModels/VerboseInputInfo.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 |
3 | namespace WalletWasabi.BitcoinCore.RpcModels
4 | {
5 | public class VerboseInputInfo
6 | {
7 | public VerboseInputInfo(string coinbase)
8 | {
9 | Coinbase = coinbase;
10 | }
11 |
12 | public VerboseInputInfo(OutPoint outPoint, VerboseOutputInfo prevOutput)
13 | {
14 | OutPoint = outPoint;
15 | PrevOutput = prevOutput;
16 | }
17 |
18 | public OutPoint OutPoint { get; }
19 |
20 | public VerboseOutputInfo PrevOutput { get; }
21 |
22 | public string Coinbase { get; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/RpcModels/VerboseOutputInfo.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 |
3 | namespace WalletWasabi.BitcoinCore.RpcModels
4 | {
5 | public class VerboseOutputInfo
6 | {
7 | public VerboseOutputInfo(Money value, Script scriptPubKey, string pubkeyType)
8 | {
9 | Value = value;
10 | ScriptPubKey = scriptPubKey;
11 | PubkeyType = RpcParser.ConvertPubkeyType(pubkeyType);
12 | }
13 |
14 | public Money Value { get; }
15 |
16 | public Script ScriptPubKey { get; }
17 |
18 | public RpcPubkeyType PubkeyType { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/BitcoinCore/RpcModels/VerboseTransactionInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using NBitcoin;
3 |
4 | namespace WalletWasabi.BitcoinCore.RpcModels
5 | {
6 | public class VerboseTransactionInfo
7 | {
8 | public VerboseTransactionInfo(uint256 id, IEnumerable inputs, IEnumerable outputs)
9 | {
10 | Id = id;
11 | Inputs = inputs;
12 | Outputs = outputs;
13 | }
14 |
15 | public uint256 Id { get; }
16 |
17 | public IEnumerable Inputs { get; }
18 |
19 | public IEnumerable Outputs { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Analysis/FeesEstimation/IFeeProvider.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Blockchain.Analysis.FeesEstimation
8 | {
9 | public interface IFeeProvider
10 | {
11 | public event EventHandler AllFeeEstimateChanged;
12 |
13 | public AllFeeEstimate AllFeeEstimate { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Keys/KeyState.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Blockchain.Keys
2 | {
3 | public enum KeyState
4 | {
5 | Clean,
6 | Locked,
7 | Used
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/TransactionBuilding/ChangeStrategy.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Blockchain.TransactionBuilding
6 | {
7 | public enum ChangeStrategy
8 | {
9 | Auto,
10 | Custom,
11 | AllRemainingCustom
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/TransactionBuilding/FeeStrategyType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Blockchain.TransactionBuilding
6 | {
7 | public enum FeeStrategyType
8 | {
9 | Target,
10 | Rate
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/TransactionBuilding/MoneyRequestType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Blockchain.TransactionBuilding
6 | {
7 | public enum MoneyRequestType
8 | {
9 | Value,
10 | Change,
11 | AllRemaining
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/AllTransactionStoreMock.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 |
3 | namespace WalletWasabi.Blockchain.Transactions
4 | {
5 | public class AllTransactionStoreMock : AllTransactionStore
6 | {
7 | public override bool TryGetTransaction(uint256 hash, out SmartTransaction sameStx)
8 | {
9 | sameStx = null;
10 | return false;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/Operations/Append.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace WalletWasabi.Blockchain.Transactions.Operations
7 | {
8 | public class Append : ITxStoreOperation
9 | {
10 | public Append(params SmartTransaction[] transactions) : this(transactions as IEnumerable)
11 | {
12 | }
13 |
14 | public Append(IEnumerable transactions)
15 | {
16 | Transactions = transactions;
17 | }
18 |
19 | public IEnumerable Transactions { get; }
20 |
21 | public bool IsEmpty => Transactions is null || !Transactions.Any();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/Operations/ITxStoreOperation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Blockchain.Transactions.Operations
6 | {
7 | public interface ITxStoreOperation
8 | {
9 | public bool IsEmpty { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/Operations/Remove.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Blockchain.Transactions.Operations
8 | {
9 | public class Remove : ITxStoreOperation
10 | {
11 | public Remove(params uint256[] transactions) : this(transactions as IEnumerable)
12 | {
13 | }
14 |
15 | public Remove(IEnumerable transactions)
16 | {
17 | Transactions = transactions;
18 | }
19 |
20 | public IEnumerable Transactions { get; }
21 | public bool IsEmpty => Transactions is null || !Transactions.Any();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/Operations/Update.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace WalletWasabi.Blockchain.Transactions.Operations
7 | {
8 | public class Update : ITxStoreOperation
9 | {
10 | public Update(params SmartTransaction[] transactions) : this(transactions as IEnumerable)
11 | {
12 | }
13 |
14 | public Update(IEnumerable transactions)
15 | {
16 | Transactions = transactions;
17 | }
18 |
19 | public IEnumerable Transactions { get; }
20 |
21 | public bool IsEmpty => Transactions is null || !Transactions.Any();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/TransactionDependencyNode.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace WalletWasabi.Blockchain.Transactions
7 | {
8 | public class TransactionDependencyNode
9 | {
10 | public List Children { get; } = new List();
11 | public List Parents { get; } = new List();
12 | public Transaction Transaction { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Blockchain/Transactions/TransactionSummary.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using WalletWasabi.Models;
4 |
5 | namespace WalletWasabi.Blockchain.Transactions
6 | {
7 | public class TransactionSummary
8 | {
9 | public DateTimeOffset DateTime { get; set; }
10 | public Height Height { get; set; }
11 | public Money Amount { get; set; }
12 | public string Label { get; set; }
13 | public uint256 TransactionId { get; set; }
14 | public int BlockIndex { get; set; }
15 | public bool IsLikelyCoinJoinOutput { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Client/Clients/Queuing/DequeueResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using WalletWasabi.Blockchain.TransactionOutputs;
5 | using WalletWasabi.Helpers;
6 |
7 | namespace WalletWasabi.CoinJoin.Client.Clients.Queuing
8 | {
9 | public class DequeueResult
10 | {
11 | public DequeueResult(IDictionary> successful, IDictionary> unsuccessful)
12 | {
13 | Successful = Guard.NotNull(nameof(successful), successful);
14 | Unsuccessful = Guard.NotNull(nameof(unsuccessful), unsuccessful);
15 | }
16 |
17 | public IDictionary> Successful { get; }
18 | public IDictionary> Unsuccessful { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/ActiveOutput.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using WalletWasabi.Crypto;
6 | using WalletWasabi.Helpers;
7 |
8 | namespace WalletWasabi.CoinJoin.Common.Models
9 | {
10 | public class ActiveOutput
11 | {
12 | public ActiveOutput(BitcoinAddress address, UnblindedSignature signature, int mixingLevel)
13 | {
14 | Address = Guard.NotNull(nameof(address), address);
15 | Signature = Guard.NotNull(nameof(signature), signature);
16 | MixingLevel = Guard.MinimumAndNotNull(nameof(mixingLevel), mixingLevel, 0);
17 | }
18 |
19 | public BitcoinAddress Address { get; }
20 | public UnblindedSignature Signature { get; }
21 | public int MixingLevel { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/ConnectionConfirmationResponse.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel.DataAnnotations;
6 | using System.Text;
7 | using WalletWasabi.JsonConverters;
8 |
9 | namespace WalletWasabi.CoinJoin.Common.Models
10 | {
11 | public class ConnectionConfirmationResponse
12 | {
13 | [JsonProperty(ItemConverterType = typeof(Uint256JsonConverter))]
14 | public IEnumerable BlindedOutputSignatures { get; set; }
15 |
16 | [Required]
17 | public RoundPhase CurrentPhase { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/HdPubKeyBlindedPair.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Text;
6 | using WalletWasabi.Blockchain.Keys;
7 | using WalletWasabi.Helpers;
8 | using WalletWasabi.JsonConverters;
9 |
10 | namespace WalletWasabi.CoinJoin.Common.Models
11 | {
12 | [JsonObject(MemberSerialization.OptIn)]
13 | public class HdPubKeyBlindedPair
14 | {
15 | [JsonConstructor]
16 | public HdPubKeyBlindedPair(HdPubKey key, bool isBlinded)
17 | {
18 | Key = Guard.NotNull(nameof(key), key);
19 | IsBlinded = isBlinded;
20 | }
21 |
22 | [JsonProperty]
23 | public HdPubKey Key { get; set; }
24 |
25 | [JsonProperty]
26 | public bool IsBlinded { get; set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/InputProofModel.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System.ComponentModel.DataAnnotations;
4 | using WalletWasabi.JsonConverters;
5 |
6 | namespace WalletWasabi.CoinJoin.Common.Models
7 | {
8 | public class InputProofModel
9 | {
10 | [Required]
11 | [JsonConverter(typeof(OutPointAsTxoRefJsonConverter))]
12 | public OutPoint Input { get; set; }
13 |
14 | [Required]
15 | [MinLength(65, ErrorMessage = "Provided proof is invalid")] // Bitcoin compact signatures are 65 bytes length
16 | [MaxLength(65, ErrorMessage = "Provided proof is invalid")] // Bitcoin compact signatures are 65 bytes length
17 | [JsonConverter(typeof(ByteArrayJsonConverter))]
18 | public byte[] Proof { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/InputsRequest.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations;
5 | using System.Net.Http;
6 | using System.Text;
7 | using WalletWasabi.JsonConverters;
8 |
9 | namespace WalletWasabi.CoinJoin.Common.Models
10 | {
11 | public class InputsRequest : InputsRequestBase
12 | {
13 | [Required, MinLength(1)]
14 | [JsonProperty(ItemConverterType = typeof(Uint256JsonConverter))]
15 | public IEnumerable BlindedOutputScripts { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/InputsRequest4.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations;
5 | using System.Net.Http;
6 | using System.Text;
7 | using WalletWasabi.JsonConverters;
8 |
9 | namespace WalletWasabi.CoinJoin.Common.Models
10 | {
11 | public class InputsRequest4 : InputsRequestBase
12 | {
13 | [Required, MinLength(1)]
14 | public IEnumerable BlindedOutputScripts { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/InputsResponse.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations;
5 | using WalletWasabi.JsonConverters;
6 |
7 | namespace WalletWasabi.CoinJoin.Common.Models
8 | {
9 | public class InputsResponse
10 | {
11 | [JsonConverter(typeof(GuidJsonConverter))]
12 | public Guid UniqueId { get; set; }
13 |
14 | public long RoundId { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/PublicNonceWithIndex.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using WalletWasabi.JsonConverters;
4 |
5 | namespace WalletWasabi.CoinJoin.Common.Models
6 | {
7 | public class PublicNonceWithIndex
8 | {
9 | public PublicNonceWithIndex(int n, PubKey rPubKey)
10 | {
11 | N = n;
12 | R = rPubKey;
13 | }
14 |
15 | [JsonProperty]
16 | public int N { get; set; }
17 |
18 | [JsonProperty]
19 | [JsonConverter(typeof(PubKeyJsonConverter))]
20 | public PubKey R { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/RoundPhase.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.CoinJoin.Common.Models
2 | {
3 | public enum RoundPhase
4 | {
5 | InputRegistration,
6 | ConnectionConfirmation,
7 | OutputRegistration,
8 | Signing
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/RoundStateResponse.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using Newtonsoft.Json.Converters;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using WalletWasabi.CoinJoin.Common.Crypto;
8 | using WalletWasabi.JsonConverters;
9 |
10 | namespace WalletWasabi.CoinJoin.Common.Models
11 | {
12 | public class RoundStateResponse : RoundStateResponseBase
13 | {
14 | public IEnumerable SchnorrPubKeys { get; set; }
15 |
16 | public override int MixLevelCount => SchnorrPubKeys.Count();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Common/Models/RoundStateResponse4.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using WalletWasabi.JsonConverters;
8 |
9 | namespace WalletWasabi.CoinJoin.Common.Models
10 | {
11 | public class RoundStateResponse4 : RoundStateResponseBase
12 | {
13 | [JsonProperty(ItemConverterType = typeof(PubKeyJsonConverter))]
14 | public IEnumerable SignerPubKeys { get; set; }
15 |
16 | public IEnumerable RPubKeys { get; set; }
17 |
18 | public override int MixLevelCount => SignerPubKeys.Count();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Coordinator/Participants/AliceState.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.CoinJoin.Coordinator.Participants
2 | {
3 | public enum AliceState
4 | {
5 | InputsRegistered,
6 | ConnectionConfirmed,
7 | SignedCoinJoin
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Coordinator/Participants/Bob.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using WalletWasabi.CoinJoin.Coordinator.MixingLevels;
3 | using WalletWasabi.Helpers;
4 |
5 | namespace WalletWasabi.CoinJoin.Coordinator.Participants
6 | {
7 | public class Bob
8 | {
9 | public Bob(BitcoinAddress activeOutputAddress, MixingLevel level)
10 | {
11 | ActiveOutputAddress = Guard.NotNull(nameof(activeOutputAddress), activeOutputAddress);
12 | Level = Guard.NotNull(nameof(level), level);
13 | }
14 |
15 | public MixingLevel Level { get; }
16 | public BitcoinAddress ActiveOutputAddress { get; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRoundStatus.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.CoinJoin.Coordinator.Rounds
2 | {
3 | public enum CoordinatorRoundStatus
4 | {
5 | NotStarted,
6 | Running,
7 | Succeded,
8 | Aborted
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Crypto/Randomness/MockRandom.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin.Secp256k1;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace WalletWasabi.Crypto.Randomness
8 | {
9 | public class MockRandom : IWasabiRandom
10 | {
11 | public List GetBytesResults { get; } = new List();
12 |
13 | public void GetBytes(byte[] output)
14 | {
15 | var first = GetBytesResults.First();
16 | GetBytesResults.RemoveFirst();
17 | Buffer.BlockCopy(first, 0, output, 0, first.Length);
18 | }
19 |
20 | public void GetBytes(Span output)
21 | {
22 | var first = GetBytesResults.First();
23 | GetBytesResults.RemoveFirst();
24 | first.AsSpan().CopyTo(output);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Crypto/Randomness/UnsecureRandom.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Crypto.Randomness
6 | {
7 | public class UnsecureRandom : IWasabiRandom
8 | {
9 | public UnsecureRandom()
10 | {
11 | Random = new Random();
12 | }
13 |
14 | private Random Random { get; }
15 |
16 | public void GetBytes(byte[] buffer) => Random.NextBytes(buffer);
17 |
18 | public void GetBytes(Span buffer) => Random.NextBytes(buffer);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Exceptions/ConnectionException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WalletWasabi.Exceptions
4 | {
5 | public class ConnectionException : Exception
6 | {
7 | public ConnectionException(string message) : base(message)
8 | {
9 | }
10 |
11 | public ConnectionException(string message, Exception innerException) : base(message, innerException)
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Exceptions/InsufficientBalanceException.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 |
4 | namespace WalletWasabi.Exceptions
5 | {
6 | public class InsufficientBalanceException : Exception
7 | {
8 | public InsufficientBalanceException(Money minimum, Money actual) : base($"Needed: {minimum.ToString(false, true)} BTC, got only: {actual.ToString(false, true)} BTC.")
9 | {
10 | Minimum = minimum ?? Money.Zero;
11 | Actual = actual ?? Money.Zero;
12 | }
13 |
14 | public Money Minimum { get; }
15 | public Money Actual { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Exceptions/InvalidTxException.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using NBitcoin.Policy;
3 | using System;
4 | using System.Collections.Generic;
5 | using WalletWasabi.Helpers;
6 |
7 | namespace WalletWasabi.Exceptions
8 | {
9 | public class InvalidTxException : Exception
10 | {
11 | public InvalidTxException(Transaction invalidTx, IEnumerable errors = null)
12 | {
13 | Transaction = Guard.NotNull(nameof(invalidTx), invalidTx);
14 | Errors = errors;
15 | }
16 |
17 | public Transaction Transaction { get; }
18 | public IEnumerable Errors { get; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Exceptions/NotSupportedNetworkException.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace WalletWasabi.Exceptions
7 | {
8 | public class NotSupportedNetworkException : NotSupportedException
9 | {
10 | public NotSupportedNetworkException(Network network)
11 | : base($"{nameof(Network)} not supported: {network}.")
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Exceptions/TorSocks5FailureResponseException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using WalletWasabi.Helpers;
3 | using WalletWasabi.TorSocks5.Models.Fields.OctetFields;
4 |
5 | namespace WalletWasabi.Exceptions
6 | {
7 | public class TorSocks5FailureResponseException : Exception
8 | {
9 | public TorSocks5FailureResponseException(RepField rep) : base($"Tor SOCKS5 proxy responded with {rep}.")
10 | {
11 | RepField = Guard.NotNull(nameof(rep), rep);
12 | }
13 |
14 | public RepField RepField { get; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Exceptions/TypeArgumentException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Exceptions
6 | {
7 | public class TypeArgumentException : ArgumentException
8 | {
9 | public TypeArgumentException(object value, Type expected, string paramName) : base($"Invalid type: {value.GetType()}. Expected: {expected}.", paramName)
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Extensions/HttpContentExtensions.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Serialization;
3 | using System.Threading.Tasks;
4 | using WalletWasabi.JsonConverters;
5 | using WalletWasabi.WebClients.Wasabi;
6 |
7 | namespace System.Net.Http
8 | {
9 | public static class HttpContentExtensions
10 | {
11 | public static async Task ReadAsJsonAsync(this HttpContent me)
12 | {
13 | if (me is null)
14 | {
15 | return default;
16 | }
17 |
18 | var settings = new JsonSerializerSettings
19 | {
20 | Converters = new[] { new RoundStateResponseJsonConverter(WasabiClient.ApiVersion) }
21 | };
22 | var jsonString = await me.ReadAsStringAsync();
23 | return JsonConvert.DeserializeObject(jsonString, settings);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Extensions/HttpStatusCodeExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http;
2 |
3 | namespace System.Net
4 | {
5 | public static class HttpStatusCodeExtensions
6 | {
7 | public static string ToReasonString(this HttpStatusCode me)
8 | {
9 | using var message = new HttpResponseMessage(me);
10 | return message.ReasonPhrase;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Extensions/ReflectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | namespace System.Reflection
4 | {
5 | public static class MethodInfoExtensions
6 | {
7 | public static bool IsAsync(this MethodInfo mi)
8 | {
9 | Type attType = typeof(AsyncStateMachineAttribute);
10 |
11 | var attrib = (AsyncStateMachineAttribute)mi.GetCustomAttribute(attType);
12 |
13 | return attrib is { };
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/DataEncodation/EncodationStruct.cs:
--------------------------------------------------------------------------------
1 | using Gma.QrCodeNet.Encoding.Versions;
2 |
3 | namespace Gma.QrCodeNet.Encoding.DataEncodation
4 | {
5 | internal struct EncodationStruct
6 | {
7 | internal EncodationStruct(VersionControlStruct vcStruct) : this()
8 | {
9 | VersionDetail = vcStruct.VersionDetail;
10 | }
11 |
12 | internal VersionDetail VersionDetail { get; set; }
13 | internal BitList DataCodewords { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/DataEncodation/InputRecognition/RecognitionStruct.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.DataEncodation.InputRecognition
2 | {
3 | public struct RecognitionStruct
4 | {
5 | public RecognitionStruct(string encodingName)
6 | : this()
7 | {
8 | EncodingName = encodingName;
9 | }
10 |
11 | public string EncodingName { get; private set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/ErrorCorrectionLevel.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding
2 | {
3 | public enum ErrorCorrectionLevel
4 | {
5 | L,
6 | M,
7 | Q,
8 | H
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/InputOutOfBoundaryException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding
4 | {
5 | ///
6 | /// Use this exception for null or empty input string or when input string is too large.
7 | ///
8 | public class InputOutOfBoundaryException : Exception
9 | {
10 | public InputOutOfBoundaryException() : base()
11 | {
12 | }
13 |
14 | public InputOutOfBoundaryException(string message) : base(message)
15 | {
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/MaskPatternType.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.Masking
2 | {
3 | public enum MaskPatternType
4 | {
5 | Type0 = 0,
6 | Type1 = 1,
7 | Type2 = 2,
8 | Type3 = 3,
9 | Type4 = 4,
10 | Type5 = 5,
11 | Type6 = 6,
12 | Type7 = 7
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | public abstract class Pattern : BitMatrix
6 | {
7 | public override int Width => throw new NotSupportedException();
8 | public override int Height => throw new NotSupportedException();
9 |
10 | public override bool[,] InternalArray => throw new NotImplementedException();
11 |
12 | public abstract MaskPatternType MaskPatternType { get; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern0.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern0 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type0;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => (j + i) % 2 == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern1 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type1;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => j % 2 == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern2 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type2;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => i % 3 == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern3.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern3 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type3;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => (j + i) % 3 == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern4.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern4 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type4;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => ((j / 2) + (i / 3)) % 2 == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern5.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern5 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type5;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => (((i * j) % 2) + ((i * j) % 3)) == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern6.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern6 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type6;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => ((((i * j) % 2) + ((i * j) % 3)) % 2) == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Pattern7.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Masking
4 | {
5 | internal class Pattern7 : Pattern
6 | {
7 | public override MaskPatternType MaskPatternType => MaskPatternType.Type7;
8 |
9 | public override bool this[int i, int j]
10 | {
11 | get => (((i * j) % 3) + (((i + j) % 2) % 2)) == 0;
12 | set => throw new NotSupportedException();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Scoring/Penalty.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.Masking.Scoring
2 | {
3 | public abstract class Penalty
4 | {
5 | internal abstract int PenaltyCalculate(BitMatrix matrix);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Masking/Scoring/PenaltyRules.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.Masking.Scoring
2 | {
3 | public enum PenaltyRules
4 | {
5 | Rule01 = 1,
6 | Rule02 = 2,
7 | Rule03 = 3,
8 | Rule04 = 4
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/MatrixPoint.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding
2 | {
3 | public struct MatrixPoint
4 | {
5 | internal MatrixPoint(int x, int y)
6 | : this()
7 | {
8 | X = x;
9 | Y = y;
10 | }
11 |
12 | public int X { get; private set; }
13 | public int Y { get; private set; }
14 |
15 | public MatrixPoint Offset(MatrixPoint offset) => new MatrixPoint(offset.X + X, offset.Y + Y);
16 |
17 | internal MatrixPoint Offset(int offsetX, int offsetY) => Offset(new MatrixPoint(offsetX, offsetY));
18 |
19 | public override string ToString() => $"Point({X};{Y})";
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/MatrixSize.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding
2 | {
3 | public struct MatrixSize
4 | {
5 | internal MatrixSize(int width, int height)
6 | : this()
7 | {
8 | Width = width;
9 | Height = height;
10 | }
11 |
12 | public int Width { get; private set; }
13 | public int Height { get; private set; }
14 |
15 | public override string ToString()
16 | {
17 | return $"Size({Width};{Height})";
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/MatrixStatus.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding
2 | {
3 | public enum MatrixStatus
4 | {
5 | None,
6 | NoMask,
7 | Data
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Positioning/PositioninngPatternBuilder.cs:
--------------------------------------------------------------------------------
1 | using Gma.QrCodeNet.Encoding.Positioning.Stencils;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Positioning
4 | {
5 | internal static class PositioningPatternBuilder
6 | {
7 | internal static void EmbedBasicPatterns(int version, TriStateMatrix matrix)
8 | {
9 | new PositionDetectionPattern(version).ApplyTo(matrix);
10 | new DarkDotAtLeftBottom(version).ApplyTo(matrix);
11 | new AlignmentPattern(version).ApplyTo(matrix);
12 | new TimingPattern(version).ApplyTo(matrix);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Positioning/Stencils/DarkDotAtLeftBottom.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Gma.QrCodeNet.Encoding.Positioning.Stencils
4 | {
5 | internal class DarkDotAtLeftBottom : PatternStencilBase
6 | {
7 | public DarkDotAtLeftBottom(int version) : base(version)
8 | {
9 | }
10 |
11 | public override bool[,] Stencil => throw new NotImplementedException();
12 |
13 | public override void ApplyTo(TriStateMatrix matrix)
14 | {
15 | matrix[8, matrix.Width - 8, MatrixStatus.NoMask] = true;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/QrCode.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding
2 | {
3 | ///
4 | /// This class contain two variables.
5 | /// BitMatrix for QrCode
6 | /// isContainMatrix for indicate whether QrCode contains BitMatrix or not.
7 | /// BitMatrix will be equal to null if isContainMatrix is false.
8 | ///
9 | public class QrCode
10 | {
11 | internal QrCode(BitMatrix matrix)
12 | {
13 | Matrix = matrix;
14 | IsContainMatrix = true;
15 | }
16 |
17 | public QrCode()
18 | {
19 | IsContainMatrix = false;
20 | Matrix = null;
21 | }
22 |
23 | public bool IsContainMatrix
24 | {
25 | get;
26 | private set;
27 | }
28 |
29 | public BitMatrix Matrix
30 | {
31 | get;
32 | private set;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/ReedSolomon/PolyDivideStruct.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.ReedSolomon
2 | {
3 | internal struct PolyDivideStruct
4 | {
5 | internal PolyDivideStruct(Polynomial quotient, Polynomial remainder)
6 | : this()
7 | {
8 | Quotient = quotient;
9 | Remainder = remainder;
10 | }
11 |
12 | internal Polynomial Quotient { get; private set; }
13 |
14 | internal Polynomial Remainder { get; private set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/StateMatrix.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding
2 | {
3 | public sealed class StateMatrix
4 | {
5 | public StateMatrix(int width)
6 | {
7 | Width = width;
8 | MatrixStatus = new MatrixStatus[width, width];
9 | }
10 |
11 | private MatrixStatus[,] MatrixStatus { get; }
12 |
13 | public MatrixStatus this[int x, int y]
14 | {
15 | get => MatrixStatus[x, y];
16 | set => MatrixStatus[x, y] = value;
17 | }
18 |
19 | internal MatrixStatus this[MatrixPoint point]
20 | {
21 | get => this[point.X, point.Y];
22 | set => this[point.X, point.Y] = value;
23 | }
24 |
25 | public int Width { get; }
26 |
27 | public int Height => Width;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Versions/ErrorCorrectionBlock.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.Versions
2 | {
3 | internal struct ErrorCorrectionBlock
4 | {
5 | internal ErrorCorrectionBlock(int numErrorCorrectionBlock, int numDataCodewards)
6 | : this()
7 | {
8 | NumErrorCorrectionBlock = numErrorCorrectionBlock;
9 | NumDataCodewords = numDataCodewards;
10 | }
11 |
12 | internal int NumErrorCorrectionBlock { get; private set; }
13 |
14 | internal int NumDataCodewords { get; private set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Gma/QrCodeNet/Encoding/Versions/VersionControlStruct.cs:
--------------------------------------------------------------------------------
1 | namespace Gma.QrCodeNet.Encoding.Versions
2 | {
3 | internal struct VersionControlStruct
4 | {
5 | internal VersionDetail VersionDetail { get; set; }
6 | internal bool IsContainECI { get; set; }
7 | internal BitList ECIHeader { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Helpers/ByteArrayEqualityComparer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics.CodeAnalysis;
4 | using System.Text;
5 | using WalletWasabi.Crypto;
6 |
7 | namespace WalletWasabi.Helpers
8 | {
9 | public class ByteArrayEqualityComparer : IEqualityComparer
10 | {
11 | public bool Equals([AllowNull] byte[] x, [AllowNull] byte[] y) => ByteHelpers.CompareFastUnsafe(x, y);
12 |
13 | public int GetHashCode([DisallowNull] byte[] obj) => HashHelpers.ComputeHashCode(obj);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Helpers/HttpStatusCodeHelper.cs:
--------------------------------------------------------------------------------
1 | namespace System.Net
2 | {
3 | public static class HttpStatusCodeHelper
4 | {
5 | ///
6 | /// 1xx
7 | ///
8 | public static bool IsInformational(HttpStatusCode status)
9 | {
10 | return ((int)status).ToString()[0] == '1';
11 | }
12 |
13 | ///
14 | /// 2xx
15 | ///
16 | public static bool IsSuccessful(HttpStatusCode status)
17 | {
18 | return ((int)status).ToString()[0] == '2';
19 | }
20 |
21 | public static bool IsValidCode(int codeToValidate)
22 | {
23 | foreach (var code in Enum.GetValues(typeof(HttpStatusCode)))
24 | {
25 | if ((int)code == codeToValidate)
26 | {
27 | return true;
28 | }
29 | }
30 |
31 | return false;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Helpers/JsonHelpers.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json.Linq;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace Newtonsoft.Json
7 | {
8 | public static class JsonHelpers
9 | {
10 | public static bool TryParseJToken(string text, out JToken token)
11 | {
12 | token = null;
13 | try
14 | {
15 | token = JToken.Parse(text);
16 | return true;
17 | }
18 | catch (JsonReaderException)
19 | {
20 | return false;
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Helpers/RandomString.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using WalletWasabi.Helpers;
3 |
4 | namespace System
5 | {
6 | public static class RandomString
7 | {
8 | private static Random Random { get; } = new Random();
9 |
10 | public static string Generate(int length)
11 | {
12 | Guard.MinimumAndNotNull(nameof(length), length, 1);
13 |
14 | return new string(Enumerable.Repeat(Constants.Chars, length)
15 | .Select(s => s[Random.Next(s.Length)]).ToArray());
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Helpers/ThreadingHelpers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace System.Threading
6 | {
7 | public static class ThreadingHelpers
8 | {
9 | public static CancellationToken Cancelled
10 | {
11 | get
12 | {
13 | if (!CancelledBacking.HasValue)
14 | {
15 | using var cts = new CancellationTokenSource();
16 | cts.Cancel();
17 | CancelledBacking = cts.Token;
18 | }
19 | return CancelledBacking.Value;
20 | }
21 | }
22 |
23 | private static CancellationToken? CancelledBacking { get; set; } = null;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Http/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Http
2 | {
3 | public static class Constants
4 | {
5 | public const string SP = " ";
6 | public const string HTAB = "\t";
7 | public const string CR = "\r";
8 | public const string LF = "\n";
9 | public const string CRLF = "\r\n";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Http/Models/HttpRequestContentHeaders.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http.Headers;
2 |
3 | namespace WalletWasabi.Http.Models
4 | {
5 | public class HttpRequestContentHeaders
6 | {
7 | public HttpRequestHeaders RequestHeaders { get; set; }
8 | public HttpContentHeaders ContentHeaders { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Http/Models/HttpResponseContentHeaders.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http.Headers;
2 |
3 | namespace WalletWasabi.Http.Models
4 | {
5 | public class HttpResponseContentHeaders
6 | {
7 | public HttpResponseHeaders ResponseHeaders { get; set; }
8 | public HttpContentHeaders ContentHeaders { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Http/Models/StartLine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using WalletWasabi.Helpers;
7 | using static WalletWasabi.Http.Constants;
8 |
9 | namespace WalletWasabi.Http.Models
10 | {
11 | public abstract class StartLine
12 | {
13 | protected StartLine(HttpProtocol protocol)
14 | {
15 | Protocol = protocol;
16 | }
17 |
18 | public HttpProtocol Protocol { get; }
19 |
20 | public static string[] GetParts(string startLineString)
21 | {
22 | var trimmed = Guard.NotNullOrEmptyOrWhitespace(nameof(startLineString), startLineString, trim: true);
23 | return trimmed.Split(SP, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToArray();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Http/Models/UriScheme.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Http.Models
2 | {
3 | // https://tools.ietf.org/html/rfc7230#section-2.7.3
4 | // The scheme and host are case-insensitive and normally provided in lowercase;
5 | // all other components are compared in a case-sensitive manner.
6 | public enum UriScheme
7 | {
8 | http,
9 | https
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Hwi/Exceptions/HwiException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Hwi.Exceptions
6 | {
7 | public class HwiException : Exception
8 | {
9 | public HwiException(HwiErrorCode errorCode, string message) : base(message)
10 | {
11 | ErrorCode = errorCode;
12 | }
13 |
14 | public HwiErrorCode ErrorCode { get; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Hwi/Models/HardwareWalletModels.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Hwi.Models
6 | {
7 | ///
8 | /// Source: https://github.com/bitcoin-core/HWI/pull/228
9 | ///
10 | public enum HardwareWalletModels
11 | {
12 | Unknown,
13 | Coldcard,
14 | Coldcard_Simulator,
15 | DigitalBitBox_01,
16 | DigitalBitBox_01_Simulator,
17 | KeepKey,
18 | KeepKey_Simulator,
19 | Ledger_Nano_S,
20 | Trezor_1,
21 | Trezor_1_Simulator,
22 | Trezor_T,
23 | Trezor_T_Simulator
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Hwi/Models/HwiOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Hwi.Models
6 | {
7 | public enum HwiOptions
8 | {
9 | Help,
10 | DevicePath,
11 | DeviceType,
12 | Password,
13 | StdInPass,
14 | TestNet,
15 | Debug,
16 | Fingerprint,
17 | Version,
18 | StdIn,
19 | Interactive
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Interfaces/IByteArraySerializable.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Interfaces
2 | {
3 | public interface IByteArraySerializable
4 | {
5 | byte[] ToBytes();
6 |
7 | void FromBytes(params byte[] bytes);
8 |
9 | string ToHex(bool xhhSyntax);
10 |
11 | void FromHex(string hex);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Interfaces/IByteSerializable.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Interfaces
2 | {
3 | public interface IByteSerializable
4 | {
5 | byte ToByte();
6 |
7 | void FromByte(byte b);
8 |
9 | string ToHex(bool xhhSyntax);
10 |
11 | void FromHex(string hex);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Interfaces/IExchangeRateProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using WalletWasabi.Backend.Models;
4 |
5 | namespace WalletWasabi.Interfaces
6 | {
7 | public interface IExchangeRateProvider
8 | {
9 | Task> GetExchangeRateAsync();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Io/MutexIoManager.cs:
--------------------------------------------------------------------------------
1 | using Nito.AsyncEx;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Text;
6 | using WalletWasabi.Crypto;
7 |
8 | namespace WalletWasabi.Io
9 | {
10 | public class MutexIoManager : IoManager
11 | {
12 | public MutexIoManager(string filePath) : base(filePath)
13 | {
14 | Mutex = new AsyncLock();
15 | }
16 |
17 | public AsyncLock Mutex { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/JsonConverters/PubKeyJsonConverter.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 | using Newtonsoft.Json;
3 | using System;
4 |
5 | namespace WalletWasabi.JsonConverters
6 | {
7 | public class PubKeyJsonConverter : JsonConverter
8 | {
9 | ///
10 | public override bool CanConvert(Type objectType)
11 | {
12 | return objectType == typeof(PubKey);
13 | }
14 |
15 | ///
16 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
17 | {
18 | return new PubKey(((string)reader.Value).Trim());
19 | }
20 |
21 | ///
22 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
23 | {
24 | var pubKey = (PubKey)value;
25 | writer.WriteValue(pubKey.ToHex());
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Logging/LogMode.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Logging
2 | {
3 | public enum LogMode
4 | {
5 | /// It uses Console.Write.
6 | Console,
7 |
8 | /// It uses Debug.Write.
9 | Debug,
10 |
11 | /// Logs into Log.txt, if filename is not specified.
12 | File
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/README.md:
--------------------------------------------------------------------------------
1 | # Updating Executables
2 |
3 | 1. Replace executables.
4 | 2. Properties/Copy to Output: Copy if newer. (VSBUG: Sometimes Copy Always is needed. It's generally ok to do copy always then set it back to Copy if newer, so already running Bitcoin Core will not be tried to get recopied all the time.)
5 | 3. Make sure the Linux and the OSX binaries are executable:
6 | `git update-index --chmod=+x hwi`
7 | `git update-index --chmod=+x bitcoind`
8 | 4. Commit, push.
9 | 5. Make sure CI passes.
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/lin64/bitcoind:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/lin64/bitcoind
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/lin64/hwi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/lin64/hwi
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/osx64/bitcoind:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/osx64/bitcoind
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/osx64/hwi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/osx64/hwi
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/win64/bitcoind.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/win64/bitcoind.exe
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/win64/hwi.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/Microservices/Binaries/win64/hwi.exe
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Microservices/IProcessBridge.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace WalletWasabi.Microservices
10 | {
11 | public interface IProcessBridge
12 | {
13 | Task<(string response, int exitCode)> SendCommandAsync(string arguments, bool openConsole, CancellationToken cancel, Action standardInputWriter = null);
14 |
15 | Process Start(string arguments, bool openConsole, bool redirectStandardInput);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/BackendStatus.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Models
2 | {
3 | public enum BackendStatus
4 | {
5 | NotConnected,
6 | Connected
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/ErrorDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WalletWasabi.Models
4 | {
5 | public struct ErrorDescriptor : IEquatable
6 | {
7 | public static ErrorDescriptor Default = new ErrorDescriptor(ErrorSeverity.Default, "");
8 |
9 | public ErrorDescriptor(ErrorSeverity severity, string message)
10 | {
11 | Severity = severity;
12 | Message = message;
13 | }
14 |
15 | public ErrorSeverity Severity { get; }
16 | public string Message { get; }
17 |
18 | public bool Equals(ErrorDescriptor other)
19 | {
20 | return (Severity == other.Severity && Message == other.Message);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/ErrorDescriptors.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace WalletWasabi.Models
4 | {
5 | public class ErrorDescriptors : List, IValidationErrors
6 | {
7 | public static ErrorDescriptors Empty = Create();
8 |
9 | private ErrorDescriptors() : base()
10 | {
11 | }
12 |
13 | public static ErrorDescriptors Create()
14 | {
15 | return new ErrorDescriptors();
16 | }
17 |
18 | void IValidationErrors.Add(ErrorSeverity severity, string error)
19 | {
20 | Add(new ErrorDescriptor(severity, error));
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/ErrorSeverity.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Models
2 | {
3 | public enum ErrorSeverity
4 | {
5 | Default,
6 | Info,
7 | Warning,
8 | Error
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/HeightType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Models
6 | {
7 | public enum HeightType
8 | {
9 | Chain,
10 | Mempool,
11 | Unknown
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/IValidationErrors.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Models
2 | {
3 | public interface IValidationErrors
4 | {
5 | void Add(ErrorSeverity severity, string error);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/MixUntilAnonymitySet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Models
6 | {
7 | public enum MixUntilAnonymitySet
8 | {
9 | PrivacyLevelSome,
10 | PrivacyLevelFine,
11 | PrivacyLevelStrong
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Models/TorStatus.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Models
2 | {
3 | public enum TorStatus
4 | {
5 | NotRunning,
6 | TurnedOff,
7 | Running
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Nito/AsyncEx/TaskCompletionSourceExtensions.cs:
--------------------------------------------------------------------------------
1 | using Nito.AsyncEx.Synchronous;
2 | using System;
3 | using System.Threading.Tasks;
4 |
5 | namespace Nito.AsyncEx
6 | {
7 | ///
8 | /// Provides extension methods for .
9 | ///
10 | public static class TaskCompletionSourceExtensions
11 | {
12 | ///
13 | /// Creates a new TCS for use with async code, and which forces its continuations to execute asynchronously.
14 | ///
15 | /// The type of the result of the TCS.
16 | public static TaskCompletionSource CreateAsyncTaskSource()
17 | {
18 | return new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/OnionSeeds/TestNetOnionSeeds.txt:
--------------------------------------------------------------------------------
1 | thfsmmn2jbitcoin.onion:18333
2 | it2pj4f7657g3rhi.onion:18333
3 | nkf5e6b7pl4jfd4a.onion:18333
4 | 4zhkir2ofl7orfom.onion:18333
5 | t6xj6wilh4ytvcs7.onion:18333
6 | i6y6ivorwakd7nw3.onion:18333
7 | ubqj4rsu3nqtxmtp.onion:18333
8 | ocasutxnvl4lwegq.onion:18333
9 | cu6octp6yo754wda.onion:18333
10 | lkiggf5esgs7d5z6.onion:18333
11 | rhcv7q2quqn74zlr.onion:18333
12 | nq7cak6pufzs2ou2.onion:18333
13 | nec4kn4ghql7p7an.onion:18333
14 | qlllezfaif5cscnx.onion:18333
15 | zmtr2di735ngxpcl.onion:18333
16 | 4syvownyxejvqbzn.onion:18333
17 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Services/HostedService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Hosting;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using WalletWasabi.Helpers;
7 |
8 | namespace WalletWasabi.Services
9 | {
10 | public class HostedService
11 | {
12 | public HostedService(IHostedService service, string friendlyName)
13 | {
14 | Service = Guard.NotNull(nameof(service), service);
15 | FriendlyName = Guard.NotNull(nameof(friendlyName), friendlyName);
16 | }
17 |
18 | public IHostedService Service { get; }
19 | public string FriendlyName { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Stores/BitcoinStoreMock.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.Stores
2 | {
3 | ///
4 | /// This class provides a Mock version of for
5 | /// Unit tests that only need a dummy version of the class.
6 | ///
7 | public class BitcoinStoreMock : BitcoinStore
8 | {
9 | public BitcoinStoreMock() : base()
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorDaemons/data-folder.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/TorDaemons/data-folder.zip
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorDaemons/digests.txt:
--------------------------------------------------------------------------------
1 | af7302d62fc1e47f79af8860541365f77547233404302a1e601e1f367e6e2888
2 | fe6d719e18bf3a963f0274de259b7e029f40e4fe778f4d170bba343eb491af00
3 | d244a89f7ca9da2259925affa0bd008d3cdea1d9dfd24cf53efffb7c1eadc169
4 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorDaemons/tor-linux64.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/TorDaemons/tor-linux64.zip
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorDaemons/tor-osx64.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/TorDaemons/tor-osx64.zip
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorDaemons/tor-win64.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chaincase-app/Chaincase-iOS-Beta/79ef485d0e48557ef4bc965ee61d56e5a14e52c1/WalletWasabi.SDK/WalletWasabi/TorDaemons/tor-win64.zip
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorSocks5/ITorHttpClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Net.Http;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 |
7 | namespace WalletWasabi.TorSocks5
8 | {
9 | public interface ITorHttpClient : IDisposable
10 | {
11 | Uri DestinationUri { get; }
12 | Func DestinationUriAction { get; }
13 | EndPoint TorSocks5EndPoint { get; }
14 |
15 | bool IsTorUsed { get; }
16 |
17 | Task SendAsync(HttpMethod method, string relativeUri, HttpContent content = null, CancellationToken cancel = default);
18 |
19 | Task SendAsync(HttpRequestMessage request, CancellationToken cancel = default);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorSocks5/Models/Fields/OctetFields/AuthVerField.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Bases;
2 | using WalletWasabi.Helpers;
3 |
4 | namespace WalletWasabi.TorSocks5.Models.Fields.OctetFields
5 | {
6 | public class AuthVerField : OctetSerializableBase
7 | {
8 | #region Constructors
9 |
10 | public AuthVerField()
11 | {
12 | }
13 |
14 | public AuthVerField(int value)
15 | {
16 | ByteValue = (byte)Guard.InRangeAndNotNull(nameof(value), value, 0, 255);
17 | }
18 |
19 | #endregion Constructors
20 |
21 | #region Statics
22 |
23 | public static AuthVerField Version1 => new AuthVerField(1);
24 |
25 | #endregion Statics
26 |
27 | #region PropertiesAndMembers
28 |
29 | public int Value => ByteValue;
30 |
31 | #endregion PropertiesAndMembers
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorSocks5/Models/Fields/OctetFields/RsvField.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Bases;
2 |
3 | namespace WalletWasabi.TorSocks5.TorSocks5.Models.Fields.ByteArrayFields
4 | {
5 | public class RsvField : OctetSerializableBase
6 | {
7 | #region Constructors
8 |
9 | public RsvField()
10 | {
11 | }
12 |
13 | #endregion Constructors
14 |
15 | #region Statics
16 |
17 | public static RsvField X00
18 | {
19 | get
20 | {
21 | var rsv = new RsvField();
22 | rsv.FromHex("00");
23 | return rsv;
24 | }
25 | }
26 |
27 | #endregion Statics
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorSocks5/Models/Fields/OctetFields/VerField.cs:
--------------------------------------------------------------------------------
1 | using WalletWasabi.Bases;
2 | using WalletWasabi.Helpers;
3 |
4 | namespace WalletWasabi.TorSocks5.Models.Fields.OctetFields
5 | {
6 | public class VerField : OctetSerializableBase
7 | {
8 | #region Constructors
9 |
10 | public VerField()
11 | {
12 | }
13 |
14 | public VerField(int value)
15 | {
16 | ByteValue = (byte)Guard.InRangeAndNotNull(nameof(value), value, 0, 255);
17 | }
18 |
19 | #endregion Constructors
20 |
21 | #region Statics
22 |
23 | public static VerField Socks5 => new VerField(5);
24 |
25 | #endregion Statics
26 |
27 | #region PropertiesAndMembers
28 |
29 | public int Value => ByteValue;
30 |
31 | #endregion PropertiesAndMembers
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/TorSocks5/Models/ReplyType.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.TorSocks5.Models
2 | {
3 | public enum ReplyType : byte
4 | {
5 | Succeeded = 0x00,
6 | GeneralSocksServerFailure = 0x01,
7 | ConnectionNotAllowedByRuleset = 0x02,
8 | NetworkUnreachable = 0x03,
9 | HostUnreachable = 0x04,
10 | ConnectionRefused = 0x05,
11 | TtlExpired = 0x06,
12 | CommandNotSupported = 0x07,
13 | AddressTypeNotSupported = 0x08
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Wallets/IBlockProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using NBitcoin;
4 |
5 | namespace WalletWasabi.Wallets
6 | {
7 | ///
8 | /// IBlockProvider is an abstraction for types that can return blocks.
9 | ///
10 | public interface IBlockProvider
11 | {
12 | Task GetBlockAsync(uint256 hash, CancellationToken cancel);
13 | }
14 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Wallets/IRepository.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace WalletWasabi.Wallets
5 | {
6 | ///
7 | /// IRepository is a generic abstraction of a repository pattern
8 | ///
9 | public interface IRepository
10 | {
11 | Task GetAsync(TID id, CancellationToken cancel);
12 | Task SaveAsync(TElement element, CancellationToken cancel);
13 | Task RemoveAsync(TID id, CancellationToken cancel);
14 | Task CountAsync(CancellationToken cancel);
15 | }
16 | }
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/Wallets/WalletState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace WalletWasabi.Wallets
6 | {
7 | public enum WalletState
8 | {
9 | Uninitialized,
10 | WaitingForInit,
11 | Initialized,
12 | Starting,
13 | Started,
14 | Stopping,
15 | Stopped
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/WebClients/PayJoin/IPayjoinClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 | using NBitcoin;
5 | using WalletWasabi.Blockchain.Keys;
6 |
7 | namespace WalletWasabi.WebClients.PayJoin
8 | {
9 | public interface IPayjoinClient
10 | {
11 | Uri PaymentUrl { get; }
12 |
13 | Task RequestPayjoin(PSBT originalTx, IHDKey accountKey, RootedKeyPath rootedKeyPath, HdPubKey changeHdPubKey, CancellationToken cancellationToken);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/WebClients/PayJoin/PayjoinClientParameters.cs:
--------------------------------------------------------------------------------
1 | using NBitcoin;
2 |
3 | namespace WalletWasabi.WebClients.PayJoin
4 | {
5 | public class PayjoinClientParameters
6 | {
7 | public Money MaxAdditionalFeeContribution { get; set; }
8 | public FeeRate MinFeeRate { get; set; }
9 | public int? AdditionalFeeOutputIndex { get; set; }
10 | public bool DisableOutputSubstitution { get; set; }
11 | public int Version { get; set; } = 1;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/WebClients/PayJoin/PayjoinException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace WalletWasabi.WebClients.PayJoin
4 | {
5 | public class PayjoinException : Exception
6 | {
7 | public PayjoinException(string message) : base(message)
8 | {
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/WebClients/PayJoin/PayjoinReceiverException.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.WebClients.PayJoin
2 | {
3 | public class PayjoinReceiverException : PayjoinException
4 | {
5 | public PayjoinReceiverException(int httpCode, string errorCode, string message)
6 | : base(message)
7 | {
8 | HttpCode = httpCode;
9 | ErrorCode = errorCode;
10 | ErrorMessage = message;
11 | }
12 |
13 | public int HttpCode { get; }
14 | public string ErrorCode { get; }
15 | public string ErrorMessage { get; }
16 |
17 | private static string FormatMessage(in int httpCode, string errorCode, string message)
18 | {
19 | return $"{errorCode}: {message} (HTTP: {httpCode})";
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/WebClients/PayJoin/PayjoinSenderException.cs:
--------------------------------------------------------------------------------
1 | namespace WalletWasabi.WebClients.PayJoin
2 | {
3 | public class PayjoinSenderException : PayjoinException
4 | {
5 | public PayjoinSenderException(string message) : base(message)
6 | {
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WalletWasabi.SDK/WalletWasabi/WebClients/SmartBit/Models/SmartBitExchangeRate.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace WalletWasabi.WebClients.SmartBit.Models
4 | {
5 | [JsonObject(MemberSerialization.OptIn)]
6 | public class SmartBitExchangeRate
7 | {
8 | [JsonProperty(PropertyName = "code")]
9 | public string Code { get; set; }
10 |
11 | [JsonProperty(PropertyName = "name")]
12 | public string Name { get; set; }
13 |
14 | [JsonProperty(PropertyName = "rate")]
15 | public decimal Rate { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------