import * as vaultfire from '../src/index';

describe('Package Exports', () => {
  test('exports createVaultfireTools', () => {
    expect(typeof vaultfire.createVaultfireTools).toBe('function');
  });

  test('exports createVaultfireReadTools', () => {
    expect(typeof vaultfire.createVaultfireReadTools).toBe('function');
  });

  test('exports VaultfireClient', () => {
    expect(typeof vaultfire.VaultfireClient).toBe('function');
  });

  test('exports CHAIN_CONFIG', () => {
    expect(vaultfire.CHAIN_CONFIG).toBeDefined();
    expect(vaultfire.CHAIN_CONFIG.base).toBeDefined();
    expect(vaultfire.CHAIN_CONFIG.avalanche).toBeDefined();
    expect(vaultfire.CHAIN_CONFIG.arbitrum).toBeDefined();
    expect(vaultfire.CHAIN_CONFIG.polygon).toBeDefined();
  });

  test('exports getChainConfig', () => {
    expect(typeof vaultfire.getChainConfig).toBe('function');
  });

  test('exports getSupportedChains', () => {
    const chains = vaultfire.getSupportedChains();
    expect(chains).toHaveLength(4);
  });

  test('no private keys or secrets in exports', () => {
    const allExports = JSON.stringify(vaultfire);
    // Ensure no private keys, credentials, or sensitive patterns in public exports
    expect(allExports).not.toMatch(/0x[0-9a-f]{64}/i); // no 32-byte hex keys
    expect(allExports).not.toContain('npm_'); // no npm tokens
  });
});
