@rhinestone/sdk 2.0.0-beta.4 → 2.0.0-beta.41
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/dist/src/accounts/error.d.ts +2 -9
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +5 -11
- package/dist/src/accounts/hca.d.ts +25 -0
- package/dist/src/accounts/hca.d.ts.map +1 -0
- package/dist/src/accounts/hca.js +148 -0
- package/dist/src/accounts/index.d.ts +23 -10
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +170 -79
- package/dist/src/accounts/kernel.d.ts +1 -2
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +1 -8
- package/dist/src/accounts/nexus.d.ts +3 -2
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +33 -8
- package/dist/src/accounts/safe.d.ts +1 -2
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +3 -9
- package/dist/src/accounts/signing/common.d.ts +10 -4
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +48 -46
- package/dist/src/accounts/signing/message.d.ts.map +1 -1
- package/dist/src/accounts/signing/message.js +1 -4
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +1 -4
- package/dist/src/accounts/startale.d.ts +1 -2
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +6 -9
- package/dist/src/actions/ecdsa.js +5 -5
- package/dist/src/actions/index.js +2 -2
- package/dist/src/actions/mfa.js +2 -2
- package/dist/src/actions/passkeys.js +2 -2
- package/dist/src/actions/smart-sessions.d.ts +29 -5
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +38 -10
- package/dist/src/errors/index.d.ts +6 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +6 -6
- package/dist/src/execution/error.d.ts +42 -11
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +53 -15
- package/dist/src/execution/index.d.ts +18 -18
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +27 -42
- package/dist/src/execution/utils.d.ts +55 -14
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +629 -82
- package/dist/src/index.d.ts +270 -38
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +89 -116
- package/dist/src/jwt-server/jcs.d.ts +1 -1
- package/dist/src/jwt-server/jcs.js +4 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +0 -5
- package/dist/src/modules/read.d.ts +3 -2
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +52 -4
- package/dist/src/modules/validators/core.d.ts +6 -6
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +42 -39
- package/dist/src/modules/validators/cross-chain-permits.d.ts +21 -0
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +1 -0
- package/dist/src/modules/validators/cross-chain-permits.js +111 -0
- package/dist/src/modules/validators/permissions.d.ts +1 -0
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/permissions.js +192 -18
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts +22 -0
- package/dist/src/modules/validators/policies/claim/arbiters.d.ts.map +1 -0
- package/dist/src/modules/validators/policies/claim/arbiters.js +57 -0
- package/dist/src/modules/validators/smart-sessions.d.ts +38 -9
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +509 -92
- package/dist/src/orchestrator/caip2.d.ts +16 -3
- package/dist/src/orchestrator/caip2.d.ts.map +1 -1
- package/dist/src/orchestrator/caip2.js +38 -6
- package/dist/src/orchestrator/client.d.ts +2 -1
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +50 -24
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/dist/src/orchestrator/destinations.d.ts +24 -0
- package/dist/src/orchestrator/destinations.d.ts.map +1 -0
- package/dist/src/orchestrator/destinations.js +59 -0
- package/dist/src/orchestrator/error.d.ts +95 -5
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +260 -4
- package/dist/src/orchestrator/index.d.ts +7 -5
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +4 -3
- package/dist/src/orchestrator/registry.d.ts +2 -1
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +13 -0
- package/dist/src/orchestrator/types.d.ts +92 -29
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +1 -5
- package/dist/src/orchestrator/wire.d.ts +30 -0
- package/dist/src/orchestrator/wire.d.ts.map +1 -0
- package/dist/src/orchestrator/wire.gen.d.ts +4290 -0
- package/dist/src/orchestrator/wire.gen.d.ts.map +1 -0
- package/dist/src/orchestrator/wire.gen.js +1 -0
- package/dist/src/orchestrator/wire.js +1 -0
- package/dist/src/smart-sessions/index.d.ts +6 -0
- package/dist/src/smart-sessions/index.d.ts.map +1 -0
- package/dist/src/smart-sessions/index.js +7 -0
- package/dist/src/types.d.ts +299 -31
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +59 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +59 -0
- package/package.json +5 -9
- package/dist/src/actions/recovery.d.ts +0 -33
- package/dist/src/actions/recovery.d.ts.map +0 -1
- package/dist/src/actions/recovery.js +0 -189
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { concat, createWalletClient, custom, encodeAbiParameters, encodePacked, hashMessage, pad, padHex, toHex, } from 'viem';
|
|
2
2
|
import { isRip7212SupportedNetwork } from '../../modules/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ENS_HCA_MODULE, getValidator, OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_V0_VALIDATOR_ADDRESS, } from '../../modules/validators/core.js';
|
|
4
4
|
import { packSignature as packSmartSessionSignature, } from '../../modules/validators/smart-sessions.js';
|
|
5
5
|
import { generateCredentialId, packSignature as packPasskeySignature, packSignatureV0 as packPasskeySignatureV0, parsePublicKey, parseSignature, } from './passkeys.js';
|
|
6
6
|
function convertOwnerSetToSignerSet(owners) {
|
|
@@ -17,8 +17,8 @@ function convertOwnerSetToSignerSet(owners) {
|
|
|
17
17
|
return {
|
|
18
18
|
type: 'owner',
|
|
19
19
|
kind: 'ecdsa',
|
|
20
|
-
accounts: owners.
|
|
21
|
-
module:
|
|
20
|
+
accounts: owners.owners.map((o) => o.account),
|
|
21
|
+
module: ENS_HCA_MODULE,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
case 'passkey': {
|
|
@@ -47,8 +47,8 @@ function convertOwnerSetToSignerSet(owners) {
|
|
|
47
47
|
return {
|
|
48
48
|
type: 'ecdsa',
|
|
49
49
|
id: index,
|
|
50
|
-
accounts: validator.
|
|
51
|
-
module:
|
|
50
|
+
accounts: validator.owners.map((o) => o.account),
|
|
51
|
+
module: ENS_HCA_MODULE,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
case 'passkey': {
|
|
@@ -64,6 +64,7 @@ function convertOwnerSetToSignerSet(owners) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}),
|
|
67
|
+
module: owners.module,
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -76,7 +77,14 @@ async function signWithMultiFactorAuth(signers, chain, address, params, isUserOp
|
|
|
76
77
|
const validatorSigners = convertOwnerSetToSignerSet(validator);
|
|
77
78
|
return signMain(validatorSigners, chain, address, params, isUserOpHash);
|
|
78
79
|
}));
|
|
79
|
-
|
|
80
|
+
return packMultiFactorOwnerSignatures(signers.validators.map((validator, index) => ({
|
|
81
|
+
id: validator.id,
|
|
82
|
+
validatorAddress: getValidator(validator).address,
|
|
83
|
+
signature: signatures[index],
|
|
84
|
+
})));
|
|
85
|
+
}
|
|
86
|
+
function packMultiFactorOwnerSignatures(entries) {
|
|
87
|
+
return encodeAbiParameters([
|
|
80
88
|
{
|
|
81
89
|
components: [
|
|
82
90
|
{
|
|
@@ -90,20 +98,38 @@ async function signWithMultiFactorAuth(signers, chain, address, params, isUserOp
|
|
|
90
98
|
type: 'tuple[]',
|
|
91
99
|
},
|
|
92
100
|
], [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
data: signatures[index],
|
|
103
|
-
};
|
|
104
|
-
}),
|
|
101
|
+
entries.map((entry) => ({
|
|
102
|
+
packedValidatorAndId: concat([
|
|
103
|
+
pad(toHex(entry.id), {
|
|
104
|
+
size: 12,
|
|
105
|
+
}),
|
|
106
|
+
entry.validatorAddress,
|
|
107
|
+
]),
|
|
108
|
+
data: entry.signature,
|
|
109
|
+
})),
|
|
105
110
|
]);
|
|
106
|
-
|
|
111
|
+
}
|
|
112
|
+
function packPasskeyOwnerSignatures(chain, address, publicKeys, signatures, module) {
|
|
113
|
+
const usePrecompile = isRip7212SupportedNetwork(chain);
|
|
114
|
+
const credIds = publicKeys.map((publicKey) => {
|
|
115
|
+
const { x, y } = parsePublicKey(publicKey);
|
|
116
|
+
return generateCredentialId(x, y, address);
|
|
117
|
+
});
|
|
118
|
+
const webAuthns = signatures.map((signature) => {
|
|
119
|
+
const { r, s } = parseSignature(signature.signature);
|
|
120
|
+
return {
|
|
121
|
+
authenticatorData: signature.webauthn.authenticatorData,
|
|
122
|
+
clientDataJSON: signature.webauthn.clientDataJSON,
|
|
123
|
+
challengeIndex: BigInt(signature.webauthn.challengeIndex ?? 0),
|
|
124
|
+
typeIndex: BigInt(signature.webauthn.typeIndex ?? 0),
|
|
125
|
+
r,
|
|
126
|
+
s,
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
if (module?.toLowerCase() === WEBAUTHN_V0_VALIDATOR_ADDRESS) {
|
|
130
|
+
return packPasskeySignatureV0(webAuthns[0], usePrecompile);
|
|
131
|
+
}
|
|
132
|
+
return packPasskeySignature(credIds, usePrecompile, webAuthns);
|
|
107
133
|
}
|
|
108
134
|
async function signWithSession(signers, chain, address, hash, signMain) {
|
|
109
135
|
const sessionSigners = convertOwnerSetToSignerSet(signers.session.owners);
|
|
@@ -115,10 +141,6 @@ async function signWithSession(signers, chain, address, hash, signMain) {
|
|
|
115
141
|
const validatorSignature = await signMain(sessionSigners, chain, address, signedHash, false);
|
|
116
142
|
return packSmartSessionSignature(signers, validatorSignature);
|
|
117
143
|
}
|
|
118
|
-
async function signWithGuardians(signers, params, signingFunctions) {
|
|
119
|
-
const signatures = await Promise.all(signers.guardians.map((account) => signingFunctions.signEcdsa(account, params, false)));
|
|
120
|
-
return concat(signatures);
|
|
121
|
-
}
|
|
122
144
|
async function signWithOwners(signers, chain, address, params, signingFunctions, isUserOpHash, signMain) {
|
|
123
145
|
async function signEcdsWithChain(account, params, updateV, chain) {
|
|
124
146
|
const client = account.client;
|
|
@@ -144,34 +166,14 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
144
166
|
// This is not needed for UserOps
|
|
145
167
|
const isOwnableOrENS = !signers.module ||
|
|
146
168
|
signers.module?.toLowerCase() === OWNABLE_VALIDATOR_ADDRESS ||
|
|
147
|
-
signers.module?.toLowerCase() ===
|
|
169
|
+
signers.module?.toLowerCase() === ENS_HCA_MODULE;
|
|
148
170
|
const updateV = isOwnableOrENS && !isUserOpHash;
|
|
149
171
|
const signatures = await Promise.all(signers.accounts.map((account) => signEcdsWithChain(account, params, updateV, chain)));
|
|
150
172
|
return concat(signatures);
|
|
151
173
|
}
|
|
152
174
|
case 'passkey': {
|
|
153
175
|
const signatures = await Promise.all(signers.accounts.map((account) => signingFunctions.signPasskey(account, params)));
|
|
154
|
-
|
|
155
|
-
const credIds = signers.accounts.map((account) => {
|
|
156
|
-
const publicKey = account.publicKey;
|
|
157
|
-
const { x, y } = parsePublicKey(publicKey);
|
|
158
|
-
return generateCredentialId(x, y, address);
|
|
159
|
-
});
|
|
160
|
-
const webAuthns = signatures.map((signature) => {
|
|
161
|
-
const { r, s } = parseSignature(signature.signature);
|
|
162
|
-
return {
|
|
163
|
-
authenticatorData: signature.webauthn.authenticatorData,
|
|
164
|
-
clientDataJSON: signature.webauthn.clientDataJSON,
|
|
165
|
-
challengeIndex: BigInt(signature.webauthn.challengeIndex ?? 0),
|
|
166
|
-
typeIndex: BigInt(signature.webauthn.typeIndex ?? 0),
|
|
167
|
-
r,
|
|
168
|
-
s,
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
if (signers.module?.toLowerCase() === WEBAUTHN_V0_VALIDATOR_ADDRESS) {
|
|
172
|
-
return packPasskeySignatureV0(webAuthns[0], usePrecompile);
|
|
173
|
-
}
|
|
174
|
-
return packPasskeySignature(credIds, usePrecompile, webAuthns);
|
|
176
|
+
return packPasskeyOwnerSignatures(chain, address, signers.accounts.map((account) => account.publicKey), signatures, signers.module);
|
|
175
177
|
}
|
|
176
178
|
case 'multi-factor': {
|
|
177
179
|
return signWithMultiFactorAuth(signers, chain, address, params, isUserOpHash, signMain);
|
|
@@ -181,4 +183,4 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
|
-
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession,
|
|
186
|
+
export { convertOwnerSetToSignerSet, packMultiFactorOwnerSignatures, packPasskeyOwnerSignatures, signWithMultiFactorAuth, signWithSession, signWithOwners, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAQ5C,KAAK,iBAAiB,GAAG,SAAS,GAAG,wBAAwB,CAAA;AAE7D,iBAAe,IAAI,CACjB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CA4Bd;AA4BD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { concat, parseSignature, toHex, } from 'viem';
|
|
2
2
|
import { SigningNotSupportedForAccountError } from '../error.js';
|
|
3
|
-
import {
|
|
3
|
+
import { signWithOwners, signWithSession, } from './common.js';
|
|
4
4
|
async function sign(signers, chain, address, hash, isUserOpHash) {
|
|
5
5
|
const signingFunctions = {
|
|
6
6
|
signEcdsa: (account, hash, updateV) => signEcdsa(account, hash, updateV),
|
|
@@ -13,9 +13,6 @@ async function sign(signers, chain, address, hash, isUserOpHash) {
|
|
|
13
13
|
case 'experimental_session': {
|
|
14
14
|
return signWithSession(signers, chain, address, hash, sign);
|
|
15
15
|
}
|
|
16
|
-
case 'guardians': {
|
|
17
|
-
return signWithGuardians(signers, hash, signingFunctions);
|
|
18
|
-
}
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
async function signEcdsa(account, hash, updateV) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,SAAS,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,SAAS,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAI5C,iBAAe,IAAI,CACjB,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACjE,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,EAEtE,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,uBAAuB,CAAC,SAAS,EAAE,WAAW,CAAC,GAC1D,OAAO,CAAC,GAAG,CAAC,CAwBd;AA6BD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SigningNotSupportedForAccountError } from '../error.js';
|
|
2
|
-
import {
|
|
2
|
+
import { signWithOwners } from './common.js';
|
|
3
3
|
async function sign(signers, chain, address, parameters) {
|
|
4
4
|
const signingFunctions = {
|
|
5
5
|
signEcdsa: (account, params) => signEcdsa(account, params),
|
|
@@ -9,9 +9,6 @@ async function sign(signers, chain, address, parameters) {
|
|
|
9
9
|
case 'owner': {
|
|
10
10
|
return signWithOwners(signers, chain, address, parameters, signingFunctions, false, sign);
|
|
11
11
|
}
|
|
12
|
-
case 'guardians': {
|
|
13
|
-
return signWithGuardians(signers, parameters, signingFunctions);
|
|
14
|
-
}
|
|
15
12
|
case 'experimental_session': {
|
|
16
13
|
throw new Error('Not supported');
|
|
17
14
|
}
|
|
@@ -21,6 +21,5 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
21
21
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
22
22
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
23
23
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
24
|
-
|
|
25
|
-
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
24
|
+
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, };
|
|
26
25
|
//# sourceMappingURL=startale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startale.d.ts","sourceRoot":"","sources":["../../../accounts/startale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAc7D,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,KAAK,EAEV,QAAQ,EACR,uBAAuB,EAExB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"startale.d.ts","sourceRoot":"","sources":["../../../accounts/startale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAc7D,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,KAAK,EAEV,QAAQ,EACR,uBAAuB,EAExB,MAAM,UAAU,CAAA;AAOjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,QAAA,MAAM,4BAA4B,EAAE,OACU,CAAA;AAW9C,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;SAwErD;AAoFD,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAmClD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK;;;;;;EAWrE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBAErC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAQvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,oKAUlC;AAED,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,GAChB,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { concat, decodeFunctionData, encodeAbiParameters, encodeFunctionData, encodePacked, keccak256, parseAbi, slice, zeroAddress, zeroHash, } from 'viem';
|
|
2
2
|
import { getSetup as getModuleSetup } from '../modules/index.js';
|
|
3
3
|
import { getOwnerValidator } from '../modules/validators/core.js';
|
|
4
|
-
import { AccountConfigurationNotSupportedError
|
|
5
|
-
import {
|
|
4
|
+
import { AccountConfigurationNotSupportedError } from './error.js';
|
|
5
|
+
import { getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, packSignature as packNexusSignature, } from './nexus.js';
|
|
6
6
|
const K1_DEFAULT_VALIDATOR_ADDRESS = '0x00000072f286204bb934ed49d8969e86f7dec7b1';
|
|
7
7
|
const STARTALE_VERSION = '1.0.0';
|
|
8
8
|
const IMPLEMENTATION_ADDRESS = '0x000000b8f5f723a680d3d7ee624fe0bc84a6e05a';
|
|
@@ -165,9 +165,9 @@ function getAddress(config) {
|
|
|
165
165
|
return address;
|
|
166
166
|
}
|
|
167
167
|
function getEip712Domain(config, chain) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
// Works for adopted accounts too: getAddress resolves the initData cases
|
|
169
|
+
// (returns initData.address, or recomputes the CREATE2 address from
|
|
170
|
+
// initData.factory/factoryData).
|
|
171
171
|
return {
|
|
172
172
|
name: 'Startale',
|
|
173
173
|
version: STARTALE_VERSION,
|
|
@@ -185,7 +185,4 @@ async function packSignature(signature, validator, transformSignature = (signatu
|
|
|
185
185
|
async function getSmartAccount(client, address, owners, validatorAddress, sign) {
|
|
186
186
|
return getNexusSmartAccount(client, address, owners, validatorAddress, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
return getNexusGuardianSmartAccount(client, address, guardians, validatorAddress, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
190
|
-
}
|
|
191
|
-
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
188
|
+
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { encodeFunctionData } from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { getModuleUninstallationCalls, getValidatorInstallationCalls, } from '../accounts/index.js';
|
|
3
3
|
import { getOwnableValidator, OWNABLE_VALIDATOR_ADDRESS, } from '../modules/validators/core.js';
|
|
4
4
|
/**
|
|
5
5
|
* Enable ECDSA authentication
|
|
@@ -10,8 +10,8 @@ import { getOwnableValidator, OWNABLE_VALIDATOR_ADDRESS, } from '../modules/vali
|
|
|
10
10
|
function enable(owners, threshold = 1) {
|
|
11
11
|
const module = getOwnableValidator(threshold, owners);
|
|
12
12
|
return {
|
|
13
|
-
async resolve({ config }) {
|
|
14
|
-
return
|
|
13
|
+
async resolve({ chain, config }) {
|
|
14
|
+
return getValidatorInstallationCalls(config, chain, module);
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -22,8 +22,8 @@ function enable(owners, threshold = 1) {
|
|
|
22
22
|
function disable() {
|
|
23
23
|
const module = getOwnableValidator(1, []);
|
|
24
24
|
return {
|
|
25
|
-
async resolve({ config }) {
|
|
26
|
-
return getModuleUninstallationCalls(config, module);
|
|
25
|
+
async resolve({ chain, config }) {
|
|
26
|
+
return getModuleUninstallationCalls(config, chain, module);
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
}
|
|
@@ -21,8 +21,8 @@ function installModule(module) {
|
|
|
21
21
|
function uninstallModule(module) {
|
|
22
22
|
const moduleData = getModule(module);
|
|
23
23
|
return {
|
|
24
|
-
async resolve({ config }) {
|
|
25
|
-
return getModuleUninstallationCalls(config, moduleData);
|
|
24
|
+
async resolve({ chain, config }) {
|
|
25
|
+
return getModuleUninstallationCalls(config, chain, moduleData);
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
}
|
package/dist/src/actions/mfa.js
CHANGED
|
@@ -47,8 +47,8 @@ function changeThreshold(newThreshold) {
|
|
|
47
47
|
function disable() {
|
|
48
48
|
const module = getMultiFactorValidator(1, []);
|
|
49
49
|
return {
|
|
50
|
-
async resolve({ config }) {
|
|
51
|
-
return getModuleUninstallationCalls(config, module);
|
|
50
|
+
async resolve({ chain, config }) {
|
|
51
|
+
return getModuleUninstallationCalls(config, chain, module);
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { LazyCallInput,
|
|
1
|
+
import { type Hex } from 'viem';
|
|
2
|
+
import type { LazyCallInput, Session } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Enable smart sessions
|
|
5
5
|
* @returns Calls to enable smart sessions
|
|
@@ -12,12 +12,36 @@ declare function experimental_enable(): LazyCallInput;
|
|
|
12
12
|
declare function experimental_disable(): LazyCallInput;
|
|
13
13
|
/**
|
|
14
14
|
* Enable a smart session
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
|
+
* The `session` must be a resolved `Session` (the return value of
|
|
17
|
+
* `toSession(...)`). Re-resolving it here would drop the explicit
|
|
18
|
+
* `permissions` — a `Session` only carries the derived `actions`, not the
|
|
19
|
+
* original `SessionDefinition.permissions` — which makes the on-chain digest
|
|
20
|
+
* computed by `SmartSessionLens.getAndVerifyDigest` diverge from the one
|
|
21
|
+
* signed in `getSessionDetails`, causing the emissary to reject the enable.
|
|
22
|
+
*
|
|
23
|
+
* @param session resolved session to enable
|
|
16
24
|
* @returns Calls to enable the smart session
|
|
17
25
|
*/
|
|
18
|
-
declare function experimental_enableSession(session:
|
|
26
|
+
declare function experimental_enableSession(session: Session, enableSessionSignature: Hex, hashesAndChainIds: {
|
|
19
27
|
chainId: bigint;
|
|
20
28
|
sessionDigest: Hex;
|
|
21
29
|
}[], sessionToEnableIndex: number): LazyCallInput;
|
|
22
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Disable a smart session
|
|
32
|
+
*
|
|
33
|
+
* Removes a single session from the smart-session emissary via `removeConfig`.
|
|
34
|
+
* The account executes the call itself, so the emissary skips the disable
|
|
35
|
+
* user-signature — the user authorizes it by signing the outer transaction as
|
|
36
|
+
* usual (no separate, blind session-digest signature). The `session` must be a
|
|
37
|
+
* resolved `Session` (the return value of `toSession(...)`) on the chain where
|
|
38
|
+
* the session is being disabled.
|
|
39
|
+
*
|
|
40
|
+
* @param session resolved session to disable
|
|
41
|
+
* @param expires optional deadline after which this disable call is no longer
|
|
42
|
+
* valid; must be in the future. Omit for no expiry.
|
|
43
|
+
* @returns Calls to disable the smart session
|
|
44
|
+
*/
|
|
45
|
+
declare function experimental_disableSession(session: Session, expires?: Date): LazyCallInput;
|
|
46
|
+
export { experimental_disable, experimental_disableSession, experimental_enable, experimental_enableSession, };
|
|
23
47
|
//# sourceMappingURL=smart-sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../actions/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../actions/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAc,MAAM,MAAM,CAAA;AAU3C,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEtD;;;GAGG;AACH,iBAAS,mBAAmB,IAAI,aAAa,CAU5C;AAED;;;GAGG;AACH,iBAAS,oBAAoB,IAAI,aAAa,CAU7C;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,0BAA0B,CACjC,OAAO,EAAE,OAAO,EAChB,sBAAsB,EAAE,GAAG,EAC3B,iBAAiB,EAAE;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,GAAG,CAAA;CACnB,EAAE,EACH,oBAAoB,EAAE,MAAM,GAC3B,aAAa,CAaf;AAED;;;;;;;;;;;;;;GAcG;AACH,iBAAS,2BAA2B,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,IAAI,GACb,aAAa,CAYf;AAED,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,0BAA0B,GAC3B,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { maxUint256 } from 'viem';
|
|
1
2
|
import { getModuleInstallationCalls, getModuleUninstallationCalls, } from '../accounts/index.js';
|
|
2
|
-
import { getEnableSessionCall, getSmartSessionValidator,
|
|
3
|
+
import { getDisableSessionCall, getEnableSessionCall, getSmartSessionValidator, } from '../modules/validators/smart-sessions.js';
|
|
3
4
|
/**
|
|
4
5
|
* Enable smart sessions
|
|
5
6
|
* @returns Calls to enable smart sessions
|
|
@@ -21,28 +22,55 @@ function experimental_enable() {
|
|
|
21
22
|
*/
|
|
22
23
|
function experimental_disable() {
|
|
23
24
|
return {
|
|
24
|
-
async resolve({ config }) {
|
|
25
|
+
async resolve({ chain, config }) {
|
|
25
26
|
const module = getSmartSessionValidator(config);
|
|
26
27
|
if (!module) {
|
|
27
28
|
return [];
|
|
28
29
|
}
|
|
29
|
-
return getModuleUninstallationCalls(config, module);
|
|
30
|
+
return getModuleUninstallationCalls(config, chain, module);
|
|
30
31
|
},
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Enable a smart session
|
|
35
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* The `session` must be a resolved `Session` (the return value of
|
|
38
|
+
* `toSession(...)`). Re-resolving it here would drop the explicit
|
|
39
|
+
* `permissions` — a `Session` only carries the derived `actions`, not the
|
|
40
|
+
* original `SessionDefinition.permissions` — which makes the on-chain digest
|
|
41
|
+
* computed by `SmartSessionLens.getAndVerifyDigest` diverge from the one
|
|
42
|
+
* signed in `getSessionDetails`, causing the emissary to reject the enable.
|
|
43
|
+
*
|
|
44
|
+
* @param session resolved session to enable
|
|
36
45
|
* @returns Calls to enable the smart session
|
|
37
46
|
*/
|
|
38
47
|
function experimental_enableSession(session, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex) {
|
|
39
48
|
return {
|
|
40
|
-
async resolve({ accountAddress,
|
|
41
|
-
return getEnableSessionCall(accountAddress,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
async resolve({ accountAddress, config }) {
|
|
50
|
+
return getEnableSessionCall(accountAddress, session, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex, config.useDevContracts);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Disable a smart session
|
|
56
|
+
*
|
|
57
|
+
* Removes a single session from the smart-session emissary via `removeConfig`.
|
|
58
|
+
* The account executes the call itself, so the emissary skips the disable
|
|
59
|
+
* user-signature — the user authorizes it by signing the outer transaction as
|
|
60
|
+
* usual (no separate, blind session-digest signature). The `session` must be a
|
|
61
|
+
* resolved `Session` (the return value of `toSession(...)`) on the chain where
|
|
62
|
+
* the session is being disabled.
|
|
63
|
+
*
|
|
64
|
+
* @param session resolved session to disable
|
|
65
|
+
* @param expires optional deadline after which this disable call is no longer
|
|
66
|
+
* valid; must be in the future. Omit for no expiry.
|
|
67
|
+
* @returns Calls to disable the smart session
|
|
68
|
+
*/
|
|
69
|
+
function experimental_disableSession(session, expires) {
|
|
70
|
+
return {
|
|
71
|
+
async resolve({ accountAddress, config }) {
|
|
72
|
+
return getDisableSessionCall(accountAddress, session, expires ? BigInt(Math.floor(expires.getTime() / 1000)) : maxUint256, config.provider, config.useDevContracts);
|
|
45
73
|
},
|
|
46
74
|
};
|
|
47
75
|
}
|
|
48
|
-
export { experimental_disable, experimental_enable, experimental_enableSession };
|
|
76
|
+
export { experimental_disable, experimental_disableSession, experimental_enable, experimental_enableSession, };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError,
|
|
2
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError,
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { AccountConfigurationNotSupportedError, AccountError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError } from '../accounts/index.js';
|
|
2
|
+
import { Eip7702InitSignatureRequiredError, ExecutionError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, isExecutionError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError } from '../execution/index.js';
|
|
3
|
+
import type { ErrorDetail } from '../orchestrator/index.js';
|
|
4
|
+
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isSimulationFailed, isValidationError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, SimulationFailedError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError } from '../orchestrator/index.js';
|
|
5
|
+
export type { ErrorDetail };
|
|
6
|
+
export { isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isSimulationFailed, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SimulationFailedError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, ValidationError, UnsupportedChainError, UnsupportedTokenError, };
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,uCAAuC,EACvC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,cAAc,EACd,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,iCAAiC,EACjC,cAAc,EACd,mCAAmC,EACnC,gCAAgC,EAChC,iBAAiB,EACjB,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC9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qB,EACrB,qBAAqB,GACtB,CAAA"}
|
package/dist/src/errors/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError,
|
|
2
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError,
|
|
3
|
-
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, } from '../orchestrator/index.js';
|
|
1
|
+
import { AccountConfigurationNotSupportedError, AccountError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, } from '../accounts/index.js';
|
|
2
|
+
import { Eip7702InitSignatureRequiredError, ExecutionError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, isExecutionError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError, } from '../execution/index.js';
|
|
3
|
+
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isSimulationFailed, isValidationError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, SimulationFailedError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, } from '../orchestrator/index.js';
|
|
4
4
|
export {
|
|
5
5
|
// Account
|
|
6
|
-
isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, EoaAccountMustHaveAccountError,
|
|
6
|
+
isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError,
|
|
7
7
|
// Execution
|
|
8
|
-
isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError,
|
|
8
|
+
isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError,
|
|
9
9
|
// Orchestrator
|
|
10
|
-
isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, ValidationError,
|
|
10
|
+
isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isSimulationFailed, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SimulationFailedError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, ValidationError,
|
|
11
11
|
// Registry (SDK-local validation)
|
|
12
12
|
UnsupportedChainError, UnsupportedTokenError, };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Hex } from 'viem';
|
|
1
2
|
declare class ExecutionError extends Error {
|
|
2
3
|
private readonly _message;
|
|
3
4
|
private readonly _context;
|
|
@@ -14,52 +15,82 @@ declare class ExecutionError extends Error {
|
|
|
14
15
|
get errorType(): string;
|
|
15
16
|
get traceId(): string;
|
|
16
17
|
}
|
|
17
|
-
declare class
|
|
18
|
+
declare class OrderPathRequiredForIntentsError extends ExecutionError {
|
|
18
19
|
constructor(params?: {
|
|
19
20
|
context?: any;
|
|
20
21
|
errorType?: string;
|
|
21
22
|
traceId?: string;
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
declare class
|
|
25
|
+
declare class IntentFailedError extends ExecutionError {
|
|
25
26
|
constructor(params?: {
|
|
27
|
+
intentId?: string;
|
|
26
28
|
context?: any;
|
|
27
29
|
errorType?: string;
|
|
28
30
|
traceId?: string;
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
|
-
declare class
|
|
33
|
+
declare class QuoteNotInPreparedTransactionError extends ExecutionError {
|
|
32
34
|
constructor(params?: {
|
|
33
|
-
context?:
|
|
35
|
+
context?: {
|
|
36
|
+
intentId?: string;
|
|
37
|
+
};
|
|
34
38
|
errorType?: string;
|
|
35
39
|
traceId?: string;
|
|
36
40
|
});
|
|
37
41
|
}
|
|
38
|
-
declare class
|
|
42
|
+
declare class InvalidSourceCallsError extends ExecutionError {
|
|
39
43
|
constructor(params?: {
|
|
40
|
-
|
|
44
|
+
chainId?: number;
|
|
41
45
|
context?: any;
|
|
42
46
|
errorType?: string;
|
|
43
47
|
traceId?: string;
|
|
44
48
|
});
|
|
45
49
|
}
|
|
46
|
-
declare class
|
|
50
|
+
declare class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
47
51
|
constructor(params?: {
|
|
48
52
|
context?: any;
|
|
49
53
|
errorType?: string;
|
|
50
54
|
traceId?: string;
|
|
51
55
|
});
|
|
52
56
|
}
|
|
53
|
-
declare class
|
|
57
|
+
declare class UnknownOwnerError extends ExecutionError {
|
|
54
58
|
constructor(params?: {
|
|
55
59
|
context?: {
|
|
56
|
-
|
|
60
|
+
signer?: string;
|
|
61
|
+
publicKey?: string;
|
|
62
|
+
validatorId?: number | Hex;
|
|
57
63
|
};
|
|
58
64
|
errorType?: string;
|
|
59
65
|
traceId?: string;
|
|
60
66
|
});
|
|
61
67
|
}
|
|
62
|
-
declare class
|
|
68
|
+
declare class MismatchedOwnerSignaturesError extends ExecutionError {
|
|
69
|
+
constructor(params?: {
|
|
70
|
+
message?: string;
|
|
71
|
+
context?: any;
|
|
72
|
+
errorType?: string;
|
|
73
|
+
traceId?: string;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
declare class InsufficientOwnerSignaturesError extends ExecutionError {
|
|
77
|
+
constructor(params?: {
|
|
78
|
+
required?: number;
|
|
79
|
+
provided?: number;
|
|
80
|
+
validatorId?: number | Hex;
|
|
81
|
+
context?: any;
|
|
82
|
+
errorType?: string;
|
|
83
|
+
traceId?: string;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
declare class InvalidOwnerSigningOptionsError extends ExecutionError {
|
|
87
|
+
constructor(params?: {
|
|
88
|
+
context?: any;
|
|
89
|
+
errorType?: string;
|
|
90
|
+
traceId?: string;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
declare class IndependentSigningNotSupportedError extends ExecutionError {
|
|
63
94
|
constructor(params?: {
|
|
64
95
|
context?: any;
|
|
65
96
|
errorType?: string;
|
|
@@ -67,5 +98,5 @@ declare class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
|
67
98
|
});
|
|
68
99
|
}
|
|
69
100
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
70
|
-
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError,
|
|
101
|
+
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, IntentFailedError, UnknownOwnerError, };
|
|
71
102
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE/B,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,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