@metaplex-foundation/amman
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -7,2 +7,4 @@ import { Keypair, PublicKey } from '@solana/web3.js'; | ||
export declare type KeyLike = string | PublicKey | Keypair; | ||
export declare type AddLabel = (label: string, key: KeyLike) => void; | ||
export declare type GenKeypair = (label?: string) => [PublicKey, Keypair]; | ||
/** | ||
@@ -31,4 +33,11 @@ * Manages address labels in order to improve logging and provide them to tools | ||
*/ | ||
addLabel: (label: string, key: KeyLike) => void; | ||
addLabel: AddLabel; | ||
/** | ||
* Generates a keypair and returns its public key and the keypair itself as a Tuple. | ||
* | ||
* @param label if provided the key will be added to existing labels | ||
* @return [publicKey, keypair ] | ||
*/ | ||
genKeypair: GenKeypair; | ||
/** | ||
* Returns a function that allows comparing the provided key with another and | ||
@@ -35,0 +44,0 @@ * can be used for assertion tools like {@link spok | https://github.com/thlorenz/spok }. |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.AddressLabels = void 0; | ||
const web3_js_1 = require("@solana/web3.js"); | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -53,2 +54,15 @@ function publicKeyString(key) { | ||
/** | ||
* Generates a keypair and returns its public key and the keypair itself as a Tuple. | ||
* | ||
* @param label if provided the key will be added to existing labels | ||
* @return [publicKey, keypair ] | ||
*/ | ||
this.genKeypair = (label) => { | ||
const kp = web3_js_1.Keypair.generate(); | ||
if (label != null) { | ||
this.addLabel(label, kp); | ||
} | ||
return [kp.publicKey, kp]; | ||
}; | ||
/** | ||
* Returns a function that allows comparing the provided key with another and | ||
@@ -55,0 +69,0 @@ * can be used for assertion tools like {@link spok | https://github.com/thlorenz/spok }. |
{ | ||
"name": "@metaplex-foundation/amman", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "A modern mandatory toolbelt to help test solana SDK libraries and apps on a locally running validator.", | ||
@@ -5,0 +5,0 @@ "main": "dist/amman.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71930
1019