|
|
@@ -5,12 +5,11 @@ import { Storage } from './storage';
|
|
|
import { IWebClient } from './webclient';
|
|
|
const TextEncoder = util.TextEncoder;
|
|
|
import WebSocket from 'ws';
|
|
|
+import { ContentItem } from './content-item';
|
|
|
+import { ContentParams } from './content-params';
|
|
|
import { UploadItemParameters } from './upload-item-parameters';
|
|
|
import { encodeHex, mergeDeep, uuid } from './util';
|
|
|
import WebClientNode from './webclient-node';
|
|
|
-import { reject, resolve } from 'bluebird';
|
|
|
-import { ContentParams } from './content-params';
|
|
|
-import { ContentItem } from './content-item';
|
|
|
|
|
|
export class BankClient {
|
|
|
|
|
|
@@ -246,13 +245,14 @@ export class BankClient {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public async appendPrivate(peerAddr: string, topic: string, hash: string, replaceHash?: string) {
|
|
|
+ public async appendPrivate(peerAddr: string, topic: string, hash: string, replaceHash?: string, deleteHash?: string) {
|
|
|
const nonce = await this.getNonce();
|
|
|
const payload = await this.makePlaintextPayload(JSON.stringify({
|
|
|
_date: new Date().toISOString(),
|
|
|
_nonce: nonce,
|
|
|
+ deleteHash,
|
|
|
hash,
|
|
|
- replaceHash
|
|
|
+ replaceHash,
|
|
|
}));
|
|
|
const topicURL = this.urlBase + '/bank/private/' + encodeURIComponent(peerAddr) + '/' + encodeURIComponent(topic);
|
|
|
const result = await this.webClient.request({
|