@rhinestone/sdk 1.0.43 → 1.1.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/index.d.ts +2 -5
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +0 -37
- package/dist/src/accounts/kernel.d.ts +2 -4
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +0 -16
- package/dist/src/accounts/nexus.d.ts +2 -4
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +0 -16
- package/dist/src/accounts/passport.d.ts +4 -7
- package/dist/src/accounts/passport.d.ts.map +1 -1
- package/dist/src/accounts/passport.js +0 -91
- package/dist/src/accounts/safe.d.ts +2 -4
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +0 -16
- package/dist/src/accounts/signing/common.d.ts +3 -3
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +18 -2
- package/dist/src/accounts/signing/message.js +2 -2
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +3 -3
- package/dist/src/accounts/startale.d.ts +2 -4
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +0 -4
- package/dist/src/actions/compact.d.ts +3 -2
- package/dist/src/actions/compact.d.ts.map +1 -1
- package/dist/src/actions/compact.js +1 -0
- package/dist/src/actions/smart-sessions.d.ts +7 -8
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +7 -4
- package/dist/src/execution/error.d.ts +1 -8
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +1 -10
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +3 -12
- package/dist/src/execution/utils.d.ts +1 -1
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +9 -17
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -4
- package/dist/src/modules/abi/smart-session-emissary.d.ts +696 -0
- package/dist/src/modules/abi/smart-session-emissary.d.ts.map +1 -0
- package/dist/src/modules/abi/smart-session-emissary.js +565 -0
- package/dist/src/modules/index.d.ts +2 -1
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +3 -1
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +2 -0
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.d.ts.map +1 -1
- package/dist/src/modules/validators/index.js +1 -6
- package/dist/src/modules/validators/smart-sessions.d.ts +105 -20
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +199 -439
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +1 -1
- package/dist/src/types.d.ts +8 -15
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/execution/smart-session.d.ts +0 -13
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -178
- package/dist/src/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.test.js +0 -219
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { type Address, type Hex, type
|
|
1
|
+
import { type Address, type Hex, type TypedDataDefinition } from 'viem';
|
|
2
2
|
import type { RhinestoneAccountConfig, Session } from '../../types';
|
|
3
3
|
import { type Module } from '../common';
|
|
4
4
|
interface SessionData {
|
|
5
5
|
sessionValidator: Address;
|
|
6
6
|
sessionValidatorInitData: Hex;
|
|
7
7
|
salt: Hex;
|
|
8
|
-
userOpPolicies: readonly UserOpPolicy[];
|
|
9
8
|
erc7739Policies: {
|
|
10
9
|
allowedERC7739Content: readonly AllowedERC7739Content[];
|
|
11
10
|
erc1271Policies: readonly ERC1271Policy[];
|
|
12
11
|
};
|
|
13
12
|
actions: readonly ActionData[];
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
interface UserOpPolicy {
|
|
17
|
-
policy: Address;
|
|
18
|
-
initData: Hex;
|
|
13
|
+
claimPolicies: readonly PolicyData[];
|
|
19
14
|
}
|
|
20
15
|
interface ERC1271Policy {
|
|
21
16
|
policy: Address;
|
|
@@ -23,7 +18,7 @@ interface ERC1271Policy {
|
|
|
23
18
|
}
|
|
24
19
|
interface AllowedERC7739Content {
|
|
25
20
|
appDomainSeparator: Hex;
|
|
26
|
-
|
|
21
|
+
contentNames: readonly string[];
|
|
27
22
|
}
|
|
28
23
|
interface ActionData {
|
|
29
24
|
actionTargetSelector: Hex;
|
|
@@ -69,28 +64,118 @@ interface ERC7739Context {
|
|
|
69
64
|
appDomainSeparator: Hex;
|
|
70
65
|
contentName: readonly string[];
|
|
71
66
|
}
|
|
72
|
-
interface
|
|
73
|
-
|
|
67
|
+
interface SessionDetails {
|
|
68
|
+
nonces: bigint[];
|
|
74
69
|
hashesAndChainIds: ChainDigest[];
|
|
75
|
-
|
|
76
|
-
signature: Hex;
|
|
70
|
+
data: TypedDataDefinition<typeof types, 'MultiChainSession'>;
|
|
77
71
|
}
|
|
78
|
-
declare const
|
|
72
|
+
declare const types: {
|
|
73
|
+
readonly PolicyData: readonly [{
|
|
74
|
+
readonly name: "policy";
|
|
75
|
+
readonly type: "address";
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "initData";
|
|
78
|
+
readonly type: "bytes";
|
|
79
|
+
}];
|
|
80
|
+
readonly ActionData: readonly [{
|
|
81
|
+
readonly name: "actionTargetSelector";
|
|
82
|
+
readonly type: "bytes4";
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "actionTarget";
|
|
85
|
+
readonly type: "address";
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "actionPolicies";
|
|
88
|
+
readonly type: "PolicyData[]";
|
|
89
|
+
}];
|
|
90
|
+
readonly ERC7739Context: readonly [{
|
|
91
|
+
readonly name: "appDomainSeparator";
|
|
92
|
+
readonly type: "bytes32";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "contentName";
|
|
95
|
+
readonly type: "string[]";
|
|
96
|
+
}];
|
|
97
|
+
readonly ERC7739Data: readonly [{
|
|
98
|
+
readonly name: "allowedERC7739Content";
|
|
99
|
+
readonly type: "ERC7739Context[]";
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "erc1271Policies";
|
|
102
|
+
readonly type: "PolicyData[]";
|
|
103
|
+
}];
|
|
104
|
+
readonly LockTagData: readonly [{
|
|
105
|
+
readonly name: "lockTag";
|
|
106
|
+
readonly type: "bytes12";
|
|
107
|
+
}, {
|
|
108
|
+
readonly name: "claimPolicies";
|
|
109
|
+
readonly type: "PolicyData[]";
|
|
110
|
+
}];
|
|
111
|
+
readonly SignedPermissions: readonly [{
|
|
112
|
+
readonly name: "actions";
|
|
113
|
+
readonly type: "ActionData[]";
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "erc7739Policies";
|
|
116
|
+
readonly type: "ERC7739Data";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "lockTagPolicies";
|
|
119
|
+
readonly type: "LockTagData";
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "permitGenericPolicy";
|
|
122
|
+
readonly type: "bool";
|
|
123
|
+
}];
|
|
124
|
+
readonly SignedSession: readonly [{
|
|
125
|
+
readonly name: "account";
|
|
126
|
+
readonly type: "address";
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "expires";
|
|
129
|
+
readonly type: "uint256";
|
|
130
|
+
}, {
|
|
131
|
+
readonly name: "nonce";
|
|
132
|
+
readonly type: "uint256";
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "permissions";
|
|
135
|
+
readonly type: "SignedPermissions";
|
|
136
|
+
}, {
|
|
137
|
+
readonly name: "salt";
|
|
138
|
+
readonly type: "bytes32";
|
|
139
|
+
}, {
|
|
140
|
+
readonly name: "sessionValidator";
|
|
141
|
+
readonly type: "address";
|
|
142
|
+
}, {
|
|
143
|
+
readonly name: "sessionValidatorInitData";
|
|
144
|
+
readonly type: "bytes";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "smartSessionEmissary";
|
|
147
|
+
readonly type: "address";
|
|
148
|
+
}];
|
|
149
|
+
readonly ChainSession: readonly [{
|
|
150
|
+
readonly name: "chainId";
|
|
151
|
+
readonly type: "uint64";
|
|
152
|
+
}, {
|
|
153
|
+
readonly name: "session";
|
|
154
|
+
readonly type: "SignedSession";
|
|
155
|
+
}];
|
|
156
|
+
readonly MultiChainSession: readonly [{
|
|
157
|
+
readonly name: "sessionsAndChainIds";
|
|
158
|
+
readonly type: "ChainSession[]";
|
|
159
|
+
}];
|
|
160
|
+
};
|
|
161
|
+
declare const SMART_SESSION_EMISSARY_ADDRESS: Address;
|
|
79
162
|
declare const SMART_SESSION_MODE_USE = "0x00";
|
|
80
163
|
declare const SMART_SESSION_MODE_ENABLE = "0x01";
|
|
81
164
|
declare const SMART_SESSION_MODE_UNSAFE_ENABLE = "0x02";
|
|
82
165
|
declare const SMART_SESSIONS_FALLBACK_TARGET_FLAG: Address;
|
|
83
166
|
declare const SMART_SESSIONS_FALLBACK_TARGET_SELECTOR_FLAG: Hex;
|
|
84
167
|
declare const SMART_SESSIONS_FALLBACK_TARGET_SELECTOR_FLAG_PERMITTED_TO_CALL_SMARTSESSION: Hex;
|
|
85
|
-
declare function
|
|
168
|
+
declare function getSessionDetails(account: Address, sessions: Session[]): Promise<SessionDetails>;
|
|
169
|
+
declare function getEnableSessionCall(account: Address, session: Session, enableSessionSignature: Hex, hashesAndChainIds: {
|
|
170
|
+
chainId: bigint;
|
|
171
|
+
sessionDigest: Hex;
|
|
172
|
+
}[], sessionToEnableIndex: number): Promise<{
|
|
86
173
|
to: `0x${string}`;
|
|
87
174
|
data: `0x${string}`;
|
|
88
175
|
}>;
|
|
89
|
-
declare function
|
|
90
|
-
declare function getSmartSessionValidator(config: RhinestoneAccountConfig): Module | null;
|
|
91
|
-
declare function isSessionEnabled(client: PublicClient, address: Address, permissionId: Hex): Promise<boolean>;
|
|
92
|
-
declare function encodeSmartSessionSignature(mode: SmartSessionModeType, permissionId: Hex, signature: Hex, enableSessionData?: EnableSessionData): `0x${string}`;
|
|
176
|
+
declare function getSessionData(session: Session): SessionData;
|
|
93
177
|
declare function getPermissionId(session: Session): `0x${string}`;
|
|
94
|
-
|
|
95
|
-
export
|
|
178
|
+
declare function getSmartSessionValidator(config: RhinestoneAccountConfig): Module | null;
|
|
179
|
+
export { SMART_SESSION_EMISSARY_ADDRESS, SMART_SESSIONS_FALLBACK_TARGET_FLAG, SMART_SESSIONS_FALLBACK_TARGET_SELECTOR_FLAG, SMART_SESSIONS_FALLBACK_TARGET_SELECTOR_FLAG_PERMITTED_TO_CALL_SMARTSESSION, getSessionData, getEnableSessionCall, getPermissionId, getSmartSessionValidator, getSessionDetails, };
|
|
180
|
+
export type { ChainSession, ChainDigest, SessionData, SmartSessionModeType, SessionDetails, };
|
|
96
181
|
//# sourceMappingURL=smart-sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/smart-sessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAIZ,KAAK,GAAG,EAKR,KAAK,mBAAmB,EAGzB,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEnE,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAGjE,UAAU,WAAW;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACz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