@blockfrost/blockfrost-utils
Advanced tools
Comparing version 2.4.0-beta.1 to 2.4.0
@@ -129,3 +129,3 @@ "use strict"; | ||
// error.name is always "FastifyError", use error.code to provide more info to a client (eg. FST_ERR_CTP_INVALID_MEDIA_TYPE) | ||
error: error.name, | ||
error: error.name === 'FastifyError' ? 'error' : error.name, | ||
message: error.message, | ||
@@ -132,0 +132,0 @@ status_code: error.statusCode, |
declare type BlockfrostNetwork = 'mainnet' | 'testnet' | 'preview' | 'preprod'; | ||
declare type SUPPORTED_PAYMENT_CRED_PREFIX = 'addr_vkh' | 'addr_vk' | 'script'; | ||
declare type PaymentCredPrefix = 'addr_vkh' | 'addr_vk' | 'script'; | ||
export declare const validateHex: (input: string) => boolean; | ||
@@ -9,5 +9,5 @@ export declare const validateStakeAddress: (input: string, network: BlockfrostNetwork) => boolean; | ||
paymentCred: string; | ||
prefix: SUPPORTED_PAYMENT_CRED_PREFIX; | ||
prefix: PaymentCredPrefix; | ||
} | undefined; | ||
export declare const paymentCredToBech32Address: (input: string, prefix: SUPPORTED_PAYMENT_CRED_PREFIX) => string | undefined; | ||
export declare const paymentCredToBech32Address: (input: string, prefix: PaymentCredPrefix) => string | undefined; | ||
export declare const detectAndValidateAddressType: (input: string, network: BlockfrostNetwork) => 'byron' | 'shelley' | undefined; | ||
@@ -17,3 +17,3 @@ export declare const getAddressTypeAndPaymentCred: (address: string, network: BlockfrostNetwork) => { | ||
paymentCred: string; | ||
paymentCredPrefix: SUPPORTED_PAYMENT_CRED_PREFIX; | ||
paymentCredPrefix: PaymentCredPrefix; | ||
} | { | ||
@@ -20,0 +20,0 @@ addressType: "byron" | "shelley" | undefined; |
@@ -126,7 +126,2 @@ "use strict"; | ||
return bech32_1.bech32.encode(prefix, words); | ||
case Prefixes.PAYMENT_KEY: | ||
// Payment key was already converted to key hash, so we cannot restore the original key. | ||
// We could supply orig via a parameter and then compare its hash to the input, but that's too much trouble. | ||
// Due to the above return payment key hash (input) with addr_vkh prefix instead of the original addr_vk | ||
return bech32_1.bech32.encode(Prefixes.PAYMENT_KEY_HASH, words); | ||
default: | ||
@@ -133,0 +128,0 @@ throw Error(`Prefix ${prefix} is not supported by paymentCredToBech32Address`); |
{ | ||
"name": "@blockfrost/blockfrost-utils", | ||
"version": "2.4.0-beta.1", | ||
"version": "2.4.0", | ||
"repository": "git@github.com:blockfrost/blockfrost-utils.git", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
62547
1140