Compare commits

...

1 Commits

Author SHA1 Message Date
Mark Sinclair acac53d3bf Rename vpn-api-lib-wasm to nym-credential-proxy-lib-wasm, and:
- change from yarn to npm
- fix license so Apache-2.0 (like the rest of the SDK)
2024-10-30 12:39:20 +00:00
14 changed files with 3859 additions and 2296 deletions
Generated
+25 -25
View File
@@ -5241,6 +5241,31 @@ dependencies = [
"zeroize",
]
[[package]]
name = "nym-credential-proxy-lib-wasm"
version = "0.1.0"
dependencies = [
"bs58",
"getrandom",
"js-sys",
"nym-bin-common 0.6.0",
"nym-compact-ecash 0.1.0",
"nym-credential-proxy-requests",
"nym-credentials",
"nym-credentials-interface 0.1.0",
"nym-crypto 0.4.0",
"nym-ecash-time 0.1.0",
"serde",
"serde-wasm-bindgen 0.6.5",
"serde_json",
"thiserror",
"time",
"tsify",
"wasm-bindgen",
"wasm-utils",
"zeroize",
]
[[package]]
name = "nym-credential-proxy-requests"
version = "0.1.0"
@@ -7165,31 +7190,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "nym-vpn-api-lib-wasm"
version = "0.1.0"
dependencies = [
"bs58",
"getrandom",
"js-sys",
"nym-bin-common 0.6.0",
"nym-compact-ecash 0.1.0",
"nym-credential-proxy-requests",
"nym-credentials",
"nym-credentials-interface 0.1.0",
"nym-crypto 0.4.0",
"nym-ecash-time 0.1.0",
"serde",
"serde-wasm-bindgen 0.6.5",
"serde_json",
"thiserror",
"time",
"tsify",
"wasm-bindgen",
"wasm-utils",
"zeroize",
]
[[package]]
name = "nym-wallet-types"
version = "1.0.0"
+1 -1
View File
@@ -118,7 +118,7 @@ members = [
"nym-browser-extension/storage",
"nym-credential-proxy/nym-credential-proxy",
"nym-credential-proxy/nym-credential-proxy-requests",
"nym-credential-proxy/vpn-api-lib-wasm",
"nym-credential-proxy/nym-credential-proxy-lib-wasm",
"nym-data-observatory",
"nym-network-monitor",
"nym-node",
@@ -1,5 +1,5 @@
[package]
name = "nym-vpn-api-lib-wasm"
name = "nym-credential-proxy-lib-wasm"
version = "0.1.0"
authors.workspace = true
repository.workspace = true
@@ -0,0 +1,4 @@
build:
wasm-pack build --scope nymproject --target web --out-dir ../../dist/wasm/nym-credential-proxy-lib-wasm
wasm-opt -Oz -o ../../dist/wasm/nym-credential-proxy-lib-wasm/nym_credential_proxy_lib_wasm_bg.wasm ../../dist/wasm/nym-credential-proxy-lib-wasm/nym_credential_proxy_lib_wasm_bg.wasm
@@ -1,4 +1,7 @@
import init, { NymIssuanceTicketbook } from "@nymproject/nym-vpn-api-lib-wasm";
import init, { NymIssuanceTicketbook } from "@nymproject/nym-credential-proxy-lib-wasm";
const NYM_CREDENTIAL_PROXY_API = "http://localhost:8080";
const API_TOKEN = "foomp";
async function main() {
await init();
@@ -6,15 +9,15 @@ async function main() {
let cryptoData = new NymIssuanceTicketbook({});
console.log("getting partial vks");
const partialVksRes = await fetch("http://localhost:8080/api/v1/ticketbook/partial-verification-keys", {
headers: new Headers({ "Authorization": "Bearer foomp" })
const partialVksRes = await fetch(`${NYM_CREDENTIAL_PROXY_API}/api/v1/ticketbook/partial-verification-keys`, {
headers: new Headers({ "Authorization": `Bearer ${API_TOKEN}` })
});
const partialVks = await partialVksRes.json();
console.debug(partialVks);
console.log("getting master vk");
const masterVkRes = await fetch("http://localhost:8080/api/v1/ticketbook/master-verification-key", {
headers: new Headers({ "Authorization": "Bearer foomp" })
const masterVkRes = await fetch(`${NYM_CREDENTIAL_PROXY_API}/api/v1/ticketbook/master-verification-key`, {
headers: new Headers({ "Authorization": `Bearer ${API_TOKEN}` })
});
const masterVk = await masterVkRes.json();
console.debug(masterVk);
@@ -24,11 +27,11 @@ async function main() {
console.log("getting blinded wallet shares");
const sharesRes = await fetch("http://localhost:8080/api/v1/ticketbook/obtain?include-coin-index-signatures=true&include-expiration-date-signatures=true", {
const sharesRes = await fetch(`${NYM_CREDENTIAL_PROXY_API}/api/v1/ticketbook/obtain?include-coin-index-signatures=true&include-expiration-date-signatures=true`, {
method: "POST",
headers: new Headers(
{
"Authorization": "Bearer foomp",
"Authorization": `Bearer ${API_TOKEN}`,
"Content-Type": "application/json"
}
),
File diff suppressed because it is too large Load Diff
@@ -21,7 +21,7 @@
"rust",
"webpack"
],
"author": "Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
"author": "Nym Technologies SA <contact@nymtech.net>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/nymtech/nym/issues"
@@ -35,6 +35,6 @@
"webpack-dev-server": "^4.7.4"
},
"dependencies": {
"@nymproject/nym-vpn-api-lib-wasm": "file:../../../dist/wasm/nym-vpn-api-lib-wasm"
"@nymproject/nym-credential-proxy-lib-wasm": "file:../../../dist/wasm/nym-credential-proxy-lib-wasm"
}
}
@@ -22,7 +22,7 @@ module.exports = {
patterns: [
"index.html",
{
from: "../../../dist/wasm/nym-vpn-api-lib-wasm/*.(js|wasm)",
from: "../../../dist/wasm/nym-credential-proxy-lib-wasm/*.(js|wasm)",
to: "[name][ext]"
}
]
@@ -1,5 +1,5 @@
// Copyright 2024 Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
// SPDX-License-Identifier: Apache-2.0
use serde_wasm_bindgen::Error;
use thiserror::Error;
@@ -1,5 +1,5 @@
// Copyright 2024 Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
// SPDX-License-Identifier: Apache-2.0
use crate::error::VpnApiLibError;
use nym_compact_ecash::scheme::keygen::KeyPairUser;
@@ -1,4 +0,0 @@
build:
wasm-pack build --scope nymproject --target web --out-dir ../../dist/wasm/nym-vpn-api-lib-wasm
wasm-opt -Oz -o ../../dist/wasm/nym-vpn-api-lib-wasm/nym_vpn_api_lib_wasm_bg.wasm ../../dist/wasm/nym-vpn-api-lib-wasm/nym_vpn_api_lib_wasm_bg.wasm
File diff suppressed because it is too large Load Diff