@learncard/core 7.0.3 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  /// <reference types="node" />
4
4
 
5
+ import { CeramicClient } from '@ceramicnetwork/http-client';
5
6
  import { StreamID } from '@ceramicnetwork/streamid';
6
7
  import { ModelAliases } from '@glazed/types';
7
8
 
@@ -4663,8 +4664,7 @@ declare const VerificationItemValidator: z.ZodObject<{
4663
4664
  check: string;
4664
4665
  }>;
4665
4666
  export declare type VerificationItem = z.infer<typeof VerificationItemValidator>;
4666
- /** @group IDXPlugin */
4667
- export declare type IDXCredential<Metadata extends Record<string, any> = Record<never, never>> = {
4667
+ export declare type CredentialRecord<Metadata extends Record<string, any> = Record<never, never>> = {
4668
4668
  id: string;
4669
4669
  uri: string;
4670
4670
  [key: string]: any;
@@ -4689,6 +4689,177 @@ declare const JWKValidator: z.ZodObject<{
4689
4689
  d: string;
4690
4690
  }>;
4691
4691
  export declare type JWK = z.infer<typeof JWKValidator>;
4692
+ export declare type InitFunction<Args extends Record<string, any> = Record<string, any>, Config extends keyof LearnCardConfig | undefined = keyof LearnCardConfig, ReturnValue extends LearnCard<any, any> = LearnCard<any, any>> = {
4693
+ args: Args & (undefined extends Config ? {} : Partial<Pick<LearnCardConfig, NonNullable<Config>>>);
4694
+ returnValue: ReturnValue;
4695
+ };
4696
+ export declare type GenericInitFunction<InitFunctions extends InitFunction<any, any, any>[]> = {
4697
+ args: InitFunctions[number]["args"];
4698
+ returnValue: Promise<InitFunctions[number]["returnValue"]>;
4699
+ };
4700
+ export declare type DiscriminatedUnionize<T extends object = {}, K extends string = "type"> = {
4701
+ [Key in keyof T]: {
4702
+ [Key2 in K]: Key;
4703
+ } & T[Key];
4704
+ }[keyof T];
4705
+ export declare type OmitNevers<T extends Record<string, any>> = Omit<T, {
4706
+ [Index in keyof T]: [
4707
+ T[Index]
4708
+ ] extends [
4709
+ never
4710
+ ] ? Index : never;
4711
+ }[keyof T]>;
4712
+ export declare type CacheStrategy = "cache-only" | "cache-first" | "skip-cache";
4713
+ export declare type PlaneOptions = {
4714
+ cache?: CacheStrategy;
4715
+ };
4716
+ export declare type ControlPlane = "read" | "store" | "index" | "cache" | "id";
4717
+ export declare type FilterForPlane<Plugins extends Plugin[], Plane extends ControlPlane> = {
4718
+ [Index in keyof Plugins]: undefined extends Plugins[Index][Plane] ? never : Plugins[Index]["name"];
4719
+ }[number];
4720
+ export declare type GetPlanesForPlugins<Plugins extends Plugin[]> = any[] extends Plugins ? never : {
4721
+ [Index in keyof Plugins]: {
4722
+ [Key in ControlPlane]: undefined extends Plugins[Index][Key] ? never : Key;
4723
+ }[ControlPlane];
4724
+ }[number];
4725
+ export declare type GetPlaneProviders<Plugins extends Plugin[], Plane extends ControlPlane> = any[] extends Plugins ? any : {
4726
+ [Index in keyof Plugins]: undefined extends Plugins[Index][Plane] ? never : OmitNevers<{
4727
+ [Name in Plugins[number]["name"]]: Name extends Plugins[Index]["name"] ? {
4728
+ name: Name;
4729
+ displayName?: string;
4730
+ description?: string;
4731
+ } : never;
4732
+ }>;
4733
+ }[number];
4734
+ export declare type ReadPlane = {
4735
+ get: (uri?: string, options?: PlaneOptions) => Promise<VC | undefined>;
4736
+ };
4737
+ export declare type PluginReadPlane = ReadPlane;
4738
+ export declare type LearnCardReadPlane<Plugins extends Plugin[]> = ReadPlane & {
4739
+ providers: GetPlaneProviders<Plugins, "read">;
4740
+ };
4741
+ export declare type StorePlane = {
4742
+ upload: (vc: VC, options?: PlaneOptions) => Promise<string>;
4743
+ uploadMany?: (vcs: VC[], options?: PlaneOptions) => Promise<string[]>;
4744
+ };
4745
+ export declare type PluginStorePlane = StorePlane;
4746
+ export declare type LearnCardStorePlane<Plugins extends Plugin[]> = Record<FilterForPlane<Plugins, "store">, StorePlane> & {
4747
+ providers: GetPlaneProviders<Plugins, "store">;
4748
+ };
4749
+ export declare type IndexPlane = {
4750
+ get: <Metadata extends Record<string, any> = Record<never, never>>(query?: Record<string, any>, options?: PlaneOptions) => Promise<CredentialRecord<Metadata>[]>;
4751
+ add: <Metadata extends Record<string, any> = Record<never, never>>(obj: CredentialRecord<Metadata>, options?: PlaneOptions) => Promise<boolean>;
4752
+ update: (id: string, updates: Record<string, any>, options?: PlaneOptions) => Promise<boolean>;
4753
+ remove: (id: string, options?: PlaneOptions) => Promise<boolean>;
4754
+ };
4755
+ export declare type PluginIndexPlane = IndexPlane;
4756
+ export declare type LearnCardIndexPlane<Plugins extends Plugin[]> = {
4757
+ all: Pick<IndexPlane, "get">;
4758
+ providers: GetPlaneProviders<Plugins, "index">;
4759
+ } & Record<FilterForPlane<Plugins, "index">, IndexPlane>;
4760
+ export declare type CachePlane = {
4761
+ getIndex: <Metadata extends Record<string, any> = Record<never, never>>(name: string, query: Record<string, any>) => Promise<CredentialRecord<Metadata>[] | undefined>;
4762
+ setIndex: <Metadata extends Record<string, any> = Record<never, never>>(name: string, query: Record<string, any>, value: CredentialRecord<Metadata>[]) => Promise<boolean>;
4763
+ flushIndex: () => Promise<boolean>;
4764
+ getVc: (uri: string) => Promise<VC | undefined>;
4765
+ setVc: (uri: string, value: VC | undefined) => Promise<boolean>;
4766
+ flushVc: () => Promise<boolean>;
4767
+ };
4768
+ export declare type PluginCachePlane = CachePlane;
4769
+ export declare type LearnCardCachePlane<Plugins extends Plugin[]> = CachePlane & {
4770
+ providers: GetPlaneProviders<Plugins, "cache">;
4771
+ };
4772
+ export declare type IdPlane = {
4773
+ did: (method?: string, options?: PlaneOptions) => string;
4774
+ keypair: (algorithm?: string, options?: PlaneOptions) => JWK;
4775
+ };
4776
+ export declare type PluginIdPlane = IdPlane;
4777
+ export declare type LearnCardIdPlane<Plugins extends Plugin[]> = IdPlane & {
4778
+ providers: GetPlaneProviders<Plugins, "id">;
4779
+ };
4780
+ /** @group Utility Types */
4781
+ export declare type Last<T extends any[]> = T extends [
4782
+ ...any[],
4783
+ infer R
4784
+ ] ? R : never;
4785
+ /** @group Utility Types */
4786
+ export declare type RemoveLast<T extends any[]> = T extends [
4787
+ ...infer R,
4788
+ any
4789
+ ] ? R : [
4790
+ ];
4791
+ /** @group Utility Types */
4792
+ export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
4793
+ /** @group Utility Types */
4794
+ export declare type MergeObjects<Objects extends Record<string, any>[]> = undefined extends Objects[2] ? Omit<Objects[0], keyof Objects[1]> & Objects[1] : Omit<MergeObjects<RemoveLast<Objects>>, keyof Last<Objects>> & Last<Objects>;
4795
+ export declare type GenerateLearnCard<NewControlPlanes extends ControlPlane = never, NewMethods extends Record<string, (...args: any[]) => any> = Record<never, never>, ControlPlanes extends ControlPlane = never, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>> = LearnCard<any, [
4796
+ ControlPlanes
4797
+ ] extends [
4798
+ 1 & ControlPlanes
4799
+ ] ? NewControlPlanes : [
4800
+ NewControlPlanes
4801
+ ] extends [
4802
+ 1 & NewControlPlanes
4803
+ ] ? ControlPlanes : ControlPlanes | NewControlPlanes, NewMethods & Methods>;
4804
+ export declare type AddImplicitLearnCardArgument<Functions extends Record<string, (...args: any[]) => any> = Record<never, never>, ControlPlanes extends ControlPlane = never, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>, DependentControlPlanes extends ControlPlane = never, DependentMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4805
+ [Key in keyof Functions]: <T extends GenerateLearnCard<ControlPlanes, Methods, DependentControlPlanes, DependentMethods>>(learnCard: T, ...args: Parameters<Functions[Key]>) => ReturnType<Functions[Key]>;
4806
+ };
4807
+ /** @group Universal Wallets */
4808
+ export declare type GetPluginMethods<Plugins extends Plugin[]> = undefined extends Plugins[1] ? NonNullable<Plugins[0]["_methods"]> : UnionToIntersection<NonNullable<MergeObjects<{
4809
+ [Key in keyof Plugins]: NonNullable<Plugins[Key]["_methods"]>;
4810
+ }>>>;
4811
+ /** @group Universal Wallets */
4812
+ export declare type Plugin<Name extends string = string, ControlPlanes extends ControlPlane = any, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>, DependentControlPlanes extends ControlPlane = never, DependentMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4813
+ name: Name;
4814
+ displayName?: string;
4815
+ description?: string;
4816
+ methods: AddImplicitLearnCardArgument<Methods, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
4817
+ _methods?: Methods;
4818
+ read?: {};
4819
+ store?: {};
4820
+ index?: {};
4821
+ cache?: {};
4822
+ id?: {};
4823
+ } & ([
4824
+ ControlPlanes
4825
+ ] extends [
4826
+ 1 & ControlPlanes
4827
+ ] ? {} : ("read" extends ControlPlanes ? {
4828
+ read: AddImplicitLearnCardArgument<PluginReadPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
4829
+ } : {}) & ("store" extends ControlPlanes ? {
4830
+ store: AddImplicitLearnCardArgument<PluginStorePlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
4831
+ } : {}) & ("index" extends ControlPlanes ? {
4832
+ index: AddImplicitLearnCardArgument<PluginIndexPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
4833
+ } : {}) & ("cache" extends ControlPlanes ? {
4834
+ cache: AddImplicitLearnCardArgument<PluginCachePlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
4835
+ } : {}) & ("id" extends ControlPlanes ? {
4836
+ id: AddImplicitLearnCardArgument<PluginIdPlane, ControlPlanes, Methods, DependentControlPlanes, DependentMethods>;
4837
+ } : {}));
4838
+ /** @group Universal Wallets */
4839
+ export declare type LearnCard<Plugins extends Plugin[] = [
4840
+ ], ControlPlanes extends ControlPlane = GetPlanesForPlugins<Plugins>, PluginMethods = GetPluginMethods<Plugins>> = {
4841
+ plugins: Plugins;
4842
+ invoke: PluginMethods;
4843
+ addPlugin: <NewPlugin extends Plugin>(plugin: NewPlugin) => Promise<LearnCard<[
4844
+ ...Plugins,
4845
+ NewPlugin
4846
+ ]>>;
4847
+ debug?: typeof console.log;
4848
+ } & ([
4849
+ ControlPlanes
4850
+ ] extends [
4851
+ 1 & ControlPlanes
4852
+ ] ? {} : ("read" extends ControlPlanes ? {
4853
+ read: LearnCardReadPlane<Plugins>;
4854
+ } : {}) & ("store" extends ControlPlanes ? {
4855
+ store: LearnCardStorePlane<Plugins>;
4856
+ } : {}) & ("index" extends ControlPlanes ? {
4857
+ index: LearnCardIndexPlane<Plugins>;
4858
+ } : {}) & ("cache" extends ControlPlanes ? {
4859
+ cache: LearnCardCachePlane<Plugins>;
4860
+ } : {}) & ("id" extends ControlPlanes ? {
4861
+ id: LearnCardIdPlane<Plugins>;
4862
+ } : {}));
4692
4863
  /** @group DIDKit Plugin */
4693
4864
  export declare type DidMethod = "key" | "tz" | "ethr" | `pkh:${"tz" | "tezos" | "sol" | "solana" | "eth" | "celo" | "poly" | "btc" | "doge" | "eip155" | "bip122"}` | `pkh:eip155:${string}` | `pkh:bip122:${string}`;
4694
4865
  /** @group DIDKit Plugin */
@@ -4721,48 +4892,89 @@ export declare type DidkitPluginMethods = {
4721
4892
  contextLoader: (url: string) => Promise<Record<string, any>>;
4722
4893
  resolveDid: (did: string, inputMetadata?: InputMetadata) => Promise<Record<string, any>>;
4723
4894
  };
4895
+ /** @group DIDKit Plugin */
4896
+ export declare type DIDKitPlugin = Plugin<"DIDKit", any, DidkitPluginMethods>;
4724
4897
  /** @group DidKey Plugin */
4725
4898
  export declare type Algorithm = "ed25519" | "secp256k1";
4726
4899
  /** @group DidKey Plugin */
4727
- export declare type DependentMethods<T extends string> = {
4900
+ export declare type DependentMethods<DidMethod extends string> = {
4728
4901
  generateEd25519KeyFromBytes: (bytes: Uint8Array) => JWK;
4729
4902
  generateSecp256k1KeyFromBytes: (bytes: Uint8Array) => JWK;
4730
- keyToDid: (type: T, keypair: JWK) => string;
4903
+ keyToDid: (method: DidMethod, keypair: JWK) => string;
4731
4904
  };
4732
4905
  /** @group DidKey Plugin */
4733
4906
  export declare type DidKeyPluginMethods<DidMethod extends string> = {
4734
- getSubjectDid: (type: DidMethod) => string;
4735
- getSubjectKeypair: (type?: Algorithm) => JWK;
4907
+ getSubjectDid: (method?: DidMethod) => string;
4908
+ getSubjectKeypair: (algorithm?: Algorithm) => JWK;
4736
4909
  getKey: () => string;
4737
4910
  };
4738
- /** @group Ethereum Plugin */
4739
- export declare type EthereumPluginMethods = {
4740
- getEthereumAddress: () => string;
4741
- getBalance: (symbolOrAddress?: string) => Promise<string>;
4742
- getBalanceForAddress: (walletAddress: string, symbolOrAddress?: string) => Promise<string>;
4743
- transferTokens: (tokenSymbolOrAddress: string, amount: number, toAddress: string) => Promise<string>;
4744
- getGasPrice: () => Promise<string>;
4745
- getCurrentNetwork: () => providers.Networkish;
4746
- changeNetwork: (network: providers.Networkish) => void;
4747
- addInfuraProjectId: (infuraProjectIdToAdd: string) => void;
4911
+ /** @group DidKey Plugin */
4912
+ export declare type DidKeyPlugin<DidMethod extends string = string> = Plugin<"DID Key", "id", DidKeyPluginMethods<DidMethod>, any, DependentMethods<DidMethod>>;
4913
+ /** @group VC Plugin */
4914
+ export declare type VCPluginDependentMethods = {
4915
+ getSubjectDid: (type: "key") => string;
4916
+ getSubjectKeypair: () => JWK;
4917
+ keyToVerificationMethod: (type: string, keypair: JWK) => Promise<string>;
4918
+ issueCredential: (credential: UnsignedVC, options: ProofOptions, keypair: JWK) => Promise<VC>;
4919
+ verifyCredential: (credential: VC, options?: ProofOptions) => Promise<VerificationCheck>;
4920
+ issuePresentation: (presentation: UnsignedVP, options: ProofOptions, keypair: JWK) => Promise<VP>;
4921
+ verifyPresentation: (presentation: VP, options?: ProofOptions) => Promise<VerificationCheck>;
4748
4922
  };
4749
- /** @group Ethereum Plugin */
4750
- export declare type EthereumConfig = {
4751
- infuraProjectId?: string;
4752
- network?: providers.Networkish;
4923
+ /** @group VC Plugin */
4924
+ export declare type VCPluginMethods = {
4925
+ issueCredential: (credential: UnsignedVC, signingOptions?: Partial<ProofOptions>) => Promise<VC>;
4926
+ verifyCredential: (credential: VC, options?: Partial<ProofOptions>) => Promise<VerificationCheck>;
4927
+ issuePresentation: (credential: UnsignedVP, signingOptions?: Partial<ProofOptions>) => Promise<VP>;
4928
+ verifyPresentation: (presentation: VP, options?: Partial<ProofOptions>) => Promise<VerificationCheck>;
4929
+ getTestVc: (subject?: string) => UnsignedVC;
4930
+ getTestVp: (credential?: VC) => Promise<UnsignedVP>;
4753
4931
  };
4754
- /** @group Ethereum Plugin */
4755
- export declare type Token = {
4756
- chainId: number;
4757
- address: string;
4758
- name: string;
4759
- symbol: string;
4760
- decimals: number;
4761
- logoURI: string;
4762
- extensions: any;
4932
+ /** @group VC Plugin */
4933
+ export declare type VCDependentLearnCard = LearnCard<any, "id", VCPluginDependentMethods>;
4934
+ /** @group VC Plugin */
4935
+ export declare type VCImplicitLearnCard = LearnCard<any, "id", VCPluginMethods & VCPluginDependentMethods>;
4936
+ /** @group VC Plugin */
4937
+ export declare type VerifyExtension = {
4938
+ verifyCredential: (credential: VC) => Promise<VerificationCheck>;
4763
4939
  };
4764
- /** @group Ethereum Plugin */
4765
- export declare type TokenList = Token[];
4940
+ /** @group VC Plugin */
4941
+ export declare type VCPlugin = Plugin<"VC", any, VCPluginMethods, "id", VCPluginDependentMethods>;
4942
+ /** @group VC Templates Plugin */
4943
+ export declare type VcTemplates = {
4944
+ basic: {
4945
+ did?: string;
4946
+ subject?: string;
4947
+ issuanceDate?: string;
4948
+ };
4949
+ achievement: {
4950
+ did?: string;
4951
+ subject?: string;
4952
+ name?: string;
4953
+ achievementName?: string;
4954
+ description?: string;
4955
+ criteriaNarrative?: string;
4956
+ issuanceDate?: string;
4957
+ };
4958
+ };
4959
+ /** @group VC Templates Plugin */
4960
+ export declare type NewCredentialFunction = (args?: DiscriminatedUnionize<VcTemplates>) => UnsignedVC;
4961
+ /** @group VC Templates Plugin */
4962
+ export declare type VCTemplatePluginDependentMethods = {
4963
+ getSubjectDid?: (type: "key") => string;
4964
+ };
4965
+ /** @group VC Templates Plugin */
4966
+ export declare type VCTemplatePluginMethods = {
4967
+ newCredential: NewCredentialFunction;
4968
+ newPresentation: (credential: VC, args?: {
4969
+ did?: string;
4970
+ }) => Promise<UnsignedVP>;
4971
+ };
4972
+ /** @group VC Templates Plugin */
4973
+ export declare type VCTemplatePlugin = Plugin<"VC Templates", any, VCTemplatePluginMethods, "id", VCTemplatePluginDependentMethods>;
4974
+ /**
4975
+ * @group Plugins
4976
+ */
4977
+ export declare const getVCTemplatesPlugin: () => VCTemplatePlugin;
4766
4978
  /** @group VC Resolution Plugin */
4767
4979
  export declare type LC_URI<URI extends string = ""> = string | URI;
4768
4980
  /** @group VC Resolution Plugin */
@@ -4773,71 +4985,58 @@ export declare type VCResolutionPluginMethods = {
4773
4985
  export declare type ResolutionExtension<URI extends string> = {
4774
4986
  resolveCredential: (uri?: LC_URI<URI>) => Promise<VC | undefined>;
4775
4987
  };
4776
- export declare type Last<T extends any[]> = T extends [
4777
- ...any[],
4778
- infer R
4779
- ] ? R : never;
4780
- export declare type RemoveLast<T extends any[]> = T extends [
4781
- ...infer R,
4782
- any
4783
- ] ? R : [
4784
- ];
4785
- /** @group Utility Types */
4786
- export declare type MergeObjects<Objects extends Record<string, any>[]> = undefined extends Objects[2] ? Omit<Objects[0], keyof Objects[1]> & Objects[1] : Omit<MergeObjects<RemoveLast<Objects>>, keyof Last<Objects>> & Last<Objects>;
4787
- /** @group Universal Wallets */
4788
- export declare type Plugin<Name extends string, PublicMethods extends Record<string, (...args: any[]) => any> = Record<never, never>, DependentMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4789
- name?: Name;
4790
- pluginMethods: {
4791
- [Key in keyof PublicMethods]: <T extends Wallet<any, PublicMethods & DependentMethods>>(wallet: T, ...args: Parameters<PublicMethods[Key]>) => ReturnType<PublicMethods[Key]>;
4792
- };
4793
- };
4794
- /** @group Universal Wallets */
4795
- export declare type PublicFieldsObj<PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4796
- pluginMethods: PluginMethods;
4797
- };
4798
- /** @group Universal Wallets */
4799
- export declare type Wallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = PublicFieldsObj<PluginMethods> & {
4800
- contents: any[];
4801
- plugins: Plugin<PluginNames, Record<string, (...args: any[]) => any>>[];
4802
- add: (content: any) => Promise<Wallet<PluginNames, PluginMethods>>;
4803
- remove: (contentId: string) => Promise<Wallet<PluginNames, PluginMethods>>;
4804
- addPlugin: <Name extends string, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>>(plugin: Plugin<Name, Methods>) => Promise<Wallet<"" extends PluginNames ? Name : PluginNames | Name, Record<never, never> extends PluginMethods ? Methods : MergeObjects<[
4805
- PluginMethods,
4806
- Methods
4807
- ]>>>;
4808
- };
4809
- /** @group IDXPlugin */
4810
- export declare type CeramicIDXArgs = {
4811
- modelData: ModelAliases;
4812
- credentialAlias: string;
4988
+ export declare type VCResolutionPluginType = Plugin<"VC Resolution", any, VCResolutionPluginMethods>;
4989
+ /**
4990
+ * @group Plugins
4991
+ */
4992
+ export declare const VCResolutionPlugin: VCResolutionPluginType;
4993
+ /** @group CeramicPlugin */
4994
+ export declare type CeramicArgs = {
4813
4995
  ceramicEndpoint: string;
4814
4996
  defaultContentFamily: string;
4815
4997
  };
4816
- /** @group IDXPlugin */
4998
+ /** @group CeramicPlugin */
4817
4999
  export declare type CeramicURI = `lc:ceramic:${string}`;
4818
- /** @group IDXPlugin */
5000
+ /** @group CeramicPlugin */
4819
5001
  export declare const CeramicURIValidator: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
4820
- /** @group IDXPlugin */
4821
- export declare type IDXPluginMethods<URI extends string = ""> = {
4822
- getCredentialsListFromIdx: <Metadata extends Record<string, any> = Record<never, never>>(alias?: string) => Promise<CredentialsList<Metadata>>;
5002
+ /** @group CeramicPlugin */
5003
+ export declare type CeramicPluginMethods<URI extends string = ""> = {
4823
5004
  publishContentToCeramic: (cred: any) => Promise<CeramicURI>;
4824
5005
  readContentFromCeramic: (streamId: string) => Promise<any>;
5006
+ getCeramicClient: () => CeramicClient;
5007
+ } & ResolutionExtension<URI | CeramicURI>;
5008
+ /** @group CeramicPlugin */
5009
+ export declare type CeramicPluginDependentMethods<URI extends string = ""> = {
5010
+ getKey: () => string;
5011
+ } & ResolutionExtension<URI>;
5012
+ /** @group CeramicPlugin */
5013
+ export declare type CeramicPlugin = Plugin<"Ceramic", "read" | "store", CeramicPluginMethods>;
5014
+ /** @group IDXPlugin */
5015
+ export declare type IDXArgs = {
5016
+ modelData: ModelAliases;
5017
+ credentialAlias: string;
5018
+ };
5019
+ /** @group IDXPlugin */
5020
+ export declare type IDXPluginMethods = {
5021
+ getCredentialsListFromIdx: <Metadata extends Record<string, any> = Record<never, never>>(alias?: string) => Promise<CredentialRecord<Metadata>[]>;
4825
5022
  getVerifiableCredentialFromIdx: (id: string) => Promise<VC | undefined>;
4826
5023
  getVerifiableCredentialsFromIdx: () => Promise<VC[]>;
4827
- addVerifiableCredentialInIdx: <Metadata extends Record<string, any> = Record<never, never>>(cred: IDXCredential<Metadata>) => Promise<CeramicURI>;
5024
+ addVerifiableCredentialInIdx: <Metadata extends Record<string, any> = Record<never, never>>(cred: CredentialRecord<Metadata>) => Promise<string>;
4828
5025
  removeVerifiableCredentialInIdx: (title: string) => Promise<StreamID>;
4829
- } & ResolutionExtension<URI | CeramicURI>;
5026
+ };
4830
5027
  /** @group IDXPlugin */
4831
5028
  export declare type IDXPluginDependentMethods<URI extends string = ""> = {
4832
- getKey: () => string;
5029
+ getCeramicClient: () => CeramicClient;
4833
5030
  } & ResolutionExtension<URI>;
4834
5031
  /** @group IDXPlugin */
4835
5032
  export declare type CredentialsList<Metadata extends Record<string, any> = Record<never, never>> = {
4836
- credentials: Array<IDXCredential<Metadata>>;
5033
+ credentials: Array<CredentialRecord<Metadata>>;
4837
5034
  };
4838
5035
  /** @group IDXPlugin */
4839
5036
  export declare const CredentialsListValidator: z.ZodType<CredentialsList>;
4840
5037
  /** @group IDXPlugin */
5038
+ export declare type IDXPlugin = Plugin<"IDX", "index", IDXPluginMethods, "read", IDXPluginDependentMethods>;
5039
+ /** @group IDXPlugin */
4841
5040
  export declare type BackwardsCompatIDXCredential<Metadata extends Record<string, any> = Record<never, never>> = {
4842
5041
  [key: string]: any;
4843
5042
  id: string;
@@ -4848,35 +5047,45 @@ export declare type BackwardsCompatIDXCredential<Metadata extends Record<string,
4848
5047
  export declare const BackwardsCompatIDXCredentialValidator: z.ZodType<BackwardsCompatIDXCredential>;
4849
5048
  /** @group IDXPlugin */
4850
5049
  export declare type BackwardsCompatCredentialsList<Metadata extends Record<string, any> = Record<never, never>> = {
4851
- credentials: Array<IDXCredential<Metadata> | BackwardsCompatIDXCredential<Metadata>>;
5050
+ credentials: Array<CredentialRecord<Metadata> | BackwardsCompatIDXCredential<Metadata>>;
4852
5051
  };
4853
5052
  /** @group IDXPlugin */
4854
5053
  export declare const BackwardsCompatCredentialsListValidator: z.ZodType<BackwardsCompatCredentialsList>;
4855
- /** @group VC Plugin */
4856
- export declare type VCPluginDependentMethods = {
4857
- getSubjectDid: (type: "key") => string;
4858
- getSubjectKeypair: () => JWK;
4859
- keyToVerificationMethod: (type: string, keypair: JWK) => Promise<string>;
4860
- issueCredential: (credential: UnsignedVC, options: ProofOptions, keypair: JWK) => Promise<VC>;
4861
- verifyCredential: (credential: VC, options?: ProofOptions) => Promise<VerificationCheck>;
4862
- issuePresentation: (presentation: UnsignedVP, options: ProofOptions, keypair: JWK) => Promise<VP>;
4863
- verifyPresentation: (presentation: VP, options?: ProofOptions) => Promise<VerificationCheck>;
5054
+ /**
5055
+ * @group Plugins
5056
+ */
5057
+ export declare const getVCPlugin: (learnCard: VCDependentLearnCard) => VCPlugin;
5058
+ export declare type ExpirationPlugin = Plugin<"Expiration", any, VerifyExtension>;
5059
+ /** @group Ethereum Plugin */
5060
+ export declare type EthereumPluginMethods = {
5061
+ getEthereumAddress: () => string;
5062
+ getBalance: (symbolOrAddress?: string) => Promise<string>;
5063
+ getBalanceForAddress: (walletAddress: string, symbolOrAddress?: string) => Promise<string>;
5064
+ transferTokens: (tokenSymbolOrAddress: string, amount: number, toAddress: string) => Promise<string>;
5065
+ getGasPrice: () => Promise<string>;
5066
+ getCurrentNetwork: () => providers.Networkish;
5067
+ changeNetwork: (network: providers.Networkish) => void;
5068
+ addInfuraProjectId: (infuraProjectIdToAdd: string) => void;
4864
5069
  };
4865
- /** @group VC Plugin */
4866
- export declare type VCPluginMethods = {
4867
- issueCredential: (credential: UnsignedVC, signingOptions?: Partial<ProofOptions>) => Promise<VC>;
4868
- verifyCredential: (credential: VC, options?: Partial<ProofOptions>) => Promise<VerificationCheck>;
4869
- issuePresentation: (credential: UnsignedVP, signingOptions?: Partial<ProofOptions>) => Promise<VP>;
4870
- verifyPresentation: (presentation: VP, options?: Partial<ProofOptions>) => Promise<VerificationCheck>;
4871
- getTestVc: (subject?: string) => UnsignedVC;
4872
- getTestVp: (credential?: VC) => Promise<UnsignedVP>;
5070
+ /** @group Ethereum Plugin */
5071
+ export declare type EthereumConfig = {
5072
+ infuraProjectId?: string;
5073
+ network?: providers.Networkish;
4873
5074
  };
4874
- /** @group VC Plugin */
4875
- export declare type VCImplicitWallet = Wallet<string, VCPluginMethods & VCPluginDependentMethods>;
4876
- /** @group VC Plugin */
4877
- export declare type VerifyExtension = {
4878
- verifyCredential: (credential: VC) => Promise<VerificationCheck>;
5075
+ /** @group Ethereum Plugin */
5076
+ export declare type Token = {
5077
+ chainId: number;
5078
+ address: string;
5079
+ name: string;
5080
+ symbol: string;
5081
+ decimals: number;
5082
+ logoURI: string;
5083
+ extensions: any;
4879
5084
  };
5085
+ /** @group Ethereum Plugin */
5086
+ export declare type TokenList = Token[];
5087
+ /** @group Ethereum Plugin */
5088
+ export declare type EthereumPlugin = Plugin<"Ethereum", any, EthereumPluginMethods, "id">;
4880
5089
  /** @group VPQR Plugin */
4881
5090
  export declare type VpqrPluginMethods = {
4882
5091
  vpFromQrCode: (text: string) => Promise<VP>;
@@ -4886,6 +5095,7 @@ export declare type VpqrPluginMethods = {
4886
5095
  export declare type VpqrPluginDependentMethods = {
4887
5096
  contextLoader: (url: string) => Promise<Record<string, any>>;
4888
5097
  };
5098
+ export declare type VpqrPlugin = Plugin<"Vpqr", any, VpqrPluginMethods, any, VpqrPluginDependentMethods>;
4889
5099
  /** @group CHAPI Plugin */
4890
5100
  export declare type WebCredential = {
4891
5101
  new (dataType: string, data: VP, options?: {
@@ -4969,49 +5179,12 @@ export declare type CHAPIPluginMethods = {
4969
5179
  }>;
4970
5180
  storePresentationViaChapi: (presentation: UnsignedVP | VP) => Promise<Credential | undefined>;
4971
5181
  };
5182
+ /** @group CHAPI Plugin */
5183
+ export declare type CHAPIPlugin = Plugin<"CHAPI", any, CHAPIPluginMethods, any, CHAPIPluginDependentMethods>;
4972
5184
  /**
4973
5185
  * @group Plugins
4974
5186
  */
4975
- export declare const getCHAPIPlugin: () => Promise<Plugin<"CHAPI", CHAPIPluginMethods, CHAPIPluginDependentMethods>>;
4976
- export declare type InitFunction<Args extends Record<string, any> = Record<string, any>, Config extends keyof LearnCardConfig = keyof LearnCardConfig, ReturnValue extends LearnCard<any, any> = LearnCard<any, any>> = {
4977
- args: Args & Partial<Pick<LearnCardConfig, Config>>;
4978
- returnValue: ReturnValue;
4979
- };
4980
- export declare type GenericInitFunction<InitFunctions extends InitFunction<any, any, any>[]> = {
4981
- args: InitFunctions[number]["args"];
4982
- returnValue: Promise<InitFunctions[number]["returnValue"]>;
4983
- };
4984
- export declare type DiscriminatedUnionize<T extends object = {}, K extends string = "type"> = {
4985
- [Key in keyof T]: {
4986
- [Key2 in K]: Key;
4987
- } & T[Key];
4988
- }[keyof T];
4989
- /** @group VC Templates Plugin */
4990
- export declare type VcTemplates = {
4991
- basic: {
4992
- did?: string;
4993
- subject?: string;
4994
- issuanceDate?: string;
4995
- };
4996
- achievement: {
4997
- did?: string;
4998
- subject?: string;
4999
- name?: string;
5000
- achievementName?: string;
5001
- description?: string;
5002
- criteriaNarrative?: string;
5003
- issuanceDate?: string;
5004
- };
5005
- };
5006
- /** @group VC Templates Plugin */
5007
- export declare type NewCredentialFunction = (args?: DiscriminatedUnionize<VcTemplates>) => UnsignedVC;
5008
- /** @group VC Templates Plugin */
5009
- export declare type VCTemplatePluginMethods = {
5010
- newCredential: NewCredentialFunction;
5011
- newPresentation: (credential: VC, args?: {
5012
- did?: string;
5013
- }) => Promise<UnsignedVP>;
5014
- };
5187
+ export declare const getCHAPIPlugin: () => Promise<CHAPIPlugin>;
5015
5188
  /** @group VC-API Plugin */
5016
5189
  export declare type APIOptions = {
5017
5190
  created?: string;
@@ -5028,422 +5201,755 @@ export declare type VCAPIPluginMethods = {
5028
5201
  getTestVc: (subject?: string) => UnsignedVC;
5029
5202
  getTestVp: (credential?: VC) => Promise<UnsignedVP>;
5030
5203
  };
5204
+ /** @group VC-API Plugin */
5205
+ export declare type VCAPIPlugin = Plugin<"VC API", "id", VCAPIPluginMethods>;
5031
5206
  /**
5032
5207
  *
5033
5208
  * @group Plugins
5034
5209
  */
5035
- export declare const getDidKitPlugin: (input?: InitInput | Promise<InitInput>) => Promise<Plugin<"DIDKit", DidkitPluginMethods>>;
5036
- /**
5037
- *
5038
- * @group Plugins
5039
- */
5040
- export declare const getDidKeyPlugin: <DidMethod extends string>(wallet: Wallet<string, DependentMethods<DidMethod>>, key: string) => Promise<Plugin<"DID Key", DidKeyPluginMethods<DidMethod>, Record<never, never>>>;
5041
- /**
5042
- * @group Plugins
5043
- */
5044
- export declare const getVCPlugin: (wallet: Wallet<string, VCPluginDependentMethods>) => Plugin<"VC", VCPluginMethods, VCPluginDependentMethods>;
5045
- /**
5046
- * @group Plugins
5047
- */
5048
- export declare const getIDXPlugin: <URI extends string = "">(wallet: Wallet<any, IDXPluginDependentMethods<URI>>, { modelData, credentialAlias, ceramicEndpoint, defaultContentFamily }: CeramicIDXArgs) => Promise<Plugin<"IDX", IDXPluginMethods<URI>, Record<never, never>>>;
5049
- /**
5050
- * @group Plugins
5051
- */
5052
- export declare const ExpirationPlugin: (wallet: Wallet<any, VerifyExtension>) => Plugin<"Expiration", VerifyExtension>;
5053
- /**
5054
- * @group Plugins
5055
- */
5056
- export declare const getEthereumPlugin: (initWallet: Wallet<string, {
5057
- getSubjectDid: (type: DidMethod) => string;
5058
- getSubjectKeypair: (type?: Algorithm) => JWK;
5059
- }>, config: EthereumConfig) => Plugin<"Ethereum", EthereumPluginMethods>;
5060
- /**
5061
- * @group Plugins
5062
- */
5063
- export declare const getVpqrPlugin: (wallet: Wallet<string, VpqrPluginDependentMethods>) => Plugin<"Vpqr", VpqrPluginMethods>;
5064
- /**
5065
- * Wallet holder's did
5066
- *
5067
- * @group LearnCard Methods
5068
- */
5069
- export declare type Did = (type?: DidMethod) => string;
5070
- /**
5071
- * Wallet holder's ed25519 key pair
5072
- *
5073
- * @group LearnCard Methods
5074
- */
5075
- export declare type Keypair = (type?: Algorithm) => {
5076
- kty: string;
5077
- crv: string;
5078
- x: string;
5079
- y?: string;
5080
- d: string;
5210
+ export declare const getDidKitPlugin: (input?: InitInput | Promise<InitInput>) => Promise<DIDKitPlugin>;
5211
+ export declare type VerifyCredential = {
5212
+ (vc: VC, options?: Partial<ProofOptions>): Promise<VerificationCheck>;
5213
+ (vc: VC, options: Partial<ProofOptions>, prettify: true): Promise<VerificationItem[]>;
5081
5214
  };
5082
- /**
5083
- * Generates a new Unsigned VC from a template
5084
- *
5085
- * @group LearnCard Methods
5086
- */
5087
- export declare type NewCredential = NewCredentialFunction;
5088
- /**
5089
- * Wraps a VC in a simple Presentation
5090
- *
5091
- * @group LearnCard Methods
5092
- */
5093
- export declare type NewPresentation = (credential: VC, args?: {
5094
- did?: string;
5095
- }) => Promise<UnsignedVP>;
5096
- /**
5097
- * Signs an unsigned Verifiable Credential, returning the signed VC
5098
- *
5099
- * @group LearnCard Methods
5100
- */
5101
- export declare type IssueCredential = (credential: UnsignedVC, signingOptions?: Partial<ProofOptions>) => Promise<VC>;
5102
- /**
5103
- * Verifies a signed Verifiable Credential
5104
- *
5105
- * Empty error/warnings arrays means verification was successful
5106
- *
5107
- * @group LearnCard Methods
5108
- */
5109
- export declare type VerifyCredential = (credential: VC, options?: Partial<ProofOptions>) => Promise<VerificationItem[]>;
5110
- /**
5111
- * Signs an unsigned Verifiable Presentation, returning the signed VP
5112
- *
5113
- * @group LearnCard Methods
5114
- */
5115
- export declare type IssuePresentation = (presentation: UnsignedVP, signingOptions?: Partial<ProofOptions>) => Promise<VP>;
5116
- /**
5117
- * Verifies a signed Verifiable Presentation
5118
- *
5119
- * Empry error/warnings arrays means verification was successful
5120
- *
5121
- * @group LearnCard Methods
5122
- */
5123
- export declare type VerifyPresentation = (presentation: VP, options?: Partial<ProofOptions>) => Promise<VerificationCheck>;
5124
- /**
5125
- * Returns the credential marked with `title` from IDX
5126
- *
5127
- * @group LearnCard Methods
5128
- */
5129
- export declare type GetCredential = (title: string) => Promise<VC | undefined>;
5130
- /**
5131
- * Returns all credentials from IDX
5132
- *
5133
- * @group LearnCard Methods
5134
- */
5135
- export declare type GetCredentials = () => Promise<VC[]>;
5136
- /**
5137
- * Returns all credentials from IDX
5138
- *
5139
- * @group LearnCard Methods
5140
- */
5141
- export declare type GetCredentialsList = <Metadata extends Record<string, any> = Record<never, never>>() => Promise<IDXCredential<Metadata>[]>;
5142
- /**
5143
- * Publishes a credential to Ceramic, returning the credential's Ceramic URI
5144
- *
5145
- * This URI may then be shared/persisted/resolved to gain access to the credential
5146
- *
5147
- * Resolving a URI can be done by passing the URI to `resolveCredential`
5148
- *
5149
- * @group LearnCard Methods
5150
- */
5151
- export declare type PublishCredential = (credential: VC) => Promise<CeramicURI>;
5152
- /**
5153
- * Adds a URI pointing to a credential (such as the one returned by `publishCredential`)
5154
- * to IDX with a bespoke ID
5155
- *
5156
- * The credential may then be retrieved using `getCredential` and passing in that bespoke ID,
5157
- * or by using `getCredentials`/`getCredentialsList` to get a list of all credentials that have been added to IDX
5158
- *
5159
- * @group LearnCard Methods
5160
- */
5161
- export declare type AddCredential = <Metadata extends Record<string, any> = Record<never, never>>(credential: IDXCredential<Metadata>) => Promise<void>;
5162
- /**
5163
- * Removes a credential from IDX by passing in its bespoke ID
5164
- *
5165
- * @group LearnCard Methods
5166
- */
5167
- export declare type RemoveCredential = (id: string) => Promise<void>;
5168
- /**
5169
- * Resolves a did to its did document
5170
- *
5171
- * @group LearnCard Methods
5172
- */
5173
- export declare type ResolveDid = (did: string, inputMetadata?: InputMetadata) => Promise<Record<string, any>>;
5174
- /**
5175
- * Resolves a stream ID, returning its contents
5176
- *
5177
- * @group LearnCard Methods
5178
- */
5179
- export declare type ReadFromCeramic = (streamId: string) => Promise<any>;
5180
- /**
5181
- * Resolves a LearnCard URI (e.g. lc:ceramic:1234561)
5182
- *
5183
- * This can be given the return value of `publishCredential` to gain access to the credential
5184
- * that was published
5185
- *
5186
- * @group LearnCard Methods
5187
- */
5188
- export declare type ResolveCredential = (URI?: string | "" | `lc:ceramic:${string}`) => Promise<VC | undefined>;
5189
- /**
5190
- * Returns an example credential, optionally allowing a subject's did to be passed in
5191
- *
5192
- * You can use this to test out implementations that use this library!
5193
- *
5194
- * @group LearnCard Methods
5195
- */
5196
- export declare type GetTestVc = (subject?: string) => UnsignedVC;
5197
- /**
5198
- * Wraps a crednetial in an exmaple presentaion. If no credential is provided, a new one will be
5199
- * generated using getTestVc
5200
- *
5201
- * You can use this to test out implementations that use this library!
5202
- *
5203
- * @group LearnCard Methods
5204
- */
5205
- export declare type GetTestVp = (credential?: VC) => Promise<UnsignedVP>;
5206
- /**
5207
- * Returns Ethereum public address
5208
- *
5209
- * @group LearnCard Methods
5210
- */
5211
- export declare type GetEthereumAddress = () => string;
5212
- /**
5213
- * Get the balance of an ERC20 token
5214
- * Defaults to ETH if symbolOrAddress is not provided
5215
- *
5216
- * @group LearnCard Methods
5217
- */
5218
- export declare type GetBalance = (symbolOrAddress?: string) => Promise<string>;
5219
- /**
5220
- * Get the balance of an ERC20 token for a given address
5221
- * Defaults to ETH if symbolOrAddress is not provided
5222
- *
5223
- * @group LearnCard Methods
5224
- */
5225
- export declare type GetBalanceForAddress = (walletAddress: string, symbolOrAddress?: string) => Promise<string>;
5226
- /**
5227
- * Transfer tokens to a given address
5228
- *
5229
- * @group LearnCard Methods
5230
- */
5231
- export declare type TransferTokens = (tokenSymbolOrAddress: string, amount: number, toAddress: string) => Promise<string>;
5232
- /**
5233
- * Get the gas price of the current network
5234
- *
5235
- * @group LearnCard Methods
5236
- */
5237
- export declare type GetGasPrice = () => Promise<string>;
5238
- /**
5239
- * Get your current Ethereum network
5240
- *
5241
- * @group LearnCard Methods
5242
- */
5243
- export declare type GetCurrentNetwork = () => ethers.providers.Networkish;
5244
- /**
5245
- * Change your Ethereum network
5246
- *
5247
- * @group LearnCard Methods
5248
- */
5249
- export declare type ChangeNetwork = (network: ethers.providers.Networkish) => void;
5250
- /**
5251
- * Add an infura project id to an existing wallet.
5252
- * Really only useful for testing with the CLI right now...
5253
- *
5254
- * @group LearnCard Methods
5255
- */
5256
- export declare type AddInfuraProjectId = (infuraProjectIdToAdd: string) => void;
5257
- /**
5258
- * Returns a Verifiable Presentation (VP) from a QR code base-64 image data string containing a VP compressed by CBOR-LD.
5259
- *
5260
- * @group LearnCard Methods
5261
- */
5262
- export declare type VpFromQrCode = (text: string) => Promise<VP>;
5263
- /**
5264
- * Returns a QR-embeddable base-64 image data string from a Verifiable Presentation, compressed using CBOR-LD.
5265
- *
5266
- * @group LearnCard Methods
5267
- */
5268
- export declare type VpToQrCode = (vp: VP) => Promise<string>;
5269
- /**
5270
- * Sets up CHAPI
5271
- *
5272
- * @group LearnCard Methods
5273
- */
5274
- export declare type InstallChapiHandler = () => Promise<void>;
5275
- /**
5276
- * Activates CHAPI
5277
- *
5278
- * @group LearnCard Methods
5279
- */
5280
- export declare type ActivateChapiHandler = (args: {
5281
- mediatorOrigin?: string;
5282
- get?: (event: CredentialRequestEvent) => Promise<HandlerResponse>;
5283
- store?: (event: CredentialStoreEvent) => Promise<HandlerResponse>;
5284
- }) => Promise<void>;
5285
- /**
5286
- * Receives a CHAPI Event
5287
- *
5288
- * @group LearnCard Methods
5289
- */
5290
- export declare type ReceiveChapiEvent = () => Promise<CredentialRequestEvent | CredentialStoreEvent>;
5291
- /**
5292
- * Stores a VP via CHAPI
5293
- *
5294
- * @group LearnCard Methods
5295
- */
5296
- export declare type StorePresentationViaChapi = (presentation: VP) => Promise<Credential | undefined>;
5297
- /**
5298
- * Stores a Credential via CHAPI using DIDAuth
5299
- *
5300
- * @group LearnCard Methods
5301
- */
5302
- export declare type StoreCredentialViaChapiDidAuth = (credential: UnsignedVC) => Promise<{
5303
- success: true;
5304
- } | {
5305
- success: false;
5306
- reason: "did not auth" | "auth failed verification" | "did not store";
5307
- }>;
5308
- /**
5309
- * @group LearnCard Methods
5310
- */
5311
- export declare type AllLearnCardMethods = {
5312
- did: Did;
5313
- keypair: Keypair;
5314
- newCredential: NewCredential;
5315
- newPresentation: NewPresentation;
5316
- issueCredential: IssueCredential;
5215
+ /** @group LearnCard Plugin */
5216
+ export declare type LearnCardPluginDependentMethods = {
5217
+ verifyCredential: (vc: VC, options?: Partial<ProofOptions>) => Promise<VerificationCheck>;
5218
+ };
5219
+ /** @group LearnCard Plugin */
5220
+ export declare type LearnCardPluginMethods = {
5317
5221
  verifyCredential: VerifyCredential;
5318
- issuePresentation: IssuePresentation;
5319
- verifyPresentation: VerifyPresentation;
5320
- getCredential: GetCredential;
5321
- getCredentials: GetCredentials;
5322
- getCredentialsList: GetCredentialsList;
5323
- publishCredential: PublishCredential;
5324
- addCredential: AddCredential;
5325
- removeCredential: RemoveCredential;
5326
- resolveDid: ResolveDid;
5327
- readFromCeramic: ReadFromCeramic;
5328
- resolveCredential: ResolveCredential;
5329
- getTestVc: GetTestVc;
5330
- getTestVp: GetTestVp;
5331
- getEthereumAddress: GetEthereumAddress;
5332
- getBalance: GetBalance;
5333
- getBalanceForAddress: GetBalanceForAddress;
5334
- transferTokens: TransferTokens;
5335
- getGasPrice: GetGasPrice;
5336
- getCurrentNetwork: GetCurrentNetwork;
5337
- changeNetwork: ChangeNetwork;
5338
- addInfuraProjectId: AddInfuraProjectId;
5339
- vpFromQrCode: VpFromQrCode;
5340
- vpToQrCode: VpToQrCode;
5341
- installChapiHandler: InstallChapiHandler;
5342
- activateChapiHandler: ActivateChapiHandler;
5343
- receiveChapiEvent: ReceiveChapiEvent;
5344
- storePresentationViaChapi: StorePresentationViaChapi;
5345
- storeCredentialViaChapiDidAuth: StoreCredentialViaChapiDidAuth;
5346
5222
  };
5347
- /** @group Universal Wallets */
5348
- export declare type LearnCardRawWallet = Wallet<"DIDKit" | "DID Key" | "VC" | "VC Templates" | "VC Resolution" | "IDX" | "Expiration" | "Ethereum" | "Vpqr" | "CHAPI", MergeObjects<[
5349
- DidKeyPluginMethods<DidMethod>,
5350
- VCPluginMethods,
5351
- VCTemplatePluginMethods,
5352
- VCResolutionPluginMethods,
5353
- IDXPluginMethods,
5354
- EthereumPluginMethods,
5355
- VpqrPluginMethods,
5356
- CHAPIPluginMethods
5357
- ]>>;
5358
- /**
5359
- * @group LearnCard
5360
- */
5361
- export declare type LearnCard<Methods extends keyof AllLearnCardMethods = keyof AllLearnCardMethods, RawWallet extends Wallet<any, any> = LearnCardRawWallet> = {
5362
- /** Raw IoE wallet instance. You shouldn't need to drop down to this level! */
5363
- _wallet: RawWallet;
5364
- } & Pick<AllLearnCardMethods, Methods>;
5365
- /**
5366
- * @group LearnCard
5367
- */
5368
- export declare type EmptyLearnCard = LearnCard<"newCredential" | "newPresentation" | "verifyCredential" | "verifyPresentation" | "resolveDid" | "installChapiHandler" | "activateChapiHandler" | "receiveChapiEvent" | "storePresentationViaChapi" | "storeCredentialViaChapiDidAuth", Wallet<"DIDKit" | "Expiration" | "VC Templates" | "CHAPI", MergeObjects<[
5369
- DidkitPluginMethods,
5370
- VerifyExtension,
5371
- VCTemplatePluginMethods,
5372
- CHAPIPluginMethods
5373
- ]>>>;
5374
- /**
5375
- * @group LearnCard
5376
- */
5377
- export declare type VCAPILearnCard = LearnCard<"did" | "newCredential" | "newPresentation" | "issueCredential" | "verifyCredential" | "issuePresentation" | "verifyPresentation" | "getTestVc" | "getTestVp" | "installChapiHandler" | "activateChapiHandler" | "receiveChapiEvent" | "storePresentationViaChapi" | "storeCredentialViaChapiDidAuth", Wallet<"VC API" | "Expiration" | "VC Templates" | "CHAPI", MergeObjects<[
5378
- VCAPIPluginMethods,
5379
- VerifyExtension,
5380
- VCTemplatePluginMethods,
5381
- CHAPIPluginMethods
5382
- ]>>>;
5223
+ /** @group LearnCard Plugin */
5224
+ export declare type LearnCardPlugin = Plugin<"LearnCard", any, LearnCardPluginMethods, any, LearnCardPluginDependentMethods>;
5383
5225
  /** @group LearnCard */
5384
5226
  export declare type LearnCardConfig = {
5385
- ceramicIdx: CeramicIDXArgs;
5227
+ ceramicIdx: CeramicArgs & IDXArgs;
5386
5228
  didkit: InitInput | Promise<InitInput>;
5387
- defaultContents: any[];
5388
5229
  ethereumConfig: EthereumConfig;
5230
+ debug?: typeof console.log;
5389
5231
  };
5390
5232
  /** @group Init Functions */
5391
- export declare type EmptyWallet = InitFunction<{}, "didkit", EmptyLearnCard>;
5233
+ export declare type EmptyLearnCard = InitFunction<{}, "didkit" | "debug", LearnCard<[
5234
+ DIDKitPlugin,
5235
+ ExpirationPlugin,
5236
+ VCTemplatePlugin,
5237
+ CHAPIPlugin,
5238
+ LearnCardPlugin
5239
+ ]>>;
5392
5240
  /** @group Init Functions */
5393
- export declare type WalletFromKey = InitFunction<{
5241
+ export declare type LearnCardFromSeed = InitFunction<{
5394
5242
  seed: string;
5395
- }, keyof LearnCardConfig, LearnCard>;
5243
+ }, keyof LearnCardConfig, LearnCard<[
5244
+ DIDKitPlugin,
5245
+ DidKeyPlugin<DidMethod>,
5246
+ VCPlugin,
5247
+ VCTemplatePlugin,
5248
+ VCResolutionPluginType,
5249
+ CeramicPlugin,
5250
+ IDXPlugin,
5251
+ ExpirationPlugin,
5252
+ EthereumPlugin,
5253
+ VpqrPlugin,
5254
+ CHAPIPlugin,
5255
+ LearnCardPlugin
5256
+ ]>>;
5396
5257
  /** @group Init Functions */
5397
- export declare type WalletFromVcApi = InitFunction<{
5258
+ export declare type LearnCardFromVcApi = InitFunction<{
5398
5259
  vcApi: true | string;
5399
5260
  did?: string;
5400
- }, "defaultContents", VCAPILearnCard>;
5261
+ }, "debug", LearnCard<[
5262
+ VCAPIPlugin,
5263
+ ExpirationPlugin,
5264
+ VCTemplatePlugin,
5265
+ CHAPIPlugin,
5266
+ LearnCardPlugin
5267
+ ]>>;
5268
+ /** @group Init Functions */
5269
+ export declare type CustomLearnCard = InitFunction<{
5270
+ custom: true;
5271
+ }, "debug", LearnCard<[
5272
+ ]>>;
5401
5273
  /** @group Init Functions */
5402
5274
  export declare type InitLearnCard = GenericInitFunction<[
5403
- EmptyWallet,
5404
- WalletFromKey,
5405
- WalletFromVcApi
5275
+ EmptyLearnCard,
5276
+ LearnCardFromSeed,
5277
+ LearnCardFromVcApi,
5278
+ CustomLearnCard
5406
5279
  ]>;
5280
+ /**
5281
+ * Generates a custom LearnCard with no plugins added
5282
+ *
5283
+ * @group Init Functions
5284
+ */
5285
+ export declare const customLearnCard: ({ debug }?: Partial<CustomLearnCard["args"]>) => Promise<CustomLearnCard["returnValue"]>;
5407
5286
  /**
5408
5287
  * Generates an empty wallet with no key material
5409
5288
  *
5410
5289
  * @group Init Functions
5411
5290
  */
5412
- export declare const emptyWallet: ({ didkit }?: EmptyWallet["args"]) => Promise<EmptyWallet["returnValue"]>;
5291
+ export declare const emptyLearnCard: ({ didkit, debug }?: EmptyLearnCard["args"]) => Promise<EmptyLearnCard["returnValue"]>;
5413
5292
  /**
5414
5293
  * Generates a LearnCard Wallet from a 64 character seed string
5415
5294
  *
5416
5295
  * @group Init Functions
5417
5296
  */
5418
- export declare const walletFromKey: (key: string, { ceramicIdx, didkit, defaultContents, ethereumConfig, }?: Partial<LearnCardConfig>) => Promise<LearnCard>;
5297
+ export declare const learnCardFromSeed: (seed: string, { ceramicIdx, didkit, ethereumConfig, debug, }?: Partial<LearnCardConfig>) => Promise<LearnCardFromSeed["returnValue"]>;
5419
5298
  /**
5420
5299
  * Generates a LearnCard Wallet from a 64 character seed string
5421
5300
  *
5422
5301
  * @group Init Functions
5423
5302
  */
5424
- export declare const walletFromApiUrl: (url: string, did?: string, { defaultContents }?: Partial<LearnCardConfig>) => Promise<WalletFromVcApi["returnValue"]>;
5303
+ export declare const learnCardFromApiUrl: ({ url, did, debug, }: {
5304
+ url: string;
5305
+ did?: string | undefined;
5306
+ debug?: {
5307
+ (...data: any[]): void;
5308
+ (message?: any, ...optionalParams: any[]): void;
5309
+ } | undefined;
5310
+ }) => Promise<LearnCardFromVcApi["returnValue"]>;
5425
5311
  /**
5426
5312
  * Generates an Empty Wallet
5427
5313
  *
5428
5314
  * @group Init Functions
5429
5315
  */
5430
- export declare function initLearnCard(config?: EmptyWallet["args"]): Promise<EmptyWallet["returnValue"]>;
5316
+ export declare function initLearnCard(config?: EmptyLearnCard["args"]): Promise<EmptyLearnCard["returnValue"]>;
5431
5317
  /**
5432
5318
  * Generates a full wallet from a 32 byte seed
5433
5319
  *
5434
5320
  * @group Init Functions
5435
5321
  */
5436
- export declare function initLearnCard(config: WalletFromKey["args"]): Promise<WalletFromKey["returnValue"]>;
5322
+ export declare function initLearnCard(config: LearnCardFromSeed["args"]): Promise<LearnCardFromSeed["returnValue"]>;
5437
5323
  /**
5438
5324
  * Generates a wallet that can sign VCs/VPs from a VC API
5439
5325
  *
5440
5326
  * @group Init Functions
5441
5327
  */
5442
- export declare function initLearnCard(config: WalletFromVcApi["args"]): Promise<WalletFromVcApi["returnValue"]>;
5328
+ export declare function initLearnCard(config: LearnCardFromVcApi["args"]): Promise<LearnCardFromVcApi["returnValue"]>;
5329
+ /**
5330
+ * Generates a custom wallet with no plugins added
5331
+ *
5332
+ * @group Init Functions
5333
+ */
5334
+ export declare function initLearnCard(config: CustomLearnCard["args"]): Promise<CustomLearnCard["returnValue"]>;
5443
5335
  /** @group Universal Wallets */
5444
- export declare const generateWallet: <PluginNames extends string, PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>>(contents?: any[], _wallet?: Partial<Wallet<any, PluginMethods>>) => Promise<Wallet<PluginNames, PluginMethods>>;
5336
+ export declare const generateLearnCard: <Plugins extends {
5337
+ name: string;
5338
+ displayName?: string | undefined;
5339
+ description?: string | undefined;
5340
+ methods: AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5341
+ _methods?: Record<never, never> | undefined;
5342
+ read?: {} | undefined;
5343
+ store?: {} | undefined;
5344
+ index?: {} | undefined;
5345
+ cache?: {} | undefined;
5346
+ id?: {} | undefined;
5347
+ }[] = [
5348
+ ], ControlPlanes extends GetPlanesForPlugins<Plugins> = GetPlanesForPlugins<Plugins>, PluginMethods extends GetPluginMethods<Plugins> = GetPluginMethods<Plugins>>(_learnCard?: Partial<LearnCard<Plugins, ControlPlanes, PluginMethods>>) => Promise<LearnCard<Plugins, ControlPlanes, PluginMethods>>;
5349
+ /**
5350
+ * @group Plugins
5351
+ */
5352
+ export declare const getCeramicPlugin: <URI extends string = "">(learnCard: {
5353
+ plugins: any;
5354
+ invoke: CeramicPluginDependentMethods<URI>;
5355
+ addPlugin: <NewPlugin extends {
5356
+ name: string;
5357
+ displayName?: string | undefined;
5358
+ description?: string | undefined;
5359
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5360
+ _methods?: Record<never, never> | undefined;
5361
+ read?: {} | undefined;
5362
+ store?: {} | undefined;
5363
+ index?: {} | undefined;
5364
+ cache?: {} | undefined;
5365
+ id?: {} | undefined;
5366
+ }>(plugin: NewPlugin) => Promise<{
5367
+ plugins: [
5368
+ ...any[],
5369
+ NewPlugin
5370
+ ];
5371
+ invoke: any;
5372
+ addPlugin: <NewPlugin_1 extends {
5373
+ name: string;
5374
+ displayName?: string | undefined;
5375
+ description?: string | undefined;
5376
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5377
+ _methods?: Record<never, never> | undefined;
5378
+ read?: {} | undefined;
5379
+ store?: {} | undefined;
5380
+ index?: {} | undefined;
5381
+ cache?: {} | undefined;
5382
+ id?: {} | undefined;
5383
+ }>(plugin: NewPlugin_1) => Promise<{
5384
+ plugins: [
5385
+ ...any[],
5386
+ NewPlugin,
5387
+ NewPlugin_1
5388
+ ];
5389
+ invoke: any;
5390
+ addPlugin: <NewPlugin_2 extends {
5391
+ name: string;
5392
+ displayName?: string | undefined;
5393
+ description?: string | undefined;
5394
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5395
+ _methods?: Record<never, never> | undefined;
5396
+ read?: {} | undefined;
5397
+ store?: {} | undefined;
5398
+ index?: {} | undefined;
5399
+ cache?: {} | undefined;
5400
+ id?: {} | undefined;
5401
+ }>(plugin: NewPlugin_2) => Promise<{
5402
+ plugins: [
5403
+ ...any[],
5404
+ NewPlugin,
5405
+ NewPlugin_1,
5406
+ NewPlugin_2
5407
+ ];
5408
+ invoke: any;
5409
+ addPlugin: <NewPlugin_3 extends {
5410
+ name: string;
5411
+ displayName?: string | undefined;
5412
+ description?: string | undefined;
5413
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5414
+ _methods?: Record<never, never> | undefined;
5415
+ read?: {} | undefined;
5416
+ store?: {} | undefined;
5417
+ index?: {} | undefined;
5418
+ cache?: {} | undefined;
5419
+ id?: {} | undefined;
5420
+ }>(plugin: NewPlugin_3) => Promise<{
5421
+ plugins: [
5422
+ ...any[],
5423
+ NewPlugin,
5424
+ NewPlugin_1,
5425
+ NewPlugin_2,
5426
+ NewPlugin_3
5427
+ ];
5428
+ invoke: any;
5429
+ addPlugin: <NewPlugin_4 extends {
5430
+ name: string;
5431
+ displayName?: string | undefined;
5432
+ description?: string | undefined;
5433
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5434
+ _methods?: Record<never, never> | undefined;
5435
+ read?: {} | undefined;
5436
+ store?: {} | undefined;
5437
+ index?: {} | undefined;
5438
+ cache?: {} | undefined;
5439
+ id?: {} | undefined;
5440
+ }>(plugin: NewPlugin_4) => Promise<{
5441
+ plugins: [
5442
+ ...any[],
5443
+ NewPlugin,
5444
+ NewPlugin_1,
5445
+ NewPlugin_2,
5446
+ NewPlugin_3,
5447
+ NewPlugin_4
5448
+ ];
5449
+ invoke: any;
5450
+ addPlugin: <NewPlugin_5 extends {
5451
+ name: string;
5452
+ displayName?: string | undefined;
5453
+ description?: string | undefined;
5454
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5455
+ _methods?: Record<never, never> | undefined;
5456
+ read?: {} | undefined;
5457
+ store?: {} | undefined;
5458
+ index?: {} | undefined;
5459
+ cache?: {} | undefined;
5460
+ id?: {} | undefined;
5461
+ }>(plugin: NewPlugin_5) => Promise<{
5462
+ plugins: [
5463
+ ...any[],
5464
+ NewPlugin,
5465
+ NewPlugin_1,
5466
+ NewPlugin_2,
5467
+ NewPlugin_3,
5468
+ NewPlugin_4,
5469
+ NewPlugin_5
5470
+ ];
5471
+ invoke: any;
5472
+ addPlugin: <NewPlugin_6 extends {
5473
+ name: string;
5474
+ displayName?: string | undefined;
5475
+ description?: string | undefined;
5476
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5477
+ _methods?: Record<never, never> | undefined;
5478
+ read?: {} | undefined;
5479
+ store?: {} | undefined;
5480
+ index?: {} | undefined;
5481
+ cache?: {} | undefined;
5482
+ id?: {} | undefined;
5483
+ }>(plugin: NewPlugin_6) => Promise<{
5484
+ plugins: [
5485
+ ...any[],
5486
+ NewPlugin,
5487
+ NewPlugin_1,
5488
+ NewPlugin_2,
5489
+ NewPlugin_3,
5490
+ NewPlugin_4,
5491
+ NewPlugin_5,
5492
+ NewPlugin_6
5493
+ ];
5494
+ invoke: any;
5495
+ addPlugin: <NewPlugin_7 extends {
5496
+ name: string;
5497
+ displayName?: string | undefined;
5498
+ description?: string | undefined;
5499
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5500
+ _methods?: Record<never, never> | undefined;
5501
+ read?: {} | undefined;
5502
+ store?: {} | undefined;
5503
+ index?: {} | undefined;
5504
+ cache?: {} | undefined;
5505
+ id?: {} | undefined;
5506
+ }>(plugin: NewPlugin_7) => Promise<{
5507
+ plugins: [
5508
+ ...any[],
5509
+ NewPlugin,
5510
+ NewPlugin_1,
5511
+ NewPlugin_2,
5512
+ NewPlugin_3,
5513
+ NewPlugin_4,
5514
+ NewPlugin_5,
5515
+ NewPlugin_6,
5516
+ NewPlugin_7
5517
+ ];
5518
+ invoke: any;
5519
+ addPlugin: <NewPlugin_8 extends {
5520
+ name: string;
5521
+ displayName?: string | undefined;
5522
+ description?: string | undefined;
5523
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5524
+ _methods?: Record<never, never> | undefined;
5525
+ read?: {} | undefined;
5526
+ store?: {} | undefined;
5527
+ index?: {} | undefined;
5528
+ cache?: {} | undefined;
5529
+ id?: {} | undefined;
5530
+ }>(plugin: NewPlugin_8) => Promise<{
5531
+ plugins: [
5532
+ ...any[],
5533
+ NewPlugin,
5534
+ NewPlugin_1,
5535
+ NewPlugin_2,
5536
+ NewPlugin_3,
5537
+ NewPlugin_4,
5538
+ NewPlugin_5,
5539
+ NewPlugin_6,
5540
+ NewPlugin_7,
5541
+ NewPlugin_8
5542
+ ];
5543
+ invoke: any;
5544
+ addPlugin: <NewPlugin_9 extends {
5545
+ name: string;
5546
+ displayName?: string | undefined;
5547
+ description?: string | undefined;
5548
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5549
+ _methods?: Record<never, never> | undefined;
5550
+ read?: {} | undefined;
5551
+ store?: {} | undefined;
5552
+ index?: {} | undefined;
5553
+ cache?: {} | undefined;
5554
+ id?: {} | undefined;
5555
+ }>(plugin: NewPlugin_9) => Promise<{
5556
+ plugins: [
5557
+ ...any[],
5558
+ NewPlugin,
5559
+ NewPlugin_1,
5560
+ NewPlugin_2,
5561
+ NewPlugin_3,
5562
+ NewPlugin_4,
5563
+ NewPlugin_5,
5564
+ NewPlugin_6,
5565
+ NewPlugin_7,
5566
+ NewPlugin_8,
5567
+ NewPlugin_9
5568
+ ];
5569
+ invoke: any;
5570
+ addPlugin: <NewPlugin_10 extends {
5571
+ name: string;
5572
+ displayName?: string | undefined;
5573
+ description?: string | undefined;
5574
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5575
+ _methods?: Record<never, never> | undefined;
5576
+ read?: {} | undefined;
5577
+ store?: {} | undefined;
5578
+ index?: {} | undefined;
5579
+ cache?: {} | undefined;
5580
+ id?: {} | undefined;
5581
+ }>(plugin: NewPlugin_10) => Promise<any>;
5582
+ debug?: {
5583
+ (...data: any[]): void;
5584
+ (message?: any, ...optionalParams: any[]): void;
5585
+ } | undefined;
5586
+ }>;
5587
+ debug?: {
5588
+ (...data: any[]): void;
5589
+ (message?: any, ...optionalParams: any[]): void;
5590
+ } | undefined;
5591
+ }>;
5592
+ debug?: {
5593
+ (...data: any[]): void;
5594
+ (message?: any, ...optionalParams: any[]): void;
5595
+ } | undefined;
5596
+ }>;
5597
+ debug?: {
5598
+ (...data: any[]): void;
5599
+ (message?: any, ...optionalParams: any[]): void;
5600
+ } | undefined;
5601
+ }>;
5602
+ debug?: {
5603
+ (...data: any[]): void;
5604
+ (message?: any, ...optionalParams: any[]): void;
5605
+ } | undefined;
5606
+ }>;
5607
+ debug?: {
5608
+ (...data: any[]): void;
5609
+ (message?: any, ...optionalParams: any[]): void;
5610
+ } | undefined;
5611
+ }>;
5612
+ debug?: {
5613
+ (...data: any[]): void;
5614
+ (message?: any, ...optionalParams: any[]): void;
5615
+ } | undefined;
5616
+ }>;
5617
+ debug?: {
5618
+ (...data: any[]): void;
5619
+ (message?: any, ...optionalParams: any[]): void;
5620
+ } | undefined;
5621
+ }>;
5622
+ debug?: {
5623
+ (...data: any[]): void;
5624
+ (message?: any, ...optionalParams: any[]): void;
5625
+ } | undefined;
5626
+ }>;
5627
+ debug?: {
5628
+ (...data: any[]): void;
5629
+ (message?: any, ...optionalParams: any[]): void;
5630
+ } | undefined;
5631
+ }>;
5632
+ debug?: {
5633
+ (...data: any[]): void;
5634
+ (message?: any, ...optionalParams: any[]): void;
5635
+ } | undefined;
5636
+ }, { ceramicEndpoint, defaultContentFamily }: CeramicArgs) => Promise<CeramicPlugin>;
5637
+ /**
5638
+ *
5639
+ * @group Plugins
5640
+ */
5641
+ export declare const getDidKeyPlugin: <DidMethod extends string>(learnCard: {
5642
+ plugins: any;
5643
+ invoke: DependentMethods<DidMethod>;
5644
+ addPlugin: <NewPlugin extends {
5645
+ name: string;
5646
+ displayName?: string | undefined;
5647
+ description?: string | undefined;
5648
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5649
+ _methods?: Record<never, never> | undefined;
5650
+ read?: {} | undefined;
5651
+ store?: {} | undefined;
5652
+ index?: {} | undefined;
5653
+ cache?: {} | undefined;
5654
+ id?: {} | undefined;
5655
+ }>(plugin: NewPlugin) => Promise<{
5656
+ plugins: [
5657
+ ...any[],
5658
+ NewPlugin
5659
+ ];
5660
+ invoke: any;
5661
+ addPlugin: <NewPlugin_1 extends {
5662
+ name: string;
5663
+ displayName?: string | undefined;
5664
+ description?: string | undefined;
5665
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5666
+ _methods?: Record<never, never> | undefined;
5667
+ read?: {} | undefined;
5668
+ store?: {} | undefined;
5669
+ index?: {} | undefined;
5670
+ cache?: {} | undefined;
5671
+ id?: {} | undefined;
5672
+ }>(plugin: NewPlugin_1) => Promise<{
5673
+ plugins: [
5674
+ ...any[],
5675
+ NewPlugin,
5676
+ NewPlugin_1
5677
+ ];
5678
+ invoke: any;
5679
+ addPlugin: <NewPlugin_2 extends {
5680
+ name: string;
5681
+ displayName?: string | undefined;
5682
+ description?: string | undefined;
5683
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5684
+ _methods?: Record<never, never> | undefined;
5685
+ read?: {} | undefined;
5686
+ store?: {} | undefined;
5687
+ index?: {} | undefined;
5688
+ cache?: {} | undefined;
5689
+ id?: {} | undefined;
5690
+ }>(plugin: NewPlugin_2) => Promise<{
5691
+ plugins: [
5692
+ ...any[],
5693
+ NewPlugin,
5694
+ NewPlugin_1,
5695
+ NewPlugin_2
5696
+ ];
5697
+ invoke: any;
5698
+ addPlugin: <NewPlugin_3 extends {
5699
+ name: string;
5700
+ displayName?: string | undefined;
5701
+ description?: string | undefined;
5702
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5703
+ _methods?: Record<never, never> | undefined;
5704
+ read?: {} | undefined;
5705
+ store?: {} | undefined;
5706
+ index?: {} | undefined;
5707
+ cache?: {} | undefined;
5708
+ id?: {} | undefined;
5709
+ }>(plugin: NewPlugin_3) => Promise<{
5710
+ plugins: [
5711
+ ...any[],
5712
+ NewPlugin,
5713
+ NewPlugin_1,
5714
+ NewPlugin_2,
5715
+ NewPlugin_3
5716
+ ];
5717
+ invoke: any;
5718
+ addPlugin: <NewPlugin_4 extends {
5719
+ name: string;
5720
+ displayName?: string | undefined;
5721
+ description?: string | undefined;
5722
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5723
+ _methods?: Record<never, never> | undefined;
5724
+ read?: {} | undefined;
5725
+ store?: {} | undefined;
5726
+ index?: {} | undefined;
5727
+ cache?: {} | undefined;
5728
+ id?: {} | undefined;
5729
+ }>(plugin: NewPlugin_4) => Promise<{
5730
+ plugins: [
5731
+ ...any[],
5732
+ NewPlugin,
5733
+ NewPlugin_1,
5734
+ NewPlugin_2,
5735
+ NewPlugin_3,
5736
+ NewPlugin_4
5737
+ ];
5738
+ invoke: any;
5739
+ addPlugin: <NewPlugin_5 extends {
5740
+ name: string;
5741
+ displayName?: string | undefined;
5742
+ description?: string | undefined;
5743
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5744
+ _methods?: Record<never, never> | undefined;
5745
+ read?: {} | undefined;
5746
+ store?: {} | undefined;
5747
+ index?: {} | undefined;
5748
+ cache?: {} | undefined;
5749
+ id?: {} | undefined;
5750
+ }>(plugin: NewPlugin_5) => Promise<{
5751
+ plugins: [
5752
+ ...any[],
5753
+ NewPlugin,
5754
+ NewPlugin_1,
5755
+ NewPlugin_2,
5756
+ NewPlugin_3,
5757
+ NewPlugin_4,
5758
+ NewPlugin_5
5759
+ ];
5760
+ invoke: any;
5761
+ addPlugin: <NewPlugin_6 extends {
5762
+ name: string;
5763
+ displayName?: string | undefined;
5764
+ description?: string | undefined;
5765
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5766
+ _methods?: Record<never, never> | undefined;
5767
+ read?: {} | undefined;
5768
+ store?: {} | undefined;
5769
+ index?: {} | undefined;
5770
+ cache?: {} | undefined;
5771
+ id?: {} | undefined;
5772
+ }>(plugin: NewPlugin_6) => Promise<{
5773
+ plugins: [
5774
+ ...any[],
5775
+ NewPlugin,
5776
+ NewPlugin_1,
5777
+ NewPlugin_2,
5778
+ NewPlugin_3,
5779
+ NewPlugin_4,
5780
+ NewPlugin_5,
5781
+ NewPlugin_6
5782
+ ];
5783
+ invoke: any;
5784
+ addPlugin: <NewPlugin_7 extends {
5785
+ name: string;
5786
+ displayName?: string | undefined;
5787
+ description?: string | undefined;
5788
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5789
+ _methods?: Record<never, never> | undefined;
5790
+ read?: {} | undefined;
5791
+ store?: {} | undefined;
5792
+ index?: {} | undefined;
5793
+ cache?: {} | undefined;
5794
+ id?: {} | undefined;
5795
+ }>(plugin: NewPlugin_7) => Promise<{
5796
+ plugins: [
5797
+ ...any[],
5798
+ NewPlugin,
5799
+ NewPlugin_1,
5800
+ NewPlugin_2,
5801
+ NewPlugin_3,
5802
+ NewPlugin_4,
5803
+ NewPlugin_5,
5804
+ NewPlugin_6,
5805
+ NewPlugin_7
5806
+ ];
5807
+ invoke: any;
5808
+ addPlugin: <NewPlugin_8 extends {
5809
+ name: string;
5810
+ displayName?: string | undefined;
5811
+ description?: string | undefined;
5812
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5813
+ _methods?: Record<never, never> | undefined;
5814
+ read?: {} | undefined;
5815
+ store?: {} | undefined;
5816
+ index?: {} | undefined;
5817
+ cache?: {} | undefined;
5818
+ id?: {} | undefined;
5819
+ }>(plugin: NewPlugin_8) => Promise<{
5820
+ plugins: [
5821
+ ...any[],
5822
+ NewPlugin,
5823
+ NewPlugin_1,
5824
+ NewPlugin_2,
5825
+ NewPlugin_3,
5826
+ NewPlugin_4,
5827
+ NewPlugin_5,
5828
+ NewPlugin_6,
5829
+ NewPlugin_7,
5830
+ NewPlugin_8
5831
+ ];
5832
+ invoke: any;
5833
+ addPlugin: <NewPlugin_9 extends {
5834
+ name: string;
5835
+ displayName?: string | undefined;
5836
+ description?: string | undefined;
5837
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5838
+ _methods?: Record<never, never> | undefined;
5839
+ read?: {} | undefined;
5840
+ store?: {} | undefined;
5841
+ index?: {} | undefined;
5842
+ cache?: {} | undefined;
5843
+ id?: {} | undefined;
5844
+ }>(plugin: NewPlugin_9) => Promise<{
5845
+ plugins: [
5846
+ ...any[],
5847
+ NewPlugin,
5848
+ NewPlugin_1,
5849
+ NewPlugin_2,
5850
+ NewPlugin_3,
5851
+ NewPlugin_4,
5852
+ NewPlugin_5,
5853
+ NewPlugin_6,
5854
+ NewPlugin_7,
5855
+ NewPlugin_8,
5856
+ NewPlugin_9
5857
+ ];
5858
+ invoke: any;
5859
+ addPlugin: <NewPlugin_10 extends {
5860
+ name: string;
5861
+ displayName?: string | undefined;
5862
+ description?: string | undefined;
5863
+ methods: import("types/wallet").AddImplicitLearnCardArgument<Record<never, never>, any, Record<never, never>, never, Record<never, never>>;
5864
+ _methods?: Record<never, never> | undefined;
5865
+ read?: {} | undefined;
5866
+ store?: {} | undefined;
5867
+ index?: {} | undefined;
5868
+ cache?: {} | undefined;
5869
+ id?: {} | undefined;
5870
+ }>(plugin: NewPlugin_10) => Promise<any>;
5871
+ debug?: {
5872
+ (...data: any[]): void;
5873
+ (message?: any, ...optionalParams: any[]): void;
5874
+ } | undefined;
5875
+ }>;
5876
+ debug?: {
5877
+ (...data: any[]): void;
5878
+ (message?: any, ...optionalParams: any[]): void;
5879
+ } | undefined;
5880
+ }>;
5881
+ debug?: {
5882
+ (...data: any[]): void;
5883
+ (message?: any, ...optionalParams: any[]): void;
5884
+ } | undefined;
5885
+ }>;
5886
+ debug?: {
5887
+ (...data: any[]): void;
5888
+ (message?: any, ...optionalParams: any[]): void;
5889
+ } | undefined;
5890
+ }>;
5891
+ debug?: {
5892
+ (...data: any[]): void;
5893
+ (message?: any, ...optionalParams: any[]): void;
5894
+ } | undefined;
5895
+ }>;
5896
+ debug?: {
5897
+ (...data: any[]): void;
5898
+ (message?: any, ...optionalParams: any[]): void;
5899
+ } | undefined;
5900
+ }>;
5901
+ debug?: {
5902
+ (...data: any[]): void;
5903
+ (message?: any, ...optionalParams: any[]): void;
5904
+ } | undefined;
5905
+ }>;
5906
+ debug?: {
5907
+ (...data: any[]): void;
5908
+ (message?: any, ...optionalParams: any[]): void;
5909
+ } | undefined;
5910
+ }>;
5911
+ debug?: {
5912
+ (...data: any[]): void;
5913
+ (message?: any, ...optionalParams: any[]): void;
5914
+ } | undefined;
5915
+ }>;
5916
+ debug?: {
5917
+ (...data: any[]): void;
5918
+ (message?: any, ...optionalParams: any[]): void;
5919
+ } | undefined;
5920
+ }>;
5921
+ debug?: {
5922
+ (...data: any[]): void;
5923
+ (message?: any, ...optionalParams: any[]): void;
5924
+ } | undefined;
5925
+ }, key: string, defaultDidMethod: DidMethod) => Promise<DidKeyPlugin<DidMethod>>;
5926
+ /**
5927
+ * @group Plugins
5928
+ */
5929
+ export declare const getEthereumPlugin: (initLearnCard: LearnCard<any, "id">, config: EthereumConfig) => EthereumPlugin;
5930
+ /**
5931
+ * @group Plugins
5932
+ */
5933
+ export declare const expirationPlugin: (learnCard: LearnCard<any, any, VerifyExtension>) => ExpirationPlugin;
5934
+ /**
5935
+ * @group Plugins
5936
+ */
5937
+ export declare const getIDXPlugin: <URI extends string = "">(learnCard: LearnCard<any, "read", IDXPluginDependentMethods<URI>>, { modelData, credentialAlias }: IDXArgs) => Promise<IDXPlugin>;
5938
+ export declare type TestCachePlugin = Plugin<"Test Cache", "cache">;
5939
+ export declare const getTestCache: () => TestCachePlugin;
5940
+ /**
5941
+ * @group Plugins
5942
+ */
5943
+ export declare const getVCAPIPlugin: ({ url, did, }: {
5944
+ url: string;
5945
+ did?: string;
5946
+ }) => Promise<VCAPIPlugin>;
5947
+ /**
5948
+ * @group Plugins
5949
+ */
5950
+ export declare const getVpqrPlugin: (learnCard: LearnCard<any, any, VpqrPluginDependentMethods>) => VpqrPlugin;
5445
5951
  export * from "@wallet/init";
5446
- export { Wallet, Plugin } from "types/wallet";
5952
+ export { LearnCard, Plugin } from "types/wallet";
5447
5953
  export * from "types/LearnCard";
5448
5954
  export * from "@wallet/base";
5449
5955
  export * from "@wallet/plugins";