@rarible/types
Advanced tools
Comparing version 0.11.0-alpha.4 to 0.11.0-alpha.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BlockchainParseError = exports.parseBlockchain = exports.toLayerOneBlockchain = exports.withBlockchain = exports.withLayer1Blockchain = exports.isRealBlockchainSpecified = exports.isBlockchainSpecified = exports.blockchains = exports.isEVMBlockchain = exports.evmBlockchains = exports.BlockchainEnum = exports.blockchainsLayer1 = exports.BlockchainLayer1Enum = void 0; | ||
exports.BlockchainParseError = exports.parseBlockchain = exports.toLayerOneBlockchain = exports.withBlockchain = exports.withLayer1Blockchain = exports.isRealBlockchainSpecified = exports.isBlockchainSpecified = exports.blockchains = exports.isEVMBlockchain = exports.isBlockchain = exports.evmBlockchains = exports.BlockchainEnum = exports.blockchainsLayer1 = exports.BlockchainLayer1Enum = void 0; | ||
var BlockchainLayer1Enum; | ||
@@ -30,3 +30,23 @@ (function (BlockchainLayer1Enum) { | ||
]; | ||
/** | ||
* Checks if provided string is real blockchain from BlockchainEnum | ||
* @param blockchain test string | ||
*/ | ||
function isBlockchain(blockchain) { | ||
for (const enumValue of exports.blockchains) { | ||
if (enumValue === blockchain) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
exports.isBlockchain = isBlockchain; | ||
/** | ||
* Checks if provided string is EVM blockchain | ||
* @param blockchain test string | ||
*/ | ||
function isEVMBlockchain(blockchain) { | ||
if (!isBlockchain(blockchain)) { | ||
return false; | ||
} | ||
return exports.evmBlockchains.includes(blockchain); | ||
@@ -33,0 +53,0 @@ } |
@@ -20,3 +20,12 @@ export declare enum BlockchainLayer1Enum { | ||
export declare const evmBlockchains: BlockchainEnum[]; | ||
export declare function isEVMBlockchain(blockchain: BlockchainEnum): blockchain is EVMBlockchain; | ||
/** | ||
* Checks if provided string is real blockchain from BlockchainEnum | ||
* @param blockchain test string | ||
*/ | ||
export declare function isBlockchain(blockchain: string): blockchain is BlockchainEnum; | ||
/** | ||
* Checks if provided string is EVM blockchain | ||
* @param blockchain test string | ||
*/ | ||
export declare function isEVMBlockchain(blockchain: string): blockchain is EVMBlockchain; | ||
export declare const blockchains: BlockchainEnum[]; | ||
@@ -23,0 +32,0 @@ export declare function isBlockchainSpecified(value: string): value is WithLayer1Blockchain; |
@@ -27,3 +27,22 @@ export var BlockchainLayer1Enum; | ||
]; | ||
/** | ||
* Checks if provided string is real blockchain from BlockchainEnum | ||
* @param blockchain test string | ||
*/ | ||
export function isBlockchain(blockchain) { | ||
for (const enumValue of blockchains) { | ||
if (enumValue === blockchain) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
/** | ||
* Checks if provided string is EVM blockchain | ||
* @param blockchain test string | ||
*/ | ||
export function isEVMBlockchain(blockchain) { | ||
if (!isBlockchain(blockchain)) { | ||
return false; | ||
} | ||
return evmBlockchains.includes(blockchain); | ||
@@ -30,0 +49,0 @@ } |
{ | ||
"name": "@rarible/types", | ||
"version": "0.11.0-alpha.4", | ||
"version": "0.11.0-alpha.5", | ||
"keywords": [ | ||
@@ -33,3 +33,3 @@ "rarible", | ||
}, | ||
"gitHead": "a4a3aa3f112404c2095b45cab07446dc7201c775" | ||
"gitHead": "d759f43ae3f4f666149552d2d49a47e91fe52c7a" | ||
} |
Sorry, the diff of this file is not supported yet
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
112101
1303