UNPKG

@protokol/nft-exchange-crypto

Version:

Transaction Builders For Exchange NFT Transaction Types

79 lines 2.62 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NFTBidCancelTransaction = void 0; const crypto_1 = require("@arkecosystem/crypto"); const core_nft_crypto_1 = require("@protokol/core-nft-crypto"); const utils_1 = require("@protokol/utils"); const bytebuffer_1 = __importDefault(require("bytebuffer")); const enums_1 = require("../enums"); class NFTBidCancelTransaction extends core_nft_crypto_1.AbstractNFTTransaction { static getAssetSchema() { return { type: "object", required: ["nftBidCancel"], properties: { nftBidCancel: { type: "object", required: ["bidId"], properties: { bidId: { $ref: "transactionId", }, }, }, }, }; } serialize() { var _a; const { data } = this; utils_1.Asserts.assert.defined((_a = data.asset) === null || _a === void 0 ? void 0 : _a.nftBidCancel); const buffer = new bytebuffer_1.default(32, true); buffer.append(data.asset.nftBidCancel.bidId, "hex"); return buffer; } deserialize(buf) { const { data } = this; const nftBidCancel = { bidId: buf.readBytes(32).toString("hex"), }; data.asset = { nftBidCancel, }; } } exports.NFTBidCancelTransaction = NFTBidCancelTransaction; Object.defineProperty(NFTBidCancelTransaction, "typeGroup", { enumerable: true, configurable: true, writable: true, value: enums_1.NFTExchangeTransactionsTypeGroup }); Object.defineProperty(NFTBidCancelTransaction, "type", { enumerable: true, configurable: true, writable: true, value: enums_1.NFTTransactionTypes.NFTBidCancel }); Object.defineProperty(NFTBidCancelTransaction, "key", { enumerable: true, configurable: true, writable: true, value: "NFTBidCancel" }); Object.defineProperty(NFTBidCancelTransaction, "version", { enumerable: true, configurable: true, writable: true, value: enums_1.NFTExchangeTransactionVersion }); Object.defineProperty(NFTBidCancelTransaction, "defaultStaticFee", { enumerable: true, configurable: true, writable: true, value: crypto_1.Utils.BigNumber.make(enums_1.NFTStaticFees.NFTBidCancel) }); //# sourceMappingURL=nft-bid-cancel.js.map