apostille-library
Version:
A novel & holistic blockchain notarization and timestamping with transferable, updatable, branded, and conjointly owned notarizations.
34 lines • 1.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const nem2_sdk_1 = require("nem2-sdk");
class ApostillePublicAccount {
constructor(publicAccount) {
this.publicAccount = publicAccount;
}
static createFromPublicKey(publicKey, networkType) {
const publicAccount = nem2_sdk_1.PublicAccount.createFromPublicKey(publicKey, networkType);
return new ApostillePublicAccount(publicAccount);
}
update(rawData, destAddress) {
const plainMessage = nem2_sdk_1.PlainMessage.create(rawData);
const creationTransaction = nem2_sdk_1.TransferTransaction.create(nem2_sdk_1.Deadline.create(), destAddress || this.publicAccount.address, [], plainMessage, this.publicAccount.address.networkType);
return creationTransaction;
}
transfer(newOwners, ownersToRemove, quorumDelta, minRemovalDelta) {
const addOwners = newOwners.map((cosignatory) => {
return new nem2_sdk_1.MultisigCosignatoryModification(nem2_sdk_1.MultisigCosignatoryModificationType.Add, cosignatory);
});
const removeOwners = ownersToRemove.map((cosignatory) => {
return new nem2_sdk_1.MultisigCosignatoryModification(nem2_sdk_1.MultisigCosignatoryModificationType.Remove, cosignatory);
});
return nem2_sdk_1.ModifyMultisigAccountTransaction.create(nem2_sdk_1.Deadline.create(), quorumDelta, minRemovalDelta, [...addOwners, ...removeOwners], this.publicAccount.address.networkType);
}
get publicKey() {
return this.publicAccount.publicKey;
}
get address() {
return this.publicAccount.address;
}
}
exports.ApostillePublicAccount = ApostillePublicAccount;
//# sourceMappingURL=ApostillePublicAccount.js.map