UNPKG

@volare.finance/schemas.js

Version:
92 lines 4.49 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BlockSchema = exports.Block = void 0; const mongoose_1 = require("@nestjs/mongoose"); const swagger_1 = require("@nestjs/swagger"); let Block = class Block { }; exports.Block = Block; __decorate([ (0, swagger_1.ApiProperty)({ description: 'The hash of the block header of the current block.', example: '0x000160a0000004ebd03c3bb87b629a9cec90d7ffe684a1f26b3a5856714a1171', }), (0, mongoose_1.Prop)({ index: true }), __metadata("design:type", String) ], Block.prototype, "hash", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The hash of the block from which the block was generated, also known as its parent block.', example: '0x000160a0000004e18dca9d202fe1c96e1ba3ec18c907f019ed961c21e587bc69', }), (0, mongoose_1.Prop)(), __metadata("design:type", String) ], Block.prototype, "parentHash", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The number of the block in which the transaction was recorded.', example: 32851612 }), (0, mongoose_1.Prop)({ index: true }), __metadata("design:type", Number) ], Block.prototype, "number", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The timestamp at which a block is validated.', example: 1646717593 }), (0, mongoose_1.Prop)({ index: true }), __metadata("design:type", Number) ], Block.prototype, "timestamp", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Block nonce is a value used during mining to demonstrate proof of work for a block.', example: '0x0000000000000000' }), (0, mongoose_1.Prop)(), __metadata("design:type", String) ], Block.prototype, "nonce", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The amount of effort required to mine a new block. The difficulty algorithm may adjust according to time.', example: 0, }), (0, mongoose_1.Prop)(), __metadata("design:type", Number) ], Block.prototype, "difficulty", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Maximum amount of gas provided for the transaction. The value is 21,000. For contract this value is higher and bound by block gas limit.', example: '21000', }), (0, mongoose_1.Prop)(), __metadata("design:type", String) ], Block.prototype, "gasLimit", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The total gas used in the block and its percentage of gas filled in the block.', example: '4037961' }), (0, mongoose_1.Prop)(), __metadata("design:type", String) ], Block.prototype, "gasUsed", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The address of the miner who obtained the accounting right of the block.', example: '0xea674fdde714fd979de3edf0f56aa9716b898ec8', }), (0, mongoose_1.Prop)(), __metadata("design:type", String) ], Block.prototype, "miner", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Any data that can be included by the miner in the block.', example: 'asia-east1-2 (Hex:0x617369612d65617374312d32)' }), (0, mongoose_1.Prop)(), __metadata("design:type", String) ], Block.prototype, "extraData", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'The transaction count in the block.', example: 10 }), (0, mongoose_1.Prop)(), __metadata("design:type", Number) ], Block.prototype, "transactionCount", void 0); exports.Block = Block = __decorate([ (0, mongoose_1.Schema)({ collection: 'block' }) ], Block); exports.BlockSchema = mongoose_1.SchemaFactory.createForClass(Block); //# sourceMappingURL=block.js.map