space-data-module-sdk 0.9.15 → 0.9.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "space-data-module-sdk",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Module SDK for building, validating, signing, and deploying WebAssembly modules on the Space Data Network.",
6
6
  "type": "module",
@@ -129,7 +129,7 @@
129
129
  "flatbuffers": "^25.9.23",
130
130
  "flatc-wasm": "^26.1.32",
131
131
  "flatsql": "^2.0.0",
132
- "hd-wallet-wasm": "2.1.0",
132
+ "hd-wallet-wasm": "2.2.2",
133
133
  "sdn-emception": "1.0.0",
134
134
  "spacedatastandards.org": "1.261.0"
135
135
  },
@@ -13,6 +13,7 @@ import {
13
13
  toUint8Array,
14
14
  } from "../utils/encoding.js";
15
15
  import { derSignatureToRaw, rawSignatureToDer } from "../utils/ecdsaDer.js";
16
+ import { SECP256K1_CURVE } from "../utils/walletCurves.js";
16
17
  import {
17
18
  parseCronExpression,
18
19
  matchesCronExpression,
@@ -913,7 +914,7 @@ export class BrowserHost {
913
914
  );
914
915
  }
915
916
  return new Uint8Array(
916
- wasmWallet.curves.publicKeyFromPrivate(toUint8Array(privateKey)),
917
+ wasmWallet.curves.publicKeyFromPrivate(toUint8Array(privateKey), SECP256K1_CURVE),
917
918
  );
918
919
  },
919
920
  sign: (message, privateKey) => {
@@ -0,0 +1,7 @@
1
+ // hd-wallet-wasm names a curve by the number its C ABI takes (its `Curve` export). The SDK uses one
2
+ // of them, secp256k1, and says so on every call: hd-wallet-wasm 2.1.2 and later refuse a call that
3
+ // leaves the curve out (`curves.publicKeyFromPrivate(privateKey)` used to default to secp256k1);
4
+ // naming it works on every release the SDK has pinned.
5
+
6
+ /** hd-wallet-wasm `Curve.SECP256K1`. */
7
+ export const SECP256K1_CURVE = 0;
@@ -1,4 +1,5 @@
1
1
  import { toUint8Array } from "./encoding.js";
2
+ import { SECP256K1_CURVE } from "./walletCurves.js";
2
3
 
3
4
  let walletPromise = null;
4
5
 
@@ -54,7 +55,7 @@ export async function x25519SharedSecret(privateKey, publicKey) {
54
55
 
55
56
  export async function secp256k1PublicKey(privateKey) {
56
57
  const wallet = await getWasmWallet();
57
- return wallet.curves.publicKeyFromPrivate(toUint8Array(privateKey));
58
+ return wallet.curves.publicKeyFromPrivate(toUint8Array(privateKey), SECP256K1_CURVE);
58
59
  }
59
60
 
60
61
  // secp256k1 ECDSA. The wallet's sign / verify hash their input with sha256 (a message API); signRecoverable and