tenzro-wallet 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/LICENSE +201 -0
- package/README.md +128 -0
- package/dist/balance/aggregator.d.ts +16 -0
- package/dist/balance/aggregator.d.ts.map +1 -0
- package/dist/balance/aggregator.js +73 -0
- package/dist/balance/aggregator.js.map +1 -0
- package/dist/balance/index.d.ts +3 -0
- package/dist/balance/index.d.ts.map +1 -0
- package/dist/balance/index.js +2 -0
- package/dist/balance/index.js.map +1 -0
- package/dist/consent/index.d.ts +3 -0
- package/dist/consent/index.d.ts.map +1 -0
- package/dist/consent/index.js +2 -0
- package/dist/consent/index.js.map +1 -0
- package/dist/consent/policy.d.ts +27 -0
- package/dist/consent/policy.d.ts.map +1 -0
- package/dist/consent/policy.js +121 -0
- package/dist/consent/policy.js.map +1 -0
- package/dist/crypto/eip1559.d.ts +53 -0
- package/dist/crypto/eip1559.d.ts.map +1 -0
- package/dist/crypto/eip1559.js +79 -0
- package/dist/crypto/eip1559.js.map +1 -0
- package/dist/crypto/keccak256.d.ts +20 -0
- package/dist/crypto/keccak256.d.ts.map +1 -0
- package/dist/crypto/keccak256.js +167 -0
- package/dist/crypto/keccak256.js.map +1 -0
- package/dist/crypto/rlp.d.ts +30 -0
- package/dist/crypto/rlp.d.ts.map +1 -0
- package/dist/crypto/rlp.js +165 -0
- package/dist/crypto/rlp.js.map +1 -0
- package/dist/crypto/sha256.d.ts +14 -0
- package/dist/crypto/sha256.d.ts.map +1 -0
- package/dist/crypto/sha256.js +33 -0
- package/dist/crypto/sha256.js.map +1 -0
- package/dist/crypto/solana.d.ts +86 -0
- package/dist/crypto/solana.d.ts.map +1 -0
- package/dist/crypto/solana.js +218 -0
- package/dist/crypto/solana.js.map +1 -0
- package/dist/custody/frost/backend.d.ts +59 -0
- package/dist/custody/frost/backend.d.ts.map +1 -0
- package/dist/custody/frost/backend.js +83 -0
- package/dist/custody/frost/backend.js.map +1 -0
- package/dist/custody/frost/coordinator.d.ts +148 -0
- package/dist/custody/frost/coordinator.d.ts.map +1 -0
- package/dist/custody/frost/coordinator.js +58 -0
- package/dist/custody/frost/coordinator.js.map +1 -0
- package/dist/custody/frost/ed25519-driver.d.ts +30 -0
- package/dist/custody/frost/ed25519-driver.d.ts.map +1 -0
- package/dist/custody/frost/ed25519-driver.js +76 -0
- package/dist/custody/frost/ed25519-driver.js.map +1 -0
- package/dist/custody/frost/http-adapter.d.ts +77 -0
- package/dist/custody/frost/http-adapter.d.ts.map +1 -0
- package/dist/custody/frost/http-adapter.js +168 -0
- package/dist/custody/frost/http-adapter.js.map +1 -0
- package/dist/custody/frost/hybrid-driver.d.ts +37 -0
- package/dist/custody/frost/hybrid-driver.d.ts.map +1 -0
- package/dist/custody/frost/hybrid-driver.js +60 -0
- package/dist/custody/frost/hybrid-driver.js.map +1 -0
- package/dist/custody/frost/index.d.ts +12 -0
- package/dist/custody/frost/index.d.ts.map +1 -0
- package/dist/custody/frost/index.js +6 -0
- package/dist/custody/frost/index.js.map +1 -0
- package/dist/custody/frost/secp256k1-driver.d.ts +26 -0
- package/dist/custody/frost/secp256k1-driver.d.ts.map +1 -0
- package/dist/custody/frost/secp256k1-driver.js +78 -0
- package/dist/custody/frost/secp256k1-driver.js.map +1 -0
- package/dist/custody/index.d.ts +9 -0
- package/dist/custody/index.d.ts.map +1 -0
- package/dist/custody/index.js +11 -0
- package/dist/custody/index.js.map +1 -0
- package/dist/custody/internal-mpc.d.ts +14 -0
- package/dist/custody/internal-mpc.d.ts.map +1 -0
- package/dist/custody/internal-mpc.js +40 -0
- package/dist/custody/internal-mpc.js.map +1 -0
- package/dist/custody/mldsa/coordinator.d.ts +63 -0
- package/dist/custody/mldsa/coordinator.d.ts.map +1 -0
- package/dist/custody/mldsa/coordinator.js +44 -0
- package/dist/custody/mldsa/coordinator.js.map +1 -0
- package/dist/custody/mldsa/driver.d.ts +23 -0
- package/dist/custody/mldsa/driver.d.ts.map +1 -0
- package/dist/custody/mldsa/driver.js +43 -0
- package/dist/custody/mldsa/driver.js.map +1 -0
- package/dist/custody/mldsa/http-adapter.d.ts +59 -0
- package/dist/custody/mldsa/http-adapter.d.ts.map +1 -0
- package/dist/custody/mldsa/http-adapter.js +103 -0
- package/dist/custody/mldsa/http-adapter.js.map +1 -0
- package/dist/custody/mldsa/index.d.ts +7 -0
- package/dist/custody/mldsa/index.d.ts.map +1 -0
- package/dist/custody/mldsa/index.js +4 -0
- package/dist/custody/mldsa/index.js.map +1 -0
- package/dist/custody/pairing/http-adapter.d.ts +40 -0
- package/dist/custody/pairing/http-adapter.d.ts.map +1 -0
- package/dist/custody/pairing/http-adapter.js +113 -0
- package/dist/custody/pairing/http-adapter.js.map +1 -0
- package/dist/custody/pairing/index.d.ts +10 -0
- package/dist/custody/pairing/index.d.ts.map +1 -0
- package/dist/custody/pairing/index.js +8 -0
- package/dist/custody/pairing/index.js.map +1 -0
- package/dist/custody/pairing/port.d.ts +121 -0
- package/dist/custody/pairing/port.d.ts.map +1 -0
- package/dist/custody/pairing/port.js +40 -0
- package/dist/custody/pairing/port.js.map +1 -0
- package/dist/custody/passkey-share/http-adapter.d.ts +77 -0
- package/dist/custody/passkey-share/http-adapter.d.ts.map +1 -0
- package/dist/custody/passkey-share/http-adapter.js +125 -0
- package/dist/custody/passkey-share/http-adapter.js.map +1 -0
- package/dist/custody/passkey-share/index.d.ts +7 -0
- package/dist/custody/passkey-share/index.d.ts.map +1 -0
- package/dist/custody/passkey-share/index.js +4 -0
- package/dist/custody/passkey-share/index.js.map +1 -0
- package/dist/custody/passkey-share/unwrapper.d.ts +174 -0
- package/dist/custody/passkey-share/unwrapper.d.ts.map +1 -0
- package/dist/custody/passkey-share/unwrapper.js +132 -0
- package/dist/custody/passkey-share/unwrapper.js.map +1 -0
- package/dist/custody/passkey-share/webauthn-adapter.d.ts +112 -0
- package/dist/custody/passkey-share/webauthn-adapter.d.ts.map +1 -0
- package/dist/custody/passkey-share/webauthn-adapter.js +150 -0
- package/dist/custody/passkey-share/webauthn-adapter.js.map +1 -0
- package/dist/custody/surface-key-id.d.ts +15 -0
- package/dist/custody/surface-key-id.d.ts.map +1 -0
- package/dist/custody/surface-key-id.js +25 -0
- package/dist/custody/surface-key-id.js.map +1 -0
- package/dist/dapp/eip6963.d.ts +64 -0
- package/dist/dapp/eip6963.d.ts.map +1 -0
- package/dist/dapp/eip6963.js +55 -0
- package/dist/dapp/eip6963.js.map +1 -0
- package/dist/dapp/index.d.ts +21 -0
- package/dist/dapp/index.d.ts.map +1 -0
- package/dist/dapp/index.js +24 -0
- package/dist/dapp/index.js.map +1 -0
- package/dist/identity/delegate-set.d.ts +57 -0
- package/dist/identity/delegate-set.d.ts.map +1 -0
- package/dist/identity/delegate-set.js +85 -0
- package/dist/identity/delegate-set.js.map +1 -0
- package/dist/identity/did.d.ts +17 -0
- package/dist/identity/did.d.ts.map +1 -0
- package/dist/identity/did.js +60 -0
- package/dist/identity/did.js.map +1 -0
- package/dist/identity/index.d.ts +14 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +8 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/identity/provision.d.ts +13 -0
- package/dist/identity/provision.d.ts.map +1 -0
- package/dist/identity/provision.js +151 -0
- package/dist/identity/provision.js.map +1 -0
- package/dist/identity/provisioning-http-adapter.d.ts +81 -0
- package/dist/identity/provisioning-http-adapter.d.ts.map +1 -0
- package/dist/identity/provisioning-http-adapter.js +114 -0
- package/dist/identity/provisioning-http-adapter.js.map +1 -0
- package/dist/identity/recovery-http-adapter.d.ts +83 -0
- package/dist/identity/recovery-http-adapter.d.ts.map +1 -0
- package/dist/identity/recovery-http-adapter.js +139 -0
- package/dist/identity/recovery-http-adapter.js.map +1 -0
- package/dist/identity/wallet-new.d.ts +132 -0
- package/dist/identity/wallet-new.d.ts.map +1 -0
- package/dist/identity/wallet-new.js +94 -0
- package/dist/identity/wallet-new.js.map +1 -0
- package/dist/identity/wallet-recover.d.ts +116 -0
- package/dist/identity/wallet-recover.d.ts.map +1 -0
- package/dist/identity/wallet-recover.js +95 -0
- package/dist/identity/wallet-recover.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel.d.ts +119 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +144 -0
- package/dist/kernel.js.map +1 -0
- package/dist/ports/adapters/tenzro-identity-adapter.d.ts +44 -0
- package/dist/ports/adapters/tenzro-identity-adapter.d.ts.map +1 -0
- package/dist/ports/adapters/tenzro-identity-adapter.js +60 -0
- package/dist/ports/adapters/tenzro-identity-adapter.js.map +1 -0
- package/dist/ports/adapters/tenzro-sdk-adapter.d.ts +86 -0
- package/dist/ports/adapters/tenzro-sdk-adapter.d.ts.map +1 -0
- package/dist/ports/adapters/tenzro-sdk-adapter.js +100 -0
- package/dist/ports/adapters/tenzro-sdk-adapter.js.map +1 -0
- package/dist/ports/agent/acp.d.ts +66 -0
- package/dist/ports/agent/acp.d.ts.map +1 -0
- package/dist/ports/agent/acp.js +27 -0
- package/dist/ports/agent/acp.js.map +1 -0
- package/dist/ports/agent/adapters/acp-adapter.d.ts +67 -0
- package/dist/ports/agent/adapters/acp-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/acp-adapter.js +70 -0
- package/dist/ports/agent/adapters/acp-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/agent-bond-adapter.d.ts +31 -0
- package/dist/ports/agent/adapters/agent-bond-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/agent-bond-adapter.js +82 -0
- package/dist/ports/agent/adapters/agent-bond-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/agent-payment-adapter.d.ts +66 -0
- package/dist/ports/agent/adapters/agent-payment-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/agent-payment-adapter.js +75 -0
- package/dist/ports/agent/adapters/agent-payment-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/ap2-adapter.d.ts +28 -0
- package/dist/ports/agent/adapters/ap2-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/ap2-adapter.js +97 -0
- package/dist/ports/agent/adapters/ap2-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/auth-approval-adapter.d.ts +26 -0
- package/dist/ports/agent/adapters/auth-approval-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/auth-approval-adapter.js +37 -0
- package/dist/ports/agent/adapters/auth-approval-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/erc7802-adapter.d.ts +30 -0
- package/dist/ports/agent/adapters/erc7802-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/erc7802-adapter.js +60 -0
- package/dist/ports/agent/adapters/erc7802-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/erc8004-adapter.d.ts +54 -0
- package/dist/ports/agent/adapters/erc8004-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/erc8004-adapter.js +53 -0
- package/dist/ports/agent/adapters/erc8004-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/escrow-adapter.d.ts +33 -0
- package/dist/ports/agent/adapters/escrow-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/escrow-adapter.js +109 -0
- package/dist/ports/agent/adapters/escrow-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/fee-estimator-adapter.d.ts +31 -0
- package/dist/ports/agent/adapters/fee-estimator-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/fee-estimator-adapter.js +103 -0
- package/dist/ports/agent/adapters/fee-estimator-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/htlc-escrow-adapter.d.ts +68 -0
- package/dist/ports/agent/adapters/htlc-escrow-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/htlc-escrow-adapter.js +131 -0
- package/dist/ports/agent/adapters/htlc-escrow-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/insurance-adapter.d.ts +32 -0
- package/dist/ports/agent/adapters/insurance-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/insurance-adapter.js +103 -0
- package/dist/ports/agent/adapters/insurance-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/lifecycle-adapter.d.ts +26 -0
- package/dist/ports/agent/adapters/lifecycle-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/lifecycle-adapter.js +136 -0
- package/dist/ports/agent/adapters/lifecycle-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/nanopayment-adapter.d.ts +62 -0
- package/dist/ports/agent/adapters/nanopayment-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/nanopayment-adapter.js +76 -0
- package/dist/ports/agent/adapters/nanopayment-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/payment-rails-adapter.d.ts +67 -0
- package/dist/ports/agent/adapters/payment-rails-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/payment-rails-adapter.js +108 -0
- package/dist/ports/agent/adapters/payment-rails-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/principal-chain-adapter.d.ts +23 -0
- package/dist/ports/agent/adapters/principal-chain-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/principal-chain-adapter.js +156 -0
- package/dist/ports/agent/adapters/principal-chain-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/session-key-adapter.d.ts +45 -0
- package/dist/ports/agent/adapters/session-key-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/session-key-adapter.js +80 -0
- package/dist/ports/agent/adapters/session-key-adapter.js.map +1 -0
- package/dist/ports/agent/adapters/tee-attestation-adapter.d.ts +32 -0
- package/dist/ports/agent/adapters/tee-attestation-adapter.d.ts.map +1 -0
- package/dist/ports/agent/adapters/tee-attestation-adapter.js +38 -0
- package/dist/ports/agent/adapters/tee-attestation-adapter.js.map +1 -0
- package/dist/ports/agent/agent-bond.d.ts +80 -0
- package/dist/ports/agent/agent-bond.d.ts.map +1 -0
- package/dist/ports/agent/agent-bond.js +23 -0
- package/dist/ports/agent/agent-bond.js.map +1 -0
- package/dist/ports/agent/agent-payment.d.ts +72 -0
- package/dist/ports/agent/agent-payment.d.ts.map +1 -0
- package/dist/ports/agent/agent-payment.js +17 -0
- package/dist/ports/agent/agent-payment.js.map +1 -0
- package/dist/ports/agent/ap2.d.ts +104 -0
- package/dist/ports/agent/ap2.d.ts.map +1 -0
- package/dist/ports/agent/ap2.js +22 -0
- package/dist/ports/agent/ap2.js.map +1 -0
- package/dist/ports/agent/auth-approval.d.ts +40 -0
- package/dist/ports/agent/auth-approval.d.ts.map +1 -0
- package/dist/ports/agent/auth-approval.js +23 -0
- package/dist/ports/agent/auth-approval.js.map +1 -0
- package/dist/ports/agent/erc7802.d.ts +94 -0
- package/dist/ports/agent/erc7802.d.ts.map +1 -0
- package/dist/ports/agent/erc7802.js +30 -0
- package/dist/ports/agent/erc7802.js.map +1 -0
- package/dist/ports/agent/erc8004.d.ts +57 -0
- package/dist/ports/agent/erc8004.d.ts.map +1 -0
- package/dist/ports/agent/erc8004.js +20 -0
- package/dist/ports/agent/erc8004.js.map +1 -0
- package/dist/ports/agent/escrow.d.ts +74 -0
- package/dist/ports/agent/escrow.d.ts.map +1 -0
- package/dist/ports/agent/escrow.js +18 -0
- package/dist/ports/agent/escrow.js.map +1 -0
- package/dist/ports/agent/fee-estimator.d.ts +71 -0
- package/dist/ports/agent/fee-estimator.d.ts.map +1 -0
- package/dist/ports/agent/fee-estimator.js +21 -0
- package/dist/ports/agent/fee-estimator.js.map +1 -0
- package/dist/ports/agent/htlc-escrow.d.ts +94 -0
- package/dist/ports/agent/htlc-escrow.d.ts.map +1 -0
- package/dist/ports/agent/htlc-escrow.js +25 -0
- package/dist/ports/agent/htlc-escrow.js.map +1 -0
- package/dist/ports/agent/index.d.ts +58 -0
- package/dist/ports/agent/index.d.ts.map +1 -0
- package/dist/ports/agent/index.js +24 -0
- package/dist/ports/agent/index.js.map +1 -0
- package/dist/ports/agent/insurance.d.ts +65 -0
- package/dist/ports/agent/insurance.d.ts.map +1 -0
- package/dist/ports/agent/insurance.js +18 -0
- package/dist/ports/agent/insurance.js.map +1 -0
- package/dist/ports/agent/lifecycle.d.ts +69 -0
- package/dist/ports/agent/lifecycle.d.ts.map +1 -0
- package/dist/ports/agent/lifecycle.js +17 -0
- package/dist/ports/agent/lifecycle.js.map +1 -0
- package/dist/ports/agent/nanopayment.d.ts +72 -0
- package/dist/ports/agent/nanopayment.d.ts.map +1 -0
- package/dist/ports/agent/nanopayment.js +16 -0
- package/dist/ports/agent/nanopayment.js.map +1 -0
- package/dist/ports/agent/payment-rails.d.ts +140 -0
- package/dist/ports/agent/payment-rails.d.ts.map +1 -0
- package/dist/ports/agent/payment-rails.js +25 -0
- package/dist/ports/agent/payment-rails.js.map +1 -0
- package/dist/ports/agent/principal-chain.d.ts +95 -0
- package/dist/ports/agent/principal-chain.d.ts.map +1 -0
- package/dist/ports/agent/principal-chain.js +16 -0
- package/dist/ports/agent/principal-chain.js.map +1 -0
- package/dist/ports/agent/session-key.d.ts +94 -0
- package/dist/ports/agent/session-key.d.ts.map +1 -0
- package/dist/ports/agent/session-key.js +31 -0
- package/dist/ports/agent/session-key.js.map +1 -0
- package/dist/ports/agent/tee-attestation.d.ts +51 -0
- package/dist/ports/agent/tee-attestation.d.ts.map +1 -0
- package/dist/ports/agent/tee-attestation.js +28 -0
- package/dist/ports/agent/tee-attestation.js.map +1 -0
- package/dist/ports/bridge/adapters/bridge-adapter-base.d.ts +47 -0
- package/dist/ports/bridge/adapters/bridge-adapter-base.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/bridge-adapter-base.js +144 -0
- package/dist/ports/bridge/adapters/bridge-adapter-base.js.map +1 -0
- package/dist/ports/bridge/adapters/canton-bridge-adapter.d.ts +30 -0
- package/dist/ports/bridge/adapters/canton-bridge-adapter.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/canton-bridge-adapter.js +31 -0
- package/dist/ports/bridge/adapters/canton-bridge-adapter.js.map +1 -0
- package/dist/ports/bridge/adapters/ccip-adapter.d.ts +30 -0
- package/dist/ports/bridge/adapters/ccip-adapter.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/ccip-adapter.js +31 -0
- package/dist/ports/bridge/adapters/ccip-adapter.js.map +1 -0
- package/dist/ports/bridge/adapters/debridge-adapter.d.ts +27 -0
- package/dist/ports/bridge/adapters/debridge-adapter.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/debridge-adapter.js +28 -0
- package/dist/ports/bridge/adapters/debridge-adapter.js.map +1 -0
- package/dist/ports/bridge/adapters/layerzero-adapter.d.ts +30 -0
- package/dist/ports/bridge/adapters/layerzero-adapter.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/layerzero-adapter.js +31 -0
- package/dist/ports/bridge/adapters/layerzero-adapter.js.map +1 -0
- package/dist/ports/bridge/adapters/lifi-adapter.d.ts +48 -0
- package/dist/ports/bridge/adapters/lifi-adapter.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/lifi-adapter.js +49 -0
- package/dist/ports/bridge/adapters/lifi-adapter.js.map +1 -0
- package/dist/ports/bridge/adapters/wormhole-adapter.d.ts +26 -0
- package/dist/ports/bridge/adapters/wormhole-adapter.d.ts.map +1 -0
- package/dist/ports/bridge/adapters/wormhole-adapter.js +27 -0
- package/dist/ports/bridge/adapters/wormhole-adapter.js.map +1 -0
- package/dist/ports/bridge/bridge.d.ts +123 -0
- package/dist/ports/bridge/bridge.d.ts.map +1 -0
- package/dist/ports/bridge/bridge.js +20 -0
- package/dist/ports/bridge/bridge.js.map +1 -0
- package/dist/ports/bridge/index.d.ts +13 -0
- package/dist/ports/bridge/index.d.ts.map +1 -0
- package/dist/ports/bridge/index.js +11 -0
- package/dist/ports/bridge/index.js.map +1 -0
- package/dist/ports/canton/adapters/ledger-api-adapter.d.ts +52 -0
- package/dist/ports/canton/adapters/ledger-api-adapter.d.ts.map +1 -0
- package/dist/ports/canton/adapters/ledger-api-adapter.js +232 -0
- package/dist/ports/canton/adapters/ledger-api-adapter.js.map +1 -0
- package/dist/ports/canton/canton-identity.d.ts +60 -0
- package/dist/ports/canton/canton-identity.d.ts.map +1 -0
- package/dist/ports/canton/canton-identity.js +28 -0
- package/dist/ports/canton/canton-identity.js.map +1 -0
- package/dist/ports/canton/canton-validator.d.ts +182 -0
- package/dist/ports/canton/canton-validator.d.ts.map +1 -0
- package/dist/ports/canton/canton-validator.js +39 -0
- package/dist/ports/canton/canton-validator.js.map +1 -0
- package/dist/ports/canton/fingerprint.d.ts +24 -0
- package/dist/ports/canton/fingerprint.d.ts.map +1 -0
- package/dist/ports/canton/fingerprint.js +31 -0
- package/dist/ports/canton/fingerprint.js.map +1 -0
- package/dist/ports/canton/hash.d.ts +37 -0
- package/dist/ports/canton/hash.d.ts.map +1 -0
- package/dist/ports/canton/hash.js +68 -0
- package/dist/ports/canton/hash.js.map +1 -0
- package/dist/ports/canton/http.d.ts +64 -0
- package/dist/ports/canton/http.d.ts.map +1 -0
- package/dist/ports/canton/http.js +177 -0
- package/dist/ports/canton/http.js.map +1 -0
- package/dist/ports/cross-vm.d.ts +79 -0
- package/dist/ports/cross-vm.d.ts.map +1 -0
- package/dist/ports/cross-vm.js +81 -0
- package/dist/ports/cross-vm.js.map +1 -0
- package/dist/ports/index.d.ts +18 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +11 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/tenzro-identity.d.ts +29 -0
- package/dist/ports/tenzro-identity.d.ts.map +1 -0
- package/dist/ports/tenzro-identity.js +19 -0
- package/dist/ports/tenzro-identity.js.map +1 -0
- package/dist/ports/tenzro-rpc.d.ts +79 -0
- package/dist/ports/tenzro-rpc.d.ts.map +1 -0
- package/dist/ports/tenzro-rpc.js +21 -0
- package/dist/ports/tenzro-rpc.js.map +1 -0
- package/dist/router/index.d.ts +3 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +2 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/route.d.ts +17 -0
- package/dist/router/route.d.ts.map +1 -0
- package/dist/router/route.js +78 -0
- package/dist/router/route.js.map +1 -0
- package/dist/settlement/nanopayment-flow.d.ts +48 -0
- package/dist/settlement/nanopayment-flow.d.ts.map +1 -0
- package/dist/settlement/nanopayment-flow.js +111 -0
- package/dist/settlement/nanopayment-flow.js.map +1 -0
- package/dist/surfaces/canton-external.d.ts +43 -0
- package/dist/surfaces/canton-external.d.ts.map +1 -0
- package/dist/surfaces/canton-external.js +252 -0
- package/dist/surfaces/canton-external.js.map +1 -0
- package/dist/surfaces/canton-internal.d.ts +34 -0
- package/dist/surfaces/canton-internal.d.ts.map +1 -0
- package/dist/surfaces/canton-internal.js +163 -0
- package/dist/surfaces/canton-internal.js.map +1 -0
- package/dist/surfaces/canton-onboarding.d.ts +64 -0
- package/dist/surfaces/canton-onboarding.d.ts.map +1 -0
- package/dist/surfaces/canton-onboarding.js +113 -0
- package/dist/surfaces/canton-onboarding.js.map +1 -0
- package/dist/surfaces/evm-on-tenzro.d.ts +29 -0
- package/dist/surfaces/evm-on-tenzro.d.ts.map +1 -0
- package/dist/surfaces/evm-on-tenzro.js +226 -0
- package/dist/surfaces/evm-on-tenzro.js.map +1 -0
- package/dist/surfaces/index.d.ts +13 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +7 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/svm-on-tenzro.d.ts +24 -0
- package/dist/surfaces/svm-on-tenzro.d.ts.map +1 -0
- package/dist/surfaces/svm-on-tenzro.js +238 -0
- package/dist/surfaces/svm-on-tenzro.js.map +1 -0
- package/dist/surfaces/tenzro-native.d.ts +45 -0
- package/dist/surfaces/tenzro-native.d.ts.map +1 -0
- package/dist/surfaces/tenzro-native.js +299 -0
- package/dist/surfaces/tenzro-native.js.map +1 -0
- package/dist/surfaces/util.d.ts +18 -0
- package/dist/surfaces/util.d.ts.map +1 -0
- package/dist/surfaces/util.js +36 -0
- package/dist/surfaces/util.js.map +1 -0
- package/dist/types/asset.d.ts +43 -0
- package/dist/types/asset.d.ts.map +1 -0
- package/dist/types/asset.js +13 -0
- package/dist/types/asset.js.map +1 -0
- package/dist/types/consent.d.ts +46 -0
- package/dist/types/consent.d.ts.map +1 -0
- package/dist/types/consent.js +18 -0
- package/dist/types/consent.js.map +1 -0
- package/dist/types/identity.d.ts +115 -0
- package/dist/types/identity.d.ts.map +1 -0
- package/dist/types/identity.js +12 -0
- package/dist/types/identity.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/intent.d.ts +132 -0
- package/dist/types/intent.d.ts.map +1 -0
- package/dist/types/intent.js +8 -0
- package/dist/types/intent.js.map +1 -0
- package/dist/types/signing-driver.d.ts +48 -0
- package/dist/types/signing-driver.d.ts.map +1 -0
- package/dist/types/signing-driver.js +9 -0
- package/dist/types/signing-driver.js.map +1 -0
- package/dist/types/surface-module.d.ts +38 -0
- package/dist/types/surface-module.d.ts.map +1 -0
- package/dist/types/surface-module.js +19 -0
- package/dist/types/surface-module.js.map +1 -0
- package/dist/types/surface.d.ts +17 -0
- package/dist/types/surface.d.ts.map +1 -0
- package/dist/types/surface.js +28 -0
- package/dist/types/surface.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TenzroIdentityAdapter — wraps the SDK's `IdentityClient.resolveDidDocument`
|
|
3
|
+
* and exposes the narrow `TenzroIdentityPort` the kernel uses.
|
|
4
|
+
*
|
|
5
|
+
* Mapping `DidDocument` → tenzro-native address:
|
|
6
|
+
* - Find the verification method whose key is tagged for the tenzro-native
|
|
7
|
+
* surface. The DID Document carries a list of `verificationMethod`
|
|
8
|
+
* entries; the one we want has a controller key suitable for native
|
|
9
|
+
* signing (Ed25519, the canonical scheme for tenzro-native per
|
|
10
|
+
* `SurfaceKey`).
|
|
11
|
+
* - Decode `publicKeyMultibase` (multibase prefix `z` → base58btc) to raw
|
|
12
|
+
* public-key bytes.
|
|
13
|
+
* - Base58-encode those bytes — that *is* the Tenzro address (per the
|
|
14
|
+
* SDK's `Address = Base58-encoded` convention).
|
|
15
|
+
*
|
|
16
|
+
* What's NOT here: per-surface address resolution for EVM/SVM/Canton.
|
|
17
|
+
* The current kernel only needs tenzro-native recipient resolution because
|
|
18
|
+
* that's the only surface that accepts TDIP recipients today; EVM/SVM
|
|
19
|
+
* recipients arrive as raw addresses, Canton as raw partyId. Extending
|
|
20
|
+
* to full surface-aware resolution lands when M4 adds Canton-via-DID.
|
|
21
|
+
*/
|
|
22
|
+
import type { TdipDid } from '../../types/identity.js';
|
|
23
|
+
import type { TenzroIdentityPort } from '../tenzro-identity.js';
|
|
24
|
+
/**
|
|
25
|
+
* The slice of `IdentityClient` the adapter touches. Listed explicitly so
|
|
26
|
+
* tests can inject a hand-rolled object. Mirrors the pattern used by
|
|
27
|
+
* `TenzroSdkAdapter` / `TenzroClientLike`.
|
|
28
|
+
*/
|
|
29
|
+
export interface IdentityClientLike {
|
|
30
|
+
resolveDidDocument(did: string): Promise<{
|
|
31
|
+
verificationMethod: ReadonlyArray<{
|
|
32
|
+
id: string;
|
|
33
|
+
type: string;
|
|
34
|
+
controller: string;
|
|
35
|
+
publicKeyMultibase?: string;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export declare class TenzroIdentityAdapter implements TenzroIdentityPort {
|
|
40
|
+
private readonly client;
|
|
41
|
+
constructor(client: IdentityClientLike);
|
|
42
|
+
resolveTenzroAddress(did: TdipDid): Promise<string | undefined>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=tenzro-identity-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenzro-identity-adapter.d.ts","sourceRoot":"","sources":["../../../src/ports/adapters/tenzro-identity-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QACvC,kBAAkB,EAAE,aAAa,CAAC;YAChC,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,EAAE,MAAM,CAAC;YACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;SAC7B,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ;AAED,qBAAa,qBAAsB,YAAW,kBAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,kBAAkB;IAEjD,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAatE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TenzroIdentityAdapter — wraps the SDK's `IdentityClient.resolveDidDocument`
|
|
3
|
+
* and exposes the narrow `TenzroIdentityPort` the kernel uses.
|
|
4
|
+
*
|
|
5
|
+
* Mapping `DidDocument` → tenzro-native address:
|
|
6
|
+
* - Find the verification method whose key is tagged for the tenzro-native
|
|
7
|
+
* surface. The DID Document carries a list of `verificationMethod`
|
|
8
|
+
* entries; the one we want has a controller key suitable for native
|
|
9
|
+
* signing (Ed25519, the canonical scheme for tenzro-native per
|
|
10
|
+
* `SurfaceKey`).
|
|
11
|
+
* - Decode `publicKeyMultibase` (multibase prefix `z` → base58btc) to raw
|
|
12
|
+
* public-key bytes.
|
|
13
|
+
* - Base58-encode those bytes — that *is* the Tenzro address (per the
|
|
14
|
+
* SDK's `Address = Base58-encoded` convention).
|
|
15
|
+
*
|
|
16
|
+
* What's NOT here: per-surface address resolution for EVM/SVM/Canton.
|
|
17
|
+
* The current kernel only needs tenzro-native recipient resolution because
|
|
18
|
+
* that's the only surface that accepts TDIP recipients today; EVM/SVM
|
|
19
|
+
* recipients arrive as raw addresses, Canton as raw partyId. Extending
|
|
20
|
+
* to full surface-aware resolution lands when M4 adds Canton-via-DID.
|
|
21
|
+
*/
|
|
22
|
+
import { base58Decode, base58Encode } from "../../crypto/solana.js";
|
|
23
|
+
export class TenzroIdentityAdapter {
|
|
24
|
+
client;
|
|
25
|
+
constructor(client) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
}
|
|
28
|
+
async resolveTenzroAddress(did) {
|
|
29
|
+
const doc = await this.client.resolveDidDocument(did);
|
|
30
|
+
// Pick the first Ed25519 verification method — that's the tenzro-native
|
|
31
|
+
// signing key. The W3C type tag for Ed25519 is `Ed25519VerificationKey2020`
|
|
32
|
+
// (or the older `Ed25519VerificationKey2018`); accept both since the
|
|
33
|
+
// node-side serialization isn't pinned in the SDK.
|
|
34
|
+
const vm = doc.verificationMethod.find((m) => m.type === 'Ed25519VerificationKey2020' || m.type === 'Ed25519VerificationKey2018');
|
|
35
|
+
if (!vm || !vm.publicKeyMultibase)
|
|
36
|
+
return undefined;
|
|
37
|
+
const pubkey = decodeMultibase(vm.publicKeyMultibase);
|
|
38
|
+
return base58Encode(pubkey);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Decode a multibase string to raw bytes. Multibase prefixes the encoded
|
|
43
|
+
* string with a single character identifying the base; `z` is base58btc,
|
|
44
|
+
* which is what Tenzro / W3C DID v1 use for Ed25519 keys.
|
|
45
|
+
*
|
|
46
|
+
* Spec: https://github.com/multiformats/multibase
|
|
47
|
+
*/
|
|
48
|
+
function decodeMultibase(s) {
|
|
49
|
+
if (s.length === 0)
|
|
50
|
+
throw new Error('multibase: empty input');
|
|
51
|
+
const prefix = s[0];
|
|
52
|
+
const body = s.slice(1);
|
|
53
|
+
switch (prefix) {
|
|
54
|
+
case 'z':
|
|
55
|
+
return base58Decode(body);
|
|
56
|
+
default:
|
|
57
|
+
throw new Error(`multibase: unsupported prefix '${prefix}' (expected 'z')`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=tenzro-identity-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenzro-identity-adapter.js","sourceRoot":"","sources":["../../../src/ports/adapters/tenzro-identity-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAoBpE,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,MAA0B;QAA1B,WAAM,GAAN,MAAM,CAAoB;IAAG,CAAC;IAE3D,KAAK,CAAC,oBAAoB,CAAC,GAAY;QACrC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACtD,wEAAwE;QACxE,4EAA4E;QAC5E,qEAAqE;QACrE,mDAAmD;QACnD,MAAM,EAAE,GAAG,GAAG,CAAC,kBAAkB,CAAC,IAAI,CACpC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,4BAA4B,IAAI,CAAC,CAAC,IAAI,KAAK,4BAA4B,CAC1F,CAAC;QACF,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,kBAAkB;YAAE,OAAO,SAAS,CAAC;QACpD,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;QACtD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,CAAS;IAChC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B;YACE,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,kBAAkB,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TenzroSdkAdapter — the only kernel file that imports from `tenzro-sdk`.
|
|
3
|
+
*
|
|
4
|
+
* Wraps a `TenzroClient` (or any object with the same shape — useful when
|
|
5
|
+
* tests want to swap a partial fake) and exposes the narrow `TenzroRpcPort`
|
|
6
|
+
* surface the kernel actually uses. If the SDK's shape changes, this is the
|
|
7
|
+
* single file that breaks; the rest of the kernel stays put.
|
|
8
|
+
*
|
|
9
|
+
* Two construction paths:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Direct fetch transport** — `fromClient(new TenzroClient(config))`
|
|
12
|
+
* is the M2 path: the kernel/host owns the bearer JWT + DPoP proof and
|
|
13
|
+
* the SDK's default `RpcClient` reads them from ambient env (`rpc.ts`).
|
|
14
|
+
*
|
|
15
|
+
* 2. **Injected EIP-1193 transport** — `fromInjected({rdns, timeoutMs})`
|
|
16
|
+
* is the M6 path: a dApp page loads, discovers `window.tenzro` via
|
|
17
|
+
* EIP-6963, and routes every `client.rpc.call(...)` through
|
|
18
|
+
* `provider.request(...)` so the extension owns auth + user
|
|
19
|
+
* confirmation. The SDK's `TenzroClient.fromInjected()` does the
|
|
20
|
+
* discovery + transport wiring for us.
|
|
21
|
+
*/
|
|
22
|
+
import { type TenzroClient as SdkTenzroClient, type TenzroConfig, TenzroNotInstalledError } from 'tenzro-sdk';
|
|
23
|
+
import type { TenzroRpcPort, TenzroSendArgs, TenzroTxStatus } from '../tenzro-rpc.js';
|
|
24
|
+
/**
|
|
25
|
+
* Just the slice of `TenzroClient` the adapter touches. Listed explicitly so
|
|
26
|
+
* tests can inject a hand-rolled object instead of the full SDK class.
|
|
27
|
+
*/
|
|
28
|
+
export interface TenzroClientLike {
|
|
29
|
+
getNonce(address: string): Promise<number>;
|
|
30
|
+
getChainId(): Promise<number>;
|
|
31
|
+
getFinalizedBlock(): Promise<number>;
|
|
32
|
+
getTransaction(hash: string): Promise<{
|
|
33
|
+
hash: string;
|
|
34
|
+
blockHeight?: number;
|
|
35
|
+
} | null>;
|
|
36
|
+
sendTransaction(params: {
|
|
37
|
+
from: string;
|
|
38
|
+
to: string;
|
|
39
|
+
value: bigint;
|
|
40
|
+
gas_limit?: number;
|
|
41
|
+
gas_price?: number;
|
|
42
|
+
nonce?: number;
|
|
43
|
+
chain_id?: number;
|
|
44
|
+
}): Promise<string>;
|
|
45
|
+
}
|
|
46
|
+
export declare class TenzroSdkAdapter implements TenzroRpcPort {
|
|
47
|
+
private readonly client;
|
|
48
|
+
constructor(client: TenzroClientLike);
|
|
49
|
+
/** Construct from a real `TenzroClient`. The cast is safe because
|
|
50
|
+
* `TenzroClient` already implements `TenzroClientLike`. */
|
|
51
|
+
static fromClient(client: SdkTenzroClient): TenzroSdkAdapter;
|
|
52
|
+
/**
|
|
53
|
+
* Construct an adapter that routes RPCs through an injected EIP-1193
|
|
54
|
+
* provider (`window.tenzro`) discovered via EIP-6963.
|
|
55
|
+
*
|
|
56
|
+
* Resolves only after the extension announces a provider matching
|
|
57
|
+
* `rdns` (defaults to `TENZRO_PROVIDER_RDNS`). Rejects with the SDK's
|
|
58
|
+
* `TenzroNotInstalledError` if no announcement arrives within
|
|
59
|
+
* `timeoutMs` (default 3000) — dApps should catch that and render an
|
|
60
|
+
* "Install Tenzro" CTA.
|
|
61
|
+
*
|
|
62
|
+
* The SDK's `fromInjected` wires `Eip1193Transport` internally, so
|
|
63
|
+
* neither this adapter nor the rest of the kernel needs to know that
|
|
64
|
+
* the underlying transport is a `provider.request(...)` call rather
|
|
65
|
+
* than a `fetch` to `rpc.tenzro.network`.
|
|
66
|
+
*
|
|
67
|
+
* Re-exports `TenzroNotInstalledError` so callers don't need a second
|
|
68
|
+
* dependency on `tenzro-sdk` purely to type the catch arm.
|
|
69
|
+
*/
|
|
70
|
+
static fromInjected(options?: {
|
|
71
|
+
config?: TenzroConfig;
|
|
72
|
+
timeoutMs?: number;
|
|
73
|
+
rdns?: string;
|
|
74
|
+
}): Promise<TenzroSdkAdapter>;
|
|
75
|
+
getNonce(address: string): Promise<number>;
|
|
76
|
+
getChainId(): Promise<number>;
|
|
77
|
+
sendTransaction(args: TenzroSendArgs): Promise<string>;
|
|
78
|
+
getTransaction(hash: string): Promise<TenzroTxStatus | null>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Re-export so kernel consumers can `instanceof`-check the not-installed
|
|
82
|
+
* case without taking a direct dependency on `tenzro-sdk`. The kernel's
|
|
83
|
+
* adapter layer is the only place SDK types should leak in from.
|
|
84
|
+
*/
|
|
85
|
+
export { TenzroNotInstalledError };
|
|
86
|
+
//# sourceMappingURL=tenzro-sdk-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenzro-sdk-adapter.d.ts","sourceRoot":"","sources":["../../../src/ports/adapters/tenzro-sdk-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,KAAK,YAAY,IAAI,eAAe,EAEpC,KAAK,YAAY,EACjB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,iBA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|
|
1
|
+
/**
|
|
2
|
+
* TenzroSdkAdapter — the only kernel file that imports from `tenzro-sdk`.
|
|
3
|
+
*
|
|
4
|
+
* Wraps a `TenzroClient` (or any object with the same shape — useful when
|
|
5
|
+
* tests want to swap a partial fake) and exposes the narrow `TenzroRpcPort`
|
|
6
|
+
* surface the kernel actually uses. If the SDK's shape changes, this is the
|
|
7
|
+
* single file that breaks; the rest of the kernel stays put.
|
|
8
|
+
*
|
|
9
|
+
* Two construction paths:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Direct fetch transport** — `fromClient(new TenzroClient(config))`
|
|
12
|
+
* is the M2 path: the kernel/host owns the bearer JWT + DPoP proof and
|
|
13
|
+
* the SDK's default `RpcClient` reads them from ambient env (`rpc.ts`).
|
|
14
|
+
*
|
|
15
|
+
* 2. **Injected EIP-1193 transport** — `fromInjected({rdns, timeoutMs})`
|
|
16
|
+
* is the M6 path: a dApp page loads, discovers `window.tenzro` via
|
|
17
|
+
* EIP-6963, and routes every `client.rpc.call(...)` through
|
|
18
|
+
* `provider.request(...)` so the extension owns auth + user
|
|
19
|
+
* confirmation. The SDK's `TenzroClient.fromInjected()` does the
|
|
20
|
+
* discovery + transport wiring for us.
|
|
21
|
+
*/
|
|
22
|
+
import { TenzroClient, TenzroNotInstalledError, } from 'tenzro-sdk';
|
|
23
|
+
export class TenzroSdkAdapter {
|
|
24
|
+
client;
|
|
25
|
+
constructor(client) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
}
|
|
28
|
+
/** Construct from a real `TenzroClient`. The cast is safe because
|
|
29
|
+
* `TenzroClient` already implements `TenzroClientLike`. */
|
|
30
|
+
static fromClient(client) {
|
|
31
|
+
return new TenzroSdkAdapter(client);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Construct an adapter that routes RPCs through an injected EIP-1193
|
|
35
|
+
* provider (`window.tenzro`) discovered via EIP-6963.
|
|
36
|
+
*
|
|
37
|
+
* Resolves only after the extension announces a provider matching
|
|
38
|
+
* `rdns` (defaults to `TENZRO_PROVIDER_RDNS`). Rejects with the SDK's
|
|
39
|
+
* `TenzroNotInstalledError` if no announcement arrives within
|
|
40
|
+
* `timeoutMs` (default 3000) — dApps should catch that and render an
|
|
41
|
+
* "Install Tenzro" CTA.
|
|
42
|
+
*
|
|
43
|
+
* The SDK's `fromInjected` wires `Eip1193Transport` internally, so
|
|
44
|
+
* neither this adapter nor the rest of the kernel needs to know that
|
|
45
|
+
* the underlying transport is a `provider.request(...)` call rather
|
|
46
|
+
* than a `fetch` to `rpc.tenzro.network`.
|
|
47
|
+
*
|
|
48
|
+
* Re-exports `TenzroNotInstalledError` so callers don't need a second
|
|
49
|
+
* dependency on `tenzro-sdk` purely to type the catch arm.
|
|
50
|
+
*/
|
|
51
|
+
static async fromInjected(options) {
|
|
52
|
+
const client = await TenzroClient.fromInjected(options);
|
|
53
|
+
return TenzroSdkAdapter.fromClient(client);
|
|
54
|
+
}
|
|
55
|
+
getNonce(address) {
|
|
56
|
+
return this.client.getNonce(address);
|
|
57
|
+
}
|
|
58
|
+
getChainId() {
|
|
59
|
+
return this.client.getChainId();
|
|
60
|
+
}
|
|
61
|
+
async sendTransaction(args) {
|
|
62
|
+
// Map our camelCase port shape to the SDK's snake_case wire shape.
|
|
63
|
+
const params = {
|
|
64
|
+
from: args.from,
|
|
65
|
+
to: args.to,
|
|
66
|
+
value: args.value,
|
|
67
|
+
};
|
|
68
|
+
if (args.gasLimit !== undefined)
|
|
69
|
+
params.gas_limit = args.gasLimit;
|
|
70
|
+
if (args.gasPrice !== undefined)
|
|
71
|
+
params.gas_price = args.gasPrice;
|
|
72
|
+
if (args.nonce !== undefined)
|
|
73
|
+
params.nonce = args.nonce;
|
|
74
|
+
if (args.chainId !== undefined)
|
|
75
|
+
params.chain_id = args.chainId;
|
|
76
|
+
return this.client.sendTransaction(params);
|
|
77
|
+
}
|
|
78
|
+
async getTransaction(hash) {
|
|
79
|
+
const tx = await this.client.getTransaction(hash);
|
|
80
|
+
if (tx === null)
|
|
81
|
+
return null;
|
|
82
|
+
// The SDK's `Transaction` has no explicit status field; we infer:
|
|
83
|
+
// - `blockHeight` unset → still in mempool → 'pending'
|
|
84
|
+
// - `blockHeight` set, ≤ finalized → 'finalized'
|
|
85
|
+
// - `blockHeight` set, > finalized → 'included'
|
|
86
|
+
if (tx.blockHeight === undefined) {
|
|
87
|
+
return { hash: tx.hash, status: 'pending' };
|
|
88
|
+
}
|
|
89
|
+
const finalized = await this.client.getFinalizedBlock();
|
|
90
|
+
const status = tx.blockHeight <= finalized ? 'finalized' : 'included';
|
|
91
|
+
return { hash: tx.hash, status, blockHeight: tx.blockHeight };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Re-export so kernel consumers can `instanceof`-check the not-installed
|
|
96
|
+
* case without taking a direct dependency on `tenzro-sdk`. The kernel's
|
|
97
|
+
* adapter layer is the only place SDK types should leak in from.
|
|
98
|
+
*/
|
|
99
|
+
export { TenzroNotInstalledError };
|
|
100
|
+
//# sourceMappingURL=tenzro-sdk-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenzro-sdk-adapter.js","sourceRoot":"","sources":["../../../src/ports/adapters/tenzro-sdk-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAEL,YAAY,EAEZ,uBAAuB,GACxB,MAAM,YAAY,CAAC;AA0BpB,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAEzD;gEAC4D;IAC5D,MAAM,CAAC,UAAU,CAAC,MAAuB;QACvC,OAAO,IAAI,gBAAgB,CAAC,MAAqC,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAIzB;QACC,MAAM,MAAM,GAAG,MAAM,YAAY,C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AC;YACjC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAC9C,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACxD,MAAM,MAAM,GAA6B,EAAE,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;QAChG,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC;IAChE,CAAC;CACF;AAED;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AcpPort — buyer-side OpenAI Agentic Commerce Protocol (ACP).
|
|
3
|
+
*
|
|
4
|
+
* ACP went live with ChatGPT Instant Checkout on 2026-02-16 (Etsy /
|
|
5
|
+
* Shopify / PayPal). Per `reference_agentic_payments_2026.md`, Tenzro's
|
|
6
|
+
* adopt-don't-rebuild stance is: implement the *buyer* side so a Tenzro
|
|
7
|
+
* agent can complete a ChatGPT-initiated purchase.
|
|
8
|
+
*
|
|
9
|
+
* The wallet is the buyer agent. It receives an ACP `CheckoutSession`
|
|
10
|
+
* from the merchant (typically through ChatGPT), confirms with the user
|
|
11
|
+
* via the standard consent flow, and submits a `CheckoutAuthorization`
|
|
12
|
+
* back. Settlement happens on the merchant side; the wallet does not
|
|
13
|
+
* transfer funds directly through ACP — it provides authorisation that
|
|
14
|
+
* the merchant redeems via their PSP (Stripe is the typical processor).
|
|
15
|
+
*
|
|
16
|
+
* SDK status (2026-05): `tenzro-sdk` does NOT yet expose an ACP client.
|
|
17
|
+
* This port is declared so the kernel surface is stable; `AcpSdkAdapter`
|
|
18
|
+
* lands when the SDK ships `AcpClient` (tracked as DESIGN.md §11 SDK gap).
|
|
19
|
+
*
|
|
20
|
+
* Wire shape follows the public ACP v1 spec:
|
|
21
|
+
* • CheckoutSession: { id, merchant, line_items[], total, currency,
|
|
22
|
+
* psp, expires_at }
|
|
23
|
+
* • CheckoutAuthorization: { session_id, buyer, payment_method,
|
|
24
|
+
* authorisation_proof, signature }
|
|
25
|
+
*/
|
|
26
|
+
export interface AcpLineItem {
|
|
27
|
+
readonly sku: string;
|
|
28
|
+
readonly description: string;
|
|
29
|
+
readonly quantity: number;
|
|
30
|
+
readonly unitPrice: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AcpCheckoutSession {
|
|
33
|
+
readonly sessionId: string;
|
|
34
|
+
readonly merchant: string;
|
|
35
|
+
readonly lineItems: readonly AcpLineItem[];
|
|
36
|
+
readonly total: string;
|
|
37
|
+
readonly currency: string;
|
|
38
|
+
/** Payment service provider (e.g. "stripe", "adyen"). */
|
|
39
|
+
readonly psp: string;
|
|
40
|
+
readonly expiresAt: number;
|
|
41
|
+
}
|
|
42
|
+
export interface AcpAuthorizeRequest {
|
|
43
|
+
readonly sessionId: string;
|
|
44
|
+
/** Buyer DID — the agent / human authorising the purchase. */
|
|
45
|
+
readonly buyer: string;
|
|
46
|
+
/**
|
|
47
|
+
* Payment method handle issued by the buyer's PSP. ACP carries the
|
|
48
|
+
* handle, not raw card data.
|
|
49
|
+
*/
|
|
50
|
+
readonly paymentMethod: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AcpAuthorizationResult {
|
|
53
|
+
readonly sessionId: string;
|
|
54
|
+
readonly authorizationId: string;
|
|
55
|
+
readonly status: 'authorised' | 'declined' | 'pending';
|
|
56
|
+
readonly reason?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface AcpPort {
|
|
59
|
+
/** Fetch a checkout session by id (typically issued by the merchant). */
|
|
60
|
+
getSession(sessionId: string): Promise<AcpCheckoutSession>;
|
|
61
|
+
/** Authorise a checkout session. The wallet runs its consent flow first. */
|
|
62
|
+
authorize(req: AcpAuthorizeRequest): Promise<AcpAuthorizationResult>;
|
|
63
|
+
/** Cancel a session before authorisation. */
|
|
64
|
+
cancel(sessionId: string): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=acp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp.d.ts","sourceRoot":"","sources":["../../../src/ports/agent/acp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,WAAW,EAAE,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE3D,4EAA4E;IAC5E,SAAS,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAErE,6CAA6C;IAC7C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AcpPort — buyer-side OpenAI Agentic Commerce Protocol (ACP).
|
|
3
|
+
*
|
|
4
|
+
* ACP went live with ChatGPT Instant Checkout on 2026-02-16 (Etsy /
|
|
5
|
+
* Shopify / PayPal). Per `reference_agentic_payments_2026.md`, Tenzro's
|
|
6
|
+
* adopt-don't-rebuild stance is: implement the *buyer* side so a Tenzro
|
|
7
|
+
* agent can complete a ChatGPT-initiated purchase.
|
|
8
|
+
*
|
|
9
|
+
* The wallet is the buyer agent. It receives an ACP `CheckoutSession`
|
|
10
|
+
* from the merchant (typically through ChatGPT), confirms with the user
|
|
11
|
+
* via the standard consent flow, and submits a `CheckoutAuthorization`
|
|
12
|
+
* back. Settlement happens on the merchant side; the wallet does not
|
|
13
|
+
* transfer funds directly through ACP — it provides authorisation that
|
|
14
|
+
* the merchant redeems via their PSP (Stripe is the typical processor).
|
|
15
|
+
*
|
|
16
|
+
* SDK status (2026-05): `tenzro-sdk` does NOT yet expose an ACP client.
|
|
17
|
+
* This port is declared so the kernel surface is stable; `AcpSdkAdapter`
|
|
18
|
+
* lands when the SDK ships `AcpClient` (tracked as DESIGN.md §11 SDK gap).
|
|
19
|
+
*
|
|
20
|
+
* Wire shape follows the public ACP v1 spec:
|
|
21
|
+
* • CheckoutSession: { id, merchant, line_items[], total, currency,
|
|
22
|
+
* psp, expires_at }
|
|
23
|
+
* • CheckoutAuthorization: { session_id, buyer, payment_method,
|
|
24
|
+
* authorisation_proof, signature }
|
|
25
|
+
*/
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=acp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acp.js","sourceRoot":"","sources":["../../../src/ports/agent/acp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AcpSdkAdapter — buyer-side OpenAI Agentic Commerce Protocol (ACP) wrapper.
|
|
3
|
+
*
|
|
4
|
+
* **SDK status (2026-05):** `tenzro-sdk` does NOT yet expose an `AcpClient`.
|
|
5
|
+
* This adapter therefore depends on a structural `AcpClientLike` interface
|
|
6
|
+
* the kernel defines itself, mirroring the public ACP v1 wire shape. When
|
|
7
|
+
* the SDK ships `AcpClient`, swap `AcpClientLike` for the SDK type and
|
|
8
|
+
* delete the structural definition — the wire mapping below is already
|
|
9
|
+
* the one we'll need.
|
|
10
|
+
*
|
|
11
|
+
* Wire shape pinned to the public ACP spec:
|
|
12
|
+
* GET /sessions/{id} → AcpCheckoutSession (snake_case)
|
|
13
|
+
* POST /sessions/{id}/authorize → AcpAuthorizationResult
|
|
14
|
+
* POST /sessions/{id}/cancel → 204
|
|
15
|
+
*
|
|
16
|
+
* Field-mapping rules, identical to the rest of the agent-port adapter set:
|
|
17
|
+
* - snake_case on the wire ↔ camelCase on the port.
|
|
18
|
+
* - decimal-string amounts on the wire (ACP carries no bigint over the
|
|
19
|
+
* wire — all amounts are "1234.56" strings — so we forward verbatim).
|
|
20
|
+
* - missing optional fields use the conditional-spread idiom required
|
|
21
|
+
* by the kernel's `exactOptionalPropertyTypes: true`.
|
|
22
|
+
*/
|
|
23
|
+
import type { AcpAuthorizationResult, AcpAuthorizeRequest, AcpCheckoutSession, AcpPort } from '../acp.js';
|
|
24
|
+
interface RawLineItem {
|
|
25
|
+
readonly sku: string;
|
|
26
|
+
readonly description: string;
|
|
27
|
+
readonly quantity: number;
|
|
28
|
+
readonly unit_price: string;
|
|
29
|
+
}
|
|
30
|
+
interface RawCheckoutSession {
|
|
31
|
+
readonly session_id: string;
|
|
32
|
+
readonly merchant: string;
|
|
33
|
+
readonly line_items: ReadonlyArray<RawLineItem>;
|
|
34
|
+
readonly total: string;
|
|
35
|
+
readonly currency: string;
|
|
36
|
+
readonly psp: string;
|
|
37
|
+
readonly expires_at: number;
|
|
38
|
+
}
|
|
39
|
+
interface RawAuthorizationResult {
|
|
40
|
+
readonly session_id: string;
|
|
41
|
+
readonly authorization_id: string;
|
|
42
|
+
readonly status: 'authorised' | 'declined' | 'pending';
|
|
43
|
+
readonly reason?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Structural shape the adapter expects from the SDK client. When `tenzro-sdk`
|
|
47
|
+
* exposes `AcpClient`, this becomes `import type { AcpClient } from 'tenzro-sdk'`
|
|
48
|
+
* and the structural type goes away.
|
|
49
|
+
*/
|
|
50
|
+
export interface AcpClientLike {
|
|
51
|
+
getSession(sessionId: string): Promise<RawCheckoutSession>;
|
|
52
|
+
authorize(req: {
|
|
53
|
+
session_id: string;
|
|
54
|
+
buyer: string;
|
|
55
|
+
payment_method: string;
|
|
56
|
+
}): Promise<RawAuthorizationResult>;
|
|
57
|
+
cancel(sessionId: string): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
export declare class AcpSdkAdapter implements AcpPort {
|
|
60
|
+
private readonly client;
|
|
61
|
+
constructor(client: AcpClientLike);
|
|
62
|
+
getSession(sessionId: string): Promise<AcpCheckoutSession>;
|
|
63
|
+
authorize(req: AcpAuthorizeRequest): Promise<AcpAuthorizationResult>;
|
|
64
|
+
cancel(sessionId: string): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=acp-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|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d,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACpC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAgCD,qBAAa,aAAc,YAAW,OAAO;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI1D,SAAS,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IASpE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AcpSdkAdapter — buyer-side OpenAI Agentic Commerce Protocol (ACP) wrapper.
|
|
3
|
+
*
|
|
4
|
+
* **SDK status (2026-05):** `tenzro-sdk` does NOT yet expose an `AcpClient`.
|
|
5
|
+
* This adapter therefore depends on a structural `AcpClientLike` interface
|
|
6
|
+
* the kernel defines itself, mirroring the public ACP v1 wire shape. When
|
|
7
|
+
* the SDK ships `AcpClient`, swap `AcpClientLike` for the SDK type and
|
|
8
|
+
* delete the structural definition — the wire mapping below is already
|
|
9
|
+
* the one we'll need.
|
|
10
|
+
*
|
|
11
|
+
* Wire shape pinned to the public ACP spec:
|
|
12
|
+
* GET /sessions/{id} → AcpCheckoutSession (snake_case)
|
|
13
|
+
* POST /sessions/{id}/authorize → AcpAuthorizationResult
|
|
14
|
+
* POST /sessions/{id}/cancel → 204
|
|
15
|
+
*
|
|
16
|
+
* Field-mapping rules, identical to the rest of the agent-port adapter set:
|
|
17
|
+
* - snake_case on the wire ↔ camelCase on the port.
|
|
18
|
+
* - decimal-string amounts on the wire (ACP carries no bigint over the
|
|
19
|
+
* wire — all amounts are "1234.56" strings — so we forward verbatim).
|
|
20
|
+
* - missing optional fields use the conditional-spread idiom required
|
|
21
|
+
* by the kernel's `exactOptionalPropertyTypes: true`.
|
|
22
|
+
*/
|
|
23
|
+
function mapLineItem(raw) {
|
|
24
|
+
return {
|
|
25
|
+
sku: raw.sku,
|
|
26
|
+
description: raw.description,
|
|
27
|
+
quantity: raw.quantity,
|
|
28
|
+
unitPrice: raw.unit_price,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function mapSession(raw) {
|
|
32
|
+
return {
|
|
33
|
+
sessionId: raw.session_id,
|
|
34
|
+
merchant: raw.merchant,
|
|
35
|
+
lineItems: raw.line_items.map(mapLineItem),
|
|
36
|
+
total: raw.total,
|
|
37
|
+
currency: raw.currency,
|
|
38
|
+
psp: raw.psp,
|
|
39
|
+
expiresAt: raw.expires_at,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function mapAuthorizationResult(raw) {
|
|
43
|
+
return {
|
|
44
|
+
sessionId: raw.session_id,
|
|
45
|
+
authorizationId: raw.authorization_id,
|
|
46
|
+
status: raw.status,
|
|
47
|
+
...(raw.reason !== undefined ? { reason: raw.reason } : {}),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export class AcpSdkAdapter {
|
|
51
|
+
client;
|
|
52
|
+
constructor(client) {
|
|
53
|
+
this.client = client;
|
|
54
|
+
}
|
|
55
|
+
async getSession(sessionId) {
|
|
56
|
+
return mapSession(await this.client.getSession(sessionId));
|
|
57
|
+
}
|
|
58
|
+
async authorize(req) {
|
|
59
|
+
const raw = await this.client.authorize({
|
|
60
|
+
session_id: req.sessionId,
|
|
61
|
+
buyer: req.buyer,
|
|
62
|
+
payment_method: req.paymentMethod,
|
|
63
|
+
});
|
|
64
|
+
return mapAuthorizationResult(raw);
|
|
65
|
+
}
|
|
66
|
+
async cancel(sessionId) {
|
|
67
|
+
await this.client.cancel(sessionId);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=acp-adapter.js.map
|
|
@@ -0,0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AS,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAwB;QACtC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YACtC,UAAU,EAAE,GAAG,CAAC,SAAS;YACzB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,cAAc,EAAE,GAAG,CAAC,aAAa;SAClC,CAAC,CAAC;QACH,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentBondSdkAdapter — wraps `BondClient` so the kernel can drive the
|
|
3
|
+
* Agent-Swarm Spec 9 bond primitive without owning the typed-tx encoding.
|
|
4
|
+
*
|
|
5
|
+
* Wire:
|
|
6
|
+
* post → BondClient.postAgentBond(controller, agentDid, controllerDid, amount)
|
|
7
|
+
* increase → BondClient.increaseAgentBond(controller, agentDid, amount)
|
|
8
|
+
* withdraw → BondClient.withdrawAgentBond(controller, agentDid)
|
|
9
|
+
* get → BondClient.getAgentBond(bondId)
|
|
10
|
+
* list → BondClient.listAgentBondsByController(controllerDid)
|
|
11
|
+
*
|
|
12
|
+
* The SDK already handles `tenzro_signAndSendTransaction` routing for
|
|
13
|
+
* hybrid (server-side MPC) signing, so we forward verbatim.
|
|
14
|
+
*/
|
|
15
|
+
import type { BondClient } from 'tenzro-sdk';
|
|
16
|
+
import type { AgentBondPort, AgentBondRecord, IncreaseAgentBondRequest, PostAgentBondRequest, WithdrawAgentBondRequest } from '../agent-bond.js';
|
|
17
|
+
/**
|
|
18
|
+
* Slice of `BondClient` the adapter relies on, anchored to the SDK via
|
|
19
|
+
* `Pick<>` so a method-rename in `tenzro-sdk` breaks the build.
|
|
20
|
+
*/
|
|
21
|
+
export type BondClientLike = Pick<BondClient, 'postAgentBond' | 'increaseAgentBond' | 'withdrawAgentBond' | 'getAgentBond' | 'listAgentBondsByController'>;
|
|
22
|
+
export declare class AgentBondSdkAdapter implements AgentBondPort {
|
|
23
|
+
private readonly client;
|
|
24
|
+
constructor(client: BondClientLike);
|
|
25
|
+
post(req: PostAgentBondRequest): Promise<string>;
|
|
26
|
+
increase(req: IncreaseAgentBondRequest): Promise<string>;
|
|
27
|
+
withdraw(req: WithdrawAgentBondRequest): Promise<string>;
|
|
28
|
+
get(bondId: string): Promise<AgentBondRecord | null>;
|
|
29
|
+
listByController(controllerDid: string): Promise<AgentBondRecord[]>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=agent-bond-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-bond-adapter.d.ts","sourceRoot":"","sources":["../../../../src/ports/agent/adapters/agent-bond-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAEf,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACR,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,4BAA4B,CAC/B,CAAC;AAsBF,qBAAa,mBAAoB,YAAW,aAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAEnD,IAAI,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIhD,QAAQ,CAAC,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD,QAAQ,CAAC,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlD,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAKpD,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAa1E"}
|