index.d.ts 1.5 KB

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