lisk-framework
Version:
Lisk blockchain application platform
46 lines • 1.42 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.RecoverEvent = exports.recoverEventSchema = void 0;
const base_event_1 = require("../../base_event");
const constants_1 = require("../constants");
exports.recoverEventSchema = {
$id: '/token/events/recover',
type: 'object',
required: ['terminatedChainID', 'tokenID', 'amount', 'result'],
properties: {
terminatedChainID: {
dataType: 'bytes',
minLength: constants_1.CHAIN_ID_LENGTH,
maxLength: constants_1.CHAIN_ID_LENGTH,
fieldNumber: 1,
},
tokenID: {
dataType: 'bytes',
minLength: constants_1.TOKEN_ID_LENGTH,
maxLength: constants_1.TOKEN_ID_LENGTH,
fieldNumber: 2,
},
amount: {
dataType: 'uint64',
fieldNumber: 3,
},
result: {
dataType: 'uint32',
fieldNumber: 4,
},
},
};
class RecoverEvent extends base_event_1.BaseEvent {
constructor() {
super(...arguments);
this.schema = exports.recoverEventSchema;
}
log(ctx, address, data) {
this.add(ctx, { ...data, result: 0 }, [address]);
}
error(ctx, address, data, result) {
this.add(ctx, { ...data, result }, [address], true);
}
}
exports.RecoverEvent = RecoverEvent;
//# sourceMappingURL=recover.js.map
;