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/blockchain-development-tutorials/cross-vm-apps/interacting-with-coa.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,45 @@ transaction() {
135
135
}
136
136
```
137
137
138
+
### Creating a Cadence Account and COA together
139
+
140
+
It is possible to create a new Cadence account and COA within the same transaction. This transaction will need to be signed and paid for by another account, but any account will do. A common process is to set up a backend service to handle this function.
141
+
142
+
:::info
143
+
144
+
During the singular transaction in which an account is created, the `AuthAccount` object for the newly created account is present. As a result, the creating account can access and modify the new account's storage **only** during this transaction.
145
+
146
+
:::
147
+
148
+
First, you'll need to use the CLI to [generate keys](../../build/tools/flow-cli/keys/generate-keys.md) for the new account. Then, simply run the following transaction to create the Cadence Account and COA at once.
149
+
150
+
:::warning
151
+
152
+
This is a very minimal example. You may wish to set up vaults and perform other actions during account creation.
0 commit comments