@rhinestone/sdk 2.0.0-beta.40 → 2.0.0-beta.42
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/index.d.ts +16 -3
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +57 -42
- package/dist/src/accounts/signing/common.d.ts +10 -1
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +41 -36
- package/dist/src/errors/index.d.ts +5 -5
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +4 -4
- package/dist/src/execution/error.d.ts +45 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +53 -1
- package/dist/src/execution/index.d.ts +3 -2
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +5 -5
- package/dist/src/execution/utils.d.ts +42 -5
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +360 -9
- package/dist/src/index.d.ts +26 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -1
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/dist/src/orchestrator/error.d.ts +67 -2
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +123 -6
- package/dist/src/orchestrator/index.d.ts +4 -4
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +2 -2
- package/dist/src/orchestrator/types.d.ts +6 -0
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/wire.gen.d.ts +1486 -27
- package/dist/src/orchestrator/wire.gen.d.ts.map +1 -1
- package/dist/src/types.d.ts +10 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type Address, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type TypedData } from 'viem';
|
|
1
|
+
import { type Account, type Address, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type TypedData } from 'viem';
|
|
2
|
+
import type { WebAuthnAccount } from 'viem/account-abstraction';
|
|
2
3
|
import { type Module } from '../modules/common.js';
|
|
3
4
|
import type { ResolvedSessionSignerSet } from '../modules/validators/smart-sessions.js';
|
|
4
5
|
import type { AccountProviderConfig, Call, RhinestoneConfig, SignerSet } from '../types.js';
|
|
@@ -34,9 +35,21 @@ declare function getValidatorInstallationCalls(config: RhinestoneConfig, chain:
|
|
|
34
35
|
declare function getModuleUninstallationCalls(config: RhinestoneConfig, chain: Chain, module: Module): Promise<Call[]>;
|
|
35
36
|
declare function getAddress(config: RhinestoneConfig): `0x${string}`;
|
|
36
37
|
declare function checkAddress(config: RhinestoneConfig): boolean;
|
|
38
|
+
declare function packAccountSignature(config: RhinestoneConfig, signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
37
39
|
declare function getEip1271Signature(config: RhinestoneConfig, signers: InternalSignerSet | undefined, chain: Chain, validator: ValidatorConfig, hash: Hex, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
38
40
|
declare function getEmissarySignature(config: RhinestoneConfig, signers: InternalSignerSet | undefined, chain: Chain, hash: Hex, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
39
41
|
declare function getTypedDataPackedSignature<typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(config: RhinestoneConfig, signers: InternalSignerSet | undefined, chain: Chain, validator: ValidatorConfig, parameters: HashTypedDataParameters<typedData, primaryType>, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
42
|
+
declare function getOwnerEcdsaSignature<typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(config: RhinestoneConfig, chain: Chain, parameters: HashTypedDataParameters<typedData, primaryType>, owner: Account, module: Address | undefined, validatorSupportsEip712: boolean): Promise<Hex>;
|
|
43
|
+
declare function getOwnerPasskeySignature<typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(config: RhinestoneConfig, parameters: HashTypedDataParameters<typedData, primaryType>, owner: WebAuthnAccount, validatorSupportsEip712: boolean): Promise<{
|
|
44
|
+
webauthn: {
|
|
45
|
+
authenticatorData: Hex;
|
|
46
|
+
clientDataJSON: string;
|
|
47
|
+
challengeIndex?: number | undefined;
|
|
48
|
+
typeIndex?: number | undefined;
|
|
49
|
+
userVerificationRequired?: boolean | undefined;
|
|
50
|
+
};
|
|
51
|
+
signature: Hex;
|
|
52
|
+
}>;
|
|
40
53
|
declare function isDeployed(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
41
54
|
declare function deploy(config: RhinestoneConfig, chain: Chain, params?: {
|
|
42
55
|
sponsored?: boolean;
|
|
@@ -44,8 +57,8 @@ declare function deploy(config: RhinestoneConfig, chain: Chain, params?: {
|
|
|
44
57
|
}): Promise<boolean>;
|
|
45
58
|
declare function setup(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
46
59
|
declare function toErc6492Signature(config: RhinestoneConfig, signature: Hex, chain: Chain): Promise<Hex>;
|
|
47
|
-
declare function getSmartAccount(config: RhinestoneConfig, client: PublicClient, chain: Chain): Promise<import("viem/
|
|
60
|
+
declare function getSmartAccount(config: RhinestoneConfig, client: PublicClient, chain: Chain): Promise<import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | undefined>;
|
|
48
61
|
declare function is7702(config: RhinestoneConfig): boolean;
|
|
49
62
|
declare function getAccountProvider(config: RhinestoneConfig): AccountProviderConfig;
|
|
50
|
-
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature, isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, };
|
|
63
|
+
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getEip1271Signature, getEmissarySignature, getOwnerEcdsaSignature, getOwnerPasskeySignature, getTypedDataPackedSignature, packAccountSignature, isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, };
|
|
51
64
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAGR,KAAK,YAAY,EAEjB,KAAK,SAAS,EAEf,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAA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2B,EAC3B,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,mCAAmC,GACpC,CAAA"}
|
|
@@ -337,35 +337,23 @@ function checkAddress(config) {
|
|
|
337
337
|
}
|
|
338
338
|
return initData.address.toLowerCase() === getAddress(config).toLowerCase();
|
|
339
339
|
}
|
|
340
|
-
|
|
341
|
-
async function getEip1271Signature(config, signers, chain, validator, hash, transformSignature = (signature) => signature) {
|
|
342
|
-
if (config.account?.type === 'eoa') {
|
|
343
|
-
throw new EoaSigningNotSupportedError('packed signatures');
|
|
344
|
-
}
|
|
345
|
-
signers = signers ?? convertOwnerSetToSignerSet(config.owners);
|
|
346
|
-
const signFn = (hash) => signMessage(signers, chain, address, hash, false);
|
|
340
|
+
async function packAccountSignature(config, signature, validator, transformSignature = (signature) => signature) {
|
|
347
341
|
const account = getAccountProvider(config);
|
|
348
|
-
const address = getAddress(config);
|
|
349
342
|
switch (account.type) {
|
|
350
343
|
case 'safe': {
|
|
351
|
-
const signature = await signFn(hash);
|
|
352
344
|
return packSafeSignature(signature, validator, transformSignature);
|
|
353
345
|
}
|
|
354
346
|
case 'nexus': {
|
|
355
|
-
const signature = await signFn(hash);
|
|
356
347
|
const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
|
|
357
348
|
return packNexusSignature(signature, validator, transformSignature, defaultValidatorAddress);
|
|
358
349
|
}
|
|
359
350
|
case 'kernel': {
|
|
360
|
-
const signature = await signFn(wrapKernelMessageHash(hash, address));
|
|
361
351
|
return packKernelSignature(signature, validator, transformSignature);
|
|
362
352
|
}
|
|
363
353
|
case 'startale': {
|
|
364
|
-
const signature = await signFn(hash);
|
|
365
354
|
return packStartaleSignature(signature, validator, transformSignature);
|
|
366
355
|
}
|
|
367
356
|
case 'hca': {
|
|
368
|
-
const signature = await signFn(hash);
|
|
369
357
|
return packHcaSignature(signature, validator, transformSignature);
|
|
370
358
|
}
|
|
371
359
|
default: {
|
|
@@ -373,6 +361,17 @@ async function getEip1271Signature(config, signers, chain, validator, hash, tran
|
|
|
373
361
|
}
|
|
374
362
|
}
|
|
375
363
|
}
|
|
364
|
+
async function getEip1271Signature(config, signers, chain, validator, hash, transformSignature = (signature) => signature) {
|
|
365
|
+
if (config.account?.type === 'eoa') {
|
|
366
|
+
throw new EoaSigningNotSupportedError('packed signatures');
|
|
367
|
+
}
|
|
368
|
+
signers = signers ?? convertOwnerSetToSignerSet(config.owners);
|
|
369
|
+
const account = getAccountProvider(config);
|
|
370
|
+
const address = getAddress(config);
|
|
371
|
+
const signedHash = account.type === 'kernel' ? wrapKernelMessageHash(hash, address) : hash;
|
|
372
|
+
const signature = await signMessage(signers, chain, address, signedHash, false);
|
|
373
|
+
return packAccountSignature(config, signature, validator, transformSignature);
|
|
374
|
+
}
|
|
376
375
|
// Signs and packs a signature to be used by the emissary validator
|
|
377
376
|
async function getEmissarySignature(config, signers, chain, hash, transformSignature = (signature) => signature) {
|
|
378
377
|
if (config.account?.type === 'eoa') {
|
|
@@ -391,36 +390,52 @@ async function getTypedDataPackedSignature(config, signers, chain, validator, pa
|
|
|
391
390
|
}
|
|
392
391
|
const address = getAddress(config);
|
|
393
392
|
signers = signers ?? convertOwnerSetToSignerSet(config.owners);
|
|
394
|
-
const signFn = (parameters) => signTypedData(signers, chain, address, parameters);
|
|
395
393
|
const account = getAccountProvider(config);
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
394
|
+
const signature = account.type === 'kernel'
|
|
395
|
+
? await signMessage(signers, chain, address, wrapKernelMessageHash(hashTypedData(parameters), address), false)
|
|
396
|
+
: await signTypedData(signers, chain, address, parameters);
|
|
397
|
+
return packAccountSignature(config, signature, validator, transformSignature);
|
|
398
|
+
}
|
|
399
|
+
async function getOwnerEcdsaSignature(config, chain, parameters, owner, module, validatorSupportsEip712) {
|
|
400
|
+
if (config.account?.type === 'eoa') {
|
|
401
|
+
throw new EoaSigningNotSupportedError('packed signatures');
|
|
402
|
+
}
|
|
403
|
+
const address = getAddress(config);
|
|
404
|
+
const signers = {
|
|
405
|
+
type: 'owner',
|
|
406
|
+
kind: 'ecdsa',
|
|
407
|
+
accounts: [owner],
|
|
408
|
+
module,
|
|
409
|
+
};
|
|
410
|
+
const accountProvider = getAccountProvider(config);
|
|
411
|
+
if (accountProvider.type === 'kernel') {
|
|
412
|
+
return signMessage(signers, chain, address, wrapKernelMessageHash(hashTypedData(parameters), address), false);
|
|
413
|
+
}
|
|
414
|
+
if (!validatorSupportsEip712) {
|
|
415
|
+
return signMessage(signers, chain, address, hashTypedData(parameters), false);
|
|
416
|
+
}
|
|
417
|
+
return signTypedData(signers, chain, address, parameters);
|
|
418
|
+
}
|
|
419
|
+
async function getOwnerPasskeySignature(config, parameters, owner, validatorSupportsEip712) {
|
|
420
|
+
if (config.account?.type === 'eoa') {
|
|
421
|
+
throw new EoaSigningNotSupportedError('packed signatures');
|
|
422
|
+
}
|
|
423
|
+
const address = getAddress(config);
|
|
424
|
+
const accountProvider = getAccountProvider(config);
|
|
425
|
+
if (accountProvider.type === 'kernel') {
|
|
426
|
+
const { webauthn, signature } = await owner.sign({
|
|
427
|
+
hash: wrapKernelMessageHash(hashTypedData(parameters), address),
|
|
428
|
+
});
|
|
429
|
+
return { webauthn, signature };
|
|
430
|
+
}
|
|
431
|
+
if (!validatorSupportsEip712) {
|
|
432
|
+
const { webauthn, signature } = await owner.sign({
|
|
433
|
+
hash: hashTypedData(parameters),
|
|
434
|
+
});
|
|
435
|
+
return { webauthn, signature };
|
|
423
436
|
}
|
|
437
|
+
const { webauthn, signature } = await owner.signTypedData(parameters);
|
|
438
|
+
return { webauthn, signature };
|
|
424
439
|
}
|
|
425
440
|
async function isDeployed(config, chain) {
|
|
426
441
|
const account = getAccountProvider(config);
|
|
@@ -660,6 +675,6 @@ function getAccountProvider(config) {
|
|
|
660
675
|
type: 'nexus',
|
|
661
676
|
};
|
|
662
677
|
}
|
|
663
|
-
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature,
|
|
678
|
+
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getEip1271Signature, getEmissarySignature, getOwnerEcdsaSignature, getOwnerPasskeySignature, getTypedDataPackedSignature, packAccountSignature,
|
|
664
679
|
// Errors
|
|
665
680
|
isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, };
|
|
@@ -21,9 +21,18 @@ declare function signWithMultiFactorAuth<T>(signers: SignerSet & {
|
|
|
21
21
|
type: 'owner';
|
|
22
22
|
kind: 'multi-factor';
|
|
23
23
|
}, chain: Chain, address: Address, params: T, isUserOpHash: boolean, signMain: (signers: SignerSet, chain: Chain, address: Address, params: T, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
24
|
+
declare function packMultiFactorOwnerSignatures(entries: {
|
|
25
|
+
id: number | Hex;
|
|
26
|
+
validatorAddress: Address;
|
|
27
|
+
signature: Hex;
|
|
28
|
+
}[]): Hex;
|
|
29
|
+
declare function packPasskeyOwnerSignatures(chain: Chain, address: Address, publicKeys: Hex[], signatures: {
|
|
30
|
+
webauthn: WebAuthnSignMetadata;
|
|
31
|
+
signature: Hex;
|
|
32
|
+
}[], module?: Address): Hex;
|
|
24
33
|
declare function signWithSession(signers: ResolvedSessionSignerSet, chain: Chain, address: Address, hash: Hex, signMain: (signers: SignerSet, chain: Chain, address: Address, hash: Hex, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
25
34
|
declare function signWithOwners<T>(signers: SignerSet & {
|
|
26
35
|
type: 'owner';
|
|
27
36
|
}, chain: Chain, address: Address, params: T, signingFunctions: SigningFunctions<T>, isUserOpHash: boolean, signMain: (signers: SignerSet, chain: Chain, address: Address, params: T, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
28
|
-
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession, signWithOwners, type SigningFunctions, };
|
|
37
|
+
export { convertOwnerSetToSignerSet, packMultiFactorOwnerSignatures, packPasskeyOwnerSignatures, signWithMultiFactorAuth, signWithSession, signWithOwners, type SigningFunctions, };
|
|
29
38
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EAMV,KAAK,GAAG,EAKT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAQ/D,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,E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AAC,GAChB,OAAO,CAAC,GAAG,CAAC,CAuEd;AAED,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,KAAK,gBAAgB,GACtB,CAAA"}
|
|
@@ -77,7 +77,14 @@ async function signWithMultiFactorAuth(signers, chain, address, params, isUserOp
|
|
|
77
77
|
const validatorSigners = convertOwnerSetToSignerSet(validator);
|
|
78
78
|
return signMain(validatorSigners, chain, address, params, isUserOpHash);
|
|
79
79
|
}));
|
|
80
|
-
|
|
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([
|
|
81
88
|
{
|
|
82
89
|
components: [
|
|
83
90
|
{
|
|
@@ -91,20 +98,38 @@ async function signWithMultiFactorAuth(signers, chain, address, params, isUserOp
|
|
|
91
98
|
type: 'tuple[]',
|
|
92
99
|
},
|
|
93
100
|
], [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
data: signatures[index],
|
|
104
|
-
};
|
|
105
|
-
}),
|
|
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
|
+
})),
|
|
106
110
|
]);
|
|
107
|
-
|
|
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);
|
|
108
133
|
}
|
|
109
134
|
async function signWithSession(signers, chain, address, hash, signMain) {
|
|
110
135
|
const sessionSigners = convertOwnerSetToSignerSet(signers.session.owners);
|
|
@@ -148,27 +173,7 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
148
173
|
}
|
|
149
174
|
case 'passkey': {
|
|
150
175
|
const signatures = await Promise.all(signers.accounts.map((account) => signingFunctions.signPasskey(account, params)));
|
|
151
|
-
|
|
152
|
-
const credIds = signers.accounts.map((account) => {
|
|
153
|
-
const publicKey = account.publicKey;
|
|
154
|
-
const { x, y } = parsePublicKey(publicKey);
|
|
155
|
-
return generateCredentialId(x, y, address);
|
|
156
|
-
});
|
|
157
|
-
const webAuthns = signatures.map((signature) => {
|
|
158
|
-
const { r, s } = parseSignature(signature.signature);
|
|
159
|
-
return {
|
|
160
|
-
authenticatorData: signature.webauthn.authenticatorData,
|
|
161
|
-
clientDataJSON: signature.webauthn.clientDataJSON,
|
|
162
|
-
challengeIndex: BigInt(signature.webauthn.challengeIndex ?? 0),
|
|
163
|
-
typeIndex: BigInt(signature.webauthn.typeIndex ?? 0),
|
|
164
|
-
r,
|
|
165
|
-
s,
|
|
166
|
-
};
|
|
167
|
-
});
|
|
168
|
-
if (signers.module?.toLowerCase() === WEBAUTHN_V0_VALIDATOR_ADDRESS) {
|
|
169
|
-
return packPasskeySignatureV0(webAuthns[0], usePrecompile);
|
|
170
|
-
}
|
|
171
|
-
return packPasskeySignature(credIds, usePrecompile, webAuthns);
|
|
176
|
+
return packPasskeyOwnerSignatures(chain, address, signers.accounts.map((account) => account.publicKey), signatures, signers.module);
|
|
172
177
|
}
|
|
173
178
|
case 'multi-factor': {
|
|
174
179
|
return signWithMultiFactorAuth(signers, chain, address, params, isUserOpHash, signMain);
|
|
@@ -178,4 +183,4 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
178
183
|
}
|
|
179
184
|
}
|
|
180
185
|
}
|
|
181
|
-
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession, signWithOwners, };
|
|
186
|
+
export { convertOwnerSetToSignerSet, packMultiFactorOwnerSignatures, packPasskeyOwnerSignatures, signWithMultiFactorAuth, signWithSession, signWithOwners, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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, IntentFailedError, InvalidSourceCallsError, isExecutionError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError } 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, IntentFailedError, InvalidSourceCallsError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isSimulationFailed, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SimulationFailedError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, ValidationError, UnsupportedChainError, UnsupportedTokenError, };
|
|
2
|
+
import { Eip7702InitSignatureRequiredError, ExecutionError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, isExecutionError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError } from '../execution/index.js';
|
|
3
|
+
import type { ErrorDetail, SponsorLimitKey } from '../orchestrator/index.js';
|
|
4
|
+
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InsufficientSponsorBalanceError, InternalServerError, isAuthError, isInsufficientSponsorBalance, isOrchestratorError, isRateLimited, isRetryable, isSimulationFailed, isSponsorError, isSponsorLimitExceeded, isValidationError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, SimulationFailedError, SponsorLimitExceededError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError } from '../orchestrator/index.js';
|
|
5
|
+
export type { ErrorDetail, SponsorLimitKey };
|
|
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, isSponsorLimitExceeded, isInsufficientSponsorBalance, isSponsorError, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InsufficientSponsorBalanceError, InternalServerError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SimulationFailedError, SettlementExecutionError, SettlementQuoteError, SponsorLimitExceededError, UnauthorizedError, UnprocessableContentError, ValidationError, UnsupportedChainError, UnsupportedTokenError, };
|
|
7
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,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,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,gCAAgC,EAChC,kCAAkC,
|
|
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,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EAClB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,WAAW,EACX,4BAA4B,EAC5B,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EAChB,MAAM,iBAAiB,CAAA;AAExB,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA;AAE5C,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,uCAAuC,EACvC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,mCAAmC,EAEnC,gBAAgB,EAChB,cAAc,EACd,iCAAiC,EACjC,mCAAmC,EACnC,gCAAgC,EAChC,iBAAiB,EACjB,+BAA+B,EAC/B,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EAEjB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,2BAA2B,EAC3B,cAAc,EACd,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,6BAA6B,EAC7B,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,EAEf,qBAAqB,EACrB,qBAAqB,GACtB,CAAA"}
|
package/dist/src/errors/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
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, IntentFailedError, InvalidSourceCallsError, isExecutionError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, } 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';
|
|
2
|
+
import { Eip7702InitSignatureRequiredError, ExecutionError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, isExecutionError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError, } from '../execution/index.js';
|
|
3
|
+
import { ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InsufficientSponsorBalanceError, InternalServerError, isAuthError, isInsufficientSponsorBalance, isOrchestratorError, isRateLimited, isRetryable, isSimulationFailed, isSponsorError, isSponsorLimitExceeded, isValidationError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SettlementExecutionError, SettlementQuoteError, SimulationFailedError, SponsorLimitExceededError, UnauthorizedError, UnprocessableContentError, UnsupportedChainError, UnsupportedTokenError, ValidationError, } from '../orchestrator/index.js';
|
|
4
4
|
export {
|
|
5
5
|
// Account
|
|
6
6
|
isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError,
|
|
7
7
|
// Execution
|
|
8
|
-
isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IntentFailedError, InvalidSourceCallsError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError,
|
|
8
|
+
isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError,
|
|
9
9
|
// Orchestrator
|
|
10
|
-
isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isSimulationFailed, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InternalServerError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SimulationFailedError, SettlementExecutionError, SettlementQuoteError, UnauthorizedError, UnprocessableContentError, ValidationError,
|
|
10
|
+
isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isSimulationFailed, isSponsorLimitExceeded, isInsufficientSponsorBalance, isSponsorError, ConflictError, ExternalServiceTimeoutError, ForbiddenError, InsufficientLiquidityError, InsufficientSponsorBalanceError, InternalServerError, KeyScopeDeniedError, NotFoundError, OrchestratorError, RateLimitedError, RelayerMarketUnavailableError, SimulationFailedError, SettlementExecutionError, SettlementQuoteError, SponsorLimitExceededError, 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;
|
|
@@ -53,6 +54,49 @@ declare class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
|
53
54
|
traceId?: string;
|
|
54
55
|
});
|
|
55
56
|
}
|
|
57
|
+
declare class UnknownOwnerError extends ExecutionError {
|
|
58
|
+
constructor(params?: {
|
|
59
|
+
context?: {
|
|
60
|
+
signer?: string;
|
|
61
|
+
publicKey?: string;
|
|
62
|
+
validatorId?: number | Hex;
|
|
63
|
+
};
|
|
64
|
+
errorType?: string;
|
|
65
|
+
traceId?: string;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
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 {
|
|
94
|
+
constructor(params?: {
|
|
95
|
+
context?: any;
|
|
96
|
+
errorType?: string;
|
|
97
|
+
traceId?: string;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
56
100
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
57
|
-
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, InvalidSourceCallsError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, IntentFailedError, };
|
|
101
|
+
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, IntentFailedError, UnknownOwnerError, };
|
|
58
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,gCAAiC,SAAQ,cAAc;gBAC/C,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB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AO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAOF;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAE/D;AAED,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iCAAiC,EACjC,mCAAmC,EACnC,gCAAgC,EAChC,+BAA+B,EAC/B,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EACjB,iBAAiB,GAClB,CAAA"}
|
|
@@ -65,7 +65,59 @@ class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
class UnknownOwnerError extends ExecutionError {
|
|
69
|
+
constructor(params) {
|
|
70
|
+
super({
|
|
71
|
+
message: 'The provided owner is not part of the account owner set. Pass an account that matches one of the configured `owners` (for multi-factor owner sets, also pass the matching `validatorId`).',
|
|
72
|
+
...params,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
class MismatchedOwnerSignaturesError extends ExecutionError {
|
|
77
|
+
constructor(params) {
|
|
78
|
+
super({
|
|
79
|
+
message: params?.message ??
|
|
80
|
+
'Owner signatures are inconsistent and cannot be assembled. All owners must sign the same prepared transaction and quote using `signTransaction` with the `owner` option.',
|
|
81
|
+
...params,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class InsufficientOwnerSignaturesError extends ExecutionError {
|
|
86
|
+
constructor(params) {
|
|
87
|
+
super({
|
|
88
|
+
message: params?.required !== undefined
|
|
89
|
+
? params?.validatorId !== undefined
|
|
90
|
+
? `Not enough owner signatures to meet the threshold of validator ${params.validatorId}: ${params.provided ?? 0} of ${params.required} required. Collect the missing owner signatures before calling \`assembleTransaction\`.`
|
|
91
|
+
: `Not enough owner signatures to meet the account threshold: ${params.provided ?? 0} of ${params.required} required. Collect the missing owner signatures before calling \`assembleTransaction\`.`
|
|
92
|
+
: 'Not enough owner signatures to meet the account threshold. Collect the missing owner signatures before calling `assembleTransaction`.',
|
|
93
|
+
context: {
|
|
94
|
+
required: params?.required,
|
|
95
|
+
provided: params?.provided,
|
|
96
|
+
validatorId: params?.validatorId,
|
|
97
|
+
...params?.context,
|
|
98
|
+
},
|
|
99
|
+
errorType: params?.errorType,
|
|
100
|
+
traceId: params?.traceId,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
class InvalidOwnerSigningOptionsError extends ExecutionError {
|
|
105
|
+
constructor(params) {
|
|
106
|
+
super({
|
|
107
|
+
message: 'Invalid per-owner signing options. Pass `validatorId` only for multi-factor accounts, where it must identify the factor containing `owner`.',
|
|
108
|
+
...params,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
class IndependentSigningNotSupportedError extends ExecutionError {
|
|
113
|
+
constructor(params) {
|
|
114
|
+
super({
|
|
115
|
+
message: 'Independent owner signing is only supported for smart accounts using ECDSA, passkey, or multi-factor owners. EOA accounts, smart sessions, and K1/ERC-7739 validators must use the standard `signTransaction` flow.',
|
|
116
|
+
...params,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
68
120
|
function isExecutionError(error) {
|
|
69
121
|
return error instanceof ExecutionError;
|
|
70
122
|
}
|
|
71
|
-
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, InvalidSourceCallsError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, IntentFailedError, };
|
|
123
|
+
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, IntentFailedError, UnknownOwnerError, };
|
|
@@ -4,7 +4,7 @@ import { type AuthProvider } from '../auth/provider.js';
|
|
|
4
4
|
import { type IntentOpStatus, type SplitIntentsInput } from '../orchestrator/index.js';
|
|
5
5
|
import type { AppFeeRate, SettlementLayerFilter } from '../orchestrator/types.js';
|
|
6
6
|
import type { CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, SourceCallInput, Sponsorship, TokenRequest, UserOperationTransaction } from '../types.js';
|
|
7
|
-
import { Eip7702InitSignatureRequiredError, ExecutionError, IntentFailedError, InvalidSourceCallsError, isExecutionError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError } from './error.js';
|
|
7
|
+
import { Eip7702InitSignatureRequiredError, ExecutionError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, isExecutionError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError } from './error.js';
|
|
8
8
|
import type { TransactionResult, UserOperationResult } from './utils.js';
|
|
9
9
|
interface TransactionStatus {
|
|
10
10
|
/** OpenTelemetry trace ID for correlating the status response. */
|
|
@@ -29,6 +29,7 @@ declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains:
|
|
|
29
29
|
settlementLayers?: SettlementLayerFilter;
|
|
30
30
|
sourceAssets?: SourceAssetInput;
|
|
31
31
|
appFees?: AppFeeRate;
|
|
32
|
+
customDeadline?: number;
|
|
32
33
|
}): Promise<TransactionResult>;
|
|
33
34
|
declare function sendUserOperationInternal(config: RhinestoneConfig, chain: Chain, callInputs: CalldataInput[], signers?: SignerSet): Promise<UserOperationResult>;
|
|
34
35
|
declare function waitForExecution(config: RhinestoneConfig, result: TransactionResult | UserOperationResult): Promise<TransactionStatus | UserOperationReceipt>;
|
|
@@ -36,6 +37,6 @@ declare function getPortfolio(config: RhinestoneConfig, onTestnets: boolean): Pr
|
|
|
36
37
|
declare function getAppFeeBalances(authProvider: AuthProvider, endpointUrl: string | undefined, headers?: Record<string, string>): Promise<import("../orchestrator/index.js").AppFeeBalances>;
|
|
37
38
|
declare function getIntentStatus(authProvider: AuthProvider, endpointUrl: string | undefined, intentId: string, headers?: Record<string, string>): Promise<TransactionStatus>;
|
|
38
39
|
declare function splitIntents(authProvider: AuthProvider, endpointUrl: string | undefined, input: SplitIntentsInput, headers?: Record<string, string>): Promise<import("../orchestrator/index.js").SplitIntentsResult>;
|
|
39
|
-
export { sendTransactionInternal, sendUserOperation, sendUserOperationInternal, waitForExecution, getPortfolio, getAppFeeBalances, getIntentStatus, splitIntents, isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IntentFailedError, InvalidSourceCallsError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, };
|
|
40
|
+
export { sendTransactionInternal, sendUserOperation, sendUserOperationInternal, waitForExecution, getPortfolio, getAppFeeBalances, getIntentStatus, splitIntents, isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError, };
|
|
40
41
|
export type { TransactionStatus, TransactionResult, UserOperationResult };
|
|
41
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAGpE,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAIL,KAAK,cAAc,EAInB,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAA;AAOxB,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EAET,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,wBAAwB,EACzB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,iCAAiC,EACjC,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,gCAAgC,EAChC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAGpE,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAIL,KAAK,cAAc,EAInB,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAA;AAOxB,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EAET,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,wBAAwB,EACzB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,iCAAiC,EACjC,cAAc,EACd,mCAAmC,EACnC,gCAAgC,EAChC,iBAAiB,EACjB,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAmBrE,UAA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OAAO,CAAC,iBAAiB,GAAG,oBAAoB,CAAC,CA6FnD;AAED,iBAAe,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,gDAgBxE;AAED,iBAAe,iBAAiB,CAC9B,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,qDAIjC;AAED,iBAAe,eAAe,CAC5B,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED,iBAAe,YAAY,CACzB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,KAAK,EAAE,iBAAiB,EACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,yDAIjC;AAED,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EACd,iCAAiC,EACjC,mCAAmC,EACnC,gCAAgC,EAChC,iBAAiB,EACjB,+BAA+B,EAC/B,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,GAClB,CAAA;AACD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { createTransport, getBundlerClient } from '../accounts/utils.js';
|
|
|
4
4
|
import { createAuthProvider } from '../auth/provider.js';
|
|
5
5
|
import { getOrchestrator, INTENT_STATUS_COMPLETED, INTENT_STATUS_FAILED, isConnectionError, isRateLimited, isRetryable, } from '../orchestrator/index.js';
|
|
6
6
|
import { getChainById, getSupportedChainIds, isTestnet, } from '../orchestrator/registry.js';
|
|
7
|
-
import { Eip7702InitSignatureRequiredError, ExecutionError, IntentFailedError, InvalidSourceCallsError, isExecutionError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, } from './error.js';
|
|
7
|
+
import { Eip7702InitSignatureRequiredError, ExecutionError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, isExecutionError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError, } from './error.js';
|
|
8
8
|
import { getTargetExecutionSignature, getTokenRequests, getValidatorAccount, parseCalls, prepareTransactionAsIntent, resolveCallInputs, signAuthorizationsInternal, signIntent, submitIntentInternal, } from './utils.js';
|
|
9
9
|
const POLL_INITIAL_MS = 500;
|
|
10
10
|
const POLL_SLOW_AFTER_MS = 15000;
|
|
@@ -20,7 +20,7 @@ async function sendTransactionInternal(config, sourceChains, targetChain, option
|
|
|
20
20
|
const accountAddress = getAddress(config);
|
|
21
21
|
const resolvedCalls = await resolveCallInputs(options.callInputs, config, targetChain, accountAddress);
|
|
22
22
|
const tokenRequests = getTokenRequests(targetChain, options.initialTokenRequests);
|
|
23
|
-
return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.eip7702InitSignature, options.settlementLayers, options.sourceAssets, options.sourceCalls, options.appFees);
|
|
23
|
+
return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.eip7702InitSignature, options.settlementLayers, options.sourceAssets, options.sourceCalls, options.appFees, options.customDeadline);
|
|
24
24
|
}
|
|
25
25
|
async function sendUserOperationInternal(config, chain, callInputs, signers) {
|
|
26
26
|
// Make sure the account is deployed
|
|
@@ -45,8 +45,8 @@ async function sendUserOperationInternal(config, chain, callInputs, signers) {
|
|
|
45
45
|
chain: chain.id,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, sourceCalls, appFees) {
|
|
49
|
-
const prepared = await prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false, eip7702InitSignature, settlementLayers, sourceAssets, undefined, undefined, signers, sourceCalls, appFees);
|
|
48
|
+
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, sourceCalls, appFees, customDeadline) {
|
|
49
|
+
const prepared = await prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false, eip7702InitSignature, settlementLayers, sourceAssets, undefined, undefined, signers, sourceCalls, appFees, customDeadline);
|
|
50
50
|
if (!prepared) {
|
|
51
51
|
throw new OrderPathRequiredForIntentsError();
|
|
52
52
|
}
|
|
@@ -184,4 +184,4 @@ async function splitIntents(authProvider, endpointUrl, input, headers) {
|
|
|
184
184
|
}
|
|
185
185
|
export { sendTransactionInternal, sendUserOperation, sendUserOperationInternal, waitForExecution, getPortfolio, getAppFeeBalances, getIntentStatus, splitIntents,
|
|
186
186
|
// Errors
|
|
187
|
-
isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IntentFailedError, InvalidSourceCallsError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, };
|
|
187
|
+
isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, IndependentSigningNotSupportedError, InsufficientOwnerSignaturesError, IntentFailedError, InvalidOwnerSigningOptionsError, InvalidSourceCallsError, MismatchedOwnerSignaturesError, OrderPathRequiredForIntentsError, QuoteNotInPreparedTransactionError, UnknownOwnerError, };
|