diff --git a/src/interfaces.ts b/src/interfaces.ts index b87c23a..7787ea5 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -266,6 +266,16 @@ export interface ICoreKit { */ getKeyDetails(): MPCKeyDetails; + /** + * Get specific general domain's metadata which is used by plugin or modules. + */ + getGeneralStoreDomain(domain: string): T; + + /** + * Set specific general domain's metadata which is used by plugin or modules. + */ + setGeneralStoreDomain(domain: string, value: T): void; + /** * Commit the changes made to the user's account when in manual sync mode. */ diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index f1100c7..96a7fbc 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -985,6 +985,15 @@ export class Web3AuthMPCCoreKit implements ICoreKit { this.state = { ...this.state, ...newState }; } + public getGeneralStoreDomain(domain: string): T { + return this.tkey.metadata.getGeneralStoreDomain(domain) as T; + } + + public setGeneralStoreDomain(domain: string, value: T): void { + // should we add check for root flag before allow to mutate metadata? + this.tkey.metadata.setGeneralStoreDomain(domain, value); + } + protected async atomicSync(f: () => Promise): Promise { this.atomicCallStackCounter += 1;