@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 +6 -0
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/examples/solana/accounts/importAccount.ts +14 -8
- package/examples/solana/signing/signTransaction.ts +42 -21
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -384,7 +384,7 @@ function requiresWalletAuth(requestMethod, requestPath) {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// src/version.ts
|
|
387
|
-
var VERSION = "0.10.
|
|
387
|
+
var VERSION = "0.10.1";
|
|
388
388
|
var PACKAGE = "@openfort/openfort-node";
|
|
389
389
|
|
|
390
390
|
// src/openapi-client/openfortApiClient.ts
|
|
@@ -4119,6 +4119,7 @@ var EvmClient = class {
|
|
|
4119
4119
|
EvmClient.type = "evmWallet";
|
|
4120
4120
|
|
|
4121
4121
|
// src/wallets/solana/solanaClient.ts
|
|
4122
|
+
import { createPrivateKey, createPublicKey } from "crypto";
|
|
4122
4123
|
import bs58 from "bs58";
|
|
4123
4124
|
|
|
4124
4125
|
// src/wallets/solana/actions/constants.ts
|
|
@@ -4661,9 +4662,24 @@ var SolanaClient = class {
|
|
|
4661
4662
|
);
|
|
4662
4663
|
}
|
|
4663
4664
|
}
|
|
4664
|
-
if (privateKeyBytes.length ===
|
|
4665
|
-
|
|
4666
|
-
|
|
4665
|
+
if (privateKeyBytes.length === 32) {
|
|
4666
|
+
const edPrivKey = createPrivateKey({
|
|
4667
|
+
key: Buffer.concat([
|
|
4668
|
+
Buffer.from(
|
|
4669
|
+
// PKCS#8 DER prefix for Ed25519 (RFC 8410): 16 bytes wrapping a 32-byte seed
|
|
4670
|
+
"302e020100300506032b657004220420",
|
|
4671
|
+
"hex"
|
|
4672
|
+
),
|
|
4673
|
+
privateKeyBytes
|
|
4674
|
+
]),
|
|
4675
|
+
format: "der",
|
|
4676
|
+
type: "pkcs8"
|
|
4677
|
+
});
|
|
4678
|
+
const rawPublicKey = createPublicKey(edPrivKey).export({ type: "spki", format: "der" }).subarray(-32);
|
|
4679
|
+
privateKeyBytes = new Uint8Array(
|
|
4680
|
+
Buffer.concat([privateKeyBytes, rawPublicKey])
|
|
4681
|
+
);
|
|
4682
|
+
} else if (privateKeyBytes.length !== 64) {
|
|
4667
4683
|
throw new UserInputValidationError(
|
|
4668
4684
|
"Private key must be 32 bytes (seed) or 64 bytes (full keypair)"
|
|
4669
4685
|
);
|