@rhinestone/1auth 0.7.5 → 0.7.6
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-6MUQKHAT.mjs → chunk-E4YZS7FZ.mjs} +62 -2
- package/dist/chunk-E4YZS7FZ.mjs.map +1 -0
- package/dist/{client-C9mcj5jN.d.ts → client-C8QSA1th.d.mts} +6 -1
- package/dist/{client-BqKAd2RZ.d.mts → client-Dn6mL7BZ.d.ts} +6 -1
- package/dist/headless.d.mts +2 -2
- package/dist/headless.d.ts +2 -2
- package/dist/index.d.mts +157 -7
- package/dist/index.d.ts +157 -7
- package/dist/index.js +166 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -16
- package/dist/index.mjs.map +1 -1
- package/dist/{provider-CCyUBseo.d.ts → provider-BsVmPgkQ.d.ts} +21 -2
- package/dist/{provider-CRhZVLg8.d.mts → provider-CJv38fIK.d.mts} +21 -2
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/{types-CbhPRY5s.d.mts → types-Dzm5lZK-.d.mts} +10 -1
- package/dist/{types-CbhPRY5s.d.ts → types-Dzm5lZK-.d.ts} +10 -1
- package/dist/{verify-DPJR_foR.d.ts → verify-0VXQpQBJ.d.mts} +1 -1
- package/dist/{verify-DVYDJgOS.d.mts → verify-9UgxLSdo.d.ts} +1 -1
- package/dist/wagmi.d.mts +3 -3
- package/dist/wagmi.d.ts +3 -3
- package/dist/wagmi.js +61 -1
- package/dist/wagmi.js.map +1 -1
- package/dist/wagmi.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6MUQKHAT.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { O as OneAuthClient } from './client-Dn6mL7BZ.js';
|
|
3
|
+
import { C as CloseOnStatus, h as SignerType } from './types-Dzm5lZK-.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* EIP-1193 JSON-RPC provider factory for the 1auth passkey authentication system.
|
|
@@ -30,6 +31,24 @@ type OneAuthProvider = {
|
|
|
30
31
|
on: (event: string, listener: Listener) => void;
|
|
31
32
|
removeListener: (event: string, listener: Listener) => void;
|
|
32
33
|
disconnect: () => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Bind the active session in-memory and persist it to `localStorage`.
|
|
36
|
+
*
|
|
37
|
+
* Used by {@link createOneAuthConnection} to hand a freshly connected session
|
|
38
|
+
* to the provider the instant `connect()` resolves — before the app has
|
|
39
|
+
* written `1auth-user` itself. This closes a race where a provider built right
|
|
40
|
+
* after connect would read stale/empty storage and default an EOA session to
|
|
41
|
+
* passkey intents. Passing `null` clears the session (same effect as
|
|
42
|
+
* `disconnect()` minus the events).
|
|
43
|
+
*
|
|
44
|
+
* Existing `createOneAuthProvider` consumers never call this, so their
|
|
45
|
+
* behavior is unchanged: `getStoredUser` falls back to the localStorage read.
|
|
46
|
+
*/
|
|
47
|
+
setSession: (session: {
|
|
48
|
+
address: Address;
|
|
49
|
+
signerType?: SignerType;
|
|
50
|
+
connectorId?: string;
|
|
51
|
+
} | null) => void;
|
|
33
52
|
};
|
|
34
53
|
type OneAuthProviderOptions = {
|
|
35
54
|
client: OneAuthClient;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { O as OneAuthClient } from './client-C8QSA1th.mjs';
|
|
3
|
+
import { C as CloseOnStatus, h as SignerType } from './types-Dzm5lZK-.mjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* EIP-1193 JSON-RPC provider factory for the 1auth passkey authentication system.
|
|
@@ -30,6 +31,24 @@ type OneAuthProvider = {
|
|
|
30
31
|
on: (event: string, listener: Listener) => void;
|
|
31
32
|
removeListener: (event: string, listener: Listener) => void;
|
|
32
33
|
disconnect: () => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Bind the active session in-memory and persist it to `localStorage`.
|
|
36
|
+
*
|
|
37
|
+
* Used by {@link createOneAuthConnection} to hand a freshly connected session
|
|
38
|
+
* to the provider the instant `connect()` resolves — before the app has
|
|
39
|
+
* written `1auth-user` itself. This closes a race where a provider built right
|
|
40
|
+
* after connect would read stale/empty storage and default an EOA session to
|
|
41
|
+
* passkey intents. Passing `null` clears the session (same effect as
|
|
42
|
+
* `disconnect()` minus the events).
|
|
43
|
+
*
|
|
44
|
+
* Existing `createOneAuthProvider` consumers never call this, so their
|
|
45
|
+
* behavior is unchanged: `getStoredUser` falls back to the localStorage read.
|
|
46
|
+
*/
|
|
47
|
+
setSession: (session: {
|
|
48
|
+
address: Address;
|
|
49
|
+
signerType?: SignerType;
|
|
50
|
+
connectorId?: string;
|
|
51
|
+
} | null) => void;
|
|
33
52
|
};
|
|
34
53
|
type OneAuthProviderOptions = {
|
|
35
54
|
client: OneAuthClient;
|
package/dist/react.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { O as OneAuthClient } from './client-
|
|
4
|
-
import {
|
|
3
|
+
import { O as OneAuthClient } from './client-C8QSA1th.mjs';
|
|
4
|
+
import { _ as SendIntentOptions, j as SendIntentResult, C as CloseOnStatus, aw as SponsorshipUrlConfig, av as SponsorshipCallbackConfig } from './types-Dzm5lZK-.mjs';
|
|
5
5
|
import 'viem';
|
|
6
6
|
import '@rhinestone/sdk';
|
|
7
7
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { O as OneAuthClient } from './client-
|
|
4
|
-
import {
|
|
3
|
+
import { O as OneAuthClient } from './client-Dn6mL7BZ.js';
|
|
4
|
+
import { _ as SendIntentOptions, j as SendIntentResult, C as CloseOnStatus, aw as SponsorshipUrlConfig, av as SponsorshipCallbackConfig } from './types-Dzm5lZK-.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
import '@rhinestone/sdk';
|
|
7
7
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address, Hex } from 'viem';
|
|
2
|
-
export { e as encodeWebAuthnSignature, q as hashMessage, k as isTestnet, v as verifyMessageHash } from './verify-
|
|
3
|
-
export { W as WebAuthnSignature } from './types-
|
|
2
|
+
export { e as encodeWebAuthnSignature, q as hashMessage, k as isTestnet, v as verifyMessageHash } from './verify-0VXQpQBJ.mjs';
|
|
3
|
+
export { W as WebAuthnSignature } from './types-Dzm5lZK-.mjs';
|
|
4
4
|
import '@rhinestone/sdk';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address, Hex } from 'viem';
|
|
2
|
-
export { e as encodeWebAuthnSignature, q as hashMessage, k as isTestnet, v as verifyMessageHash } from './verify-
|
|
3
|
-
export { W as WebAuthnSignature } from './types-
|
|
2
|
+
export { e as encodeWebAuthnSignature, q as hashMessage, k as isTestnet, v as verifyMessageHash } from './verify-9UgxLSdo.js';
|
|
3
|
+
export { W as WebAuthnSignature } from './types-Dzm5lZK-.js';
|
|
4
4
|
import '@rhinestone/sdk';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -257,6 +257,15 @@ interface AuthWithModalOptions {
|
|
|
257
257
|
oauthEnabled?: boolean;
|
|
258
258
|
/** Force a specific auth entry route instead of the default auto-router. */
|
|
259
259
|
flow?: AuthFlow;
|
|
260
|
+
/**
|
|
261
|
+
* Opt the dialog into "wallet as signer" mode: when the user picks a
|
|
262
|
+
* traditional wallet, connect that EOA as the account signer (a `signerType:
|
|
263
|
+
* "eoa"` session whose transactions bypass Rhinestone intents) instead of
|
|
264
|
+
* using the wallet only to prove identity for a passkey signup. Passkey
|
|
265
|
+
* selection is unaffected. Set by {@link createOneAuthConnection}; the default
|
|
266
|
+
* (`false`/absent) preserves the existing wallet-assisted passkey signup.
|
|
267
|
+
*/
|
|
268
|
+
eoaConnect?: boolean;
|
|
260
269
|
}
|
|
261
270
|
/**
|
|
262
271
|
* Options for {@link OneAuthClient.loginWithModal}.
|
|
@@ -1458,4 +1467,4 @@ interface HeadlessIntentStatusResult {
|
|
|
1458
1467
|
transactionHash?: string;
|
|
1459
1468
|
}
|
|
1460
1469
|
|
|
1461
|
-
export { type
|
|
1470
|
+
export { type IntentQuote as $, type AuthResult as A, type AuthenticateOptions as B, type CloseOnStatus as C, type AuthenticateResult as D, type EmbedOptions as E, type SigningResultBase as F, type SignMessageOptions as G, type HeadlessIntentOptions as H, type InstallSmartSessionOptions as I, type SignMessageResult as J, type SignTypedDataOptions as K, type LoginWithModalOptions as L, type SignTypedDataResult as M, type EIP712Domain as N, type EIP712Types as O, type PasskeyProviderConfig as P, type EIP712TypeField as Q, type TransactionAction as R, type SponsorshipConfig as S, type ThemeConfig as T, type UserPasskeysResponse as U, type TransactionFees as V, type WebAuthnSignature as W, type BalanceRequirement as X, type TransactionDetails as Y, type IntentTokenRequest as Z, type SendIntentOptions as _, type HeadlessPrepareResult as a, type IntentStatus as a0, type OrchestratorStatus as a1, type PrepareIntentResponse as a2, type ExecuteIntentResponse as a3, type IntentHistoryOptions as a4, type IntentHistoryItem as a5, type IntentHistoryResult as a6, type GetAssetsOptions as a7, type AssetBalance as a8, type AssetBalanceBucket as a9, type OneAuthTelemetryEvent as aA, type OneAuthTelemetryEventName as aB, type OneAuthTelemetryFlow as aC, type OneAuthTelemetryTraceContext as aD, type AssetsResponse as aa, type ConsentField as ab, type ConsentData as ac, type CheckConsentOptions as ad, type CheckConsentResult as ae, type RequestConsentOptions as af, type RequestConsentResult as ag, type GrantPermissionsOptions as ah, type GrantPermissionsResult as ai, type ListSessionGrantsOptions as aj, type ListSessionGrantsResult as ak, type SessionGrantRecord as al, type SessionGrantChain as am, type GrantPermissionContractMetadata as an, type SmartSessionPolicy as ao, type BatchIntentItem as ap, type SendBatchIntentOptions as aq, type SendBatchIntentResult as ar, type BatchIntentItemResult as as, type PreparedBatchIntent as at, type PrepareBatchIntentResponse as au, type SponsorshipCallbackConfig as av, type SponsorshipUrlConfig as aw, type OneAuthTelemetryAttributeValue as ax, type OneAuthTelemetryAttributes as ay, type OneAuthTelemetryConfig as az, type HeadlessSubmitOptions as b, type HeadlessSubmitResult as c, type HeadlessIntentStatusResult as d, type InstallSmartSessionResult as e, type SessionKeyHandle as f, type SmartSessionEnableRequest as g, type SignerType as h, type IntentCall as i, type SendIntentResult as j, createCrossChainPermission as k, type CreateCrossChainPermissionInput as l, type CrossChainPermit as m, type CrossChainSettlementLayer as n, type SigningRequestOptions as o, type SigningResult as p, type SigningSuccess as q, type SigningError as r, type SigningErrorCode as s, type CreateSigningRequestResponse as t, type SigningRequestStatus as u, type PasskeyCredential as v, type AuthFlow as w, type AuthWithModalOptions as x, type CreateAccountWithModalOptions as y, type ConnectResult as z };
|
|
@@ -257,6 +257,15 @@ interface AuthWithModalOptions {
|
|
|
257
257
|
oauthEnabled?: boolean;
|
|
258
258
|
/** Force a specific auth entry route instead of the default auto-router. */
|
|
259
259
|
flow?: AuthFlow;
|
|
260
|
+
/**
|
|
261
|
+
* Opt the dialog into "wallet as signer" mode: when the user picks a
|
|
262
|
+
* traditional wallet, connect that EOA as the account signer (a `signerType:
|
|
263
|
+
* "eoa"` session whose transactions bypass Rhinestone intents) instead of
|
|
264
|
+
* using the wallet only to prove identity for a passkey signup. Passkey
|
|
265
|
+
* selection is unaffected. Set by {@link createOneAuthConnection}; the default
|
|
266
|
+
* (`false`/absent) preserves the existing wallet-assisted passkey signup.
|
|
267
|
+
*/
|
|
268
|
+
eoaConnect?: boolean;
|
|
260
269
|
}
|
|
261
270
|
/**
|
|
262
271
|
* Options for {@link OneAuthClient.loginWithModal}.
|
|
@@ -1458,4 +1467,4 @@ interface HeadlessIntentStatusResult {
|
|
|
1458
1467
|
transactionHash?: string;
|
|
1459
1468
|
}
|
|
1460
1469
|
|
|
1461
|
-
export { type
|
|
1470
|
+
export { type IntentQuote as $, type AuthResult as A, type AuthenticateOptions as B, type CloseOnStatus as C, type AuthenticateResult as D, type EmbedOptions as E, type SigningResultBase as F, type SignMessageOptions as G, type HeadlessIntentOptions as H, type InstallSmartSessionOptions as I, type SignMessageResult as J, type SignTypedDataOptions as K, type LoginWithModalOptions as L, type SignTypedDataResult as M, type EIP712Domain as N, type EIP712Types as O, type PasskeyProviderConfig as P, type EIP712TypeField as Q, type TransactionAction as R, type SponsorshipConfig as S, type ThemeConfig as T, type UserPasskeysResponse as U, type TransactionFees as V, type WebAuthnSignature as W, type BalanceRequirement as X, type TransactionDetails as Y, type IntentTokenRequest as Z, type SendIntentOptions as _, type HeadlessPrepareResult as a, type IntentStatus as a0, type OrchestratorStatus as a1, type PrepareIntentResponse as a2, type ExecuteIntentResponse as a3, type IntentHistoryOptions as a4, type IntentHistoryItem as a5, type IntentHistoryResult as a6, type GetAssetsOptions as a7, type AssetBalance as a8, type AssetBalanceBucket as a9, type OneAuthTelemetryEvent as aA, type OneAuthTelemetryEventName as aB, type OneAuthTelemetryFlow as aC, type OneAuthTelemetryTraceContext as aD, type AssetsResponse as aa, type ConsentField as ab, type ConsentData as ac, type CheckConsentOptions as ad, type CheckConsentResult as ae, type RequestConsentOptions as af, type RequestConsentResult as ag, type GrantPermissionsOptions as ah, type GrantPermissionsResult as ai, type ListSessionGrantsOptions as aj, type ListSessionGrantsResult as ak, type SessionGrantRecord as al, type SessionGrantChain as am, type GrantPermissionContractMetadata as an, type SmartSessionPolicy as ao, type BatchIntentItem as ap, type SendBatchIntentOptions as aq, type SendBatchIntentResult as ar, type BatchIntentItemResult as as, type PreparedBatchIntent as at, type PrepareBatchIntentResponse as au, type SponsorshipCallbackConfig as av, type SponsorshipUrlConfig as aw, type OneAuthTelemetryAttributeValue as ax, type OneAuthTelemetryAttributes as ay, type OneAuthTelemetryConfig as az, type HeadlessSubmitOptions as b, type HeadlessSubmitResult as c, type HeadlessIntentStatusResult as d, type InstallSmartSessionResult as e, type SessionKeyHandle as f, type SmartSessionEnableRequest as g, type SignerType as h, type IntentCall as i, type SendIntentResult as j, createCrossChainPermission as k, type CreateCrossChainPermissionInput as l, type CrossChainPermit as m, type CrossChainSettlementLayer as n, type SigningRequestOptions as o, type SigningResult as p, type SigningSuccess as q, type SigningError as r, type SigningErrorCode as s, type CreateSigningRequestResponse as t, type SigningRequestStatus as u, type PasskeyCredential as v, type AuthFlow as w, type AuthWithModalOptions as x, type CreateAccountWithModalOptions as y, type ConnectResult as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Chain, Transport, Hex } from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-Dzm5lZK-.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Configuration for creating a passkey-enabled WalletClient
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Chain, Transport, Hex } from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-Dzm5lZK-.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Configuration for creating a passkey-enabled WalletClient
|
package/dist/wagmi.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _wagmi_core from '@wagmi/core';
|
|
2
|
-
import { O as OneAuthProvider } from './provider-
|
|
3
|
-
import { O as OneAuthClient } from './client-
|
|
4
|
-
import './types-CbhPRY5s.mjs';
|
|
2
|
+
import { O as OneAuthProvider } from './provider-CJv38fIK.mjs';
|
|
3
|
+
import { O as OneAuthClient } from './client-C8QSA1th.mjs';
|
|
5
4
|
import 'viem';
|
|
5
|
+
import './types-Dzm5lZK-.mjs';
|
|
6
6
|
import '@rhinestone/sdk';
|
|
7
7
|
|
|
8
8
|
type OneAuthConnectorOptions = {
|
package/dist/wagmi.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _wagmi_core from '@wagmi/core';
|
|
2
|
-
import { O as OneAuthProvider } from './provider-
|
|
3
|
-
import { O as OneAuthClient } from './client-
|
|
4
|
-
import './types-CbhPRY5s.js';
|
|
2
|
+
import { O as OneAuthProvider } from './provider-BsVmPgkQ.js';
|
|
3
|
+
import { O as OneAuthClient } from './client-Dn6mL7BZ.js';
|
|
5
4
|
import 'viem';
|
|
5
|
+
import './types-Dzm5lZK-.js';
|
|
6
6
|
import '@rhinestone/sdk';
|
|
7
7
|
|
|
8
8
|
type OneAuthConnectorOptions = {
|
package/dist/wagmi.js
CHANGED
|
@@ -143,12 +143,14 @@ function createOneAuthProvider(options) {
|
|
|
143
143
|
let chainId = options.chainId;
|
|
144
144
|
const storageKey = options.storageKey || DEFAULT_STORAGE_KEY;
|
|
145
145
|
const listeners = /* @__PURE__ */ new Map();
|
|
146
|
+
let sessionOverride;
|
|
146
147
|
const emit = (event, ...args) => {
|
|
147
148
|
const set = listeners.get(event);
|
|
148
149
|
if (!set) return;
|
|
149
150
|
for (const listener of set) listener(...args);
|
|
150
151
|
};
|
|
151
152
|
const getStoredUser = () => {
|
|
153
|
+
if (sessionOverride !== void 0) return sessionOverride;
|
|
152
154
|
if (typeof window === "undefined") return null;
|
|
153
155
|
try {
|
|
154
156
|
const raw = localStorage.getItem(storageKey);
|
|
@@ -188,10 +190,28 @@ function createOneAuthProvider(options) {
|
|
|
188
190
|
return [address];
|
|
189
191
|
};
|
|
190
192
|
const disconnect = async () => {
|
|
193
|
+
sessionOverride = void 0;
|
|
191
194
|
clearStoredUser();
|
|
192
195
|
emit("accountsChanged", []);
|
|
193
196
|
emit("disconnect");
|
|
194
197
|
};
|
|
198
|
+
const setSession = (session) => {
|
|
199
|
+
if (!session) {
|
|
200
|
+
sessionOverride = void 0;
|
|
201
|
+
clearStoredUser();
|
|
202
|
+
emit("accountsChanged", []);
|
|
203
|
+
emit("disconnect");
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
sessionOverride = {
|
|
207
|
+
address: session.address,
|
|
208
|
+
signerType: session.signerType,
|
|
209
|
+
connectorId: session.connectorId
|
|
210
|
+
};
|
|
211
|
+
setStoredUser(sessionOverride);
|
|
212
|
+
emit("accountsChanged", [session.address]);
|
|
213
|
+
emit("connect", { chainId: (0, import_viem3.numberToHex)(chainId) });
|
|
214
|
+
};
|
|
195
215
|
const ensureUser = async () => {
|
|
196
216
|
const stored = getStoredUser();
|
|
197
217
|
if (stored) return stored;
|
|
@@ -401,10 +421,49 @@ function createOneAuthProvider(options) {
|
|
|
401
421
|
}
|
|
402
422
|
return list;
|
|
403
423
|
};
|
|
424
|
+
const eoaBatches = /* @__PURE__ */ new Map();
|
|
425
|
+
const sendCallsEoa = async (params, address) => {
|
|
426
|
+
const validated = injectEoaSigner("wallet_sendCalls", params, address);
|
|
427
|
+
const payload = Array.isArray(validated) ? validated[0] : {};
|
|
428
|
+
const calls = Array.isArray(payload.calls) ? payload.calls : [];
|
|
429
|
+
if (!calls.length) throw new Error("No calls provided");
|
|
430
|
+
const batchChainId = payload.chainId;
|
|
431
|
+
const hashes = [];
|
|
432
|
+
for (const raw of calls) {
|
|
433
|
+
const call = raw || {};
|
|
434
|
+
const tx = { from: address, to: call.to };
|
|
435
|
+
if (call.data !== void 0) tx.data = call.data;
|
|
436
|
+
if (call.value !== void 0) tx.value = call.value;
|
|
437
|
+
const callChain = call.chainId ?? batchChainId;
|
|
438
|
+
if (callChain !== void 0) tx.chainId = callChain;
|
|
439
|
+
const hash = await forwardToWallet("eth_sendTransaction", [tx], address);
|
|
440
|
+
hashes.push(String(hash));
|
|
441
|
+
}
|
|
442
|
+
const id = hashes[hashes.length - 1];
|
|
443
|
+
eoaBatches.set(id, hashes);
|
|
444
|
+
return id;
|
|
445
|
+
};
|
|
446
|
+
const getCallsStatusEoa = (callsId) => {
|
|
447
|
+
if (!callsId || typeof callsId !== "string") {
|
|
448
|
+
throw new Error("callsId is required");
|
|
449
|
+
}
|
|
450
|
+
const hashes = eoaBatches.get(callsId) ?? [callsId];
|
|
451
|
+
return {
|
|
452
|
+
status: "CONFIRMED",
|
|
453
|
+
receipts: hashes.map((transactionHash) => ({ transactionHash }))
|
|
454
|
+
};
|
|
455
|
+
};
|
|
404
456
|
const request = async ({ method, params }) => {
|
|
405
457
|
if (EOA_FORWARDED_METHODS.has(method)) {
|
|
406
458
|
const user = await ensureUser();
|
|
407
459
|
if (user.signerType === "eoa") {
|
|
460
|
+
if (method === "wallet_sendCalls") {
|
|
461
|
+
return sendCallsEoa(params, user.address);
|
|
462
|
+
}
|
|
463
|
+
if (method === "wallet_getCallsStatus") {
|
|
464
|
+
const list = Array.isArray(params) ? params : [];
|
|
465
|
+
return getCallsStatusEoa(list[0]);
|
|
466
|
+
}
|
|
408
467
|
return forwardToWallet(
|
|
409
468
|
method,
|
|
410
469
|
injectEoaSigner(method, params, user.address),
|
|
@@ -621,7 +680,8 @@ function createOneAuthProvider(options) {
|
|
|
621
680
|
set.delete(listener);
|
|
622
681
|
if (set.size === 0) listeners.delete(event);
|
|
623
682
|
},
|
|
624
|
-
disconnect
|
|
683
|
+
disconnect,
|
|
684
|
+
setSession
|
|
625
685
|
};
|
|
626
686
|
}
|
|
627
687
|
|