@hashgraph/sdk
Version:
88 lines (87 loc) • 2.85 kB
TypeScript
/**
* @namespace proto
* @typedef {import("@hashgraph/proto").proto.ITokenRelationship} HieroProto.proto.ITokenRelationship
* @typedef {import("@hashgraph/proto").proto.TokenKycStatus} HieroProto.proto.TokenKycStatus
* @typedef {import("@hashgraph/proto").proto.TokenFreezeStatus} HieroProto.proto.TokenFreezeStatus
* @typedef {import("@hashgraph/proto").proto.ITokenID} HieroProto.proto.ITokenID
*/
/**
* Token's information related to the given Account
*/
export default class TokenRelationship {
/**
* @param {HieroProto.proto.ITokenRelationship} relationship
* @returns {TokenRelationship}
*/
static _fromProtobuf(relationship: HieroProto.proto.ITokenRelationship): TokenRelationship;
/**
* @param {object} props
* @param {TokenId} props.tokenId
* @param {string} props.symbol
* @param {Long} props.balance
* @param {boolean | null} props.isKycGranted
* @param {boolean | null} props.isFrozen
* @param {boolean | null} props.automaticAssociation
*/
constructor(props: {
tokenId: TokenId;
symbol: string;
balance: Long;
isKycGranted: boolean | null;
isFrozen: boolean | null;
automaticAssociation: boolean | null;
});
/**
* The ID of the token
*
* @readonly
*/
readonly tokenId: TokenId;
/**
* The Symbol of the token
*
* @readonly
*/
readonly symbol: string;
/**
* The balance that the Account holds in the smallest denomination
*
* @readonly
*/
readonly balance: Long;
/**
* The KYC status of the account (KycNotApplicable, Granted or Revoked). If the token does
* not have KYC key, KycNotApplicable is returned
*
* @readonly
*/
readonly isKycGranted: boolean | null;
/**
* The Freeze status of the account (FreezeNotApplicable, Frozen or Unfrozen). If the token
* does not have Freeze key, FreezeNotApplicable is returned
*
* @readonly
*/
readonly isFrozen: boolean | null;
/**
* Specifies if the relationship is created implicitly. False : explicitly associated, True :
* implicitly associated.
*
* @readonly
*/
readonly automaticAssociation: boolean | null;
/**
* @returns {HieroProto.proto.ITokenRelationship}
*/
_toProtobuf(): HieroProto.proto.ITokenRelationship;
}
export namespace HieroProto {
namespace proto {
type ITokenRelationship = import("@hashgraph/proto").proto.ITokenRelationship;
type TokenKycStatus = import("@hashgraph/proto").proto.TokenKycStatus;
type TokenFreezeStatus = import("@hashgraph/proto").proto.TokenFreezeStatus;
type ITokenID = import("@hashgraph/proto").proto.ITokenID;
}
}
import TokenId from "../token/TokenId.js";
import Long from "long";