|
@@ -16,9 +16,9 @@ const util = require("util");
|
|
|
const storage_1 = require("./storage");
|
|
const storage_1 = require("./storage");
|
|
|
const TextEncoder = util.TextEncoder;
|
|
const TextEncoder = util.TextEncoder;
|
|
|
const ws_1 = __importDefault(require("ws"));
|
|
const ws_1 = __importDefault(require("ws"));
|
|
|
|
|
+const content_item_1 = require("./content-item");
|
|
|
const util_1 = require("./util");
|
|
const util_1 = require("./util");
|
|
|
const webclient_node_1 = __importDefault(require("./webclient-node"));
|
|
const webclient_node_1 = __importDefault(require("./webclient-node"));
|
|
|
-const content_item_1 = require("./content-item");
|
|
|
|
|
class BankClient {
|
|
class BankClient {
|
|
|
constructor(urlBase, ipfsUrlBase, storage = new storage_1.Storage('bankClient'), webClient = new webclient_node_1.default()) {
|
|
constructor(urlBase, ipfsUrlBase, storage = new storage_1.Storage('bankClient'), webClient = new webclient_node_1.default()) {
|
|
|
this.urlBase = urlBase;
|
|
this.urlBase = urlBase;
|
|
@@ -249,14 +249,15 @@ class BankClient {
|
|
|
});
|
|
});
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
- appendPrivate(peerAddr, topic, hash, replaceHash) {
|
|
|
|
|
|
|
+ appendPrivate(peerAddr, topic, hash, replaceHash, deleteHash) {
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
const nonce = yield this.getNonce();
|
|
const nonce = yield this.getNonce();
|
|
|
const payload = yield this.makePlaintextPayload(JSON.stringify({
|
|
const payload = yield this.makePlaintextPayload(JSON.stringify({
|
|
|
_date: new Date().toISOString(),
|
|
_date: new Date().toISOString(),
|
|
|
_nonce: nonce,
|
|
_nonce: nonce,
|
|
|
|
|
+ deleteHash,
|
|
|
hash,
|
|
hash,
|
|
|
- replaceHash
|
|
|
|
|
|
|
+ replaceHash,
|
|
|
}));
|
|
}));
|
|
|
const topicURL = this.urlBase + '/bank/private/' + encodeURIComponent(peerAddr) + '/' + encodeURIComponent(topic);
|
|
const topicURL = this.urlBase + '/bank/private/' + encodeURIComponent(peerAddr) + '/' + encodeURIComponent(topic);
|
|
|
const result = yield this.webClient.request({
|
|
const result = yield this.webClient.request({
|