You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Execute transactions - user will see approval dialog
61
83
const tx =awaitaccount.execute([
62
84
{
63
-
contractAddress: "0x...",
64
-
entrypoint: "my_function",
85
+
contractAddress: "0x1234...",
86
+
entrypoint: "move_player",
65
87
calldata: ["0x1", "0x2"],
66
88
}
67
89
]);
68
90
```
69
91
92
+
### Simple Controller (No Sessions)
93
+
94
+
For basic usage without session management:
95
+
96
+
```ts
97
+
importControllerfrom"@cartridge/controller";
98
+
99
+
// Initialize with minimal configuration
100
+
const controller =newController();
101
+
102
+
// Connect and use
103
+
const account =awaitcontroller.connect();
104
+
```
105
+
70
106
> **Note:** When no policies are provided, each transaction requires manual user approval through the Cartridge interface. This is suitable for simple applications or testing, but games typically benefit from using [session policies](#configuration-with-session-policies) for a smoother experience.
71
107
72
108
## Configuration with Session Policies
@@ -90,7 +126,7 @@ const controller = new Controller({
90
126
},
91
127
{
92
128
name: "attack",
93
-
entrypoint: "attack",
129
+
entrypoint: "attack",
94
130
description: "Attack enemy",
95
131
},
96
132
],
@@ -102,18 +138,51 @@ const controller = new Controller({
0 commit comments