@learncard/core 1.3.1 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/core.cjs.development.js +15732 -2008
- package/dist/core.cjs.development.js.map +3 -3
- package/dist/core.cjs.production.min.js +164 -161
- package/dist/core.cjs.production.min.js.map +3 -3
- package/dist/core.d.ts +34 -7
- package/dist/core.esm.js +15733 -2009
- package/dist/core.esm.js.map +3 -3
- package/dist/didkit/didkit_wasm.d.ts +11 -0
- package/dist/didkit/didkit_wasm.js +57 -4
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +2 -0
- package/dist/didkit_wasm.d.ts +11 -0
- package/dist/didkit_wasm.js +57 -4
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +2 -0
- package/package.json +3 -1
- package/dist/README.md +0 -89
- package/dist/didkit/README.md +0 -89
- package/dist/didkit/package.json +0 -15
- package/dist/package.json +0 -15
package/dist/core.d.ts
CHANGED
@@ -4590,27 +4590,40 @@ declare const VerificationItemValidator: z.ZodObject<{
|
|
4590
4590
|
check: string;
|
4591
4591
|
}>;
|
4592
4592
|
export declare type VerificationItem = z.infer<typeof VerificationItemValidator>;
|
4593
|
-
export declare type DidMethod = "key" | "tz" | "pkh
|
4593
|
+
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}`;
|
4594
4594
|
export declare type KeyPair = {
|
4595
4595
|
kty: string;
|
4596
4596
|
crv: string;
|
4597
4597
|
x: string;
|
4598
|
+
y?: string;
|
4598
4599
|
d: string;
|
4599
4600
|
};
|
4600
4601
|
export declare type ProofOptions = {
|
4601
4602
|
verificationMethod: string;
|
4602
4603
|
proofPurpose: string;
|
4603
4604
|
};
|
4604
|
-
export declare type
|
4605
|
-
|
4606
|
-
|
4605
|
+
export declare type Algorithm = "ed25519" | "secp256k1";
|
4606
|
+
export declare type DidKeyPluginMethods<DidMethod extends string> = {
|
4607
|
+
getSubjectDid: (type: DidMethod) => string;
|
4608
|
+
getSubjectKeypair: (type?: Algorithm) => {
|
4607
4609
|
kty: string;
|
4608
4610
|
crv: string;
|
4609
4611
|
x: string;
|
4612
|
+
y?: string;
|
4610
4613
|
d: string;
|
4611
4614
|
};
|
4612
4615
|
getKey: () => string;
|
4613
4616
|
};
|
4617
|
+
export declare type EthereumPluginMethods = {
|
4618
|
+
checkMyEth: () => Promise<string>;
|
4619
|
+
checkMyDai: () => Promise<string>;
|
4620
|
+
checkMyUsdc: () => Promise<string>;
|
4621
|
+
};
|
4622
|
+
export declare type EthereumConfig = {
|
4623
|
+
address: string;
|
4624
|
+
infuraProjectId?: string;
|
4625
|
+
network?: providers.Networkish;
|
4626
|
+
};
|
4614
4627
|
export declare type IDXPluginMethods = {
|
4615
4628
|
getCredentialsListFromIndex: (alias?: string) => Promise<CredentialsList>;
|
4616
4629
|
publishContentToCeramic: (cred: any) => Promise<string>;
|
@@ -4674,17 +4687,18 @@ export declare type UnlockedWallet<PluginNames extends string = "", PluginMethod
|
|
4674
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>>;
|
4675
4688
|
};
|
4676
4689
|
export declare type Wallet<PluginNames extends string = "", PluginMethods extends Record<string, (...args: any[]) => any> = Record<never, never>> = LockedWallet<PluginNames, PluginMethods> | UnlockedWallet<PluginNames, PluginMethods>;
|
4677
|
-
export declare type LearnCardRawWallet = UnlockedWallet<"DIDKit" | "DID Key" | "VC" | "IDX" | "Expiration", DidKeyPluginMethods<DidMethod> & VCPluginMethods & IDXPluginMethods>;
|
4690
|
+
export declare type LearnCardRawWallet = UnlockedWallet<"DIDKit" | "DID Key" | "VC" | "IDX" | "Expiration" | "Ethereum", DidKeyPluginMethods<DidMethod> & VCPluginMethods & IDXPluginMethods & EthereumPluginMethods>;
|
4678
4691
|
export declare type LearnCardWallet = {
|
4679
4692
|
/** Raw IoE wallet instance. You shouldn't need to drop down to this level! */
|
4680
4693
|
_wallet: LearnCardRawWallet;
|
4681
4694
|
/** Wallet holder's did */
|
4682
4695
|
did: (type?: DidMethod) => string;
|
4683
4696
|
/** Wallet holder's ed25519 key pair */
|
4684
|
-
keypair: {
|
4697
|
+
keypair: (type?: Algorithm) => {
|
4685
4698
|
kty: string;
|
4686
4699
|
crv: string;
|
4687
4700
|
x: string;
|
4701
|
+
y?: string;
|
4688
4702
|
d: string;
|
4689
4703
|
};
|
4690
4704
|
/** Signs an unsigned Verifiable Credential, returning the signed VC */
|
@@ -4736,6 +4750,18 @@ export declare type LearnCardWallet = {
|
|
4736
4750
|
* You can use this to test out implementations that use this library!
|
4737
4751
|
*/
|
4738
4752
|
getTestVc: (subject?: string) => UnsignedVC;
|
4753
|
+
/**
|
4754
|
+
* Returns your ETH balance
|
4755
|
+
*/
|
4756
|
+
checkMyEth: () => Promise<string>;
|
4757
|
+
/**
|
4758
|
+
* Returns your DAI balance
|
4759
|
+
*/
|
4760
|
+
checkMyDai: () => Promise<string>;
|
4761
|
+
/**
|
4762
|
+
* Returns your USDC balance
|
4763
|
+
*/
|
4764
|
+
checkMyUsdc: () => Promise<string>;
|
4739
4765
|
};
|
4740
4766
|
export declare type CeramicIDXArgs = {
|
4741
4767
|
modelData: ModelAliases;
|
@@ -4747,9 +4773,10 @@ export declare type LearnCardConfig = {
|
|
4747
4773
|
ceramicIdx: CeramicIDXArgs;
|
4748
4774
|
didkit: InitInput | Promise<InitInput>;
|
4749
4775
|
defaultContents: any[];
|
4776
|
+
ethereumConfig: EthereumConfig;
|
4750
4777
|
};
|
4751
4778
|
/** Generates a LearnCard Wallet from a 64 character seed string */
|
4752
|
-
export declare const walletFromKey: (key: string, { ceramicIdx, didkit, defaultContents, }?: Partial<LearnCardConfig>) => Promise<LearnCardWallet>;
|
4779
|
+
export declare const walletFromKey: (key: string, { ceramicIdx, didkit, defaultContents, ethereumConfig, }?: Partial<LearnCardConfig>) => Promise<LearnCardWallet>;
|
4753
4780
|
export { walletFromKey } from "@wallet/init";
|
4754
4781
|
export { Wallet, UnlockedWallet, LockedWallet, Plugin } from "types/wallet";
|
4755
4782
|
|