import { PolkadotSigner } from 'polkadot-api'; declare function formatPasBalance(plancks: bigint): string; interface PoolAccount { index: number; path: string; publicKey: Uint8Array; signer: PolkadotSigner; address: string; } interface PoolAuthorization extends PoolAccount { transactions: bigint; renewBytes: bigint; expiration: number; } declare const DEPLOY_PATH_PREFIX = "//deploy"; declare function poolAccountDerivationPath(index: number): string; declare function assetHubTopUpAmount(balanceRaw: bigint, thresholdRaw: bigint, targetRaw: bigint): bigint; declare function derivePoolAccounts(poolSize?: number, mnemonic?: string): PoolAccount[]; interface BulletinAuthorization { expiration: number; transactionsAllowance: number; transactionsUsed: number; bytesAllowance: bigint; bytesUsed: bigint; bytesPermanentUsed: bigint; } declare const ACCOUNT_AUTHORIZATION_FIELDS: readonly ["expires_at", "bytes_allowance", "bytes_used", "bytes_permanent_used", "transactions_allowance", "transactions_used"]; /** * Read an account's Bulletin storage authorization via the * `BulletinTransactionStorageApi::account_authorization` runtime API — the one * chain entry point for this, replacing the old `TransactionStorage.Authorizations` * read. That entry is no longer client-readable: its `AuthorizationExtent` carries * an opaque consumer payload (`extra`) where `bytes_permanent` used to sit. * * Returns null both when the account was never authorized and when its grant has * lapsed — the API filters expired entries, so a non-null result is always active. * * A `Some` missing any field throws instead of defaulting to 0: a renamed field * would otherwise read as "no allowance, expires at block 0" and fail every deploy * with a message pointing at the account rather than at the chain. */ declare function readAccountAuthorization(api: any, address: string): Promise; declare function remainingRenewBytes(auth: BulletinAuthorization): bigint; declare function remainingTransactions(auth: BulletinAuthorization): bigint; declare function isAuthorizationSufficient(auth: { expiration: number; } | null | undefined, currentBlock: number): boolean; declare function accountsNeedingAuthorization(auths: PoolAuthorization[], currentBlock: number): PoolAuthorization[]; declare const BULLETIN_BLOCK_TIME_SECS = 6; declare const BULLETIN_BLOCKS_PER_DAY: number; declare function accountsNeedingReauthorization(auths: PoolAuthorization[], currentBlock: number, bufferBlocks?: number): PoolAuthorization[]; interface AutoReauthorizeEnv { network?: string; bulletinAutoAuthorize?: boolean; } declare function isAutoReauthorizeAllowed(env: AutoReauthorizeEnv | null | undefined): boolean; interface SelectionResult { account: PoolAuthorization; eligibleCount: number; } declare function selectAccount(authorizations: PoolAuthorization[], random?: () => number, pinnedIndex?: number): SelectionResult; declare function fetchPoolAuthorizations(api: any, accounts: PoolAccount[]): Promise; declare function isTestnetSpecName(specName: string | undefined | null): boolean; declare function testnetFromNetworkField(network?: string | null): boolean | undefined; declare function detectTestnet(api: any, network?: string | null): Promise; declare function _resetTestnetCacheForTests(): void; declare function ensureAuthorized(api: any, address: string, label?: string, opts?: { autoAuthorize?: boolean; authorizer?: string; network?: string; }): Promise; interface EnsurePoolFundedOptions { envEntry: AutoReauthorizeEnv | null | undefined; thresholdRaw?: bigint; targetRaw?: bigint; funderMnemonic?: string; funderDerivationPath?: string; } declare function ensurePoolAccountsFundedOnAssetHub(assetHubRpc: string, poolSize: number, poolMnemonic: string | undefined, opts: EnsurePoolFundedOptions): Promise; interface BootstrapPoolOptions { authorizerMnemonic?: string; envAuthorizer?: string; bulletinAuthorizeV2?: boolean; reauthBufferBlocks?: number; allowAutoReauthorize?: boolean; network?: string; } declare function bootstrapPool(bulletinRpc: string, poolSize?: number, mnemonic?: string, opts?: BootstrapPoolOptions): Promise; export { ACCOUNT_AUTHORIZATION_FIELDS, type AutoReauthorizeEnv, BULLETIN_BLOCKS_PER_DAY, BULLETIN_BLOCK_TIME_SECS, type BootstrapPoolOptions, type BulletinAuthorization, DEPLOY_PATH_PREFIX, type EnsurePoolFundedOptions, type PoolAccount, type PoolAuthorization, type SelectionResult, _resetTestnetCacheForTests, accountsNeedingAuthorization, accountsNeedingReauthorization, assetHubTopUpAmount, bootstrapPool, derivePoolAccounts, detectTestnet, ensureAuthorized, ensurePoolAccountsFundedOnAssetHub, fetchPoolAuthorizations, formatPasBalance, isAuthorizationSufficient, isAutoReauthorizeAllowed, isTestnetSpecName, poolAccountDerivationPath, readAccountAuthorization, remainingRenewBytes, remainingTransactions, selectAccount, testnetFromNetworkField };