@rarible/types
Advanced tools
Comparing version 0.10.0-alpha.2 to 0.10.0-alpha.3
@@ -1,35 +0,4 @@ | ||
export declare enum BlockchainLayer1Enum { | ||
ETHEREUM = "ETHEREUM", | ||
FLOW = "FLOW", | ||
TEZOS = "TEZOS", | ||
SOLANA = "SOLANA" | ||
} | ||
export declare const blockchainsLayer1: BlockchainLayer1Enum[]; | ||
export declare enum BlockchainEnum { | ||
ETHEREUM = "ETHEREUM", | ||
FLOW = "FLOW", | ||
TEZOS = "TEZOS", | ||
POLYGON = "POLYGON", | ||
IMMUTABLEX = "IMMUTABLEX", | ||
SOLANA = "SOLANA" | ||
} | ||
export declare const evmBlockchains: BlockchainEnum[]; | ||
export type EVMBlockchain = (typeof evmBlockchains)[number]; | ||
export declare function isEVMBlockchain(blockchain: BlockchainEnum): blockchain is EVMBlockchain; | ||
export declare const blockchains: BlockchainEnum[]; | ||
export declare function isBlockchainSpecified(value: string): value is WithLayer1Blockchain; | ||
export declare function isRealBlockchainSpecified(value: string): value is WithBlockchain; | ||
export type WithLayer1Blockchain = string & { | ||
__WITH_BLOCKCHAIN__: true; | ||
}; | ||
export declare function withLayer1Blockchain(blockchain: BlockchainLayer1Enum, raw: string): WithLayer1Blockchain; | ||
export type WithBlockchain = string & { | ||
__WITH_BLOCKCHAIN__: true; | ||
}; | ||
export declare function withBlockchain(blockchain: BlockchainEnum, raw: string): WithBlockchain; | ||
export declare function toLayerOneBlockchain(blockchain: BlockchainEnum): BlockchainLayer1Enum; | ||
export declare function parseBlockchain(value: WithBlockchain): [BlockchainEnum, string]; | ||
export declare class BlockchainParseError extends Error { | ||
readonly name = "BlockchainParseError"; | ||
constructor(value: string); | ||
} | ||
export * from "./union"; | ||
export * from "./evm"; | ||
export * from "./flow"; | ||
export * from "./common"; |
"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; | ||
var BlockchainLayer1Enum; | ||
(function (BlockchainLayer1Enum) { | ||
BlockchainLayer1Enum["ETHEREUM"] = "ETHEREUM"; | ||
BlockchainLayer1Enum["FLOW"] = "FLOW"; | ||
BlockchainLayer1Enum["TEZOS"] = "TEZOS"; | ||
BlockchainLayer1Enum["SOLANA"] = "SOLANA"; | ||
})(BlockchainLayer1Enum = exports.BlockchainLayer1Enum || (exports.BlockchainLayer1Enum = {})); | ||
exports.blockchainsLayer1 = Object.values(BlockchainLayer1Enum); | ||
var BlockchainEnum; | ||
(function (BlockchainEnum) { | ||
BlockchainEnum["ETHEREUM"] = "ETHEREUM"; | ||
BlockchainEnum["FLOW"] = "FLOW"; | ||
BlockchainEnum["TEZOS"] = "TEZOS"; | ||
BlockchainEnum["POLYGON"] = "POLYGON"; | ||
BlockchainEnum["IMMUTABLEX"] = "IMMUTABLEX"; | ||
BlockchainEnum["SOLANA"] = "SOLANA"; | ||
})(BlockchainEnum = exports.BlockchainEnum || (exports.BlockchainEnum = {})); | ||
exports.evmBlockchains = [BlockchainEnum.POLYGON, BlockchainEnum.IMMUTABLEX, BlockchainEnum.POLYGON]; | ||
function isEVMBlockchain(blockchain) { | ||
return exports.evmBlockchains.includes(blockchain); | ||
} | ||
exports.isEVMBlockchain = isEVMBlockchain; | ||
exports.blockchains = Object.values(BlockchainEnum); | ||
function isBlockchainSpecified(value) { | ||
for (const blockchain of exports.blockchainsLayer1) { | ||
if (value.startsWith(`${blockchain}:`)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
exports.isBlockchainSpecified = isBlockchainSpecified; | ||
function isRealBlockchainSpecified(value) { | ||
for (const blockchain of exports.blockchains) { | ||
if (value.startsWith(`${blockchain}:`)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
exports.isRealBlockchainSpecified = isRealBlockchainSpecified; | ||
function withLayer1Blockchain(blockchain, raw) { | ||
return `${blockchain}:${raw}`; | ||
} | ||
exports.withLayer1Blockchain = withLayer1Blockchain; | ||
function withBlockchain(blockchain, raw) { | ||
return `${blockchain}:${raw}`; | ||
} | ||
exports.withBlockchain = withBlockchain; | ||
function toLayerOneBlockchain(blockchain) { | ||
if (isEVMBlockchain(blockchain)) | ||
return BlockchainLayer1Enum.ETHEREUM; | ||
return blockchain; | ||
} | ||
exports.toLayerOneBlockchain = toLayerOneBlockchain; | ||
function parseBlockchain(value) { | ||
if (isRealBlockchainSpecified(value)) { | ||
const sliceIndex = value.indexOf(":"); | ||
const blockchain = value.substring(0, sliceIndex); | ||
const rest = value.substring(sliceIndex + 1); | ||
return [blockchain, rest]; | ||
} | ||
throw new BlockchainParseError(value); | ||
} | ||
exports.parseBlockchain = parseBlockchain; | ||
class BlockchainParseError extends Error { | ||
constructor(value) { | ||
super(`Can't parse blockchain from value ${value}`); | ||
this.name = "BlockchainParseError"; | ||
} | ||
} | ||
exports.BlockchainParseError = BlockchainParseError; | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./union"), exports); | ||
tslib_1.__exportStar(require("./evm"), exports); | ||
tslib_1.__exportStar(require("./flow"), exports); | ||
tslib_1.__exportStar(require("./common"), exports); |
export type Maybe<T> = T | undefined; | ||
/** | ||
* String that represent any number value and can be passed to BigNumber constructor | ||
* can be used with any bn implementation such as bn.js, bignumber.js | ||
*/ | ||
export type BigNumberLike = string & { | ||
__IS_BIG_NUMBER__: true; | ||
}; |
@@ -6,1 +6,3 @@ export * from "./collection-id"; | ||
export * from "./ownership-id"; | ||
export * from "./auction-id"; | ||
export * from "./activity-id"; |
@@ -9,1 +9,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./ownership-id"), exports); | ||
tslib_1.__exportStar(require("./auction-id"), exports); | ||
tslib_1.__exportStar(require("./activity-id"), exports); |
@@ -1,6 +0,4 @@ | ||
export * from "./address"; | ||
export * from "./binary"; | ||
export * from "./ids"; | ||
export * from "./contract-address"; | ||
export * from "./common"; | ||
export * from "./blockchains"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./address"), exports); | ||
tslib_1.__exportStar(require("./binary"), exports); | ||
tslib_1.__exportStar(require("./ids"), exports); | ||
tslib_1.__exportStar(require("./contract-address"), exports); | ||
tslib_1.__exportStar(require("./common"), exports); | ||
tslib_1.__exportStar(require("./blockchains"), exports); |
{ | ||
"name": "@rarible/types", | ||
"version": "0.10.0-alpha.2", | ||
"version": "0.10.0-alpha.3", | ||
"keywords": [ | ||
@@ -32,3 +32,3 @@ "rarible", | ||
}, | ||
"gitHead": "5a2ed593bab16bf08356ee2b85f83a4c1b45cf16" | ||
"gitHead": "38483bfb8266062e940521534005dfdf8a9c9e04" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
57883
56
652