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
Copy file name to clipboardExpand all lines: docs/drain_account.md
+45-37Lines changed: 45 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,14 @@ Once we know the associated fees, we can calculate the maximum amount that needs
16
16
Finally, we can do the transfer operation and use the maximum amount we just calculated as the `amount` parameter of the `transfer` function.
17
17
18
18
:::note
19
-
In the following example, we have not revealed the account that we want to empty. We need to keep in mind that there are fees related to a reveal operation. We are subtracting 1420 mutez from the balance to cover reveal fees.
19
+
In the following example, we have not revealed the account that we want to empty. We need to keep in mind that there are fees related to a reveal operation. We are estimating the reveal fees and subtracting them from the balance to cover reveal fees.
20
20
21
-
**If the account to drain has already been revealed, you must not subtract this amount (1420 mutez) from the balance.**
21
+
**If the account to drain has already been revealed, you must not subtract the reveal fee from the balance.**
22
22
:::
23
23
24
24
```js live noInline
25
25
// const Tezos = new TezosToolkit('https://api.tez.ie/rpc/florencenet');
26
+
// import { DEFAULT_FEE } from "@taquito/taquito";
26
27
27
28
Tezos.signer
28
29
.publicKeyHash()
@@ -33,43 +34,50 @@ Tezos.signer
33
34
balance.toNumber() /1000000
34
35
} ꜩ.`
35
36
);
36
-
Tezos.estimate
37
-
.transfer({
38
-
to:'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr',
39
-
amount:balance.toNumber() -1420,
40
-
mutez:true,
41
-
})
42
-
.then((estimate) => {
43
-
//Subtract 1420 mutez for fees related to the reveal operation
0 commit comments