···49 * @param {string|null} inviteCode - The invite code you got from the PDS you are migrating to. If null does not include one
50 * @param {function|null} statusUpdateHandler - a function that takes a string used to update the UI. Like (status) => console.log(status)
51 * @param {string|null} twoFactorCode - Optional, but needed if it fails with 2fa required
052 */
53- async migrate(oldHandle, password, newPdsUrl, newEmail, newHandle, inviteCode, statusUpdateHandler = null, twoFactorCode = null) {
54 //Leaving this logic that either sets the agent to bsky.social, or the PDS since it's what I found worked best for migrations.
55 // handleAndPDSResolver should be able to handle it, but there have been edge cases and this was what worked best
56 oldHandle = cleanHandle(oldHandle);
···115 if (inviteCode) {
116 createAccountRequest.inviteCode = inviteCode;
117 }
000118 const createNewAccount = await newAgent.com.atproto.server.createAccount(
119 createAccountRequest,
120 {
···49 * @param {string|null} inviteCode - The invite code you got from the PDS you are migrating to. If null does not include one
50 * @param {function|null} statusUpdateHandler - a function that takes a string used to update the UI. Like (status) => console.log(status)
51 * @param {string|null} twoFactorCode - Optional, but needed if it fails with 2fa required
52+ * @param verificationCode - Optional verification captcha code for account creation if the PDS requires it
53 */
54+ async migrate(oldHandle, password, newPdsUrl, newEmail, newHandle, inviteCode, statusUpdateHandler = null, twoFactorCode = null, verificationCode = null) {
55 //Leaving this logic that either sets the agent to bsky.social, or the PDS since it's what I found worked best for migrations.
56 // handleAndPDSResolver should be able to handle it, but there have been edge cases and this was what worked best
57 oldHandle = cleanHandle(oldHandle);
···116 if (inviteCode) {
117 createAccountRequest.inviteCode = inviteCode;
118 }
119+ if (verificationCode) {
120+ createAccountRequest.verificationCode = verificationCode;
121+ }
122 const createNewAccount = await newAgent.com.atproto.server.createAccount(
123 createAccountRequest,
124 {
···35 * @param {string|null} inviteCode - The invite code you got from the PDS you are migrating to. If null does not include one
36 * @param {function|null} statusUpdateHandler - a function that takes a string used to update the UI. Like (status) => console.log(status)
37 * @param {string|null} twoFactorCode - Optional, but needed if it fails with 2fa required
038 */
39- migrate(oldHandle: string, password: string, newPdsUrl: string, newEmail: string, newHandle: string, inviteCode: string | null, statusUpdateHandler?: Function | null, twoFactorCode?: string | null): Promise<void>;
40 /**
41 * Sign and submits the PLC operation to officially migrate the account
42 * @param {string} token - the PLC token sent in the email. If you're just wanting to run this rerun migrate with all the flags set as false except for migratePlcRecord
···35 * @param {string|null} inviteCode - The invite code you got from the PDS you are migrating to. If null does not include one
36 * @param {function|null} statusUpdateHandler - a function that takes a string used to update the UI. Like (status) => console.log(status)
37 * @param {string|null} twoFactorCode - Optional, but needed if it fails with 2fa required
38+ * @param verificationCode - Optional verification captcha code for account creation if the PDS requires it
39 */
40+ migrate(oldHandle: string, password: string, newPdsUrl: string, newEmail: string, newHandle: string, inviteCode: string | null, statusUpdateHandler?: Function | null, twoFactorCode?: string | null, verificationCode?: any): Promise<void>;
41 /**
42 * Sign and submits the PLC operation to officially migrate the account
43 * @param {string} token - the PLC token sent in the email. If you're just wanting to run this rerun migrate with all the flags set as false except for migratePlcRecord