import type * as FundingProvider from './funding/Provider.js' import type * as Log from './Log.js' test('accepts deployment-supplied funding provider identifiers', () => { const provider = null as never as FundingProvider.ProviderId const id: Log.FundingProviderAttempt['id'] = provider const provider_roundTrip: FundingProvider.ProviderId = id void provider_roundTrip const attempt = { durationMs: 1, id: 'relay', operation: 'getQuote', outcome: 'available', } satisfies Log.FundingProviderAttempt void attempt const custom: Log.FundingProviderAttempt['id'] = 'custom-bridge' void custom }) test('bounds sponsorship diagnostics', () => { const reasons = [ 'api_key_forbidden', 'api_key_required', 'billing_past_due', 'billing_required', 'chain_id_unsupported', 'fee_token_unsupported', 'internal_error', 'production_api_key_required', 'project_id_invalid', 'project_id_required', 'spend_limit_exceeded', 'tx_fee_limit_exceeded', ] as const satisfies readonly Log.SponsorshipReason[] expectTypeOf<(typeof reasons)[number]>().toEqualTypeOf() const sponsorship = { chainId: 4217, method: 'eth_signRawTransaction', outcome: 'rejected', payloadHash: `0x${'aa'.repeat(32)}`, reason: 'production_api_key_required', rejections: 1, } satisfies Log.Sponsorship void sponsorship // @ts-expect-error arbitrary method names would create unbounded log values const method: Log.SponsorshipMethod = 'wallet_userControlled' void method // @ts-expect-error arbitrary reasons would create unbounded log values const reason: Log.SponsorshipReason = 'user_controlled_reason' void reason })