@hiero-ledger/sdk
Version:
78 lines (77 loc) • 2.21 kB
TypeScript
/**
* @typedef {object} TransferJSON
* @property {string} accountId
* @property {string} amount
* @property {boolean} isApproved
*/
/**
* @namespace proto
* @typedef {import("@hashgraph/proto").proto.IAccountAmount} HieroProto.proto.IAccountAmount
* @typedef {import("@hashgraph/proto").proto.IAccountID} HieroProto.proto.IAccountID
*/
/**
* @typedef {import("bignumber.js").default} BigNumber
* @typedef {import("long")} Long
*/
/**
* An account, and the amount that it sends or receives during a cryptocurrency transfer.
*/
export default class Transfer {
/**
* @internal
* @param {HieroProto.proto.IAccountAmount[]} accountAmounts
* @returns {Transfer[]}
*/
static _fromProtobuf(accountAmounts: HieroProto.proto.IAccountAmount[]): Transfer[];
/**
* @internal
* @param {object} props
* @param {AccountId | string} props.accountId
* @param {number | string | Long | BigNumber | Hbar} props.amount
* @param {boolean} props.isApproved
*/
constructor(props: {
accountId: AccountId | string;
amount: number | string | Long | BigNumber | Hbar;
isApproved: boolean;
});
/**
* The Account ID that sends or receives cryptocurrency.
*
* @readonly
*/
readonly accountId: AccountId;
/**
* The amount of tinybars that the account sends(negative) or receives(positive).
*/
amount: Hbar;
isApproved: boolean;
/**
* @internal
* @returns {HieroProto.proto.IAccountAmount}
*/
_toProtobuf(): HieroProto.proto.IAccountAmount;
/**
* @returns {TransferJSON}
*/
toJSON(): TransferJSON;
/**
* @returns {string}
*/
toString(): string;
}
export type TransferJSON = {
accountId: string;
amount: string;
isApproved: boolean;
};
export namespace HieroProto {
namespace proto {
type IAccountAmount = import("@hashgraph/proto").proto.IAccountAmount;
type IAccountID = import("@hashgraph/proto").proto.IAccountID;
}
}
export type BigNumber = import("bignumber.js").default;
export type Long = import("long");
import AccountId from "./account/AccountId.js";
import Hbar from "./Hbar.js";