index.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Storage } from './storage';
  2. import { IWebClient } from './webclient';
  3. import { ContentItem } from './content-item';
  4. import { UploadItemParameters } from './upload-item-parameters';
  5. export declare class BankClient {
  6. private urlBase;
  7. private ipfsUrlBase;
  8. private storage;
  9. private webClient;
  10. static parseBankLink(bankLink: string): {
  11. host: string | undefined;
  12. address: string;
  13. topic: string;
  14. };
  15. private privateKey;
  16. private wsUrlBase;
  17. private bootstrapPromise;
  18. private bootstrapResult;
  19. constructor(urlBase: string, ipfsUrlBase: string, storage?: Storage, webClient?: IWebClient);
  20. getPub(): Promise<string>;
  21. bootstrap(): any;
  22. getNonce(): Promise<number>;
  23. getBalance(): Promise<number>;
  24. upload(params: UploadItemParameters): Promise<any>;
  25. uploadSlimJSON(item: any): Promise<any>;
  26. uploadSlimText(item: string): Promise<any>;
  27. appendBank(bankAddress: string, bankTopic: string, itemHash: string): Promise<void>;
  28. retrievePrivate(peerAddr: string, topic: string): Promise<string>;
  29. subscribePrivate(peerAddr: string, topic: string, callback: () => void): Promise<void>;
  30. appendPrivate(peerAddr: string, topic: string, hash?: string, replaceHash?: string, deleteHash?: string): Promise<void>;
  31. getOrCreateContact(peerId: string, contactAddr: string): Promise<any>;
  32. getContactById(peerId: string, contactId: string): Promise<any>;
  33. updateContact(peerId: string, contactId: string, newProperties: any): Promise<any>;
  34. getContentItemByHash(hash: string): Promise<ContentItem>;
  35. private connectWebsocket;
  36. private getItemsForCommaList;
  37. private getPriv;
  38. private makePlaintextPayload;
  39. }