@hashgraph/sdk
Version:
229 lines (228 loc) • 11.7 kB
TypeScript
export default CACHE;
export type ContractId = import("./contract/ContractId.js").default;
export type AccountId = import("./account/AccountId.js").default;
export type KeyList = import("./KeyList.js").default;
export type PublicKey = import("./PublicKey.js").default;
export type PrivateKey = import("./PrivateKey.js").default;
export type Mnemonic = import("./Mnemonic.js").default;
export type EvmAddress = import("./EvmAddress.js").default;
export type EthereumTransactionData = import("./EthereumTransactionData.js").default;
export type TransactionReceiptQuery = import("./transaction/TransactionReceiptQuery.js").default;
export type TransactionRecordQuery = import("./transaction/TransactionRecordQuery.js").default;
export type AddressBookQuery = import("./network/AddressBookQuery.js").default;
export namespace HieroProto {
namespace proto {
type IKey = import("@hashgraph/proto").proto.IKey;
type IKeyList = import("@hashgraph/proto").proto.IKeyList;
type IThresholdKey = import("@hashgraph/proto").proto.IThresholdKey;
type IContractID = import("@hashgraph/proto").proto.IContractID;
}
}
export namespace cryptography {
type PrivateKey = import("@hashgraph/cryptography").PrivateKey;
type Mnemonic = import("@hashgraph/cryptography").Mnemonic;
}
export type FromProtobufKeyFuncT<ProtobufT extends object, SdkT extends object> = {
(proto: ProtobufT): SdkT;
};
/**
* This variable is strictly designed to prevent cyclic dependencies.
*/
declare const CACHE: Cache;
/**
* @typedef {import("./contract/ContractId.js").default} ContractId
* @typedef {import("./account/AccountId.js").default} AccountId
* @typedef {import("./KeyList.js").default} KeyList
* @typedef {import("./PublicKey.js").default} PublicKey
* @typedef {import("./PrivateKey.js").default} PrivateKey
* @typedef {import("./Mnemonic.js").default} Mnemonic
* @typedef {import("./EvmAddress.js").default} EvmAddress
* @typedef {import("./EthereumTransactionData.js").default} EthereumTransactionData
* @typedef {import("./transaction/TransactionReceiptQuery.js").default} TransactionReceiptQuery
* @typedef {import("./transaction/TransactionRecordQuery.js").default} TransactionRecordQuery
* @typedef {import("./network/AddressBookQuery.js").default} AddressBookQuery
*/
/**
* @namespace proto
* @typedef {import("@hashgraph/proto").proto.IKey} HieroProto.proto.IKey
* @typedef {import("@hashgraph/proto").proto.IKeyList} HieroProto.proto.IKeyList
* @typedef {import("@hashgraph/proto").proto.IThresholdKey} HieroProto.proto.IThresholdKey
* @typedef {import("@hashgraph/proto").proto.IContractID} HieroProto.proto.IContractID
*/
/**
* @namespace cryptography
* @typedef {import("@hashgraph/cryptography").PrivateKey} cryptography.PrivateKey
* @typedef {import("@hashgraph/cryptography").Mnemonic} cryptography.Mnemonic
*/
/**
* @template {object} ProtobufT
* @template {object} SdkT
* @typedef {{ (proto: ProtobufT): SdkT }} FromProtobufKeyFuncT
*/
/**
* Cache class is designed to prevent cyclic dependencies in the Hiero JavaScript SDK.
* It stores various conversion functions and configuration values that are used across
* different parts of the SDK.
*/
declare class Cache {
/** @type {number} */
_timeDrift: number;
/** @type {FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId> | null} */
_contractId: FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId> | null;
/** @type {FromProtobufKeyFuncT<HieroProto.proto.IKeyList, KeyList> | null} */
_keyList: FromProtobufKeyFuncT<HieroProto.proto.IKeyList, KeyList> | null;
/** @type {FromProtobufKeyFuncT<HieroProto.proto.IThresholdKey, KeyList> | null} */
_thresholdKey: FromProtobufKeyFuncT<HieroProto.proto.IThresholdKey, KeyList> | null;
/** @type {FromProtobufKeyFuncT<Uint8Array, PublicKey> | null} */
_publicKeyED25519: FromProtobufKeyFuncT<Uint8Array, PublicKey> | null;
/** @type {FromProtobufKeyFuncT<Uint8Array, PublicKey> | null} */
_publicKeyECDSA: FromProtobufKeyFuncT<Uint8Array, PublicKey> | null;
/** @type {((key: cryptography.PrivateKey) => PrivateKey) | null} */
_privateKeyConstructor: ((key: cryptography.PrivateKey) => PrivateKey) | null;
/** @type {((key: cryptography.Mnemonic) => Mnemonic) | null} */
_mnemonicFromString: ((key: cryptography.Mnemonic) => Mnemonic) | null;
/** @type {((shard: Long | number, realm: Long | number, key: PublicKey) => AccountId) | null} */
_accountIdConstructor: ((shard: Long | number, realm: Long | number, key: PublicKey) => AccountId) | null;
/** @type {FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId> | null} */
_delegateContractId: FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId> | null;
/** @type {FromProtobufKeyFuncT<Uint8Array, EvmAddress> | null} */
_evmAddress: FromProtobufKeyFuncT<Uint8Array, EvmAddress> | null;
/** @type {((bytes: Uint8Array) => EthereumTransactionData) | null} */
_ethereumTransactionDataLegacyFromBytes: ((bytes: Uint8Array) => EthereumTransactionData) | null;
/** @type {((bytes: Uint8Array) => EthereumTransactionData) | null} */
_ethereumTransactionDataEip1559FromBytes: ((bytes: Uint8Array) => EthereumTransactionData) | null;
/** @type {((bytes: Uint8Array) => EthereumTransactionData) | null} */
_ethereumTransactionDataEip2930FromBytes: ((bytes: Uint8Array) => EthereumTransactionData) | null;
/** @type {(() => TransactionReceiptQuery) | null} */
_transactionReceiptQueryConstructor: (() => TransactionReceiptQuery) | null;
/** @type {(() => TransactionRecordQuery) | null} */
_transactionRecordQueryConstructor: (() => TransactionRecordQuery) | null;
/**
* @param {number} timeDrift
*/
setTimeDrift(timeDrift: number): void;
/**
* @returns {number}
*/
get timeDrift(): number;
/**
* @param {FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>} contractId
*/
setContractId(contractId: FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>): void;
/**
* @returns {FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>}
*/
get contractId(): FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>;
/**
* @param {FromProtobufKeyFuncT<HieroProto.proto.IKeyList, KeyList>} keyList
*/
setKeyList(keyList: FromProtobufKeyFuncT<HieroProto.proto.IKeyList, KeyList>): void;
/**
* @returns {FromProtobufKeyFuncT<HieroProto.proto.IKeyList, KeyList>}
*/
get keyList(): FromProtobufKeyFuncT<HieroProto.proto.IKeyList, KeyList>;
/**
* @param {FromProtobufKeyFuncT<HieroProto.proto.IThresholdKey, KeyList>} thresholdKey
*/
setThresholdKey(thresholdKey: FromProtobufKeyFuncT<HieroProto.proto.IThresholdKey, KeyList>): void;
/**
* @returns {FromProtobufKeyFuncT<HieroProto.proto.IThresholdKey, KeyList>}
*/
get thresholdKey(): FromProtobufKeyFuncT<HieroProto.proto.IThresholdKey, KeyList>;
/**
* @param {FromProtobufKeyFuncT<Uint8Array, PublicKey>} publicKeyED25519
*/
setPublicKeyED25519(publicKeyED25519: FromProtobufKeyFuncT<Uint8Array, PublicKey>): void;
/**
* @returns {FromProtobufKeyFuncT<Uint8Array, PublicKey>}
*/
get publicKeyED25519(): FromProtobufKeyFuncT<Uint8Array, PublicKey>;
/**
* @param {FromProtobufKeyFuncT<Uint8Array, PublicKey>} publicKeyECDSA
*/
setPublicKeyECDSA(publicKeyECDSA: FromProtobufKeyFuncT<Uint8Array, PublicKey>): void;
/**
* @returns {FromProtobufKeyFuncT<Uint8Array, PublicKey>}
*/
get publicKeyECDSA(): FromProtobufKeyFuncT<Uint8Array, PublicKey>;
/**
* @param {((key: cryptography.PrivateKey) => PrivateKey)} privateKeyConstructor
*/
setPrivateKeyConstructor(privateKeyConstructor: ((key: cryptography.PrivateKey) => PrivateKey)): void;
/**
* @returns {((key: cryptography.PrivateKey) => PrivateKey)}
*/
get privateKeyConstructor(): ((key: cryptography.PrivateKey) => PrivateKey);
/**
* @param {((key: cryptography.Mnemonic) => Mnemonic)} mnemonicFromString
*/
setMnemonicFromString(mnemonicFromString: ((key: cryptography.Mnemonic) => Mnemonic)): void;
/**
* @returns {((key: cryptography.PrivateKey) => PrivateKey)}
*/
get mnemonicFromString(): ((key: cryptography.PrivateKey) => PrivateKey);
/**
* @param {((shard: Long | number, realm: Long | number, key: PublicKey) => AccountId)} accountIdConstructor
*/
setAccountIdConstructor(accountIdConstructor: ((shard: Long | number, realm: Long | number, key: PublicKey) => AccountId)): void;
/**
* @returns {((shard: Long | number, realm: Long | number, key: PublicKey) => AccountId)}
*/
get accountIdConstructor(): ((shard: Long | number, realm: Long | number, key: PublicKey) => AccountId);
/**
* @param {FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>} delegateContractId
*/
setDelegateContractId(delegateContractId: FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>): void;
/**
* @returns {FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>}
*/
get delegateContractId(): FromProtobufKeyFuncT<HieroProto.proto.IContractID, ContractId>;
/**
* @param {FromProtobufKeyFuncT<Uint8Array, EvmAddress>} evmAddress
*/
setEvmAddress(evmAddress: FromProtobufKeyFuncT<Uint8Array, EvmAddress>): void;
/**
* @returns {FromProtobufKeyFuncT<Uint8Array, EvmAddress>}
*/
get evmAddress(): FromProtobufKeyFuncT<Uint8Array, EvmAddress>;
/**
* @param {((bytes: Uint8Array) => EthereumTransactionData)} ethereumTransactionDataLegacyFromBytes
*/
setEthereumTransactionDataLegacyFromBytes(ethereumTransactionDataLegacyFromBytes: ((bytes: Uint8Array) => EthereumTransactionData)): void;
/**
* @returns {((bytes: Uint8Array) => EthereumTransactionData)}
*/
get ethereumTransactionDataLegacyFromBytes(): ((bytes: Uint8Array) => EthereumTransactionData);
/**
* @param {((bytes: Uint8Array) => EthereumTransactionData)} ethereumTransactionDataEip1559FromBytes
*/
setEthereumTransactionDataEip1559FromBytes(ethereumTransactionDataEip1559FromBytes: ((bytes: Uint8Array) => EthereumTransactionData)): void;
/**
* @returns {((bytes: Uint8Array) => EthereumTransactionData)}
*/
get ethereumTransactionDataEip1559FromBytes(): ((bytes: Uint8Array) => EthereumTransactionData);
/**
* @param {((bytes: Uint8Array) => EthereumTransactionData)} ethereumTransactionDataEip2930FromBytes
*/
setEthereumTransactionDataEip2930FromBytes(ethereumTransactionDataEip2930FromBytes: ((bytes: Uint8Array) => EthereumTransactionData)): void;
/**
* @returns {((bytes: Uint8Array) => EthereumTransactionData)}
*/
get ethereumTransactionDataEip2930FromBytes(): ((bytes: Uint8Array) => EthereumTransactionData);
/**
* @param {(() => TransactionReceiptQuery)} transactionReceiptQueryConstructor
*/
setTransactionReceiptQueryConstructor(transactionReceiptQueryConstructor: (() => TransactionReceiptQuery)): void;
/**
* @returns {(() => TransactionReceiptQuery)}
*/
get transactionReceiptQueryConstructor(): (() => TransactionReceiptQuery);
/**
* @param {(() => TransactionRecordQuery)} transactionRecordQueryConstructor
*/
setTransactionRecordQueryConstructor(transactionRecordQueryConstructor: (() => TransactionRecordQuery)): void;
/**
* @returns {(() => TransactionRecordQuery)}
*/
get transactionRecordQueryConstructor(): (() => TransactionRecordQuery);
}