index.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 * from './storage';
  6. export * from './storage-node';
  7. export * from './webclient';
  8. export * from './webclient-fetch';
  9. export * from './webclient-options';
  10. export * from './content-item';
  11. export * from './content-link';
  12. export * from './content-params';
  13. export * from './upload-item-link';
  14. export * from './upload-item-parameters';
  15. export * from './util';
  16. export declare class BankClient {
  17. private urlBase;
  18. private ipfsUrlBase;
  19. private storage;
  20. private webClient;
  21. static parseBankLink(bankLink: string): {
  22. host: string | undefined;
  23. address: string;
  24. topic: string;
  25. };
  26. private privateKey;
  27. private wsUrlBase;
  28. private bootstrapPromise;
  29. private bootstrapResult;
  30. constructor(urlBase: string, ipfsUrlBase: string, storage?: Storage, webClient?: IWebClient);
  31. getPub(): Promise<string>;
  32. bootstrap(): any;
  33. getNonce(): Promise<number>;
  34. getBalance(): Promise<number>;
  35. upload(params: UploadItemParameters): Promise<any>;
  36. uploadSlimJSON(item: any): Promise<any>;
  37. uploadSlimText(item: string): Promise<any>;
  38. appendBank(bankAddress: string, bankTopic: string, itemHash: string): Promise<void>;
  39. retrievePrivate(peerAddr: string, topic: string): Promise<string>;
  40. subscribePrivate(peerAddr: string, topic: string, connectCallback: () => void, messageCallback: (data: any) => void): Promise<void>;
  41. appendPrivate(peerAddr: string, topic: string, hash?: string, replaceHash?: string, deleteHash?: string): Promise<void>;
  42. getOrCreateContact(peerId: string, contactAddr: string): Promise<any>;
  43. getContactById(peerId: string, contactId: string): Promise<any>;
  44. updateContact(peerId: string, contactId: string, newProperties: any): Promise<any>;
  45. getContentItemByHash(hash: string): Promise<ContentItem>;
  46. private connectWebsocket;
  47. private getItemsForCommaList;
  48. private getPriv;
  49. private makePlaintextPayload;
  50. }