envoy-pay 0.1.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/CHANGELOG.md +99 -0
- package/LICENSE +200 -0
- package/README.md +529 -0
- package/dist/cjs/adapters/base.js +174 -0
- package/dist/cjs/adapters/base.js.map +1 -0
- package/dist/cjs/adapters/evm.js +339 -0
- package/dist/cjs/adapters/evm.js.map +1 -0
- package/dist/cjs/adapters/index.js +15 -0
- package/dist/cjs/adapters/index.js.map +1 -0
- package/dist/cjs/adapters/ows.js +204 -0
- package/dist/cjs/adapters/ows.js.map +1 -0
- package/dist/cjs/adapters/solana.js +210 -0
- package/dist/cjs/adapters/solana.js.map +1 -0
- package/dist/cjs/adapters/stellar.js +173 -0
- package/dist/cjs/adapters/stellar.js.map +1 -0
- package/dist/cjs/adapters/stripe.js +338 -0
- package/dist/cjs/adapters/stripe.js.map +1 -0
- package/dist/cjs/adapters/types.js +3 -0
- package/dist/cjs/adapters/types.js.map +1 -0
- package/dist/cjs/client.js +309 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/contracts/abis/EnvoyFacilitator.js +197 -0
- package/dist/cjs/contracts/abis/EnvoyFacilitator.js.map +1 -0
- package/dist/cjs/contracts/addresses.js +42 -0
- package/dist/cjs/contracts/addresses.js.map +1 -0
- package/dist/cjs/contracts/facilitator.js +225 -0
- package/dist/cjs/contracts/facilitator.js.map +1 -0
- package/dist/cjs/contracts/index.js +21 -0
- package/dist/cjs/contracts/index.js.map +1 -0
- package/dist/cjs/facilitator/facilitator-service.js +305 -0
- package/dist/cjs/facilitator/facilitator-service.js.map +1 -0
- package/dist/cjs/facilitator/fee-calculator.js +134 -0
- package/dist/cjs/facilitator/fee-calculator.js.map +1 -0
- package/dist/cjs/facilitator/index.js +12 -0
- package/dist/cjs/facilitator/index.js.map +1 -0
- package/dist/cjs/facilitator/types.js +99 -0
- package/dist/cjs/facilitator/types.js.map +1 -0
- package/dist/cjs/identity/agent-card.js +143 -0
- package/dist/cjs/identity/agent-card.js.map +1 -0
- package/dist/cjs/identity/agent-identity.js +166 -0
- package/dist/cjs/identity/agent-identity.js.map +1 -0
- package/dist/cjs/identity/did-resolver.js +149 -0
- package/dist/cjs/identity/did-resolver.js.map +1 -0
- package/dist/cjs/identity/erc8004/abis.js +218 -0
- package/dist/cjs/identity/erc8004/abis.js.map +1 -0
- package/dist/cjs/identity/erc8004/identity.js +268 -0
- package/dist/cjs/identity/erc8004/identity.js.map +1 -0
- package/dist/cjs/identity/erc8004/index.js +36 -0
- package/dist/cjs/identity/erc8004/index.js.map +1 -0
- package/dist/cjs/identity/erc8004/reputation.js +110 -0
- package/dist/cjs/identity/erc8004/reputation.js.map +1 -0
- package/dist/cjs/identity/erc8004/types.js +3 -0
- package/dist/cjs/identity/erc8004/types.js.map +1 -0
- package/dist/cjs/identity/index.js +61 -0
- package/dist/cjs/identity/index.js.map +1 -0
- package/dist/cjs/identity/owner-registry.js +140 -0
- package/dist/cjs/identity/owner-registry.js.map +1 -0
- package/dist/cjs/identity/reputation.js +193 -0
- package/dist/cjs/identity/reputation.js.map +1 -0
- package/dist/cjs/identity/types.js +16 -0
- package/dist/cjs/identity/types.js.map +1 -0
- package/dist/cjs/index.js +72 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/logger.js +7 -0
- package/dist/cjs/logger.js.map +1 -0
- package/dist/cjs/monitor/evm-watcher.js +165 -0
- package/dist/cjs/monitor/evm-watcher.js.map +1 -0
- package/dist/cjs/monitor/index.js +32 -0
- package/dist/cjs/monitor/index.js.map +1 -0
- package/dist/cjs/monitor/multi-watcher.js +94 -0
- package/dist/cjs/monitor/multi-watcher.js.map +1 -0
- package/dist/cjs/monitor/solana-watcher.js +172 -0
- package/dist/cjs/monitor/solana-watcher.js.map +1 -0
- package/dist/cjs/monitor/stellar-watcher.js +125 -0
- package/dist/cjs/monitor/stellar-watcher.js.map +1 -0
- package/dist/cjs/mpp.js +187 -0
- package/dist/cjs/mpp.js.map +1 -0
- package/dist/cjs/policy.js +71 -0
- package/dist/cjs/policy.js.map +1 -0
- package/dist/cjs/providers/bridge.js +323 -0
- package/dist/cjs/providers/bridge.js.map +1 -0
- package/dist/cjs/providers/onchainos.js +210 -0
- package/dist/cjs/providers/onchainos.js.map +1 -0
- package/dist/cjs/requests/eip681.js +77 -0
- package/dist/cjs/requests/eip681.js.map +1 -0
- package/dist/cjs/requests/index.js +18 -0
- package/dist/cjs/requests/index.js.map +1 -0
- package/dist/cjs/requests/sep7.js +61 -0
- package/dist/cjs/requests/sep7.js.map +1 -0
- package/dist/cjs/requests/solana-pay.js +51 -0
- package/dist/cjs/requests/solana-pay.js.map +1 -0
- package/dist/cjs/requests/universal.js +40 -0
- package/dist/cjs/requests/universal.js.map +1 -0
- package/dist/cjs/server/index.js +35 -0
- package/dist/cjs/server/index.js.map +1 -0
- package/dist/cjs/server/mpp-gate.js +118 -0
- package/dist/cjs/server/mpp-gate.js.map +1 -0
- package/dist/cjs/server/payment-gate.js +92 -0
- package/dist/cjs/server/payment-gate.js.map +1 -0
- package/dist/cjs/server/receipt.js +52 -0
- package/dist/cjs/server/receipt.js.map +1 -0
- package/dist/cjs/server/webhook.js +122 -0
- package/dist/cjs/server/webhook.js.map +1 -0
- package/dist/cjs/server/x402-gate.js +103 -0
- package/dist/cjs/server/x402-gate.js.map +1 -0
- package/dist/cjs/solana.js +14 -0
- package/dist/cjs/solana.js.map +1 -0
- package/dist/cjs/stellar.js +14 -0
- package/dist/cjs/stellar.js.map +1 -0
- package/dist/cjs/wallet/balance-aggregator.js +149 -0
- package/dist/cjs/wallet/balance-aggregator.js.map +1 -0
- package/dist/cjs/wallet/chain-router.js +254 -0
- package/dist/cjs/wallet/chain-router.js.map +1 -0
- package/dist/cjs/wallet/index.js +15 -0
- package/dist/cjs/wallet/index.js.map +1 -0
- package/dist/cjs/wallet/intent-resolver.js +145 -0
- package/dist/cjs/wallet/intent-resolver.js.map +1 -0
- package/dist/cjs/wallet/session-manager.js +170 -0
- package/dist/cjs/wallet/session-manager.js.map +1 -0
- package/dist/cjs/wallet/types.js +14 -0
- package/dist/cjs/wallet/types.js.map +1 -0
- package/dist/cjs/wallet/unified-wallet.js +253 -0
- package/dist/cjs/wallet/unified-wallet.js.map +1 -0
- package/dist/esm/adapters/base.js +170 -0
- package/dist/esm/adapters/base.js.map +1 -0
- package/dist/esm/adapters/evm.js +334 -0
- package/dist/esm/adapters/evm.js.map +1 -0
- package/dist/esm/adapters/index.js +6 -0
- package/dist/esm/adapters/index.js.map +1 -0
- package/dist/esm/adapters/ows.js +194 -0
- package/dist/esm/adapters/ows.js.map +1 -0
- package/dist/esm/adapters/solana.js +206 -0
- package/dist/esm/adapters/solana.js.map +1 -0
- package/dist/esm/adapters/stellar.js +136 -0
- package/dist/esm/adapters/stellar.js.map +1 -0
- package/dist/esm/adapters/stripe.js +334 -0
- package/dist/esm/adapters/stripe.js.map +1 -0
- package/dist/esm/adapters/types.js +2 -0
- package/dist/esm/adapters/types.js.map +1 -0
- package/dist/esm/client.js +302 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/contracts/abis/EnvoyFacilitator.js +194 -0
- package/dist/esm/contracts/abis/EnvoyFacilitator.js.map +1 -0
- package/dist/esm/contracts/addresses.js +38 -0
- package/dist/esm/contracts/addresses.js.map +1 -0
- package/dist/esm/contracts/facilitator.js +218 -0
- package/dist/esm/contracts/facilitator.js.map +1 -0
- package/dist/esm/contracts/index.js +8 -0
- package/dist/esm/contracts/index.js.map +1 -0
- package/dist/esm/facilitator/facilitator-service.js +301 -0
- package/dist/esm/facilitator/facilitator-service.js.map +1 -0
- package/dist/esm/facilitator/fee-calculator.js +130 -0
- package/dist/esm/facilitator/fee-calculator.js.map +1 -0
- package/dist/esm/facilitator/index.js +5 -0
- package/dist/esm/facilitator/index.js.map +1 -0
- package/dist/esm/facilitator/types.js +96 -0
- package/dist/esm/facilitator/types.js.map +1 -0
- package/dist/esm/identity/agent-card.js +139 -0
- package/dist/esm/identity/agent-card.js.map +1 -0
- package/dist/esm/identity/agent-identity.js +162 -0
- package/dist/esm/identity/agent-identity.js.map +1 -0
- package/dist/esm/identity/did-resolver.js +145 -0
- package/dist/esm/identity/did-resolver.js.map +1 -0
- package/dist/esm/identity/erc8004/abis.js +215 -0
- package/dist/esm/identity/erc8004/abis.js.map +1 -0
- package/dist/esm/identity/erc8004/identity.js +250 -0
- package/dist/esm/identity/erc8004/identity.js.map +1 -0
- package/dist/esm/identity/erc8004/index.js +13 -0
- package/dist/esm/identity/erc8004/index.js.map +1 -0
- package/dist/esm/identity/erc8004/reputation.js +105 -0
- package/dist/esm/identity/erc8004/reputation.js.map +1 -0
- package/dist/esm/identity/erc8004/types.js +2 -0
- package/dist/esm/identity/erc8004/types.js.map +1 -0
- package/dist/esm/identity/index.js +19 -0
- package/dist/esm/identity/index.js.map +1 -0
- package/dist/esm/identity/owner-registry.js +136 -0
- package/dist/esm/identity/owner-registry.js.map +1 -0
- package/dist/esm/identity/reputation.js +189 -0
- package/dist/esm/identity/reputation.js.map +1 -0
- package/dist/esm/identity/types.js +15 -0
- package/dist/esm/identity/types.js.map +1 -0
- package/dist/esm/index.js +37 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.js +3 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/monitor/evm-watcher.js +162 -0
- package/dist/esm/monitor/evm-watcher.js.map +1 -0
- package/dist/esm/monitor/index.js +25 -0
- package/dist/esm/monitor/index.js.map +1 -0
- package/dist/esm/monitor/multi-watcher.js +91 -0
- package/dist/esm/monitor/multi-watcher.js.map +1 -0
- package/dist/esm/monitor/solana-watcher.js +169 -0
- package/dist/esm/monitor/solana-watcher.js.map +1 -0
- package/dist/esm/monitor/stellar-watcher.js +122 -0
- package/dist/esm/monitor/stellar-watcher.js.map +1 -0
- package/dist/esm/mpp.js +175 -0
- package/dist/esm/mpp.js.map +1 -0
- package/dist/esm/policy.js +67 -0
- package/dist/esm/policy.js.map +1 -0
- package/dist/esm/providers/bridge.js +319 -0
- package/dist/esm/providers/bridge.js.map +1 -0
- package/dist/esm/providers/onchainos.js +172 -0
- package/dist/esm/providers/onchainos.js.map +1 -0
- package/dist/esm/requests/eip681.js +74 -0
- package/dist/esm/requests/eip681.js.map +1 -0
- package/dist/esm/requests/index.js +11 -0
- package/dist/esm/requests/index.js.map +1 -0
- package/dist/esm/requests/sep7.js +58 -0
- package/dist/esm/requests/sep7.js.map +1 -0
- package/dist/esm/requests/solana-pay.js +48 -0
- package/dist/esm/requests/solana-pay.js.map +1 -0
- package/dist/esm/requests/universal.js +37 -0
- package/dist/esm/requests/universal.js.map +1 -0
- package/dist/esm/server/index.js +27 -0
- package/dist/esm/server/index.js.map +1 -0
- package/dist/esm/server/mpp-gate.js +115 -0
- package/dist/esm/server/mpp-gate.js.map +1 -0
- package/dist/esm/server/payment-gate.js +89 -0
- package/dist/esm/server/payment-gate.js.map +1 -0
- package/dist/esm/server/receipt.js +48 -0
- package/dist/esm/server/receipt.js.map +1 -0
- package/dist/esm/server/webhook.js +119 -0
- package/dist/esm/server/webhook.js.map +1 -0
- package/dist/esm/server/x402-gate.js +100 -0
- package/dist/esm/server/x402-gate.js.map +1 -0
- package/dist/esm/solana.js +8 -0
- package/dist/esm/solana.js.map +1 -0
- package/dist/esm/stellar.js +8 -0
- package/dist/esm/stellar.js.map +1 -0
- package/dist/esm/wallet/balance-aggregator.js +145 -0
- package/dist/esm/wallet/balance-aggregator.js.map +1 -0
- package/dist/esm/wallet/chain-router.js +250 -0
- package/dist/esm/wallet/chain-router.js.map +1 -0
- package/dist/esm/wallet/index.js +7 -0
- package/dist/esm/wallet/index.js.map +1 -0
- package/dist/esm/wallet/intent-resolver.js +141 -0
- package/dist/esm/wallet/intent-resolver.js.map +1 -0
- package/dist/esm/wallet/session-manager.js +166 -0
- package/dist/esm/wallet/session-manager.js.map +1 -0
- package/dist/esm/wallet/types.js +13 -0
- package/dist/esm/wallet/types.js.map +1 -0
- package/dist/esm/wallet/unified-wallet.js +249 -0
- package/dist/esm/wallet/unified-wallet.js.map +1 -0
- package/dist/types/adapters/base.d.ts +53 -0
- package/dist/types/adapters/base.d.ts.map +1 -0
- package/dist/types/adapters/evm.d.ts +93 -0
- package/dist/types/adapters/evm.d.ts.map +1 -0
- package/dist/types/adapters/index.d.ts +7 -0
- package/dist/types/adapters/index.d.ts.map +1 -0
- package/dist/types/adapters/ows.d.ts +123 -0
- package/dist/types/adapters/ows.d.ts.map +1 -0
- package/dist/types/adapters/solana.d.ts +77 -0
- package/dist/types/adapters/solana.d.ts.map +1 -0
- package/dist/types/adapters/stellar.d.ts +67 -0
- package/dist/types/adapters/stellar.d.ts.map +1 -0
- package/dist/types/adapters/stripe.d.ts +206 -0
- package/dist/types/adapters/stripe.d.ts.map +1 -0
- package/dist/types/adapters/types.d.ts +110 -0
- package/dist/types/adapters/types.d.ts.map +1 -0
- package/dist/types/client.d.ts +89 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/contracts/abis/EnvoyFacilitator.d.ts +296 -0
- package/dist/types/contracts/abis/EnvoyFacilitator.d.ts.map +1 -0
- package/dist/types/contracts/addresses.d.ts +24 -0
- package/dist/types/contracts/addresses.d.ts.map +1 -0
- package/dist/types/contracts/facilitator.d.ts +172 -0
- package/dist/types/contracts/facilitator.d.ts.map +1 -0
- package/dist/types/contracts/index.d.ts +6 -0
- package/dist/types/contracts/index.d.ts.map +1 -0
- package/dist/types/facilitator/facilitator-service.d.ts +69 -0
- package/dist/types/facilitator/facilitator-service.d.ts.map +1 -0
- package/dist/types/facilitator/fee-calculator.d.ts +48 -0
- package/dist/types/facilitator/fee-calculator.d.ts.map +1 -0
- package/dist/types/facilitator/index.d.ts +5 -0
- package/dist/types/facilitator/index.d.ts.map +1 -0
- package/dist/types/facilitator/types.d.ts +221 -0
- package/dist/types/facilitator/types.d.ts.map +1 -0
- package/dist/types/identity/agent-card.d.ts +83 -0
- package/dist/types/identity/agent-card.d.ts.map +1 -0
- package/dist/types/identity/agent-identity.d.ts +102 -0
- package/dist/types/identity/agent-identity.d.ts.map +1 -0
- package/dist/types/identity/did-resolver.d.ts +70 -0
- package/dist/types/identity/did-resolver.d.ts.map +1 -0
- package/dist/types/identity/erc8004/abis.d.ts +336 -0
- package/dist/types/identity/erc8004/abis.d.ts.map +1 -0
- package/dist/types/identity/erc8004/identity.d.ts +109 -0
- package/dist/types/identity/erc8004/identity.d.ts.map +1 -0
- package/dist/types/identity/erc8004/index.d.ts +15 -0
- package/dist/types/identity/erc8004/index.d.ts.map +1 -0
- package/dist/types/identity/erc8004/reputation.d.ts +52 -0
- package/dist/types/identity/erc8004/reputation.d.ts.map +1 -0
- package/dist/types/identity/erc8004/types.d.ts +31 -0
- package/dist/types/identity/erc8004/types.d.ts.map +1 -0
- package/dist/types/identity/index.d.ts +10 -0
- package/dist/types/identity/index.d.ts.map +1 -0
- package/dist/types/identity/owner-registry.d.ts +68 -0
- package/dist/types/identity/owner-registry.d.ts.map +1 -0
- package/dist/types/identity/reputation.d.ts +66 -0
- package/dist/types/identity/reputation.d.ts.map +1 -0
- package/dist/types/identity/types.d.ts +182 -0
- package/dist/types/identity/types.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/logger.d.ts +10 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/monitor/evm-watcher.d.ts +40 -0
- package/dist/types/monitor/evm-watcher.d.ts.map +1 -0
- package/dist/types/monitor/index.d.ts +25 -0
- package/dist/types/monitor/index.d.ts.map +1 -0
- package/dist/types/monitor/multi-watcher.d.ts +48 -0
- package/dist/types/monitor/multi-watcher.d.ts.map +1 -0
- package/dist/types/monitor/solana-watcher.d.ts +36 -0
- package/dist/types/monitor/solana-watcher.d.ts.map +1 -0
- package/dist/types/monitor/stellar-watcher.d.ts +34 -0
- package/dist/types/monitor/stellar-watcher.d.ts.map +1 -0
- package/dist/types/mpp.d.ts +153 -0
- package/dist/types/mpp.d.ts.map +1 -0
- package/dist/types/policy.d.ts +40 -0
- package/dist/types/policy.d.ts.map +1 -0
- package/dist/types/providers/bridge.d.ts +162 -0
- package/dist/types/providers/bridge.d.ts.map +1 -0
- package/dist/types/providers/onchainos.d.ts +128 -0
- package/dist/types/providers/onchainos.d.ts.map +1 -0
- package/dist/types/requests/eip681.d.ts +51 -0
- package/dist/types/requests/eip681.d.ts.map +1 -0
- package/dist/types/requests/index.d.ts +11 -0
- package/dist/types/requests/index.d.ts.map +1 -0
- package/dist/types/requests/sep7.d.ts +56 -0
- package/dist/types/requests/sep7.d.ts.map +1 -0
- package/dist/types/requests/solana-pay.d.ts +50 -0
- package/dist/types/requests/solana-pay.d.ts.map +1 -0
- package/dist/types/requests/universal.d.ts +28 -0
- package/dist/types/requests/universal.d.ts.map +1 -0
- package/dist/types/server/index.d.ts +27 -0
- package/dist/types/server/index.d.ts.map +1 -0
- package/dist/types/server/mpp-gate.d.ts +66 -0
- package/dist/types/server/mpp-gate.d.ts.map +1 -0
- package/dist/types/server/payment-gate.d.ts +33 -0
- package/dist/types/server/payment-gate.d.ts.map +1 -0
- package/dist/types/server/receipt.d.ts +52 -0
- package/dist/types/server/receipt.d.ts.map +1 -0
- package/dist/types/server/webhook.d.ts +46 -0
- package/dist/types/server/webhook.d.ts.map +1 -0
- package/dist/types/server/x402-gate.d.ts +70 -0
- package/dist/types/server/x402-gate.d.ts.map +1 -0
- package/dist/types/solana.d.ts +7 -0
- package/dist/types/solana.d.ts.map +1 -0
- package/dist/types/stellar.d.ts +7 -0
- package/dist/types/stellar.d.ts.map +1 -0
- package/dist/types/wallet/balance-aggregator.d.ts +51 -0
- package/dist/types/wallet/balance-aggregator.d.ts.map +1 -0
- package/dist/types/wallet/chain-router.d.ts +44 -0
- package/dist/types/wallet/chain-router.d.ts.map +1 -0
- package/dist/types/wallet/index.d.ts +7 -0
- package/dist/types/wallet/index.d.ts.map +1 -0
- package/dist/types/wallet/intent-resolver.d.ts +39 -0
- package/dist/types/wallet/intent-resolver.d.ts.map +1 -0
- package/dist/types/wallet/session-manager.d.ts +57 -0
- package/dist/types/wallet/session-manager.d.ts.map +1 -0
- package/dist/types/wallet/types.d.ts +161 -0
- package/dist/types/wallet/types.d.ts.map +1 -0
- package/dist/types/wallet/unified-wallet.d.ts +122 -0
- package/dist/types/wallet/unified-wallet.d.ts.map +1 -0
- package/package.json +194 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
For the dated decision journal behind these changes, see [`docs/BUILD_LOG.md`](docs/BUILD_LOG.md).
|
|
6
|
+
|
|
7
|
+
## [0.3.0-envoy] — Unreleased
|
|
8
|
+
|
|
9
|
+
This release is the Celo-first re-imagining of the SDK with a real on-chain layer added. Targets Celo Sepolia (testnet) and Celo mainnet.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Scaffold forked from `ASGCompute-ows-agent-pay`, restructured around Celo as the first-class chain
|
|
13
|
+
- **`EnvoyFacilitator.sol`** — single on-chain payment contract that consumes an EIP-712 `PaymentAuth` from the agent's wallet, validates the signer against canonical ERC-8004 `getAgentWallet(agentId)`, enforces per-(agent, token) rolling-window spending limits atomically, splits the amount into net (→ merchant) and fee (→ treasury), and emits a `Settled(challengeId, agentId, merchant, …)` event. Strict CEI, custom errors, `ReentrancyGuardTransient`, ERC-1271 fallback for smart-wallet agents, zero internal balance (contract never holds funds).
|
|
14
|
+
- `MockIdentityRegistry.sol` + `MockSmartWallet.sol` test fixtures
|
|
15
|
+
- 23-test suite for `EnvoyFacilitator` covering: constructor invariants, `setLimit` authorization via ERC-8004 `isAuthorizedOrOwner`, atomic split + event emission, ERC-1271 contract-wallet flow, expired auths, wrong-signer rejection, NFT-transfer-revokes-wallet behavior, nonce reuse, per-tx and per-period exceed, lazy window rollover, treasury rotation, and on-chain ↔ off-chain typed-data hash parity
|
|
16
|
+
- **`src/identity/erc8004/`** — viem-based helpers for the canonical Celo ERC-8004 Identity and Reputation registries. Functional, pure, no global state. Exported under `import { erc8004 } from 'envoy-pay'` and individual function exports. Covers: `registerAgent` (all three overloads), `setAgentWallet`, `unsetAgentWallet`, `setAgentURI`, `setMetadata`, `getAgent`/`getAgentWallet`/`getAgentOwner`/`getAgentURI`/`getMetadata`, `isAuthorizedOrOwner`, EIP-712 `agentWalletRotationTypedData` builder, `giveFeedback`, `revokeFeedback`, and a `makeScoreFeedback` convenience helper.
|
|
17
|
+
- **`src/contracts/facilitator.ts`** — typed viem client for `EnvoyFacilitator`. Exposes pure helpers (`paymentAuthDomain`, `paymentAuthTypedData`, `signPaymentAuth`) and a `createEnvoyFacilitator(...)` factory that bundles reads (`getFeeBps`, `getLimit`, `isNonceUsed`, `paymentAuthHash`, ...), writes (`setLimit`, `disableLimit`, `setTreasury`, `pay`), and EIP-712 signing in one object. `pay()` waits for the receipt and returns a decoded `Settled` event including `txHash` + `blockNumber`.
|
|
18
|
+
- **`src/contracts/abis/EnvoyFacilitator.ts`** — minimal hand-curated ABI, `as const` for viem type inference. Carries only the function/event signatures the SDK touches.
|
|
19
|
+
- `src/__tests__/facilitator.test.ts` — 6 vitest cases verifying EIP-712 signing: signature → recovered address parity, sensitivity to every PaymentAuth field, chainId-dependent domains, hashTypedData stability, and the exported PAYMENT_AUTH_TYPES shape.
|
|
20
|
+
- `vitest.config.mts` updated to exclude `**/_legacy/**` directories so archived tests don't run.
|
|
21
|
+
- New top-level README narrative oriented around "payment layer for autonomous AI agents on Celo"
|
|
22
|
+
- `docs/BUILD_LOG.md` capturing the dated decision trail (architecture, demo, ERC-8004 interface notes, Facilitator design rationale, SDK design rationale)
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- **Testnet target switched from Celo Alfajores → Celo Sepolia** (chainId `11142220`). The canonical Celo ERC-8004 contracts are deployed on Sepolia; Alfajores is no longer a build target. `hardhat.config.ts` updated accordingly.
|
|
26
|
+
- Top-level + `contracts/` READMEs updated to reflect the lean architecture (one on-chain payment layer + canonical ERC-8004 delegation)
|
|
27
|
+
- **`src/contracts/addresses.ts`** rewritten: `EnvoyContractAddresses` shape is now `{ facilitator, identityRegistry, reputationRegistry }` (was four snowflake fields). Canonical 8004 addresses are baked in for both Celo mainnet (42220) and Celo Sepolia (11142220). New `CELO_MAINNET` / `CELO_SEPOLIA` chain-id constants exported.
|
|
28
|
+
|
|
29
|
+
### Removed
|
|
30
|
+
- **`EnvoyAgentRegistry.sol`** — superseded by the canonical ERC-8004 Identity Registry on Celo (`0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` mainnet, `0x8004A818BFB912233c491871b3d84c89A494BD9e` Sepolia). Source preserved under [`contracts/future/`](contracts/future/).
|
|
31
|
+
- **`EnvoyReputation.sol`** — superseded by the canonical ERC-8004 Reputation Registry (`0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` mainnet, `0x8004B663056A597Dffe9eCcC1965A193B7388713` Sepolia). Source preserved under [`contracts/future/`](contracts/future/).
|
|
32
|
+
- **`EnvoyEscrow.sol`** and **`EnvoyPolicyGuard.sol`** — merged into the new `EnvoyFacilitator.sol`. Source preserved under [`contracts/future/`](contracts/future/). The atomic check + settle model in the new contract removes the two-call race window the old escrow / policy split had.
|
|
33
|
+
- SDK exports `AgentRegistryClient`, `createAgentRegistry`, `ReputationClient`, `createReputation`, `EscrowClient`, `createEscrow`, `PolicyGuardClient`, `createPolicyGuard`, the four `ENVOY_*_ABI` exports, and their types — viem wrappers moved to `src/contracts/_legacy/` pending replacement with a single `EnvoyFacilitator` client + canonical ERC-8004 helpers.
|
|
34
|
+
- `examples/celo-agent-identity.ts` and `examples/celo-escrow.ts` archived to `examples/_legacy/` (both referenced removed contracts).
|
|
35
|
+
|
|
36
|
+
### Pending (locked, not yet code)
|
|
37
|
+
- **Deploy** `EnvoyFacilitator` to Celo Sepolia, verify on Celoscan, paste the address into `src/contracts/addresses.ts`.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## [0.2.0] — 2026-04-04
|
|
42
|
+
|
|
43
|
+
### 🚀 Pay In Infrastructure (NEW)
|
|
44
|
+
|
|
45
|
+
This release transforms envoy from a spending-only SDK into a **bi-directional A2A payment powerhouse**.
|
|
46
|
+
|
|
47
|
+
#### Server-Side 402 Gating (`src/server/`)
|
|
48
|
+
- **x402Gate** — x402 JSON challenge middleware with `X-PAYMENT` proof validation
|
|
49
|
+
- **MppGate** — MPP `WWW-Authenticate` middleware with credential validation
|
|
50
|
+
- **PaymentGate** — Dual-protocol unified gate (auto-detects x402 vs MPP)
|
|
51
|
+
- **WebhookHandler** — Stripe HMAC-SHA256 verification with idempotency guard
|
|
52
|
+
- **ReceiptBuilder** — Payment-Receipt header builder/parser
|
|
53
|
+
|
|
54
|
+
#### Real-Time Payment Monitoring (`src/monitor/`)
|
|
55
|
+
- **EvmWatcher** — JSON-RPC polling for ERC-20 Transfer events + native ETH
|
|
56
|
+
- **StellarWatcher** — Horizon SSE streaming for incoming payments
|
|
57
|
+
- **SolanaWatcher** — `getSignaturesForAddress` polling with tx parsing
|
|
58
|
+
- **MultiChainWatcher** — Unified cross-chain aggregator
|
|
59
|
+
|
|
60
|
+
#### Payment Request URIs (`src/requests/`)
|
|
61
|
+
- **EIP-681** — Ethereum payment URI generator
|
|
62
|
+
- **SEP-7** — Stellar payment URI generator
|
|
63
|
+
- **Solana Pay** — Solana payment URI generator
|
|
64
|
+
- **Universal** — Chain-agnostic router
|
|
65
|
+
|
|
66
|
+
### 📈 Quality
|
|
67
|
+
- Tests: **175 → 269** (+94 new tests)
|
|
68
|
+
- Coverage: **~76% → 84.38%** (80% enforced in CI)
|
|
69
|
+
- 19 new production files
|
|
70
|
+
- Zero new dependencies
|
|
71
|
+
|
|
72
|
+
### 🔧 Breaking Changes
|
|
73
|
+
- None — all new `PaymentAdapter` methods are optional for backward compatibility
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## [0.1.2] — 2026-04-03
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
- World-class README redesign with hero banner, architecture diagram, ecosystem showcase
|
|
81
|
+
- Added CI pipeline with Node 18/20/22 matrix
|
|
82
|
+
- Added CONTRIBUTING.md, SECURITY.md, issue templates
|
|
83
|
+
|
|
84
|
+
## [0.1.1] — 2026-03-28
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
- Full Stellar payment adapter (XLM + USDC, auto trustline)
|
|
88
|
+
- MPP protocol support (client-side challenge handling)
|
|
89
|
+
- Solana payment adapter (SOL + USDC SPL, auto ATA)
|
|
90
|
+
- Policy engine with 4 fail-closed gates
|
|
91
|
+
|
|
92
|
+
## [0.1.0] — 2026-03-20
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
- Initial release
|
|
96
|
+
- EVM payment adapter (10 chains, native + USDC)
|
|
97
|
+
- x402 protocol support
|
|
98
|
+
- Stripe MPP adapter
|
|
99
|
+
- EnvoyClient with dual-protocol 402 handling
|
package/LICENSE
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. Please also get an
|
|
186
|
+
"appropriate copyright line" below to show in generated output.
|
|
187
|
+
|
|
188
|
+
Copyright 2024-2026 ASG Compute Ltd.
|
|
189
|
+
|
|
190
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
191
|
+
you may not use this file except in compliance with the License.
|
|
192
|
+
You may obtain a copy of the License at
|
|
193
|
+
|
|
194
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
195
|
+
|
|
196
|
+
Unless required by applicable law or agreed to in writing, software
|
|
197
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
198
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
199
|
+
See the License for the specific language governing permissions and
|
|
200
|
+
limitations under the License.
|