@hashgraph/sdk
Version:
114 lines (113 loc) • 4.32 kB
TypeScript
/**
* @namespace proto
* @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
* @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
* @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
* @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
* @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
* @typedef {import("@hashgraph/proto").proto.ITokenMintTransactionBody} HieroProto.proto.ITokenMintTransactionBody
* @typedef {import("@hashgraph/proto").proto.ITokenID} HieroProto.proto.ITokenID
*/
/**
* @typedef {import("../channel/Channel.js").default} Channel
* @typedef {import("../client/Client.js").default<*, *>} Client
* @typedef {import("../account/AccountId.js").default} AccountId
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
*/
/**
* Mint a new Hedera™ crypto-currency token.
*/
export default class TokenMintTransaction extends Transaction {
/**
* @internal
* @param {HieroProto.proto.ITransaction[]} transactions
* @param {HieroProto.proto.ISignedTransaction[]} signedTransactions
* @param {TransactionId[]} transactionIds
* @param {AccountId[]} nodeIds
* @param {HieroProto.proto.ITransactionBody[]} bodies
* @returns {TokenMintTransaction}
*/
static _fromProtobuf(transactions: HieroProto.proto.ITransaction[], signedTransactions: HieroProto.proto.ISignedTransaction[], transactionIds: TransactionId[], nodeIds: AccountId[], bodies: HieroProto.proto.ITransactionBody[]): TokenMintTransaction;
/**
* @param {object} [props]
* @param {TokenId | string} [props.tokenId]
* @param {Long | number} [props.amount]
* @param {Uint8Array[]} [props.metadata]
*/
constructor(props?: {
tokenId?: string | TokenId | undefined;
amount?: number | Long | undefined;
metadata?: Uint8Array<ArrayBufferLike>[] | undefined;
});
/**
* @private
* @type {?TokenId}
*/
private _tokenId;
/**
* @private
* @type {?Long}
*/
private _amount;
/**
* @private
* @type {Uint8Array[]}
*/
private _metadata;
/**
* @returns {?TokenId}
*/
get tokenId(): TokenId | null;
/**
* @param {TokenId | string} tokenId
* @returns {this}
*/
setTokenId(tokenId: TokenId | string): this;
/**
* @returns {?Long}
*/
get amount(): Long | null;
/**
* @param {Long | number} amount
* @returns {this}
*/
setAmount(amount: Long | number): this;
/**
* @returns {Uint8Array[]}
*/
get metadata(): Uint8Array[];
/**
* @param {Uint8Array | string} metadata
* @returns {this}
*/
addMetadata(metadata: Uint8Array | string): this;
/**
* @param {Uint8Array[]} metadata
* @returns {this}
*/
setMetadata(metadata: Uint8Array[]): this;
/**
* @override
* @protected
* @returns {HieroProto.proto.ITokenMintTransactionBody}
*/
protected override _makeTransactionData(): HieroProto.proto.ITokenMintTransactionBody;
}
export namespace HieroProto {
namespace proto {
type ITransaction = import("@hashgraph/proto").proto.ITransaction;
type ISignedTransaction = import("@hashgraph/proto").proto.ISignedTransaction;
type TransactionBody = import("@hashgraph/proto").proto.TransactionBody;
type ITransactionBody = import("@hashgraph/proto").proto.ITransactionBody;
type ITransactionResponse = import("@hashgraph/proto").proto.ITransactionResponse;
type ITokenMintTransactionBody = import("@hashgraph/proto").proto.ITokenMintTransactionBody;
type ITokenID = import("@hashgraph/proto").proto.ITokenID;
}
}
export type Channel = import("../channel/Channel.js").default;
export type Client = import("../client/Client.js").default<any, any>;
export type AccountId = import("../account/AccountId.js").default;
export type TransactionId = import("../transaction/TransactionId.js").default;
import Transaction from "../transaction/Transaction.js";
import TokenId from "./TokenId.js";
import Long from "long";