@protokol/nft-exchange-crypto
Version:
Transaction Builders For Exchange NFT Transaction Types
79 lines • 2.71 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NFTAuctionCancelTransaction = 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 NFTAuctionCancelTransaction extends core_nft_crypto_1.AbstractNFTTransaction {
static getAssetSchema() {
return {
type: "object",
required: ["nftAuctionCancel"],
properties: {
nftAuctionCancel: {
type: "object",
required: ["auctionId"],
properties: {
auctionId: {
$ref: "transactionId",
},
},
},
},
};
}
serialize() {
var _a;
const { data } = this;
utils_1.Asserts.assert.defined((_a = data.asset) === null || _a === void 0 ? void 0 : _a.nftAuctionCancel);
const buffer = new bytebuffer_1.default(32, true);
buffer.append(data.asset.nftAuctionCancel.auctionId, "hex");
return buffer;
}
deserialize(buf) {
const { data } = this;
const nftAuctionCancel = {
auctionId: buf.readBytes(32).toString("hex"),
};
data.asset = {
nftAuctionCancel,
};
}
}
exports.NFTAuctionCancelTransaction = NFTAuctionCancelTransaction;
Object.defineProperty(NFTAuctionCancelTransaction, "typeGroup", {
enumerable: true,
configurable: true,
writable: true,
value: enums_1.NFTExchangeTransactionsTypeGroup
});
Object.defineProperty(NFTAuctionCancelTransaction, "type", {
enumerable: true,
configurable: true,
writable: true,
value: enums_1.NFTTransactionTypes.NFTAuctionCancel
});
Object.defineProperty(NFTAuctionCancelTransaction, "key", {
enumerable: true,
configurable: true,
writable: true,
value: "NFTAuctionCancel"
});
Object.defineProperty(NFTAuctionCancelTransaction, "version", {
enumerable: true,
configurable: true,
writable: true,
value: enums_1.NFTExchangeTransactionVersion
});
Object.defineProperty(NFTAuctionCancelTransaction, "defaultStaticFee", {
enumerable: true,
configurable: true,
writable: true,
value: crypto_1.Utils.BigNumber.make(enums_1.NFTStaticFees.NFTAuctionCancel)
});
//# sourceMappingURL=nft-auction-cancel.js.map