@ab-org/sdk-core 0.2.2-beta.0 → 0.3.0-beta.1
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/{chunk-MVZIAM4H.js → chunk-6MYKCH4B.js} +14 -6
- package/dist/{chunk-5HURLKIK.js → chunk-ICBI4K6V.js} +15 -1
- package/dist/{cubeSignerAuth-DrPc9FeB.d.ts → cubeSignerAuth-CPAFyY1y.d.ts} +4 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.js +39 -12
- package/dist/social-auth.d.ts +2 -2
- package/dist/social-auth.js +1 -1
- package/dist/{social-provider-Bq58TBRt.d.ts → social-provider-Djlvwn3K.d.ts} +3 -2
- package/dist/social-provider.d.ts +2 -2
- package/dist/social-provider.js +2 -2
- package/dist/social.d.ts +2 -2
- package/dist/social.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CubeSignerAuth, createCubistEvmWalletProvider } from './chunk-
|
|
1
|
+
import { CubeSignerAuth, createCubistEvmWalletProvider } from './chunk-ICBI4K6V.js';
|
|
2
2
|
|
|
3
3
|
// src/core/chains.ts
|
|
4
4
|
var chainDescriptors = {
|
|
@@ -232,7 +232,7 @@ var defaultAdapter = {
|
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
var
|
|
235
|
+
var CUBIST_CAPABILITIES = [
|
|
236
236
|
"eth_accounts",
|
|
237
237
|
"eth_requestAccounts",
|
|
238
238
|
"eth_chainId",
|
|
@@ -264,7 +264,7 @@ var CubistSocialProvider = class extends AbstractSocialProvider {
|
|
|
264
264
|
authSource: method.type,
|
|
265
265
|
sessionId: `${method.type}:${walletSession.address.toLowerCase()}`,
|
|
266
266
|
expiresAt: capabilityPolicy?.expiresAt,
|
|
267
|
-
capabilities:
|
|
267
|
+
capabilities: CUBIST_CAPABILITIES,
|
|
268
268
|
sessionData: session.sessionData,
|
|
269
269
|
chainContext: walletSession.chainContext ?? createChainContext(walletSession.chain),
|
|
270
270
|
capabilityPolicy
|
|
@@ -327,15 +327,23 @@ var CubistSocialProvider = class extends AbstractSocialProvider {
|
|
|
327
327
|
);
|
|
328
328
|
this.lastCubeSignerSession = csSession;
|
|
329
329
|
const walletSession = await this.adapter.resolve(csSession);
|
|
330
|
+
const restoredChain = persistedSession.chain ?? walletSession.chain;
|
|
331
|
+
const restoredProvider = restoredChain === walletSession.chain ? walletSession.provider : createCubistEvmWalletProvider({
|
|
332
|
+
session: csSession,
|
|
333
|
+
address: walletSession.address,
|
|
334
|
+
chain: restoredChain
|
|
335
|
+
});
|
|
330
336
|
return this.setSession({
|
|
331
337
|
...walletSession,
|
|
338
|
+
chain: restoredChain,
|
|
339
|
+
provider: restoredProvider,
|
|
332
340
|
walletType: persistedSession.walletType ?? "social",
|
|
333
341
|
authSource: persistedSession.authSource,
|
|
334
342
|
sessionId: persistedSession.sessionId,
|
|
335
343
|
expiresAt: persistedSession.expiresAt,
|
|
336
|
-
capabilities:
|
|
344
|
+
capabilities: CUBIST_CAPABILITIES,
|
|
337
345
|
sessionData: csSession.sessionData,
|
|
338
|
-
chainContext:
|
|
346
|
+
chainContext: createChainContext(restoredChain),
|
|
339
347
|
capabilityPolicy: persistedSession.capabilityPolicy
|
|
340
348
|
});
|
|
341
349
|
} catch {
|
|
@@ -360,4 +368,4 @@ var CubistSocialProvider = class extends AbstractSocialProvider {
|
|
|
360
368
|
}
|
|
361
369
|
};
|
|
362
370
|
|
|
363
|
-
export { AbstractProvider, AbstractSocialProvider, CubistSocialProvider, SessionCapabilityError, assertSessionCapability, createChainContext, createSessionCapabilityPolicy, describeSessionCapabilityPolicy, getAllChainDescriptors, getChainDescriptor, getSupportedChainFromEvmChainId, isCapabilityPolicyExpired, isSessionExpired, sessionSupportsCapability };
|
|
371
|
+
export { AbstractProvider, AbstractSocialProvider, CUBIST_CAPABILITIES, CubistSocialProvider, SessionCapabilityError, assertSessionCapability, createChainContext, createSessionCapabilityPolicy, describeSessionCapabilityPolicy, getAllChainDescriptors, getChainDescriptor, getSupportedChainFromEvmChainId, isCapabilityPolicyExpired, isSessionExpired, sessionSupportsCapability };
|
|
@@ -284,6 +284,12 @@ var _CubistApiClient = class _CubistApiClient {
|
|
|
284
284
|
get sessionMeta() {
|
|
285
285
|
return __privateGet(this, _sessionMeta);
|
|
286
286
|
}
|
|
287
|
+
async retrieveSessionData() {
|
|
288
|
+
if (typeof __privateGet(this, _sessionManager).retrieve !== "function") {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
return __privateGet(this, _sessionManager).retrieve();
|
|
292
|
+
}
|
|
287
293
|
withOrg(orgId) {
|
|
288
294
|
return new _CubistApiClient(__privateGet(this, _sessionManager), __privateGet(this, _sessionMeta), orgId);
|
|
289
295
|
}
|
|
@@ -540,6 +546,9 @@ var _CubeSignerClient = class _CubeSignerClient {
|
|
|
540
546
|
get orgId() {
|
|
541
547
|
return __privateGet(this, _apiClient4).orgId;
|
|
542
548
|
}
|
|
549
|
+
async retrieveSessionData() {
|
|
550
|
+
return __privateGet(this, _apiClient4).retrieveSessionData();
|
|
551
|
+
}
|
|
543
552
|
static async create(session, targetOrgId) {
|
|
544
553
|
const created = typeof session === "string" || isSessionData(session) ? new MemorySessionManager(parseSessionLike(session)) : session;
|
|
545
554
|
if (typeof session === "object" && session !== null && session.onInvalidToken && created instanceof MemorySessionManager) {
|
|
@@ -695,6 +704,11 @@ _options = new WeakMap();
|
|
|
695
704
|
function resolveEnv(env) {
|
|
696
705
|
return typeof env === "string" ? envs[env] : env;
|
|
697
706
|
}
|
|
707
|
+
async function refreshCubeSignerSessionData(sessionData) {
|
|
708
|
+
const client = await CubeSignerClient.create(sessionData);
|
|
709
|
+
await client.sessionKeys();
|
|
710
|
+
return await client.retrieveSessionData() ?? sessionData;
|
|
711
|
+
}
|
|
698
712
|
var CubeSignerAuth = class {
|
|
699
713
|
constructor(config) {
|
|
700
714
|
this._client = null;
|
|
@@ -1002,4 +1016,4 @@ var createCubistEvmWalletProvider = ({
|
|
|
1002
1016
|
};
|
|
1003
1017
|
};
|
|
1004
1018
|
|
|
1005
|
-
export { CubeSignerAuth, createCubistEvmWalletProvider };
|
|
1019
|
+
export { CubeSignerAuth, createCubistEvmWalletProvider, refreshCubeSignerSessionData };
|
|
@@ -267,6 +267,7 @@ declare class CubistApiClient {
|
|
|
267
267
|
get env(): EnvInterface;
|
|
268
268
|
get orgId(): string;
|
|
269
269
|
get sessionMeta(): SessionMetadata;
|
|
270
|
+
retrieveSessionData(): Promise<SessionData | null>;
|
|
270
271
|
withOrg(orgId: string): CubistApiClient;
|
|
271
272
|
sessionKeysList(): Promise<KeyInfo[]>;
|
|
272
273
|
keyGetByMaterialId(keyType: string, materialId: string): Promise<KeyInfo>;
|
|
@@ -320,6 +321,7 @@ declare class CubeSignerClient {
|
|
|
320
321
|
get apiClient(): CubistApiClient;
|
|
321
322
|
get env(): EnvInterface;
|
|
322
323
|
get orgId(): string;
|
|
324
|
+
retrieveSessionData(): Promise<SessionData | null>;
|
|
323
325
|
static create(session: string | SessionData | SessionManager, targetOrgId?: string): Promise<CubeSignerClient>;
|
|
324
326
|
static createOidcSession(env: EnvInterface, orgId: string, token: string, scopes: Array<Scope>, lifetimes?: RatchetConfig, mfaReceipt?: MfaReceipts, purpose?: string): Promise<CubeSignerResponse<SessionData>>;
|
|
325
327
|
static proveOidcIdentity(env: EnvInterface, orgId: string, token: string): Promise<IdentityProof>;
|
|
@@ -373,6 +375,7 @@ interface TwitterCodeExchangeParams {
|
|
|
373
375
|
/** redirect_uri that was used in the authorization request. */
|
|
374
376
|
redirectUri: string;
|
|
375
377
|
}
|
|
378
|
+
declare function refreshCubeSignerSessionData(sessionData: SessionData): Promise<SessionData>;
|
|
376
379
|
declare class CubeSignerAuth {
|
|
377
380
|
private readonly env;
|
|
378
381
|
private readonly orgId;
|
|
@@ -423,4 +426,4 @@ declare class CubeSignerAuth {
|
|
|
423
426
|
private createOidcSession;
|
|
424
427
|
}
|
|
425
428
|
|
|
426
|
-
export {
|
|
429
|
+
export { getChainDescriptor as A, type BalanceInfo as B, CubeSignerAuth as C, getSupportedChainFromEvmChainId as D, type EvmTransactionRequest as E, isCapabilityPolicyExpired as F, isSessionExpired as G, sessionSupportsCapability as H, type OidcLoginHooks as O, type ProviderCategory as P, type SessionCapabilityCheck as S, type TwitterCodeExchangeParams as T, type WalletState as W, type CubeSignerConfig as a, type CubeSignerSession as b, type WalletSession as c, type WalletAdapter as d, type WalletConnectArgs as e, type WalletCapability as f, type WalletProviderRequest as g, type SupportedChain as h, type WalletProvider as i, type ChainContext as j, type SessionCapabilityPolicy as k, type ChainDescriptor as l, type ChainNamespace as m, type ChainRpcFamily as n, type EvmAccessListItem as o, type EvmQuantity as p, SessionCapabilityError as q, refreshCubeSignerSessionData as r, type SupportedToken as s, type WalletAuthSource as t, type WalletType as u, assertSessionCapability as v, createChainContext as w, createSessionCapabilityPolicy as x, describeSessionCapabilityPolicy as y, getAllChainDescriptors as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { W as WalletState, c as WalletSession, B as BalanceInfo, d as WalletAdapter, e as WalletConnectArgs, f as WalletCapability, g as WalletProviderRequest, E as EvmTransactionRequest, S as SessionCapabilityCheck, h as SupportedChain, i as WalletProvider, j as ChainContext, k as SessionCapabilityPolicy } from './cubeSignerAuth-
|
|
2
|
-
export { l as ChainDescriptor, m as ChainNamespace, n as ChainRpcFamily, C as CubeSignerAuth, a as CubeSignerConfig, b as CubeSignerSession, o as EvmAccessListItem, p as EvmQuantity, O as OidcLoginHooks, P as ProviderCategory, q as SessionCapabilityError,
|
|
1
|
+
import { W as WalletState, c as WalletSession, B as BalanceInfo, d as WalletAdapter, e as WalletConnectArgs, f as WalletCapability, g as WalletProviderRequest, E as EvmTransactionRequest, S as SessionCapabilityCheck, h as SupportedChain, i as WalletProvider, j as ChainContext, k as SessionCapabilityPolicy } from './cubeSignerAuth-CPAFyY1y.js';
|
|
2
|
+
export { l as ChainDescriptor, m as ChainNamespace, n as ChainRpcFamily, C as CubeSignerAuth, a as CubeSignerConfig, b as CubeSignerSession, o as EvmAccessListItem, p as EvmQuantity, O as OidcLoginHooks, P as ProviderCategory, q as SessionCapabilityError, s as SupportedToken, T as TwitterCodeExchangeParams, t as WalletAuthSource, u as WalletType, v as assertSessionCapability, w as createChainContext, x as createSessionCapabilityPolicy, y as describeSessionCapabilityPolicy, z as getAllChainDescriptors, A as getChainDescriptor, D as getSupportedChainFromEvmChainId, F as isCapabilityPolicyExpired, G as isSessionExpired, r as refreshCubeSignerSessionData, H as sessionSupportsCapability } from './cubeSignerAuth-CPAFyY1y.js';
|
|
3
3
|
import EventEmitter from 'eventemitter3';
|
|
4
|
-
import {
|
|
5
|
-
export { A as AbstractSocialProvider, C as
|
|
4
|
+
import { e as AbstractProvider } from './social-provider-Djlvwn3K.js';
|
|
5
|
+
export { A as AbstractSocialProvider, C as CUBIST_CAPABILITIES, a as CubistLoginMethod, b as CubistSessionAdapter, c as CubistSocialProvider, S as SocialConnectArgs, d as SocialLoginOptions } from './social-provider-Djlvwn3K.js';
|
|
6
6
|
|
|
7
7
|
declare const EVM_TRANSACTION_SIGNING_UNSUPPORTED = "EVM_TRANSACTION_SIGNING_UNSUPPORTED";
|
|
8
8
|
declare class EvmTransactionSigningUnsupportedError extends Error {
|
|
@@ -14,6 +14,9 @@ declare class EvmTransactionSigningUnsupportedError extends Error {
|
|
|
14
14
|
declare const isUnsupportedEvmTransactionSigningError: (error: unknown) => boolean;
|
|
15
15
|
declare const normalizeEvmTransactionSigningError: (providerName: string, error: unknown) => Error;
|
|
16
16
|
|
|
17
|
+
declare const STALE_SESSION_ERROR_MESSAGE = "Session restored from cache. Reconnect your wallet for transactions.";
|
|
18
|
+
declare const USER_SESSION_EXPIRED_MESSAGE = "Session expired. Please reconnect your wallet and try again.";
|
|
19
|
+
declare function isStaleSessionError(error: unknown): boolean;
|
|
17
20
|
type WalletEvents = {
|
|
18
21
|
"session:changed": [WalletSession | null];
|
|
19
22
|
"session:rehydrated": [WalletSession];
|
|
@@ -234,4 +237,4 @@ interface InjectedWalletRegistryItem {
|
|
|
234
237
|
}
|
|
235
238
|
declare function createDefaultInjectedWalletRegistry(): InjectedWalletRegistryItem[];
|
|
236
239
|
|
|
237
|
-
export { AbstractProvider, BalanceInfo, BitgetProvider, BraveWalletProvider, ChainContext, CoinbaseWalletProvider, type EIP6963ProviderDetail, type EIP6963ProviderInfo, EVM_TRANSACTION_SIGNING_UNSUPPORTED, EvmTransactionRequest, EvmTransactionSigningUnsupportedError, type InjectedEthereumProvider, InjectedEvmProvider, type InjectedWalletConfig, type InjectedWalletRegistryItem, MetaMaskProvider, OKXProvider, PhantomProvider, RabbyProvider, RainbowProvider, SessionCapabilityCheck, SessionCapabilityPolicy, SessionStore, SupportedChain, TrustWalletProvider, WalletAdapter, WalletCapability, WalletConnectArgs, type WalletConnectControllerOptions, WalletConnector, type WalletEvents, type WalletExecutionClient, WalletProvider, WalletProviderRequest, WalletSession, WalletState, ZerionProvider, createAccountController, createDefaultInjectedWalletRegistry, createWalletConnectController, createWalletExecutionClient, createWalletExecutionController, discoverEIP6963Providers, findEIP6963Provider, findInjectedProvider, getWalletExecutionCapabilities, isUnsupportedEvmTransactionSigningError, normalizeEvmTransactionSigningError, sessionStore, switchToFallbackFundingChain };
|
|
240
|
+
export { AbstractProvider, BalanceInfo, BitgetProvider, BraveWalletProvider, ChainContext, CoinbaseWalletProvider, type EIP6963ProviderDetail, type EIP6963ProviderInfo, EVM_TRANSACTION_SIGNING_UNSUPPORTED, EvmTransactionRequest, EvmTransactionSigningUnsupportedError, type InjectedEthereumProvider, InjectedEvmProvider, type InjectedWalletConfig, type InjectedWalletRegistryItem, MetaMaskProvider, OKXProvider, PhantomProvider, RabbyProvider, RainbowProvider, STALE_SESSION_ERROR_MESSAGE, SessionCapabilityCheck, SessionCapabilityPolicy, SessionStore, SupportedChain, TrustWalletProvider, USER_SESSION_EXPIRED_MESSAGE, WalletAdapter, WalletCapability, WalletConnectArgs, type WalletConnectControllerOptions, WalletConnector, type WalletEvents, type WalletExecutionClient, WalletProvider, WalletProviderRequest, WalletSession, WalletState, ZerionProvider, createAccountController, createDefaultInjectedWalletRegistry, createWalletConnectController, createWalletExecutionClient, createWalletExecutionController, discoverEIP6963Providers, findEIP6963Provider, findInjectedProvider, getWalletExecutionCapabilities, isStaleSessionError, isUnsupportedEvmTransactionSigningError, normalizeEvmTransactionSigningError, sessionStore, switchToFallbackFundingChain };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractProvider, getSupportedChainFromEvmChainId,
|
|
2
|
-
export { AbstractProvider, AbstractSocialProvider, CubistSocialProvider, SessionCapabilityError, assertSessionCapability, createChainContext, createSessionCapabilityPolicy, describeSessionCapabilityPolicy, getAllChainDescriptors, getChainDescriptor, getSupportedChainFromEvmChainId, isCapabilityPolicyExpired, isSessionExpired, sessionSupportsCapability } from './chunk-
|
|
3
|
-
export { CubeSignerAuth } from './chunk-
|
|
1
|
+
import { createChainContext, AbstractProvider, getSupportedChainFromEvmChainId, assertSessionCapability } from './chunk-6MYKCH4B.js';
|
|
2
|
+
export { AbstractProvider, AbstractSocialProvider, CUBIST_CAPABILITIES, CubistSocialProvider, SessionCapabilityError, assertSessionCapability, createChainContext, createSessionCapabilityPolicy, describeSessionCapabilityPolicy, getAllChainDescriptors, getChainDescriptor, getSupportedChainFromEvmChainId, isCapabilityPolicyExpired, isSessionExpired, sessionSupportsCapability } from './chunk-6MYKCH4B.js';
|
|
3
|
+
export { CubeSignerAuth, refreshCubeSignerSessionData } from './chunk-ICBI4K6V.js';
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
|
|
6
6
|
// src/core/errors.ts
|
|
@@ -73,6 +73,12 @@ function persistSession(session) {
|
|
|
73
73
|
if (session.capabilities?.length) {
|
|
74
74
|
serializable.capabilities = session.capabilities;
|
|
75
75
|
}
|
|
76
|
+
if (session.sessionData !== void 0) {
|
|
77
|
+
serializable.sessionData = session.sessionData;
|
|
78
|
+
}
|
|
79
|
+
if (session.capabilityPolicy !== void 0) {
|
|
80
|
+
serializable.capabilityPolicy = session.capabilityPolicy;
|
|
81
|
+
}
|
|
76
82
|
try {
|
|
77
83
|
storage.setItem(STORAGE_KEY, JSON.stringify(serializable));
|
|
78
84
|
} catch {
|
|
@@ -91,11 +97,14 @@ function readPersistedSession() {
|
|
|
91
97
|
return null;
|
|
92
98
|
}
|
|
93
99
|
}
|
|
100
|
+
var STALE_SESSION_ERROR_MESSAGE = "Session restored from cache. Reconnect your wallet for transactions.";
|
|
101
|
+
var USER_SESSION_EXPIRED_MESSAGE = "Session expired. Please reconnect your wallet and try again.";
|
|
102
|
+
function isStaleSessionError(error) {
|
|
103
|
+
return error instanceof Error && error.message.includes(STALE_SESSION_ERROR_MESSAGE);
|
|
104
|
+
}
|
|
94
105
|
var staleProvider = {
|
|
95
106
|
request() {
|
|
96
|
-
return Promise.reject(
|
|
97
|
-
new Error("Session restored from cache. Reconnect your wallet for transactions.")
|
|
98
|
-
);
|
|
107
|
+
return Promise.reject(new Error(STALE_SESSION_ERROR_MESSAGE));
|
|
99
108
|
},
|
|
100
109
|
disconnect() {
|
|
101
110
|
return Promise.resolve();
|
|
@@ -163,7 +172,11 @@ var SessionStore = class {
|
|
|
163
172
|
persistSession(null);
|
|
164
173
|
return;
|
|
165
174
|
}
|
|
166
|
-
this.state.session = {
|
|
175
|
+
this.state.session = {
|
|
176
|
+
...persisted,
|
|
177
|
+
provider: staleProvider,
|
|
178
|
+
chainContext: createChainContext(persisted.chain)
|
|
179
|
+
};
|
|
167
180
|
}
|
|
168
181
|
};
|
|
169
182
|
var sessionStore = new SessionStore();
|
|
@@ -187,6 +200,20 @@ var performCapabilityCheck = (session, capability, check) => {
|
|
|
187
200
|
now: check?.now
|
|
188
201
|
});
|
|
189
202
|
};
|
|
203
|
+
var normalizeExecutionError = (error) => {
|
|
204
|
+
if (isStaleSessionError(error)) {
|
|
205
|
+
sessionStore.clearSession();
|
|
206
|
+
throw new Error(USER_SESSION_EXPIRED_MESSAGE);
|
|
207
|
+
}
|
|
208
|
+
throw error;
|
|
209
|
+
};
|
|
210
|
+
var requestSessionProvider = async (session, payload) => {
|
|
211
|
+
try {
|
|
212
|
+
return await session.provider.request(payload);
|
|
213
|
+
} catch (error) {
|
|
214
|
+
return normalizeExecutionError(error);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
190
217
|
var getWalletExecutionCapabilities = (session) => requireSession(session).capabilities ?? [];
|
|
191
218
|
var createWalletExecutionClient = (session) => {
|
|
192
219
|
const resolvedSession = requireSession(session);
|
|
@@ -201,7 +228,7 @@ var createWalletExecutionClient = (session) => {
|
|
|
201
228
|
...check,
|
|
202
229
|
amount: check?.amount ?? transaction.value
|
|
203
230
|
});
|
|
204
|
-
return resolvedSession
|
|
231
|
+
return requestSessionProvider(resolvedSession, {
|
|
205
232
|
method: "eth_sendTransaction",
|
|
206
233
|
params: [{ ...transaction, from: transaction.from ?? resolvedSession.address }]
|
|
207
234
|
});
|
|
@@ -211,21 +238,21 @@ var createWalletExecutionClient = (session) => {
|
|
|
211
238
|
...check,
|
|
212
239
|
amount: check?.amount ?? transaction.value
|
|
213
240
|
});
|
|
214
|
-
return resolvedSession
|
|
241
|
+
return requestSessionProvider(resolvedSession, {
|
|
215
242
|
method: "eth_signTransaction",
|
|
216
243
|
params: [{ ...transaction, from: transaction.from ?? resolvedSession.address }]
|
|
217
244
|
});
|
|
218
245
|
},
|
|
219
246
|
async signMessage(message, check) {
|
|
220
247
|
performCapabilityCheck(resolvedSession, "personal_sign", check);
|
|
221
|
-
return resolvedSession
|
|
248
|
+
return requestSessionProvider(resolvedSession, {
|
|
222
249
|
method: "personal_sign",
|
|
223
250
|
params: [message, resolvedSession.address]
|
|
224
251
|
});
|
|
225
252
|
},
|
|
226
253
|
async signTypedData(typedData, check) {
|
|
227
254
|
performCapabilityCheck(resolvedSession, "eth_signTypedData_v4", check);
|
|
228
|
-
return resolvedSession
|
|
255
|
+
return requestSessionProvider(resolvedSession, {
|
|
229
256
|
method: "eth_signTypedData_v4",
|
|
230
257
|
params: [resolvedSession.address, JSON.stringify(typedData)]
|
|
231
258
|
});
|
|
@@ -1116,4 +1143,4 @@ function createDefaultInjectedWalletRegistry() {
|
|
|
1116
1143
|
}));
|
|
1117
1144
|
}
|
|
1118
1145
|
|
|
1119
|
-
export { BitgetProvider, BraveWalletProvider, CoinbaseWalletProvider, EVM_TRANSACTION_SIGNING_UNSUPPORTED, EvmTransactionSigningUnsupportedError, InjectedEvmProvider, MetaMaskProvider, OKXProvider, PhantomProvider, RabbyProvider, RainbowProvider, SessionStore, TrustWalletProvider, WalletConnector, ZerionProvider, createAccountController, createDefaultInjectedWalletRegistry, createWalletConnectController, createWalletExecutionClient, createWalletExecutionController, discoverEIP6963Providers, findEIP6963Provider, findInjectedProvider, getWalletExecutionCapabilities, isUnsupportedEvmTransactionSigningError, normalizeEvmTransactionSigningError, sessionStore, switchToFallbackFundingChain };
|
|
1146
|
+
export { BitgetProvider, BraveWalletProvider, CoinbaseWalletProvider, EVM_TRANSACTION_SIGNING_UNSUPPORTED, EvmTransactionSigningUnsupportedError, InjectedEvmProvider, MetaMaskProvider, OKXProvider, PhantomProvider, RabbyProvider, RainbowProvider, STALE_SESSION_ERROR_MESSAGE, SessionStore, TrustWalletProvider, USER_SESSION_EXPIRED_MESSAGE, WalletConnector, ZerionProvider, createAccountController, createDefaultInjectedWalletRegistry, createWalletConnectController, createWalletExecutionClient, createWalletExecutionController, discoverEIP6963Providers, findEIP6963Provider, findInjectedProvider, getWalletExecutionCapabilities, isStaleSessionError, isUnsupportedEvmTransactionSigningError, normalizeEvmTransactionSigningError, sessionStore, switchToFallbackFundingChain };
|
package/dist/social-auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as CubeSignerSession, h as SupportedChain, i as WalletProvider } from './cubeSignerAuth-
|
|
2
|
-
export { C as CubeSignerAuth, a as CubeSignerConfig, O as OidcLoginHooks, T as TwitterCodeExchangeParams } from './cubeSignerAuth-
|
|
1
|
+
import { b as CubeSignerSession, h as SupportedChain, i as WalletProvider } from './cubeSignerAuth-CPAFyY1y.js';
|
|
2
|
+
export { C as CubeSignerAuth, a as CubeSignerConfig, O as OidcLoginHooks, T as TwitterCodeExchangeParams, r as refreshCubeSignerSessionData } from './cubeSignerAuth-CPAFyY1y.js';
|
|
3
3
|
|
|
4
4
|
interface CreateCubistEvmWalletProviderArgs {
|
|
5
5
|
session: CubeSignerSession;
|
package/dist/social-auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CubeSignerAuth, createCubistEvmWalletProvider } from './chunk-
|
|
1
|
+
export { CubeSignerAuth, createCubistEvmWalletProvider, refreshCubeSignerSessionData } from './chunk-ICBI4K6V.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as WalletAdapter, P as ProviderCategory, c as WalletSession, e as WalletConnectArgs, i as WalletProvider, T as TwitterCodeExchangeParams, b as CubeSignerSession, a as CubeSignerConfig, C as CubeSignerAuth } from './cubeSignerAuth-
|
|
1
|
+
import { d as WalletAdapter, P as ProviderCategory, c as WalletSession, e as WalletConnectArgs, i as WalletProvider, f as WalletCapability, T as TwitterCodeExchangeParams, b as CubeSignerSession, a as CubeSignerConfig, C as CubeSignerAuth } from './cubeSignerAuth-CPAFyY1y.js';
|
|
2
2
|
|
|
3
3
|
declare abstract class AbstractProvider implements WalletAdapter {
|
|
4
4
|
abstract readonly id: string;
|
|
@@ -49,6 +49,7 @@ interface CubistSessionAdapter {
|
|
|
49
49
|
*/
|
|
50
50
|
resolve(session: CubeSignerSession): Promise<WalletSession>;
|
|
51
51
|
}
|
|
52
|
+
declare const CUBIST_CAPABILITIES: WalletCapability[];
|
|
52
53
|
declare class CubistSocialProvider extends AbstractSocialProvider {
|
|
53
54
|
readonly id = "cubist";
|
|
54
55
|
readonly title = "Cubist Social Wallet";
|
|
@@ -85,4 +86,4 @@ declare class CubistSocialProvider extends AbstractSocialProvider {
|
|
|
85
86
|
get cubeSignerSession(): CubeSignerSession | null;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
export { AbstractSocialProvider as A,
|
|
89
|
+
export { AbstractSocialProvider as A, CUBIST_CAPABILITIES as C, type SocialConnectArgs as S, type CubistLoginMethod as a, type CubistSessionAdapter as b, CubistSocialProvider as c, type SocialLoginOptions as d, AbstractProvider as e };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AbstractSocialProvider, C as
|
|
2
|
-
import './cubeSignerAuth-
|
|
1
|
+
export { A as AbstractSocialProvider, C as CUBIST_CAPABILITIES, a as CubistLoginMethod, b as CubistSessionAdapter, c as CubistSocialProvider, S as SocialConnectArgs, d as SocialLoginOptions } from './social-provider-Djlvwn3K.js';
|
|
2
|
+
import './cubeSignerAuth-CPAFyY1y.js';
|
package/dist/social-provider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AbstractSocialProvider, CubistSocialProvider } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { AbstractSocialProvider, CUBIST_CAPABILITIES, CubistSocialProvider } from './chunk-6MYKCH4B.js';
|
|
2
|
+
import './chunk-ICBI4K6V.js';
|
package/dist/social.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CubeSignerAuth, a as CubeSignerConfig, b as CubeSignerSession, O as OidcLoginHooks, T as TwitterCodeExchangeParams } from './cubeSignerAuth-
|
|
1
|
+
export { C as CubeSignerAuth, a as CubeSignerConfig, b as CubeSignerSession, O as OidcLoginHooks, T as TwitterCodeExchangeParams, r as refreshCubeSignerSessionData } from './cubeSignerAuth-CPAFyY1y.js';
|
|
2
2
|
export { createCubistEvmWalletProvider } from './social-auth.js';
|
|
3
|
-
export { A as AbstractSocialProvider, C as
|
|
3
|
+
export { A as AbstractSocialProvider, C as CUBIST_CAPABILITIES, a as CubistLoginMethod, b as CubistSessionAdapter, c as CubistSocialProvider, S as SocialConnectArgs, d as SocialLoginOptions } from './social-provider-Djlvwn3K.js';
|
package/dist/social.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AbstractSocialProvider, CubistSocialProvider } from './chunk-
|
|
2
|
-
export { CubeSignerAuth, createCubistEvmWalletProvider } from './chunk-
|
|
1
|
+
export { AbstractSocialProvider, CUBIST_CAPABILITIES, CubistSocialProvider } from './chunk-6MYKCH4B.js';
|
|
2
|
+
export { CubeSignerAuth, createCubistEvmWalletProvider, refreshCubeSignerSessionData } from './chunk-ICBI4K6V.js';
|