Skip to content

Commit 7595cc8

Browse files
committed
export enums, update test to use them
1 parent e31ed6b commit 7595cc8

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

packages/thirdweb/src/exports/wallets/in-app.native.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ export {
2929
type CreateSessionKeyOptions,
3030
createSessionKey,
3131
isCreateSessionKeySupported,
32-
} from "../../extensions/erc7702/account/createSessionKey.js";
32+
} from "../../extensions/erc7702/account/createSessionKey.js";
33+
export type {
34+
LimitType,
35+
Condition,
36+
} from "../../extensions/erc7702/account/types.js";

packages/thirdweb/src/exports/wallets/in-app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ export {
3333
type CreateSessionKeyOptions,
3434
createSessionKey,
3535
isCreateSessionKeySupported,
36-
} from "../../extensions/erc7702/account/createSessionKey.js";
36+
} from "../../extensions/erc7702/account/createSessionKey.js";
37+
export type {
38+
LimitType,
39+
Condition,
40+
} from "../../extensions/erc7702/account/types.js";

packages/thirdweb/src/extensions/erc7702/account/sessionkey.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { parseEventLogs } from "../../../event/actions/parse-logs.js";
1414
import { sendAndConfirmTransaction } from "../../../transaction/actions/send-and-confirm-transaction.js";
1515
import { sessionCreatedEvent } from "../__generated__/MinimalAccount/events/SessionCreated.js";
1616
import { createSessionKey } from "./createSessionKey.js";
17+
import { Condition, LimitType } from "./types.js";
1718

1819
describe.runIf(process.env.TW_SECRET_KEY)(
1920
"Session Key Behavior",
@@ -84,13 +85,19 @@ describe.runIf(process.env.TW_SECRET_KEY)(
8485
account: account,
8586
callPolicies: [
8687
{
87-
constraints: [],
88+
constraints: [
89+
{
90+
condition: Condition.Unconstrained,
91+
index: 0n,
92+
refValue: "0x0000000000000000000000000000000000000000000000000000000000000000"
93+
}
94+
],
8895
maxValuePerUse: 0n,
8996
selector: "0x00000000",
9097
target: ZERO_ADDRESS,
9198
valueLimit: {
9299
limit: 0n,
93-
limitType: 0,
100+
limitType: LimitType.Unlimited,
94101
period: 0n,
95102
},
96103
},

0 commit comments

Comments
 (0)