Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lens-protocol/shared-kernel

Package Overview
Dependencies
Maintainers
9
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lens-protocol/shared-kernel - npm Package Compare versions

Comparing version 0.11.0-alpha.8 to 0.11.0-alpha.9

dist/Amount-58bcc8fb.cjs.prod.js

2

dist/declarations/src/array.d.ts

@@ -1,2 +0,2 @@

import { NonEmptyArray, TwoAtLeastArray } from './ts-helpers/types';
import { NonEmptyArray, TwoAtLeastArray } from "./ts-helpers/types.js";
export declare function hasAtLeastOne<T>(items: ReadonlyArray<T>): items is NonEmptyArray<T>;

@@ -3,0 +3,0 @@ export declare function assertNonEmptyArray<T>(items: ReadonlyArray<T>): asserts items is NonEmptyArray<T>;

@@ -1,12 +0,12 @@

import { Amount } from '../Amount';
import { Erc20 } from '../Asset';
import { ChainType } from '../ChainType';
import { EvmAddress } from '../types';
import { Amount } from "../Amount.js";
import { Erc20 } from "../Asset.js";
import { ChainType } from "../ChainType.js";
import { Data, EvmAddress } from "../types.js";
export declare function mock32BytesHexString(): string;
export declare function mockUint256HexString(): string;
export declare function mockData(): Data;
export declare function mockEvmAddress(): EvmAddress;
export declare function mockEtherAmount(value: number | string): Amount<import("../Asset").Ether>;
export declare function mockEtherGweiAmount(value: number | string): Amount<import("../Asset").Ether>;
export declare function mockMaticGweiAmount(value: number | string): Amount<import("../Asset").Matic>;
export declare function mockUsdAmount(value: number | string): Amount<import("../Asset").Fiat>;
export declare function mockEtherAmount(value: number | string): Amount<import("../Asset.js").Ether>;
export declare function mockEtherGweiAmount(value: number | string): Amount<import("../Asset.js").Ether>;
export declare function mockMaticGweiAmount(value: number | string): Amount<import("../Asset.js").Matic>;
export declare function mockUsdAmount(value: number | string): Amount<import("../Asset.js").Fiat>;
export declare function mockErc20Asset({ address, symbol, chainType, }: {

@@ -25,2 +25,2 @@ address: string;

export declare function mockUsdcAmount(value: number | string, chainType?: ChainType): Amount<Erc20>;
export declare function mockMaticAmount(value: number | string): Amount<import("../Asset").Matic>;
export declare function mockMaticAmount(value: number | string): Amount<import("../Asset.js").Matic>;

@@ -1,3 +0,3 @@

import { BigDecimal } from '../arithmetic/BigDecimal';
import { Asset, CryptoAsset, CryptoNativeAsset, Erc20, Ether, Fiat, Matic } from './Asset';
import { BigDecimal } from "../arithmetic/BigDecimal.js";
import { Asset, CryptoAsset, CryptoNativeAsset, Erc20, Ether, Fiat, Matic } from "./Asset.js";
/**

@@ -4,0 +4,0 @@ * A type alias for a value that can be used to construct an {@link Amount}

@@ -1,3 +0,3 @@

import { ChainType } from './ChainType';
import { EvmAddress } from './types';
import { ChainType } from "./ChainType.js";
import { EvmAddress } from "./types.js";
/** @internal */

@@ -4,0 +4,0 @@ export declare enum Kind {

/**
* An EVM address
*/
import { Brand } from '../ts-helpers/types';
import { Brand } from "../ts-helpers/types.js";
export type EvmAddress = string;

@@ -6,0 +6,0 @@ /**

@@ -1,22 +0,21 @@

export * from './array';
export * from './arithmetic/BigDecimal';
export * from './CausedError';
export * from './crypto/Amount';
export * from './crypto/Asset';
export * from './crypto/ChainType';
export * from './crypto/types';
export * from './DateUtils';
export * from './get';
export * from './logger/ILogger';
export * from './Result';
export * from './Deferred';
export * from './safeSetTimeout';
export * from './ts-helpers/assertError';
export * from './ts-helpers/assertNever';
export * from './ts-helpers/invariant';
export * from './ts-helpers/never';
export * from './ts-helpers/nonNullable';
export * from './ts-helpers/types';
export * from './ts-helpers/isInEnum';
export * from './omitDeep';
export * from './maybe';
export * from "./array.js";
export * from "./arithmetic/BigDecimal.js";
export * from "./CausedError.js";
export * from "./crypto/Amount.js";
export * from "./crypto/Asset.js";
export * from "./crypto/ChainType.js";
export * from "./crypto/types.js";
export * from "./DateUtils.js";
export * from "./get.js";
export * from "./logger/ILogger.js";
export * from "./Result.js";
export * from "./Deferred.js";
export * from "./ts-helpers/assertError.js";
export * from "./ts-helpers/assertNever.js";
export * from "./ts-helpers/invariant.js";
export * from "./ts-helpers/never.js";
export * from "./ts-helpers/nonNullable.js";
export * from "./ts-helpers/types.js";
export * from "./ts-helpers/isInEnum.js";
export * from "./omitDeep.js";
export * from "./maybe.js";

@@ -1,1 +0,1 @@

export * from './crypto/__helpers__/mocks';
export * from "./crypto/__helpers__/mocks.js";

@@ -1,2 +0,2 @@

import { Primitive, UnknownObject } from './ts-helpers/types';
import { Primitive, UnknownObject } from "./ts-helpers/types.js";
export type DeepOmit<T, Filter extends string> = T extends Primitive ? T : T extends Array<infer ItemType> ? ItemType extends UnknownObject ? Array<DeepOmit<ItemType, Filter>> : T : T extends UnknownObject ? {

@@ -3,0 +3,0 @@ [K in keyof T as Exclude<K, Filter>]: DeepOmit<T[K], Filter>;

@@ -1,2 +0,2 @@

import { Narrow } from './ts-helpers/types';
import { Narrow } from "./ts-helpers/types.js";
/**

@@ -3,0 +3,0 @@ * A `Success<T, E>` represents a successful computation that returns a value of type `T`.

export * from "./declarations/src/index";
//# sourceMappingURL=lens-protocol-shared-kernel.cjs.d.ts.map

@@ -5,3 +5,3 @@ 'use strict';

var Amount = require('./Amount-188230fa.cjs.dev.js');
var Amount = require('./Amount-781b917e.cjs.dev.js');
var defaultTo = require('lodash/defaultTo.js');

@@ -344,51 +344,2 @@ var isObject = require('lodash/isObject.js');

var POLLING_TIME = 1000;
var lastActiveTimerId = 0;
var activeTimers = new Set();
var safeSetTimeoutRec = function safeSetTimeoutRec(fn, endTime, timerId, options) {
var msToEnd = endTime - Date.now();
setTimeout(function () {
if (!activeTimers.has(timerId)) {
return;
}
var now = Date.now();
if (now >= endTime) {
activeTimers["delete"](timerId);
fn();
} else {
safeSetTimeoutRec(fn, endTime, timerId, options);
}
}, msToEnd <= options.poolingTimeout ? msToEnd : options.poolingTimeout);
};
/**
* Safe version of `setTimeout` that should support
* 1. Large milliseconds delays (larger than 2147483647)
* 2. Hibernation/Sleep
*
* @param fn - callback to be invoked after
* @param ms - milliseconds to wait
* @param options - timer options
*
* Note: `safeSetTimeout` should be only used when really needed
* as processor overhead is bigger than with normal `setTimeout`
* @returns timerId Use `clearSafeTimeout(timerId)` to cancel timeout
*/
var safeSetTimeout = function safeSetTimeout(fn, ms) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
poolingTimeout: POLLING_TIME
};
var timerId = ++lastActiveTimerId;
activeTimers.add(timerId);
safeSetTimeoutRec(fn, Date.now() + ms, timerId, options);
return timerId;
};
/**
* Cancel timeout created with `safeSetTimeout`.
*/
var clearSafeTimeout = function clearSafeTimeout(timerId) {
activeTimers["delete"](timerId);
};
function assertError(error) {

@@ -481,20 +432,8 @@ // why not `error instanceof Error`? see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1099

exports.BigDecimal = Amount.BigDecimal;
Object.defineProperty(exports, 'ChainType', {
enumerable: true,
get: function () { return Amount.ChainType; }
});
exports.ChainType = Amount.ChainType;
exports.Denomination = Amount.Denomination;
exports.InvariantError = Amount.InvariantError;
Object.defineProperty(exports, 'Kind', {
enumerable: true,
get: function () { return Amount.Kind; }
});
Object.defineProperty(exports, 'NativeType', {
enumerable: true,
get: function () { return Amount.NativeType; }
});
Object.defineProperty(exports, 'WellKnownSymbols', {
enumerable: true,
get: function () { return Amount.WellKnownSymbols; }
});
exports.Kind = Amount.Kind;
exports.NativeType = Amount.NativeType;
exports.WellKnownSymbols = Amount.WellKnownSymbols;
exports.erc20 = Amount.erc20;

@@ -516,3 +455,2 @@ exports.ether = Amount.ether;

exports.assertSuccess = assertSuccess;
exports.clearSafeTimeout = clearSafeTimeout;
exports.failure = failure;

@@ -530,3 +468,2 @@ exports.get = get;

exports.removeAtIndex = removeAtIndex;
exports.safeSetTimeout = safeSetTimeout;
exports.success = success;

@@ -5,3 +5,3 @@ 'use strict';

var Amount = require('./Amount-d4fb1927.cjs.prod.js');
var Amount = require('./Amount-58bcc8fb.cjs.prod.js');
var defaultTo = require('lodash/defaultTo.js');

@@ -344,51 +344,2 @@ var isObject = require('lodash/isObject.js');

var POLLING_TIME = 1000;
var lastActiveTimerId = 0;
var activeTimers = new Set();
var safeSetTimeoutRec = function safeSetTimeoutRec(fn, endTime, timerId, options) {
var msToEnd = endTime - Date.now();
setTimeout(function () {
if (!activeTimers.has(timerId)) {
return;
}
var now = Date.now();
if (now >= endTime) {
activeTimers["delete"](timerId);
fn();
} else {
safeSetTimeoutRec(fn, endTime, timerId, options);
}
}, msToEnd <= options.poolingTimeout ? msToEnd : options.poolingTimeout);
};
/**
* Safe version of `setTimeout` that should support
* 1. Large milliseconds delays (larger than 2147483647)
* 2. Hibernation/Sleep
*
* @param fn - callback to be invoked after
* @param ms - milliseconds to wait
* @param options - timer options
*
* Note: `safeSetTimeout` should be only used when really needed
* as processor overhead is bigger than with normal `setTimeout`
* @returns timerId Use `clearSafeTimeout(timerId)` to cancel timeout
*/
var safeSetTimeout = function safeSetTimeout(fn, ms) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
poolingTimeout: POLLING_TIME
};
var timerId = ++lastActiveTimerId;
activeTimers.add(timerId);
safeSetTimeoutRec(fn, Date.now() + ms, timerId, options);
return timerId;
};
/**
* Cancel timeout created with `safeSetTimeout`.
*/
var clearSafeTimeout = function clearSafeTimeout(timerId) {
activeTimers["delete"](timerId);
};
function assertError(error) {

@@ -481,20 +432,8 @@ // why not `error instanceof Error`? see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1099

exports.BigDecimal = Amount.BigDecimal;
Object.defineProperty(exports, 'ChainType', {
enumerable: true,
get: function () { return Amount.ChainType; }
});
exports.ChainType = Amount.ChainType;
exports.Denomination = Amount.Denomination;
exports.InvariantError = Amount.InvariantError;
Object.defineProperty(exports, 'Kind', {
enumerable: true,
get: function () { return Amount.Kind; }
});
Object.defineProperty(exports, 'NativeType', {
enumerable: true,
get: function () { return Amount.NativeType; }
});
Object.defineProperty(exports, 'WellKnownSymbols', {
enumerable: true,
get: function () { return Amount.WellKnownSymbols; }
});
exports.Kind = Amount.Kind;
exports.NativeType = Amount.NativeType;
exports.WellKnownSymbols = Amount.WellKnownSymbols;
exports.erc20 = Amount.erc20;

@@ -516,3 +455,2 @@ exports.ether = Amount.ether;

exports.assertSuccess = assertSuccess;
exports.clearSafeTimeout = clearSafeTimeout;
exports.failure = failure;

@@ -530,3 +468,2 @@ exports.get = get;

exports.removeAtIndex = removeAtIndex;
exports.safeSetTimeout = safeSetTimeout;
exports.success = success;

@@ -1,3 +0,3 @@

import { i as invariant, _ as _inherits, a as _createSuper, b as _classCallCheck, c as _assertThisInitialized, d as _createClass, e as _wrapNativeSuper, I as InvariantError } from './Amount-32055385.esm.js';
export { A as Amount, B as BigDecimal, C as ChainType, D as Denomination, I as InvariantError, K as Kind, N as NativeType, W as WellKnownSymbols, f as erc20, g as ether, i as invariant, m as matic, u as usd } from './Amount-32055385.esm.js';
import { i as invariant, _ as _inherits, a as _createSuper, b as _classCallCheck, c as _assertThisInitialized, d as _createClass, e as _wrapNativeSuper, I as InvariantError } from './Amount-5b0c3806.esm.js';
export { A as Amount, B as BigDecimal, C as ChainType, D as Denomination, I as InvariantError, K as Kind, N as NativeType, W as WellKnownSymbols, f as erc20, g as ether, i as invariant, m as matic, u as usd } from './Amount-5b0c3806.esm.js';
import defaultTo from 'lodash/defaultTo.js';

@@ -332,51 +332,2 @@ import isObject from 'lodash/isObject.js';

var POLLING_TIME = 1000;
var lastActiveTimerId = 0;
var activeTimers = new Set();
var safeSetTimeoutRec = function safeSetTimeoutRec(fn, endTime, timerId, options) {
var msToEnd = endTime - Date.now();
setTimeout(function () {
if (!activeTimers.has(timerId)) {
return;
}
var now = Date.now();
if (now >= endTime) {
activeTimers["delete"](timerId);
fn();
} else {
safeSetTimeoutRec(fn, endTime, timerId, options);
}
}, msToEnd <= options.poolingTimeout ? msToEnd : options.poolingTimeout);
};
/**
* Safe version of `setTimeout` that should support
* 1. Large milliseconds delays (larger than 2147483647)
* 2. Hibernation/Sleep
*
* @param fn - callback to be invoked after
* @param ms - milliseconds to wait
* @param options - timer options
*
* Note: `safeSetTimeout` should be only used when really needed
* as processor overhead is bigger than with normal `setTimeout`
* @returns timerId Use `clearSafeTimeout(timerId)` to cancel timeout
*/
var safeSetTimeout = function safeSetTimeout(fn, ms) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
poolingTimeout: POLLING_TIME
};
var timerId = ++lastActiveTimerId;
activeTimers.add(timerId);
safeSetTimeoutRec(fn, Date.now() + ms, timerId, options);
return timerId;
};
/**
* Cancel timeout created with `safeSetTimeout`.
*/
var clearSafeTimeout = function clearSafeTimeout(timerId) {
activeTimers["delete"](timerId);
};
function assertError(error) {

@@ -467,2 +418,2 @@ // why not `error instanceof Error`? see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1099

export { CausedError, DateUtils, Deferred, assertError, assertErrorWithCode, assertErrorWithReason, assertFailure, assertJustOne, assertNever, assertNonEmptyArray, assertSuccess, clearSafeTimeout, failure, get, hasAtLeastOne, hasJustOne, hasTwoOrMore, isInEnum, isNonNullable, maybe, never, nonNullable, omitDeep, removeAtIndex, safeSetTimeout, success };
export { CausedError, DateUtils, Deferred, assertError, assertErrorWithCode, assertErrorWithReason, assertFailure, assertJustOne, assertNever, assertNonEmptyArray, assertSuccess, failure, get, hasAtLeastOne, hasJustOne, hasTwoOrMore, isInEnum, isNonNullable, maybe, never, nonNullable, omitDeep, removeAtIndex, success };
export * from "../../dist/declarations/src/mocks";
//# sourceMappingURL=lens-protocol-shared-kernel-mocks.cjs.d.ts.map

@@ -5,4 +5,4 @@ 'use strict';

var ethers = require('ethers');
var Amount = require('../../dist/Amount-188230fa.cjs.dev.js');
var address = require('@ethersproject/address');
var Amount = require('../../dist/Amount-781b917e.cjs.dev.js');
require('decimal.js');

@@ -49,7 +49,7 @@

}
function mockUint256HexString() {
function mockData() {
return mock32BytesHexString();
}
function mockEvmAddress() {
return ethers.utils.getAddress("0x".concat(genRanHex(20 * 2)));
return address.getAddress("0x".concat(genRanHex(20 * 2)));
}

@@ -124,2 +124,3 @@ function mockEtherAmount(value) {

exports.mockDaiAsset = mockDaiAsset;
exports.mockData = mockData;
exports.mockErc20Asset = mockErc20Asset;

@@ -131,5 +132,4 @@ exports.mockEtherAmount = mockEtherAmount;

exports.mockMaticGweiAmount = mockMaticGweiAmount;
exports.mockUint256HexString = mockUint256HexString;
exports.mockUsdAmount = mockUsdAmount;
exports.mockUsdcAmount = mockUsdcAmount;
exports.mockUsdcAsset = mockUsdcAsset;

@@ -5,4 +5,4 @@ 'use strict';

var ethers = require('ethers');
var Amount = require('../../dist/Amount-d4fb1927.cjs.prod.js');
var address = require('@ethersproject/address');
var Amount = require('../../dist/Amount-58bcc8fb.cjs.prod.js');
require('decimal.js');

@@ -49,7 +49,7 @@

}
function mockUint256HexString() {
function mockData() {
return mock32BytesHexString();
}
function mockEvmAddress() {
return ethers.utils.getAddress("0x".concat(genRanHex(20 * 2)));
return address.getAddress("0x".concat(genRanHex(20 * 2)));
}

@@ -124,2 +124,3 @@ function mockEtherAmount(value) {

exports.mockDaiAsset = mockDaiAsset;
exports.mockData = mockData;
exports.mockErc20Asset = mockErc20Asset;

@@ -131,5 +132,4 @@ exports.mockEtherAmount = mockEtherAmount;

exports.mockMaticGweiAmount = mockMaticGweiAmount;
exports.mockUint256HexString = mockUint256HexString;
exports.mockUsdAmount = mockUsdAmount;
exports.mockUsdcAmount = mockUsdcAmount;
exports.mockUsdcAsset = mockUsdcAsset;

@@ -1,3 +0,3 @@

import { utils } from 'ethers';
import { A as Amount, D as Denomination, C as ChainType, f as erc20 } from '../../dist/Amount-32055385.esm.js';
import { getAddress } from '@ethersproject/address';
import { A as Amount, D as Denomination, C as ChainType, f as erc20 } from '../../dist/Amount-5b0c3806.esm.js';
import 'decimal.js';

@@ -44,7 +44,7 @@

}
function mockUint256HexString() {
function mockData() {
return mock32BytesHexString();
}
function mockEvmAddress() {
return utils.getAddress("0x".concat(genRanHex(20 * 2)));
return getAddress("0x".concat(genRanHex(20 * 2)));
}

@@ -116,2 +116,2 @@ function mockEtherAmount(value) {

export { mock32BytesHexString, mockDaiAmount, mockDaiAsset, mockErc20Asset, mockEtherAmount, mockEtherGweiAmount, mockEvmAddress, mockMaticAmount, mockMaticGweiAmount, mockUint256HexString, mockUsdAmount, mockUsdcAmount, mockUsdcAsset };
export { mock32BytesHexString, mockDaiAmount, mockDaiAsset, mockData, mockErc20Asset, mockEtherAmount, mockEtherGweiAmount, mockEvmAddress, mockMaticAmount, mockMaticGweiAmount, mockUsdAmount, mockUsdcAmount, mockUsdcAsset };
{
"name": "@lens-protocol/shared-kernel",
"version": "0.11.0-alpha.8",
"version": "0.11.0-alpha.9",
"description": "Shared kernel",

@@ -30,2 +30,3 @@ "repository": {

"dependencies": {
"@ethersproject/address": "^5.7.0",
"decimal.js": "^10.4.3",

@@ -36,14 +37,13 @@ "lodash": "^4.17.21",

"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "29.5.3",
"@types/lodash": "^4.14.191",
"@types/uuid": "^9.0.0",
"eslint": "^8.34.0",
"ethers": "^5.7.2",
"jest": "^29.4.3",
"prettier": "^2.8.4",
"ts-jest": "^29.0.5",
"typescript": "^5.2.2",
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@types/jest": "^29.5.10",
"@types/lodash": "^4.14.202",
"@types/uuid": "^9.0.7",
"eslint": "^8.54.0",
"jest": "^29.7.0",
"prettier": "^2.8.8",
"ts-jest": "^29.1.1",
"typescript": "5.2.2",
"@lens-protocol/eslint-config": "0.5.0",

@@ -53,10 +53,2 @@ "@lens-protocol/prettier-config": "0.5.0",

},
"peerDependencies": {
"ethers": "^5.7.2"
},
"peerDependenciesMeta": {
"ethers": {
"optional": true
}
},
"prettier": "@lens-protocol/prettier-config",

@@ -63,0 +55,0 @@ "babel": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc