@rhinestone/sdk 0.7.10 → 0.8.1
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 → accounts}/index.d.ts +2 -2
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/index.js +55 -45
- package/dist/accounts/nexus.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/nexus.js +48 -42
- package/dist/accounts/safe.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/safe.js +35 -29
- package/dist/accounts/utils.d.ts.map +1 -0
- package/dist/{src/accounts → accounts}/utils.js +23 -19
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/{src/execution → execution}/index.js +72 -61
- package/dist/execution/smart-session.d.ts.map +1 -0
- package/dist/execution/smart-session.js +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{src/index.js → index.js} +10 -8
- package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/modules/common.d.ts.map +1 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/omni-account.d.ts.map +1 -0
- package/dist/modules/validators/core.d.ts.map +1 -0
- package/dist/modules/validators/index.d.ts.map +1 -0
- package/dist/modules/validators/smart-sessions.d.ts.map +1 -0
- package/dist/orchestrator/client.d.ts.map +1 -0
- package/dist/{cjs/orchestrator → orchestrator}/consts.d.ts +2 -2
- package/dist/orchestrator/consts.d.ts.map +1 -0
- package/dist/{cjs/orchestrator → orchestrator}/consts.js +2 -2
- package/dist/orchestrator/error.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/{src/orchestrator → orchestrator}/types.d.ts +14 -15
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/utils.d.ts.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +13 -13
- package/dist/cjs/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/cjs/modules/common.d.ts.map +0 -1
- package/dist/cjs/modules/index.d.ts.map +0 -1
- package/dist/cjs/modules/omni-account.d.ts.map +0 -1
- package/dist/cjs/modules/validators/core.d.ts.map +0 -1
- package/dist/cjs/modules/validators/index.d.ts.map +0 -1
- package/dist/cjs/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/cjs/orchestrator/client.d.ts.map +0 -1
- package/dist/cjs/orchestrator/consts.d.ts.map +0 -1
- package/dist/cjs/orchestrator/error.d.ts.map +0 -1
- package/dist/cjs/orchestrator/index.d.ts.map +0 -1
- package/dist/cjs/orchestrator/registry.d.ts.map +0 -1
- package/dist/cjs/orchestrator/types.d.ts +0 -222
- package/dist/cjs/orchestrator/types.d.ts.map +0 -1
- package/dist/cjs/orchestrator/utils.d.ts.map +0 -1
- package/dist/cjs/types.d.ts.map +0 -1
- package/dist/src/accounts/index.d.ts.map +0 -1
- package/dist/src/accounts/nexus.d.ts.map +0 -1
- package/dist/src/accounts/safe.d.ts.map +0 -1
- package/dist/src/accounts/utils.d.ts.map +0 -1
- package/dist/src/execution/index.d.ts.map +0 -1
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -81
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.d.ts +0 -42
- package/dist/src/modules/abi/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/abi/smart-sessions.js +0 -128
- package/dist/src/modules/common.d.ts +0 -16
- package/dist/src/modules/common.d.ts.map +0 -1
- package/dist/src/modules/common.js +0 -5
- package/dist/src/modules/index.d.ts +0 -33
- package/dist/src/modules/index.d.ts.map +0 -1
- package/dist/src/modules/index.js +0 -146
- package/dist/src/modules/omni-account.d.ts +0 -9
- package/dist/src/modules/omni-account.d.ts.map +0 -1
- package/dist/src/modules/omni-account.js +0 -7
- package/dist/src/modules/validators/core.d.ts +0 -23
- package/dist/src/modules/validators/core.d.ts.map +0 -1
- package/dist/src/modules/validators/core.js +0 -112
- package/dist/src/modules/validators/index.d.ts +0 -4
- package/dist/src/modules/validators/index.d.ts.map +0 -1
- package/dist/src/modules/validators/index.js +0 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +0 -29
- package/dist/src/modules/validators/smart-sessions.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.js +0 -414
- package/dist/src/orchestrator/client.d.ts +0 -29
- package/dist/src/orchestrator/client.d.ts.map +0 -1
- package/dist/src/orchestrator/client.js +0 -243
- package/dist/src/orchestrator/consts.d.ts +0 -5
- package/dist/src/orchestrator/consts.d.ts.map +0 -1
- package/dist/src/orchestrator/consts.js +0 -4
- package/dist/src/orchestrator/error.d.ts +0 -18
- package/dist/src/orchestrator/error.d.ts.map +0 -1
- package/dist/src/orchestrator/error.js +0 -28
- package/dist/src/orchestrator/index.d.ts +0 -11
- package/dist/src/orchestrator/index.d.ts.map +0 -1
- package/dist/src/orchestrator/index.js +0 -10
- package/dist/src/orchestrator/registry.d.ts +0 -17
- package/dist/src/orchestrator/registry.d.ts.map +0 -1
- package/dist/src/orchestrator/registry.js +0 -344
- package/dist/src/orchestrator/types.d.ts.map +0 -1
- package/dist/src/orchestrator/types.js +0 -9
- package/dist/src/orchestrator/utils.d.ts +0 -29
- package/dist/src/orchestrator/utils.d.ts.map +0 -1
- package/dist/src/orchestrator/utils.js +0 -303
- package/dist/src/types.d.ts +0 -113
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -1
- package/dist/test/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/test/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/test/modules/validators/smart-sessions.test.js +0 -20
- /package/dist/{src/accounts → accounts}/nexus.d.ts +0 -0
- /package/dist/{src/accounts → accounts}/safe.d.ts +0 -0
- /package/dist/{src/accounts → accounts}/utils.d.ts +0 -0
- /package/dist/{src/execution → execution}/index.d.ts +0 -0
- /package/dist/{src/execution → execution}/smart-session.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/modules → modules}/abi/smart-sessions.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/abi/smart-sessions.js +0 -0
- /package/dist/{cjs/modules → modules}/common.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/common.js +0 -0
- /package/dist/{cjs/modules → modules}/index.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/index.js +0 -0
- /package/dist/{cjs/modules → modules}/omni-account.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/omni-account.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/core.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/core.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/index.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/index.js +0 -0
- /package/dist/{cjs/modules → modules}/validators/smart-sessions.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/validators/smart-sessions.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/client.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/client.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/error.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/error.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/index.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/index.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/registry.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/registry.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/types.js +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/utils.d.ts +0 -0
- /package/dist/{cjs/orchestrator → orchestrator}/utils.js +0 -0
- /package/dist/{cjs/types.d.ts → types.d.ts} +0 -0
- /package/dist/{cjs/types.js → types.js} +0 -0
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
const enableSessionsAbi = [
|
|
2
|
-
{
|
|
3
|
-
type: 'function',
|
|
4
|
-
name: 'enableSessions',
|
|
5
|
-
inputs: [
|
|
6
|
-
{
|
|
7
|
-
name: 'sessions',
|
|
8
|
-
type: 'tuple[]',
|
|
9
|
-
internalType: 'struct Session[]',
|
|
10
|
-
components: [
|
|
11
|
-
{
|
|
12
|
-
name: 'sessionValidator',
|
|
13
|
-
type: 'address',
|
|
14
|
-
internalType: 'contract ISessionValidator',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: 'sessionValidatorInitData',
|
|
18
|
-
type: 'bytes',
|
|
19
|
-
internalType: 'bytes',
|
|
20
|
-
},
|
|
21
|
-
{ name: 'salt', type: 'bytes32', internalType: 'bytes32' },
|
|
22
|
-
{
|
|
23
|
-
name: 'userOpPolicies',
|
|
24
|
-
type: 'tuple[]',
|
|
25
|
-
internalType: 'struct PolicyData[]',
|
|
26
|
-
components: [
|
|
27
|
-
{
|
|
28
|
-
name: 'policy',
|
|
29
|
-
type: 'address',
|
|
30
|
-
internalType: 'address',
|
|
31
|
-
},
|
|
32
|
-
{ name: 'initData', type: 'bytes', internalType: 'bytes' },
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'erc7739Policies',
|
|
37
|
-
type: 'tuple',
|
|
38
|
-
internalType: 'struct ERC7739Data',
|
|
39
|
-
components: [
|
|
40
|
-
{
|
|
41
|
-
name: 'allowedERC7739Content',
|
|
42
|
-
type: 'tuple[]',
|
|
43
|
-
internalType: 'struct ERC7739Context[]',
|
|
44
|
-
components: [
|
|
45
|
-
{
|
|
46
|
-
name: 'appDomainSeparator',
|
|
47
|
-
type: 'bytes32',
|
|
48
|
-
internalType: 'bytes32',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'contentName',
|
|
52
|
-
type: 'string[]',
|
|
53
|
-
internalType: 'string[]',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'erc1271Policies',
|
|
59
|
-
type: 'tuple[]',
|
|
60
|
-
internalType: 'struct PolicyData[]',
|
|
61
|
-
components: [
|
|
62
|
-
{
|
|
63
|
-
name: 'policy',
|
|
64
|
-
type: 'address',
|
|
65
|
-
internalType: 'address',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'initData',
|
|
69
|
-
type: 'bytes',
|
|
70
|
-
internalType: 'bytes',
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'actions',
|
|
78
|
-
type: 'tuple[]',
|
|
79
|
-
internalType: 'struct ActionData[]',
|
|
80
|
-
components: [
|
|
81
|
-
{
|
|
82
|
-
name: 'actionTargetSelector',
|
|
83
|
-
type: 'bytes4',
|
|
84
|
-
internalType: 'bytes4',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: 'actionTarget',
|
|
88
|
-
type: 'address',
|
|
89
|
-
internalType: 'address',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'actionPolicies',
|
|
93
|
-
type: 'tuple[]',
|
|
94
|
-
internalType: 'struct PolicyData[]',
|
|
95
|
-
components: [
|
|
96
|
-
{
|
|
97
|
-
name: 'policy',
|
|
98
|
-
type: 'address',
|
|
99
|
-
internalType: 'address',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'initData',
|
|
103
|
-
type: 'bytes',
|
|
104
|
-
internalType: 'bytes',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
name: 'permitERC4337Paymaster',
|
|
112
|
-
type: 'bool',
|
|
113
|
-
internalType: 'bool',
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
outputs: [
|
|
119
|
-
{
|
|
120
|
-
name: 'permissionIds',
|
|
121
|
-
type: 'bytes32[]',
|
|
122
|
-
internalType: 'PermissionId[]',
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
stateMutability: 'nonpayable',
|
|
126
|
-
},
|
|
127
|
-
];
|
|
128
|
-
export { enableSessionsAbi };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem';
|
|
2
|
-
type ModuleType = typeof MODULE_TYPE_ID_VALIDATOR | typeof MODULE_TYPE_ID_EXECUTOR | typeof MODULE_TYPE_ID_FALLBACK | typeof MODULE_TYPE_ID_HOOK;
|
|
3
|
-
interface Module {
|
|
4
|
-
address: Address;
|
|
5
|
-
initData: Hex;
|
|
6
|
-
deInitData: Hex;
|
|
7
|
-
additionalContext: Hex;
|
|
8
|
-
type: ModuleType;
|
|
9
|
-
}
|
|
10
|
-
declare const MODULE_TYPE_ID_VALIDATOR = 1n;
|
|
11
|
-
declare const MODULE_TYPE_ID_EXECUTOR = 2n;
|
|
12
|
-
declare const MODULE_TYPE_ID_FALLBACK = 3n;
|
|
13
|
-
declare const MODULE_TYPE_ID_HOOK = 4n;
|
|
14
|
-
export { MODULE_TYPE_ID_VALIDATOR, MODULE_TYPE_ID_EXECUTOR, MODULE_TYPE_ID_FALLBACK, MODULE_TYPE_ID_HOOK, };
|
|
15
|
-
export type { Module, ModuleType };
|
|
16
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../modules/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAExC,KAAK,UAAU,GACX,OAAO,wBAAwB,GAC/B,OAAO,uBAAuB,GAC9B,OAAO,uBAAuB,GAC9B,OAAO,mBAAmB,CAAA;AAE9B,UAAU,MAAM;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,GAAG,CAAA;IACb,UAAU,EAAE,GAAG,CAAA;IACf,iBAAiB,EAAE,GAAG,CAAA;IACtB,IAAI,EAAE,UAAU,CAAA;CACjB;AAED,QAAA,MAAM,wBAAwB,KAAK,CAAA;AACnC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAClC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAClC,QAAA,MAAM,mBAAmB,KAAK,CAAA;AAE9B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,GACpB,CAAA;AACD,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type Address, type Chain, type Hex } from 'viem';
|
|
2
|
-
import type { RhinestoneAccountConfig } from '../types';
|
|
3
|
-
import { type Module } from './common';
|
|
4
|
-
import { HOOK_ADDRESS } from './omni-account';
|
|
5
|
-
import { getOwnerValidator } from './validators';
|
|
6
|
-
interface WebAuthnData {
|
|
7
|
-
authenticatorData: Hex;
|
|
8
|
-
clientDataJSON: string;
|
|
9
|
-
typeIndex: number | bigint;
|
|
10
|
-
}
|
|
11
|
-
interface WebauthnValidatorSignature {
|
|
12
|
-
webauthn: WebAuthnData;
|
|
13
|
-
signature: WebauthnSignature | Hex | Uint8Array;
|
|
14
|
-
usePrecompiled?: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface WebauthnSignature {
|
|
17
|
-
r: bigint;
|
|
18
|
-
s: bigint;
|
|
19
|
-
}
|
|
20
|
-
interface ModeleSetup {
|
|
21
|
-
validators: Module[];
|
|
22
|
-
executors: Module[];
|
|
23
|
-
fallbacks: Module[];
|
|
24
|
-
hooks: Module[];
|
|
25
|
-
registry: Address;
|
|
26
|
-
attesters: Address[];
|
|
27
|
-
threshold: number;
|
|
28
|
-
}
|
|
29
|
-
declare function getSetup(config: RhinestoneAccountConfig): ModeleSetup;
|
|
30
|
-
declare function getWebauthnValidatorSignature({ webauthn, signature, usePrecompiled, }: WebauthnValidatorSignature): `0x${string}`;
|
|
31
|
-
declare function isRip7212SupportedNetwork(chain: Chain): boolean;
|
|
32
|
-
export { HOOK_ADDRESS, getSetup, getOwnerValidator, getWebauthnValidatorSignature, isRip7212SupportedNetwork, };
|
|
33
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAET,MAAM,MAAM,CAAA;AAYb,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EAMb,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAA4B,MAAM,cAAc,CAAA;AAK1E,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B;AAED,UAAU,0BAA0B;IAClC,QAAQ,EAAE,YAAY,CAAA;IACtB,SAAS,EAAE,iBAAiB,GAAG,GAAG,GAAG,UAAU,CAAA;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,UAAU,iBAAiB;IACzB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,WAAW,CAoF9D;AAED,iBAAS,6BAA6B,CAAC,EACrC,QAAQ,EACR,SAAS,EACT,cAAsB,GACvB,EAAE,0BAA0B,iBA6C5B;AAED,iBAAS,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAa9C;AAaD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,6BAA6B,EAC7B,yBAAyB,GAC1B,CAAA"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { bytesToHex, encodeAbiParameters, hexToBytes, } from 'viem';
|
|
2
|
-
import { arbitrum, arbitrumSepolia, base, baseSepolia, optimism, optimismSepolia, polygon, polygonAmoy, } from 'viem/chains';
|
|
3
|
-
import { MODULE_TYPE_ID_EXECUTOR, MODULE_TYPE_ID_FALLBACK, } from './common.js';
|
|
4
|
-
import { HOOK_ADDRESS, OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS, RHINESTONE_ATTESTER_ADDRESS, RHINESTONE_MODULE_REGISTRY_ADDRESS, SAME_CHAIN_MODULE_ADDRESS, TARGET_MODULE_ADDRESS, } from './omni-account.js';
|
|
5
|
-
import { getOwnerValidator, getSmartSessionValidator } from './validators/index.js';
|
|
6
|
-
const SMART_SESSION_COMPATIBILITY_FALLBACK_ADDRESS = '0x12cae64c42f362e7d5a847c2d33388373f629177';
|
|
7
|
-
function getSetup(config) {
|
|
8
|
-
const ownerValidator = getOwnerValidator(config);
|
|
9
|
-
const smartSessionValidator = getSmartSessionValidator(config);
|
|
10
|
-
const validators = [ownerValidator];
|
|
11
|
-
if (smartSessionValidator) {
|
|
12
|
-
validators.push(smartSessionValidator);
|
|
13
|
-
}
|
|
14
|
-
const executors = [
|
|
15
|
-
{
|
|
16
|
-
address: SAME_CHAIN_MODULE_ADDRESS,
|
|
17
|
-
initData: '0x',
|
|
18
|
-
deInitData: '0x',
|
|
19
|
-
additionalContext: '0x',
|
|
20
|
-
type: MODULE_TYPE_ID_EXECUTOR,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
address: TARGET_MODULE_ADDRESS,
|
|
24
|
-
initData: '0x',
|
|
25
|
-
deInitData: '0x',
|
|
26
|
-
additionalContext: '0x',
|
|
27
|
-
type: MODULE_TYPE_ID_EXECUTOR,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
address: HOOK_ADDRESS,
|
|
31
|
-
initData: '0x',
|
|
32
|
-
deInitData: '0x',
|
|
33
|
-
additionalContext: '0x',
|
|
34
|
-
type: MODULE_TYPE_ID_EXECUTOR,
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
const fallbacks = [
|
|
38
|
-
{
|
|
39
|
-
address: TARGET_MODULE_ADDRESS,
|
|
40
|
-
initData: encodeAbiParameters([
|
|
41
|
-
{ name: 'selector', type: 'bytes4' },
|
|
42
|
-
{ name: 'flags', type: 'bytes1' },
|
|
43
|
-
{ name: 'data', type: 'bytes' },
|
|
44
|
-
], ['0x3a5be8cb', '0x00', '0x']),
|
|
45
|
-
deInitData: '0x',
|
|
46
|
-
additionalContext: '0x',
|
|
47
|
-
type: MODULE_TYPE_ID_FALLBACK,
|
|
48
|
-
},
|
|
49
|
-
];
|
|
50
|
-
// Some accounts (e.g. Safe) need a fallback method to support smart sessions
|
|
51
|
-
if (config.sessions) {
|
|
52
|
-
if (config.account && config.account.type === 'safe') {
|
|
53
|
-
fallbacks.push({
|
|
54
|
-
address: SMART_SESSION_COMPATIBILITY_FALLBACK_ADDRESS,
|
|
55
|
-
initData: encodeAbiParameters([
|
|
56
|
-
{ name: 'selector', type: 'bytes4' },
|
|
57
|
-
{ name: 'flags', type: 'bytes1' },
|
|
58
|
-
{ name: 'data', type: 'bytes' },
|
|
59
|
-
], ['0x84b0196e', '0xfe', '0x']),
|
|
60
|
-
deInitData: '0x',
|
|
61
|
-
additionalContext: '0x',
|
|
62
|
-
type: MODULE_TYPE_ID_FALLBACK,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const hooks = [];
|
|
67
|
-
return {
|
|
68
|
-
validators,
|
|
69
|
-
executors,
|
|
70
|
-
fallbacks,
|
|
71
|
-
hooks,
|
|
72
|
-
registry: RHINESTONE_MODULE_REGISTRY_ADDRESS,
|
|
73
|
-
attesters: [
|
|
74
|
-
RHINESTONE_ATTESTER_ADDRESS,
|
|
75
|
-
OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS,
|
|
76
|
-
],
|
|
77
|
-
threshold: 1,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function getWebauthnValidatorSignature({ webauthn, signature, usePrecompiled = false, }) {
|
|
81
|
-
const { authenticatorData, clientDataJSON, typeIndex } = webauthn;
|
|
82
|
-
let r;
|
|
83
|
-
let s;
|
|
84
|
-
if (typeof signature === 'string' || signature instanceof Uint8Array) {
|
|
85
|
-
const parsedSignature = parseSignature(signature);
|
|
86
|
-
r = parsedSignature.r;
|
|
87
|
-
s = parsedSignature.s;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
r = signature.r;
|
|
91
|
-
s = signature.s;
|
|
92
|
-
}
|
|
93
|
-
return encodeAbiParameters([
|
|
94
|
-
{ type: 'bytes', name: 'authenticatorData' },
|
|
95
|
-
{
|
|
96
|
-
type: 'string',
|
|
97
|
-
name: 'clientDataJSON',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
type: 'uint256',
|
|
101
|
-
name: 'responseTypeLocation',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
type: 'uint256',
|
|
105
|
-
name: 'r',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
type: 'uint256',
|
|
109
|
-
name: 's',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
type: 'bool',
|
|
113
|
-
name: 'usePrecompiled',
|
|
114
|
-
},
|
|
115
|
-
], [
|
|
116
|
-
authenticatorData,
|
|
117
|
-
clientDataJSON,
|
|
118
|
-
typeof typeIndex === 'bigint' ? typeIndex : BigInt(typeIndex),
|
|
119
|
-
r,
|
|
120
|
-
s,
|
|
121
|
-
usePrecompiled,
|
|
122
|
-
]);
|
|
123
|
-
}
|
|
124
|
-
function isRip7212SupportedNetwork(chain) {
|
|
125
|
-
const supportedChains = [
|
|
126
|
-
optimism,
|
|
127
|
-
optimismSepolia,
|
|
128
|
-
polygon,
|
|
129
|
-
polygonAmoy,
|
|
130
|
-
base,
|
|
131
|
-
baseSepolia,
|
|
132
|
-
arbitrum,
|
|
133
|
-
arbitrumSepolia,
|
|
134
|
-
];
|
|
135
|
-
return supportedChains.includes(chain);
|
|
136
|
-
}
|
|
137
|
-
function parseSignature(signature) {
|
|
138
|
-
const bytes = typeof signature === 'string' ? hexToBytes(signature) : signature;
|
|
139
|
-
const r = bytes.slice(0, 32);
|
|
140
|
-
const s = bytes.slice(32, 64);
|
|
141
|
-
return {
|
|
142
|
-
r: BigInt(bytesToHex(r)),
|
|
143
|
-
s: BigInt(bytesToHex(s)),
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
export { HOOK_ADDRESS, getSetup, getOwnerValidator, getWebauthnValidatorSignature, isRip7212SupportedNetwork, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Address } from 'viem';
|
|
2
|
-
declare const OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS: Address;
|
|
3
|
-
declare const RHINESTONE_MODULE_REGISTRY_ADDRESS: Address;
|
|
4
|
-
declare const RHINESTONE_ATTESTER_ADDRESS: Address;
|
|
5
|
-
declare const HOOK_ADDRESS: Address;
|
|
6
|
-
declare const TARGET_MODULE_ADDRESS: Address;
|
|
7
|
-
declare const SAME_CHAIN_MODULE_ADDRESS: Address;
|
|
8
|
-
export { OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS, RHINESTONE_MODULE_REGISTRY_ADDRESS, RHINESTONE_ATTESTER_ADDRESS, HOOK_ADDRESS, TARGET_MODULE_ADDRESS, SAME_CHAIN_MODULE_ADDRESS, };
|
|
9
|
-
//# sourceMappingURL=omni-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omni-account.d.ts","sourceRoot":"","sources":["../../../modules/omni-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,QAAA,MAAM,kCAAkC,EAAE,OACI,CAAA;AAE9C,QAAA,MAAM,kCAAkC,EAAE,OACI,CAAA;AAC9C,QAAA,MAAM,2BAA2B,EAAE,OACW,CAAA;AAE9C,QAAA,MAAM,YAAY,EAAE,OAAsD,CAAA;AAC1E,QAAA,MAAM,qBAAqB,EAAE,OACiB,CAAA;AAC9C,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAE9C,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,GAC1B,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = '0x6D0515e8E499468DCe9583626f0cA15b887f9d03';
|
|
2
|
-
const RHINESTONE_MODULE_REGISTRY_ADDRESS = '0x000000000069e2a187aeffb852bf3ccdc95151b2';
|
|
3
|
-
const RHINESTONE_ATTESTER_ADDRESS = '0x000000333034E9f539ce08819E12c1b8Cb29084d';
|
|
4
|
-
const HOOK_ADDRESS = '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
5
|
-
const TARGET_MODULE_ADDRESS = '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
6
|
-
const SAME_CHAIN_MODULE_ADDRESS = '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
7
|
-
export { OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS, RHINESTONE_MODULE_REGISTRY_ADDRESS, RHINESTONE_ATTESTER_ADDRESS, HOOK_ADDRESS, TARGET_MODULE_ADDRESS, SAME_CHAIN_MODULE_ADDRESS, };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type Address, type Hex } from 'viem';
|
|
2
|
-
import type { OwnerSet, RhinestoneAccountConfig } from '../../types';
|
|
3
|
-
import { type Module } from '../common';
|
|
4
|
-
interface PublicKey {
|
|
5
|
-
prefix?: number | undefined;
|
|
6
|
-
x: bigint;
|
|
7
|
-
y: bigint;
|
|
8
|
-
}
|
|
9
|
-
interface WebauthnCredential {
|
|
10
|
-
pubKey: PublicKey | Hex | Uint8Array;
|
|
11
|
-
authenticatorId: string;
|
|
12
|
-
hook?: Address;
|
|
13
|
-
}
|
|
14
|
-
declare function getOwnerValidator(config: RhinestoneAccountConfig): Module;
|
|
15
|
-
declare function getMockSignature(ownerSet: OwnerSet): Hex;
|
|
16
|
-
declare function getValidator(owners: OwnerSet): Module;
|
|
17
|
-
declare function getOwnableValidator({ threshold, owners, }: {
|
|
18
|
-
threshold: number;
|
|
19
|
-
owners: Address[];
|
|
20
|
-
}): Module;
|
|
21
|
-
declare function getWebAuthnValidator(webAuthnCredential: WebauthnCredential): Module;
|
|
22
|
-
export { getOwnerValidator, getValidator, getOwnableValidator, getWebAuthnValidator, getMockSignature, };
|
|
23
|
-
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../modules/validators/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAIZ,KAAK,GAAG,EAIT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAEjE,UAAU,SAAS;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,SAAS,GAAG,GAAG,GAAG,UAAU,CAAA;IACpC,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAYD,iBAAS,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,UAEzD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAUjD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,QAAQ,UAarC;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,EAAE,CAAA;CAClB,GAAG,MAAM,CAiBT;AAED,iBAAS,oBAAoB,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,MAAM,CAwD5E;AAeD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,GACjB,CAAA"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { bytesToHex, concat, encodeAbiParameters, hexToBytes, keccak256, toHex, } from 'viem';
|
|
2
|
-
import { MODULE_TYPE_ID_VALIDATOR } from '../common.js';
|
|
3
|
-
const OWNABLE_VALIDATOR_ADDRESS = '0x2483DA3A338895199E5e538530213157e931Bf06';
|
|
4
|
-
const WEBAUTHN_VALIDATOR_ADDRESS = '0x2f167e55d42584f65e2e30a748f41ee75a311414';
|
|
5
|
-
const ECDSA_MOCK_SIGNATURE = '0x81d4b4981670cb18f99f0b4a66446df1bf5b204d24cfcb659bf38ba27a4359b5711649ec2423c5e1247245eba2964679b6a1dbb85c992ae40b9b00c6935b02ff1b';
|
|
6
|
-
const WEBAUTHN_MOCK_SIGNATURE = '0x00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001635bc6d0f68ff895cae8a288ecf7542a6a9cd555df784b73e1e2ea7e9104b1db15e9015d280cb19527881c625fee43fd3a405d5b0d199a8c8e6589a7381209e40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97631d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f47b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22746278584e465339585f3442797231634d77714b724947422d5f3330613051685a36793775634d30424f45222c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a33303030222c2263726f73734f726967696e223a66616c73652c20226f746865725f6b6579735f63616e5f62655f61646465645f68657265223a22646f206e6f7420636f6d7061726520636c69656e74446174614a534f4e20616761696e737420612074656d706c6174652e205365652068747470733a2f2f676f6f2e676c2f796162506578227d000000000000000000000000';
|
|
7
|
-
function getOwnerValidator(config) {
|
|
8
|
-
return getValidator(config.owners);
|
|
9
|
-
}
|
|
10
|
-
function getMockSignature(ownerSet) {
|
|
11
|
-
switch (ownerSet.type) {
|
|
12
|
-
case 'ecdsa': {
|
|
13
|
-
const owners = ownerSet.accounts.map((account) => account.address);
|
|
14
|
-
const signatures = owners.map(() => ECDSA_MOCK_SIGNATURE);
|
|
15
|
-
return concat(signatures);
|
|
16
|
-
}
|
|
17
|
-
case 'passkey':
|
|
18
|
-
return WEBAUTHN_MOCK_SIGNATURE;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function getValidator(owners) {
|
|
22
|
-
switch (owners.type) {
|
|
23
|
-
case 'ecdsa':
|
|
24
|
-
return getOwnableValidator({
|
|
25
|
-
threshold: owners.threshold ?? 1,
|
|
26
|
-
owners: owners.accounts.map((account) => account.address),
|
|
27
|
-
});
|
|
28
|
-
case 'passkey':
|
|
29
|
-
return getWebAuthnValidator({
|
|
30
|
-
pubKey: owners.account.publicKey,
|
|
31
|
-
authenticatorId: owners.account.id,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function getOwnableValidator({ threshold, owners, }) {
|
|
36
|
-
return {
|
|
37
|
-
address: OWNABLE_VALIDATOR_ADDRESS,
|
|
38
|
-
initData: encodeAbiParameters([
|
|
39
|
-
{ name: 'threshold', type: 'uint256' },
|
|
40
|
-
{ name: 'owners', type: 'address[]' },
|
|
41
|
-
], [
|
|
42
|
-
BigInt(threshold),
|
|
43
|
-
owners.map((owner) => owner.toLowerCase()).sort(),
|
|
44
|
-
]),
|
|
45
|
-
deInitData: '0x',
|
|
46
|
-
additionalContext: '0x',
|
|
47
|
-
type: MODULE_TYPE_ID_VALIDATOR,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function getWebAuthnValidator(webAuthnCredential) {
|
|
51
|
-
let pubKeyX;
|
|
52
|
-
let pubKeyY;
|
|
53
|
-
// Distinguish between PublicKey and Hex / byte encoded public key
|
|
54
|
-
if (typeof webAuthnCredential.pubKey === 'string' ||
|
|
55
|
-
webAuthnCredential.pubKey instanceof Uint8Array) {
|
|
56
|
-
// It's a P256Credential
|
|
57
|
-
const { x, y, prefix } = parsePublicKey(webAuthnCredential.pubKey);
|
|
58
|
-
pubKeyX = x;
|
|
59
|
-
pubKeyY = y;
|
|
60
|
-
if (prefix && prefix !== 4) {
|
|
61
|
-
throw new Error('Only uncompressed public keys are supported');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
// It's already a PublicKey
|
|
66
|
-
pubKeyX = webAuthnCredential.pubKey.x;
|
|
67
|
-
pubKeyY = webAuthnCredential.pubKey.y;
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
address: WEBAUTHN_VALIDATOR_ADDRESS,
|
|
71
|
-
initData: encodeAbiParameters([
|
|
72
|
-
{
|
|
73
|
-
components: [
|
|
74
|
-
{
|
|
75
|
-
name: 'pubKeyX',
|
|
76
|
-
type: 'uint256',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'pubKeyY',
|
|
80
|
-
type: 'uint256',
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
type: 'tuple',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: 'bytes32',
|
|
87
|
-
name: 'authenticatorIdHash',
|
|
88
|
-
},
|
|
89
|
-
], [
|
|
90
|
-
{
|
|
91
|
-
pubKeyX,
|
|
92
|
-
pubKeyY,
|
|
93
|
-
},
|
|
94
|
-
keccak256(toHex(webAuthnCredential.authenticatorId)),
|
|
95
|
-
]),
|
|
96
|
-
deInitData: '0x',
|
|
97
|
-
additionalContext: '0x',
|
|
98
|
-
type: MODULE_TYPE_ID_VALIDATOR,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function parsePublicKey(publicKey) {
|
|
102
|
-
const bytes = typeof publicKey === 'string' ? hexToBytes(publicKey) : publicKey;
|
|
103
|
-
const offset = bytes.length === 65 ? 1 : 0;
|
|
104
|
-
const x = bytes.slice(offset, 32 + offset);
|
|
105
|
-
const y = bytes.slice(32 + offset, 64 + offset);
|
|
106
|
-
return {
|
|
107
|
-
prefix: bytes.length === 65 ? bytes[0] : undefined,
|
|
108
|
-
x: BigInt(bytesToHex(x)),
|
|
109
|
-
y: BigInt(bytesToHex(y)),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
export { getOwnerValidator, getValidator, getOwnableValidator, getWebAuthnValidator, getMockSignature, };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { getMockSignature, getOwnerValidator } from './core';
|
|
2
|
-
import { encodeSmartSessionSignature, getAccountEIP712Domain, getEnableSessionCall, getPermissionId, getSessionAllowedERC7739Content, getSmartSessionValidator, isSessionEnabled, SMART_SESSION_MODE_ENABLE, SMART_SESSION_MODE_USE, SMART_SESSIONS_VALIDATOR_ADDRESS } from './smart-sessions';
|
|
3
|
-
export { SMART_SESSION_MODE_USE, SMART_SESSION_MODE_ENABLE, SMART_SESSIONS_VALIDATOR_ADDRESS, getOwnerValidator, getSmartSessionValidator, getEnableSessionCall, encodeSmartSessionSignature, getPermissionId, getMockSignature, getAccountEIP712Domain, isSessionEnabled, getSessionAllowedERC7739Content, };
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../modules/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,+BAA+B,EAC/B,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,gCAAgC,EAChC,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,+BAA+B,GAChC,CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { getMockSignature, getOwnerValidator } from './core.js';
|
|
2
|
-
import { encodeSmartSessionSignature, getAccountEIP712Domain, getEnableSessionCall, getPermissionId, getSessionAllowedERC7739Content, getSmartSessionValidator, isSessionEnabled, SMART_SESSION_MODE_ENABLE, SMART_SESSION_MODE_USE, SMART_SESSIONS_VALIDATOR_ADDRESS, } from './smart-sessions.js';
|
|
3
|
-
export { SMART_SESSION_MODE_USE, SMART_SESSION_MODE_ENABLE, SMART_SESSIONS_VALIDATOR_ADDRESS, getOwnerValidator, getSmartSessionValidator, getEnableSessionCall, encodeSmartSessionSignature, getPermissionId, getMockSignature, getAccountEIP712Domain, isSessionEnabled, getSessionAllowedERC7739Content, };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type Address, type Chain, type Hex, type PublicClient } from 'viem';
|
|
2
|
-
import type { RhinestoneAccountConfig, Session } from '../../types';
|
|
3
|
-
import { type Module } from '../common';
|
|
4
|
-
type SmartSessionModeType = typeof SMART_SESSION_MODE_USE | typeof SMART_SESSION_MODE_ENABLE | typeof SMART_SESSION_MODE_UNSAFE_ENABLE;
|
|
5
|
-
declare const SMART_SESSIONS_VALIDATOR_ADDRESS: Address;
|
|
6
|
-
declare const SMART_SESSION_MODE_USE = "0x00";
|
|
7
|
-
declare const SMART_SESSION_MODE_ENABLE = "0x01";
|
|
8
|
-
declare const SMART_SESSION_MODE_UNSAFE_ENABLE = "0x02";
|
|
9
|
-
declare function getEnableSessionCall(chain: Chain, session: Session): Promise<{
|
|
10
|
-
to: `0x${string}`;
|
|
11
|
-
data: `0x${string}`;
|
|
12
|
-
}>;
|
|
13
|
-
declare function getSessionAllowedERC7739Content(chain: Chain): Promise<{
|
|
14
|
-
appDomainSeparator: `0x${string}`;
|
|
15
|
-
contentsType: string;
|
|
16
|
-
}>;
|
|
17
|
-
declare function getSmartSessionValidator(config: RhinestoneAccountConfig): Module | null;
|
|
18
|
-
declare function isSessionEnabled(client: PublicClient, address: Address, permissionId: Hex): Promise<boolean>;
|
|
19
|
-
declare function encodeSmartSessionSignature(mode: SmartSessionModeType, permissionId: Hex, signature: Hex): `0x${string}`;
|
|
20
|
-
declare function getPermissionId(session: Session): `0x${string}`;
|
|
21
|
-
declare function getAccountEIP712Domain(client: PublicClient, account: Address): Promise<{
|
|
22
|
-
name: string;
|
|
23
|
-
version: string;
|
|
24
|
-
chainId: bigint;
|
|
25
|
-
verifyingContract: `0x${string}`;
|
|
26
|
-
salt: `0x${string}`;
|
|
27
|
-
}>;
|
|
28
|
-
export { SMART_SESSION_MODE_USE, SMART_SESSION_MODE_ENABLE, SMART_SESSIONS_VALIDATOR_ADDRESS, getSmartSessionValidator, getEnableSessionCall, encodeSmartSessionSignature, getPermissionId, getAccountEIP712Domain, isSessionEnabled, getSessionAllowedERC7739Content, };
|
|
29
|
-
//# sourceMappingURL=smart-sessions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,GAAG,EAIR,KAAK,YAAY,EAKlB,MAAM,MAAM,CAAA;AAMb,OAAO,KAAK,EAEV,uBAAuB,EACvB,OAAO,EAER,MAAM,aAAa,CAAA;AAEpB,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AA6DjE,KAAK,oBAAoB,GACrB,OAAO,sBAAsB,GAC7B,OAAO,yBAAyB,GAChC,OAAO,gCAAgC,CAAA;AAE3C,QAAA,MAAM,gCAAgC,EAAE,OACM,CAAA;AAE9C,QAAA,MAAM,sBAAsB,SAAS,CAAA;AACrC,QAAA,MAAM,yBAAyB,SAAS,CAAA;AACxC,QAAA,MAAM,gCAAgC,SAAS,CAAA;AAyB/C,iBAAe,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO;;;GAsBjE;AA6BD,iBAAe,+BAA+B,CAAC,KAAK,EAAE,KAAK;;;GAgB1D;AA0DD,iBAAS,wBAAwB,CAC/B,MAAM,EAAE,uBAAuB,GAC9B,MAAM,GAAG,IAAI,CAWf;AA8KD,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,GAAG,oBAiClB;AAED,iBAAS,2BAA2B,CAClC,IAAI,EAAE,oBAAoB,EAC1B,YAAY,EAAE,GAAG,EACjB,SAAS,EAAE,GAAG,iBAcf;AAED,iBAAS,eAAe,CAAC,OAAO,EAAE,OAAO,iBAyBxC;AAED,iBAAe,sBAAsB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;;;;;;GAoD3E;AAED,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,gCAAgC,EAChC,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,+BAA+B,GAChC,CAAA"}
|