edge-core-js 2.34.0 → 2.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.34.1 (2025-09-19)
6
+
7
+ - fixed: Avoid deprecated Gradle syntax.
8
+ - changed: Support 16KiB alignment on Android.
9
+
5
10
  ## 2.34.0 (2025-08-25)
6
11
 
7
12
  - added: `SwapAddressError` type with `reason` flags
@@ -5,7 +5,7 @@ buildscript {
5
5
  }
6
6
 
7
7
  dependencies {
8
- classpath 'com.android.tools.build:gradle:3.6.0'
8
+ classpath 'com.android.tools.build:gradle:7.3.1'
9
9
  }
10
10
  }
11
11
 
@@ -15,25 +15,19 @@ def safeExtGet(prop, fallback) {
15
15
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
16
16
  }
17
17
 
18
- def DEFAULT_COMPILE_SDK_VERSION = 28
19
- def DEFAULT_BUILD_TOOLS_VERSION = '28.0.2'
20
- def DEFAULT_MIN_SDK_VERSION = 19
21
- def DEFAULT_TARGET_SDK_VERSION = 27
22
- def DEFAULT_WEBKIT_VERSION = '1.4.0'
23
-
24
18
  android {
25
- namespace "app.edge.reactnative.core"
26
- compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
27
- buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
19
+ namespace = "app.edge.reactnative.core"
20
+ compileSdk = safeExtGet('compileSdkVersion', 31)
21
+ ndkVersion = safeExtGet('ndkVersion', '28.0.2')
28
22
 
29
23
  defaultConfig {
30
- minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
31
- targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
32
- versionCode 1
33
- versionName '1.0'
24
+ minSdk = safeExtGet('minSdkVersion', 19)
25
+ targetSdk = safeExtGet('targetSdkVersion', 34)
26
+ versionCode = 1
27
+ versionName = '1.0'
34
28
  }
35
29
  lintOptions {
36
- abortOnError false
30
+ abortOnError = false
37
31
  }
38
32
  externalNativeBuild {
39
33
  cmake {
@@ -45,7 +39,7 @@ android {
45
39
  repositories {
46
40
  }
47
41
 
48
- def webkit_version = safeExtGet('webkitVersion', DEFAULT_WEBKIT_VERSION)
42
+ def webkit_version = safeExtGet('webkitVersion', '1.4.0')
49
43
 
50
44
  dependencies {
51
45
  implementation "androidx.webkit:webkit:$webkit_version"
@@ -12,3 +12,6 @@ add_library(
12
12
  scrypt/crypto_scrypt.c
13
13
  scrypt/sha256.c
14
14
  )
15
+
16
+ # 16KiB page alignment:
17
+ target_link_options(edge-core-jni PRIVATE "-Wl,-z,max-page-size=16384")
@@ -0,0 +1,35 @@
1
+ // @flow
2
+
3
+ import { Buffer } from "buffer";
4
+ import http from "http";
5
+ import { createProxyServer } from "http-proxy";
6
+
7
+ const proxy = createProxyServer({});
8
+
9
+ // Rust WebDAV server running on port 3000
10
+ const WEBDAV_TARGET = "http://localhost:3000";
11
+ const OTHER_TARGET = "http://localhost:4000";
12
+
13
+ const AUTH_USER = "william";
14
+ const AUTH_PASS = "hunter2";
15
+
16
+ const mainServer = http.createServer((req, res) => {
17
+ if (isAuthorized(req)) {
18
+ proxy.web(req, res, { target: WEBDAV_TARGET });
19
+ } else {
20
+ proxy.web(req, res, { target: OTHER_TARGET });
21
+ }
22
+ });
23
+
24
+ mainServer.listen(8080, () => {
25
+ console.log("Node proxy running on port 8080");
26
+ });
27
+
28
+ function isAuthorized(req) {
29
+ const authHeader = req.headers.authorization;
30
+ if (!authHeader || !authHeader.startsWith("Basic ")) return false;
31
+
32
+ const encoded = authHeader.slice(6);
33
+ const decoded = Buffer.from(encoded, "base64").toString("utf8");
34
+ return decoded === `${AUTH_USER}:${AUTH_PASS}`;
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-core-js",
3
- "version": "2.34.0",
3
+ "version": "2.34.1",
4
4
  "description": "Edge account & wallet management library",
5
5
  "keywords": [
6
6
  "bitcoin",
@@ -0,0 +1,33 @@
1
+ import { Buffer } from 'buffer'
2
+ import http from 'http'
3
+ import { createProxyServer } from 'http-proxy'
4
+
5
+ const proxy = createProxyServer({})
6
+
7
+ // Rust WebDAV server running on port 3000
8
+ const WEBDAV_TARGET = 'http://localhost:3000'
9
+ const OTHER_TARGET = 'http://localhost:4000'
10
+
11
+ const AUTH_USER = 'william'
12
+ const AUTH_PASS = 'hunter2'
13
+
14
+ const mainServer = http.createServer((req, res) => {
15
+ if (isAuthorized(req)) {
16
+ proxy.web(req, res, { target: WEBDAV_TARGET })
17
+ } else {
18
+ proxy.web(req, res, { target: OTHER_TARGET })
19
+ }
20
+ })
21
+
22
+ mainServer.listen(8080, () => {
23
+ console.log('Node proxy running on port 8080')
24
+ })
25
+
26
+ function isAuthorized(req) {
27
+ const authHeader = req.headers.authorization
28
+ if (!authHeader || !authHeader.startsWith('Basic ')) return false
29
+
30
+ const encoded = authHeader.slice(6)
31
+ const decoded = Buffer.from(encoded, 'base64').toString('utf8')
32
+ return decoded === `${AUTH_USER}:${AUTH_PASS}`
33
+ }