epistery 1.2.6 → 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.
- package/.test.env.example +31 -0
- package/README.md +12 -0
- package/artifacts/build-info/06755c4b5b78c3712cbf3383ae571054.json +1 -0
- package/artifacts/build-info/d543a0323a7b2da80b60c3056668fbde.json +1 -0
- package/artifacts/contracts/IdentityContract.sol/IdentityContract.dbg.json +1 -1
- package/artifacts/contracts/agent.sol/Agent.dbg.json +1 -1
- package/artifacts/contracts/agent.sol/Agent.json +402 -2
- package/cli/epistery.mjs +820 -268
- package/client/witness.js +422 -284
- package/contracts/agent.sol +347 -24
- package/demo/server.mjs +129 -0
- package/demo/whitelist-test.html +664 -0
- package/dist/epistery.d.ts +55 -3
- package/dist/epistery.d.ts.map +1 -1
- package/dist/epistery.js +400 -48
- package/dist/epistery.js.map +1 -1
- package/dist/utils/Utils.d.ts +73 -2
- package/dist/utils/Utils.d.ts.map +1 -1
- package/dist/utils/Utils.js +326 -18
- package/dist/utils/Utils.js.map +1 -1
- package/dist/utils/types.d.ts +57 -1
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/types.js +13 -0
- package/dist/utils/types.js.map +1 -1
- package/index.mjs +160 -989
- package/package.json +13 -5
- package/routes/approval.mjs +257 -0
- package/routes/auth.mjs +253 -0
- package/routes/connect.mjs +95 -0
- package/routes/contract.mjs +23 -0
- package/routes/data.mjs +394 -0
- package/routes/domain.mjs +53 -0
- package/routes/identity.mjs +85 -0
- package/routes/index.mjs +78 -0
- package/routes/list.mjs +76 -0
- package/routes/notabot.mjs +268 -0
- package/routes/status.mjs +156 -0
- package/routes/whitelist/client/admin.html +1249 -0
- package/routes/whitelist/client/client.js +289 -0
- package/routes/whitelist/client/icon.svg +5 -0
- package/routes/whitelist/client/widget.html +90 -0
- package/routes/whitelist/index.mjs +708 -0
- package/scripts/deploy-agent.js +5 -5
- package/scripts/fund-test-wallets.js +204 -0
- package/scripts/setup-test-env.js +191 -0
- package/src/epistery.ts +525 -51
- package/src/utils/Utils.ts +439 -19
- package/src/utils/types.ts +68 -1
- package/test/fixtures/wallets.ts +70 -0
- package/test/mocks/dns.ts +109 -0
- package/test/routes/approval.test.ts +282 -0
- package/test/routes/auth.test.ts +176 -0
- package/test/routes/connect.test.ts +155 -0
- package/test/routes/contract.test.ts +58 -0
- package/test/routes/data.test.ts +474 -0
- package/test/routes/domain.test.ts +110 -0
- package/test/routes/identity.test.ts +165 -0
- package/test/routes/list.test.ts +172 -0
- package/test/routes/notabot.test.ts +157 -0
- package/test/routes/status.test.ts +130 -0
- package/test/routes/whitelist.test.ts +596 -0
- package/test/setup.ts +156 -0
- package/test/teardown.ts +14 -0
- package/test/utils.ts +346 -0
- package/vitest.config.ts +65 -0
- package/artifacts/build-info/9b85c8f19813050589c4ca647079da4e.json +0 -1
- package/artifacts/build-info/b0d21f00b5b6ae1bd915b0ac69b049ab.json +0 -1
- package/test/server.mjs +0 -89
- /package/{test → demo}/README.md +0 -0
- /package/{test → demo}/index.html +0 -0
- /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
|