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
Turnkey's export functionality allows your end users to backup or transer a [Wallet](../getting-started/Wallets.md) by securely viewing the wallet's [mnemonic phrase](https://learnmeabitcoin.com/technical/mnemonic). We engineered this feature to ensure that the user can export their mnemonic without exposing the mnemonic itsef to Turnkey or your application.
9
9
10
-
Follow along with the guide below to set up Wallet export for your end users.
10
+
Follow along with the guide below to set up Wallet Export for your end users.
11
11
12
12
## Before you start
13
13
Make sure you have created a wallet for your user. Check out our [Quickstart guide](../getting-started/Quickstart.md) if you need help getting started.
@@ -31,9 +31,9 @@ Here's a diagram summarizing the wallet export flow step-by-step ([direct link](
31
31
32
32
Let's review these steps in detail:
33
33
34
-
1.User on `yoursite.xyz`clicks "export", and a new export UI is shown. We recommend setting this export UI as a new hosted page of your site or application that contains language explaining to the user the security best practices they should follow once they've successfully exported their wallet. Remember: once the wallet has been exported, Turnkey can no longer ensure its security.
34
+
1.When a user on your application clicks "export", display a new export UI. We recommend setting this export UI as a new hosted page of your application that contains language explaining the security best practices users should follow once they've successfully exported their wallet. Remember: once the wallet has been exported, Turnkey can no longer ensure its security.
35
35
36
-
While the UI is in a loading state, your frontend uses [`@turnkey/iframe-stamper`](https://www.npmjs.com/package/@turnkey/iframe-stamper) to insert a new iframe element:
36
+
While the UI is in a loading state, your application uses [`@turnkey/iframe-stamper`](https://www.npmjs.com/package/@turnkey/iframe-stamper) to insert a new iframe element:
37
37
```js
38
38
constiframeStamper=newIframeStamper({
39
39
iframeUrl:"https://export.turnkey.com",
@@ -50,16 +50,14 @@ Let's review these steps in detail:
50
50
51
51
return (
52
52
// The iframe element can be hidden until the wallet is exported
53
-
<div
54
-
style={{ display: displayIframe }}
55
-
/>
53
+
<div style={{ display: displayIframe }} />
56
54
);
57
55
```
58
-
2. Your code receives the iframe publickey. Yourapp prompts the user to sign a new`EXPORT_WALLET` activity with the wallet ID and the iframe public key in the parameters.
59
-
3. Your app polls for the activity response, which contains an exportbundle. Remember:thisexportbundleisanencryptedmnemonicwhichcanonlybedecryptedwithintheiframe.
56
+
2. Your code receives the iframe publickey. Yourapplication prompts the user to sign a new`EXPORT_WALLET` activity with the wallet ID and the iframe public key in the parameters.
57
+
3. Your application polls for the activity response, which contains an exportbundle. Remember:thisexportbundleisanencryptedmnemonicwhichcanonlybedecryptedwithintheiframe.
60
58
61
59
Need help setting up async polling? Checkout our guide and helper [here](https://github.com/tkhq/sdk/tree/main/packages/http#withasyncpolling-helper).
62
-
4. Your app injects the exportbundleintotheiframefordecryptionanddisplaystheiframeuponsuccess:
60
+
4. Your application injects the exportbundleintotheiframefordecryptionanddisplaystheiframeuponsuccess:
63
61
```js
64
62
// Inject export bundle into iframe
65
63
let success = await iframeStamper.injectWalletExportBundle(exportBundle);
0 commit comments