Skip to content

Commit

Permalink
fix signature from wallet pro (#461)
Browse files Browse the repository at this point in the history
* fix signature from wallet pro

* fix wallet pro version

* patch
  • Loading branch information
Ben-Rey authored Aug 24, 2023
1 parent be2436d commit 0f52182
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@massalabs/massa-web3",
"version": "2.2.0",
"version": "2.2.1",
"description": "massa's web3 sdk client",
"main": "dist/cmd/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -58,7 +58,7 @@
"bundle.min.js"
],
"dependencies": {
"@massalabs/wallet-provider": "^1.3.2",
"@massalabs/wallet-provider": "^1.3.3",
"@noble/ed25519": "^1.7.3",
"@noble/hashes": "^1.2.0",
"@types/ws": "^8.5.4",
Expand Down
7 changes: 3 additions & 4 deletions src/web3/accounts/WalletProviderAccount.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IBaseAccount } from '../../interfaces/IBaseAccount';
import { IAccount } from '@massalabs/wallet-provider';
import { base58Encode } from '../../utils/Xbqcrypto';
import { ISignature } from '../../interfaces/ISignature';
import { IRollsData } from '../../interfaces/IRollsData';
import { ITransactionData } from '../../interfaces/ITransactionData';
Expand All @@ -18,12 +17,12 @@ export class WalletProviderAccount implements IBaseAccount {
if (data instanceof Uint8Array) {
data = Buffer.from(data);
}

const signatureData = await this.account.sign(data);
let bytes_signature = signatureData.signature;
const base58Encoded = base58Encode(bytes_signature);

return {
publicKey: signatureData.publicKey,
base58Encoded,
base58Encoded: signatureData.base58Encoded,
};
}

Expand Down

0 comments on commit 0f52182

Please sign in to comment.