@solana/web3.js 1.30.3 → 1.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.30.3",
3
+ "version": "1.31.1",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -59,8 +59,8 @@
59
59
  "@babel/preset-env": "^7.12.11",
60
60
  "@babel/preset-typescript": "^7.12.16",
61
61
  "@babel/register": "^7.12.13",
62
- "@commitlint/config-conventional": "^13.1.0",
63
- "@commitlint/travis-cli": "^13.1.0",
62
+ "@commitlint/config-conventional": "^14.1.0",
63
+ "@commitlint/travis-cli": "^14.1.0",
64
64
  "@rollup/plugin-alias": "^3.1.2",
65
65
  "@rollup/plugin-babel": "^5.2.3",
66
66
  "@rollup/plugin-commonjs": "^21.0.0",
@@ -87,7 +87,7 @@
87
87
  "cross-env": "7.0.3",
88
88
  "eslint": "^7.19.0",
89
89
  "eslint-config-prettier": "^8.0.0",
90
- "eslint-plugin-import": "2.25.2",
90
+ "eslint-plugin-import": "2.25.3",
91
91
  "eslint-plugin-mocha": "^9.0.0",
92
92
  "eslint-plugin-prettier": "^4.0.0",
93
93
  "esm": "^3.2.25",
@@ -101,14 +101,14 @@
101
101
  "npm-run-all": "^4.1.5",
102
102
  "nyc": "^15.1.0",
103
103
  "prettier": "^2.3.0",
104
- "puppeteer": "^10.2.0",
104
+ "puppeteer": "^11.0.0",
105
105
  "rimraf": "3.0.2",
106
- "rollup": "2.58.3",
106
+ "rollup": "2.60.0",
107
107
  "rollup-plugin-dts": "^4.0.0",
108
108
  "rollup-plugin-node-polyfills": "^0.2.1",
109
109
  "rollup-plugin-terser": "^7.0.2",
110
110
  "semantic-release": "^18.0.0",
111
- "sinon": "^11.0.0",
111
+ "sinon": "^12.0.0",
112
112
  "start-server-and-test": "^1.12.0",
113
113
  "ts-node": "^10.0.0",
114
114
  "tslib": "^2.1.0",
package/src/account.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as nacl from 'tweetnacl';
1
+ import nacl from 'tweetnacl';
2
2
  import type {SignKeyPair as KeyPair} from 'tweetnacl';
3
3
  import type {Buffer} from 'buffer';
4
4
 
package/src/keypair.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as nacl from 'tweetnacl';
1
+ import nacl from 'tweetnacl';
2
2
 
3
3
  import {PublicKey} from './publickey';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import {Buffer} from 'buffer';
2
2
  import * as BufferLayout from '@solana/buffer-layout';
3
3
  import secp256k1 from 'secp256k1';
4
- import {keccak_256} from 'js-sha3';
4
+ import sha3 from 'js-sha3';
5
5
 
6
6
  import {PublicKey} from './publickey';
7
7
  import {TransactionInstruction} from './transaction';
@@ -86,9 +86,9 @@ export class Secp256k1Program {
86
86
  );
87
87
 
88
88
  try {
89
- return Buffer.from(keccak_256.update(toBuffer(publicKey)).digest()).slice(
90
- -ETHEREUM_ADDRESS_BYTES,
91
- );
89
+ return Buffer.from(
90
+ sha3.keccak_256.update(toBuffer(publicKey)).digest(),
91
+ ).slice(-ETHEREUM_ADDRESS_BYTES);
92
92
  } catch (error) {
93
93
  throw new Error(`Error constructing Ethereum address: ${error}`);
94
94
  }
@@ -197,7 +197,7 @@ export class Secp256k1Program {
197
197
  const privateKey = toBuffer(pkey);
198
198
  const publicKey = publicKeyCreate(privateKey, false).slice(1); // throw away leading byte
199
199
  const messageHash = Buffer.from(
200
- keccak_256.update(toBuffer(message)).digest(),
200
+ sha3.keccak_256.update(toBuffer(message)).digest(),
201
201
  );
202
202
  const {signature, recid: recoveryId} = ecdsaSign(messageHash, privateKey);
203
203