@hashgraph/sdk
Version:
272 lines (271 loc) • 8.47 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.ICryptoUpdateTransactionBody} HieroProto.proto.ICryptoUpdateTransactionBody
* @typedef {import("@hashgraph/proto").proto.IAccountID} HieroProto.proto.IAccountID
*/
/**
* @typedef {import("../channel/Channel.js").default} Channel
* @typedef {import("../client/Client.js").default<*, *>} Client
* @typedef {import("../transaction/TransactionId.js").default} TransactionId
*/
/**
* Change properties for the given account.
*/
export default class AccountUpdateTransaction 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 {AccountUpdateTransaction}
*/
static _fromProtobuf(transactions: HieroProto.proto.ITransaction[], signedTransactions: HieroProto.proto.ISignedTransaction[], transactionIds: TransactionId[], nodeIds: AccountId[], bodies: HieroProto.proto.ITransactionBody[]): AccountUpdateTransaction;
/**
* @param {object} props
* @param {AccountId} [props.accountId]
* @param {Key} [props.key]
* @param {?boolean} [props.receiverSignatureRequired]
* @param {AccountId} [props.proxyAccountId]
* @param {Duration | Long | number} [props.autoRenewPeriod]
* @param {Timestamp | Date} [props.expirationTime]
* @param {?string} [props.accountMemo]
* @param {Long | number} [props.maxAutomaticTokenAssociations]
* @param {Key} [props.aliasKey]
* @param {AccountId | string} [props.stakedAccountId]
* @param {Long | number} [props.stakedNodeId]
* @param {?boolean} [props.declineStakingReward]
*/
constructor(props?: {
accountId?: AccountId | undefined;
key?: Key | undefined;
receiverSignatureRequired?: boolean | null | undefined;
proxyAccountId?: AccountId | undefined;
autoRenewPeriod?: number | Long | Duration | undefined;
expirationTime?: Date | Timestamp | undefined;
accountMemo?: string | null | undefined;
maxAutomaticTokenAssociations?: number | Long | undefined;
aliasKey?: Key | undefined;
stakedAccountId?: string | AccountId | undefined;
stakedNodeId?: number | Long | undefined;
declineStakingReward?: boolean | null | undefined;
});
/**
* @private
* @type {?AccountId}
*/
private _accountId;
/**
* @private
* @type {?Key}
*/
private _key;
/**
* @private
* @type {?boolean}
*/
private _receiverSignatureRequired;
/**
* @private
* @type {?AccountId}
*/
private _proxyAccountId;
/**
* @private
* @type {?Duration}
*/
private _autoRenewPeriod;
/**
* @private
* @type {?Timestamp}
*/
private _expirationTime;
/**
* @private
* @type {?string}
*/
private _accountMemo;
/**
* @private
* @type {?Long}
*/
private _maxAutomaticTokenAssociations;
/**
* @private
* @type {?Key}
*/
private _aliasKey;
/**
* @private
* @type {?AccountId}
*/
private _stakedAccountId;
/**
* @private
* @type {?Long}
*/
private _stakedNodeId;
/**
* @private
* @type {?boolean}
*/
private _declineStakingReward;
/**
* @returns {?AccountId}
*/
get accountId(): AccountId | null;
/**
* Sets the account ID which is being updated in this transaction.
*
* @param {AccountId | string} accountId
* @returns {AccountUpdateTransaction}
*/
setAccountId(accountId: AccountId | string): AccountUpdateTransaction;
/**
* @returns {?Key}
*/
get key(): Key | null;
/**
* @param {Key} key
* @returns {this}
*/
setKey(key: Key): this;
/**
* @returns {?boolean}
*/
get receiverSignatureRequired(): boolean | null;
/**
* @param {boolean} receiverSignatureRequired
* @returns {this}
*/
setReceiverSignatureRequired(receiverSignatureRequired: boolean): this;
/**
* @deprecated
* @returns {?AccountId}
*/
get proxyAccountId(): AccountId | null;
/**
* @deprecated
* @param {AccountId} proxyAccountId
* @returns {this}
*/
setProxyAccountId(proxyAccountId: AccountId): this;
/**
* @returns {?Duration}
*/
get autoRenewPeriod(): Duration | null;
/**
* @param {Duration | Long | number} autoRenewPeriod
* @returns {this}
*/
setAutoRenewPeriod(autoRenewPeriod: Duration | Long | number): this;
/**
* @returns {?Timestamp}
*/
get expirationTime(): Timestamp | null;
/**
* @param {Timestamp | Date} expirationTime
* @returns {this}
*/
setExpirationTime(expirationTime: Timestamp | Date): this;
/**
* @returns {?string}
*/
get accountMemo(): string | null;
/**
* @param {string} memo
* @returns {this}
*/
setAccountMemo(memo: string): this;
/**
* @returns {this}
*/
clearAccountMemo(): this;
/**
* @returns {?Long}
*/
get maxAutomaticTokenAssociations(): Long | null;
/**
* @param {Long | number} maxAutomaticTokenAssociations
* @returns {this}
*/
setMaxAutomaticTokenAssociations(maxAutomaticTokenAssociations: Long | number): this;
/**
* @deprecated - no longer supported
* @returns {?Key}
*/
get aliasKey(): Key | null;
/**
* @deprecated - no longer supported
* @param {Key} _
* @returns {this}
*/
setAliasKey(_: Key): this;
/**
* @returns {?AccountId}
*/
get stakedAccountId(): AccountId | null;
/**
* @param {AccountId | string} stakedAccountId
* @returns {this}
*/
setStakedAccountId(stakedAccountId: AccountId | string): this;
/**
* @returns {this}
*/
clearStakedAccountId(): this;
/**
* @returns {?Long}
*/
get stakedNodeId(): Long | null;
/**
* @param {Long | number} stakedNodeId
* @returns {this}
*/
setStakedNodeId(stakedNodeId: Long | number): this;
/**
* @returns {this}
*/
clearStakedNodeId(): this;
/**
* @returns {?boolean}
*/
get declineStakingRewards(): boolean | null;
/**
* @param {boolean} declineStakingReward
* @returns {this}
*/
setDeclineStakingReward(declineStakingReward: boolean): this;
/**
* @override
* @protected
* @returns {HieroProto.proto.ICryptoUpdateTransactionBody}
*/
protected override _makeTransactionData(): HieroProto.proto.ICryptoUpdateTransactionBody;
}
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 ICryptoUpdateTransactionBody = import("@hashgraph/proto").proto.ICryptoUpdateTransactionBody;
type IAccountID = import("@hashgraph/proto").proto.IAccountID;
}
}
export type Channel = import("../channel/Channel.js").default;
export type Client = import("../client/Client.js").default<any, any>;
export type TransactionId = import("../transaction/TransactionId.js").default;
import Transaction from "../transaction/Transaction.js";
import AccountId from "./AccountId.js";
import Key from "../Key.js";
import Duration from "../Duration.js";
import Long from "long";
import Timestamp from "../Timestamp.js";