epistery 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.test.env.example +31 -0
  2. package/README.md +12 -0
  3. package/artifacts/build-info/06755c4b5b78c3712cbf3383ae571054.json +1 -0
  4. package/artifacts/build-info/d543a0323a7b2da80b60c3056668fbde.json +1 -0
  5. package/artifacts/contracts/IdentityContract.sol/IdentityContract.dbg.json +1 -1
  6. package/artifacts/contracts/agent.sol/Agent.dbg.json +1 -1
  7. package/artifacts/contracts/agent.sol/Agent.json +402 -2
  8. package/cli/epistery.mjs +742 -220
  9. package/client/witness.js +422 -284
  10. package/contracts/agent.sol +347 -24
  11. package/demo/server.mjs +129 -0
  12. package/demo/whitelist-test.html +664 -0
  13. package/dist/epistery.d.ts +55 -3
  14. package/dist/epistery.d.ts.map +1 -1
  15. package/dist/epistery.js +376 -42
  16. package/dist/epistery.js.map +1 -1
  17. package/dist/utils/Utils.d.ts +73 -2
  18. package/dist/utils/Utils.d.ts.map +1 -1
  19. package/dist/utils/Utils.js +326 -18
  20. package/dist/utils/Utils.js.map +1 -1
  21. package/dist/utils/types.d.ts +57 -1
  22. package/dist/utils/types.d.ts.map +1 -1
  23. package/dist/utils/types.js +13 -0
  24. package/dist/utils/types.js.map +1 -1
  25. package/index.mjs +156 -992
  26. package/package.json +13 -5
  27. package/routes/approval.mjs +257 -0
  28. package/routes/auth.mjs +253 -0
  29. package/routes/connect.mjs +95 -0
  30. package/routes/contract.mjs +23 -0
  31. package/routes/data.mjs +394 -0
  32. package/routes/domain.mjs +53 -0
  33. package/routes/identity.mjs +85 -0
  34. package/routes/index.mjs +78 -0
  35. package/routes/list.mjs +76 -0
  36. package/routes/notabot.mjs +268 -0
  37. package/routes/status.mjs +156 -0
  38. package/routes/whitelist/client/admin.html +1249 -0
  39. package/routes/whitelist/client/client.js +289 -0
  40. package/routes/whitelist/client/icon.svg +5 -0
  41. package/routes/whitelist/client/widget.html +90 -0
  42. package/routes/whitelist/index.mjs +708 -0
  43. package/scripts/deploy-agent.js +5 -5
  44. package/scripts/fund-test-wallets.js +204 -0
  45. package/scripts/setup-test-env.js +191 -0
  46. package/src/epistery.ts +497 -45
  47. package/src/utils/Utils.ts +439 -19
  48. package/src/utils/types.ts +68 -1
  49. package/test/fixtures/wallets.ts +70 -0
  50. package/test/mocks/dns.ts +109 -0
  51. package/test/routes/approval.test.ts +282 -0
  52. package/test/routes/auth.test.ts +176 -0
  53. package/test/routes/connect.test.ts +155 -0
  54. package/test/routes/contract.test.ts +58 -0
  55. package/test/routes/data.test.ts +474 -0
  56. package/test/routes/domain.test.ts +110 -0
  57. package/test/routes/identity.test.ts +165 -0
  58. package/test/routes/list.test.ts +172 -0
  59. package/test/routes/notabot.test.ts +157 -0
  60. package/test/routes/status.test.ts +130 -0
  61. package/test/routes/whitelist.test.ts +596 -0
  62. package/test/setup.ts +156 -0
  63. package/test/teardown.ts +14 -0
  64. package/test/utils.ts +346 -0
  65. package/vitest.config.ts +65 -0
  66. package/artifacts/build-info/9b85c8f19813050589c4ca647079da4e.json +0 -1
  67. package/artifacts/build-info/b0d21f00b5b6ae1bd915b0ac69b049ab.json +0 -1
  68. package/test/server.mjs +0 -89
  69. /package/{test → demo}/README.md +0 -0
  70. /package/{test → demo}/index.html +0 -0
  71. /package/{test → demo}/package.json +0 -0
@@ -0,0 +1,31 @@
1
+ # Epistery Test Environment Configuration
2
+
3
+ # Test Contract Address - Update after deploying test contract
4
+ # Deploy with: npx hardhat run scripts/deploy-agent.js --network amoy
5
+ TEST_CONTRACT_ADDRESS=
6
+
7
+ # Provider Configuration
8
+ TEST_PROVIDER_NAME=Polygon Amoy Testnet
9
+ TEST_PROVIDER_CHAIN_ID=80002
10
+ TEST_PROVIDER_RPC=https://rpc-amoy.polygon.technology
11
+ TEST_PROVIDER_CURRENCY_SYMBOL=POL
12
+ TEST_PROVIDER_CURRENCY_NAME=POL
13
+ TEST_PROVIDER_CURRENCY_DECIMALS=18
14
+
15
+ # Server Wallet - Fund this wallet with ~0.5 POL on Polygon Amoy
16
+ TEST_SERVER_ADDRESS=
17
+ TEST_SERVER_MNEMONIC=
18
+ TEST_SERVER_PUBLIC_KEY=
19
+ TEST_SERVER_PRIVATE_KEY=
20
+
21
+ # Client 1 Wallet - Used for standard client operations and admin role testing
22
+ TEST_CLIENT1_ADDRESS=
23
+ TEST_CLIENT1_MNEMONIC=
24
+ TEST_CLIENT1_PUBLIC_KEY=
25
+ TEST_CLIENT1_PRIVATE_KEY=
26
+
27
+ # Client 2 Wallet - Used for multi-wallet scenarios (moderator role testing)
28
+ TEST_CLIENT2_ADDRESS=
29
+ TEST_CLIENT2_MNEMONIC=
30
+ TEST_CLIENT2_PUBLIC_KEY=
31
+ TEST_CLIENT2_PRIVATE_KEY=
package/README.md CHANGED
@@ -320,6 +320,18 @@ See [Architecture.md](Architecture.md) for detailed architecture documentation.
320
320
  - **Encrypted Key Exchange**: Browser clients use ECDH for secure shared secret establishment
321
321
  - **On-Chain Verification**: Whitelist and ownership data stored immutably on blockchain
322
322
 
323
+ ## Testing
324
+
325
+ ```bash
326
+ # Setup test environment (generates wallets automatically)
327
+ npm run test:setup
328
+
329
+ # Run tests
330
+ npm test
331
+ ```
332
+
333
+ The setup script creates `.test.env` with generated wallet credentials. For integration tests requiring a deployed contract, add `TEST_CONTRACT_ADDRESS` to `.test.env` after running `npm run deploy:agent`.
334
+
323
335
  ## License
324
336
 
325
337
  MIT License - see [LICENSE](LICENSE) for details