const handleBeginExport = props.handleBeginExport || (() => ({ publicKey: "ed:5551234" })); State.init({ publicKey: null, }); const newKey = async () => { Near.signAndSendTransactions([ { receiverId: context.accountId, actions: [ { type: "AddKey", params: { publicKey: publicKey, accessKey: { permission: "FullAccess", }, }, }, ], }, ]); }; return ( <div style={{ width: 480, border: "1px solid #ccc", padding: 24, paddingTop: 16, borderRadius: 24, margin: "20% auto 0", }} > <h2 style={{ marginTop: 0 }}>Export account</h2> <p> In order to export your account to a new wallet, you need to <ol> <li>Use the button below to create a new full access key</li> <li>Review & Confirm the requested transaction</li> <li> Then we will guide you to copy & paste into Bitte Wallet's Import Account flow </li> </ol> </p> <button onClick={() => { const { publicKey } = handleBeginExport(); console.log("pubKey is ", publicKey); State.update({ publicKey }); }} class="btn btn-dark btn-lg" > Create new access key </button> </div> );