@haven_ai/sdk 0.0.0-dev.202610031142.ceefb34 → 0.0.0-dev.202610050826.294716e
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/README.md +6 -6
- package/dist/{base64-DK-BszUZ.d.cts → base64-VJtMyjBC.d.cts} +3 -3
- package/dist/{base64-DK-BszUZ.d.ts → base64-VJtMyjBC.d.ts} +3 -3
- package/dist/{chunk-S2KGUYDV.js → chunk-GK5TO7Y2.js} +2 -2
- package/dist/chunk-GK5TO7Y2.js.map +1 -0
- package/dist/{chunk-JK5RJJLI.cjs → chunk-NBZ6OQIV.cjs} +35 -35
- package/dist/{chunk-JK5RJJLI.cjs.map → chunk-NBZ6OQIV.cjs.map} +1 -1
- package/dist/{chunk-KDLEKUS2.js → chunk-PUNK5KW2.js} +4 -4
- package/dist/{chunk-KDLEKUS2.js.map → chunk-PUNK5KW2.js.map} +1 -1
- package/dist/{chunk-KYDD3B32.cjs → chunk-QJD7PL4N.cjs} +2 -2
- package/dist/chunk-QJD7PL4N.cjs.map +1 -0
- package/dist/edge.cjs +89 -89
- package/dist/edge.d.cts +2 -2
- package/dist/edge.d.ts +2 -2
- package/dist/edge.js +4 -4
- package/dist/index.cjs +315 -310
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/test-support.cjs +18 -18
- package/dist/test-support.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KYDD3B32.cjs.map +0 -1
- package/dist/chunk-S2KGUYDV.js.map +0 -1
package/README.md
CHANGED
|
@@ -46,13 +46,13 @@ const haven = new HavenClient({
|
|
|
46
46
|
|
|
47
47
|
// One-liner payment — handles intent, signing, submission, and confirmation
|
|
48
48
|
const result = await haven.pay({
|
|
49
|
-
token: '
|
|
49
|
+
token: 'USDC',
|
|
50
50
|
amount: '5.00',
|
|
51
51
|
to: '0xabc...',
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
console.log(result.txHash) // 0x...
|
|
55
|
-
console.log(result.explorerUrl) // https://
|
|
55
|
+
console.log(result.explorerUrl) // https://basescan.org/tx/0x... (sepolia.basescan.org on Base Sepolia)
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Pay for an x402 resource
|
|
@@ -82,8 +82,8 @@ shows up in your Haven dashboard activity feed.
|
|
|
82
82
|
|
|
83
83
|
| Network | CAIP-2 | Tokens |
|
|
84
84
|
|---------|--------|--------|
|
|
85
|
-
|
|
|
86
|
-
| Base | `eip155:
|
|
85
|
+
| Base | `eip155:8453` | USDC |
|
|
86
|
+
| Base Sepolia (dev/QA) | `eip155:84532` | USDC |
|
|
87
87
|
|
|
88
88
|
## Credential Lifecycle
|
|
89
89
|
|
|
@@ -290,7 +290,7 @@ const anthropic = new Anthropic()
|
|
|
290
290
|
const response = await anthropic.messages.create({
|
|
291
291
|
model: 'claude-opus-4-7',
|
|
292
292
|
tools: havenTools.claude(), // or havenTools.openai() for OpenAI
|
|
293
|
-
messages: [{ role: 'user', content: 'Pay 5
|
|
293
|
+
messages: [{ role: 'user', content: 'Pay 5 USDC to 0xabc for API access' }],
|
|
294
294
|
})
|
|
295
295
|
|
|
296
296
|
// Handle tool calls
|
|
@@ -632,7 +632,7 @@ inspection, saved resume state, and final retry.
|
|
|
632
632
|
import { HavenApiError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError } from '@haven_ai/sdk'
|
|
633
633
|
|
|
634
634
|
try {
|
|
635
|
-
await haven.pay({ token: '
|
|
635
|
+
await haven.pay({ token: 'USDC', amount: '5.00', to: '0xabc...' })
|
|
636
636
|
} catch (err) {
|
|
637
637
|
if (err instanceof HavenPaymentStateError) {
|
|
638
638
|
console.log(err.paymentId, err.phase, err.nextAction)
|
|
@@ -55,7 +55,7 @@ interface HavenClientConfig {
|
|
|
55
55
|
chainRpcs?: Record<number, string>;
|
|
56
56
|
}
|
|
57
57
|
interface PaymentRequest {
|
|
58
|
-
/** Token symbol: "
|
|
58
|
+
/** Token symbol: "USDC" (agent budgets are USDC on Base and Base Sepolia) */
|
|
59
59
|
token: string;
|
|
60
60
|
/** Amount as a decimal string, e.g. "5.00" */
|
|
61
61
|
amount: string;
|
|
@@ -2292,7 +2292,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
2292
2292
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
2293
2293
|
* it with the package version on every release — never hand-edit it.
|
|
2294
2294
|
*/
|
|
2295
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
2295
|
+
declare const SDK_VERSION = "0.0.0-dev.202610050826.294716e";
|
|
2296
2296
|
/** The request header every published Haven client sends. */
|
|
2297
2297
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
2298
2298
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -2879,7 +2879,7 @@ declare function encodePaymentProof(receipt: {
|
|
|
2879
2879
|
* Resolve a token symbol from a contract address.
|
|
2880
2880
|
*
|
|
2881
2881
|
* Checks all supported chains. For chain-specific resolution,
|
|
2882
|
-
* pass the optional `network` CAIP-2 string (e.g. "eip155:
|
|
2882
|
+
* pass the optional `network` CAIP-2 string (e.g. "eip155:8453").
|
|
2883
2883
|
*/
|
|
2884
2884
|
declare function resolveTokenFromAddress(address: string, network?: string): {
|
|
2885
2885
|
symbol: string;
|
|
@@ -55,7 +55,7 @@ interface HavenClientConfig {
|
|
|
55
55
|
chainRpcs?: Record<number, string>;
|
|
56
56
|
}
|
|
57
57
|
interface PaymentRequest {
|
|
58
|
-
/** Token symbol: "
|
|
58
|
+
/** Token symbol: "USDC" (agent budgets are USDC on Base and Base Sepolia) */
|
|
59
59
|
token: string;
|
|
60
60
|
/** Amount as a decimal string, e.g. "5.00" */
|
|
61
61
|
amount: string;
|
|
@@ -2292,7 +2292,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
2292
2292
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
2293
2293
|
* it with the package version on every release — never hand-edit it.
|
|
2294
2294
|
*/
|
|
2295
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
2295
|
+
declare const SDK_VERSION = "0.0.0-dev.202610050826.294716e";
|
|
2296
2296
|
/** The request header every published Haven client sends. */
|
|
2297
2297
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
2298
2298
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -2879,7 +2879,7 @@ declare function encodePaymentProof(receipt: {
|
|
|
2879
2879
|
* Resolve a token symbol from a contract address.
|
|
2880
2880
|
*
|
|
2881
2881
|
* Checks all supported chains. For chain-specific resolution,
|
|
2882
|
-
* pass the optional `network` CAIP-2 string (e.g. "eip155:
|
|
2882
|
+
* pass the optional `network` CAIP-2 string (e.g. "eip155:8453").
|
|
2883
2883
|
*/
|
|
2884
2884
|
declare function resolveTokenFromAddress(address: string, network?: string): {
|
|
2885
2885
|
symbol: string;
|
|
@@ -1016,5 +1016,5 @@ function assertRedeemsOwnBudgetDelegation(redeemCalldata, ownAccount) {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
|
|
1018
1018
|
export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CAVEAT_ENFORCERS, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DELEGATION_MANAGER, DELEGATION_TUPLE_COMPONENTS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_DOMAIN_NAME, HYBRID_DELEGATOR_DOMAIN_VERSION, HYBRID_DELEGATOR_IMPLEMENTATION, HavenApiError, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, HavenZeroSettlementHashError, MAX_SETTLEMENT_WINDOW_SECONDS, MerchantTimeoutError, PACKED_USER_OPERATION_FIELDS, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SIMPLE_FACTORY_ADDRESS, SINGLE_DEFAULT_MODE, SignerRefusalCode, TASK_SIGN_CONTEXT_VERSION, X402AlreadySettledError, X402Erc7710AlreadySettledError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, assertRedeemsOwnBudgetDelegation, assertUserOpTypedDataBinding, chainIdForNetwork, connectorRerunCommand, connectorSpec, connectorUpgradeCommand, deriveDelegateAccountAddress, isConnectorChannel, isPackedUserOperationTypedData, isSettlementChildTypedData, packedUserOperationHash, resolveConnectorChannel, signerUpdateFallback, verifySettlementChild };
|
|
1019
|
-
//# sourceMappingURL=chunk-
|
|
1020
|
-
//# sourceMappingURL=chunk-
|
|
1019
|
+
//# sourceMappingURL=chunk-GK5TO7Y2.js.map
|
|
1020
|
+
//# sourceMappingURL=chunk-GK5TO7Y2.js.map
|