diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index af99424..10bbca1 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to casper-client-sdk. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.0.23 + +### Changed +- Removes use of `Buffer` in `parseKeyPair()` and instead creates new `Uint8Array` concatenating public and private keys for use as secret key in Ed25519 key pair. ## 1.0.22 ### Fixed diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 5b4b157..6e2881f 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "casper-client-sdk", - "version": "1.0.22", + "version": "1.0.23", "license": "Apache 2.0", "description": "SDK to interact with the Casper blockchain", "main": "dist/index.js", diff --git a/packages/sdk/src/lib/Keys.ts b/packages/sdk/src/lib/Keys.ts index 184fe09..49a225c 100644 --- a/packages/sdk/src/lib/Keys.ts +++ b/packages/sdk/src/lib/Keys.ts @@ -184,9 +184,12 @@ export class Ed25519 extends AsymmetricKey { const publ = Ed25519.parsePublicKey(publicKey); const priv = Ed25519.parsePrivateKey(privateKey); // nacl expects that the private key will contain both. + const secr = new Uint8Array(publ.length + priv.length); + secr.set(priv); + secr.set(publ, priv.length); return new Ed25519({ publicKey: publ, - secretKey: Buffer.concat([priv, publ]) + secretKey: secr }); }