@solana/web3.js 1.30.2 → 1.31.0

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.2",
3
+ "version": "1.31.0",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -84,8 +84,8 @@
84
84
  "@babel/preset-env": "^7.12.11",
85
85
  "@babel/preset-typescript": "^7.12.16",
86
86
  "@babel/register": "^7.12.13",
87
- "@commitlint/config-conventional": "^13.1.0",
88
- "@commitlint/travis-cli": "^13.1.0",
87
+ "@commitlint/config-conventional": "^14.1.0",
88
+ "@commitlint/travis-cli": "^14.1.0",
89
89
  "@rollup/plugin-alias": "^3.1.2",
90
90
  "@rollup/plugin-babel": "^5.2.3",
91
91
  "@rollup/plugin-commonjs": "^21.0.0",
@@ -112,7 +112,7 @@
112
112
  "cross-env": "7.0.3",
113
113
  "eslint": "^7.19.0",
114
114
  "eslint-config-prettier": "^8.0.0",
115
- "eslint-plugin-import": "2.25.2",
115
+ "eslint-plugin-import": "2.25.3",
116
116
  "eslint-plugin-mocha": "^9.0.0",
117
117
  "eslint-plugin-prettier": "^4.0.0",
118
118
  "esm": "^3.2.25",
@@ -126,14 +126,14 @@
126
126
  "npm-run-all": "^4.1.5",
127
127
  "nyc": "^15.1.0",
128
128
  "prettier": "^2.3.0",
129
- "puppeteer": "^10.2.0",
129
+ "puppeteer": "^11.0.0",
130
130
  "rimraf": "3.0.2",
131
- "rollup": "2.58.3",
131
+ "rollup": "2.60.0",
132
132
  "rollup-plugin-dts": "^4.0.0",
133
133
  "rollup-plugin-node-polyfills": "^0.2.1",
134
134
  "rollup-plugin-terser": "^7.0.2",
135
135
  "semantic-release": "^18.0.0",
136
- "sinon": "^11.0.0",
136
+ "sinon": "^12.0.0",
137
137
  "start-server-and-test": "^1.12.0",
138
138
  "ts-node": "^10.0.0",
139
139
  "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