@@ -10,20 +10,24 @@ A Paymaster in Starknet allows your account to pay gas fees using alternative to
10
10
STRK.
11
11
12
12
::: info
13
+
13
14
There are 2 types of paymaster transaction:
14
15
15
16
- ` default ` when the account is paying the fees.
16
17
- ` sponsored ` when a dApp wants to cover the gas fees on behalf of users.
17
- :::
18
+
19
+ :::
18
20
19
21
In ` starknet.js ` , you can interact with a Paymaster in two ways:
20
22
21
23
- Through the ` Account ` or ` WalletAccount ` classes
22
24
- Or directly via the ` PaymasterRpc ` class
23
25
24
26
:::warning IMPORTANT
27
+
25
28
To be able to use the Paymaster, accounts must be compatible with SNIP-9 (Outside execution).
26
29
See [ SNIP-9 compatibility] ( ./outsideExecution.md#check-snip-9-support )
30
+
27
31
:::
28
32
29
33
## Paymaster service
@@ -140,20 +144,26 @@ Optional execution window with `executeAfter` and `executeBefore` dates:
140
144
const feesDetails: PaymasterDetails = {
141
145
feeMode: { mode: ' default' , gasToken },
142
146
timeBounds: {
143
- executeBefore: Date .now () / 1000 + 60 , // 60 seconds
144
- executeAfter: Date .now () / 1000 ,
147
+ executeBefore: Math .floor (Date .now () / 1000 ) + 60 * 5 , // 5 minutes
145
148
},
146
149
};
147
150
```
148
151
149
152
::: note
150
- Time unit is the Starknet blockchain time unit: seconds.
153
+
154
+ - Time unit is the Starknet blockchain time unit: seconds.
155
+ - ` executeAfter ` is optional. If omitted, the transaction can be executed immediately.
156
+ - if ` executeAfter ` is defined, it must be strictly lower than the timestamp of the last block if you want to be able to process immediately.
157
+ - ` executeBefore ` : the transaction is possible as long as the Unix time of the SNIP-29 server is lower than executeBefore.
158
+
151
159
:::
152
160
153
161
### Deploy Account
154
162
155
163
:::warning important
164
+
156
165
If the account selected in the Wallet extension (Braavos, ArgentX, ...) is not deployed, you can't process a Paymaster transaction.
166
+
157
167
:::
158
168
159
169
If necessary, deploy first the account, using:
0 commit comments