@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.browser.esm.js
CHANGED
|
@@ -7180,14 +7180,17 @@ class Connection {
|
|
|
7180
7180
|
*/
|
|
7181
7181
|
class Keypair {
|
|
7182
7182
|
/**
|
|
7183
|
-
*
|
|
7184
|
-
*
|
|
7185
|
-
* Create a new keypair instance from a {@link SignKeyPair}.
|
|
7183
|
+
* Create a new keypair instance.
|
|
7184
|
+
* Generate random keypair if no {@link Ed25519Keypair} is provided.
|
|
7186
7185
|
*
|
|
7187
7186
|
* @param keypair ed25519 keypair
|
|
7188
7187
|
*/
|
|
7189
7188
|
constructor(keypair) {
|
|
7190
|
-
|
|
7189
|
+
if (keypair) {
|
|
7190
|
+
this._keypair = keypair;
|
|
7191
|
+
} else {
|
|
7192
|
+
this._keypair = nacl.sign.keyPair();
|
|
7193
|
+
}
|
|
7191
7194
|
}
|
|
7192
7195
|
/**
|
|
7193
7196
|
* Generate a new random keypair
|
|
@@ -7242,7 +7245,7 @@ class Keypair {
|
|
|
7242
7245
|
|
|
7243
7246
|
|
|
7244
7247
|
get publicKey() {
|
|
7245
|
-
return new PublicKey(this.
|
|
7248
|
+
return new PublicKey(this._keypair.publicKey);
|
|
7246
7249
|
}
|
|
7247
7250
|
/**
|
|
7248
7251
|
* The raw secret key for this keypair
|
|
@@ -7250,7 +7253,7 @@ class Keypair {
|
|
|
7250
7253
|
|
|
7251
7254
|
|
|
7252
7255
|
get secretKey() {
|
|
7253
|
-
return this.
|
|
7256
|
+
return this._keypair.secretKey;
|
|
7254
7257
|
}
|
|
7255
7258
|
|
|
7256
7259
|
}
|