@stacks/transactions
Advanced tools
Comparing version 6.14.1-pr.88 to 6.14.1-pr.89
@@ -16,9 +16,9 @@ import { hmac } from '@noble/hashes/hmac'; | ||
}; | ||
export function getAddressFromPrivateKey(privateKey, network) { | ||
network = networkFrom(network ?? STACKS_MAINNET); | ||
export function getAddressFromPrivateKey(privateKey, network = 'mainnet') { | ||
network = networkFrom(network); | ||
const publicKey = privateKeyToPublic(privateKey); | ||
return getAddressFromPublicKey(publicKey, network); | ||
} | ||
export function getAddressFromPublicKey(publicKey, network) { | ||
network = networkFrom(network ?? STACKS_MAINNET); | ||
export function getAddressFromPublicKey(publicKey, network = 'mainnet') { | ||
network = networkFrom(network); | ||
publicKey = typeof publicKey === 'string' ? hexToBytes(publicKey) : publicKey; | ||
@@ -25,0 +25,0 @@ const addrVer = addressHashModeToVersion(AddressHashMode.P2PKH, network); |
@@ -19,4 +19,4 @@ "use strict"; | ||
}; | ||
function getAddressFromPrivateKey(privateKey, network) { | ||
network = (0, network_1.networkFrom)(network ?? network_1.STACKS_MAINNET); | ||
function getAddressFromPrivateKey(privateKey, network = 'mainnet') { | ||
network = (0, network_1.networkFrom)(network); | ||
const publicKey = privateKeyToPublic(privateKey); | ||
@@ -26,4 +26,4 @@ return getAddressFromPublicKey(publicKey, network); | ||
exports.getAddressFromPrivateKey = getAddressFromPrivateKey; | ||
function getAddressFromPublicKey(publicKey, network) { | ||
network = (0, network_1.networkFrom)(network ?? network_1.STACKS_MAINNET); | ||
function getAddressFromPublicKey(publicKey, network = 'mainnet') { | ||
network = (0, network_1.networkFrom)(network); | ||
publicKey = typeof publicKey === 'string' ? (0, common_1.hexToBytes)(publicKey) : publicKey; | ||
@@ -30,0 +30,0 @@ const addrVer = (0, address_1.addressHashModeToVersion)(constants_1.AddressHashMode.P2PKH, network); |
{ | ||
"name": "@stacks/transactions", | ||
"version": "6.14.1-pr.88+7144c1ba", | ||
"version": "6.14.1-pr.89+912069b5", | ||
"description": "Javascript library for constructing transactions on the Stacks blockchain.", | ||
@@ -30,4 +30,4 @@ "license": "MIT", | ||
"@noble/secp256k1": "1.7.1", | ||
"@stacks/common": "^6.14.1-pr.88+7144c1ba", | ||
"@stacks/network": "^6.14.1-pr.88+7144c1ba", | ||
"@stacks/common": "^6.14.1-pr.89+912069b5", | ||
"@stacks/network": "^6.14.1-pr.89+912069b5", | ||
"c32check": "^2.0.0", | ||
@@ -37,3 +37,3 @@ "lodash.clonedeep": "^4.5.0" | ||
"devDependencies": { | ||
"@stacks/encryption": "^6.14.1-pr.88+7144c1ba", | ||
"@stacks/encryption": "^6.14.1-pr.89+912069b5", | ||
"@types/common-tags": "^1.8.0", | ||
@@ -67,3 +67,3 @@ "@types/elliptic": "^6.4.12", | ||
}, | ||
"gitHead": "7144c1ba55ec58119f860eeb7f7d092fd1ec8567" | ||
"gitHead": "912069b59561d1394e38b152f004320968227bf1" | ||
} |
@@ -47,5 +47,5 @@ import { hmac } from '@noble/hashes/hmac'; | ||
privateKey: PrivateKey, | ||
network?: StacksNetworkName | StacksNetwork | ||
network: StacksNetworkName | StacksNetwork = 'mainnet' | ||
): string { | ||
network = networkFrom(network ?? STACKS_MAINNET); | ||
network = networkFrom(network); | ||
const publicKey = privateKeyToPublic(privateKey); | ||
@@ -59,5 +59,5 @@ return getAddressFromPublicKey(publicKey, network); | ||
publicKey: PublicKey, | ||
network?: StacksNetworkName | StacksNetwork | ||
network: StacksNetworkName | StacksNetwork = 'mainnet' | ||
): string { | ||
network = networkFrom(network ?? STACKS_MAINNET); | ||
network = networkFrom(network); | ||
publicKey = typeof publicKey === 'string' ? hexToBytes(publicKey) : publicKey; | ||
@@ -64,0 +64,0 @@ const addrVer = addressHashModeToVersion(AddressHashMode.P2PKH, network); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1871472