@solana/web3.js 1.12.1 → 1.13.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/lib/index.browser.esm.js +9 -6
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +9 -6
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +17 -7
- package/lib/index.esm.js +9 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +9 -6
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/module.flow.js +17 -6
- package/package.json +6 -6
- package/src/connection.ts +4 -6
- package/src/keypair.ts +21 -7
- package/src/publickey.ts +2 -16
- package/src/stake-program.ts +2 -7
package/lib/index.cjs.js
CHANGED
|
@@ -5278,14 +5278,17 @@ class Connection {
|
|
|
5278
5278
|
*/
|
|
5279
5279
|
class Keypair {
|
|
5280
5280
|
/**
|
|
5281
|
-
*
|
|
5282
|
-
*
|
|
5283
|
-
* Create a new keypair instance from a {@link SignKeyPair}.
|
|
5281
|
+
* Create a new keypair instance.
|
|
5282
|
+
* Generate random keypair if no {@link Ed25519Keypair} is provided.
|
|
5284
5283
|
*
|
|
5285
5284
|
* @param keypair ed25519 keypair
|
|
5286
5285
|
*/
|
|
5287
5286
|
constructor(keypair) {
|
|
5288
|
-
|
|
5287
|
+
if (keypair) {
|
|
5288
|
+
this._keypair = keypair;
|
|
5289
|
+
} else {
|
|
5290
|
+
this._keypair = nacl__namespace.sign.keyPair();
|
|
5291
|
+
}
|
|
5289
5292
|
}
|
|
5290
5293
|
/**
|
|
5291
5294
|
* Generate a new random keypair
|
|
@@ -5340,7 +5343,7 @@ class Keypair {
|
|
|
5340
5343
|
|
|
5341
5344
|
|
|
5342
5345
|
get publicKey() {
|
|
5343
|
-
return new PublicKey(this.
|
|
5346
|
+
return new PublicKey(this._keypair.publicKey);
|
|
5344
5347
|
}
|
|
5345
5348
|
/**
|
|
5346
5349
|
* The raw secret key for this keypair
|
|
@@ -5348,7 +5351,7 @@ class Keypair {
|
|
|
5348
5351
|
|
|
5349
5352
|
|
|
5350
5353
|
get secretKey() {
|
|
5351
|
-
return this.
|
|
5354
|
+
return this._keypair.secretKey;
|
|
5352
5355
|
}
|
|
5353
5356
|
|
|
5354
5357
|
}
|