@marinade.finance/cli-common
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "@marinade.finance/cli-common", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "CLI tooling", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"pino": "^8.15.0", | ||
"@solana/web3.js": "^1.78.3", | ||
"@solana/web3.js": "^1.78.4", | ||
"borsh": "^0.7.0", | ||
@@ -34,3 +34,3 @@ "@types/expand-tilde": "^2.0.0", | ||
"pino": "^8.15.0", | ||
"@solana/web3.js": "^1.78.3", | ||
"@solana/web3.js": "^1.78.4", | ||
"borsh": "^0.7.0", | ||
@@ -37,0 +37,0 @@ "expand-tilde": "^2.0.2" |
@@ -5,3 +5,4 @@ import { Keypair, PublicKey, Commitment } from '@solana/web3.js'; | ||
export declare function parseKeypair(path: string): Promise<Keypair>; | ||
export declare function parseFile(path: string): Promise<string>; | ||
export declare function getClusterUrl(url: string): string; | ||
export declare function parseCommitment(commitment: string): Commitment; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseCommitment = exports.getClusterUrl = exports.parseKeypair = exports.parsePubkeyOrKeypair = exports.parsePubkey = void 0; | ||
exports.parseCommitment = exports.getClusterUrl = exports.parseFile = exports.parseKeypair = exports.parsePubkeyOrKeypair = exports.parsePubkey = void 0; | ||
const web3_js_1 = require("@solana/web3.js"); | ||
@@ -23,2 +23,3 @@ const expand_tilde_1 = __importDefault(require("expand-tilde")); // eslint-disable-line node/no-extraneous-import | ||
try { | ||
// TODO: reading public key from file is not supported | ||
return new web3_js_1.PublicKey(pubkeyOrPath); | ||
@@ -32,5 +33,9 @@ } | ||
async function parseKeypair(path) { | ||
return web3_js_1.Keypair.fromSecretKey(new Uint8Array(JSON.parse(await (0, promises_1.readFile)((0, expand_tilde_1.default)(path), 'utf-8')))); | ||
return web3_js_1.Keypair.fromSecretKey(new Uint8Array(JSON.parse(await parseFile(path)))); | ||
} | ||
exports.parseKeypair = parseKeypair; | ||
async function parseFile(path) { | ||
return await (0, promises_1.readFile)((0, expand_tilde_1.default)(path), 'utf-8'); | ||
} | ||
exports.parseFile = parseFile; | ||
function getClusterUrl(url) { | ||
@@ -37,0 +42,0 @@ let clusterUrl = url === 'd' |
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
36353
601