@mocanetwork/airkit 1.4.0 → 1.5.0-beta.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/README.md +8 -3
- package/dist/airkit.cjs.js +139 -27
- package/dist/airkit.esm.js +139 -27
- package/dist/airkit.umd.js +139 -27
- package/dist/types/airService.d.ts +30 -1
- package/dist/types/authMessageService.d.ts +4 -1
- package/dist/types/common/air/credentials/types.d.ts +19 -0
- package/dist/types/common/air/messaging/auth.d.ts +68 -22
- package/dist/types/common/air/messaging/const.d.ts +6 -0
- package/dist/types/common/air/messaging/messageServiceBase.d.ts +1 -1
- package/dist/types/common/air/messaging/wallet.d.ts +13 -1
- package/dist/types/common/const.d.ts +15 -15
- package/dist/types/common/realm/user/types.d.ts +1 -1
- package/dist/types/common/types.d.ts +1 -1
- package/dist/types/common/utils.d.ts +0 -8
- package/dist/types/iframeController.d.ts +3 -1
- package/dist/types/interfaces.d.ts +2 -0
- package/dist/types/recoveryMessageService.d.ts +1 -1
- package/dist/types/walletMessageService.d.ts +4 -0
- package/package.json +1 -1
- package/dist/types/common/realm/partner/config.d.ts +0 -36
- package/dist/types/common/realm/wallet/bybit/bybit.d.ts +0 -2
- package/dist/types/common/realm/wallet/coinbase/coinbase.d.ts +0 -2
- package/dist/types/common/realm/wallet/cryptoCom/cryptoCom.d.ts +0 -2
- package/dist/types/common/realm/wallet/index.d.ts +0 -25
- package/dist/types/common/realm/wallet/metamask/metamask.d.ts +0 -2
- package/dist/types/common/realm/wallet/okx/okx.d.ts +0 -2
- package/dist/types/common/realm/wallet/phantom/phantom.d.ts +0 -2
- package/dist/types/common/realm/wallet/rabby/rabby.d.ts +0 -2
- package/dist/types/common/realm/wallet/rainbow/rainbow.d.ts +0 -2
- package/dist/types/common/realm/wallet/trust/trust.d.ts +0 -2
package/dist/airkit.umd.js
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
var version = "1.
|
|
104
|
+
var version = "1.5.0-beta.0";
|
|
105
105
|
var airkitPackage = {
|
|
106
106
|
version: version};
|
|
107
107
|
|
|
@@ -112,8 +112,6 @@
|
|
|
112
112
|
LOGIN_REQUEST: "air_auth_login_request",
|
|
113
113
|
LOGIN_RESPONSE: "air_auth_login_response",
|
|
114
114
|
LOGIN_SERVICE_RESPONSE: "air_auth_login_service_response",
|
|
115
|
-
PASSKEY_LOGIN_REQUEST: "air_auth_passkey_login_request",
|
|
116
|
-
PASSKEY_LOGIN_RESPONSE: "air_auth_passkey_login_response",
|
|
117
115
|
USER_INFO_REQUEST: "air_auth_user_info_request",
|
|
118
116
|
USER_INFO_RESPONSE: "air_auth_user_info_response",
|
|
119
117
|
PARTNER_USER_INFO_REQUEST: "air_auth_partner_user_info_request",
|
|
@@ -134,8 +132,6 @@
|
|
|
134
132
|
CROSS_PARTNER_TOKEN_RESPONSE: "air_auth_cross_partner_token_response",
|
|
135
133
|
PARTNER_ACCESS_TOKEN_REQUEST: "air_auth_partner_access_token_request",
|
|
136
134
|
PARTNER_ACCESS_TOKEN_RESPONSE: "air_auth_partner_access_token_response",
|
|
137
|
-
PRIVY_LOGIN_REQUEST: "air_auth_privy_login_request",
|
|
138
|
-
PRIVY_LOGIN_RESPONSE: "air_auth_privy_login_response",
|
|
139
135
|
CREDENTIAL_SALT_REQUEST: "air_auth_credential_salt_request",
|
|
140
136
|
CREDENTIAL_SALT_RESPONSE: "air_auth_credential_salt_response",
|
|
141
137
|
LOGOUT_REQUEST: "air_auth_logout_request",
|
|
@@ -145,8 +141,14 @@
|
|
|
145
141
|
RESET_RECOVERY_COMMUNICATION: "air_auth_reset_recovery_communication",
|
|
146
142
|
START_RECOVERY_REQUEST: "air_start_recovery_request",
|
|
147
143
|
START_RECOVERY_RESPONSE: "air_start_recovery_response",
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
RECOVERY_REQUEST: "air_auth_recovery_request",
|
|
145
|
+
RECOVERY_RESPONSE: "air_auth_recovery_response",
|
|
146
|
+
LINK_EOA_CREDENTIAL_REQUEST: "air_auth_link_eoa_credential_request",
|
|
147
|
+
LINK_EOA_CREDENTIAL_RESPONSE: "air_auth_link_eoa_credential_response",
|
|
148
|
+
LINKAGE_NONCE_REQUEST: "air_auth_linkage_nonce_request",
|
|
149
|
+
LINKAGE_NONCE_RESPONSE: "air_auth_linkage_nonce_response",
|
|
150
|
+
CREDENTIAL_SIGNERS_REQUEST: "air_auth_credential_signers_request",
|
|
151
|
+
CREDENTIAL_SIGNERS_RESPONSE: "air_auth_credential_signers_response"
|
|
150
152
|
};
|
|
151
153
|
|
|
152
154
|
const AirRecoveryMessageTypes = {
|
|
@@ -164,6 +166,8 @@
|
|
|
164
166
|
SERVICE_STARTED: "air_service_started",
|
|
165
167
|
INITIALIZATION_REQUEST: "air_initialization_request",
|
|
166
168
|
INITIALIZATION_RESPONSE: "air_initialization_response",
|
|
169
|
+
CLOSE_MODAL_REQUEST: "air_close_modal_request",
|
|
170
|
+
CLOSE_MODAL_RESPONSE: "air_close_modal_response",
|
|
167
171
|
INIT_AUTH_COMMUNICATION: "air_init_auth_communication",
|
|
168
172
|
WALLET_INITIALIZED: "air_wallet_initialized",
|
|
169
173
|
WALLET_LOGIN_REQUEST: "air_wallet_login_request",
|
|
@@ -174,6 +178,8 @@
|
|
|
174
178
|
CLAIM_ID_RESPONSE: "air_claim_id_response",
|
|
175
179
|
SHOW_SWAP_UI_REQUEST: "air_show_swap_ui_request",
|
|
176
180
|
SHOW_SWAP_UI_RESPONSE: "air_show_swap_ui_response",
|
|
181
|
+
SHOW_ON_RAMP_UI_REQUEST: "air_show_on_ramp_ui_request",
|
|
182
|
+
SHOW_ON_RAMP_UI_RESPONSE: "air_show_on_ramp_ui_response",
|
|
177
183
|
DEPLOY_SMART_ACCOUNT_REQUEST: "air_deploy_smart_account_request",
|
|
178
184
|
DEPLOY_SMART_ACCOUNT_RESPONSE: "air_deploy_smart_account_response",
|
|
179
185
|
WALLET_IFRAME_VISIBILITY_REQUEST: "air_wallet_iframe_visibility_request",
|
|
@@ -569,6 +575,8 @@
|
|
|
569
575
|
level = enableLogging ? log.levels.DEBUG : log.levels.INFO;
|
|
570
576
|
} else if (environment === "uat") {
|
|
571
577
|
level = enableLogging ? log.levels.INFO : log.levels.WARN;
|
|
578
|
+
} else if (environment === "sandbox") {
|
|
579
|
+
level = enableLogging ? log.levels.WARN : log.levels.ERROR;
|
|
572
580
|
} else if (environment === "production") {
|
|
573
581
|
// Be cautious with enabling more than WARN in prod
|
|
574
582
|
level = enableLogging ? log.levels.WARN : log.levels.ERROR;
|
|
@@ -1676,7 +1684,7 @@
|
|
|
1676
1684
|
this._messages$ = this.eventSubject.pipe(map(ev => ev.data));
|
|
1677
1685
|
this._events$.subscribe(event => {
|
|
1678
1686
|
const sentOrReceived = event.origin === window.origin ? "sent" : "received";
|
|
1679
|
-
log.debug(`[${this.name}] Message ${sentOrReceived}:`, event.data);
|
|
1687
|
+
log.debug(`[${this.name}] Message ${sentOrReceived}:`, JSON.stringify(event.data, bigIntReplacer));
|
|
1680
1688
|
});
|
|
1681
1689
|
const handleMessage = async ev => {
|
|
1682
1690
|
if (this.targetOrigin && ev.origin !== this.targetOrigin || !ev.data || !(ev.data instanceof Object)) return;
|
|
@@ -1769,17 +1777,17 @@
|
|
|
1769
1777
|
AirWalletProviderMessageTypes["EVENT"] = "JRPC_EVENT";
|
|
1770
1778
|
})(AirWalletProviderMessageTypes || (AirWalletProviderMessageTypes = {}));
|
|
1771
1779
|
|
|
1772
|
-
var _a$
|
|
1780
|
+
var _a$3, _ProviderMessageService_instance;
|
|
1773
1781
|
const ALLOWED_PROVIDER_MESSAGES = [
|
|
1774
1782
|
AirWalletProviderMessageTypes.RESPONSE,
|
|
1775
1783
|
AirWalletProviderMessageTypes.EVENT,
|
|
1776
1784
|
];
|
|
1777
1785
|
class ProviderMessageService extends MessageServiceBase {
|
|
1778
1786
|
static create() {
|
|
1779
|
-
if (__classPrivateFieldGet(this, _a$
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
return __classPrivateFieldGet(this, _a$
|
|
1787
|
+
if (!__classPrivateFieldGet(this, _a$3, "f", _ProviderMessageService_instance)) {
|
|
1788
|
+
__classPrivateFieldSet(this, _a$3, new _a$3("Embed Service: Provider Channel", ALLOWED_PROVIDER_MESSAGES), "f", _ProviderMessageService_instance);
|
|
1789
|
+
}
|
|
1790
|
+
return __classPrivateFieldGet(this, _a$3, "f", _ProviderMessageService_instance);
|
|
1783
1791
|
}
|
|
1784
1792
|
async open(walletIframe) {
|
|
1785
1793
|
const origin = new URL(walletIframe.src).origin;
|
|
@@ -1795,7 +1803,7 @@
|
|
|
1795
1803
|
return response;
|
|
1796
1804
|
}
|
|
1797
1805
|
}
|
|
1798
|
-
_a$
|
|
1806
|
+
_a$3 = ProviderMessageService;
|
|
1799
1807
|
_ProviderMessageService_instance = { value: void 0 };
|
|
1800
1808
|
|
|
1801
1809
|
var _AirWalletProvider_instances, _AirWalletProvider_providerMessageService, _AirWalletProvider_isWalletInitialized, _AirWalletProvider_getLoginResult, _AirWalletProvider_ensureWallet, _AirWalletProvider_eventListeners, _AirWalletProvider_emit;
|
|
@@ -1906,7 +1914,7 @@
|
|
|
1906
1914
|
});
|
|
1907
1915
|
};
|
|
1908
1916
|
|
|
1909
|
-
var _a$
|
|
1917
|
+
var _a$2, _AuthMessageService_instance;
|
|
1910
1918
|
const ALLOWED_AUTH_MESSAGES = [
|
|
1911
1919
|
AirAuthMessageTypes.INITIALIZATION_RESPONSE,
|
|
1912
1920
|
AirAuthMessageTypes.LOGIN_RESPONSE,
|
|
@@ -1921,13 +1929,16 @@
|
|
|
1921
1929
|
AirAuthMessageTypes.IFRAME_VISIBILITY_REQUEST,
|
|
1922
1930
|
AirAuthMessageTypes.CREDENTIAL_SALT_RESPONSE,
|
|
1923
1931
|
AirAuthMessageTypes.START_RECOVERY_RESPONSE,
|
|
1932
|
+
AirAuthMessageTypes.LINK_EOA_CREDENTIAL_RESPONSE,
|
|
1933
|
+
AirAuthMessageTypes.LINKAGE_NONCE_RESPONSE,
|
|
1934
|
+
AirAuthMessageTypes.CREDENTIAL_SIGNERS_RESPONSE,
|
|
1924
1935
|
];
|
|
1925
1936
|
class AuthMessageService extends MessageServiceBase {
|
|
1926
1937
|
static create() {
|
|
1927
|
-
if (__classPrivateFieldGet(this, _a$
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
return __classPrivateFieldGet(this, _a$
|
|
1938
|
+
if (!__classPrivateFieldGet(this, _a$2, "f", _AuthMessageService_instance)) {
|
|
1939
|
+
__classPrivateFieldSet(this, _a$2, new _a$2("Embed Service: Auth Channel", ALLOWED_AUTH_MESSAGES), "f", _AuthMessageService_instance);
|
|
1940
|
+
}
|
|
1941
|
+
return __classPrivateFieldGet(this, _a$2, "f", _AuthMessageService_instance);
|
|
1931
1942
|
}
|
|
1932
1943
|
async open(authIframe) {
|
|
1933
1944
|
const origin = new URL(authIframe.src).origin;
|
|
@@ -2027,15 +2038,43 @@
|
|
|
2027
2038
|
await this.sendMessage({ type: AirAuthMessageTypes.CREDENTIAL_SALT_REQUEST });
|
|
2028
2039
|
return response;
|
|
2029
2040
|
}
|
|
2041
|
+
async sendLinkEoaCredentialRequest(payload) {
|
|
2042
|
+
const response = firstValueFrom(this.messages$.pipe(filter((msg) => msg.type === AirAuthMessageTypes.LINK_EOA_CREDENTIAL_RESPONSE)));
|
|
2043
|
+
await this.sendMessage({ type: AirAuthMessageTypes.LINK_EOA_CREDENTIAL_REQUEST, payload });
|
|
2044
|
+
return response;
|
|
2045
|
+
}
|
|
2046
|
+
async sendCredentialSignersRequest(payload) {
|
|
2047
|
+
const response = firstValueFrom(this.messages$.pipe(filter((msg) => msg.type === AirAuthMessageTypes.CREDENTIAL_SIGNERS_RESPONSE)));
|
|
2048
|
+
await this.sendMessage({
|
|
2049
|
+
type: AirAuthMessageTypes.CREDENTIAL_SIGNERS_REQUEST,
|
|
2050
|
+
payload,
|
|
2051
|
+
});
|
|
2052
|
+
return response;
|
|
2053
|
+
}
|
|
2054
|
+
async sendLinkageNonceRequest(payload) {
|
|
2055
|
+
const response = firstValueFrom(this.messages$.pipe(filter((msg) => msg.type === AirAuthMessageTypes.LINKAGE_NONCE_RESPONSE)));
|
|
2056
|
+
await this.sendMessage({ type: AirAuthMessageTypes.LINKAGE_NONCE_REQUEST, payload });
|
|
2057
|
+
return response;
|
|
2058
|
+
}
|
|
2030
2059
|
}
|
|
2031
|
-
_a$
|
|
2060
|
+
_a$2 = AuthMessageService;
|
|
2032
2061
|
_AuthMessageService_instance = { value: void 0 };
|
|
2033
2062
|
|
|
2034
2063
|
class IframeController {
|
|
2064
|
+
getZIndex() {
|
|
2065
|
+
if (this.iframeId.includes("air-auth"))
|
|
2066
|
+
return this.AUTH_IFRAME_Z_INDEX;
|
|
2067
|
+
if (this.iframeId.includes("air-wallet"))
|
|
2068
|
+
return this.WALLET_IFRAME_Z_INDEX;
|
|
2069
|
+
if (this.iframeId.includes("air-recovery"))
|
|
2070
|
+
return this.RECOVERY_IFRAME_Z_INDEX;
|
|
2071
|
+
return "9999999"; // Default z-index if not matched
|
|
2072
|
+
}
|
|
2035
2073
|
constructor(iframeUrl, iframeId, state) {
|
|
2036
2074
|
this._iframeElement = null;
|
|
2037
|
-
this.AUTH_IFRAME_Z_INDEX = "
|
|
2038
|
-
this.
|
|
2075
|
+
this.AUTH_IFRAME_Z_INDEX = "9999998";
|
|
2076
|
+
this.WALLET_IFRAME_Z_INDEX = "9999999";
|
|
2077
|
+
this.RECOVERY_IFRAME_Z_INDEX = "999999";
|
|
2039
2078
|
this.state = {
|
|
2040
2079
|
...IframeController.defaultState,
|
|
2041
2080
|
...state,
|
|
@@ -2054,7 +2093,7 @@
|
|
|
2054
2093
|
iframe.allow = "publickey-credentials-get *; publickey-credentials-create *";
|
|
2055
2094
|
iframe.src = this.iframeUrl;
|
|
2056
2095
|
iframe.style.position = "fixed";
|
|
2057
|
-
iframe.style.zIndex = this.
|
|
2096
|
+
iframe.style.zIndex = this.getZIndex();
|
|
2058
2097
|
iframe.style.border = "none";
|
|
2059
2098
|
iframe.style.margin = "0";
|
|
2060
2099
|
iframe.style.padding = "0";
|
|
@@ -2097,13 +2136,14 @@
|
|
|
2097
2136
|
isVisible: false,
|
|
2098
2137
|
};
|
|
2099
2138
|
|
|
2139
|
+
var _a$1, _RecoveryMessageService_instance;
|
|
2100
2140
|
const ALLOWED_RECOVERY_MESSAGES = Object.values(AirRecoveryMessageTypes);
|
|
2101
2141
|
class RecoveryMessageService extends MessageServiceBase {
|
|
2102
2142
|
static create() {
|
|
2103
|
-
if (!
|
|
2104
|
-
|
|
2143
|
+
if (!__classPrivateFieldGet(this, _a$1, "f", _RecoveryMessageService_instance)) {
|
|
2144
|
+
__classPrivateFieldSet(this, _a$1, new _a$1("Recovery Service", ALLOWED_RECOVERY_MESSAGES), "f", _RecoveryMessageService_instance);
|
|
2105
2145
|
}
|
|
2106
|
-
return
|
|
2146
|
+
return __classPrivateFieldGet(this, _a$1, "f", _RecoveryMessageService_instance);
|
|
2107
2147
|
}
|
|
2108
2148
|
async sendInitializationRequest(payload) {
|
|
2109
2149
|
const response = firstValueFrom(this.messages$.pipe(filter((msg) => msg.type === AirRecoveryMessageTypes.INITIALIZATION_RESPONSE)));
|
|
@@ -2133,6 +2173,8 @@
|
|
|
2133
2173
|
await super.close();
|
|
2134
2174
|
}
|
|
2135
2175
|
}
|
|
2176
|
+
_a$1 = RecoveryMessageService;
|
|
2177
|
+
_RecoveryMessageService_instance = { value: void 0 };
|
|
2136
2178
|
|
|
2137
2179
|
var _a, _WalletMessageService_instance;
|
|
2138
2180
|
const ALLOWED_WALLET_MESSAGES = [
|
|
@@ -2141,6 +2183,7 @@
|
|
|
2141
2183
|
AirWalletMessageTypes.WALLET_LOGIN_RESPONSE,
|
|
2142
2184
|
AirWalletMessageTypes.SETUP_OR_UPDATE_MFA_RESPONSE,
|
|
2143
2185
|
AirWalletMessageTypes.SHOW_SWAP_UI_RESPONSE,
|
|
2186
|
+
AirWalletMessageTypes.SHOW_ON_RAMP_UI_RESPONSE,
|
|
2144
2187
|
AirWalletMessageTypes.CLAIM_ID_RESPONSE,
|
|
2145
2188
|
AirWalletMessageTypes.IS_SMART_ACCOUNT_DEPLOYED_RESPONSE,
|
|
2146
2189
|
AirWalletMessageTypes.DEPLOY_SMART_ACCOUNT_RESPONSE,
|
|
@@ -2255,6 +2298,14 @@
|
|
|
2255
2298
|
});
|
|
2256
2299
|
return response;
|
|
2257
2300
|
}
|
|
2301
|
+
async sendShowOnRampUIRequest(payload) {
|
|
2302
|
+
const response = firstValueFrom(this.messages$.pipe(filter((msg) => msg.type === AirWalletMessageTypes.SHOW_ON_RAMP_UI_RESPONSE)));
|
|
2303
|
+
await this.sendMessage({
|
|
2304
|
+
type: AirWalletMessageTypes.SHOW_ON_RAMP_UI_REQUEST,
|
|
2305
|
+
payload,
|
|
2306
|
+
});
|
|
2307
|
+
return response;
|
|
2308
|
+
}
|
|
2258
2309
|
}
|
|
2259
2310
|
_a = WalletMessageService;
|
|
2260
2311
|
_WalletMessageService_instance = { value: void 0 };
|
|
@@ -2510,7 +2561,7 @@
|
|
|
2510
2561
|
};
|
|
2511
2562
|
}
|
|
2512
2563
|
shouldEnableAutomation() {
|
|
2513
|
-
return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !==
|
|
2564
|
+
return localStorage.getItem("automation") === "true" && __classPrivateFieldGet(this, _AirService_buildEnv, "f") !== BUILD_ENV.PRODUCTION;
|
|
2514
2565
|
}
|
|
2515
2566
|
async init({ buildEnv = BUILD_ENV.PRODUCTION, enableLogging = false, skipRehydration = false, }) {
|
|
2516
2567
|
if (!__classPrivateFieldGet(this, _AirService_partnerId, "f"))
|
|
@@ -2585,6 +2636,8 @@
|
|
|
2585
2636
|
});
|
|
2586
2637
|
__classPrivateFieldSet(this, _AirService_isAuthInitialized, true, "f");
|
|
2587
2638
|
__classPrivateFieldGet(this, _AirService_instances, "m", _AirService_triggerAirAuthInitialized).call(this, { rehydrated: result.rehydrated });
|
|
2639
|
+
if (result.preloadWallet)
|
|
2640
|
+
this.preloadWallet();
|
|
2588
2641
|
// rehydrated auth session
|
|
2589
2642
|
if (result.rehydrated) {
|
|
2590
2643
|
__classPrivateFieldSet(this, _AirService_loginResult, __classPrivateFieldGet(this, _AirService_instances, "m", _AirService_createLoginResult).call(this, result), "f");
|
|
@@ -2667,6 +2720,49 @@
|
|
|
2667
2720
|
credentialSalt: result.payload.credentialSalt,
|
|
2668
2721
|
};
|
|
2669
2722
|
}
|
|
2723
|
+
/**
|
|
2724
|
+
* @experimental This method is experimental and will change in the future.
|
|
2725
|
+
*/
|
|
2726
|
+
async getLinkageNonce(payload) {
|
|
2727
|
+
if (!__classPrivateFieldGet(this, _AirService_isAuthInitialized, "f"))
|
|
2728
|
+
throw new Error("Service is not initialized");
|
|
2729
|
+
if (!this.isLoggedIn)
|
|
2730
|
+
throw new Error("No active session to get nonce");
|
|
2731
|
+
const result = await __classPrivateFieldGet(this, _AirService_authMessagingService, "f").sendLinkageNonceRequest(payload);
|
|
2732
|
+
if (result.payload.success === false) {
|
|
2733
|
+
throw new AirServiceError(result.payload.errorName, result.payload.errorMessage);
|
|
2734
|
+
}
|
|
2735
|
+
return {
|
|
2736
|
+
nonce: result.payload.nonce,
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
/**
|
|
2740
|
+
* @experimental This method is experimental and will change in the future.
|
|
2741
|
+
*/
|
|
2742
|
+
async retrieveCredentialSigners(payload) {
|
|
2743
|
+
if (!__classPrivateFieldGet(this, _AirService_isAuthInitialized, "f"))
|
|
2744
|
+
throw new Error("Service is not initialized");
|
|
2745
|
+
if (!this.isLoggedIn)
|
|
2746
|
+
throw new Error("No active session to retrieve EOA credential");
|
|
2747
|
+
const result = await __classPrivateFieldGet(this, _AirService_authMessagingService, "f").sendCredentialSignersRequest(payload);
|
|
2748
|
+
if (result.payload.success === false) {
|
|
2749
|
+
throw new AirServiceError(result.payload.errorName, result.payload.errorMessage);
|
|
2750
|
+
}
|
|
2751
|
+
return result.payload.credentials;
|
|
2752
|
+
}
|
|
2753
|
+
/**
|
|
2754
|
+
* @experimental This method is experimental and will change in the future.
|
|
2755
|
+
*/
|
|
2756
|
+
async linkEoaCredential(payload) {
|
|
2757
|
+
if (!__classPrivateFieldGet(this, _AirService_isAuthInitialized, "f"))
|
|
2758
|
+
throw new Error("Service is not initialized");
|
|
2759
|
+
if (!this.isLoggedIn)
|
|
2760
|
+
throw new Error("No active session to link EOA credential");
|
|
2761
|
+
const result = await __classPrivateFieldGet(this, _AirService_authMessagingService, "f").sendLinkEoaCredentialRequest(payload);
|
|
2762
|
+
if (result.payload.success === false) {
|
|
2763
|
+
throw new AirServiceError(result.payload.errorName, result.payload.errorMessage);
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2670
2766
|
getProvider() {
|
|
2671
2767
|
return this.provider;
|
|
2672
2768
|
}
|
|
@@ -2684,6 +2780,9 @@
|
|
|
2684
2780
|
isMFASetup: true,
|
|
2685
2781
|
}, "f");
|
|
2686
2782
|
}
|
|
2783
|
+
/**
|
|
2784
|
+
* @experimental This feature has not been officially released and might change in the future.
|
|
2785
|
+
*/
|
|
2687
2786
|
async claimAirId(options) {
|
|
2688
2787
|
await __classPrivateFieldGet(this, _AirService_instances, "m", _AirService_ensureWallet).call(this);
|
|
2689
2788
|
const result = await __classPrivateFieldGet(this, _AirService_walletMessagingService, "f").sendClaimIdRequest(options ?? {});
|
|
@@ -2692,6 +2791,9 @@
|
|
|
2692
2791
|
}
|
|
2693
2792
|
throw new AirServiceError(result.payload.errorName, result.payload.errorMessage);
|
|
2694
2793
|
}
|
|
2794
|
+
/**
|
|
2795
|
+
* @experimental This feature has not been officially released and might change in the future.
|
|
2796
|
+
*/
|
|
2695
2797
|
async showSwapUI() {
|
|
2696
2798
|
await __classPrivateFieldGet(this, _AirService_instances, "m", _AirService_ensureWallet).call(this);
|
|
2697
2799
|
const result = await __classPrivateFieldGet(this, _AirService_walletMessagingService, "f").sendShowSwapUIRequest();
|
|
@@ -2700,6 +2802,16 @@
|
|
|
2700
2802
|
}
|
|
2701
2803
|
return { txHash: result.payload.txHash };
|
|
2702
2804
|
}
|
|
2805
|
+
/**
|
|
2806
|
+
* @experimental This feature has not been officially released and might change in the future.
|
|
2807
|
+
*/
|
|
2808
|
+
async showOnRampUI(options) {
|
|
2809
|
+
await __classPrivateFieldGet(this, _AirService_instances, "m", _AirService_ensureWallet).call(this);
|
|
2810
|
+
const result = await __classPrivateFieldGet(this, _AirService_walletMessagingService, "f").sendShowOnRampUIRequest(options);
|
|
2811
|
+
if (result.payload.success === false) {
|
|
2812
|
+
throw new AirServiceError(result.payload.errorName, result.payload.errorMessage);
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2703
2815
|
async getUserInfo() {
|
|
2704
2816
|
if (!this.isLoggedIn)
|
|
2705
2817
|
throw new Error("User not logged in");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinkEoaCredentialParams, LinkEoaNonceRequestParams } from "@mocanetwork/common/src/air/credentials/types";
|
|
2
|
+
import { AirAuthStartRecoveryRequestPayload, CredentialSigner, CredentialSignersParams } from "@mocanetwork/common/src/air/messaging/auth";
|
|
2
3
|
import { AirEventListener, AirLoginResult, AirUserDetails, BUILD_ENV_TYPE, ClaimAirIdOptions, ClaimAirIdResult, EIP1193Provider } from "./interfaces";
|
|
3
4
|
declare class AirService {
|
|
4
5
|
#private;
|
|
@@ -17,6 +18,7 @@ declare class AirService {
|
|
|
17
18
|
buildEnv: BUILD_ENV_TYPE;
|
|
18
19
|
enableLogging: boolean;
|
|
19
20
|
skipRehydration: boolean;
|
|
21
|
+
preloadWallet?: boolean;
|
|
20
22
|
}): Promise<AirLoginResult | null>;
|
|
21
23
|
login(options?: {
|
|
22
24
|
authToken?: string;
|
|
@@ -37,13 +39,40 @@ declare class AirService {
|
|
|
37
39
|
getCredentialSalt(): Promise<{
|
|
38
40
|
credentialSalt: string;
|
|
39
41
|
}>;
|
|
42
|
+
/**
|
|
43
|
+
* @experimental This method is experimental and will change in the future.
|
|
44
|
+
*/
|
|
45
|
+
getLinkageNonce(payload: LinkEoaNonceRequestParams): Promise<{
|
|
46
|
+
nonce: string;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* @experimental This method is experimental and will change in the future.
|
|
50
|
+
*/
|
|
51
|
+
retrieveCredentialSigners(payload: CredentialSignersParams): Promise<CredentialSigner[]>;
|
|
52
|
+
/**
|
|
53
|
+
* @experimental This method is experimental and will change in the future.
|
|
54
|
+
*/
|
|
55
|
+
linkEoaCredential(payload: LinkEoaCredentialParams): Promise<void>;
|
|
40
56
|
getProvider(): EIP1193Provider;
|
|
41
57
|
preloadWallet(): Promise<void>;
|
|
42
58
|
setupOrUpdateMfa(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* @experimental This feature has not been officially released and might change in the future.
|
|
61
|
+
*/
|
|
43
62
|
claimAirId(options?: ClaimAirIdOptions): Promise<ClaimAirIdResult>;
|
|
63
|
+
/**
|
|
64
|
+
* @experimental This feature has not been officially released and might change in the future.
|
|
65
|
+
*/
|
|
44
66
|
showSwapUI(): Promise<{
|
|
45
67
|
txHash: `0x${string}`;
|
|
46
68
|
}>;
|
|
69
|
+
/**
|
|
70
|
+
* @experimental This feature has not been officially released and might change in the future.
|
|
71
|
+
*/
|
|
72
|
+
showOnRampUI(options: {
|
|
73
|
+
displayCurrencyCode: string;
|
|
74
|
+
targetCurrencyCode?: string;
|
|
75
|
+
}): Promise<void>;
|
|
47
76
|
getUserInfo(): Promise<AirUserDetails>;
|
|
48
77
|
goToPartner(partnerUrl: string): Promise<{
|
|
49
78
|
urlWithToken: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AirAuthInitializationRequestMessage, AirAuthLoginRequestMessage, AirAuthMessage, AirAuthStartRecoveryRequestPayload } from "./common/air/messaging/auth";
|
|
2
1
|
import { MessageServiceBase } from "@mocanetwork/common/src/air/messaging/messageServiceBase";
|
|
2
|
+
import { AirAuthCredentialSignersRequestMessage, AirAuthInitializationRequestMessage, AirAuthLinkageNonceRequestMessage, AirAuthLinkEoaCredentialRequestMessage, AirAuthLoginRequestMessage, AirAuthMessage, AirAuthStartRecoveryRequestPayload } from "./common/air/messaging/auth";
|
|
3
3
|
export declare class AuthMessageService extends MessageServiceBase<AirAuthMessage> {
|
|
4
4
|
#private;
|
|
5
5
|
static create(): AuthMessageService;
|
|
@@ -20,4 +20,7 @@ export declare class AuthMessageService extends MessageServiceBase<AirAuthMessag
|
|
|
20
20
|
sendPartnerAccessTokenRequest(): Promise<import("./common/air/messaging/auth").AirAuthPartnerAccessTokenResponseMessage>;
|
|
21
21
|
sendAccountRecoveryRequest(payload: AirAuthStartRecoveryRequestPayload): Promise<import("./common/air/messaging/auth").AirStartRecoveryResponseMessage>;
|
|
22
22
|
sendCredentialSaltRequest(): Promise<import("./common/air/messaging/auth").AirAuthCredentialSaltResponseMessage>;
|
|
23
|
+
sendLinkEoaCredentialRequest(payload: AirAuthLinkEoaCredentialRequestMessage["payload"]): Promise<import("./common/air/messaging/auth").AirAuthLinkEoaCredentialResponseMessage>;
|
|
24
|
+
sendCredentialSignersRequest(payload: AirAuthCredentialSignersRequestMessage["payload"]): Promise<import("./common/air/messaging/auth").AirAuthCredentialSignersResponseMessage>;
|
|
25
|
+
sendLinkageNonceRequest(payload: AirAuthLinkageNonceRequestMessage["payload"]): Promise<import("./common/air/messaging/auth").AirAuthLinkageNonceResponseMessage>;
|
|
23
26
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum EoaLinkageNonceType {
|
|
2
|
+
AUTH_SIGNER_LINKAGE = "auth_signer_linkage",
|
|
3
|
+
AUTH_SIGNER_LOGIN = "auth_signer_login"
|
|
4
|
+
}
|
|
5
|
+
export type EoaLinkagePayload = {
|
|
6
|
+
nonce: string;
|
|
7
|
+
aaAddress: string;
|
|
8
|
+
eoaAddress: string;
|
|
9
|
+
chainIds: number[];
|
|
10
|
+
chainOrder: number;
|
|
11
|
+
encryptedTkSeed: string;
|
|
12
|
+
};
|
|
13
|
+
export type LinkEoaNonceRequestParams = {
|
|
14
|
+
type: EoaLinkageNonceType;
|
|
15
|
+
};
|
|
16
|
+
export type LinkEoaCredentialParams = {
|
|
17
|
+
signature: string;
|
|
18
|
+
payload: EoaLinkagePayload;
|
|
19
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AirIdDetails, GlobalId, MFASetup, PartnerUserResponse } from "../../realm/user/types";
|
|
2
|
+
import { AirAuthRecoveryFlowType } from "./const";
|
|
3
|
+
import { LinkEoaCredentialParams, LinkEoaNonceRequestParams } from "../credentials/types";
|
|
2
4
|
import { AirMessageBase, AirMessageBaseWithoutPayload, AirMessageErrorPayload, AirMessageSuccessPayload } from "./types";
|
|
3
5
|
export declare const AirAuthMessageTypes: {
|
|
4
6
|
readonly AUTH_SETUP_COMPLETED: "air_auth_setup_completed";
|
|
@@ -7,8 +9,6 @@ export declare const AirAuthMessageTypes: {
|
|
|
7
9
|
readonly LOGIN_REQUEST: "air_auth_login_request";
|
|
8
10
|
readonly LOGIN_RESPONSE: "air_auth_login_response";
|
|
9
11
|
readonly LOGIN_SERVICE_RESPONSE: "air_auth_login_service_response";
|
|
10
|
-
readonly PASSKEY_LOGIN_REQUEST: "air_auth_passkey_login_request";
|
|
11
|
-
readonly PASSKEY_LOGIN_RESPONSE: "air_auth_passkey_login_response";
|
|
12
12
|
readonly USER_INFO_REQUEST: "air_auth_user_info_request";
|
|
13
13
|
readonly USER_INFO_RESPONSE: "air_auth_user_info_response";
|
|
14
14
|
readonly PARTNER_USER_INFO_REQUEST: "air_auth_partner_user_info_request";
|
|
@@ -29,8 +29,6 @@ export declare const AirAuthMessageTypes: {
|
|
|
29
29
|
readonly CROSS_PARTNER_TOKEN_RESPONSE: "air_auth_cross_partner_token_response";
|
|
30
30
|
readonly PARTNER_ACCESS_TOKEN_REQUEST: "air_auth_partner_access_token_request";
|
|
31
31
|
readonly PARTNER_ACCESS_TOKEN_RESPONSE: "air_auth_partner_access_token_response";
|
|
32
|
-
readonly PRIVY_LOGIN_REQUEST: "air_auth_privy_login_request";
|
|
33
|
-
readonly PRIVY_LOGIN_RESPONSE: "air_auth_privy_login_response";
|
|
34
32
|
readonly CREDENTIAL_SALT_REQUEST: "air_auth_credential_salt_request";
|
|
35
33
|
readonly CREDENTIAL_SALT_RESPONSE: "air_auth_credential_salt_response";
|
|
36
34
|
readonly LOGOUT_REQUEST: "air_auth_logout_request";
|
|
@@ -40,8 +38,14 @@ export declare const AirAuthMessageTypes: {
|
|
|
40
38
|
readonly RESET_RECOVERY_COMMUNICATION: "air_auth_reset_recovery_communication";
|
|
41
39
|
readonly START_RECOVERY_REQUEST: "air_start_recovery_request";
|
|
42
40
|
readonly START_RECOVERY_RESPONSE: "air_start_recovery_response";
|
|
43
|
-
readonly
|
|
44
|
-
readonly
|
|
41
|
+
readonly RECOVERY_REQUEST: "air_auth_recovery_request";
|
|
42
|
+
readonly RECOVERY_RESPONSE: "air_auth_recovery_response";
|
|
43
|
+
readonly LINK_EOA_CREDENTIAL_REQUEST: "air_auth_link_eoa_credential_request";
|
|
44
|
+
readonly LINK_EOA_CREDENTIAL_RESPONSE: "air_auth_link_eoa_credential_response";
|
|
45
|
+
readonly LINKAGE_NONCE_REQUEST: "air_auth_linkage_nonce_request";
|
|
46
|
+
readonly LINKAGE_NONCE_RESPONSE: "air_auth_linkage_nonce_response";
|
|
47
|
+
readonly CREDENTIAL_SIGNERS_REQUEST: "air_auth_credential_signers_request";
|
|
48
|
+
readonly CREDENTIAL_SIGNERS_RESPONSE: "air_auth_credential_signers_response";
|
|
45
49
|
};
|
|
46
50
|
export type AirAuthMessageType = (typeof AirAuthMessageTypes)[keyof typeof AirAuthMessageTypes];
|
|
47
51
|
export type AirAuthMessageBase<TType extends AirAuthMessageType, TPayload extends object> = AirMessageBase<TType, TPayload>;
|
|
@@ -81,8 +85,10 @@ type AirAuthWalletTokenResponsePayload = (AirAuthPartnerUserDetailsSuccess & {
|
|
|
81
85
|
}) | AirMessageErrorPayload;
|
|
82
86
|
export type AirAuthInitializationSuccess = (AirAuthLoginSuccess & {
|
|
83
87
|
rehydrated: true;
|
|
88
|
+
preloadWallet?: boolean;
|
|
84
89
|
}) | (AirMessageSuccessPayload & {
|
|
85
90
|
rehydrated: false;
|
|
91
|
+
preloadWallet?: boolean;
|
|
86
92
|
});
|
|
87
93
|
type AirAuthInitializationResponsePayload = AirAuthInitializationSuccess | AirMessageErrorPayload;
|
|
88
94
|
type AirAuthLoginRequestPayload = {
|
|
@@ -146,15 +152,6 @@ export type AirAuthPartnerAccessTokenResponsePayload = (AirMessageSuccessPayload
|
|
|
146
152
|
partnerAccessToken: string;
|
|
147
153
|
}) | AirMessageErrorPayload;
|
|
148
154
|
export type AirAuthPartnerAccessTokenResponseMessage = AirAuthMessageBase<"air_auth_partner_access_token_response", AirAuthPartnerAccessTokenResponsePayload>;
|
|
149
|
-
type AirAuthPasskeyLoginResponsePayload = AirMessageSuccessPayload | AirMessageErrorPayload;
|
|
150
|
-
export type AirAuthPasskeyLoginRequestMessage = AirAuthMessageBaseWithoutPayload<"air_auth_passkey_login_request">;
|
|
151
|
-
export type AirAuthPasskeyLoginResponseMessage = AirAuthMessageBase<"air_auth_passkey_login_response", AirAuthPasskeyLoginResponsePayload>;
|
|
152
|
-
type AirAuthPrivyLoginRequestPayload = {
|
|
153
|
-
privyAccessToken: string;
|
|
154
|
-
};
|
|
155
|
-
export type AirAuthPrivyLoginResponsePayload = AirAuthLoginResponseToWalletPayload;
|
|
156
|
-
export type AirAuthPrivyLoginRequestMessage = AirAuthMessageBase<"air_auth_privy_login_request", AirAuthPrivyLoginRequestPayload>;
|
|
157
|
-
export type AirAuthPrivyLoginResponseMessage = AirAuthMessageBase<"air_auth_privy_login_response", AirAuthPrivyLoginResponsePayload>;
|
|
158
155
|
export type AirAuthSetupRecoveryResponsePayload = AirMessageSuccessPayload | AirMessageErrorPayload;
|
|
159
156
|
export type AirAuthSetupRecoveryRequestMessage = AirAuthMessageBaseWithoutPayload<"air_auth_setup_recovery_request">;
|
|
160
157
|
export type AirAuthSetupRecoveryResponseMessage = AirAuthMessageBase<"air_auth_setup_recovery_response", AirAuthSetupRecoveryResponsePayload>;
|
|
@@ -166,7 +163,7 @@ export type AirAuthCredentialSaltResponsePayload = (AirMessageSuccessPayload & {
|
|
|
166
163
|
}) | AirMessageErrorPayload;
|
|
167
164
|
export type AirAuthCredentialSaltResponseMessage = AirAuthMessageBase<"air_auth_credential_salt_response", AirAuthCredentialSaltResponsePayload>;
|
|
168
165
|
export type StartRecoveryOptions = {
|
|
169
|
-
type?: "import" | "
|
|
166
|
+
type?: "import" | "update" | "delete" | "recovery" | "setup";
|
|
170
167
|
};
|
|
171
168
|
export type AirAuthStartRecoveryRequestPayload = {
|
|
172
169
|
options?: StartRecoveryOptions;
|
|
@@ -174,14 +171,63 @@ export type AirAuthStartRecoveryRequestPayload = {
|
|
|
174
171
|
};
|
|
175
172
|
export type AirStartRecoveryRequestMessage = AirAuthMessageBase<"air_start_recovery_request", AirAuthStartRecoveryRequestPayload>;
|
|
176
173
|
export type AirStartRecoveryResponseMessage = AirAuthMessageBase<"air_start_recovery_response", AirMessageSuccessPayload | AirMessageErrorPayload>;
|
|
177
|
-
export type
|
|
174
|
+
export type UpdateEmailCompletePayloadParam = {
|
|
175
|
+
privyAccessToken?: string;
|
|
176
|
+
intentId?: string;
|
|
177
|
+
};
|
|
178
|
+
export type RecoverEmailPayloadParam = {
|
|
179
|
+
privyAccessToken?: string;
|
|
180
|
+
};
|
|
181
|
+
export type AirAuthRecoveryRequestPayloadBase = {
|
|
178
182
|
email: string;
|
|
183
|
+
flow?: AirAuthRecoveryFlowType;
|
|
184
|
+
};
|
|
185
|
+
export type AirAuthRecoverEmailRequestPayload = AirAuthRecoveryRequestPayloadBase & {
|
|
186
|
+
flow: AirAuthRecoveryFlowType.RECOVER_EMAIL;
|
|
187
|
+
recoveryPayload: RecoverEmailPayloadParam;
|
|
179
188
|
};
|
|
180
|
-
export type
|
|
181
|
-
type
|
|
189
|
+
export type AirAuthRecoveryLoginRequestPayload = AirAuthRecoveryRequestPayloadBase;
|
|
190
|
+
export type AirAuthUpdateEmailVerifyOldRequestPayload = AirAuthRecoveryRequestPayloadBase & {
|
|
191
|
+
flow: AirAuthRecoveryFlowType.UPDATE_EMAIL_VERIFY_OLD_EMAIL;
|
|
192
|
+
};
|
|
193
|
+
export type AirAuthUpdateEmailConfirmNewRequestPayload = AirAuthRecoveryRequestPayloadBase & {
|
|
194
|
+
flow: AirAuthRecoveryFlowType.UPDATE_EMAIL_VERIFY_UPDATE_NEW_EMAIL;
|
|
195
|
+
recoveryPayload: UpdateEmailCompletePayloadParam;
|
|
196
|
+
};
|
|
197
|
+
export type AirAuthRecoveryRequestPayload = AirAuthRecoverEmailRequestPayload | AirAuthRecoveryLoginRequestPayload | AirAuthUpdateEmailVerifyOldRequestPayload | AirAuthUpdateEmailConfirmNewRequestPayload;
|
|
198
|
+
export type AirAuthRecoveryRequestMessage = AirAuthMessageBase<"air_auth_recovery_request", AirAuthRecoveryRequestPayload>;
|
|
199
|
+
export type AirAuthRecoverySuccessPayload = AirMessageSuccessPayload & {
|
|
182
200
|
userInfo?: PartnerUserResponse;
|
|
201
|
+
intentId?: string;
|
|
202
|
+
};
|
|
203
|
+
export type AirAuthRecoveryResponseMessage = AirAuthMessageBase<"air_auth_recovery_response", AirAuthRecoverySuccessPayload | AirMessageErrorPayload>;
|
|
204
|
+
export type AirAuthLinkEoaCredentialRequestPayload = LinkEoaCredentialParams;
|
|
205
|
+
export type AirAuthLinkEoaCredentialRequestMessage = AirAuthMessageBase<"air_auth_link_eoa_credential_request", AirAuthLinkEoaCredentialRequestPayload>;
|
|
206
|
+
export type AirAuthLinkEoaCredentialResponsePayload = AirMessageSuccessPayload | AirMessageErrorPayload;
|
|
207
|
+
export type AirAuthLinkEoaCredentialResponseMessage = AirAuthMessageBase<"air_auth_link_eoa_credential_response", AirAuthLinkEoaCredentialResponsePayload>;
|
|
208
|
+
export type AirAuthLinkageNonceRequestPayload = LinkEoaNonceRequestParams;
|
|
209
|
+
export type AirAuthLinkageNonceResponsePayload = (AirMessageSuccessPayload & {
|
|
210
|
+
nonce: string;
|
|
211
|
+
}) | AirMessageErrorPayload;
|
|
212
|
+
export type AirAuthLinkageNonceRequestMessage = AirAuthMessageBase<"air_auth_linkage_nonce_request", AirAuthLinkageNonceRequestPayload>;
|
|
213
|
+
export type AirAuthLinkageNonceResponseMessage = AirAuthMessageBase<"air_auth_linkage_nonce_response", AirAuthLinkageNonceResponsePayload>;
|
|
214
|
+
export type CredentialSignersParams = {
|
|
215
|
+
nonce: string;
|
|
216
|
+
eoaAddress: string;
|
|
217
|
+
signature: string;
|
|
218
|
+
};
|
|
219
|
+
export type AirAuthCredentialSignersRequestPayload = CredentialSignersParams;
|
|
220
|
+
export type AirAuthCredentialSignersRequestMessage = AirAuthMessageBase<"air_auth_credential_signers_request", AirAuthCredentialSignersRequestPayload>;
|
|
221
|
+
export type CredentialSigner = {
|
|
222
|
+
id: string;
|
|
223
|
+
eoaAddress: string;
|
|
224
|
+
chainIds: number[];
|
|
225
|
+
chainOrder: number;
|
|
226
|
+
encryptedTkSeed: string;
|
|
183
227
|
};
|
|
184
|
-
export type
|
|
185
|
-
|
|
186
|
-
|
|
228
|
+
export type AirAuthCredentialSignersResponsePayload = (AirMessageSuccessPayload & {
|
|
229
|
+
credentials: CredentialSigner[];
|
|
230
|
+
}) | AirMessageErrorPayload;
|
|
231
|
+
export type AirAuthCredentialSignersResponseMessage = AirAuthMessageBase<"air_auth_credential_signers_response", AirAuthCredentialSignersResponsePayload>;
|
|
232
|
+
export type AirAuthMessage = AirAuthSetupCompletedMessage | AirAuthInitializationRequestMessage | AirAuthInitializationResponseMessage | AirAuthLoginRequestMessage | AirAuthLoginResponseToEmbedMessage | AirAuthLoginResponseToWalletServiceMessage | AirAuthUserInfoRequestMessage | AirAuthUserInfoResponseMessage | AirAuthPartnerUserInfoRequestMessage | AirAuthPartnerUserInfoResponseMessage | AirAuthRefreshTokenRequestMessage | AirAuthRefreshTokenResponseMessage | AirAuthWalletTokenRequestMessage | AirAuthWalletTokenResponseMessage | AirAuthInitWalletCommunicationMessage | AirAuthSetupWalletRequestMessage | AirAuthSetupWalletResponseMessage | AirAuthSignSiweMessageRequestMessage | AirAuthSignSiweMessageResponseMessage | AirAuthCrossPartnerTokenRequestMessage | AirAuthCrossPartnerTokenResponseMessage | AirAuthLogoutRequestMessage | AirAuthLogoutResponseMessage | AirAuthIframeVisibilityRequestMessage | AirAuthResetWalletCommunicationRequestMessage | AirAuthPartnerAccessTokenRequestMessage | AirAuthPartnerAccessTokenResponseMessage | AirAuthSetupRecoveryRequestMessage | AirAuthSetupRecoveryResponseMessage | AirAuthInitRecoveryCommunicationMessage | AirAuthResetRecoveryCommunicationMessage | AirAuthCredentialSaltRequestMessage | AirAuthCredentialSaltResponseMessage | AirStartRecoveryRequestMessage | AirStartRecoveryResponseMessage | AirAuthRecoveryRequestMessage | AirAuthRecoveryResponseMessage | AirAuthLinkEoaCredentialRequestMessage | AirAuthLinkEoaCredentialResponseMessage | AirAuthLinkageNonceRequestMessage | AirAuthLinkageNonceResponseMessage | AirAuthCredentialSignersRequestMessage | AirAuthCredentialSignersResponseMessage;
|
|
187
233
|
export {};
|
|
@@ -26,7 +26,7 @@ export declare abstract class MessageServiceBase<TMessage extends AirMessageBase
|
|
|
26
26
|
type: T;
|
|
27
27
|
payload: {
|
|
28
28
|
success: false;
|
|
29
|
-
errorName: import("../error/codes").AuthErrorName | import("../error/codes").PartnerAccessTokenErrorName | import("../error/codes").RealmIDErrorName | import("../error/codes").ParameterErrorName | import("../error/codes").ServerErrorName | import("../error/codes").PasskeyErrorName | import("../error/codes").PasswordlessErrorName | import("../error/codes").AuthWalletErrorName | import("../error/codes").WalletLinkErrorName | import("../error/codes").IntentErrorName | import("../error/codes").PrivyErrorName | import("../error/codes").AirIDErrorName | import("../error/codes").WindowErrorName
|
|
29
|
+
errorName: "USER_CANCELLED" | "CONFIG_ERROR" | "CLIENT_ERROR" | "UNKNOWN_ERROR" | "PERMISSION_NOT_ENABLED" | "SMART_ACCOUNT_NOT_DEPLOYED" | import("../error/codes").AuthErrorName | import("../error/codes").PartnerAccessTokenErrorName | import("../error/codes").RealmIDErrorName | import("../error/codes").ParameterErrorName | import("../error/codes").ServerErrorName | import("../error/codes").PasskeyErrorName | import("../error/codes").PasswordlessErrorName | import("../error/codes").AuthWalletErrorName | import("../error/codes").WalletLinkErrorName | import("../error/codes").IntentErrorName | import("../error/codes").PrivyErrorName | import("../error/codes").AirIDErrorName | import("../error/codes").WindowErrorName;
|
|
30
30
|
errorMessage: string;
|
|
31
31
|
};
|
|
32
32
|
};
|