@agirails/sdk 2.0.1-beta → 2.0.2
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/LICENSE +190 -0
- package/README.md +116 -108
- package/bin/actp +10 -0
- package/dist/ACTPClient.d.ts +456 -33
- package/dist/ACTPClient.d.ts.map +1 -1
- package/dist/ACTPClient.js +477 -93
- package/dist/ACTPClient.js.map +1 -1
- package/dist/abi/AgentRegistry.json +782 -0
- package/dist/abi/EscrowVault.json +106 -38
- package/dist/abi/IdentityRegistry.json +316 -0
- package/dist/adapters/BaseAdapter.d.ts +231 -0
- package/dist/adapters/BaseAdapter.d.ts.map +1 -0
- package/dist/adapters/BaseAdapter.js +393 -0
- package/dist/adapters/BaseAdapter.js.map +1 -0
- package/dist/adapters/BeginnerAdapter.d.ts +152 -0
- package/dist/adapters/BeginnerAdapter.d.ts.map +1 -0
- package/dist/adapters/BeginnerAdapter.js +168 -0
- package/dist/adapters/BeginnerAdapter.js.map +1 -0
- package/dist/adapters/IntermediateAdapter.d.ts +211 -0
- package/dist/adapters/IntermediateAdapter.d.ts.map +1 -0
- package/dist/adapters/IntermediateAdapter.js +260 -0
- package/dist/adapters/IntermediateAdapter.js.map +1 -0
- package/dist/adapters/index.d.ts +15 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +26 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/builders/DeliveryProofBuilder.d.ts +60 -1
- package/dist/builders/DeliveryProofBuilder.d.ts.map +1 -1
- package/dist/builders/DeliveryProofBuilder.js +81 -5
- package/dist/builders/DeliveryProofBuilder.js.map +1 -1
- package/dist/builders/QuoteBuilder.d.ts +101 -0
- package/dist/builders/QuoteBuilder.d.ts.map +1 -1
- package/dist/builders/QuoteBuilder.js +120 -3
- package/dist/builders/QuoteBuilder.js.map +1 -1
- package/dist/builders/index.d.ts +4 -0
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +4 -0
- package/dist/builders/index.js.map +1 -1
- package/dist/cli/commands/balance.d.ts +13 -0
- package/dist/cli/commands/balance.d.ts.map +1 -0
- package/dist/cli/commands/balance.js +89 -0
- package/dist/cli/commands/balance.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +24 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +424 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/config.d.ts +13 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +192 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/init.d.ts +19 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +143 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/mint.d.ts +13 -0
- package/dist/cli/commands/mint.d.ts.map +1 -0
- package/dist/cli/commands/mint.js +91 -0
- package/dist/cli/commands/mint.js.map +1 -0
- package/dist/cli/commands/pay.d.ts +18 -0
- package/dist/cli/commands/pay.d.ts.map +1 -0
- package/dist/cli/commands/pay.js +87 -0
- package/dist/cli/commands/pay.js.map +1 -0
- package/dist/cli/commands/simulate.d.ts +32 -0
- package/dist/cli/commands/simulate.d.ts.map +1 -0
- package/dist/cli/commands/simulate.js +290 -0
- package/dist/cli/commands/simulate.js.map +1 -0
- package/dist/cli/commands/time.d.ts +29 -0
- package/dist/cli/commands/time.d.ts.map +1 -0
- package/dist/cli/commands/time.js +252 -0
- package/dist/cli/commands/time.js.map +1 -0
- package/dist/cli/commands/tx.d.ts +16 -0
- package/dist/cli/commands/tx.d.ts.map +1 -0
- package/dist/cli/commands/tx.js +379 -0
- package/dist/cli/commands/tx.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +20 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +160 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +104 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/client.d.ts +70 -0
- package/dist/cli/utils/client.d.ts.map +1 -0
- package/dist/cli/utils/client.js +240 -0
- package/dist/cli/utils/client.js.map +1 -0
- package/dist/cli/utils/config.d.ts +91 -0
- package/dist/cli/utils/config.d.ts.map +1 -0
- package/dist/cli/utils/config.js +240 -0
- package/dist/cli/utils/config.js.map +1 -0
- package/dist/cli/utils/output.d.ts +174 -0
- package/dist/cli/utils/output.d.ts.map +1 -0
- package/dist/cli/utils/output.js +380 -0
- package/dist/cli/utils/output.js.map +1 -0
- package/dist/config/networks.d.ts +28 -0
- package/dist/config/networks.d.ts.map +1 -1
- package/dist/config/networks.js +60 -12
- package/dist/config/networks.js.map +1 -1
- package/dist/errors/index.d.ts +165 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +260 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/index.d.ts +61 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -36
- package/dist/index.js.map +1 -1
- package/dist/level0/Provider.d.ts +106 -0
- package/dist/level0/Provider.d.ts.map +1 -0
- package/dist/level0/Provider.js +10 -0
- package/dist/level0/Provider.js.map +1 -0
- package/dist/level0/ServiceDirectory.d.ts +74 -0
- package/dist/level0/ServiceDirectory.d.ts.map +1 -0
- package/dist/level0/ServiceDirectory.js +122 -0
- package/dist/level0/ServiceDirectory.js.map +1 -0
- package/dist/level0/index.d.ts +10 -0
- package/dist/level0/index.d.ts.map +1 -0
- package/dist/level0/index.js +15 -0
- package/dist/level0/index.js.map +1 -0
- package/dist/level0/provide.d.ts +51 -0
- package/dist/level0/provide.d.ts.map +1 -0
- package/dist/level0/provide.js +113 -0
- package/dist/level0/provide.js.map +1 -0
- package/dist/level0/request.d.ts +53 -0
- package/dist/level0/request.d.ts.map +1 -0
- package/dist/level0/request.js +462 -0
- package/dist/level0/request.js.map +1 -0
- package/dist/level1/Agent.d.ts +472 -0
- package/dist/level1/Agent.d.ts.map +1 -0
- package/dist/level1/Agent.js +1091 -0
- package/dist/level1/Agent.js.map +1 -0
- package/dist/level1/index.d.ts +10 -0
- package/dist/level1/index.d.ts.map +1 -0
- package/dist/level1/index.js +30 -0
- package/dist/level1/index.js.map +1 -0
- package/dist/level1/pricing/PriceCalculator.d.ts +62 -0
- package/dist/level1/pricing/PriceCalculator.d.ts.map +1 -0
- package/dist/level1/pricing/PriceCalculator.js +237 -0
- package/dist/level1/pricing/PriceCalculator.js.map +1 -0
- package/dist/level1/pricing/PricingStrategy.d.ts +179 -0
- package/dist/level1/pricing/PricingStrategy.d.ts.map +1 -0
- package/dist/level1/pricing/PricingStrategy.js +11 -0
- package/dist/level1/pricing/PricingStrategy.js.map +1 -0
- package/dist/level1/types/Job.d.ts +166 -0
- package/dist/level1/types/Job.d.ts.map +1 -0
- package/dist/level1/types/Job.js +11 -0
- package/dist/level1/types/Job.js.map +1 -0
- package/dist/level1/types/Options.d.ts +258 -0
- package/dist/level1/types/Options.d.ts.map +1 -0
- package/dist/level1/types/Options.js +8 -0
- package/dist/level1/types/Options.js.map +1 -0
- package/dist/level1/types/index.d.ts +8 -0
- package/dist/level1/types/index.d.ts.map +1 -0
- package/dist/level1/types/index.js +8 -0
- package/dist/level1/types/index.js.map +1 -0
- package/dist/protocol/ACTPKernel.d.ts +229 -2
- package/dist/protocol/ACTPKernel.d.ts.map +1 -1
- package/dist/protocol/ACTPKernel.js +367 -33
- package/dist/protocol/ACTPKernel.js.map +1 -1
- package/dist/protocol/AgentRegistry.d.ts +177 -0
- package/dist/protocol/AgentRegistry.d.ts.map +1 -0
- package/dist/protocol/AgentRegistry.js +449 -0
- package/dist/protocol/AgentRegistry.js.map +1 -0
- package/dist/protocol/DIDManager.d.ts +289 -0
- package/dist/protocol/DIDManager.d.ts.map +1 -0
- package/dist/protocol/DIDManager.js +481 -0
- package/dist/protocol/DIDManager.js.map +1 -0
- package/dist/protocol/DIDResolver.d.ts +236 -0
- package/dist/protocol/DIDResolver.d.ts.map +1 -0
- package/dist/protocol/DIDResolver.js +495 -0
- package/dist/protocol/DIDResolver.js.map +1 -0
- package/dist/protocol/EASHelper.d.ts +57 -2
- package/dist/protocol/EASHelper.d.ts.map +1 -1
- package/dist/protocol/EASHelper.js +230 -37
- package/dist/protocol/EASHelper.js.map +1 -1
- package/dist/protocol/EscrowVault.d.ts +93 -2
- package/dist/protocol/EscrowVault.d.ts.map +1 -1
- package/dist/protocol/EscrowVault.js +122 -33
- package/dist/protocol/EscrowVault.js.map +1 -1
- package/dist/protocol/EventMonitor.d.ts +45 -1
- package/dist/protocol/EventMonitor.d.ts.map +1 -1
- package/dist/protocol/EventMonitor.js +64 -8
- package/dist/protocol/EventMonitor.js.map +1 -1
- package/dist/protocol/MessageSigner.d.ts +116 -2
- package/dist/protocol/MessageSigner.d.ts.map +1 -1
- package/dist/protocol/MessageSigner.js +215 -9
- package/dist/protocol/MessageSigner.js.map +1 -1
- package/dist/protocol/ProofGenerator.d.ts +93 -0
- package/dist/protocol/ProofGenerator.d.ts.map +1 -1
- package/dist/protocol/ProofGenerator.js +194 -9
- package/dist/protocol/ProofGenerator.js.map +1 -1
- package/dist/protocol/QuoteBuilder.d.ts +8 -0
- package/dist/protocol/QuoteBuilder.d.ts.map +1 -1
- package/dist/protocol/QuoteBuilder.js +8 -0
- package/dist/protocol/QuoteBuilder.js.map +1 -1
- package/dist/runtime/BlockchainRuntime.d.ts +360 -0
- package/dist/runtime/BlockchainRuntime.d.ts.map +1 -0
- package/dist/runtime/BlockchainRuntime.js +767 -0
- package/dist/runtime/BlockchainRuntime.js.map +1 -0
- package/dist/runtime/IACTPRuntime.d.ts +271 -0
- package/dist/runtime/IACTPRuntime.d.ts.map +1 -0
- package/dist/runtime/IACTPRuntime.js +15 -0
- package/dist/runtime/IACTPRuntime.js.map +1 -0
- package/dist/runtime/MockRuntime.d.ts +445 -0
- package/dist/runtime/MockRuntime.d.ts.map +1 -0
- package/dist/runtime/MockRuntime.js +1065 -0
- package/dist/runtime/MockRuntime.js.map +1 -0
- package/dist/runtime/MockStateManager.d.ts +233 -0
- package/dist/runtime/MockStateManager.d.ts.map +1 -0
- package/dist/runtime/MockStateManager.js +533 -0
- package/dist/runtime/MockStateManager.js.map +1 -0
- package/dist/runtime/index.d.ts +14 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +42 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/types/MockState.d.ts +167 -0
- package/dist/runtime/types/MockState.d.ts.map +1 -0
- package/dist/runtime/types/MockState.js +43 -0
- package/dist/runtime/types/MockState.js.map +1 -0
- package/dist/types/agent.d.ts +76 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +8 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/did.d.ts +192 -0
- package/dist/types/did.d.ts.map +1 -0
- package/dist/types/did.js +38 -0
- package/dist/types/did.js.map +1 -0
- package/dist/types/eip712.d.ts +34 -0
- package/dist/types/eip712.d.ts.map +1 -1
- package/dist/types/eip712.js +31 -5
- package/dist/types/eip712.js.map +1 -1
- package/dist/types/escrow.d.ts +17 -10
- package/dist/types/escrow.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/message.d.ts +32 -0
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js +4 -0
- package/dist/types/message.js.map +1 -1
- package/dist/types/state.d.ts +28 -0
- package/dist/types/state.d.ts.map +1 -1
- package/dist/types/state.js +37 -6
- package/dist/types/state.js.map +1 -1
- package/dist/types/transaction.d.ts +17 -0
- package/dist/types/transaction.d.ts.map +1 -1
- package/dist/utils/ErrorRecoveryGuide.d.ts +125 -0
- package/dist/utils/ErrorRecoveryGuide.d.ts.map +1 -0
- package/dist/utils/ErrorRecoveryGuide.js +579 -0
- package/dist/utils/ErrorRecoveryGuide.js.map +1 -0
- package/dist/utils/Helpers.d.ts +453 -0
- package/dist/utils/Helpers.d.ts.map +1 -0
- package/dist/utils/Helpers.js +623 -0
- package/dist/utils/Helpers.js.map +1 -0
- package/dist/utils/IPFSClient.d.ts +113 -0
- package/dist/utils/IPFSClient.d.ts.map +1 -1
- package/dist/utils/IPFSClient.js +128 -7
- package/dist/utils/IPFSClient.js.map +1 -1
- package/dist/utils/Logger.d.ts +195 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/Logger.js +382 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/NonceManager.d.ts +234 -1
- package/dist/utils/NonceManager.d.ts.map +1 -1
- package/dist/utils/NonceManager.js +372 -7
- package/dist/utils/NonceManager.js.map +1 -1
- package/dist/utils/RateLimiter.d.ts +253 -0
- package/dist/utils/RateLimiter.d.ts.map +1 -0
- package/dist/utils/RateLimiter.js +424 -0
- package/dist/utils/RateLimiter.js.map +1 -0
- package/dist/utils/ReceivedNonceTracker.d.ts +175 -0
- package/dist/utils/ReceivedNonceTracker.d.ts.map +1 -1
- package/dist/utils/ReceivedNonceTracker.js +261 -5
- package/dist/utils/ReceivedNonceTracker.js.map +1 -1
- package/dist/utils/SDKLifecycle.d.ts +156 -0
- package/dist/utils/SDKLifecycle.d.ts.map +1 -0
- package/dist/utils/SDKLifecycle.js +347 -0
- package/dist/utils/SDKLifecycle.js.map +1 -0
- package/dist/utils/SecureNonce.d.ts +57 -0
- package/dist/utils/SecureNonce.d.ts.map +1 -0
- package/dist/utils/SecureNonce.js +80 -0
- package/dist/utils/SecureNonce.js.map +1 -0
- package/dist/utils/Semaphore.d.ts +123 -0
- package/dist/utils/Semaphore.d.ts.map +1 -0
- package/dist/utils/Semaphore.js +247 -0
- package/dist/utils/Semaphore.js.map +1 -0
- package/dist/utils/UsedAttestationTracker.d.ts +167 -0
- package/dist/utils/UsedAttestationTracker.d.ts.map +1 -0
- package/dist/utils/UsedAttestationTracker.js +309 -0
- package/dist/utils/UsedAttestationTracker.js.map +1 -0
- package/dist/utils/canonicalJson.d.ts +22 -0
- package/dist/utils/canonicalJson.d.ts.map +1 -1
- package/dist/utils/canonicalJson.js +26 -3
- package/dist/utils/canonicalJson.js.map +1 -1
- package/dist/utils/computeTypeHash.d.ts +14 -0
- package/dist/utils/computeTypeHash.d.ts.map +1 -1
- package/dist/utils/computeTypeHash.js +19 -2
- package/dist/utils/computeTypeHash.js.map +1 -1
- package/dist/utils/fsSafe.d.ts +14 -0
- package/dist/utils/fsSafe.d.ts.map +1 -0
- package/dist/utils/fsSafe.js +89 -0
- package/dist/utils/fsSafe.js.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +51 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/security.d.ts +147 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +391 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/validation.d.ts +40 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +184 -7
- package/dist/utils/validation.js.map +1 -1
- package/package.json +54 -37
- package/src/ACTPClient.ts +692 -178
- package/src/abi/AgentRegistry.json +782 -0
- package/src/abi/EscrowVault.json +106 -38
- package/src/abi/IdentityRegistry.json +316 -0
- package/src/adapters/BaseAdapter.ts +473 -0
- package/src/adapters/BeginnerAdapter.ts +232 -0
- package/src/adapters/IntermediateAdapter.ts +316 -0
- package/src/adapters/index.ts +25 -0
- package/src/builders/DeliveryProofBuilder.ts +3 -2
- package/src/cli/commands/balance.ts +110 -0
- package/src/cli/commands/batch.ts +487 -0
- package/src/cli/commands/config.ts +231 -0
- package/src/cli/commands/init.ts +161 -0
- package/src/cli/commands/mint.ts +116 -0
- package/src/cli/commands/pay.ts +113 -0
- package/src/cli/commands/simulate.ts +345 -0
- package/src/cli/commands/time.ts +303 -0
- package/src/cli/commands/tx.ts +448 -0
- package/src/cli/commands/watch.ts +211 -0
- package/src/cli/index.ts +116 -0
- package/src/cli/utils/client.ts +249 -0
- package/src/cli/utils/config.ts +282 -0
- package/src/cli/utils/output.ts +465 -0
- package/src/config/networks.ts +32 -9
- package/src/errors/index.ts +298 -1
- package/src/index.ts +207 -71
- package/src/level0/Provider.ts +117 -0
- package/src/level0/ServiceDirectory.ts +131 -0
- package/src/level0/index.ts +10 -0
- package/src/level0/provide.ts +131 -0
- package/src/level0/request.ts +494 -0
- package/src/level1/Agent.ts +1432 -0
- package/src/level1/index.ts +10 -0
- package/src/level1/pricing/PriceCalculator.ts +255 -0
- package/src/level1/pricing/PricingStrategy.ts +198 -0
- package/src/level1/types/Job.ts +179 -0
- package/src/level1/types/Options.ts +291 -0
- package/src/level1/types/index.ts +8 -0
- package/src/protocol/ACTPKernel.ts +175 -23
- package/src/protocol/AgentRegistry.ts +559 -0
- package/src/protocol/DIDManager.ts +629 -0
- package/src/protocol/DIDResolver.ts +554 -0
- package/src/protocol/EASHelper.ts +230 -46
- package/src/protocol/EscrowVault.ts +68 -50
- package/src/protocol/EventMonitor.ts +44 -15
- package/src/protocol/MessageSigner.ts +193 -13
- package/src/protocol/ProofGenerator.ts +223 -4
- package/src/runtime/BlockchainRuntime.ts +993 -0
- package/src/runtime/IACTPRuntime.ts +284 -0
- package/src/runtime/MockRuntime.ts +1244 -0
- package/src/runtime/MockStateManager.ts +576 -0
- package/src/runtime/index.ts +25 -0
- package/src/runtime/types/MockState.ts +227 -0
- package/src/types/agent.ts +79 -0
- package/src/types/did.ts +223 -0
- package/src/types/escrow.ts +12 -11
- package/src/types/index.ts +5 -1
- package/src/types/state.ts +12 -3
- package/src/types/transaction.ts +4 -1
- package/src/utils/ErrorRecoveryGuide.ts +675 -0
- package/src/utils/Helpers.ts +688 -0
- package/src/utils/IPFSClient.ts +122 -5
- package/src/utils/Logger.ts +484 -0
- package/src/utils/NonceManager.ts +305 -8
- package/src/utils/RateLimiter.ts +534 -0
- package/src/utils/ReceivedNonceTracker.ts +170 -0
- package/src/utils/SDKLifecycle.ts +416 -0
- package/src/utils/SecureNonce.ts +78 -0
- package/src/utils/Semaphore.ts +276 -0
- package/src/utils/UsedAttestationTracker.ts +387 -0
- package/src/utils/fsSafe.ts +75 -0
- package/src/utils/index.ts +80 -0
- package/src/utils/security.ts +418 -0
- package/src/utils/validation.ts +164 -0
- package/src/__tests__/ProofGenerator.test.ts +0 -124
- package/src/__tests__/QuoteBuilder.test.ts +0 -516
- package/src/__tests__/StateMachine.test.ts +0 -82
- package/src/__tests__/builders/DeliveryProofBuilder.test.ts +0 -581
- package/src/__tests__/integration/ACTPClient.test.ts +0 -263
- package/src/__tests__/integration.test.ts +0 -289
- package/src/__tests__/protocol/EASHelper.test.ts +0 -472
- package/src/__tests__/protocol/EventMonitor.test.ts +0 -382
- package/src/__tests__/security/ACTPKernel.security.test.ts +0 -1167
- package/src/__tests__/security/EscrowVault.security.test.ts +0 -570
- package/src/__tests__/security/MessageSigner.security.test.ts +0 -286
- package/src/__tests__/security/NonceReplay.security.test.ts +0 -501
- package/src/__tests__/security/validation.security.test.ts +0 -376
- package/src/__tests__/utils/IPFSClient.test.ts +0 -262
- package/src/__tests__/utils/NonceManager.test.ts +0 -205
- package/src/__tests__/utils/canonicalJson.test.ts +0 -153
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AgentRegistry = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const AgentRegistry_json_1 = __importDefault(require("../abi/AgentRegistry.json"));
|
|
9
|
+
const errors_1 = require("../errors");
|
|
10
|
+
const validation_1 = require("../utils/validation");
|
|
11
|
+
/**
|
|
12
|
+
* AgentRegistry - Agent Identity & Reputation SDK Module (AIP-7)
|
|
13
|
+
*
|
|
14
|
+
* Provides methods for:
|
|
15
|
+
* - Registering AI agents on-chain
|
|
16
|
+
* - Managing agent profiles and services
|
|
17
|
+
* - Querying agents by service type
|
|
18
|
+
* - Reading reputation scores
|
|
19
|
+
*
|
|
20
|
+
* Reference: AIP-7 Agent Identity, Registry & Storage System
|
|
21
|
+
*/
|
|
22
|
+
class AgentRegistry {
|
|
23
|
+
constructor(address, signer, gasSettings) {
|
|
24
|
+
this.address = address;
|
|
25
|
+
this.contract = new ethers_1.Contract(address, AgentRegistry_json_1.default, signer);
|
|
26
|
+
this.gasSettings = gasSettings;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get gas buffer multiplier based on operation complexity
|
|
30
|
+
*/
|
|
31
|
+
getGasBufferMultiplier(operation) {
|
|
32
|
+
const buffers = {
|
|
33
|
+
'registerAgent': 1.40, // 40% - Complex storage writes
|
|
34
|
+
'addServiceType': 1.25, // 25% - Storage update
|
|
35
|
+
'removeServiceType': 1.25,
|
|
36
|
+
'updateEndpoint': 1.20, // 20% - Simple storage update
|
|
37
|
+
'setActiveStatus': 1.15 // 15% - Boolean update
|
|
38
|
+
};
|
|
39
|
+
return buffers[operation] || 1.20;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build transaction options with gas settings
|
|
43
|
+
*/
|
|
44
|
+
buildTxOptions(estimatedGas, operation = 'default') {
|
|
45
|
+
const bufferMultiplier = this.getGasBufferMultiplier(operation);
|
|
46
|
+
let gasLimit = (estimatedGas * BigInt(Math.round(bufferMultiplier * 100))) / 100n;
|
|
47
|
+
// Cap gas limit (Base L2 safety)
|
|
48
|
+
const MAX_GAS_LIMIT = 10000000n;
|
|
49
|
+
if (gasLimit > MAX_GAS_LIMIT) {
|
|
50
|
+
throw new errors_1.ValidationError('gasLimit', `Estimated gas exceeds maximum safe limit (${MAX_GAS_LIMIT})`);
|
|
51
|
+
}
|
|
52
|
+
const options = { gasLimit };
|
|
53
|
+
if (this.gasSettings?.maxFeePerGas) {
|
|
54
|
+
options.maxFeePerGas = this.gasSettings.maxFeePerGas;
|
|
55
|
+
}
|
|
56
|
+
if (this.gasSettings?.maxPriorityFeePerGas) {
|
|
57
|
+
options.maxPriorityFeePerGas = this.gasSettings.maxPriorityFeePerGas;
|
|
58
|
+
}
|
|
59
|
+
return options;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get registry contract address
|
|
63
|
+
*/
|
|
64
|
+
getAddress() {
|
|
65
|
+
return this.address;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Compute service type hash
|
|
69
|
+
* Service types must be lowercase with only a-z, 0-9, and hyphens
|
|
70
|
+
*
|
|
71
|
+
* @param serviceType - Human-readable service type (e.g., "text-generation")
|
|
72
|
+
* @returns keccak256 hash of the service type
|
|
73
|
+
*/
|
|
74
|
+
computeServiceTypeHash(serviceType) {
|
|
75
|
+
// Validate length
|
|
76
|
+
const MAX_SERVICE_TYPE_LENGTH = 64;
|
|
77
|
+
if (serviceType.length > MAX_SERVICE_TYPE_LENGTH) {
|
|
78
|
+
throw new errors_1.ValidationError('serviceType', `Service type exceeds maximum length (${MAX_SERVICE_TYPE_LENGTH} characters)`);
|
|
79
|
+
}
|
|
80
|
+
// Validate format
|
|
81
|
+
if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(serviceType)) {
|
|
82
|
+
throw new errors_1.ValidationError('serviceType', 'Must be lowercase alphanumeric with hyphens (e.g., "text-generation")');
|
|
83
|
+
}
|
|
84
|
+
return (0, ethers_1.keccak256)((0, ethers_1.toUtf8Bytes)(serviceType));
|
|
85
|
+
}
|
|
86
|
+
// ========== WRITE FUNCTIONS ==========
|
|
87
|
+
/**
|
|
88
|
+
* Register a new agent profile
|
|
89
|
+
*
|
|
90
|
+
* @param params - Registration parameters
|
|
91
|
+
* @returns Transaction hash
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* await registry.registerAgent({
|
|
96
|
+
* endpoint: 'https://myagent.example.com/webhook',
|
|
97
|
+
* serviceDescriptors: [{
|
|
98
|
+
* serviceTypeHash: registry.computeServiceTypeHash('text-generation'),
|
|
99
|
+
* serviceType: 'text-generation',
|
|
100
|
+
* schemaURI: 'ipfs://Qm...',
|
|
101
|
+
* minPrice: 1_000_000n, // 1 USDC
|
|
102
|
+
* maxPrice: 100_000_000n, // 100 USDC
|
|
103
|
+
* avgCompletionTime: 60,
|
|
104
|
+
* metadataCID: 'Qm...'
|
|
105
|
+
* }]
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
async registerAgent(params) {
|
|
110
|
+
// SECURITY FIX (H-1): Await async endpoint validation (DNS resolution + SSRF check)
|
|
111
|
+
await (0, validation_1.validateEndpointURL)(params.endpoint, 'endpoint');
|
|
112
|
+
if (!params.serviceDescriptors || params.serviceDescriptors.length === 0) {
|
|
113
|
+
throw new errors_1.ValidationError('serviceDescriptors', 'At least one service descriptor required');
|
|
114
|
+
}
|
|
115
|
+
const MAX_SERVICE_DESCRIPTORS = 100;
|
|
116
|
+
if (params.serviceDescriptors.length > MAX_SERVICE_DESCRIPTORS) {
|
|
117
|
+
throw new errors_1.ValidationError('serviceDescriptors', `Too many service descriptors (max: ${MAX_SERVICE_DESCRIPTORS})`);
|
|
118
|
+
}
|
|
119
|
+
// Validate each service descriptor
|
|
120
|
+
for (const sd of params.serviceDescriptors) {
|
|
121
|
+
const expectedHash = this.computeServiceTypeHash(sd.serviceType);
|
|
122
|
+
if (sd.serviceTypeHash !== expectedHash) {
|
|
123
|
+
throw new errors_1.ValidationError('serviceTypeHash', `Hash mismatch for ${sd.serviceType}. Expected ${expectedHash}`);
|
|
124
|
+
}
|
|
125
|
+
// C-2: Validate price range
|
|
126
|
+
if (sd.minPrice < 0n) {
|
|
127
|
+
throw new errors_1.ValidationError('minPrice', 'Minimum price cannot be negative');
|
|
128
|
+
}
|
|
129
|
+
if (sd.maxPrice < 0n) {
|
|
130
|
+
throw new errors_1.ValidationError('maxPrice', 'Maximum price cannot be negative');
|
|
131
|
+
}
|
|
132
|
+
if (sd.minPrice > sd.maxPrice) {
|
|
133
|
+
throw new errors_1.ValidationError('priceRange', `minPrice (${sd.minPrice}) cannot exceed maxPrice (${sd.maxPrice})`);
|
|
134
|
+
}
|
|
135
|
+
// Sanity check: max $1M USDC
|
|
136
|
+
const MAX_PRICE = 1000000000000n;
|
|
137
|
+
if (sd.maxPrice > MAX_PRICE) {
|
|
138
|
+
throw new errors_1.ValidationError('maxPrice', 'Price exceeds maximum reasonable value ($1M USDC)');
|
|
139
|
+
}
|
|
140
|
+
// Validate completion time
|
|
141
|
+
if (sd.avgCompletionTime <= 0) {
|
|
142
|
+
throw new errors_1.ValidationError('avgCompletionTime', 'Average completion time must be positive');
|
|
143
|
+
}
|
|
144
|
+
const MAX_COMPLETION_TIME = 30 * 24 * 60 * 60; // 30 days
|
|
145
|
+
if (sd.avgCompletionTime > MAX_COMPLETION_TIME) {
|
|
146
|
+
throw new errors_1.ValidationError('avgCompletionTime', 'Completion time exceeds maximum (30 days)');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
const registerFunc = this.contract.getFunction('registerAgent');
|
|
151
|
+
// Convert to contract format
|
|
152
|
+
const descriptors = params.serviceDescriptors.map(sd => ({
|
|
153
|
+
serviceTypeHash: sd.serviceTypeHash,
|
|
154
|
+
serviceType: sd.serviceType,
|
|
155
|
+
schemaURI: sd.schemaURI,
|
|
156
|
+
minPrice: sd.minPrice,
|
|
157
|
+
maxPrice: sd.maxPrice,
|
|
158
|
+
avgCompletionTime: sd.avgCompletionTime,
|
|
159
|
+
metadataCID: sd.metadataCID
|
|
160
|
+
}));
|
|
161
|
+
const estimatedGas = await registerFunc.estimateGas(params.endpoint, descriptors);
|
|
162
|
+
const txOptions = this.buildTxOptions(estimatedGas, 'registerAgent');
|
|
163
|
+
const tx = await registerFunc(params.endpoint, descriptors, txOptions);
|
|
164
|
+
const receipt = await tx.wait(2); // L-2: Wait for 2 confirmations
|
|
165
|
+
return receipt.hash;
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
throw new errors_1.TransactionRevertedError(error.transactionHash, `Agent registration failed: ${error.reason || error.message}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Update agent endpoint URL
|
|
173
|
+
*
|
|
174
|
+
* @param newEndpoint - New webhook/IPFS gateway URL
|
|
175
|
+
*/
|
|
176
|
+
async updateEndpoint(newEndpoint) {
|
|
177
|
+
// SECURITY FIX (H-1): Await async endpoint validation (DNS resolution + SSRF check)
|
|
178
|
+
await (0, validation_1.validateEndpointURL)(newEndpoint, 'newEndpoint');
|
|
179
|
+
try {
|
|
180
|
+
const updateFunc = this.contract.getFunction('updateEndpoint');
|
|
181
|
+
const estimatedGas = await updateFunc.estimateGas(newEndpoint);
|
|
182
|
+
const txOptions = this.buildTxOptions(estimatedGas, 'updateEndpoint');
|
|
183
|
+
const tx = await updateFunc(newEndpoint, txOptions);
|
|
184
|
+
const receipt = await tx.wait(2); // L-2: Wait for 2 confirmations
|
|
185
|
+
return receipt.hash;
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
throw new errors_1.TransactionRevertedError(error.transactionHash, `Endpoint update failed: ${error.reason || error.message}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Add a new service type to agent profile
|
|
193
|
+
*
|
|
194
|
+
* @param serviceType - Lowercase service type (e.g., "code-review")
|
|
195
|
+
*/
|
|
196
|
+
async addServiceType(serviceType) {
|
|
197
|
+
// Validate format
|
|
198
|
+
this.computeServiceTypeHash(serviceType);
|
|
199
|
+
try {
|
|
200
|
+
const addFunc = this.contract.getFunction('addServiceType');
|
|
201
|
+
const estimatedGas = await addFunc.estimateGas(serviceType);
|
|
202
|
+
const txOptions = this.buildTxOptions(estimatedGas, 'addServiceType');
|
|
203
|
+
const tx = await addFunc(serviceType, txOptions);
|
|
204
|
+
const receipt = await tx.wait(2); // L-2: Wait for 2 confirmations
|
|
205
|
+
return receipt.hash;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
throw new errors_1.TransactionRevertedError(error.transactionHash, `Add service type failed: ${error.reason || error.message}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Remove a service type from agent profile
|
|
213
|
+
*
|
|
214
|
+
* @param serviceTypeHash - Hash of service type to remove
|
|
215
|
+
*/
|
|
216
|
+
async removeServiceType(serviceTypeHash) {
|
|
217
|
+
// C-3: Validate hash format (bytes32)
|
|
218
|
+
if (!serviceTypeHash || !/^0x[a-fA-F0-9]{64}$/.test(serviceTypeHash)) {
|
|
219
|
+
throw new errors_1.ValidationError('serviceTypeHash', 'Must be valid bytes32 hex string (0x + 64 hex chars)');
|
|
220
|
+
}
|
|
221
|
+
if (serviceTypeHash === '0x0000000000000000000000000000000000000000000000000000000000000000') {
|
|
222
|
+
throw new errors_1.ValidationError('serviceTypeHash', 'Cannot be zero hash');
|
|
223
|
+
}
|
|
224
|
+
try {
|
|
225
|
+
const removeFunc = this.contract.getFunction('removeServiceType');
|
|
226
|
+
const estimatedGas = await removeFunc.estimateGas(serviceTypeHash);
|
|
227
|
+
const txOptions = this.buildTxOptions(estimatedGas, 'removeServiceType');
|
|
228
|
+
const tx = await removeFunc(serviceTypeHash, txOptions);
|
|
229
|
+
const receipt = await tx.wait(2); // L-2: Wait for 2 confirmations
|
|
230
|
+
return receipt.hash;
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
throw new errors_1.TransactionRevertedError(error.transactionHash, `Remove service type failed: ${error.reason || error.message}`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Set agent active/inactive status
|
|
238
|
+
*
|
|
239
|
+
* @param isActive - Whether agent is accepting new requests
|
|
240
|
+
*/
|
|
241
|
+
async setActiveStatus(isActive) {
|
|
242
|
+
try {
|
|
243
|
+
const setFunc = this.contract.getFunction('setActiveStatus');
|
|
244
|
+
const estimatedGas = await setFunc.estimateGas(isActive);
|
|
245
|
+
const txOptions = this.buildTxOptions(estimatedGas, 'setActiveStatus');
|
|
246
|
+
const tx = await setFunc(isActive, txOptions);
|
|
247
|
+
const receipt = await tx.wait(2); // L-2: Wait for 2 confirmations
|
|
248
|
+
return receipt.hash;
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
throw new errors_1.TransactionRevertedError(error.transactionHash, `Set active status failed: ${error.reason || error.message}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// ========== READ FUNCTIONS ==========
|
|
255
|
+
/**
|
|
256
|
+
* Get agent profile by address
|
|
257
|
+
*
|
|
258
|
+
* @param agentAddress - Agent's Ethereum address
|
|
259
|
+
* @returns Agent profile or null if not registered
|
|
260
|
+
*/
|
|
261
|
+
async getAgent(agentAddress) {
|
|
262
|
+
(0, validation_1.validateAddress)(agentAddress, 'agentAddress');
|
|
263
|
+
const profile = await this.contract.getAgent(agentAddress);
|
|
264
|
+
// Check if registered (registeredAt > 0)
|
|
265
|
+
if (profile.registeredAt === 0n) {
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
return this._mapProfile(profile);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Get agent profile by DID
|
|
272
|
+
*
|
|
273
|
+
* @param did - Agent's DID (e.g., "did:ethr:8453:0x...")
|
|
274
|
+
* @returns Agent profile or null if not found
|
|
275
|
+
*/
|
|
276
|
+
async getAgentByDID(did) {
|
|
277
|
+
// H-2: Strengthen DID validation
|
|
278
|
+
const didPattern = /^did:ethr:(\d+):(0x[a-fA-F0-9]{40})$/;
|
|
279
|
+
const match = did.match(didPattern);
|
|
280
|
+
if (!match) {
|
|
281
|
+
throw new errors_1.ValidationError('did', 'Invalid DID format. Expected did:ethr:<chainId>:<address> (e.g., did:ethr:84532:0x1234...)');
|
|
282
|
+
}
|
|
283
|
+
const [, chainIdStr] = match;
|
|
284
|
+
// Validate chain ID matches
|
|
285
|
+
const currentChainId = await this.getChainId();
|
|
286
|
+
if (parseInt(chainIdStr, 10) !== currentChainId) {
|
|
287
|
+
throw new errors_1.ValidationError('did', `DID chain ID (${chainIdStr}) does not match registry chain ID (${currentChainId})`);
|
|
288
|
+
}
|
|
289
|
+
const profile = await this.contract.getAgentByDID(did);
|
|
290
|
+
if (profile.registeredAt === 0n) {
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
return this._mapProfile(profile);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Query agents by service type
|
|
297
|
+
*
|
|
298
|
+
* **IMPORTANT - Query Cap Limitation (L-4)**:
|
|
299
|
+
*
|
|
300
|
+
* This method will throw `QueryCapExceededError` when the registry contains
|
|
301
|
+
* more than 1000 agents. This is an intentional DoS prevention measure.
|
|
302
|
+
*
|
|
303
|
+
* When you encounter this error, migrate to an off-chain indexer:
|
|
304
|
+
* - The Graph: https://thegraph.com/
|
|
305
|
+
* - Goldsky: https://goldsky.com/
|
|
306
|
+
* - Alchemy Subgraphs: https://docs.alchemy.com/docs/subgraphs-overview
|
|
307
|
+
*
|
|
308
|
+
* See `QueryCapExceededError` documentation for event schemas to index.
|
|
309
|
+
*
|
|
310
|
+
* @param params - Query parameters
|
|
311
|
+
* @returns List of agent addresses matching criteria
|
|
312
|
+
* @throws {QueryCapExceededError} When registry exceeds 1000 agents
|
|
313
|
+
* @throws {ValidationError} For invalid parameters
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```typescript
|
|
317
|
+
* try {
|
|
318
|
+
* const agents = await registry.queryAgentsByService({
|
|
319
|
+
* serviceTypeHash: registry.computeServiceTypeHash('text-generation'),
|
|
320
|
+
* minReputation: 5000,
|
|
321
|
+
* limit: 50
|
|
322
|
+
* });
|
|
323
|
+
* } catch (error) {
|
|
324
|
+
* if (error instanceof QueryCapExceededError) {
|
|
325
|
+
* console.log('Registry too large, use off-chain indexer');
|
|
326
|
+
* // Fallback to your indexer implementation
|
|
327
|
+
* }
|
|
328
|
+
* }
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
async queryAgentsByService(params) {
|
|
332
|
+
// H-3: Add pagination bounds and validation
|
|
333
|
+
// Validate serviceTypeHash format
|
|
334
|
+
if (!params.serviceTypeHash || !/^0x[a-fA-F0-9]{64}$/.test(params.serviceTypeHash)) {
|
|
335
|
+
throw new errors_1.ValidationError('serviceTypeHash', 'Must be valid bytes32 hex string');
|
|
336
|
+
}
|
|
337
|
+
// Validate reputation bounds (0-10000 scale)
|
|
338
|
+
const reputation = params.minReputation ?? 0;
|
|
339
|
+
if (reputation < 0 || reputation > 10000) {
|
|
340
|
+
throw new errors_1.ValidationError('minReputation', 'Must be between 0 and 10000');
|
|
341
|
+
}
|
|
342
|
+
// Validate offset
|
|
343
|
+
const offset = params.offset ?? 0;
|
|
344
|
+
if (offset < 0) {
|
|
345
|
+
throw new errors_1.ValidationError('offset', 'Cannot be negative');
|
|
346
|
+
}
|
|
347
|
+
// Validate and cap limit
|
|
348
|
+
const MAX_LIMIT = 1000;
|
|
349
|
+
let limit = params.limit ?? 100;
|
|
350
|
+
if (limit <= 0) {
|
|
351
|
+
throw new errors_1.ValidationError('limit', 'Must be positive');
|
|
352
|
+
}
|
|
353
|
+
if (limit > MAX_LIMIT) {
|
|
354
|
+
limit = MAX_LIMIT; // Cap silently
|
|
355
|
+
}
|
|
356
|
+
try {
|
|
357
|
+
const agents = await this.contract.queryAgentsByService(params.serviceTypeHash, reputation, offset, limit);
|
|
358
|
+
return agents;
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
// [L-4] Catch query cap exceeded revert and throw descriptive error
|
|
362
|
+
const message = error.message || error.reason || '';
|
|
363
|
+
if (message.includes('Too many agents')) {
|
|
364
|
+
// Extract approximate size from error or use default
|
|
365
|
+
throw new errors_1.QueryCapExceededError(1001, 1000);
|
|
366
|
+
}
|
|
367
|
+
throw error;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Get service descriptors for an agent
|
|
372
|
+
*
|
|
373
|
+
* @param agentAddress - Agent's Ethereum address
|
|
374
|
+
* @returns List of service descriptors
|
|
375
|
+
*/
|
|
376
|
+
async getServiceDescriptors(agentAddress) {
|
|
377
|
+
(0, validation_1.validateAddress)(agentAddress, 'agentAddress');
|
|
378
|
+
const descriptors = await this.contract.getServiceDescriptors(agentAddress);
|
|
379
|
+
return descriptors.map((d) => ({
|
|
380
|
+
serviceTypeHash: d.serviceTypeHash,
|
|
381
|
+
serviceType: d.serviceType,
|
|
382
|
+
schemaURI: d.schemaURI,
|
|
383
|
+
minPrice: d.minPrice,
|
|
384
|
+
maxPrice: d.maxPrice,
|
|
385
|
+
avgCompletionTime: Number(d.avgCompletionTime),
|
|
386
|
+
metadataCID: d.metadataCID
|
|
387
|
+
}));
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Check if agent supports a service type
|
|
391
|
+
*
|
|
392
|
+
* @param agentAddress - Agent's Ethereum address
|
|
393
|
+
* @param serviceTypeHash - Service type hash
|
|
394
|
+
* @returns True if supported
|
|
395
|
+
*/
|
|
396
|
+
async supportsService(agentAddress, serviceTypeHash) {
|
|
397
|
+
(0, validation_1.validateAddress)(agentAddress, 'agentAddress');
|
|
398
|
+
return await this.contract.supportsService(agentAddress, serviceTypeHash);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Get the chain ID used for DID generation
|
|
402
|
+
*/
|
|
403
|
+
async getChainId() {
|
|
404
|
+
return Number(await this.contract.chainId());
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Build a DID for an address on the current chain
|
|
408
|
+
*
|
|
409
|
+
* @param address - Ethereum address
|
|
410
|
+
* @returns DID string (e.g., "did:ethr:8453:0x...")
|
|
411
|
+
*/
|
|
412
|
+
async buildDID(address) {
|
|
413
|
+
(0, validation_1.validateAddress)(address, 'address');
|
|
414
|
+
const chainId = await this.getChainId();
|
|
415
|
+
return `did:ethr:${chainId}:${address.toLowerCase()}`;
|
|
416
|
+
}
|
|
417
|
+
// ========== PRIVATE HELPERS ==========
|
|
418
|
+
/**
|
|
419
|
+
* Safely convert bigint to number, throwing if precision would be lost
|
|
420
|
+
*/
|
|
421
|
+
safeToNumber(value, fieldName) {
|
|
422
|
+
const bigIntValue = typeof value === 'bigint' ? value : BigInt(value);
|
|
423
|
+
if (bigIntValue > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
424
|
+
throw new Error(`${fieldName} exceeds JavaScript MAX_SAFE_INTEGER`);
|
|
425
|
+
}
|
|
426
|
+
if (bigIntValue < BigInt(Number.MIN_SAFE_INTEGER)) {
|
|
427
|
+
throw new Error(`${fieldName} below JavaScript MIN_SAFE_INTEGER`);
|
|
428
|
+
}
|
|
429
|
+
return Number(bigIntValue);
|
|
430
|
+
}
|
|
431
|
+
_mapProfile(profile) {
|
|
432
|
+
return {
|
|
433
|
+
agentAddress: profile.agentAddress,
|
|
434
|
+
did: profile.did,
|
|
435
|
+
endpoint: profile.endpoint,
|
|
436
|
+
serviceTypes: [...profile.serviceTypes], // H-4: Clone array
|
|
437
|
+
stakedAmount: profile.stakedAmount,
|
|
438
|
+
reputationScore: this.safeToNumber(profile.reputationScore, 'reputationScore'),
|
|
439
|
+
totalTransactions: this.safeToNumber(profile.totalTransactions, 'totalTransactions'),
|
|
440
|
+
disputedTransactions: this.safeToNumber(profile.disputedTransactions, 'disputedTransactions'),
|
|
441
|
+
totalVolumeUSDC: profile.totalVolumeUSDC,
|
|
442
|
+
registeredAt: this.safeToNumber(profile.registeredAt, 'registeredAt'),
|
|
443
|
+
updatedAt: this.safeToNumber(profile.updatedAt, 'updatedAt'),
|
|
444
|
+
isActive: Boolean(profile.isActive)
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
exports.AgentRegistry = AgentRegistry;
|
|
449
|
+
//# sourceMappingURL=AgentRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentRegistry.js","sourceRoot":"","sources":["../../src/protocol/AgentRegistry.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAkE;AAClE,mFAAyD;AAOzD,sCAA6F;AAC7F,oDAA2E;AAU3E;;;;;;;;;;GAUG;AACH,MAAa,aAAa;IAIxB,YACmB,OAAe,EAChC,MAAc,EACd,WAAwB;QAFP,YAAO,GAAP,OAAO,CAAQ;QAIhC,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAQ,CAAC,OAAO,EAAE,4BAAgB,EAAE,MAAM,CAAC,CAAC;QAChE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,SAAiB;QAC9C,MAAM,OAAO,GAA2B;YACtC,eAAe,EAAE,IAAI,EAAK,+BAA+B;YACzD,gBAAgB,EAAE,IAAI,EAAI,uBAAuB;YACjD,mBAAmB,EAAE,IAAI;YACzB,gBAAgB,EAAE,IAAI,EAAI,8BAA8B;YACxD,iBAAiB,EAAE,IAAI,CAAG,uBAAuB;SAClD,CAAC;QAEF,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED;;OAEG;IACK,cAAc,CAAC,YAAoB,EAAE,YAAoB,SAAS;QACxE,MAAM,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,QAAQ,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAElF,iCAAiC;QACjC,MAAM,aAAa,GAAG,SAAW,CAAC;QAClC,IAAI,QAAQ,GAAG,aAAa,EAAE,CAAC;YAC7B,MAAM,IAAI,wBAAe,CAAC,UAAU,EAAE,6C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