@getpara/core-sdk 2.11.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ParaCore.js +809 -2003
- package/dist/cjs/constants.js +4 -1
- package/dist/cjs/services/AuthService.js +787 -0
- package/dist/cjs/services/BaseAuthFlowService.js +78 -0
- package/dist/cjs/services/ExternalWalletService.js +386 -0
- package/dist/cjs/services/LoginFlowService.js +163 -0
- package/dist/cjs/services/PollingService.js +448 -0
- package/dist/cjs/services/PortalUrlService.js +379 -0
- package/dist/cjs/services/PregenWalletService.js +442 -0
- package/dist/cjs/services/SessionManagementService.js +280 -0
- package/dist/cjs/services/SignupFlowService.js +185 -0
- package/dist/cjs/services/VerificationFlowService.js +242 -0
- package/dist/cjs/services/WalletService.js +577 -0
- package/dist/cjs/services/types/AuthServiceTypes.js +15 -0
- package/dist/cjs/services/types/BaseAuthFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/ExternalWalletServiceTypes.js +15 -0
- package/dist/cjs/services/types/LoginFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/PollingServiceTypes.js +15 -0
- package/dist/cjs/services/types/PortalUrlServiceTypes.js +15 -0
- package/dist/cjs/services/types/PregenWalletServiceTypes.js +15 -0
- package/dist/cjs/services/types/SessionManagementServiceTypes.js +15 -0
- package/dist/cjs/services/types/SignupFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/VerificationFlowServiceTypes.js +15 -0
- package/dist/cjs/services/types/WalletServiceTypes.js +15 -0
- package/dist/cjs/services/types/index.js +15 -0
- package/dist/cjs/state/CoreStateManager.js +297 -0
- package/dist/cjs/state/actors/authenticateWithEmailOrPhone.js +50 -0
- package/dist/cjs/state/actors/authenticateWithExternalWallet.js +50 -0
- package/dist/cjs/state/actors/authenticateWithFarcaster.js +50 -0
- package/dist/cjs/state/actors/authenticateWithFarcasterLegacy.js +50 -0
- package/dist/cjs/state/actors/authenticateWithTelegram.js +50 -0
- package/dist/cjs/state/actors/authenticateWithTelegramLegacy.js +50 -0
- package/dist/cjs/state/actors/checkUserState.js +53 -0
- package/dist/cjs/state/actors/claimWallets.js +56 -0
- package/dist/cjs/state/actors/connectExternalConnectors.js +54 -0
- package/dist/cjs/state/actors/connectExternalWallet.js +50 -0
- package/dist/cjs/state/actors/createGuestWallets.js +50 -0
- package/dist/cjs/state/actors/createWallets.js +73 -0
- package/dist/cjs/state/actors/polling.js +91 -0
- package/dist/cjs/state/actors/processAuthentication.js +50 -0
- package/dist/cjs/state/actors/setupAfterLogin.js +52 -0
- package/dist/cjs/state/actors/setupPara.js +50 -0
- package/dist/cjs/state/actors/signExternalWalletVerification.js +79 -0
- package/dist/cjs/state/actors/switchExternalWallet.js +50 -0
- package/dist/cjs/state/actors/verifyExternalWallet.js +50 -0
- package/dist/cjs/state/actors/verifyNewAccount.js +50 -0
- package/dist/cjs/state/actors/waitForExternalWalletProviders.js +54 -0
- package/dist/cjs/state/machines/authStateMachine.helpers.js +137 -0
- package/dist/cjs/state/machines/authStateMachine.js +1084 -0
- package/dist/cjs/state/machines/coreStateMachine.js +383 -0
- package/dist/cjs/state/machines/walletStateMachine.js +437 -0
- package/dist/cjs/state/types/auth.js +15 -0
- package/dist/cjs/state/types/core.js +15 -0
- package/dist/cjs/state/types/wallet.js +15 -0
- package/dist/cjs/types/{auth.js → accountLinking.js} +3 -3
- package/dist/cjs/types/authState.js +15 -0
- package/dist/cjs/types/coreApi.js +3 -1
- package/dist/cjs/types/index.js +2 -2
- package/dist/cjs/types/serviceInterfaces.js +15 -0
- package/dist/cjs/types/util.js +15 -0
- package/dist/cjs/utils/formatting.js +6 -0
- package/dist/cjs/utils/retryBackoff.js +30 -0
- package/dist/cjs/utils/stateErrorHelpers.js +60 -0
- package/dist/cjs/utils/stateListener.js +129 -0
- package/dist/esm/ParaCore.js +812 -2031
- package/dist/esm/constants.js +3 -1
- package/dist/esm/services/AuthService.js +717 -0
- package/dist/esm/services/BaseAuthFlowService.js +25 -0
- package/dist/esm/services/ExternalWalletService.js +327 -0
- package/dist/esm/services/LoginFlowService.js +97 -0
- package/dist/esm/services/PollingService.js +389 -0
- package/dist/esm/services/PortalUrlService.js +320 -0
- package/dist/esm/services/PregenWalletService.js +393 -0
- package/dist/esm/services/SessionManagementService.js +236 -0
- package/dist/esm/services/SignupFlowService.js +119 -0
- package/dist/esm/services/VerificationFlowService.js +178 -0
- package/dist/esm/services/WalletService.js +514 -0
- package/dist/esm/services/types/AuthServiceTypes.js +0 -0
- package/dist/esm/services/types/BaseAuthFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/ExternalWalletServiceTypes.js +0 -0
- package/dist/esm/services/types/LoginFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/PollingServiceTypes.js +0 -0
- package/dist/esm/services/types/PortalUrlServiceTypes.js +0 -0
- package/dist/esm/services/types/PregenWalletServiceTypes.js +0 -0
- package/dist/esm/services/types/SessionManagementServiceTypes.js +0 -0
- package/dist/esm/services/types/SignupFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/VerificationFlowServiceTypes.js +0 -0
- package/dist/esm/services/types/WalletServiceTypes.js +0 -0
- package/dist/esm/services/types/index.js +0 -0
- package/dist/esm/state/CoreStateManager.js +261 -0
- package/dist/esm/state/actors/authenticateWithEmailOrPhone.js +10 -0
- package/dist/esm/state/actors/authenticateWithExternalWallet.js +10 -0
- package/dist/esm/state/actors/authenticateWithFarcaster.js +10 -0
- package/dist/esm/state/actors/authenticateWithFarcasterLegacy.js +10 -0
- package/dist/esm/state/actors/authenticateWithTelegram.js +10 -0
- package/dist/esm/state/actors/authenticateWithTelegramLegacy.js +10 -0
- package/dist/esm/state/actors/checkUserState.js +13 -0
- package/dist/esm/state/actors/claimWallets.js +16 -0
- package/dist/esm/state/actors/connectExternalConnectors.js +14 -0
- package/dist/esm/state/actors/connectExternalWallet.js +10 -0
- package/dist/esm/state/actors/createGuestWallets.js +10 -0
- package/dist/esm/state/actors/createWallets.js +20 -0
- package/dist/esm/state/actors/polling.js +55 -0
- package/dist/esm/state/actors/processAuthentication.js +10 -0
- package/dist/esm/state/actors/setupAfterLogin.js +12 -0
- package/dist/esm/state/actors/setupPara.js +10 -0
- package/dist/esm/state/actors/signExternalWalletVerification.js +15 -0
- package/dist/esm/state/actors/switchExternalWallet.js +10 -0
- package/dist/esm/state/actors/verifyExternalWallet.js +10 -0
- package/dist/esm/state/actors/verifyNewAccount.js +10 -0
- package/dist/esm/state/actors/waitForExternalWalletProviders.js +14 -0
- package/dist/esm/state/machines/authStateMachine.helpers.js +92 -0
- package/dist/esm/state/machines/authStateMachine.js +1039 -0
- package/dist/esm/state/machines/coreStateMachine.js +343 -0
- package/dist/esm/state/machines/walletStateMachine.js +382 -0
- package/dist/esm/state/types/auth.js +0 -0
- package/dist/esm/state/types/core.js +0 -0
- package/dist/esm/state/types/wallet.js +0 -0
- package/dist/esm/types/authState.js +0 -0
- package/dist/esm/types/coreApi.js +3 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/serviceInterfaces.js +0 -0
- package/dist/esm/types/util.js +0 -0
- package/dist/esm/utils/formatting.js +6 -0
- package/dist/esm/utils/retryBackoff.js +7 -0
- package/dist/esm/utils/stateErrorHelpers.js +37 -0
- package/dist/esm/utils/stateListener.js +106 -0
- package/dist/types/ParaCore.d.ts +190 -119
- package/dist/types/PlatformUtils.d.ts +23 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/services/AuthService.d.ts +72 -0
- package/dist/types/services/BaseAuthFlowService.d.ts +28 -0
- package/dist/types/services/ExternalWalletService.d.ts +44 -0
- package/dist/types/services/LoginFlowService.d.ts +9 -0
- package/dist/types/services/PollingService.d.ts +35 -0
- package/dist/types/services/PortalUrlService.d.ts +26 -0
- package/dist/types/services/PregenWalletService.d.ts +38 -0
- package/dist/types/services/SessionManagementService.d.ts +28 -0
- package/dist/types/services/SignupFlowService.d.ts +10 -0
- package/dist/types/services/VerificationFlowService.d.ts +17 -0
- package/dist/types/services/WalletService.d.ts +54 -0
- package/dist/types/services/types/AuthServiceTypes.d.ts +147 -0
- package/dist/types/services/types/BaseAuthFlowServiceTypes.d.ts +4 -0
- package/dist/types/services/types/ExternalWalletServiceTypes.d.ts +67 -0
- package/dist/types/services/types/LoginFlowServiceTypes.d.ts +19 -0
- package/dist/types/services/types/PollingServiceTypes.d.ts +82 -0
- package/dist/types/services/types/PortalUrlServiceTypes.d.ts +46 -0
- package/dist/types/services/types/PregenWalletServiceTypes.d.ts +73 -0
- package/dist/types/services/types/SessionManagementServiceTypes.d.ts +27 -0
- package/dist/types/services/types/SignupFlowServiceTypes.d.ts +18 -0
- package/dist/types/services/types/VerificationFlowServiceTypes.d.ts +90 -0
- package/dist/types/services/types/WalletServiceTypes.d.ts +109 -0
- package/dist/types/services/types/index.d.ts +11 -0
- package/dist/types/state/CoreStateManager.d.ts +36 -0
- package/dist/types/state/actors/authenticateWithEmailOrPhone.d.ts +8 -0
- package/dist/types/state/actors/authenticateWithExternalWallet.d.ts +8 -0
- package/dist/types/state/actors/authenticateWithFarcaster.d.ts +3 -0
- package/dist/types/state/actors/authenticateWithFarcasterLegacy.d.ts +3 -0
- package/dist/types/state/actors/authenticateWithTelegram.d.ts +3 -0
- package/dist/types/state/actors/authenticateWithTelegramLegacy.d.ts +8 -0
- package/dist/types/state/actors/checkUserState.d.ts +6 -0
- package/dist/types/state/actors/claimWallets.d.ts +8 -0
- package/dist/types/state/actors/connectExternalConnectors.d.ts +4 -0
- package/dist/types/state/actors/connectExternalWallet.d.ts +3 -0
- package/dist/types/state/actors/createGuestWallets.d.ts +3 -0
- package/dist/types/state/actors/createWallets.d.ts +10 -0
- package/dist/types/state/actors/polling.d.ts +3 -0
- package/dist/types/state/actors/processAuthentication.d.ts +10 -0
- package/dist/types/state/actors/setupAfterLogin.d.ts +5 -0
- package/dist/types/state/actors/setupPara.d.ts +2 -0
- package/dist/types/state/actors/signExternalWalletVerification.d.ts +7 -0
- package/dist/types/state/actors/switchExternalWallet.d.ts +3 -0
- package/dist/types/state/actors/verifyExternalWallet.d.ts +8 -0
- package/dist/types/state/actors/verifyNewAccount.d.ts +8 -0
- package/dist/types/state/actors/waitForExternalWalletProviders.d.ts +2 -0
- package/dist/types/state/machines/authStateMachine.d.ts +2570 -0
- package/dist/types/state/machines/authStateMachine.helpers.d.ts +57 -0
- package/dist/types/state/machines/coreStateMachine.d.ts +22033 -0
- package/dist/types/state/machines/walletStateMachine.d.ts +1049 -0
- package/dist/types/state/types/auth.d.ts +113 -0
- package/dist/types/state/types/core.d.ts +114 -0
- package/dist/types/state/types/wallet.d.ts +76 -0
- package/dist/types/types/authState.d.ts +66 -0
- package/dist/types/types/config.d.ts +5 -0
- package/dist/types/types/coreApi.d.ts +148 -298
- package/dist/types/types/index.d.ts +3 -1
- package/dist/types/types/methods.d.ts +1 -191
- package/dist/types/types/serviceInterfaces.d.ts +125 -0
- package/dist/types/types/util.d.ts +43 -0
- package/dist/types/types/wallet.d.ts +3 -1
- package/dist/types/utils/retryBackoff.d.ts +2 -0
- package/dist/types/utils/stateErrorHelpers.d.ts +2 -0
- package/dist/types/utils/stateListener.d.ts +47 -0
- package/package.json +5 -4
- /package/dist/esm/types/{auth.js → accountLinking.js} +0 -0
- /package/dist/types/types/{auth.d.ts → accountLinking.d.ts} +0 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-7B52C2XE.js";
|
|
5
|
+
import { createActor } from "xstate";
|
|
6
|
+
import { createCoreStateMachine } from "./machines/coreStateMachine.js";
|
|
7
|
+
const _CoreStateManager = class _CoreStateManager {
|
|
8
|
+
constructor(paraCore) {
|
|
9
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
10
|
+
this.childSubscriptions = /* @__PURE__ */ new Map();
|
|
11
|
+
this.currentAuthRefId = null;
|
|
12
|
+
this.currentWalletRefId = null;
|
|
13
|
+
this.lastNotifiedState = null;
|
|
14
|
+
const stateMachineInterface = paraCore.getStateMachineInterface();
|
|
15
|
+
this.devLog = stateMachineInterface.devLog;
|
|
16
|
+
const machine = createCoreStateMachine(stateMachineInterface);
|
|
17
|
+
this.service = createActor(machine);
|
|
18
|
+
this.service.subscribe((state) => {
|
|
19
|
+
this.subscribeToChildMachines(state);
|
|
20
|
+
const coreState = this.mapXStateToCoreState(state);
|
|
21
|
+
this.notifyListeners(coreState);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
subscribeToChildMachines(state) {
|
|
25
|
+
this.subscribeToChildRef(state.context.authMachineRef, "auth");
|
|
26
|
+
this.subscribeToChildRef(state.context.walletMachineRef, "wallet");
|
|
27
|
+
}
|
|
28
|
+
subscribeToChildRef(ref, slot) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
const currentIdKey = slot === "auth" ? "currentAuthRefId" : "currentWalletRefId";
|
|
31
|
+
const currentId = this[currentIdKey];
|
|
32
|
+
if (((_a = ref == null ? void 0 : ref.id) != null ? _a : null) === currentId) return;
|
|
33
|
+
if (currentId) {
|
|
34
|
+
(_b = this.childSubscriptions.get(currentId)) == null ? void 0 : _b();
|
|
35
|
+
this.childSubscriptions.delete(currentId);
|
|
36
|
+
}
|
|
37
|
+
this[currentIdKey] = (_c = ref == null ? void 0 : ref.id) != null ? _c : null;
|
|
38
|
+
if (ref) {
|
|
39
|
+
const subscription = ref.subscribe(() => {
|
|
40
|
+
const coreState = this.mapXStateToCoreState(this.service.getSnapshot());
|
|
41
|
+
this.notifyListeners(coreState);
|
|
42
|
+
});
|
|
43
|
+
this.childSubscriptions.set(ref.id, () => subscription.unsubscribe());
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
start() {
|
|
47
|
+
this.service.start();
|
|
48
|
+
}
|
|
49
|
+
stop() {
|
|
50
|
+
this.childSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
51
|
+
this.childSubscriptions.clear();
|
|
52
|
+
this.currentAuthRefId = null;
|
|
53
|
+
this.currentWalletRefId = null;
|
|
54
|
+
this.lastNotifiedState = null;
|
|
55
|
+
this.service.stop();
|
|
56
|
+
}
|
|
57
|
+
send(event) {
|
|
58
|
+
this.service.send(event);
|
|
59
|
+
}
|
|
60
|
+
getSnapshot() {
|
|
61
|
+
return this.mapXStateToCoreState(this.service.getSnapshot());
|
|
62
|
+
}
|
|
63
|
+
onStateChange(listener) {
|
|
64
|
+
this.listeners.add(listener);
|
|
65
|
+
listener(this.getSnapshot());
|
|
66
|
+
return () => {
|
|
67
|
+
this.listeners.delete(listener);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
getAuthMachineState(xstate) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
return (_b = (_a = xstate.context) == null ? void 0 : _a.authMachineRef) == null ? void 0 : _b.getSnapshot();
|
|
73
|
+
}
|
|
74
|
+
getWalletMachineState(xstate) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
return (_b = (_a = xstate.context) == null ? void 0 : _a.walletMachineRef) == null ? void 0 : _b.getSnapshot();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Computes AuthStateInfo from the auth machine context.
|
|
80
|
+
* Extracts all data needed by UI consumers from authStateResult.
|
|
81
|
+
*/
|
|
82
|
+
computeAuthStateInfo(authContext, walletContext) {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
84
|
+
const defaultAuthStateInfo = {
|
|
85
|
+
userId: null,
|
|
86
|
+
isPasskeySupported: false,
|
|
87
|
+
passkeyHints: null,
|
|
88
|
+
hasPasskey: false,
|
|
89
|
+
hasPassword: false,
|
|
90
|
+
hasPin: false,
|
|
91
|
+
passkeyUrl: null,
|
|
92
|
+
passkeyKnownDeviceUrl: null,
|
|
93
|
+
passwordUrl: null,
|
|
94
|
+
pinUrl: null,
|
|
95
|
+
verificationUrl: null,
|
|
96
|
+
externalWalletVerification: null,
|
|
97
|
+
recoverySecret: null,
|
|
98
|
+
isNewUser: false
|
|
99
|
+
};
|
|
100
|
+
if (!authContext) {
|
|
101
|
+
return defaultAuthStateInfo;
|
|
102
|
+
}
|
|
103
|
+
const authStateResult = authContext.authStateResult;
|
|
104
|
+
const externalWalletVerification = authContext.externalWalletSignVerification;
|
|
105
|
+
const isNewUser = (_a = authContext.isNewUser) != null ? _a : false;
|
|
106
|
+
const recoverySecret = (_c = (_b = walletContext == null ? void 0 : walletContext.newWalletsResult) == null ? void 0 : _b.recoverySecret) != null ? _c : null;
|
|
107
|
+
if (!authStateResult) {
|
|
108
|
+
return __spreadProps(__spreadValues({}, defaultAuthStateInfo), {
|
|
109
|
+
isNewUser,
|
|
110
|
+
recoverySecret,
|
|
111
|
+
externalWalletVerification: externalWalletVerification ? {
|
|
112
|
+
signatureVerificationMessage: (_d = externalWalletVerification.signatureVerificationMessage) != null ? _d : "",
|
|
113
|
+
walletAddress: (_f = (_e = externalWalletVerification.externalWallet) == null ? void 0 : _e.address) != null ? _f : "",
|
|
114
|
+
walletType: (_h = (_g = externalWalletVerification.externalWallet) == null ? void 0 : _g.type) != null ? _h : ""
|
|
115
|
+
} : null
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const stage = authStateResult.stage;
|
|
119
|
+
const userId = (_i = authStateResult.userId) != null ? _i : null;
|
|
120
|
+
let hasPasskey = false;
|
|
121
|
+
let hasPassword = false;
|
|
122
|
+
let hasPin = false;
|
|
123
|
+
let isPasskeySupported = false;
|
|
124
|
+
let passkeyUrl = null;
|
|
125
|
+
let passkeyKnownDeviceUrl = null;
|
|
126
|
+
let passwordUrl = null;
|
|
127
|
+
let pinUrl = null;
|
|
128
|
+
let verificationUrl = null;
|
|
129
|
+
let passkeyHints = null;
|
|
130
|
+
if (stage === "login") {
|
|
131
|
+
const loginState = authStateResult;
|
|
132
|
+
const authMethods = (_j = loginState.loginAuthMethods) != null ? _j : [];
|
|
133
|
+
hasPasskey = authMethods.includes("PASSKEY");
|
|
134
|
+
hasPassword = authMethods.includes("PASSWORD");
|
|
135
|
+
hasPin = authMethods.includes("PIN");
|
|
136
|
+
isPasskeySupported = (_k = loginState.isPasskeySupported) != null ? _k : false;
|
|
137
|
+
passkeyUrl = (_l = loginState.passkeyUrl) != null ? _l : null;
|
|
138
|
+
passkeyKnownDeviceUrl = (_m = loginState.passkeyKnownDeviceUrl) != null ? _m : null;
|
|
139
|
+
passwordUrl = (_n = loginState.passwordUrl) != null ? _n : null;
|
|
140
|
+
pinUrl = (_o = loginState.pinUrl) != null ? _o : null;
|
|
141
|
+
passkeyHints = (_p = loginState.biometricHints) != null ? _p : null;
|
|
142
|
+
} else if (stage === "signup") {
|
|
143
|
+
const signupState = authStateResult;
|
|
144
|
+
const authMethods = (_q = signupState.signupAuthMethods) != null ? _q : [];
|
|
145
|
+
hasPasskey = authMethods.includes("PASSKEY");
|
|
146
|
+
hasPassword = authMethods.includes("PASSWORD");
|
|
147
|
+
hasPin = authMethods.includes("PIN");
|
|
148
|
+
isPasskeySupported = (_r = signupState.isPasskeySupported) != null ? _r : false;
|
|
149
|
+
passkeyUrl = (_s = signupState.passkeyUrl) != null ? _s : null;
|
|
150
|
+
passwordUrl = (_t = signupState.passwordUrl) != null ? _t : null;
|
|
151
|
+
pinUrl = (_u = signupState.pinUrl) != null ? _u : null;
|
|
152
|
+
} else if (stage === "verify") {
|
|
153
|
+
const verifyState = authStateResult;
|
|
154
|
+
verificationUrl = (_v = verifyState.loginUrl) != null ? _v : null;
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
userId,
|
|
158
|
+
isPasskeySupported,
|
|
159
|
+
passkeyHints,
|
|
160
|
+
hasPasskey,
|
|
161
|
+
hasPassword,
|
|
162
|
+
hasPin,
|
|
163
|
+
passkeyUrl,
|
|
164
|
+
passkeyKnownDeviceUrl,
|
|
165
|
+
passwordUrl,
|
|
166
|
+
pinUrl,
|
|
167
|
+
verificationUrl,
|
|
168
|
+
externalWalletVerification: externalWalletVerification ? {
|
|
169
|
+
signatureVerificationMessage: (_w = externalWalletVerification.signatureVerificationMessage) != null ? _w : "",
|
|
170
|
+
walletAddress: (_y = (_x = externalWalletVerification.externalWallet) == null ? void 0 : _x.address) != null ? _y : "",
|
|
171
|
+
walletType: (_A = (_z = externalWalletVerification.externalWallet) == null ? void 0 : _z.type) != null ? _A : ""
|
|
172
|
+
} : null,
|
|
173
|
+
recoverySecret,
|
|
174
|
+
isNewUser
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
mapXStateToCoreState(xstate) {
|
|
178
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
179
|
+
const coreStatePhase = xstate.value;
|
|
180
|
+
const authMachineState = this.getAuthMachineState(xstate);
|
|
181
|
+
const walletMachineState = this.getWalletMachineState(xstate);
|
|
182
|
+
const authStatePhase = (_a = authMachineState == null ? void 0 : authMachineState.value) != null ? _a : "uninitialized";
|
|
183
|
+
const walletStatePhase = (_b = walletMachineState == null ? void 0 : walletMachineState.value) != null ? _b : "uninitialized";
|
|
184
|
+
const authContext = (_c = authMachineState == null ? void 0 : authMachineState.context) != null ? _c : null;
|
|
185
|
+
const walletContext = (_d = walletMachineState == null ? void 0 : walletMachineState.context) != null ? _d : null;
|
|
186
|
+
return {
|
|
187
|
+
phase: coreStatePhase,
|
|
188
|
+
isLoading: this.isLoadingState({ coreStatePhase, authStatePhase, walletStatePhase }),
|
|
189
|
+
error: ((_e = xstate.context) == null ? void 0 : _e.error) || ((_f = authMachineState == null ? void 0 : authMachineState.context) == null ? void 0 : _f.error) || ((_g = walletMachineState == null ? void 0 : walletMachineState.context) == null ? void 0 : _g.error) || null,
|
|
190
|
+
isReady: !!((_h = xstate.context) == null ? void 0 : _h.isReady),
|
|
191
|
+
authStatePhase,
|
|
192
|
+
walletStatePhase,
|
|
193
|
+
// Computed auth state info for UI consumers
|
|
194
|
+
authStateInfo: this.computeAuthStateInfo(authContext, walletContext),
|
|
195
|
+
// Auth process
|
|
196
|
+
authStateResult: (authMachineState == null ? void 0 : authMachineState.context.authStateResult) || null,
|
|
197
|
+
needsWallet: (walletMachineState == null ? void 0 : walletMachineState.context.needsWallet) || false,
|
|
198
|
+
newWalletsResult: (walletMachineState == null ? void 0 : walletMachineState.context.newWalletsResult) || null,
|
|
199
|
+
externalWalletSignVerification: (authMachineState == null ? void 0 : authMachineState.context.externalWalletSignVerification) || null,
|
|
200
|
+
isNewUser: (authMachineState == null ? void 0 : authMachineState.context.isNewUser) || false,
|
|
201
|
+
// Wallet process
|
|
202
|
+
guestWallets: (walletMachineState == null ? void 0 : walletMachineState.context.guestWallets) || null
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
isLoadingState({
|
|
206
|
+
coreStatePhase,
|
|
207
|
+
authStatePhase,
|
|
208
|
+
walletStatePhase
|
|
209
|
+
}) {
|
|
210
|
+
return _CoreStateManager.CORE_LOADING_STATES.has(coreStatePhase) || _CoreStateManager.AUTH_LOADING_STATES.has(authStatePhase) || _CoreStateManager.WALLET_LOADING_STATES.has(walletStatePhase);
|
|
211
|
+
}
|
|
212
|
+
notifyListeners(state) {
|
|
213
|
+
if (this.lastNotifiedState && this.statesEqual(this.lastNotifiedState, state)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.lastNotifiedState = __spreadValues({}, state);
|
|
217
|
+
this.devLog("[CoreStateManager] State changed:", state);
|
|
218
|
+
this.listeners.forEach((listener) => {
|
|
219
|
+
try {
|
|
220
|
+
listener(state);
|
|
221
|
+
} catch (error) {
|
|
222
|
+
console.error("Error in state change listener:", error);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
statesEqual(state1, state2) {
|
|
227
|
+
var _a, _b;
|
|
228
|
+
return state1.phase === state2.phase && state1.authStatePhase === state2.authStatePhase && state1.walletStatePhase === state2.walletStatePhase && state1.isLoading === state2.isLoading && state1.isReady === state2.isReady && state1.isNewUser === state2.isNewUser && state1.needsWallet === state2.needsWallet && ((_a = state1.error) == null ? void 0 : _a.message) === ((_b = state2.error) == null ? void 0 : _b.message) && state1.authStateResult === state2.authStateResult && state1.newWalletsResult === state2.newWalletsResult && state1.guestWallets === state2.guestWallets && state1.externalWalletSignVerification === state2.externalWalletSignVerification && this.authStateInfoEqual(state1.authStateInfo, state2.authStateInfo);
|
|
229
|
+
}
|
|
230
|
+
authStateInfoEqual(a, b) {
|
|
231
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
232
|
+
return a.userId === b.userId && a.isPasskeySupported === b.isPasskeySupported && a.hasPasskey === b.hasPasskey && a.hasPassword === b.hasPassword && a.hasPin === b.hasPin && a.passkeyUrl === b.passkeyUrl && a.passkeyKnownDeviceUrl === b.passkeyKnownDeviceUrl && a.passwordUrl === b.passwordUrl && a.pinUrl === b.pinUrl && a.verificationUrl === b.verificationUrl && a.recoverySecret === b.recoverySecret && a.isNewUser === b.isNewUser && ((_a = a.externalWalletVerification) == null ? void 0 : _a.signatureVerificationMessage) === ((_b = b.externalWalletVerification) == null ? void 0 : _b.signatureVerificationMessage) && ((_c = a.externalWalletVerification) == null ? void 0 : _c.walletAddress) === ((_d = b.externalWalletVerification) == null ? void 0 : _d.walletAddress) && ((_e = a.externalWalletVerification) == null ? void 0 : _e.walletType) === ((_f = b.externalWalletVerification) == null ? void 0 : _f.walletType) && ((_g = a.passkeyHints) == null ? void 0 : _g.length) === ((_h = b.passkeyHints) == null ? void 0 : _h.length) && ((_i = a.passkeyHints) != null ? _i : []).every(
|
|
233
|
+
(hint, i) => hint.useragent === b.passkeyHints[i].useragent && hint.aaguid === b.passkeyHints[i].aaguid
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
_CoreStateManager.CORE_LOADING_STATES = /* @__PURE__ */ new Set([
|
|
238
|
+
"setting_up",
|
|
239
|
+
"waiting_for_external_wallet_providers",
|
|
240
|
+
"logging_out"
|
|
241
|
+
]);
|
|
242
|
+
_CoreStateManager.AUTH_LOADING_STATES = /* @__PURE__ */ new Set([
|
|
243
|
+
"authenticating_email_phone",
|
|
244
|
+
"authenticating_oauth",
|
|
245
|
+
"authenticating_external_wallet",
|
|
246
|
+
"authenticating_farcaster",
|
|
247
|
+
"processing_authentication",
|
|
248
|
+
"authenticating_telegram",
|
|
249
|
+
"checking_state"
|
|
250
|
+
]);
|
|
251
|
+
_CoreStateManager.WALLET_LOADING_STATES = /* @__PURE__ */ new Set([
|
|
252
|
+
"checking_wallet_state",
|
|
253
|
+
"claiming_wallets",
|
|
254
|
+
"creating_wallets",
|
|
255
|
+
"waiting_for_wallets",
|
|
256
|
+
"setting_up_after_login"
|
|
257
|
+
]);
|
|
258
|
+
let CoreStateManager = _CoreStateManager;
|
|
259
|
+
export {
|
|
260
|
+
CoreStateManager
|
|
261
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createAuthenticateWithEmailOrPhoneActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.performSignUpOrLogIn(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createAuthenticateWithEmailOrPhoneActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createAuthenticateWithExternalWalletActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.performLoginExternalWallet(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createAuthenticateWithExternalWalletActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createAuthenticateWithFarcasterActor = (pollingService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield pollingService.waitForFarcasterEvent(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createAuthenticateWithFarcasterActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createAuthenticateWithFarcasterLegacyActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.performVerifyFarcaster(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createAuthenticateWithFarcasterLegacyActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createAuthenticateWithTelegramActor = (pollingService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield pollingService.waitForTelegramEvent(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createAuthenticateWithTelegramActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createAuthenticateWithTelegramLegacyActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.performVerifyTelegram(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createAuthenticateWithTelegramLegacyActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createCheckUserStateActor = (paraCoreInterface) => fromPromise(() => __async(void 0, null, function* () {
|
|
6
|
+
const isAuthenticated = yield paraCoreInterface.sessionManagementService.isSessionActive();
|
|
7
|
+
const isFullyLoggedIn = yield paraCoreInterface.sessionManagementService.isFullyLoggedIn();
|
|
8
|
+
const isGuestMode = paraCoreInterface.pregenWalletService.isGuestMode;
|
|
9
|
+
return { isAuthenticated, isFullyLoggedIn, isGuestMode };
|
|
10
|
+
}));
|
|
11
|
+
export {
|
|
12
|
+
createCheckUserStateActor
|
|
13
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
import { retryDelay, sleep } from "../../utils/retryBackoff.js";
|
|
6
|
+
const createClaimWalletsActor = (pregenWalletService) => fromPromise(
|
|
7
|
+
(_0) => __async(void 0, [_0], function* ({ input }) {
|
|
8
|
+
var _a;
|
|
9
|
+
const retryCount = (_a = input == null ? void 0 : input.retryCount) != null ? _a : 0;
|
|
10
|
+
if (retryCount > 0) yield sleep(retryDelay(retryCount));
|
|
11
|
+
return yield pregenWalletService.performClaimPregenWallets();
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
export {
|
|
15
|
+
createClaimWalletsActor
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
import { retryDelay, sleep } from "../../utils/retryBackoff.js";
|
|
6
|
+
const createConnectParaConnectorsActor = (externalWalletService) => fromPromise((_0) => __async(void 0, [_0], function* ({ input }) {
|
|
7
|
+
var _a;
|
|
8
|
+
const retryCount = (_a = input == null ? void 0 : input.retryCount) != null ? _a : 0;
|
|
9
|
+
if (retryCount > 0) yield sleep(retryDelay(retryCount));
|
|
10
|
+
return yield externalWalletService.connectParaConnectors();
|
|
11
|
+
}));
|
|
12
|
+
export {
|
|
13
|
+
createConnectParaConnectorsActor
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createConnectExternalWalletActor = (externalWalletService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield externalWalletService.performConnectExternalWallet(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createConnectExternalWalletActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createCreateGuestWalletsActor = (pregenWalletService) => fromPromise(() => __async(void 0, null, function* () {
|
|
6
|
+
return yield pregenWalletService.performCreateGuestWallets();
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createCreateGuestWalletsActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-7B52C2XE.js";
|
|
5
|
+
import { fromPromise } from "xstate";
|
|
6
|
+
import { retryDelay, sleep } from "../../utils/retryBackoff.js";
|
|
7
|
+
const createCreateWalletsActor = (walletService) => fromPromise((_0) => __async(void 0, [_0], function* ({ input }) {
|
|
8
|
+
var _a;
|
|
9
|
+
const retryCount = (_a = input == null ? void 0 : input.retryCount) != null ? _a : 0;
|
|
10
|
+
if (retryCount > 0) yield sleep(retryDelay(retryCount));
|
|
11
|
+
let { walletIds, recoverySecret } = input;
|
|
12
|
+
const created = yield walletService.createWalletPerType();
|
|
13
|
+
recoverySecret = recoverySecret != null ? recoverySecret : created.recoverySecret;
|
|
14
|
+
walletIds = __spreadValues(__spreadValues({}, walletIds), created.walletIds);
|
|
15
|
+
const resp = { walletIds, recoverySecret };
|
|
16
|
+
return resp;
|
|
17
|
+
}));
|
|
18
|
+
export {
|
|
19
|
+
createCreateWalletsActor
|
|
20
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-7B52C2XE.js";
|
|
5
|
+
import { fromCallback } from "xstate";
|
|
6
|
+
function createPollingActor(pollingService) {
|
|
7
|
+
return fromCallback(({ input, sendBack, receive }) => {
|
|
8
|
+
let isCanceled = false;
|
|
9
|
+
let callbacks = {
|
|
10
|
+
isCanceled: input.isCanceled,
|
|
11
|
+
onPoll: input.onPoll,
|
|
12
|
+
onCancel: input.onCancel
|
|
13
|
+
};
|
|
14
|
+
receive((event) => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (event.type === "CANCEL") {
|
|
17
|
+
isCanceled = true;
|
|
18
|
+
(_a = callbacks.onCancel) == null ? void 0 : _a.call(callbacks);
|
|
19
|
+
sendBack({ type: "CANCEL" });
|
|
20
|
+
} else if (event.type === "UPDATE_CALLBACKS") {
|
|
21
|
+
callbacks = {
|
|
22
|
+
onPoll: event.data.onPoll || callbacks.onPoll,
|
|
23
|
+
onCancel: event.data.onCancel || callbacks.onCancel,
|
|
24
|
+
isCanceled: event.data.isCanceled || callbacks.isCanceled
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const pollConfig = __spreadProps(__spreadValues({}, input), {
|
|
29
|
+
isCanceled: () => {
|
|
30
|
+
var _a;
|
|
31
|
+
return isCanceled || ((_a = callbacks.isCanceled) == null ? void 0 : _a.call(callbacks)) || false;
|
|
32
|
+
},
|
|
33
|
+
onPoll: callbacks.onPoll,
|
|
34
|
+
onCancel: callbacks.onCancel
|
|
35
|
+
});
|
|
36
|
+
pollingService.poll(pollConfig).then((result) => {
|
|
37
|
+
if (result.type === "COMPLETE") {
|
|
38
|
+
sendBack({ type: "COMPLETE", data: result.data });
|
|
39
|
+
} else if (result.type === "CANCEL") {
|
|
40
|
+
sendBack({ type: "CANCEL" });
|
|
41
|
+
} else {
|
|
42
|
+
sendBack({ type: "ERROR", error: result.error });
|
|
43
|
+
}
|
|
44
|
+
}).catch((error) => {
|
|
45
|
+
console.error("Polling service error:", error);
|
|
46
|
+
sendBack({ type: "ERROR", error: "POLLING_SERVICE_ERROR" });
|
|
47
|
+
});
|
|
48
|
+
return () => {
|
|
49
|
+
isCanceled = true;
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
createPollingActor
|
|
55
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createProcessAuthenticationActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.prepareAuthState(params.input.authState, params.input.opts);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createProcessAuthenticationActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createSetupAfterLoginActor = (paraCoreInterface) => fromPromise(
|
|
6
|
+
(_0) => __async(void 0, [_0], function* ({ input: { temporaryShares, skipSessionRefresh } }) {
|
|
7
|
+
yield paraCoreInterface.setupAfterLogin({ temporaryShares, skipSessionRefresh });
|
|
8
|
+
})
|
|
9
|
+
);
|
|
10
|
+
export {
|
|
11
|
+
createSetupAfterLoginActor
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createSetupParaActor = (paraCoreInterface) => fromPromise(() => __async(void 0, null, function* () {
|
|
6
|
+
yield paraCoreInterface.setup();
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createSetupParaActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async,
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-7B52C2XE.js";
|
|
6
|
+
import { fromPromise } from "xstate";
|
|
7
|
+
const createSignExternalWalletVerificationActor = (externalWalletService) => fromPromise(
|
|
8
|
+
(params) => __async(void 0, null, function* () {
|
|
9
|
+
const _a = yield externalWalletService.signMessage(params.input), { signature } = _a, rest = __objRest(_a, ["signature"]);
|
|
10
|
+
return __spreadValues({ externalWallet: params.input.externalWallet, signedMessage: signature }, rest);
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
export {
|
|
14
|
+
createSignExternalWalletVerificationActor
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createSwitchExternalWalletActor = (externalWalletService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield externalWalletService.performSwitchExternalWallet(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createSwitchExternalWalletActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createVerifyExternalWalletActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.performVerifyExternalWallet(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createVerifyExternalWalletActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createVerifyNewAccountActor = (authService) => fromPromise((params) => __async(void 0, null, function* () {
|
|
6
|
+
return yield authService.performVerifyNewAccount(params.input);
|
|
7
|
+
}));
|
|
8
|
+
export {
|
|
9
|
+
createVerifyNewAccountActor
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "../../chunk-7B52C2XE.js";
|
|
4
|
+
import { fromPromise } from "xstate";
|
|
5
|
+
const createWaitForExternalWalletProvidersActor = (stateMachineInterface) => fromPromise(() => __async(void 0, null, function* () {
|
|
6
|
+
const resp = yield stateMachineInterface.externalWalletService.waitForProvidersLoading();
|
|
7
|
+
if (!resp) {
|
|
8
|
+
yield stateMachineInterface.logout();
|
|
9
|
+
}
|
|
10
|
+
return resp;
|
|
11
|
+
}));
|
|
12
|
+
export {
|
|
13
|
+
createWaitForExternalWalletProvidersActor
|
|
14
|
+
};
|