@haven_ai/sdk 0.0.0-dev.202609232125.72f3d20 → 0.0.0-dev.202609241802.ea320de
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 +9 -3
- package/dist/{base64-CNakwKE8.d.cts → base64-CPxbmyU9.d.cts} +80 -17
- package/dist/{base64-CNakwKE8.d.ts → base64-CPxbmyU9.d.ts} +80 -17
- package/dist/{chunk-7FXW3IKZ.js → chunk-FR5R26V3.js} +139 -8
- package/dist/chunk-FR5R26V3.js.map +1 -0
- package/dist/{chunk-AS6BCA42.cjs → chunk-M57KOLAN.cjs} +147 -7
- package/dist/chunk-M57KOLAN.cjs.map +1 -0
- package/dist/edge.cjs +50 -26
- package/dist/edge.d.cts +2 -1
- package/dist/edge.d.ts +2 -1
- package/dist/edge.js +2 -2
- package/dist/index.cjs +291 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-7FXW3IKZ.js.map +0 -1
- package/dist/chunk-AS6BCA42.cjs.map +0 -1
package/dist/edge.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkM57KOLAN_cjs = require('./chunk-M57KOLAN.cjs');
|
|
4
4
|
var secp256k1 = require('@noble/curves/secp256k1');
|
|
5
5
|
var accounts = require('viem/accounts');
|
|
6
6
|
var viem = require('viem');
|
|
@@ -16,7 +16,7 @@ function addressFromKey(privateKey) {
|
|
|
16
16
|
try {
|
|
17
17
|
return accounts.privateKeyToAddress(`0x${hexBytes(privateKey, 32, "private key")}`);
|
|
18
18
|
} catch (err) {
|
|
19
|
-
throw new
|
|
19
|
+
throw new chunkM57KOLAN_cjs.HavenSigningError(
|
|
20
20
|
`Invalid private key: ${err instanceof Error ? err.message : String(err)}`
|
|
21
21
|
);
|
|
22
22
|
}
|
|
@@ -30,7 +30,7 @@ function signHash(privateKey, hash) {
|
|
|
30
30
|
yParity: recovery
|
|
31
31
|
});
|
|
32
32
|
} catch (err) {
|
|
33
|
-
throw new
|
|
33
|
+
throw new chunkM57KOLAN_cjs.HavenSigningError(
|
|
34
34
|
`Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
|
|
35
35
|
);
|
|
36
36
|
}
|
|
@@ -53,95 +53,119 @@ function verifySignature(hash, signature, expectedAddress) {
|
|
|
53
53
|
|
|
54
54
|
Object.defineProperty(exports, "AgentPaymentFailureCode", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkM57KOLAN_cjs.AgentPaymentFailureCode; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "AgentPaymentNextAction", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkM57KOLAN_cjs.AgentPaymentNextAction; }
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "DIRECT_SIGN_CONTEXT_VERSION", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () { return chunkM57KOLAN_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "ENTRY_POINT_V07", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () { return chunkM57KOLAN_cjs.ENTRY_POINT_V07; }
|
|
61
69
|
});
|
|
62
70
|
Object.defineProperty(exports, "HAVEN_CONNECTOR_CHANNEL", {
|
|
63
71
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkM57KOLAN_cjs.HAVEN_CONNECTOR_CHANNEL; }
|
|
65
73
|
});
|
|
66
74
|
Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
|
|
67
75
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkM57KOLAN_cjs.HAVEN_MINIMUM_NODE_VERSION; }
|
|
69
77
|
});
|
|
70
78
|
Object.defineProperty(exports, "HavenApiError", {
|
|
71
79
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkM57KOLAN_cjs.HavenApiError; }
|
|
73
81
|
});
|
|
74
82
|
Object.defineProperty(exports, "HavenError", {
|
|
75
83
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkM57KOLAN_cjs.HavenError; }
|
|
77
85
|
});
|
|
78
86
|
Object.defineProperty(exports, "HavenSigningError", {
|
|
79
87
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkM57KOLAN_cjs.HavenSigningError; }
|
|
81
89
|
});
|
|
82
90
|
Object.defineProperty(exports, "HavenUnsupportedSignerVersionError", {
|
|
83
91
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunkM57KOLAN_cjs.HavenUnsupportedSignerVersionError; }
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "HavenUserOpBindingError", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () { return chunkM57KOLAN_cjs.HavenUserOpBindingError; }
|
|
85
97
|
});
|
|
86
98
|
Object.defineProperty(exports, "SIGNER_UPDATE_FALLBACK", {
|
|
87
99
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
100
|
+
get: function () { return chunkM57KOLAN_cjs.SIGNER_UPDATE_FALLBACK; }
|
|
89
101
|
});
|
|
90
102
|
Object.defineProperty(exports, "SignerRefusalCode", {
|
|
91
103
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
104
|
+
get: function () { return chunkM57KOLAN_cjs.SignerRefusalCode; }
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "assertUserOpTypedDataBinding", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return chunkM57KOLAN_cjs.assertUserOpTypedDataBinding; }
|
|
93
109
|
});
|
|
94
110
|
Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
|
|
95
111
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkM57KOLAN_cjs.buildSweepAuthorizationMessage; }
|
|
97
113
|
});
|
|
98
114
|
Object.defineProperty(exports, "buildSweepTypedData", {
|
|
99
115
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkM57KOLAN_cjs.buildSweepTypedData; }
|
|
101
117
|
});
|
|
102
118
|
Object.defineProperty(exports, "buildX402ExpectedMessage", {
|
|
103
119
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkM57KOLAN_cjs.buildX402ExpectedMessage; }
|
|
105
121
|
});
|
|
106
122
|
Object.defineProperty(exports, "connectorRerunCommand", {
|
|
107
123
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkM57KOLAN_cjs.connectorRerunCommand; }
|
|
109
125
|
});
|
|
110
126
|
Object.defineProperty(exports, "createNextStepBuilder", {
|
|
111
127
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkM57KOLAN_cjs.createNextStepBuilder; }
|
|
113
129
|
});
|
|
114
130
|
Object.defineProperty(exports, "decodeBase64Json", {
|
|
115
131
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkM57KOLAN_cjs.decodeBase64Json; }
|
|
117
133
|
});
|
|
118
134
|
Object.defineProperty(exports, "encodeBase64Json", {
|
|
119
135
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkM57KOLAN_cjs.encodeBase64Json; }
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "isPackedUserOperationTypedData", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () { return chunkM57KOLAN_cjs.isPackedUserOperationTypedData; }
|
|
121
141
|
});
|
|
122
142
|
Object.defineProperty(exports, "isSupportedNodeVersion", {
|
|
123
143
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkM57KOLAN_cjs.isSupportedNodeVersion; }
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "packedUserOperationHash", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function () { return chunkM57KOLAN_cjs.packedUserOperationHash; }
|
|
125
149
|
});
|
|
126
150
|
Object.defineProperty(exports, "selectStandardPaymentOption", {
|
|
127
151
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkM57KOLAN_cjs.selectStandardPaymentOption; }
|
|
129
153
|
});
|
|
130
154
|
Object.defineProperty(exports, "toStandardPaymentRequirements", {
|
|
131
155
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkM57KOLAN_cjs.toStandardPaymentRequirements; }
|
|
133
157
|
});
|
|
134
158
|
Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
|
|
135
159
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkM57KOLAN_cjs.unsupportedNodeVersionMessage; }
|
|
137
161
|
});
|
|
138
162
|
Object.defineProperty(exports, "x402AuthorizationAmount", {
|
|
139
163
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
164
|
+
get: function () { return chunkM57KOLAN_cjs.x402AuthorizationAmount; }
|
|
141
165
|
});
|
|
142
166
|
Object.defineProperty(exports, "x402V2PaymentEnvelope", {
|
|
143
167
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkM57KOLAN_cjs.x402V2PaymentEnvelope; }
|
|
145
169
|
});
|
|
146
170
|
exports.addressFromKey = addressFromKey;
|
|
147
171
|
exports.signHash = signHash;
|
package/dist/edge.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { L as AgentPaymentFailureCode, O as AgentPaymentNextAction, a7 as HAVEN_CONNECTOR_CHANNEL,
|
|
1
|
+
export { L as AgentPaymentFailureCode, O as AgentPaymentNextAction, a6 as DIRECT_SIGN_CONTEXT_VERSION, a7 as ENTRY_POINT_V07, a9 as HAVEN_CONNECTOR_CHANNEL, aa as HAVEN_MINIMUM_NODE_VERSION, ag as HavenApiError, D as HavenError, ak as HavenSigningError, am as HavenUnsupportedSignerVersionError, an as HavenUserOpBindingError, at as NextStep, av as NextStepHandoff, ax as NextStepTarget, aF as SIGNER_UPDATE_FALLBACK, aK as SignerRefusalCode, i as SweepAuthorization, aO as SweepExpectedAuth, aV as X402ExpectedAuth, aZ as X402PaymentOption, X as X402PaymentRequired, b8 as assertUserOpTypedDataBinding, b9 as buildSweepAuthorizationMessage, ba as buildSweepTypedData, bb as buildX402ExpectedMessage, bd as connectorRerunCommand, bf as createNextStepBuilder, bg as decodeBase64Json, bj as encodeBase64Json, bo as isPackedUserOperationTypedData, bp as isSupportedNodeVersion, bs as packedUserOperationHash, bB as selectStandardPaymentOption, bG as toStandardPaymentRequirements, bH as unsupportedNodeVersionMessage, bK as x402AuthorizationAmount, bM as x402V2PaymentEnvelope } from './base64-CPxbmyU9.cjs';
|
|
2
2
|
import 'x402/types';
|
|
3
|
+
import 'viem';
|
|
3
4
|
|
|
4
5
|
declare function addressFromKey(privateKey: string): string;
|
|
5
6
|
declare function signHash(privateKey: string, hash: string): string;
|
package/dist/edge.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { L as AgentPaymentFailureCode, O as AgentPaymentNextAction, a7 as HAVEN_CONNECTOR_CHANNEL,
|
|
1
|
+
export { L as AgentPaymentFailureCode, O as AgentPaymentNextAction, a6 as DIRECT_SIGN_CONTEXT_VERSION, a7 as ENTRY_POINT_V07, a9 as HAVEN_CONNECTOR_CHANNEL, aa as HAVEN_MINIMUM_NODE_VERSION, ag as HavenApiError, D as HavenError, ak as HavenSigningError, am as HavenUnsupportedSignerVersionError, an as HavenUserOpBindingError, at as NextStep, av as NextStepHandoff, ax as NextStepTarget, aF as SIGNER_UPDATE_FALLBACK, aK as SignerRefusalCode, i as SweepAuthorization, aO as SweepExpectedAuth, aV as X402ExpectedAuth, aZ as X402PaymentOption, X as X402PaymentRequired, b8 as assertUserOpTypedDataBinding, b9 as buildSweepAuthorizationMessage, ba as buildSweepTypedData, bb as buildX402ExpectedMessage, bd as connectorRerunCommand, bf as createNextStepBuilder, bg as decodeBase64Json, bj as encodeBase64Json, bo as isPackedUserOperationTypedData, bp as isSupportedNodeVersion, bs as packedUserOperationHash, bB as selectStandardPaymentOption, bG as toStandardPaymentRequirements, bH as unsupportedNodeVersionMessage, bK as x402AuthorizationAmount, bM as x402V2PaymentEnvelope } from './base64-CPxbmyU9.js';
|
|
2
2
|
import 'x402/types';
|
|
3
|
+
import 'viem';
|
|
3
4
|
|
|
4
5
|
declare function addressFromKey(privateKey: string): string;
|
|
5
6
|
declare function signHash(privateKey: string, hash: string): string;
|
package/dist/edge.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HavenSigningError } from './chunk-
|
|
2
|
-
export { AgentPaymentFailureCode, AgentPaymentNextAction, HAVEN_CONNECTOR_CHANNEL, HAVEN_MINIMUM_NODE_VERSION, HavenApiError, HavenError, HavenSigningError, HavenUnsupportedSignerVersionError, SIGNER_UPDATE_FALLBACK, SignerRefusalCode, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, connectorRerunCommand, createNextStepBuilder, decodeBase64Json, encodeBase64Json, isSupportedNodeVersion, selectStandardPaymentOption, toStandardPaymentRequirements, unsupportedNodeVersionMessage, x402AuthorizationAmount, x402V2PaymentEnvelope } from './chunk-
|
|
1
|
+
import { HavenSigningError } from './chunk-FR5R26V3.js';
|
|
2
|
+
export { AgentPaymentFailureCode, AgentPaymentNextAction, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, HAVEN_CONNECTOR_CHANNEL, HAVEN_MINIMUM_NODE_VERSION, HavenApiError, HavenError, HavenSigningError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, SIGNER_UPDATE_FALLBACK, SignerRefusalCode, assertUserOpTypedDataBinding, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, connectorRerunCommand, createNextStepBuilder, decodeBase64Json, encodeBase64Json, isPackedUserOperationTypedData, isSupportedNodeVersion, packedUserOperationHash, selectStandardPaymentOption, toStandardPaymentRequirements, unsupportedNodeVersionMessage, x402AuthorizationAmount, x402V2PaymentEnvelope } from './chunk-FR5R26V3.js';
|
|
3
3
|
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
4
4
|
import { privateKeyToAddress, publicKeyToAddress } from 'viem/accounts';
|
|
5
5
|
import { serializeSignature } from 'viem';
|