UNPKG

@cruxpay/js-sdk

Version:

CruxPay Javascript SDK

40 lines (39 loc) 1.85 kB
import { CruxUser, ICruxUserData } from "../../core/entities/crux-user"; import { ICruxBlockstackInfrastructure } from "../../core/interfaces"; import { ICruxUserRepository, ICruxUserRepositoryOptions } from "../../core/interfaces/crux-user-repository"; import { IKeyManager } from "../../core/interfaces/key-manager"; import { CruxId } from "../../packages/identity-utils"; import { StorageService } from "../../packages/storage"; export interface ICruxpayObject { "__userData__"?: ICruxUserData; [assetId: string]: string | ICruxUserData | undefined; } export interface ICruxpayObjectAndPubKey { "cruxpayObject": ICruxpayObject; "pubKey": string; } export interface IBlockstackCruxUserRepositoryOptions extends ICruxUserRepositoryOptions { blockstackInfrastructure: ICruxBlockstackInfrastructure; cacheStorage?: StorageService; } export declare class BlockstackCruxUserRepository implements ICruxUserRepository { private cacheStorage?; private infrastructure; private blockstackService; private cruxDomain?; constructor(options: IBlockstackCruxUserRepositoryOptions); create: (cruxIdSubdomain: string, keyManager: IKeyManager) => Promise<CruxUser>; isCruxIdAvailable: (cruxIdSubdomain: string) => Promise<boolean>; getByCruxId: (cruxID: CruxId, tag?: string | undefined, onlyRegistered?: boolean) => Promise<CruxUser | undefined>; getWithKey: (keyManager: IKeyManager) => Promise<CruxUser | undefined>; save: (cruxUser: CruxUser, keyManager: IKeyManager) => Promise<CruxUser>; private getCruxDomain; private getCruxIdFromSubdomain; private getUserCruxDomain; private getCruxpayObjectAndPubKey; private putCruxpayObject; private getContentByFilename; private putContentByFilename; private constructCruxpayObject; private dereferenceCruxpayObject; }