@lit-protocol/types
Advanced tools
Comparing version 6.4.1 to 6.4.2-pr-621
@@ -26,8 +26,6 @@ { | ||
}, | ||
"version": "6.4.1", | ||
"version": "6.4.2-pr-621", | ||
"dependencies": { | ||
"@ethersproject/abstract-provider": "5.7.0", | ||
"@lit-protocol/accs-schemas": "0.0.9", | ||
"ethers": "^5.7.1", | ||
"jszip": "^3.10.1", | ||
"siwe": "^2.0.5", | ||
@@ -34,0 +32,0 @@ "tslib": "1.14.1" |
@@ -39,3 +39,3 @@ import { DecryptRequest, DecryptResponse, EncryptSdkParams, EncryptResponse, ExecuteJsResponse, FormattedMultipleAccs, GetSignedTokenRequest, HandshakeWithNode, JsonExecutionSdkParams, JsonHandshakeResponse, LitNodeClientConfig, MultipleAccessControlConditions, NodeBlsSigningShare, NodeCommandServerKeysResponse, RejectedNodePromises, SendNodeCommand, SuccessNodePromises } from './interfaces'; | ||
*/ | ||
combineSharesAndGetJWT(signatureShares: NodeBlsSigningShare[]): string; | ||
combineSharesAndGetJWT(signatureShares: NodeBlsSigningShare[]): Promise<string>; | ||
/** | ||
@@ -87,2 +87,3 @@ * | ||
* @param { RejectedNodePromises } res | ||
* @param { string } requestId | ||
* | ||
@@ -92,3 +93,3 @@ * @returns { void } | ||
*/ | ||
_throwNodeError(res: RejectedNodePromises, requestId: string): void; | ||
_throwNodeError(res: RejectedNodePromises, requestId: string): never; | ||
/** | ||
@@ -99,2 +100,3 @@ * | ||
* @param { Array<any> } shareData from all node promises | ||
* @param { string } requestId | ||
* | ||
@@ -101,0 +103,0 @@ * @returns { string } signature |
import { Provider } from '@ethersproject/abstract-provider'; | ||
import * as JSZip from 'jszip/dist/jszip.js'; | ||
import { ILitNodeClient } from './ILitNodeClient'; | ||
@@ -75,21 +74,2 @@ import { ISessionCapabilityObject, LitResourceAbilityRequest } from './models'; | ||
/** ---------- Crypto ---------- */ | ||
export interface EncryptedZip { | ||
symmetricKey: SymmetricKey; | ||
encryptedZip: Blob; | ||
} | ||
export interface DecryptZipFileWithMetadata { | ||
decryptedFile: Uint8Array; | ||
metadata: MetadataForFile; | ||
} | ||
export interface MetadataForFile { | ||
name: string | any; | ||
type: string | any; | ||
size: string | number | any; | ||
accessControlConditions: any[] | any; | ||
evmContractConditions: any[] | any; | ||
solRpcConditions: any[] | any; | ||
unifiedAccessControlConditions: any[] | any; | ||
chain: string; | ||
dataToEncryptHash: string; | ||
} | ||
export interface EncryptedFile { | ||
@@ -407,2 +387,8 @@ encryptedFile: Blob; | ||
} | ||
export interface EncryptUint8ArrayRequest extends MultipleAccessControlConditions { | ||
/** | ||
* The uint8array that you wish to encrypt | ||
*/ | ||
dataToEncrypt: Uint8Array; | ||
} | ||
export interface EncryptStringRequest extends MultipleAccessControlConditions { | ||
@@ -414,8 +400,2 @@ /** | ||
} | ||
export interface EncryptZipRequest extends MultipleAccessControlConditions { | ||
/** | ||
* The zip that you wish to encrypt | ||
*/ | ||
zip: JSZip; | ||
} | ||
export interface EncryptFileRequest extends DecryptRequestBase { | ||
@@ -523,7 +503,7 @@ file: AcceptedFileType; | ||
export interface SuccessNodePromises<T> { | ||
success: boolean; | ||
success: true; | ||
values: T[]; | ||
} | ||
export interface RejectedNodePromises { | ||
success: boolean; | ||
success: false; | ||
error: NodeErrorV1; | ||
@@ -674,19 +654,2 @@ } | ||
} | ||
export interface EncryptFileAndZipWithMetadataProps extends MultipleAccessControlConditions { | ||
sessionSigs: SessionSigsMap; | ||
chain: string; | ||
file: File; | ||
litNodeClient: ILitNodeClient; | ||
readme: string; | ||
} | ||
export interface DecryptZipFileWithMetadataProps extends SessionSigsOrAuthSig { | ||
/** | ||
* The zip file blob with metadata inside it and the encrypted asset | ||
*/ | ||
file: File | Blob; | ||
/** | ||
* An instance of LitNodeClient that is already connected | ||
*/ | ||
litNodeClient: ILitNodeClient; | ||
} | ||
/** | ||
@@ -959,27 +922,4 @@ * Struct in rust | ||
/** | ||
* ========== LitAuthClient ========== | ||
* ========== Lit Auth Client ========== | ||
*/ | ||
export interface LitAuthClientOptions { | ||
/** | ||
* Endpoint to interact with a blockchain network. Defaults to the Lit Chronicle. | ||
*/ | ||
rpcUrl?: string; | ||
/** | ||
* Options for Lit's relay server | ||
*/ | ||
litRelayConfig?: LitRelayConfig; | ||
/** | ||
* Pass in a custom relay server | ||
*/ | ||
customRelay?: IRelay; | ||
/** | ||
* Lit Node Client | ||
*/ | ||
litNodeClient?: any; | ||
/** | ||
* If enable will turn on logging | ||
*/ | ||
debug?: boolean; | ||
litOtpConfig?: OtpProviderOptions; | ||
} | ||
export interface OtpSessionResult { | ||
@@ -1031,2 +971,20 @@ /** | ||
/** | ||
* Mint a new PKP for the given auth method | ||
* | ||
* @throws {Error} - Throws an error if no AuthMethods are given | ||
* @param {AuthMethod[]} authMethods - AuthMethods authentication methods to be added to the pkp | ||
* @param {{ pkpPermissionScopes?: number[][]; sendPkpToitself?: boolean; addPkpEthAddressAsPermittedAddress?: boolean;}} options | ||
* | ||
* @returns {Promise<{pkpTokenId?: string; pkpEthAddress?: string; pkpPublicKey?: string}>} pkp information | ||
*/ | ||
mintPKPWithAuthMethods(authMethods: AuthMethod[], options: { | ||
pkpPermissionScopes?: number[][]; | ||
sendPkpToitself?: boolean; | ||
addPkpEthAddressAsPermittedAddress?: boolean; | ||
}): Promise<{ | ||
pkpTokenId?: string; | ||
pkpEthAddress?: string; | ||
pkpPublicKey?: string; | ||
}>; | ||
/** | ||
* Poll the relay server for status of minting request | ||
@@ -1250,24 +1208,2 @@ * | ||
} | ||
export interface LoginUrlParams { | ||
/** | ||
* Auth method name | ||
*/ | ||
provider: string | null; | ||
/** | ||
* Access token | ||
*/ | ||
accessToken: string | null; | ||
/** | ||
* ID token | ||
*/ | ||
idToken: string | null; | ||
/** | ||
* OAuth state param | ||
*/ | ||
state: string | null; | ||
/** | ||
* Error codes from Lit's login server | ||
*/ | ||
error: string | null; | ||
} | ||
export interface BaseAuthenticateOptions { | ||
@@ -1274,0 +1210,0 @@ } |
import { SiweMessage } from 'siwe'; | ||
import { AuthSig } from './interfaces'; | ||
import { LitAbility, LitResourcePrefix } from './types'; | ||
export declare type PlainJSON = boolean | number | string | { | ||
@@ -12,46 +13,2 @@ [key: string]: PlainJSON; | ||
export declare type CID = string; | ||
/** | ||
* These are the user-facing abilities that can be granted to a session. | ||
*/ | ||
export declare enum 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. | ||
*/ | ||
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" | ||
} | ||
/** | ||
* Prefixes used for identifying various LIT resources. | ||
* | ||
* @description These resource prefixes are also used as valid IRI schemes. | ||
*/ | ||
export declare enum LitResourcePrefix { | ||
AccessControlCondition = "lit-accesscontrolcondition", | ||
PKP = "lit-pkp", | ||
RLI = "lit-ratelimitincrease", | ||
LitAction = "lit-litaction" | ||
} | ||
export interface ISessionCapabilityObject { | ||
@@ -58,0 +15,0 @@ get attenuations(): AttenuationsObject; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LitResourcePrefix = exports.LitAbility = void 0; | ||
/** | ||
* These are the user-facing abilities that can be granted to a session. | ||
*/ | ||
var LitAbility; | ||
(function (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. | ||
*/ | ||
LitAbility["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. | ||
*/ | ||
LitAbility["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. | ||
*/ | ||
LitAbility["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. | ||
*/ | ||
LitAbility["RateLimitIncreaseAuth"] = "rate-limit-increase-auth"; | ||
/** | ||
* This is the ability to execute a Lit Action. The resource will specify the | ||
* corresponding Lit Action IPFS CID. | ||
*/ | ||
LitAbility["LitActionExecution"] = "lit-action-execution"; | ||
})(LitAbility = exports.LitAbility || (exports.LitAbility = {})); | ||
/** | ||
* Prefixes used for identifying various LIT resources. | ||
* | ||
* @description These resource prefixes are also used as valid IRI schemes. | ||
*/ | ||
var LitResourcePrefix; | ||
(function (LitResourcePrefix) { | ||
LitResourcePrefix["AccessControlCondition"] = "lit-accesscontrolcondition"; | ||
LitResourcePrefix["PKP"] = "lit-pkp"; | ||
LitResourcePrefix["RLI"] = "lit-ratelimitincrease"; | ||
LitResourcePrefix["LitAction"] = "lit-litaction"; | ||
})(LitResourcePrefix = exports.LitResourcePrefix || (exports.LitResourcePrefix = {})); | ||
//# sourceMappingURL=models.js.map |
import * as ethers from 'ethers'; | ||
import { LPACC_EVM_ATOM, LPACC_EVM_CONTRACT, LPACC_SOL, LPACC_EVM_BASIC } from '@lit-protocol/accs-schemas'; | ||
import { AuthMethodType } from './enums'; | ||
import { AuthMethod, LitRelayConfig, SignInWithOTPParams, Signature, StytchOtpProviderOptions, WebAuthnProviderOptions, AccsOperatorParams, EthWalletProviderOptions, JsonEncryptionRetrieveRequest, JsonExecutionRequest, JsonSignChainDataRequest, JsonSigningRetrieveRequest, OAuthProviderOptions, BaseAuthenticateOptions } from './interfaces'; | ||
import { AuthMethod, LitRelayConfig, Signature, AccsOperatorParams, JsonEncryptionRetrieveRequest, JsonExecutionRequest, JsonSignChainDataRequest, JsonSigningRetrieveRequest, BaseAuthenticateOptions } from './interfaces'; | ||
export declare type ConditionType = 'solRpc' | 'evmBasic' | 'evmContract' | 'cosmos'; | ||
@@ -61,3 +60,3 @@ export declare type AccsDefaultParams = LPACC_EVM_BASIC; | ||
export declare type LITChain<T> = Record<string, T>; | ||
export declare type LIT_NETWORKS_KEYS = 'cayenne' | 'datil-dev' | 'datil-test' | 'datil' | 'localhost' | 'custom' | 'habanero' | 'manzano'; | ||
export declare type LIT_NETWORKS_KEYS = 'cayenne' | 'datil-dev' | 'datil-test' | 'datil' | 'custom' | 'habanero' | 'manzano'; | ||
export declare type SymmetricKey = Uint8Array | string | CryptoKey | BufferSource; | ||
@@ -70,3 +69,2 @@ export declare type EncryptedSymmetricKey = string | Uint8Array | any; | ||
export declare type IRelayAuthStatus = 'InProgress' | 'Succeeded' | 'Failed'; | ||
export declare type ProviderOptions = OAuthProviderOptions | EthWalletProviderOptions | SignInWithOTPParams | StytchOtpProviderOptions | WebAuthnProviderOptions; | ||
export declare type AuthenticateOptions = BaseAuthenticateOptions; | ||
@@ -96,3 +94,3 @@ /** | ||
*/ | ||
export declare type MintCallback<T = ClaimProcessor> = (response: ClaimResult<T>, network: string) => Promise<string>; | ||
export declare type MintCallback<T = ClaimProcessor> = (response: ClaimResult<T>, network: LIT_NETWORKS_KEYS) => Promise<string>; | ||
/** | ||
@@ -117,3 +115,3 @@ * Model for requesting a PKP to be claimed based on an {@link AuthMethod} identifier | ||
derivedKeyId: string; | ||
authMethodType: AuthMethodType; | ||
authMethodType: number; | ||
pubkey: string; | ||
@@ -162,1 +160,3 @@ } & (T extends 'relay' ? LitRelayConfig : { | ||
export declare type ResponseStrategy = 'leastCommon' | 'mostCommon' | 'custom'; | ||
export declare type LitResourcePrefix = 'lit-accesscontrolcondition' | 'lit-pkp' | 'lit-ratelimitincrease' | 'lit-litaction'; | ||
export declare type LitAbility = 'access-control-condition-decryption' | 'access-control-condition-signing' | 'pkp-signing' | 'rate-limit-increase-auth' | 'lit-action-execution'; |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4
65594
20
1940
1
- Removed@lit-protocol/accs-schemas@0.0.9
- Removedjszip@^3.10.1
- Removed@lit-protocol/accs-schemas@0.0.9(transitive)
- Removedajv@8.17.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-uri@3.0.6(transitive)
- Removedimmediate@3.0.6(transitive)
- Removedisarray@1.0.0(transitive)
- Removedjson-schema-traverse@1.0.0(transitive)
- Removedjszip@3.10.1(transitive)
- Removedlie@3.3.0(transitive)
- Removedpako@1.0.11(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)