import type { Account, AccountKeyAlgorithm, GenericAccount, IdentifierKeyAlgorithm, MultisigAddress, TokenAddress } from '../account'; import type { AdjustMethod } from '../block'; import type { Permissions } from '../permissions'; import type { DbStats, TimeStats } from '../stats'; import type { Certificate, CertificateBundle, CertificateHash } from '../utils/certificate'; import type { DistributiveOmit } from '../utils/helper'; export interface MultisigConfig { signers: (Account | MultisigAddress)[]; quorum: bigint; } /** * Account info entry */ interface BaseAccountInfo { /** * The account that this info is for */ account: Account; /** * A name for the account */ name: string; /** * A description for the account */ description: string; /** * Arbitrary metadata for the account */ metadata: string; } interface BaseIdentifierAccountInfo extends BaseAccountInfo { /** * The default permissions for the account */ defaultPermission?: Permissions; } interface ECDSA_SECP256K1AccountInfo extends BaseAccountInfo { } interface ECDSA_SECP256R1AccountInfo extends BaseAccountInfo { } interface ED25519AccountInfo extends BaseAccountInfo { } type KeyPairAccountInfo = ECDSA_SECP256K1AccountInfo | ECDSA_SECP256R1AccountInfo | ED25519AccountInfo; interface TokenAccountInfo extends BaseIdentifierAccountInfo { /** * The current supply of the token */ supply: bigint; } interface MultisigAccountInfo extends BaseIdentifierAccountInfo { /** * The number of signers required for this multisig */ multisigQuorum: bigint | null; } interface NetworkAccountInfo extends BaseIdentifierAccountInfo { } interface StorageAccountInfo extends BaseIdentifierAccountInfo { } export type AccountInfo = KeyPairAccountInfo | TokenAccountInfo | MultisigAccountInfo | StorageAccountInfo | NetworkAccountInfo; export type AccountInfoWithoutAccount = DistributiveOmit; export type AccountInfoForType = Extract; }>; export declare function isIdentifierAccountInfo(info: AccountInfo): info is Extract; }>; export declare function isKeyPairAccountInfo(info: AccountInfo): info is KeyPairAccountInfo; export declare function isAccountInfoOfType(info: AccountInfo, type: T): info is Extract; }>; declare const aclPrincipalType: readonly ["ACCOUNT", "CERTIFICATE"]; export type ACLPrincipalType = typeof aclPrincipalType[number]; export declare function isACLPrincipalType(type: string): type is ACLPrincipalType; export declare function assertACLPrincipalType(type: string): asserts type is ACLPrincipalType; export declare function asACLPrincipalType(type: string): ACLPrincipalType; interface CertificateACLPrincipal { usingCertificate: true; certificate: CertificateHash; certificateAccount: GenericAccount; } interface BaseACLRow { /** * The type of ACL row, which determines the shape of the principal */ principalType: PrincipalType; /** * The account that this row is for */ entity: GenericAccount; /** * An optional target account which, depending on the permissions, may be targeted by the permission */ target: GenericAccount; /** * The permissions for which this row grants */ permissions: Permissions; } interface AccountACLRow extends BaseACLRow<'ACCOUNT'> { /** * The account that these permissions apply to */ principal: GenericAccount; } interface CertificateACLRow extends BaseACLRow<'CERTIFICATE'> { /** * Accounts having certificate issued by this certificate will be granted the permissions in this ACL row */ principal: CertificateACLPrincipal; } /** * Permissions types */ export type ACLRow = AccountACLRow | CertificateACLRow; /** * A permission requirement for ledger effects * @expandType AccountACLRow */ export type ACLPermissionRequirement = Omit & { target?: GenericAccount; method?: AdjustMethod.SET; }; /** * Update an ACL for an account * @expandType ACLRow */ export type ACLUpdate = DistributiveOmit & { target?: GenericAccount; /** * The method to use to update the ACL */ method: AdjustMethod; /** * The permissions to set for the ACL * * If this is set to null, the permissions will be unset */ permissions: Permissions | null; }; /** * All balances for each token on an account */ export type GetAllBalancesResponse = { /** * The account balance of the specified token * * This is in raw units, and not the display units * that the token uses */ balance: bigint; /** * The account of the token */ token: TokenAddress; }[]; /** * Ledger statistics */ export interface LedgerStatistics { moment: string; momentRange: number; blockCount: number; transactionCount: number; representativeCount: number; db: DbStats; settlementTimes: TimeStats; } export interface CertificateWithIntermediates { certificate: Certificate; intermediates: CertificateBundle | null; } export {};