@openfort/openfort-node 0.10.0 → 0.10.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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#84](https://github.com/openfort-xyz/openfort-node/pull/84) [`481d81b`](https://github.com/openfort-xyz/openfort-node/commit/481d81b9691bc2be2cfab0ceda7af7a6a4713077) Thanks [@jamalavedra](https://github.com/jamalavedra)! - fix import solana
8
+
3
9
  ## 0.10.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -467,7 +467,7 @@ __export(index_exports, {
467
467
  verifyOAuthToken: () => verifyOAuthToken
468
468
  });
469
469
  module.exports = __toCommonJS(index_exports);
470
- var import_node_crypto4 = require("crypto");
470
+ var import_node_crypto5 = require("crypto");
471
471
  var import_shield_js = require("@openfort/shield-js");
472
472
  var import_node_fetch = __toESM(require("node-fetch"));
473
473
 
@@ -842,7 +842,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
842
842
  }
843
843
 
844
844
  // src/version.ts
845
- var VERSION = "0.10.0";
845
+ var VERSION = "0.10.1";
846
846
  var PACKAGE = "@openfort/openfort-node";
847
847
 
848
848
  // src/openapi-client/openfortApiClient.ts
@@ -4572,6 +4572,7 @@ var EvmClient = class {
4572
4572
  EvmClient.type = "evmWallet";
4573
4573
 
4574
4574
  // src/wallets/solana/solanaClient.ts
4575
+ var import_node_crypto4 = require("crypto");
4575
4576
  var import_bs58 = __toESM(require("bs58"));
4576
4577
 
4577
4578
  // src/wallets/solana/actions/constants.ts
@@ -5114,9 +5115,24 @@ var SolanaClient = class {
5114
5115
  );
5115
5116
  }
5116
5117
  }
5117
- if (privateKeyBytes.length === 64) {
5118
- privateKeyBytes = privateKeyBytes.slice(0, 32);
5119
- } else if (privateKeyBytes.length !== 32) {
5118
+ if (privateKeyBytes.length === 32) {
5119
+ const edPrivKey = (0, import_node_crypto4.createPrivateKey)({
5120
+ key: Buffer.concat([
5121
+ Buffer.from(
5122
+ // PKCS#8 DER prefix for Ed25519 (RFC 8410): 16 bytes wrapping a 32-byte seed
5123
+ "302e020100300506032b657004220420",
5124
+ "hex"
5125
+ ),
5126
+ privateKeyBytes
5127
+ ]),
5128
+ format: "der",
5129
+ type: "pkcs8"
5130
+ });
5131
+ const rawPublicKey = (0, import_node_crypto4.createPublicKey)(edPrivKey).export({ type: "spki", format: "der" }).subarray(-32);
5132
+ privateKeyBytes = new Uint8Array(
5133
+ Buffer.concat([privateKeyBytes, rawPublicKey])
5134
+ );
5135
+ } else if (privateKeyBytes.length !== 64) {
5120
5136
  throw new UserInputValidationError(
5121
5137
  "Private key must be 32 bytes (seed) or 64 bytes (full keypair)"
5122
5138
  );
@@ -6207,7 +6223,7 @@ var Openfort = class {
6207
6223
  const signedPayload = await sign2(this._apiKey, body);
6208
6224
  const expectedBuffer = Buffer.from(signedPayload, "hex");
6209
6225
  const receivedBuffer = Buffer.from(signature2, "hex");
6210
- if (expectedBuffer.length !== receivedBuffer.length || !(0, import_node_crypto4.timingSafeEqual)(expectedBuffer, receivedBuffer)) {
6226
+ if (expectedBuffer.length !== receivedBuffer.length || !(0, import_node_crypto5.timingSafeEqual)(expectedBuffer, receivedBuffer)) {
6211
6227
  throw new Error("Invalid signature");
6212
6228
  }
6213
6229
  try {