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