@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
|
@@ -2,18 +2,62 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EASHelper = void 0;
|
|
4
4
|
const ethers_1 = require("ethers");
|
|
5
|
+
const eas_sdk_1 = require("@ethereum-attestation-service/eas-sdk");
|
|
5
6
|
const eip712_1 = require("../types/eip712");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
'function getAttestation(bytes32 uid) external view returns (tuple(bytes32 uid, bytes32 schema, address recipient, address attester, uint64 time, uint64 expirationTime, bool revocable, bytes32 refUID, bytes data, uint32 bump))'
|
|
11
|
-
];
|
|
7
|
+
const UsedAttestationTracker_1 = require("../utils/UsedAttestationTracker");
|
|
8
|
+
/**
|
|
9
|
+
* EASHelper - utility wrapper for Ethereum Attestation Service interactions
|
|
10
|
+
*/
|
|
12
11
|
class EASHelper {
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Create EASHelper instance
|
|
14
|
+
*
|
|
15
|
+
* @param signer - Ethers signer for signing attestations
|
|
16
|
+
* @param config - EAS configuration
|
|
17
|
+
* @param attestationTracker - Optional tracker for replay attack prevention (C-1 fix)
|
|
18
|
+
*
|
|
19
|
+
* SECURITY FIX (NEW-M-2): Validates schema UID format in constructor
|
|
20
|
+
*/
|
|
21
|
+
constructor(signer, config, attestationTracker) {
|
|
14
22
|
this.config = config;
|
|
15
|
-
|
|
23
|
+
// SECURITY FIX (NEW-M-2): Validate schema UID format
|
|
24
|
+
if (!config.deliveryProofSchemaId || !/^0x[a-fA-F0-9]{64}$/.test(config.deliveryProofSchemaId)) {
|
|
25
|
+
throw new Error(`Invalid deliveryProofSchemaId: must be bytes32 hex string (0x...). ` +
|
|
26
|
+
`Got: ${config.deliveryProofSchemaId}`);
|
|
27
|
+
}
|
|
28
|
+
if (config.deliveryProofSchemaId === '0x0000000000000000000000000000000000000000000000000000000000000000') {
|
|
29
|
+
throw new Error('deliveryProofSchemaId cannot be zero bytes32');
|
|
30
|
+
}
|
|
31
|
+
// Use official EAS SDK wrapper to ensure ABI correctness across deployments
|
|
32
|
+
// (includes fields like revocationTime that are required for security checks).
|
|
33
|
+
this.eas = new eas_sdk_1.EAS(config.contractAddress);
|
|
34
|
+
this.eas.connect(signer);
|
|
35
|
+
// SECURITY FIX (C-1): Use provided tracker or create new in-memory one
|
|
36
|
+
if (!attestationTracker) {
|
|
37
|
+
// SECURITY WARNING (HIGH-5): In-memory tracker does not persist across restarts!
|
|
38
|
+
// For production use, provide a FileBasedUsedAttestationTracker with a stateDirectory:
|
|
39
|
+
//
|
|
40
|
+
// import { FileBasedUsedAttestationTracker } from '../utils/UsedAttestationTracker';
|
|
41
|
+
// const tracker = new FileBasedUsedAttestationTracker('/path/to/state');
|
|
42
|
+
// const easHelper = new EASHelper(signer, config, tracker);
|
|
43
|
+
//
|
|
44
|
+
// Without persistence, attestation replay protection is lost on process restart,
|
|
45
|
+
// allowing potential double-spend attacks.
|
|
46
|
+
console.warn('[SECURITY WARNING] EASHelper: Using in-memory attestation tracker. ' +
|
|
47
|
+
'Replay protection will be lost on process restart. ' +
|
|
48
|
+
'For production, provide FileBasedUsedAttestationTracker for persistence.');
|
|
49
|
+
}
|
|
50
|
+
this.attestationTracker = attestationTracker || new UsedAttestationTracker_1.InMemoryUsedAttestationTracker();
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Get the attestation tracker for external use
|
|
54
|
+
*/
|
|
55
|
+
getAttestationTracker() {
|
|
56
|
+
return this.attestationTracker;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create an attestation for a delivery proof. Returns the attestation UID and transaction hash.
|
|
60
|
+
*/
|
|
17
61
|
async attestDeliveryProof(proof, recipient, options) {
|
|
18
62
|
const { expirationTime = 0, revocable = true } = options || {};
|
|
19
63
|
const proofData = (0, eip712_1.deliveryProofDataFromProof)(proof);
|
|
@@ -30,77 +74,226 @@ class EASHelper {
|
|
|
30
74
|
schema: this.config.deliveryProofSchemaId,
|
|
31
75
|
data: {
|
|
32
76
|
recipient,
|
|
33
|
-
expirationTime,
|
|
77
|
+
expirationTime: BigInt(expirationTime),
|
|
34
78
|
revocable,
|
|
35
79
|
refUID: proof.txId,
|
|
36
|
-
data: encodedData
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const receipt = await tx.wait();
|
|
40
|
-
const attestedLog = receipt?.logs?.find((log) => {
|
|
41
|
-
try {
|
|
42
|
-
const parsed = this.eas.interface.parseLog(log);
|
|
43
|
-
return parsed?.name === 'Attested';
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return false;
|
|
80
|
+
data: encodedData,
|
|
81
|
+
// For Base EAS, value is typically 0. Keep explicit to avoid ambiguity.
|
|
82
|
+
value: 0n
|
|
47
83
|
}
|
|
48
84
|
});
|
|
49
|
-
const uid =
|
|
50
|
-
|
|
51
|
-
|
|
85
|
+
const uid = await tx.wait();
|
|
86
|
+
if (!uid || !/^0x[a-fA-F0-9]{64}$/.test(uid)) {
|
|
87
|
+
throw new Error(`Failed to obtain attestation UID from EAS transaction. Got: ${String(uid)}`);
|
|
88
|
+
}
|
|
89
|
+
if (uid === '0x0000000000000000000000000000000000000000000000000000000000000000') {
|
|
90
|
+
throw new Error('EAS returned zero UID for attestation (unexpected).');
|
|
91
|
+
}
|
|
52
92
|
return {
|
|
53
93
|
uid,
|
|
54
|
-
transactionHash:
|
|
94
|
+
transactionHash: tx.tx.hash
|
|
55
95
|
};
|
|
56
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Revoke a previously issued attestation by UID.
|
|
99
|
+
*/
|
|
57
100
|
async revokeAttestation(uid) {
|
|
101
|
+
if (!uid || !/^0x[a-fA-F0-9]{64}$/.test(uid)) {
|
|
102
|
+
throw new Error(`Invalid attestation UID format: ${uid}`);
|
|
103
|
+
}
|
|
58
104
|
const tx = await this.eas.revoke({
|
|
59
105
|
schema: this.config.deliveryProofSchemaId,
|
|
60
|
-
uid
|
|
106
|
+
data: { uid }
|
|
61
107
|
});
|
|
62
|
-
|
|
63
|
-
return
|
|
108
|
+
await tx.wait();
|
|
109
|
+
return tx.tx.hash;
|
|
64
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Fetch attestation data from the EAS contract.
|
|
113
|
+
*/
|
|
65
114
|
async getAttestation(uid) {
|
|
115
|
+
if (!uid || !/^0x[a-fA-F0-9]{64}$/.test(uid)) {
|
|
116
|
+
throw new Error(`Invalid attestation UID format: ${uid}`);
|
|
117
|
+
}
|
|
66
118
|
return await this.eas.getAttestation(uid);
|
|
67
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Verify that a delivery attestation belongs to the specified transaction.
|
|
122
|
+
*
|
|
123
|
+
* SECURITY: ACTPKernel V1 accepts any bytes32 as attestationUID without validation.
|
|
124
|
+
* This means a malicious provider could submit attestation from Transaction A
|
|
125
|
+
* for Transaction B. This method provides SDK-side protection by verifying:
|
|
126
|
+
*
|
|
127
|
+
* 1. Attestation exists and is not revoked
|
|
128
|
+
* 2. Attestation uses the canonical delivery schema UID
|
|
129
|
+
* 3. Attestation's txId matches the expected transaction ID
|
|
130
|
+
* 4. Attestation has not expired
|
|
131
|
+
*
|
|
132
|
+
* @param txId - Expected transaction ID (bytes32)
|
|
133
|
+
* @param attestationUID - Attestation UID to verify (bytes32)
|
|
134
|
+
* @returns true if attestation is valid for this transaction, false otherwise
|
|
135
|
+
* @throws Error if attestation is revoked, expired, schema mismatch, or txId mismatch
|
|
136
|
+
*/
|
|
68
137
|
async verifyDeliveryAttestation(txId, attestationUID) {
|
|
138
|
+
if (!txId || !/^0x[a-fA-F0-9]{64}$/.test(txId)) {
|
|
139
|
+
throw new Error(`Invalid txId format (expected bytes32): ${txId}`);
|
|
140
|
+
}
|
|
141
|
+
if (!attestationUID || !/^0x[a-fA-F0-9]{64}$/.test(attestationUID)) {
|
|
142
|
+
throw new Error(`Invalid attestationUID format (expected bytes32): ${attestationUID}`);
|
|
143
|
+
}
|
|
144
|
+
// 1. Fetch attestation from EAS contract
|
|
69
145
|
const attestation = await this.eas.getAttestation(attestationUID);
|
|
146
|
+
// 2. Check if attestation exists (uid should match)
|
|
70
147
|
if (attestation.uid !== attestationUID) {
|
|
71
148
|
throw new Error(`Attestation not found: ${attestationUID}`);
|
|
72
149
|
}
|
|
150
|
+
// 3. Check schema UID matches canonical delivery schema (B2 blocker fix)
|
|
151
|
+
// This prevents accepting attestations from unrelated EAS schemas
|
|
73
152
|
if (attestation.schema !== this.config.deliveryProofSchemaId) {
|
|
74
153
|
throw new Error(`Schema UID mismatch: expected canonical delivery schema ${this.config.deliveryProofSchemaId}, ` +
|
|
75
154
|
`got ${attestation.schema}. Attestation may be from a different schema!`);
|
|
76
155
|
}
|
|
77
|
-
|
|
156
|
+
// 4. Check revocation - EAS uses revocationTime field (not revoked boolean)
|
|
157
|
+
// revocationTime = 0 means not revoked
|
|
158
|
+
// revocationTime > 0 means revoked at that timestamp
|
|
159
|
+
const revocationTime = BigInt(attestation.revocationTime ?? 0);
|
|
160
|
+
const isRevoked = revocationTime > 0n;
|
|
78
161
|
if (isRevoked) {
|
|
79
|
-
throw new Error(`Attestation has been revoked: ${attestationUID} (revoked at timestamp ${
|
|
162
|
+
throw new Error(`Attestation has been revoked: ${attestationUID} (revoked at timestamp ${revocationTime})`);
|
|
80
163
|
}
|
|
81
|
-
|
|
164
|
+
// 5. Check expiration
|
|
165
|
+
// expirationTime = 0 means no expiration
|
|
166
|
+
// expirationTime > 0 means expires at that timestamp
|
|
167
|
+
const expirationTime = BigInt(attestation.expirationTime ?? 0);
|
|
168
|
+
if (expirationTime > 0n) {
|
|
82
169
|
const now = Math.floor(Date.now() / 1000);
|
|
83
|
-
if (Number(
|
|
84
|
-
throw new Error(`Attestation has expired: ${attestationUID} (expired at ${
|
|
170
|
+
if (Number(expirationTime) < now) {
|
|
171
|
+
throw new Error(`Attestation has expired: ${attestationUID} (expired at ${expirationTime})`);
|
|
85
172
|
}
|
|
86
173
|
}
|
|
87
|
-
|
|
174
|
+
// 6. Decode attestation data to extract txId
|
|
175
|
+
let attestedTxId = '';
|
|
88
176
|
try {
|
|
89
177
|
const abiCoder = ethers_1.AbiCoder.defaultAbiCoder();
|
|
90
|
-
const
|
|
91
|
-
|
|
178
|
+
const rawData = attestation.data;
|
|
179
|
+
// Prefer AIP-6 decoding (current DX Playground schema)
|
|
180
|
+
// - Official AIP-6: bytes32 txId,string resultCID,bytes32 resultHash,uint256 deliveredAt
|
|
181
|
+
// - Test schema: + uint256 testTimestamp
|
|
182
|
+
try {
|
|
183
|
+
const decoded = abiCoder.decode(['bytes32', 'string', 'bytes32', 'uint256', 'uint256'], rawData);
|
|
184
|
+
attestedTxId = decoded[0];
|
|
185
|
+
const resultCID = decoded[1];
|
|
186
|
+
const resultHash = decoded[2];
|
|
187
|
+
const deliveredAt = decoded[3];
|
|
188
|
+
if (!attestedTxId || !/^0x[a-fA-F0-9]{64}$/.test(attestedTxId)) {
|
|
189
|
+
throw new Error(`Decoded txId is not valid bytes32: ${attestedTxId}`);
|
|
190
|
+
}
|
|
191
|
+
if (typeof resultCID !== 'string' || resultCID.length === 0 || resultCID.length > 2048) {
|
|
192
|
+
throw new Error(`Decoded resultCID invalid length: ${resultCID?.length}`);
|
|
193
|
+
}
|
|
194
|
+
if (!resultHash || !/^0x[a-fA-F0-9]{64}$/.test(resultHash)) {
|
|
195
|
+
throw new Error(`Decoded resultHash is not valid bytes32: ${resultHash}`);
|
|
196
|
+
}
|
|
197
|
+
const now = BigInt(Math.floor(Date.now() / 1000));
|
|
198
|
+
if (deliveredAt > now + 86400n) {
|
|
199
|
+
throw new Error(`Decoded deliveredAt is in far future: ${deliveredAt.toString()}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch (_e) {
|
|
203
|
+
// Fallback: official AIP-6 schema without testTimestamp
|
|
204
|
+
try {
|
|
205
|
+
const decoded = abiCoder.decode(['bytes32', 'string', 'bytes32', 'uint256'], rawData);
|
|
206
|
+
attestedTxId = decoded[0];
|
|
207
|
+
const resultCID = decoded[1];
|
|
208
|
+
const resultHash = decoded[2];
|
|
209
|
+
const deliveredAt = decoded[3];
|
|
210
|
+
if (!attestedTxId || !/^0x[a-fA-F0-9]{64}$/.test(attestedTxId)) {
|
|
211
|
+
throw new Error(`Decoded txId is not valid bytes32: ${attestedTxId}`);
|
|
212
|
+
}
|
|
213
|
+
if (typeof resultCID !== 'string' || resultCID.length === 0 || resultCID.length > 2048) {
|
|
214
|
+
throw new Error(`Decoded resultCID invalid length: ${resultCID?.length}`);
|
|
215
|
+
}
|
|
216
|
+
if (!resultHash || !/^0x[a-fA-F0-9]{64}$/.test(resultHash)) {
|
|
217
|
+
throw new Error(`Decoded resultHash is not valid bytes32: ${resultHash}`);
|
|
218
|
+
}
|
|
219
|
+
const now = BigInt(Math.floor(Date.now() / 1000));
|
|
220
|
+
if (deliveredAt > now + 86400n) {
|
|
221
|
+
throw new Error(`Decoded deliveredAt is in far future: ${deliveredAt.toString()}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (__e) {
|
|
225
|
+
// Final fallback: legacy AIP-4 schema
|
|
226
|
+
// Schema: bytes32 txId, bytes32 contentHash, uint256 timestamp, string deliveryUrl, uint256 size, string mimeType
|
|
227
|
+
const decoded = abiCoder.decode(['bytes32', 'bytes32', 'uint256', 'string', 'uint256', 'string'], rawData);
|
|
228
|
+
attestedTxId = decoded[0];
|
|
229
|
+
const contentHash = decoded[1];
|
|
230
|
+
const timestamp = decoded[2];
|
|
231
|
+
const deliveryUrl = decoded[3];
|
|
232
|
+
const size = decoded[4];
|
|
233
|
+
const mimeType = decoded[5];
|
|
234
|
+
if (!attestedTxId || !/^0x[a-fA-F0-9]{64}$/.test(attestedTxId)) {
|
|
235
|
+
throw new Error(`Decoded txId is not valid bytes32: ${attestedTxId}`);
|
|
236
|
+
}
|
|
237
|
+
if (!contentHash || !/^0x[a-fA-F0-9]{64}$/.test(contentHash)) {
|
|
238
|
+
throw new Error(`Decoded contentHash is not valid bytes32: ${contentHash}`);
|
|
239
|
+
}
|
|
240
|
+
const now = BigInt(Math.floor(Date.now() / 1000));
|
|
241
|
+
if (timestamp > now + 86400n) {
|
|
242
|
+
throw new Error(`Decoded timestamp is in far future: ${timestamp.toString()}`);
|
|
243
|
+
}
|
|
244
|
+
if (typeof deliveryUrl !== 'string' || deliveryUrl.length > 2048) {
|
|
245
|
+
throw new Error('Decoded deliveryUrl too long');
|
|
246
|
+
}
|
|
247
|
+
if (size < 0n) {
|
|
248
|
+
throw new Error(`Decoded size is negative: ${size}`);
|
|
249
|
+
}
|
|
250
|
+
if (typeof mimeType !== 'string' || mimeType.length > 256) {
|
|
251
|
+
throw new Error('Decoded mimeType too long');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
92
255
|
}
|
|
93
256
|
catch (error) {
|
|
94
257
|
throw new Error(`Attestation data format mismatch: cannot decode attestation ${attestationUID}. ` +
|
|
95
|
-
`Expected AIP-4 delivery proof schema format. ` +
|
|
258
|
+
`Expected AIP-6 (preferred) or AIP-4 (legacy) delivery proof schema format. ` +
|
|
96
259
|
`Original error: ${error.message}`);
|
|
97
260
|
}
|
|
98
|
-
|
|
261
|
+
// 7. Verify attestation txId matches expected transaction ID
|
|
262
|
+
if (attestedTxId.toLowerCase() !== txId.toLowerCase()) {
|
|
99
263
|
throw new Error(`Attestation txId mismatch: expected ${txId}, got ${attestedTxId}. ` +
|
|
100
264
|
`Provider may be attempting to use attestation from different transaction!`);
|
|
101
265
|
}
|
|
266
|
+
// SECURITY FIX (C-1): Check if attestation has been used for a different transaction
|
|
267
|
+
if (!this.attestationTracker.isValidForTransaction(attestationUID, txId)) {
|
|
268
|
+
const usedFor = this.attestationTracker.getUsageForAttestation(attestationUID);
|
|
269
|
+
throw new Error(`Attestation replay attack detected: attestation ${attestationUID} ` +
|
|
270
|
+
`was already used for transaction ${usedFor}. ` +
|
|
271
|
+
`Cannot reuse for transaction ${txId}.`);
|
|
272
|
+
}
|
|
273
|
+
// Record this attestation as used for this transaction
|
|
274
|
+
const recorded = await this.attestationTracker.recordUsage(attestationUID, txId);
|
|
275
|
+
if (!recorded) {
|
|
276
|
+
const usedFor = this.attestationTracker.getUsageForAttestation(attestationUID);
|
|
277
|
+
throw new Error(`Attestation replay attack detected: attestation ${attestationUID} ` +
|
|
278
|
+
`was already used for transaction ${usedFor}. Cannot reuse for ${txId}.`);
|
|
279
|
+
}
|
|
280
|
+
// All checks passed
|
|
102
281
|
return true;
|
|
103
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Verify attestation for escrow release with mandatory replay protection
|
|
285
|
+
*
|
|
286
|
+
* SECURITY FIX (C-4): This method MUST be called before releaseEscrow()
|
|
287
|
+
* to prevent attestation replay attacks.
|
|
288
|
+
*
|
|
289
|
+
* @param txId - Expected transaction ID (bytes32)
|
|
290
|
+
* @param attestationUID - Attestation UID to verify (bytes32)
|
|
291
|
+
* @throws Error if verification fails or replay attack detected
|
|
292
|
+
*/
|
|
293
|
+
async verifyAndRecordForRelease(txId, attestationUID) {
|
|
294
|
+
// Verify the attestation
|
|
295
|
+
await this.verifyDeliveryAttestation(txId, attestationUID);
|
|
296
|
+
}
|
|
104
297
|
}
|
|
105
298
|
exports.EASHelper = EASHelper;
|
|
106
299
|
//# sourceMappingURL=EASHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EASHelper.js","sourceRoot":"","sources":["../../src/protocol/EASHelper.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"EASHelper.js","sourceRoot":"","sources":["../../src/protocol/EASHelper.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAC1C,mEAA4D;AAE5D,4CAA6D;AAC7D,4EAGyC;AAYzC;;GAEG;AACH,MAAa,SAAS;IAIpB;;;;;;;;OAQG;IACH,YACE,MAAc,EACG,MAAiB,EAClC,kBAA4C;QAD3B,WAAM,GAAN,MAAM,CAAW;QAGlC,qDAAqD;QACrD,IAAI,CAAC,MAAM,CAAC,qBAAqB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;YAC/F,MAAM,IAAI,KAAK,CACb,qEAAqE;gBACrE,QAAQ,MAAM,CAAC,qBAAqB,EAAE,CACvC,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,CAAC,qBAAqB,KAAK,oEAAoE,EAAE,CAAC;YAC1G,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAClE,CAAC;QAED,4EAA4E;QAC5E,+EAA+E;QAC/E,IAAI,CAAC,GAAG,GAAG,IAAI,aAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAC3C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 'ethers';
|
|
2
2
|
import { Escrow } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Gas options for transactions
|
|
5
|
+
*/
|
|
3
6
|
interface GasOptions {
|
|
4
7
|
maxFeePerGas?: bigint;
|
|
5
8
|
maxPriorityFeePerGas?: bigint;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* EscrowVault - Escrow contract wrapper
|
|
12
|
+
*
|
|
13
|
+
* IMPORTANT:
|
|
14
|
+
* - Escrow creation happens atomically inside `ACTPKernel.linkEscrow()`.
|
|
15
|
+
* - Payout/refund functions are `onlyKernel` on-chain and MUST NOT be called by users.
|
|
16
|
+
*
|
|
17
|
+
* This module provides:
|
|
18
|
+
* - Helper methods for USDC approvals (requester → EscrowVault allowance)
|
|
19
|
+
* - Read-only access to escrow state (`escrows()` / `remaining()`)
|
|
20
|
+
*
|
|
21
|
+
* Workflow (per AIP-3):
|
|
22
|
+
* 1. Consumer approves USDC to EscrowVault address (use approveToken)
|
|
23
|
+
* 2. Consumer calls ACTPKernel.linkEscrow(txId, escrowVault, escrowId)
|
|
24
|
+
* 3. Kernel internally calls IEscrowValidator.createEscrow(escrowId, requester, provider, amount)
|
|
25
|
+
* 4. Escrow pulls USDC from requester
|
|
26
|
+
*
|
|
27
|
+
* Reference: AIP-3 §3.2 (Escrow Linking Workflow), lines 258-336
|
|
28
|
+
*/
|
|
7
29
|
export declare class EscrowVault {
|
|
8
30
|
private readonly address;
|
|
9
31
|
private readonly signer;
|
|
10
32
|
private contract;
|
|
11
33
|
private readonly gasSettings?;
|
|
12
34
|
constructor(address: string, signer: Signer, gasSettings?: GasOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Get gas buffer multiplier based on operation complexity
|
|
37
|
+
* V6 Security Enhancement: Operation-specific gas buffers
|
|
38
|
+
* Reference: SDK_SECURITY_ANALYSIS-Ultra-Think.md Lines 326-337
|
|
39
|
+
*/
|
|
13
40
|
private getGasBufferMultiplier;
|
|
41
|
+
/**
|
|
42
|
+
* Build transaction options with gas settings and estimated gas
|
|
43
|
+
* V6 Enhancement: Dynamic buffer based on operation type
|
|
44
|
+
*
|
|
45
|
+
* SECURITY FIX (NEW-C-1): Gas estimation manipulation attack protection
|
|
46
|
+
* - Enforces minimum gas floor regardless of estimate
|
|
47
|
+
* - Uses safe BigInt arithmetic with overflow detection
|
|
48
|
+
*/
|
|
14
49
|
private buildTxOptions;
|
|
50
|
+
/**
|
|
51
|
+
* Get escrow vault address
|
|
52
|
+
*/
|
|
15
53
|
getAddress(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get the underlying ethers Contract instance.
|
|
56
|
+
*
|
|
57
|
+
* SECURITY FIX (C-3): Provides public access to contract for EventMonitor
|
|
58
|
+
* instead of accessing private field via bracket notation.
|
|
59
|
+
*
|
|
60
|
+
* @returns ethers Contract instance
|
|
61
|
+
*/
|
|
62
|
+
getContract(): Contract;
|
|
63
|
+
/**
|
|
64
|
+
* Approve USDC token for escrow creation
|
|
65
|
+
*
|
|
66
|
+
* IMPORTANT: Call this BEFORE ACTPKernel.linkEscrow()
|
|
67
|
+
* The consumer must approve EscrowVault to pull USDC when linkEscrow() is called
|
|
68
|
+
*
|
|
69
|
+
* @param tokenAddress - USDC contract address
|
|
70
|
+
* @param amount - Amount to approve (in USDC wei, 6 decimals)
|
|
71
|
+
* @throws {ValidationError} If inputs are invalid
|
|
72
|
+
* @throws {TransactionRevertedError} If approval fails
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // Approve 100 USDC for escrow
|
|
77
|
+
* const amount = ethers.parseUnits('100', 6);
|
|
78
|
+
* await client.escrow.approveToken(BASE_SEPOLIA.contracts.usdc, amount);
|
|
79
|
+
*
|
|
80
|
+
* // Now call linkEscrow via Kernel
|
|
81
|
+
* const escrowId = ethers.id(`escrow-${Date.now()}`);
|
|
82
|
+
* await client.kernel.linkEscrow(txId, escrowVault, escrowId);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
16
85
|
approveToken(tokenAddress: string, amount: bigint): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Get escrow details
|
|
88
|
+
*/
|
|
17
89
|
getEscrow(escrowId: string): Promise<Escrow>;
|
|
90
|
+
/**
|
|
91
|
+
* Get escrow remaining balance (amount - releasedAmount)
|
|
92
|
+
*/
|
|
18
93
|
getEscrowBalance(escrowId: string): Promise<bigint>;
|
|
19
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated
|
|
96
|
+
*
|
|
97
|
+
* Payouts/refunds are executed by ACTPKernel (on-chain) as part of state transitions.
|
|
98
|
+
* EscrowVault disbursement methods are `onlyKernel` and cannot be called by EOAs.
|
|
99
|
+
*
|
|
100
|
+
* Use:
|
|
101
|
+
* - `BlockchainRuntime.releaseEscrow(txId, attestationUID?)` (recommended)
|
|
102
|
+
* - or `ACTPKernel.transitionState(txId, State.SETTLED, proof)` (advanced)
|
|
103
|
+
*/
|
|
104
|
+
releaseEscrow(escrowId: string, _recipients: string[], _amounts: bigint[]): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Check token balance
|
|
107
|
+
*/
|
|
20
108
|
getTokenBalance(tokenAddress: string, account: string): Promise<bigint>;
|
|
109
|
+
/**
|
|
110
|
+
* Check token allowance
|
|
111
|
+
*/
|
|
21
112
|
getTokenAllowance(tokenAddress: string, owner: string, spender: string): Promise<bigint>;
|
|
22
113
|
}
|
|
23
114
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EscrowVault.d.ts","sourceRoot":"","sources":["../../src/protocol/EscrowVault.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EscrowVault.d.ts","sourceRoot":"","sources":["../../src/protocol/EscrowVault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAQlC;;GA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