Skip to content

Commit 9e5c740

Browse files
authored
docs: remove tab added by lint and expand time bounds description (#1411)
1 parent d19cb57 commit 9e5c740

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

www/docs/guides/paymaster.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ A Paymaster in Starknet allows your account to pay gas fees using alternative to
1010
STRK.
1111

1212
:::info
13+
1314
There are 2 types of paymaster transaction:
1415

1516
- `default` when the account is paying the fees.
1617
- `sponsored` when a dApp wants to cover the gas fees on behalf of users.
17-
:::
18+
19+
:::
1820

1921
In `starknet.js`, you can interact with a Paymaster in two ways:
2022

2123
- Through the `Account` or `WalletAccount` classes
2224
- Or directly via the `PaymasterRpc` class
2325

2426
:::warning IMPORTANT
27+
2528
To be able to use the Paymaster, accounts must be compatible with SNIP-9 (Outside execution).
2629
See [SNIP-9 compatibility](./outsideExecution.md#check-snip-9-support)
30+
2731
:::
2832

2933
## Paymaster service
@@ -140,20 +144,26 @@ Optional execution window with `executeAfter` and `executeBefore` dates:
140144
const feesDetails: PaymasterDetails = {
141145
feeMode: { mode: 'default', gasToken },
142146
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
145148
},
146149
};
147150
```
148151

149152
:::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+
151159
:::
152160

153161
### Deploy Account
154162

155163
:::warning important
164+
156165
If the account selected in the Wallet extension (Braavos, ArgentX, ...) is not deployed, you can't process a Paymaster transaction.
166+
157167
:::
158168

159169
If necessary, deploy first the account, using:

0 commit comments

Comments
 (0)