index.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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 bootstrapPromise;
  16. private bootstrapResult;
  17. constructor(urlBase: string, ipfsUrlBase: string, storage?: Storage, webClient?: IWebClient);
  18. getPub(): Promise<string>;
  19. bootstrap(): any;
  20. getNonce(): Promise<number>;
  21. getBalance(): Promise<number>;
  22. upload(params: UploadItemParameters): Promise<any>;
  23. uploadSlimJSON(item: any): Promise<any>;
  24. uploadSlimText(item: string): Promise<any>;
  25. appendBank(bankAddress: string, bankTopic: string, itemHash: string): Promise<void>;
  26. retrievePrivate(peerAddr: string, topic: string): Promise<string>;
  27. appendPrivate(peerAddr: string, topic: string, hash: string, replaceHash?: string): Promise<void>;
  28. getOrCreateContact(peerId: string, contactAddr: string): Promise<any>;
  29. getContactById(peerId: string, contactId: string): Promise<any>;
  30. updateContact(peerId: string, contactId: string, newProperties: any): Promise<any>;
  31. private getItemsForCommaList;
  32. private getPriv;
  33. private makePlaintextPayload;
  34. }