Socket
Socket
Sign inDemoInstall

@lit-protocol/constants

Package Overview
Dependencies
Maintainers
7
Versions
486
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lit-protocol/constants - npm Package Compare versions

Comparing version 6.4.1 to 6.4.2-pr-621

8

package.json

@@ -23,11 +23,9 @@ {

],
"version": "6.4.1",
"version": "6.4.2-pr-621",
"dependencies": {
"@ethersproject/abstract-provider": "5.7.0",
"@lit-protocol/accs-schemas": "0.0.9",
"@lit-protocol/contracts": "^0.0.39",
"@openagenda/verror": "^3.1.4",
"ethers": "^5.7.1",
"jszip": "^3.10.1",
"siwe": "^2.0.5",
"@lit-protocol/types": "6.4.1",
"@lit-protocol/types": "6.4.2-pr-621",
"tslib": "1.14.1"

@@ -34,0 +32,0 @@ },

# Quick Start
This submodule exports various modules, constants, interfaces, enums, errors, utilities that are being used in Lit Protocol.
This submodule exports various modules, constants, interfaces, errors, utilities that are being used in Lit Protocol.

@@ -5,0 +5,0 @@ ### node.js / browser

@@ -8,7 +8,6 @@ export * from './lib/version';

export * from './lib/interfaces/i-errors';
export * from './lib/enums';
export * from './lib/errors';
export * from './lib/utils/utils';
import * as ABI_ERC20 from './lib/abis/ERC20.json';
import * as ABI_LIT from './lib/abis/LIT.json';
import * as ABI_ERC20 from './lib/abis/ERC20.json';
export { ABI_LIT, ABI_ERC20 };

@@ -15,4 +15,2 @@ "use strict";

tslib_1.__exportStar(require("./lib/interfaces/i-errors"), exports);
// ----------- ENUMS -----------
tslib_1.__exportStar(require("./lib/enums"), exports);
// ----------- Errors -----------

@@ -23,6 +21,6 @@ tslib_1.__exportStar(require("./lib/errors"), exports);

// ----------- ABIs -----------
const ABI_ERC20 = require("./lib/abis/ERC20.json");
exports.ABI_ERC20 = ABI_ERC20;
const ABI_LIT = require("./lib/abis/LIT.json");
exports.ABI_LIT = ABI_LIT;
const ABI_ERC20 = require("./lib/abis/ERC20.json");
exports.ABI_ERC20 = ABI_ERC20;
//# sourceMappingURL=index.js.map

@@ -20,5 +20,5 @@ "use strict";

],
litNetwork: 'internalDev',
litNetwork: 'custom',
connectTimeout: 20000,
};
//# sourceMappingURL=autogen_internal.js.map
import { LITChain, LITCosmosChain, LITEVMChain, LITSVMChain } from '@lit-protocol/types';
import { LitNetwork } from '../enums';
/**

@@ -23,2 +22,39 @@ * Lit Protocol Network Public Key

*/
export declare const METAMASK_CHAIN_INFO: {
/**
* Information about the "chronicle" chain.
*/
chronicle: {
chainId: number;
chainName: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpcUrls: string[];
blockExplorerUrls: string[];
iconUrls: string[];
};
/**
* Information about the "chronicleYellowstone" chain.
*/
yellowstone: {
chainId: number;
chainName: string;
nativeCurrency: {
name: string;
symbol: string;
decimals: number;
};
rpcUrls: string[];
blockExplorerUrls: string[];
iconUrls: string[];
};
};
/**
* @deprecated Will be removed - Use METAMASK_CHAIN_INFO instead
* Alias for {@link METAMASK_CHAIN_INFO}. Added for backwards compatibility.
* See {@link METAMASK_CHAIN_INFO}
*/
export declare const metamaskChainInfo: {

@@ -79,12 +115,25 @@ /**

export declare const LIT_NETWORK: {
Cayenne: string;
Manzano: string;
Habanero: string;
DatilDev: string;
DatilTest: string;
Datil: string;
Custom: string;
Localhost: string;
readonly Cayenne: "cayenne";
readonly Manzano: "manzano";
readonly Habanero: "habanero";
readonly DatilDev: "datil-dev";
readonly DatilTest: "datil-test";
readonly Datil: "datil";
readonly Custom: "custom";
};
/**
* @deprecated Will be removed. - Use LIT_NETWORK instead
* Alias for LIT_NETWORK. Added for backwards compatibility.
* See {@link LIT_NETWORK}
*/
export declare const LitNetwork: {
readonly Cayenne: "cayenne";
readonly Manzano: "manzano";
readonly Habanero: "habanero";
readonly DatilDev: "datil-dev";
readonly DatilTest: "datil-test";
readonly Datil: "datil";
readonly Custom: "custom";
};
/**
* The type representing the keys of the LIT_NETWORK object.

@@ -95,2 +144,3 @@ */

* The type representing the values of the LIT_NETWORK object.
* This should replicate LIT_NETWORKS_KEYS in types package
*/

@@ -174,6 +224,3 @@ export declare type LIT_NETWORK_VALUES = (typeof LIT_NETWORK)[keyof typeof LIT_NETWORK];

export declare const LIT_NETWORKS: {
[key in LitNetwork]: string[];
} & {
localhost: string[];
internalDev: string[];
[key in LIT_NETWORK_VALUES]: string[];
};

@@ -210,1 +257,307 @@ export declare const LIT_SESSION_KEY_URI = "lit:session:";

export declare const LIT_ACTION_IPFS_HASH = "QmUjX8MW6StQ7NKNdaS6g4RMkvN5hcgtKmEi8Mca6oX4t3";
export declare const VMTYPE: {
readonly EVM: "EVM";
readonly SVM: "SVM";
readonly CVM: "CVM";
};
export declare type VMTYPE_TYPE = keyof typeof VMTYPE;
export declare type VMTYPE_VALUES = (typeof VMTYPE)[keyof typeof VMTYPE];
export declare const LIT_CURVE: {
readonly BLS: "BLS";
readonly EcdsaK256: "K256";
readonly EcdsaCaitSith: "ECDSA_CAIT_SITH";
readonly EcdsaCAITSITHP256: "EcdsaCaitSithP256";
};
export declare type LIT_CURVE_TYPE = keyof typeof LIT_CURVE;
export declare type LIT_CURVE_VALUES = (typeof LIT_CURVE)[keyof typeof LIT_CURVE];
export declare const EITHER_TYPE: {
readonly ERROR: "ERROR";
readonly SUCCESS: "SUCCESS";
};
export declare type EITHER_TYPE_TYPE = keyof typeof EITHER_TYPE;
export declare type EITHER_TYPE_VALUES = (typeof EITHER_TYPE)[keyof typeof EITHER_TYPE];
export declare const AUTH_METHOD_TYPE: {
readonly EthWallet: 1;
readonly LitAction: 2;
readonly WebAuthn: 3;
readonly Discord: 4;
readonly Google: 5;
readonly GoogleJwt: 6;
readonly AppleJwt: 8;
readonly StytchOtp: 9;
readonly StytchEmailFactorOtp: 10;
readonly StytchSmsFactorOtp: 11;
readonly StytchWhatsAppFactorOtp: 12;
readonly StytchTotpFactorOtp: 13;
};
export declare type AUTH_METHOD_TYPE_TYPE = keyof typeof AUTH_METHOD_TYPE;
export declare type AUTH_METHOD_TYPE_VALUES = (typeof AUTH_METHOD_TYPE)[keyof typeof AUTH_METHOD_TYPE];
/**
* @deprecated Will be removed - Use AUTH_METHOD_TYPE instead
* Alias for AUTH_METHOD_TYPE. Added for backwards compatibility.
* See {@link AUTH_METHOD_TYPE}
*/
export declare const AuthMethodType: {
readonly EthWallet: 1;
readonly LitAction: 2;
readonly WebAuthn: 3;
readonly Discord: 4;
readonly Google: 5;
readonly GoogleJwt: 6;
readonly AppleJwt: 8;
readonly StytchOtp: 9;
readonly StytchEmailFactorOtp: 10;
readonly StytchSmsFactorOtp: 11;
readonly StytchWhatsAppFactorOtp: 12;
readonly StytchTotpFactorOtp: 13;
};
export declare const AUTH_METHOD_SCOPE: {
readonly NoPermissions: 0;
readonly SignAnything: 1;
readonly PersonalSign: 2;
};
export declare type AUTH_METHOD_SCOPE_TYPE = keyof typeof AUTH_METHOD_SCOPE;
export declare type AUTH_METHOD_SCOPE_VALUES = (typeof AUTH_METHOD_SCOPE)[keyof typeof AUTH_METHOD_SCOPE];
/**
* @deprecated Will be removed - Use AUTH_METHOD_SCOPE instead
* Alias for AUTH_METHOD_SCOPE. Added for backwards compatibility.
* See {@link AUTH_METHOD_SCOPE}
*/
export declare const AuthMethodScope: {
readonly NoPermissions: 0;
readonly SignAnything: 1;
readonly PersonalSign: 2;
};
export declare const PROVIDER_TYPE: {
readonly Discord: "discord";
readonly Google: "google";
readonly EthWallet: "ethwallet";
readonly WebAuthn: "webauthn";
readonly Apple: "apple";
readonly StytchOtp: "stytchOtp";
readonly StytchEmailFactorOtp: "stytchEmailFactorOtp";
readonly StytchSmsFactorOtp: "stytchSmsFactorOtp";
readonly StytchWhatsAppFactorOtp: "stytchWhatsAppFactorOtp";
readonly StytchTotpFactor: "stytchTotpFactor";
};
export declare type PROVIDER_TYPE_TYPE = keyof typeof PROVIDER_TYPE;
export declare type PROVIDER_TYPE_VALUES = (typeof PROVIDER_TYPE)[keyof typeof PROVIDER_TYPE];
/**
* @deprecated Will be removed - Use PROVIDER_TYPE instead
* Alias for PROVIDER_TYPE. Added for backwards compatibility.
* See {@link PROVIDER_TYPE}
*/
export declare const ProviderType: {
readonly Discord: "discord";
readonly Google: "google";
readonly EthWallet: "ethwallet";
readonly WebAuthn: "webauthn";
readonly Apple: "apple";
readonly StytchOtp: "stytchOtp";
readonly StytchEmailFactorOtp: "stytchEmailFactorOtp";
readonly StytchSmsFactorOtp: "stytchSmsFactorOtp";
readonly StytchWhatsAppFactorOtp: "stytchWhatsAppFactorOtp";
readonly StytchTotpFactor: "stytchTotpFactor";
};
export declare const STAKING_STATES: {
readonly Active: 0;
readonly NextValidatorSetLocked: 1;
readonly ReadyForNextEpoch: 2;
readonly Unlocked: 3;
readonly Paused: 4;
readonly Restore: 5;
};
export declare type STAKING_STATES_TYPE = keyof typeof STAKING_STATES;
export declare type STAKING_STATES_VALUES = (typeof STAKING_STATES)[keyof typeof STAKING_STATES];
/**
* @deprecated Will be removed - Use STAKING_STATES instead
* Alias for STAKING_STATES. Added for backwards compatibility.
* See {@link STAKING_STATES}
*/
export declare const StakingStates: {
readonly Active: 0;
readonly NextValidatorSetLocked: 1;
readonly ReadyForNextEpoch: 2;
readonly Unlocked: 3;
readonly Paused: 4;
readonly Restore: 5;
};
export declare const RELAY_AUTH_STATUS: {
readonly InProgress: "InProgress";
readonly Succeeded: "Succeeded";
readonly Failed: "Failed";
};
export declare type RELAY_AUTH_STATUS_TYPE = keyof typeof RELAY_AUTH_STATUS;
export declare type RELAY_AUTH_STATUS_VALUES = (typeof RELAY_AUTH_STATUS)[keyof typeof RELAY_AUTH_STATUS];
/**
* @deprecated Will be removed - Use RELAY_AUTH_STATUS instead
* Alias for RELAY_AUTH_STATUS. Added for backwards compatibility.
* See {@link RELAY_AUTH_STATUS}
*/
export declare const RelayAuthStatus: {
readonly InProgress: "InProgress";
readonly Succeeded: "Succeeded";
readonly Failed: "Failed";
};
/**
* Prefixes used for identifying various LIT resources.
*
* @description These resource prefixes are also used as valid IRI schemes.
*/
export declare const LIT_RESOURCE_PREFIX: {
readonly AccessControlCondition: "lit-accesscontrolcondition";
readonly PKP: "lit-pkp";
readonly RLI: "lit-ratelimitincrease";
readonly LitAction: "lit-litaction";
};
export declare type LIT_RESOURCE_PREFIX_TYPE = keyof typeof LIT_RESOURCE_PREFIX;
export declare type LIT_RESOURCE_PREFIX_VALUES = (typeof LIT_RESOURCE_PREFIX)[keyof typeof LIT_RESOURCE_PREFIX];
/**
* @deprecated Will be removed - Use LIT_RESOURCE_PREFIX instead
* Alias for LIT_RESOURCE_PREFIX. Added for backwards compatibility.
* See {@link LIT_RESOURCE_PREFIX}
*/
export declare const LitResourcePrefix: {
readonly AccessControlCondition: "lit-accesscontrolcondition";
readonly PKP: "lit-pkp";
readonly RLI: "lit-ratelimitincrease";
readonly LitAction: "lit-litaction";
};
/**
* User-facing abilities that can be granted to a session.
*/
export declare const LIT_ABILITY: {
/**
* This is the ability to process an encryption access control condition.
* The resource will specify the corresponding hashed key value of the
* access control condition.
*/
readonly AccessControlConditionDecryption: "access-control-condition-decryption";
/**
* This is the ability to process a signing access control condition.
* The resource will specify the corresponding hashed key value of the
* access control condition.
*/
readonly AccessControlConditionSigning: "access-control-condition-signing";
/**
* This is the ability to use a PKP for signing purposes. The resource will specify
* the corresponding PKP token ID.
*/
readonly PKPSigning: "pkp-signing";
/**
* This is the ability to use a Rate Limit Increase (Capacity Credits NFT) token during
* authentication with the nodes. The resource will specify the corresponding
* Capacity Credits NFT token ID.
*/
readonly RateLimitIncreaseAuth: "rate-limit-increase-auth";
/**
* This is the ability to execute a Lit Action. The resource will specify the
* corresponding Lit Action IPFS CID.
*/
readonly LitActionExecution: "lit-action-execution";
};
export declare type LIT_ABILITY_TYPE = keyof typeof LIT_ABILITY;
export declare type LIT_ABILITY_VALUES = (typeof LIT_ABILITY)[keyof typeof LIT_ABILITY];
/**
* @deprecated Will be removed - Use LIT_ABILITY instead
* Alias for LIT_ABILITY. Added for backwards compatibility.
* See {@link LIT_ABILITY}
*/
export declare const LitAbility: {
/**
* This is the ability to process an encryption access control condition.
* The resource will specify the corresponding hashed key value of the
* access control condition.
*/
readonly AccessControlConditionDecryption: "access-control-condition-decryption";
/**
* This is the ability to process a signing access control condition.
* The resource will specify the corresponding hashed key value of the
* access control condition.
*/
readonly AccessControlConditionSigning: "access-control-condition-signing";
/**
* This is the ability to use a PKP for signing purposes. The resource will specify
* the corresponding PKP token ID.
*/
readonly PKPSigning: "pkp-signing";
/**
* This is the ability to use a Rate Limit Increase (Capacity Credits NFT) token during
* authentication with the nodes. The resource will specify the corresponding
* Capacity Credits NFT token ID.
*/
readonly RateLimitIncreaseAuth: "rate-limit-increase-auth";
/**
* This is the ability to execute a Lit Action. The resource will specify the
* corresponding Lit Action IPFS CID.
*/
readonly LitActionExecution: "lit-action-execution";
};
/**
* LIT specific abilities mapped into the Recap specific terminology
* of an 'ability'.
*/
export declare const LIT_RECAP_ABILITY: {
readonly Decryption: "Decryption";
readonly Signing: "Signing";
readonly Auth: "Auth";
readonly Execution: "Execution";
};
export declare type LIT_RECAP_ABILITY_TYPE = keyof typeof LIT_RECAP_ABILITY;
export declare type LIT_RECAP_ABILITY_VALUES = (typeof LIT_RECAP_ABILITY)[keyof typeof LIT_RECAP_ABILITY];
/**
* @deprecated Will be removed - Use LIT_RECAP_ABILITY instead
* Alias for LIT_RECAP_ABILITY. Added for backwards compatibility.
* See {@link LIT_RECAP_ABILITY}
*/
export declare const LitRecapAbility: {
readonly Decryption: "Decryption";
readonly Signing: "Signing";
readonly Auth: "Auth";
readonly Execution: "Execution";
};
export declare const LIT_NAMESPACE: {
readonly Auth: "Auth";
readonly Threshold: "Threshold";
};
export declare type LIT_NAMESPACE_TYPE = keyof typeof LIT_NAMESPACE;
export declare type LIT_NAMESPACE_VALUES = (typeof LIT_NAMESPACE)[keyof typeof LIT_NAMESPACE];
/**
* @deprecated Will be removed - Use LIT_NAMESPACE instead
* Alias for LIT_NAMESPACE. Added for backwards compatibility.
* See {@link LIT_NAMESPACE}
*/
export declare const LitNamespace: {
readonly Auth: "Auth";
readonly Threshold: "Threshold";
};
/**
* SDK Logger levels
*/
export declare const LOG_LEVEL: {
readonly INFO: 0;
readonly DEBUG: 1;
readonly WARN: 2;
readonly ERROR: 3;
readonly FATAL: 4;
readonly TIMING_START: 5;
readonly TIMING_END: 6;
readonly OFF: -1;
};
export declare type LOG_LEVEL_TYPE = keyof typeof LOG_LEVEL;
export declare type LOG_LEVEL_VALUES = (typeof LOG_LEVEL)[keyof typeof LOG_LEVEL];
/**
* @deprecated Will be removed - Use LOG_LEVEL instead
* Alias for LOG_LEVEL. Added for backwards compatibility.
* See {@link LOG_LEVEL}
*/
export declare const LogLevel: {
readonly INFO: 0;
readonly DEBUG: 1;
readonly WARN: 2;
readonly ERROR: 3;
readonly FATAL: 4;
readonly TIMING_START: 5;
readonly TIMING_END: 6;
readonly OFF: -1;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LIT_ACTION_IPFS_HASH = exports.RELAY_URL_DATIL_TEST = exports.RELAY_URL_DATIL_DEV = exports.RELAY_URL_MANZANO = exports.RELAY_URL_HABANERO = exports.RELAY_URL_CAYENNE = exports.SIWE_DELEGATION_URI = exports.PKP_CLIENT_SUPPORTED_CHAINS = exports.AUTH_METHOD_TYPE_IDS = exports.LIT_SESSION_KEY_URI = exports.LIT_NETWORKS = exports.CAYENNE_URL = exports.SYMM_KEY_ALGO_PARAMS = exports.LOCAL_STORAGE_KEYS = exports.ALL_LIT_CHAINS = exports.LIT_COSMOS_CHAINS = exports.LIT_SVM_CHAINS = exports.CENTRALISATION_BY_NETWORK = exports.HTTP_BY_NETWORK = exports.HTTPS = exports.HTTP = exports.METAMASK_CHAIN_INFO_BY_NETWORK = exports.RELAYER_URL_BY_NETWORK = exports.RPC_URL_BY_NETWORK = exports.LIT_NETWORK = exports.LIT_EVM_CHAINS = exports.LIT_RPC = exports.metamaskChainInfo = exports.LIT_CHAIN_RPC_URL = exports.LIT_CHAINS = exports.AUTH_SIGNATURE_BODY = exports.LIT_AUTH_SIG_CHAIN_KEYS = exports.NETWORK_PUB_KEY = void 0;
const autogen_internal_1 = require("./autogen_internal");
const enums_1 = require("../enums");
exports.LitResourcePrefix = exports.LIT_RESOURCE_PREFIX = exports.RelayAuthStatus = exports.RELAY_AUTH_STATUS = exports.StakingStates = exports.STAKING_STATES = exports.ProviderType = exports.PROVIDER_TYPE = exports.AuthMethodScope = exports.AUTH_METHOD_SCOPE = exports.AuthMethodType = exports.AUTH_METHOD_TYPE = exports.EITHER_TYPE = exports.LIT_CURVE = exports.VMTYPE = exports.LIT_ACTION_IPFS_HASH = exports.RELAY_URL_DATIL_TEST = exports.RELAY_URL_DATIL_DEV = exports.RELAY_URL_MANZANO = exports.RELAY_URL_HABANERO = exports.RELAY_URL_CAYENNE = exports.SIWE_DELEGATION_URI = exports.PKP_CLIENT_SUPPORTED_CHAINS = exports.AUTH_METHOD_TYPE_IDS = exports.LIT_SESSION_KEY_URI = exports.LIT_NETWORKS = exports.CAYENNE_URL = exports.SYMM_KEY_ALGO_PARAMS = exports.LOCAL_STORAGE_KEYS = exports.ALL_LIT_CHAINS = exports.LIT_COSMOS_CHAINS = exports.LIT_SVM_CHAINS = exports.CENTRALISATION_BY_NETWORK = exports.HTTP_BY_NETWORK = exports.HTTPS = exports.HTTP = exports.METAMASK_CHAIN_INFO_BY_NETWORK = exports.RELAYER_URL_BY_NETWORK = exports.RPC_URL_BY_NETWORK = exports.LitNetwork = exports.LIT_NETWORK = exports.LIT_EVM_CHAINS = exports.LIT_RPC = exports.metamaskChainInfo = exports.METAMASK_CHAIN_INFO = exports.LIT_CHAIN_RPC_URL = exports.LIT_CHAINS = exports.AUTH_SIGNATURE_BODY = exports.LIT_AUTH_SIG_CHAIN_KEYS = exports.NETWORK_PUB_KEY = void 0;
exports.LogLevel = exports.LOG_LEVEL = exports.LitNamespace = exports.LIT_NAMESPACE = exports.LitRecapAbility = exports.LIT_RECAP_ABILITY = exports.LitAbility = exports.LIT_ABILITY = void 0;
/**

@@ -614,3 +613,3 @@ * Lit Protocol Network Public Key

*/
exports.metamaskChainInfo = {
exports.METAMASK_CHAIN_INFO = {
/**

@@ -648,2 +647,8 @@ * Information about the "chronicle" chain.

/**
* @deprecated Will be removed - Use METAMASK_CHAIN_INFO instead
* Alias for {@link METAMASK_CHAIN_INFO}. Added for backwards compatibility.
* See {@link METAMASK_CHAIN_INFO}
*/
exports.metamaskChainInfo = exports.METAMASK_CHAIN_INFO;
/**
* Constants representing the available LIT RPC endpoints.

@@ -678,5 +683,10 @@ */

Custom: 'custom',
Localhost: 'localhost',
};
/**
* @deprecated Will be removed. - Use LIT_NETWORK instead
* Alias for LIT_NETWORK. Added for backwards compatibility.
* See {@link LIT_NETWORK}
*/
exports.LitNetwork = exports.LIT_NETWORK;
/**
* RPC URL by Network

@@ -694,3 +704,2 @@ *

custom: exports.LIT_RPC.LOCAL_ANVIL,
localhost: exports.LIT_RPC.LOCAL_ANVIL,
};

@@ -708,3 +717,2 @@ /**

custom: 'http://localhost:3000',
localhost: 'http://localhost:3000',
};

@@ -722,3 +730,2 @@ /**

custom: exports.metamaskChainInfo.yellowstone,
localhost: exports.metamaskChainInfo.yellowstone,
};

@@ -736,5 +743,4 @@ exports.HTTP = 'http://';

'datil-test': exports.HTTPS,
internalDev: exports.HTTPS,
custom: exports.HTTP,
localhost: exports.HTTP, // default, can be changed by config
datil: exports.HTTPS,
custom: exports.HTTP, // default, can be changed by config
};

@@ -752,3 +758,2 @@ /**

custom: 'unknown',
localhost: 'unknown',
};

@@ -896,23 +901,9 @@ /**

exports.LIT_NETWORKS = {
[enums_1.LitNetwork.Cayenne]: [],
[enums_1.LitNetwork.Manzano]: [],
[enums_1.LitNetwork.DatilDev]: [],
[enums_1.LitNetwork.DatilTest]: [],
[enums_1.LitNetwork.Datil]: [],
[enums_1.LitNetwork.Habanero]: [],
[enums_1.LitNetwork.Custom]: [],
// FIXME: Remove localhost and internalDev; replaced with 'custom' type networks
localhost: [
'http://localhost:7470',
'http://localhost:7471',
'http://localhost:7472',
'http://localhost:7473',
'http://localhost:7474',
'http://localhost:7475',
'http://localhost:7476',
'http://localhost:7477',
'http://localhost:7478',
'http://localhost:7479',
],
internalDev: autogen_internal_1.INTERNAL_DEV,
cayenne: [],
manzano: [],
'datil-dev': [],
'datil-test': [],
datil: [],
habanero: [],
custom: [],
};

@@ -954,2 +945,199 @@ // ========== Lit Sessions ==========

exports.LIT_ACTION_IPFS_HASH = 'QmUjX8MW6StQ7NKNdaS6g4RMkvN5hcgtKmEi8Mca6oX4t3';
// ========== Chains ==========
exports.VMTYPE = {
EVM: 'EVM',
SVM: 'SVM',
CVM: 'CVM',
};
exports.LIT_CURVE = {
BLS: 'BLS',
EcdsaK256: 'K256',
EcdsaCaitSith: 'ECDSA_CAIT_SITH',
EcdsaCAITSITHP256: 'EcdsaCaitSithP256',
};
// ========== Either Types ==========
exports.EITHER_TYPE = {
ERROR: 'ERROR',
SUCCESS: 'SUCCESS',
};
// ========== Supported PKP Auth Method Types ==========
exports.AUTH_METHOD_TYPE = {
EthWallet: 1,
LitAction: 2,
WebAuthn: 3,
Discord: 4,
Google: 5,
GoogleJwt: 6,
AppleJwt: 8,
StytchOtp: 9,
StytchEmailFactorOtp: 10,
StytchSmsFactorOtp: 11,
StytchWhatsAppFactorOtp: 12,
StytchTotpFactorOtp: 13,
};
/**
* @deprecated Will be removed - Use AUTH_METHOD_TYPE instead
* Alias for AUTH_METHOD_TYPE. Added for backwards compatibility.
* See {@link AUTH_METHOD_TYPE}
*/
exports.AuthMethodType = exports.AUTH_METHOD_TYPE;
// ========== Supported PKP Auth Method Scopes ==========
exports.AUTH_METHOD_SCOPE = {
NoPermissions: 0,
SignAnything: 1,
PersonalSign: 2,
};
/**
* @deprecated Will be removed - Use AUTH_METHOD_SCOPE instead
* Alias for AUTH_METHOD_SCOPE. Added for backwards compatibility.
* See {@link AUTH_METHOD_SCOPE}
*/
exports.AuthMethodScope = exports.AUTH_METHOD_SCOPE;
// ========== Supported Provider Types ==========
exports.PROVIDER_TYPE = {
Discord: 'discord',
Google: 'google',
EthWallet: 'ethwallet',
WebAuthn: 'webauthn',
Apple: 'apple',
StytchOtp: 'stytchOtp',
StytchEmailFactorOtp: 'stytchEmailFactorOtp',
StytchSmsFactorOtp: 'stytchSmsFactorOtp',
StytchWhatsAppFactorOtp: 'stytchWhatsAppFactorOtp',
StytchTotpFactor: 'stytchTotpFactor',
};
/**
* @deprecated Will be removed - Use PROVIDER_TYPE instead
* Alias for PROVIDER_TYPE. Added for backwards compatibility.
* See {@link PROVIDER_TYPE}
*/
exports.ProviderType = exports.PROVIDER_TYPE;
// ========== Supported Staking States ==========
exports.STAKING_STATES = {
Active: 0,
NextValidatorSetLocked: 1,
ReadyForNextEpoch: 2,
Unlocked: 3,
Paused: 4,
Restore: 5,
};
/**
* @deprecated Will be removed - Use STAKING_STATES instead
* Alias for STAKING_STATES. Added for backwards compatibility.
* See {@link STAKING_STATES}
*/
exports.StakingStates = exports.STAKING_STATES;
// ========== Relay Auth Status ==========
exports.RELAY_AUTH_STATUS = {
InProgress: 'InProgress',
Succeeded: 'Succeeded',
Failed: 'Failed',
};
/**
* @deprecated Will be removed - Use RELAY_AUTH_STATUS instead
* Alias for RELAY_AUTH_STATUS. Added for backwards compatibility.
* See {@link RELAY_AUTH_STATUS}
*/
exports.RelayAuthStatus = exports.RELAY_AUTH_STATUS;
/**
* Prefixes used for identifying various LIT resources.
*
* @description These resource prefixes are also used as valid IRI schemes.
*/
exports.LIT_RESOURCE_PREFIX = {
AccessControlCondition: 'lit-accesscontrolcondition',
PKP: 'lit-pkp',
RLI: 'lit-ratelimitincrease',
LitAction: 'lit-litaction',
};
/**
* @deprecated Will be removed - Use LIT_RESOURCE_PREFIX instead
* Alias for LIT_RESOURCE_PREFIX. Added for backwards compatibility.
* See {@link LIT_RESOURCE_PREFIX}
*/
exports.LitResourcePrefix = exports.LIT_RESOURCE_PREFIX;
/**
* User-facing abilities that can be granted to a session.
*/
exports.LIT_ABILITY = {
/**
* This is the ability to process an encryption access control condition.
* The resource will specify the corresponding hashed key value of the
* access control condition.
*/
AccessControlConditionDecryption: 'access-control-condition-decryption',
/**
* This is the ability to process a signing access control condition.
* The resource will specify the corresponding hashed key value of the
* access control condition.
*/
AccessControlConditionSigning: 'access-control-condition-signing',
/**
* This is the ability to use a PKP for signing purposes. The resource will specify
* the corresponding PKP token ID.
*/
PKPSigning: 'pkp-signing',
/**
* This is the ability to use a Rate Limit Increase (Capacity Credits NFT) token during
* authentication with the nodes. The resource will specify the corresponding
* Capacity Credits NFT token ID.
*/
RateLimitIncreaseAuth: 'rate-limit-increase-auth',
/**
* This is the ability to execute a Lit Action. The resource will specify the
* corresponding Lit Action IPFS CID.
*/
LitActionExecution: 'lit-action-execution',
};
/**
* @deprecated Will be removed - Use LIT_ABILITY instead
* Alias for LIT_ABILITY. Added for backwards compatibility.
* See {@link LIT_ABILITY}
*/
exports.LitAbility = exports.LIT_ABILITY;
/**
* LIT specific abilities mapped into the Recap specific terminology
* of an 'ability'.
*/
exports.LIT_RECAP_ABILITY = {
Decryption: 'Decryption',
Signing: 'Signing',
Auth: 'Auth',
Execution: 'Execution',
};
/**
* @deprecated Will be removed - Use LIT_RECAP_ABILITY instead
* Alias for LIT_RECAP_ABILITY. Added for backwards compatibility.
* See {@link LIT_RECAP_ABILITY}
*/
exports.LitRecapAbility = exports.LIT_RECAP_ABILITY;
exports.LIT_NAMESPACE = {
Auth: 'Auth',
Threshold: 'Threshold',
};
/**
* @deprecated Will be removed - Use LIT_NAMESPACE instead
* Alias for LIT_NAMESPACE. Added for backwards compatibility.
* See {@link LIT_NAMESPACE}
*/
exports.LitNamespace = exports.LIT_NAMESPACE;
/**
* SDK Logger levels
*/
exports.LOG_LEVEL = {
INFO: 0,
DEBUG: 1,
WARN: 2,
ERROR: 3,
FATAL: 4,
TIMING_START: 5,
TIMING_END: 6,
OFF: -1,
};
/**
* @deprecated Will be removed - Use LOG_LEVEL instead
* Alias for LOG_LEVEL. Added for backwards compatibility.
* See {@link LOG_LEVEL}
*/
exports.LogLevel = exports.LOG_LEVEL;
//# sourceMappingURL=constants.js.map

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

export declare enum LIT_ENDPOINT_VERSION {
V0 = "/",
V1 = "/v1"
}
export declare const LIT_ENDPOINT_VERSION: {
V0: string;
V1: string;
};
export declare const LIT_ENDPOINT: {
HANDSHAKE: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
SIGN_SESSION_KEY: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
EXECUTE_JS: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
PKP_SIGN: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
PKP_CLAIM: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
SIGN_ACCS: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
ENCRYPTION_SIGN: {
path: string;
version: LIT_ENDPOINT_VERSION;
version: string;
};
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LIT_ENDPOINT = exports.LIT_ENDPOINT_VERSION = void 0;
var LIT_ENDPOINT_VERSION;
(function (LIT_ENDPOINT_VERSION) {
LIT_ENDPOINT_VERSION["V0"] = "/";
LIT_ENDPOINT_VERSION["V1"] = "/v1";
})(LIT_ENDPOINT_VERSION = exports.LIT_ENDPOINT_VERSION || (exports.LIT_ENDPOINT_VERSION = {}));
exports.LIT_ENDPOINT_VERSION = {
V0: '/',
V1: '/v1',
};
exports.LIT_ENDPOINT = {
HANDSHAKE: {
path: '/web/handshake',
version: LIT_ENDPOINT_VERSION.V0,
version: exports.LIT_ENDPOINT_VERSION.V0,
},
SIGN_SESSION_KEY: {
path: '/web/sign_session_key',
version: LIT_ENDPOINT_VERSION.V1,
version: exports.LIT_ENDPOINT_VERSION.V1,
},
EXECUTE_JS: {
path: '/web/execute',
version: LIT_ENDPOINT_VERSION.V1,
version: exports.LIT_ENDPOINT_VERSION.V1,
},
PKP_SIGN: {
path: '/web/pkp/sign',
version: LIT_ENDPOINT_VERSION.V1,
version: exports.LIT_ENDPOINT_VERSION.V1,
},
PKP_CLAIM: {
path: '/web/pkp/claim',
version: LIT_ENDPOINT_VERSION.V0,
version: exports.LIT_ENDPOINT_VERSION.V0,
},
SIGN_ACCS: {
path: '/web/signing/access_control_condition',
version: LIT_ENDPOINT_VERSION.V0,
version: exports.LIT_ENDPOINT_VERSION.V0,
},
ENCRYPTION_SIGN: {
path: '/web/encryption/sign',
version: LIT_ENDPOINT_VERSION.V0,
version: exports.LIT_ENDPOINT_VERSION.V0,
},
};
//# sourceMappingURL=endpoints.js.map

@@ -12,3 +12,3 @@ import { LIT_NETWORK_VALUES } from './constants';

export declare const GENERAL_WORKER_URL_BY_NETWORK: {
[key in LIT_NETWORK_VALUES]: string;
[key in Exclude<LIT_NETWORK_VALUES, 'datil'>]: string;
};

@@ -15,5 +15,4 @@ "use strict";

datil: contracts_1.datil,
// just use datil dev abis for custom and localhost
// just use datil dev abis for custom
custom: contracts_1.datilDev,
localhost: contracts_1.datilDev,
};

@@ -29,6 +28,5 @@ /**

'datil-test': 'https://apis.getlit.dev/datil-test/contracts',
// just use cayenne abis for custom and localhost
// just use cayenne abis for custom
custom: 'https://apis.getlit.dev/cayenne/contracts',
localhost: 'https://apis.getlit.dev/cayenne/contracts',
};
//# sourceMappingURL=mappers.js.map

@@ -1,171 +0,44 @@

export declare enum LitErrorKind {
Unknown = "Unknown",
Unexpected = "Unexpected",
Generic = "Generic",
Config = "Config",
Validation = "Validation",
Conversion = "Conversion",
Parser = "Parser",
Serializer = "Serializer",
Timeout = "Timeout"
import { VError, Options } from '@openagenda/verror';
export declare const LIT_ERROR_KIND: {
readonly Unknown: "Unknown";
readonly Unexpected: "Unexpected";
readonly Generic: "Generic";
readonly Config: "Config";
readonly Validation: "Validation";
readonly Conversion: "Conversion";
readonly Parser: "Parser";
readonly Serializer: "Serializer";
readonly Timeout: "Timeout";
};
/**
* @deprecated Will be removed - Use LIT_ERROR_KIND instead
* Alias for LIT_ERROR_KIND. Added for backwards compatibility.
* See {@link LIT_ERROR_KIND}
*/
export declare const LitErrorKind: {
readonly Unknown: "Unknown";
readonly Unexpected: "Unexpected";
readonly Generic: "Generic";
readonly Config: "Config";
readonly Validation: "Validation";
readonly Conversion: "Conversion";
readonly Parser: "Parser";
readonly Serializer: "Serializer";
readonly Timeout: "Timeout";
};
interface ErrorConfig {
name: string;
code: string;
kind: (typeof LIT_ERROR_KIND)[keyof typeof LIT_ERROR_KIND];
}
export declare const LIT_ERROR: {
INVALID_PARAM_TYPE: {
name: string;
code: string;
kind: LitErrorKind;
};
INVALID_ACCESS_CONTROL_CONDITIONS: {
name: string;
code: string;
kind: LitErrorKind;
};
WRONG_NETWORK_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
MINTING_NOT_SUPPORTED: {
name: string;
code: string;
kind: LitErrorKind;
};
UNSUPPORTED_CHAIN_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
INVALID_UNIFIED_CONDITION_TYPE: {
name: string;
code: string;
kind: LitErrorKind;
};
LIT_NODE_CLIENT_NOT_READY_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
UNAUTHROZIED_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
INVALID_ARGUMENT_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
INVALID_BOOLEAN_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
UNKNOWN_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
NO_WALLET_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
WRONG_PARAM_FORMAT: {
name: string;
code: string;
kind: LitErrorKind;
};
LOCAL_STORAGE_ITEM_NOT_FOUND_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
LOCAL_STORAGE_ITEM_NOT_SET_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
LOCAL_STORAGE_ITEM_NOT_REMOVED_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
REMOVED_FUNCTION_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
LIT_NODE_CLIENT_BAD_CONFIG_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
PARAMS_MISSING_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
UNKNOWN_SIGNATURE_TYPE: {
name: string;
code: string;
kind: LitErrorKind;
};
UNKNOWN_SIGNATURE_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
SIGNATURE_VALIDATION_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
PARAM_NULL_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
UNKNOWN_DECRYPTION_ALGORITHM_TYPE_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
WASM_INIT_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
NODEJS_EXCEPTION: {
name: string;
code: string;
kind: LitErrorKind;
};
WALLET_SIGNATURE_NOT_FOUND_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
NO_VALID_SHARES: {
name: string;
code: string;
kind: LitErrorKind;
};
INVALID_NODE_ATTESTATION: {
name: string;
code: string;
kind: LitErrorKind;
};
INVALID_ETH_BLOCKHASH: {
name: string;
code: string;
kind: LitErrorKind;
};
INIT_ERROR: {
name: string;
code: string;
kind: LitErrorKind;
};
};
export declare const LIT_ERROR: Record<string, ErrorConfig>;
export declare const LIT_ERROR_CODE: {
NODE_NOT_AUTHORIZED: string;
};
export declare abstract class LitError extends VError {
protected constructor(options: Error | Options, message: string, ...params: any[]);
}
declare type LitErrorConstructor = new (options: Error | Options, message: string, ...params: any[]) => LitError;
declare const MultiError: any;
export { MultiError };
export declare const InitError: LitErrorConstructor, InvalidAccessControlConditions: LitErrorConstructor, InvalidArgumentException: LitErrorConstructor, InvalidBooleanException: LitErrorConstructor, InvalidEthBlockhash: LitErrorConstructor, InvalidNodeAttestation: LitErrorConstructor, InvalidParamType: LitErrorConstructor, InvalidSignatureError: LitErrorConstructor, InvalidUnifiedConditionType: LitErrorConstructor, LitNodeClientBadConfigError: LitErrorConstructor, LitNodeClientNotReadyError: LitErrorConstructor, LocalStorageItemNotFoundException: LitErrorConstructor, LocalStorageItemNotRemovedException: LitErrorConstructor, LocalStorageItemNotSetException: LitErrorConstructor, MintingNotSupported: LitErrorConstructor, NetworkError: LitErrorConstructor, NoValidShares: LitErrorConstructor, NoWalletException: LitErrorConstructor, NodeError: LitErrorConstructor, NodejsException: LitErrorConstructor, ParamNullError: LitErrorConstructor, ParamsMissingError: LitErrorConstructor, RemovedFunctionError: LitErrorConstructor, TransactionError: LitErrorConstructor, UnauthorizedException: LitErrorConstructor, UnknownDecryptionAlgorithmTypeError: LitErrorConstructor, UnknownError: LitErrorConstructor, UnknownSignatureError: LitErrorConstructor, UnknownSignatureType: LitErrorConstructor, UnsupportedChainException: LitErrorConstructor, UnsupportedMethodError: LitErrorConstructor, WalletSignatureNotFoundError: LitErrorConstructor, WasmInitError: LitErrorConstructor, WrongNetworkException: LitErrorConstructor, WrongParamFormat: LitErrorConstructor;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LIT_ERROR_CODE = exports.LIT_ERROR = exports.LitErrorKind = void 0;
var LitErrorKind;
(function (LitErrorKind) {
LitErrorKind["Unknown"] = "Unknown";
LitErrorKind["Unexpected"] = "Unexpected";
LitErrorKind["Generic"] = "Generic";
LitErrorKind["Config"] = "Config";
LitErrorKind["Validation"] = "Validation";
LitErrorKind["Conversion"] = "Conversion";
LitErrorKind["Parser"] = "Parser";
LitErrorKind["Serializer"] = "Serializer";
LitErrorKind["Timeout"] = "Timeout";
})(LitErrorKind = exports.LitErrorKind || (exports.LitErrorKind = {}));
exports.WrongParamFormat = exports.WrongNetworkException = exports.WasmInitError = exports.WalletSignatureNotFoundError = exports.UnsupportedMethodError = exports.UnsupportedChainException = exports.UnknownSignatureType = exports.UnknownSignatureError = exports.UnknownError = exports.UnknownDecryptionAlgorithmTypeError = exports.UnauthorizedException = exports.TransactionError = exports.RemovedFunctionError = exports.ParamsMissingError = exports.ParamNullError = exports.NodejsException = exports.NodeError = exports.NoWalletException = exports.NoValidShares = exports.NetworkError = exports.MintingNotSupported = exports.LocalStorageItemNotSetException = exports.LocalStorageItemNotRemovedException = exports.LocalStorageItemNotFoundException = exports.LitNodeClientNotReadyError = exports.LitNodeClientBadConfigError = exports.InvalidUnifiedConditionType = exports.InvalidSignatureError = exports.InvalidParamType = exports.InvalidNodeAttestation = exports.InvalidEthBlockhash = exports.InvalidBooleanException = exports.InvalidArgumentException = exports.InvalidAccessControlConditions = exports.InitError = exports.MultiError = exports.LitError = exports.LIT_ERROR_CODE = exports.LIT_ERROR = exports.LitErrorKind = exports.LIT_ERROR_KIND = void 0;
// @ts-expect-error No types available for this package
const verror_1 = require("@openagenda/verror");
exports.LIT_ERROR_KIND = {
Unknown: 'Unknown',
Unexpected: 'Unexpected',
Generic: 'Generic',
Config: 'Config',
Validation: 'Validation',
Conversion: 'Conversion',
Parser: 'Parser',
Serializer: 'Serializer',
Timeout: 'Timeout',
};
/**
* @deprecated Will be removed - Use LIT_ERROR_KIND instead
* Alias for LIT_ERROR_KIND. Added for backwards compatibility.
* See {@link LIT_ERROR_KIND}
*/
exports.LitErrorKind = exports.LIT_ERROR_KIND;
exports.LIT_ERROR = {

@@ -20,3 +27,3 @@ INVALID_PARAM_TYPE: {

code: 'invalid_param_type',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -26,3 +33,3 @@ INVALID_ACCESS_CONTROL_CONDITIONS: {

code: 'invalid_access_control_conditions',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -32,3 +39,3 @@ WRONG_NETWORK_EXCEPTION: {

code: 'wrong_network_exception',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -38,3 +45,3 @@ MINTING_NOT_SUPPORTED: {

code: 'minting_not_supported',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -44,3 +51,3 @@ UNSUPPORTED_CHAIN_EXCEPTION: {

code: 'unsupported_chain_exception',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -50,3 +57,3 @@ INVALID_UNIFIED_CONDITION_TYPE: {

code: 'invalid_unified_condition_type',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -56,8 +63,8 @@ LIT_NODE_CLIENT_NOT_READY_ERROR: {

code: 'lit_node_client_not_ready_error',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},
UNAUTHROZIED_EXCEPTION: {
name: 'UnauthroziedException',
code: 'unauthrozied_exception',
kind: LitErrorKind.Validation,
UNAUTHORIZED_EXCEPTION: {
name: 'UnauthorizedException',
code: 'unauthorized_exception',
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -67,3 +74,3 @@ INVALID_ARGUMENT_EXCEPTION: {

code: 'invalid_argument_exception',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -73,3 +80,3 @@ INVALID_BOOLEAN_EXCEPTION: {

code: 'invalid_boolean_exception',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -79,3 +86,3 @@ UNKNOWN_ERROR: {

code: 'unknown_error',
kind: LitErrorKind.Unknown,
kind: exports.LIT_ERROR_KIND.Unknown,
},

@@ -85,3 +92,3 @@ NO_WALLET_EXCEPTION: {

code: 'no_wallet_exception',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -91,3 +98,3 @@ WRONG_PARAM_FORMAT: {

code: 'wrong_param_format',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -97,3 +104,3 @@ LOCAL_STORAGE_ITEM_NOT_FOUND_EXCEPTION: {

code: 'local_storage_item_not_found_exception',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -103,3 +110,3 @@ LOCAL_STORAGE_ITEM_NOT_SET_EXCEPTION: {

code: 'local_storage_item_not_set_exception',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -109,3 +116,3 @@ LOCAL_STORAGE_ITEM_NOT_REMOVED_EXCEPTION: {

code: 'local_storage_item_not_removed_exception',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -115,8 +122,13 @@ REMOVED_FUNCTION_ERROR: {

code: 'removed_function_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},
UNSUPPORTED_METHOD_ERROR: {
name: 'UnsupportedMethodError',
code: 'unsupported_method_error',
kind: exports.LIT_ERROR_KIND.Validation,
},
LIT_NODE_CLIENT_BAD_CONFIG_ERROR: {
name: 'LitNodeClientBadConfigError',
code: 'lit_node_client_bad_config_error',
kind: LitErrorKind.Config,
kind: exports.LIT_ERROR_KIND.Config,
},

@@ -126,3 +138,3 @@ PARAMS_MISSING_ERROR: {

code: 'params_missing_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -132,3 +144,3 @@ UNKNOWN_SIGNATURE_TYPE: {

code: 'unknown_signature_type',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -138,8 +150,8 @@ UNKNOWN_SIGNATURE_ERROR: {

code: 'unknown_signature_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},
SIGNATURE_VALIDATION_ERROR: {
INVALID_SIGNATURE_ERROR: {
name: 'InvalidSignatureError',
code: 'invalid_signature_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -149,3 +161,3 @@ PARAM_NULL_ERROR: {

code: 'param_null_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -155,3 +167,3 @@ UNKNOWN_DECRYPTION_ALGORITHM_TYPE_ERROR: {

code: 'unknown_decryption_algorithm_type_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -161,3 +173,3 @@ WASM_INIT_ERROR: {

code: 'wasm_init_error',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -167,8 +179,13 @@ NODEJS_EXCEPTION: {

code: 'nodejs_exception',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},
NODE_ERROR: {
name: 'NodeError',
code: 'node_error',
kind: exports.LitErrorKind.Unknown,
},
WALLET_SIGNATURE_NOT_FOUND_ERROR: {
name: 'WalletSignatureNotFoundError',
code: 'wallet_signature_not_found_error',
kind: LitErrorKind.Validation,
kind: exports.LIT_ERROR_KIND.Validation,
},

@@ -178,3 +195,3 @@ NO_VALID_SHARES: {

code: 'no_valid_shares',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -184,3 +201,3 @@ INVALID_NODE_ATTESTATION: {

code: 'invalid_node_attestation',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -190,3 +207,3 @@ INVALID_ETH_BLOCKHASH: {

code: 'invalid_eth_blockhash',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},

@@ -196,4 +213,14 @@ INIT_ERROR: {

code: 'init_error',
kind: LitErrorKind.Unexpected,
kind: exports.LIT_ERROR_KIND.Unexpected,
},
NETWORK_ERROR: {
name: 'NetworkError',
code: 'network_error',
kind: exports.LitErrorKind.Unexpected,
},
TRANSACTION_ERROR: {
name: 'TransactionError',
code: 'transaction_error',
kind: exports.LitErrorKind.Unexpected,
},
};

@@ -203,2 +230,44 @@ exports.LIT_ERROR_CODE = {

};
class LitError extends verror_1.VError {
constructor(options, message, ...params) {
super(options, message, ...params);
}
}
exports.LitError = LitError;
function createErrorClass({ name, code, kind, }) {
return class extends LitError {
// VError has optional options parameter, but we make it required so thrower remembers to pass all the useful info
constructor(options, message, ...params) {
if (options instanceof Error) {
options = {
cause: options,
};
}
// If the cause is not an Error, wrap it in one
if (!(options.cause instanceof Error)) {
options.cause = new Error(options.cause);
}
super({
name,
...options,
meta: {
code,
kind,
...options.meta,
},
}, message, ...params);
}
};
}
const errorClasses = {};
for (const key in exports.LIT_ERROR) {
if (key in exports.LIT_ERROR) {
const errorDef = exports.LIT_ERROR[key];
errorClasses[errorDef.name] = createErrorClass(errorDef);
}
}
// Re-export to allow MultiErrors but keep the centralized VError import here
const MultiError = verror_1.VError.MultiError;
exports.MultiError = MultiError;
exports.InitError = errorClasses.InitError, exports.InvalidAccessControlConditions = errorClasses.InvalidAccessControlConditions, exports.InvalidArgumentException = errorClasses.InvalidArgumentException, exports.InvalidBooleanException = errorClasses.InvalidBooleanException, exports.InvalidEthBlockhash = errorClasses.InvalidEthBlockhash, exports.InvalidNodeAttestation = errorClasses.InvalidNodeAttestation, exports.InvalidParamType = errorClasses.InvalidParamType, exports.InvalidSignatureError = errorClasses.InvalidSignatureError, exports.InvalidUnifiedConditionType = errorClasses.InvalidUnifiedConditionType, exports.LitNodeClientBadConfigError = errorClasses.LitNodeClientBadConfigError, exports.LitNodeClientNotReadyError = errorClasses.LitNodeClientNotReadyError, exports.LocalStorageItemNotFoundException = errorClasses.LocalStorageItemNotFoundException, exports.LocalStorageItemNotRemovedException = errorClasses.LocalStorageItemNotRemovedException, exports.LocalStorageItemNotSetException = errorClasses.LocalStorageItemNotSetException, exports.MintingNotSupported = errorClasses.MintingNotSupported, exports.NetworkError = errorClasses.NetworkError, exports.NoValidShares = errorClasses.NoValidShares, exports.NoWalletException = errorClasses.NoWalletException, exports.NodeError = errorClasses.NodeError, exports.NodejsException = errorClasses.NodejsException, exports.ParamNullError = errorClasses.ParamNullError, exports.ParamsMissingError = errorClasses.ParamsMissingError, exports.RemovedFunctionError = errorClasses.RemovedFunctionError, exports.TransactionError = errorClasses.TransactionError, exports.UnauthorizedException = errorClasses.UnauthorizedException, exports.UnknownDecryptionAlgorithmTypeError = errorClasses.UnknownDecryptionAlgorithmTypeError, exports.UnknownError = errorClasses.UnknownError, exports.UnknownSignatureError = errorClasses.UnknownSignatureError, exports.UnknownSignatureType = errorClasses.UnknownSignatureType, exports.UnsupportedChainException = errorClasses.UnsupportedChainException, exports.UnsupportedMethodError = errorClasses.UnsupportedMethodError, exports.WalletSignatureNotFoundError = errorClasses.WalletSignatureNotFoundError, exports.WasmInitError = errorClasses.WasmInitError, exports.WrongNetworkException = errorClasses.WrongNetworkException, exports.WrongParamFormat = errorClasses.WrongParamFormat;
//# sourceMappingURL=errors.js.map

@@ -1,19 +0,14 @@

import { EITHER_TYPE } from '../enums';
export interface ILitError {
message?: string;
name?: string;
errorCode?: string;
errorKind?: string;
error?: ILitErrorTypeParams;
}
export interface ILitErrorTypeParams {
name: string;
code: string;
}
import { EITHER_TYPE } from '../constants/constants';
import { LitError } from '../errors';
/**
* A standardized way to return either error or success
*/
export interface IEither<T> {
type: EITHER_TYPE.SUCCESS | EITHER_TYPE.ERROR;
result: T | ILitError;
export declare type IEither<T> = IEitherError | IEitherSuccess<T>;
export interface IEitherError {
type: typeof EITHER_TYPE.ERROR;
result: LitError;
}
export interface IEitherSuccess<T> {
type: typeof EITHER_TYPE.SUCCESS;
result: T;
}

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

import { IEither, ILitError } from '../interfaces/i-errors';
import { LitError } from '../errors';
import { IEitherSuccess, IEitherError } from '../interfaces/i-errors';
/**

@@ -6,6 +7,6 @@ *

*
* @param errorMsg is the error message
* @param error is the error encountered
* @returns { IEither }
*/
export declare function ELeft<T>(errorMsg: ILitError): IEither<T>;
export declare function ELeft(error: LitError): IEitherError;
/**

@@ -18,2 +19,2 @@ *

*/
export declare function ERight<T>(result: T): IEither<T>;
export declare function ERight<T>(result: T): IEitherSuccess<T>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ERight = exports.ELeft = void 0;
const constants_1 = require("../constants/constants");
/**

@@ -8,9 +9,9 @@ *

*
* @param errorMsg is the error message
* @param error is the error encountered
* @returns { IEither }
*/
function ELeft(errorMsg) {
function ELeft(error) {
return {
type: "ERROR" /* EITHER_TYPE.ERROR */,
result: errorMsg,
type: constants_1.EITHER_TYPE.ERROR,
result: error,
};

@@ -28,3 +29,3 @@ }

return {
type: "SUCCESS" /* EITHER_TYPE.SUCCESS */,
type: constants_1.EITHER_TYPE.SUCCESS,
result,

@@ -31,0 +32,0 @@ };

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

export declare const version = "6.4.1";
export declare const version = "6.4.2-pr-621";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = '6.4.1';
exports.version = '6.4.2-pr-621';
//# sourceMappingURL=version.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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