kuber-client
Version:
Javascript client library for kuber server
160 lines • 4.34 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TxBuilder = void 0;
class TxBuilder {
tx_selections;
tx_inputs;
tx_outputs;
tx_collaterals;
tx_referenceInputs;
tx_validityStart;
tx_validityEnd;
tx_mint;
tx_signatures;
tx_fee;
tx_changeAddress;
tx_metadata;
tx_proposals;
tx_certificates;
tx_votes;
selections(tx_selection) {
if (Array.isArray(tx_selection)) {
if (!this.tx_selections)
this.tx_selections = [];
this.tx_selections.push(...tx_selection);
}
else {
if (!this.tx_selections)
this.tx_selections = [];
this.tx_selections.push(tx_selection);
}
return this;
}
inputs(tx_inputs) {
if (Array.isArray(tx_inputs)) {
if (!this.tx_inputs)
this.tx_inputs = [];
this.tx_inputs.push(...tx_inputs);
}
else {
if (!this.tx_inputs)
this.tx_inputs = [];
this.tx_inputs.push(tx_inputs);
}
return this;
}
outputs(tx_output) {
if (Array.isArray(tx_output)) {
if (!this.tx_outputs)
this.tx_outputs = [];
this.tx_outputs.push(...tx_output);
}
else {
if (!this.tx_outputs)
this.tx_outputs = [];
this.tx_outputs.push(tx_output);
}
return this;
}
collateral(tx_collateral) {
if (Array.isArray(tx_collateral)) {
if (!this.tx_collaterals)
this.tx_collaterals = [];
this.tx_collaterals.push(...tx_collateral);
}
else {
if (!this.tx_collaterals)
this.tx_collaterals = [];
this.tx_collaterals.push(tx_collateral);
}
return this;
}
referenceInputs(tx_referenceInput) {
if (Array.isArray(tx_referenceInput)) {
if (!this.tx_referenceInputs)
this.tx_referenceInputs = [];
this.tx_referenceInputs.push(...tx_referenceInput);
}
else {
if (!this.tx_referenceInputs)
this.tx_referenceInputs = [];
this.tx_referenceInputs.push(tx_referenceInput);
}
return this;
}
validFrom(from) {
this.tx_validityStart = from;
return this;
}
validTo(to) {
this.tx_validityEnd = to;
return this;
}
mintAssets(tx_mint) {
if (Array.isArray(tx_mint)) {
if (!this.tx_mint)
this.tx_mint = [];
this.tx_mint.push(...tx_mint);
}
else {
if (!this.tx_mint)
this.tx_mint = [];
this.tx_mint.push(tx_mint);
}
return this;
}
signatures(tx_signature) {
if (Array.isArray(tx_signature)) {
this.tx_signatures = tx_signature;
}
else {
if (!this.tx_signatures)
this.tx_signatures = [];
this.tx_signatures.push(tx_signature);
}
return this;
}
fee(lovelace) {
this.tx_fee = lovelace;
return this;
}
metadata(tx_metadata) {
this.tx_metadata = tx_metadata;
return this;
}
proposals(tx_proposal) {
if (Array.isArray(tx_proposal)) {
this.tx_proposals = tx_proposal;
}
else {
if (!this.tx_proposals)
this.tx_proposals = [];
this.tx_proposals.push(tx_proposal);
}
return this;
}
certificates(tx_certificates) {
if (Array.isArray(tx_certificates)) {
this.tx_certificates = tx_certificates;
}
else {
if (!this.tx_certificates)
this.tx_certificates = [];
this.tx_certificates.push(tx_certificates);
}
return this;
}
votes(tx_votes) {
if (Array.isArray(tx_votes)) {
this.tx_votes = tx_votes;
}
else {
if (!this.tx_votes)
this.tx_votes = [];
this.tx_votes.push(tx_votes);
}
return this;
}
}
exports.TxBuilder = TxBuilder;
//# sourceMappingURL=txBuilder.js.map