@learncard/core 1.5.1 → 2.0.0

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
@@ -4663,31 +4663,20 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
4663
4663
  export declare type Plugin<Name extends string, PublicMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4664
4664
  name?: Name;
4665
4665
  pluginMethods: {
4666
- [Key in keyof PublicMethods]: <T extends UnlockedWallet<any, PublicMethods>>(wallet: T, ...args: Parameters<PublicMethods[Key]>) => ReturnType<PublicMethods[Key]>;
4666
+ [Key in keyof PublicMethods]: <T extends Wallet<any, PublicMethods>>(wallet: T, ...args: Parameters<PublicMethods[Key]>) => ReturnType<PublicMethods[Key]>;
4667
4667
  };
4668
4668
  };
4669
4669
  export declare type PublicFieldsObj<PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = {
4670
4670
  pluginMethods: PluginMethods;
4671
4671
  };
4672
- declare enum WalletStatus {
4673
- Locked = "LOCKED",
4674
- Unlocked = "UNLOCKED"
4675
- }
4676
- export declare type BaseWallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = PublicFieldsObj<PluginMethods> & {
4672
+ export declare type Wallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = PublicFieldsObj<PluginMethods> & {
4677
4673
  contents: any[];
4678
4674
  plugins: Plugin<PluginNames, Record<string, (...args: any[]) => any>>[];
4675
+ add: (content: any) => Promise<Wallet<PluginNames, PluginMethods>>;
4676
+ remove: (contentId: string) => Promise<Wallet<PluginNames, PluginMethods>>;
4677
+ 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 : PluginMethods & Methods>>;
4679
4678
  };
4680
- export declare type LockedWallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = BaseWallet<PluginNames, PluginMethods> & {
4681
- status: WalletStatus.Locked;
4682
- };
4683
- export declare type UnlockedWallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = BaseWallet<PluginNames, PluginMethods> & {
4684
- status: WalletStatus.Unlocked;
4685
- add: (content: any) => Promise<UnlockedWallet<PluginNames, PluginMethods>>;
4686
- remove: (contentId: string) => Promise<UnlockedWallet<PluginNames, PluginMethods>>;
4687
- addPlugin: <Name extends string, Methods extends Record<string, (...args: any[]) => any> = Record<never, never>>(plugin: Plugin<Name, Methods>) => Promise<UnlockedWallet<"" extends PluginNames ? Name : PluginNames | Name, Record<never, never> extends PluginMethods ? Methods : PluginMethods & Methods>>;
4688
- };
4689
- export declare type Wallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = LockedWallet<PluginNames, PluginMethods> | UnlockedWallet<PluginNames, PluginMethods>;
4690
- export declare type LearnCardRawWallet = UnlockedWallet<"DIDKit" | "DID Key" | "VC" | "IDX" | "Expiration" | "Ethereum", DidKeyPluginMethods<DidMethod> & VCPluginMethods & IDXPluginMethods & EthereumPluginMethods>;
4679
+ export declare type LearnCardRawWallet = Wallet<"DIDKit" | "DID Key" | "VC" | "IDX" | "Expiration" | "Ethereum", DidKeyPluginMethods<DidMethod> & VCPluginMethods & IDXPluginMethods & EthereumPluginMethods>;
4691
4680
  export declare type LearnCardWallet = {
4692
4681
  /** Raw IoE wallet instance. You shouldn't need to drop down to this level! */
4693
4682
  _wallet: LearnCardRawWallet;
@@ -4778,6 +4767,6 @@ export declare type LearnCardConfig = {
4778
4767
  /** Generates a LearnCard Wallet from a 64 character seed string */
4779
4768
  export declare const walletFromKey: (key: string, { ceramicIdx, didkit, defaultContents, ethereumConfig, }?: Partial<LearnCardConfig>) => Promise<LearnCardWallet>;
4780
4769
  export { walletFromKey } from "@wallet/init";
4781
- export { Wallet, UnlockedWallet, LockedWallet, Plugin } from "types/wallet";
4770
+ export { Wallet, Plugin } from "types/wallet";
4782
4771
 
4783
4772
  export {};
package/dist/core.esm.js CHANGED
@@ -30756,7 +30756,6 @@ var generateWallet = /* @__PURE__ */ __name((..._0) => __async(void 0, [..._0],
30756
30756
  remove: function(contentId) {
30757
30757
  return removeFromWallet(this, contentId);
30758
30758
  },
30759
- status: "UNLOCKED" /* Unlocked */,
30760
30759
  plugins,
30761
30760
  pluginMethods,
30762
30761
  addPlugin: function(plugin) {