@rarible/sdk-common
Advanced tools
Comparing version 0.13.69-beta.1 to 0.13.69-beta.3
@@ -5,2 +5,3 @@ import { BlockchainGroup } from "@rarible/api-client"; | ||
export declare const COMMON_INFO_MESSAGES: string[]; | ||
export declare const OUT_OF_GAS_ERROR = "returned values aren't valid, did it run out of gas"; | ||
export declare function isCancelCode(code?: unknown): boolean; | ||
@@ -7,0 +8,0 @@ export declare function isCancelMessage(msg: unknown, isLowerCase?: boolean): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getBlockchainByConnectorId = exports.isFlowWarning = exports.FLOW_WARN_MESSAGES = exports.isSolanaWarning = exports.isTezosWarning = exports.isEVMWarning = exports.isInfoLevel = exports.isCancelMessage = exports.isCancelCode = exports.COMMON_INFO_MESSAGES = exports.CANCEL_MESSAGES = exports.INVALID_TX_PARAMS_EIP_1559_ERROR = void 0; | ||
exports.getBlockchainByConnectorId = exports.isFlowWarning = exports.FLOW_WARN_MESSAGES = exports.isSolanaWarning = exports.isTezosWarning = exports.isEVMWarning = exports.isInfoLevel = exports.isCancelMessage = exports.isCancelCode = exports.OUT_OF_GAS_ERROR = exports.COMMON_INFO_MESSAGES = exports.CANCEL_MESSAGES = exports.INVALID_TX_PARAMS_EIP_1559_ERROR = void 0; | ||
const api_client_1 = require("@rarible/api-client"); | ||
@@ -144,2 +144,3 @@ exports.INVALID_TX_PARAMS_EIP_1559_ERROR = "Invalid transaction params: params specify an EIP-1559 transaction but the current network does not support EIP-1559"; | ||
].map((msg) => msg.toLowerCase()); | ||
exports.OUT_OF_GAS_ERROR = "returned values aren't valid, did it run out of gas"; | ||
const shortCancelMessages = ["cancel", "canceled", "cancelled", "rejected"]; | ||
@@ -146,0 +147,0 @@ function isCancelCode(code) { |
@@ -1,11 +0,7 @@ | ||
import { Blockchain } from "@rarible/api-client/build/models/Blockchain"; | ||
export declare type EVMBlockchain = Blockchain.ETHEREUM | Blockchain.POLYGON | Blockchain.MANTLE | Blockchain.ARBITRUM | Blockchain.ZKSYNC | Blockchain.CHILIZ | Blockchain.LIGHTLINK | Blockchain.RARI; | ||
export declare const EVMBlockchains: EVMBlockchain[]; | ||
/** | ||
* Return true if blockchain works like ethereum blockchain | ||
* @param blockchain | ||
*/ | ||
import { Blockchain } from "@rarible/api-client"; | ||
export declare const EVMBlockchains: readonly [Blockchain.ETHEREUM, Blockchain.POLYGON, Blockchain.MANTLE, Blockchain.ARBITRUM, Blockchain.ZKSYNC, Blockchain.CHILIZ, Blockchain.LIGHTLINK, Blockchain.RARI, Blockchain.ASTARZKEVM, Blockchain.BASE, Blockchain.FIEF, Blockchain.XAI, Blockchain.KROMA, Blockchain.CELO]; | ||
export declare type EVMBlockchain = typeof EVMBlockchains[number]; | ||
export declare function isEVMBlockchain(blockchain: string): blockchain is EVMBlockchain; | ||
export declare const NonEVMBlockchains: readonly [Blockchain.FLOW, Blockchain.TEZOS, Blockchain.SOLANA, Blockchain.IMMUTABLEX]; | ||
export declare const SupportedBlockchains: readonly [...EVMBlockchain[], Blockchain.FLOW, Blockchain.TEZOS, Blockchain.SOLANA, Blockchain.IMMUTABLEX]; | ||
export declare const NonEVMBlockchains: readonly [Blockchain.FLOW, Blockchain.TEZOS, Blockchain.SOLANA, Blockchain.ECLIPSE, Blockchain.IMMUTABLEX, Blockchain.APTOS]; | ||
export declare const SupportedBlockchains: readonly [Blockchain.ETHEREUM, Blockchain.POLYGON, Blockchain.MANTLE, Blockchain.ARBITRUM, Blockchain.ZKSYNC, Blockchain.CHILIZ, Blockchain.LIGHTLINK, Blockchain.RARI, Blockchain.ASTARZKEVM, Blockchain.BASE, Blockchain.FIEF, Blockchain.XAI, Blockchain.KROMA, Blockchain.CELO, Blockchain.FLOW, Blockchain.TEZOS, Blockchain.SOLANA, Blockchain.ECLIPSE, Blockchain.IMMUTABLEX, Blockchain.APTOS]; | ||
export declare type SupportedBlockchain = Extract<Blockchain, typeof SupportedBlockchains[number]>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SupportedBlockchains = exports.NonEVMBlockchains = exports.isEVMBlockchain = exports.EVMBlockchains = void 0; | ||
const Blockchain_1 = require("@rarible/api-client/build/models/Blockchain"); | ||
const api_client_1 = require("@rarible/api-client"); | ||
exports.EVMBlockchains = [ | ||
Blockchain_1.Blockchain.ETHEREUM, | ||
Blockchain_1.Blockchain.POLYGON, | ||
Blockchain_1.Blockchain.MANTLE, | ||
Blockchain_1.Blockchain.ARBITRUM, | ||
Blockchain_1.Blockchain.ZKSYNC, | ||
Blockchain_1.Blockchain.CHILIZ, | ||
Blockchain_1.Blockchain.LIGHTLINK, | ||
Blockchain_1.Blockchain.RARI, | ||
api_client_1.Blockchain.ETHEREUM, | ||
api_client_1.Blockchain.POLYGON, | ||
api_client_1.Blockchain.MANTLE, | ||
api_client_1.Blockchain.ARBITRUM, | ||
api_client_1.Blockchain.ZKSYNC, | ||
api_client_1.Blockchain.CHILIZ, | ||
api_client_1.Blockchain.LIGHTLINK, | ||
api_client_1.Blockchain.RARI, | ||
api_client_1.Blockchain.ASTARZKEVM, | ||
api_client_1.Blockchain.BASE, | ||
api_client_1.Blockchain.FIEF, | ||
api_client_1.Blockchain.XAI, | ||
api_client_1.Blockchain.KROMA, | ||
api_client_1.Blockchain.CELO, | ||
]; | ||
/** | ||
* Return true if blockchain works like ethereum blockchain | ||
* @param blockchain | ||
*/ | ||
function isEVMBlockchain(blockchain) { | ||
for (const b of exports.EVMBlockchains) { | ||
if (b === blockchain) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
return exports.EVMBlockchains.includes(blockchain); | ||
} | ||
exports.isEVMBlockchain = isEVMBlockchain; | ||
exports.NonEVMBlockchains = [ | ||
Blockchain_1.Blockchain.FLOW, | ||
Blockchain_1.Blockchain.TEZOS, | ||
Blockchain_1.Blockchain.SOLANA, | ||
Blockchain_1.Blockchain.IMMUTABLEX, | ||
api_client_1.Blockchain.FLOW, | ||
api_client_1.Blockchain.TEZOS, | ||
api_client_1.Blockchain.SOLANA, | ||
api_client_1.Blockchain.ECLIPSE, | ||
api_client_1.Blockchain.IMMUTABLEX, | ||
api_client_1.Blockchain.APTOS, | ||
]; | ||
@@ -34,0 +33,0 @@ exports.SupportedBlockchains = [ |
@@ -46,4 +46,11 @@ export * from "./promise-settled"; | ||
export declare function getDappType(provider: any): DappType | undefined; | ||
export declare function isObjectLike(x: unknown): x is object; | ||
export declare function isObjectLike(x: unknown): x is Object; | ||
export declare function hasName(x: unknown): x is Error; | ||
export declare function hasCode(error: unknown): error is { | ||
code: number; | ||
}; | ||
export declare function hasVersion(x: unknown): x is { | ||
version: string; | ||
}; | ||
export declare function deepReplaceBigInt(o: unknown): any; | ||
export declare function getMajorVersion(version: string | undefined): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deepReplaceBigInt = exports.hasName = exports.isObjectLike = exports.getDappType = exports.DappType = exports.getStringifiedData = void 0; | ||
exports.getMajorVersion = exports.deepReplaceBigInt = exports.hasVersion = exports.hasCode = exports.hasName = exports.isObjectLike = exports.getDappType = exports.DappType = exports.getStringifiedData = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -158,5 +158,13 @@ tslib_1.__exportStar(require("./promise-settled"), exports); | ||
function hasName(x) { | ||
return typeof x === "object" && x !== null && "name" in x; | ||
return isObjectLike(x) && "name" in x; | ||
} | ||
exports.hasName = hasName; | ||
function hasCode(error) { | ||
return isObjectLike(error) && "code" in error; | ||
} | ||
exports.hasCode = hasCode; | ||
function hasVersion(x) { | ||
return isObjectLike(x) && "version" in x; | ||
} | ||
exports.hasVersion = hasVersion; | ||
function deepReplaceBigInt(o) { | ||
@@ -166,3 +174,3 @@ if (Array.isArray(o)) { | ||
} | ||
if (typeof o === "object") { | ||
if (typeof o === "object" && o !== null) { | ||
const clonedObject = Object.assign({}, o); | ||
@@ -179,1 +187,9 @@ return Object.keys(clonedObject).reduce((acc, key) => { | ||
exports.deepReplaceBigInt = deepReplaceBigInt; | ||
function getMajorVersion(version) { | ||
if (!version) | ||
return ""; | ||
const components = version === null || version === void 0 ? void 0 : version.split("."); | ||
const [major] = components; | ||
return major; | ||
} | ||
exports.getMajorVersion = getMajorVersion; |
{ | ||
"name": "@rarible/sdk-common", | ||
"version": "0.13.69-beta.1", | ||
"version": "0.13.69-beta.3", | ||
"homepage": "", | ||
@@ -19,3 +19,3 @@ "license": "ISC", | ||
"dependencies": { | ||
"@rarible/api-client": "0.16.5-alpha.6" | ||
"@rarible/api-client": "0.16.5-alpha.10" | ||
}, | ||
@@ -35,3 +35,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "c98d7f139a586bb5b369df2a5232a591a5a59792" | ||
"gitHead": "0bdada52d1cb75f1ee4c784021e71e3c63e8bea7" | ||
} |
33588
758
+ Added@rarible/api-client@0.16.5-alpha.10(transitive)
- Removed@rarible/api-client@0.16.5-alpha.6(transitive)