@bounded-sh/client 0.0.25 → 0.0.27
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/REACT_NATIVE.md +144 -0
- package/README.md +24 -18
- package/dist/auth/index.d.ts +18 -21
- package/dist/auth/oidc-auth.d.ts +7 -0
- package/dist/auth/providers/email-auth-provider.d.ts +8 -19
- package/dist/auth/providers/privy-expo-provider.d.ts +1 -1
- package/dist/global.d.ts +2 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +88 -4617
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -4621
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.ts +2 -2
- package/dist/index.native.js +5184 -78
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +5095 -4
- package/dist/index.native.mjs.map +1 -1
- package/dist/platform.d.ts +1 -1
- package/package.json +8 -4
- package/dist/index.native-CcpKp_mg.mjs +0 -5738
- package/dist/index.native-CcpKp_mg.mjs.map +0 -1
- package/dist/index.native-DIw0cB5C.js +0 -5798
- package/dist/index.native-DIw0cB5C.js.map +0 -1
- package/dist/phantom-wallet-provider-Cagl3roP.js +0 -1452
- package/dist/phantom-wallet-provider-Cagl3roP.js.map +0 -1
- package/dist/phantom-wallet-provider-CyMav6HM.mjs +0 -1431
- package/dist/phantom-wallet-provider-CyMav6HM.mjs.map +0 -1
- package/dist/privy-wallet-provider-Cb1GUmOi.js +0 -949
- package/dist/privy-wallet-provider-Cb1GUmOi.js.map +0 -1
- package/dist/privy-wallet-provider-YR9Eisgl.mjs +0 -926
- package/dist/privy-wallet-provider-YR9Eisgl.mjs.map +0 -1
- package/dist/solana-mobile-wallet-provider-BEpjk4Sz.js +0 -1492
- package/dist/solana-mobile-wallet-provider-BEpjk4Sz.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-DOSBGM8C.mjs +0 -1471
- package/dist/solana-mobile-wallet-provider-DOSBGM8C.mjs.map +0 -1
package/REACT_NATIVE.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# React Native / Expo support - `@bounded-sh/client`
|
|
2
|
+
|
|
3
|
+
The SDK ships a dedicated React Native entry (`react-native` condition ->
|
|
4
|
+
`dist/index.native.js`) and a platform-abstraction layer so the same
|
|
5
|
+
`@bounded-sh/client` package runs on web and React Native.
|
|
6
|
+
|
|
7
|
+
## 1. One-time setup before `init()`
|
|
8
|
+
|
|
9
|
+
React Native has no `localStorage`, no `document`, and no reliable browser
|
|
10
|
+
base64 helpers, so configure the SDK platform once at app startup:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import "react-native-get-random-values";
|
|
14
|
+
import "react-native-url-polyfill/auto";
|
|
15
|
+
import { setPlatform, ReactNativeSessionManager } from "@bounded-sh/client";
|
|
16
|
+
import { createMMKV } from "react-native-mmkv";
|
|
17
|
+
import { decode as atob, encode as btoa } from "base-64";
|
|
18
|
+
|
|
19
|
+
const store = createMMKV();
|
|
20
|
+
const storage = {
|
|
21
|
+
getItem: (key: string) => store.getString(key) ?? null,
|
|
22
|
+
setItem: (key: string, value: string) => store.set(key, value),
|
|
23
|
+
removeItem: (key: string) => store.remove(key),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
setPlatform({ storage, sessionStorage: storage, atob, btoa, hasDOM: false });
|
|
27
|
+
ReactNativeSessionManager.configure({ storage, atob });
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`setPlatform` fills general browser API gaps. `ReactNativeSessionManager.configure`
|
|
31
|
+
selects the RN token store used by login, restore, logout, and authenticated
|
|
32
|
+
requests.
|
|
33
|
+
|
|
34
|
+
## 2. Hosted email / social login
|
|
35
|
+
|
|
36
|
+
Human login runs through the hosted Bounded issuer. The retired app-origin OTP
|
|
37
|
+
helpers (`sendEmailOtp`, `verifyEmailOtp`, `sendTextOtp`, `verifyTextOtp`) throw
|
|
38
|
+
migration errors.
|
|
39
|
+
|
|
40
|
+
Install the Expo optional peers if your RN app uses hosted login:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npx expo install expo-web-browser expo-crypto
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use an https universal link as your redirect URI and register that origin in the
|
|
47
|
+
Bounded app's `allowedOrigins`:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { init, loginWithRedirect, getCurrentUser } from "@bounded-sh/client";
|
|
51
|
+
|
|
52
|
+
await init({ appId: "YOUR_APP_ID" });
|
|
53
|
+
|
|
54
|
+
const user = await loginWithRedirect({
|
|
55
|
+
redirectUri: "https://yourapp.com/auth/callback",
|
|
56
|
+
methods: ["email"],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const restored = await getCurrentUser();
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
On native, `loginWithRedirect()` opens the system/in-app browser and resolves
|
|
63
|
+
with the user when the callback returns to the app. `completeLoginFromRedirect()`
|
|
64
|
+
is for web callback pages.
|
|
65
|
+
|
|
66
|
+
## 3. Guest login
|
|
67
|
+
|
|
68
|
+
Anonymous auth is fully native and does not require Expo browser packages:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { init, signInAnonymously, getCurrentUser } from "@bounded-sh/client";
|
|
72
|
+
|
|
73
|
+
await init({ appId: "YOUR_APP_ID" });
|
|
74
|
+
await signInAnonymously();
|
|
75
|
+
const user = await getCurrentUser();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The device-local ed25519 keypair is stored in the RN storage adapter, so the
|
|
79
|
+
guest identity survives app restarts until `logout()` clears it.
|
|
80
|
+
|
|
81
|
+
## 4. Privy on React Native (`privy-expo`)
|
|
82
|
+
|
|
83
|
+
`@privy-io/expo` is hook-based, so the host app renders `<PrivyProvider>` and
|
|
84
|
+
bridges the hooks into a `PrivyExpoProvider` instance.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm i @privy-io/expo @privy-io/expo-native-extensions
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { PrivyProvider, usePrivy, useEmbeddedSolanaWallet, useIdentityToken } from "@privy-io/expo";
|
|
92
|
+
import { PrivyExpoProvider, init, loginWithPrivy } from "@bounded-sh/client";
|
|
93
|
+
|
|
94
|
+
const provider = new PrivyExpoProvider(PRIVY_APP_ID, SOLANA_RPC_URL);
|
|
95
|
+
|
|
96
|
+
function PrivyBridge() {
|
|
97
|
+
const privy = usePrivy();
|
|
98
|
+
const wallet = useEmbeddedSolanaWallet();
|
|
99
|
+
const { getIdentityToken } = useIdentityToken();
|
|
100
|
+
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
provider.setPrivyMethods({
|
|
103
|
+
isReady: privy.isReady,
|
|
104
|
+
isAuthenticated: !!privy.user,
|
|
105
|
+
user: privy.user,
|
|
106
|
+
login: privy.login,
|
|
107
|
+
logout: privy.logout,
|
|
108
|
+
getAccessToken: privy.getAccessToken,
|
|
109
|
+
getIdentityToken,
|
|
110
|
+
getWalletProvider: async () => {
|
|
111
|
+
const solanaWallet = wallet.wallets?.[0];
|
|
112
|
+
if (!solanaWallet) return null;
|
|
113
|
+
const solanaProvider = await solanaWallet.getProvider();
|
|
114
|
+
return {
|
|
115
|
+
address: solanaWallet.address,
|
|
116
|
+
signMessage: solanaProvider.signMessage,
|
|
117
|
+
signTransaction: solanaProvider.signTransaction,
|
|
118
|
+
signAndSendTransaction: solanaProvider.signAndSendTransaction,
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}, [privy.isReady, privy.user, wallet.wallets]);
|
|
123
|
+
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
await init({
|
|
128
|
+
appId,
|
|
129
|
+
authMethod: "privy-expo",
|
|
130
|
+
privyExpoProvider: provider,
|
|
131
|
+
rpcUrl: SOLANA_RPC_URL,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
await loginWithPrivy();
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 5. Metro notes
|
|
138
|
+
|
|
139
|
+
The default client entry no longer imports Phantom, web Privy, mobile wallet
|
|
140
|
+
adapter, or `react-dom` provider implementations. Apps that only use hosted login
|
|
141
|
+
or guest login should not need Metro stubs for those optional peers.
|
|
142
|
+
|
|
143
|
+
For Solana signing paths, keep `react-native-get-random-values` at app entry and
|
|
144
|
+
make sure `buffer` is polyfilled if your bundler setup does not provide it.
|
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
#
|
|
3
|
-
|
|
2
|
+
# Bounded JS SDK
|
|
3
|
+
Bounded is a provable realtime backend for web and React Native applications.
|
|
4
4
|
|
|
5
|
-
Welcome to the **
|
|
5
|
+
Welcome to the **Bounded JavaScript SDK**. This SDK lets JavaScript and
|
|
6
|
+
TypeScript applications authenticate users, read and write policy-governed data,
|
|
7
|
+
subscribe to realtime updates, and call Bounded services.
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
## Table of Contents
|
|
@@ -66,28 +68,26 @@ yarn add @bounded-sh/client
|
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
|
|
69
|
-
Before using the SDK, initialize it with your **Application ID
|
|
71
|
+
Before using the SDK, initialize it with your **Application ID**. Hosted Bounded
|
|
72
|
+
Auth email login is the default human-login provider.
|
|
70
73
|
|
|
71
74
|
|
|
72
75
|
```typescript
|
|
73
76
|
import { init } from '@bounded-sh/client';
|
|
74
77
|
|
|
75
|
-
await init({ appId: 'YOUR_APP_ID'
|
|
78
|
+
await init({ appId: 'YOUR_APP_ID' });
|
|
76
79
|
```
|
|
77
80
|
|
|
78
81
|
### Authentication
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
helpers
|
|
83
|
+
Human login runs through the hosted redirect or popup helpers, which bind the
|
|
84
|
+
returned token to the app id and registered redirect URI. Inline app-origin OTP
|
|
85
|
+
helpers are retired.
|
|
83
86
|
|
|
84
87
|
```typescript
|
|
85
|
-
import {
|
|
88
|
+
import { loginWithRedirect, completeLoginFromRedirect } from '@bounded-sh/client';
|
|
86
89
|
|
|
87
|
-
//
|
|
88
|
-
await login();
|
|
89
|
-
|
|
90
|
-
// Hosted OAuth/social or hosted chooser:
|
|
90
|
+
// Start hosted login:
|
|
91
91
|
await loginWithRedirect({ redirectUri: 'https://yourapp.com/auth/callback', methods: ['email'] });
|
|
92
92
|
|
|
93
93
|
// On your callback page, on load:
|
|
@@ -99,13 +99,16 @@ You can also listen for authentication state changes:
|
|
|
99
99
|
```typescript
|
|
100
100
|
import { onAuthStateChanged } from '@bounded-sh/client';
|
|
101
101
|
|
|
102
|
-
onAuthStateChanged((user) => {
|
|
102
|
+
const unsubscribe = onAuthStateChanged((user) => {
|
|
103
103
|
if (user) {
|
|
104
104
|
console.log('User logged in:', user.address);
|
|
105
105
|
} else {
|
|
106
106
|
console.log('User logged out');
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
+
|
|
110
|
+
// Later:
|
|
111
|
+
unsubscribe();
|
|
109
112
|
```
|
|
110
113
|
|
|
111
114
|
|
|
@@ -291,16 +294,19 @@ For more comprehensive examples, detailed guides, and API references, please vis
|
|
|
291
294
|
- [API Reference](https://docs.tarobase.com/api)
|
|
292
295
|
|
|
293
296
|
|
|
294
|
-
### React Native Support
|
|
295
|
-
|
|
297
|
+
### React Native Support
|
|
298
|
+
React Native and Expo are supported through the same `@bounded-sh/client`
|
|
299
|
+
package. See [REACT_NATIVE.md](./REACT_NATIVE.md) for platform setup, hosted
|
|
300
|
+
login, and guest login examples.
|
|
296
301
|
|
|
297
302
|
### Contributing
|
|
298
303
|
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
|
|
299
304
|
|
|
300
305
|
### License
|
|
301
|
-
This
|
|
306
|
+
This Bounded JS SDK project is licensed under the MIT License.
|
|
302
307
|
|
|
303
308
|
* * * * *
|
|
304
309
|
|
|
305
310
|
|
|
306
|
-
Thank you for using the
|
|
311
|
+
Thank you for using the Bounded JS SDK. If you have questions or need help,
|
|
312
|
+
please create an issue.
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -31,11 +31,11 @@ export declare function signInAnonymously(): Promise<User | null>;
|
|
|
31
31
|
* Log in with Privy as a co-equal route — selectable at runtime alongside
|
|
32
32
|
* `login()` (email/wallet) and `signInAnonymously()`, without re-`init()`.
|
|
33
33
|
*
|
|
34
|
-
* On
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* On REACT NATIVE the host must have created a PrivyExpoProvider and bridged the
|
|
35
|
+
* Privy hooks via setPrivyMethods() (pass it as `config.privyExpoProvider` to
|
|
36
|
+
* init()) — RN can't construct it here because the Privy hooks live in the app's
|
|
37
|
+
* component tree. Web Privy is no longer loaded through the default client entry;
|
|
38
|
+
* opt into a dedicated provider entry when your app needs it.
|
|
39
39
|
*
|
|
40
40
|
* Either way the Privy Solana wallet signs the SIWS challenge, so the session is
|
|
41
41
|
* minted via the same wallet path as Phantom and shares the unified session store
|
|
@@ -43,40 +43,37 @@ export declare function signInAnonymously(): Promise<User | null>;
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function loginWithPrivy(options?: LoginOptions): Promise<User | null>;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* @deprecated Inline app-origin OTP is retired. Use
|
|
47
|
+
* `loginWithRedirect({ redirectUri, methods: ["email"] })` so the credential is
|
|
48
|
+
* entered on the Bounded hosted issuer.
|
|
49
49
|
*/
|
|
50
50
|
export declare function sendEmailOtp(email: string): Promise<{
|
|
51
51
|
ok: true;
|
|
52
52
|
expiresInSeconds?: number;
|
|
53
53
|
}>;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* Works on web AND React Native.
|
|
55
|
+
* @deprecated Inline app-origin text OTP is retired. Use hosted login with
|
|
56
|
+
* `provider: "text"` or `methods: ["text"]` when text OTP is enabled.
|
|
58
57
|
*/
|
|
59
58
|
export declare function sendTextOtp(phoneNumber: string): Promise<{
|
|
60
59
|
ok: true;
|
|
61
60
|
expiresInSeconds?: number;
|
|
62
61
|
}>;
|
|
63
62
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* @deprecated Inline app-origin OTP is retired. Finish hosted login with
|
|
64
|
+
* `completeLoginFromRedirect()` on web; React Native `loginWithRedirect()`
|
|
65
|
+
* resolves inline.
|
|
66
66
|
*/
|
|
67
67
|
export declare function verifyEmailOtp(email: string, code: string): Promise<User | null>;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
69
|
+
* @deprecated Inline app-origin text OTP is retired. Finish hosted login with
|
|
70
|
+
* `completeLoginFromRedirect()` on web; React Native `loginWithRedirect()`
|
|
71
|
+
* resolves inline.
|
|
71
72
|
*/
|
|
72
73
|
export declare function verifyTextOtp(phoneNumber: string, code: string): Promise<User | null>;
|
|
73
74
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* then call `linkEmail(email, code)`. If the email is brand-new the guest's
|
|
77
|
-
* `@user.id` (and its data) is preserved; if the email already exists the user
|
|
78
|
-
* just signs into it (no merge). After it resolves, `getCurrentUser().isAnonymous`
|
|
79
|
-
* is `false`. Requires an active guest session (`signInAnonymously()` first).
|
|
75
|
+
* @deprecated Inline app-origin guest upgrade is retired. Send the user through
|
|
76
|
+
* hosted login and transfer guest-owned data explicitly.
|
|
80
77
|
*/
|
|
81
78
|
export declare function linkEmail(email: string, code: string): Promise<User | null>;
|
|
82
79
|
export declare function login(options?: LoginOptions): Promise<User | null>;
|
package/dist/auth/oidc-auth.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export interface OidcLoginOptions {
|
|
|
16
16
|
* when the issuer explicitly enables text OTP.
|
|
17
17
|
*/
|
|
18
18
|
provider?: HostedAuthMethod;
|
|
19
|
+
/**
|
|
20
|
+
* Standard OIDC `prompt`. Pass `'login'` to FORCE a fresh sign-in even if the
|
|
21
|
+
* issuer already has a session — so the user can choose a DIFFERENT account
|
|
22
|
+
* (e.g. retry with another email after an access denial) instead of being
|
|
23
|
+
* silently re-signed-in as the same one. `'select_account'` behaves the same.
|
|
24
|
+
*/
|
|
25
|
+
prompt?: 'login' | 'select_account' | 'consent' | 'none' | (string & {});
|
|
19
26
|
}
|
|
20
27
|
export interface PopupLoginOptions extends OidcLoginOptions {
|
|
21
28
|
width?: number;
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
import type { AuthProvider, User, TransactionResult, SolTransaction, EVMTransaction, SetOptions } from '@bounded-sh/core';
|
|
2
|
-
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
|
-
/**
|
|
2
|
+
import type { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
|
+
/** @deprecated Inline app-origin OTP is retired. Use loginWithRedirect(). */
|
|
4
4
|
export declare function sendEmailOtp(email: string): Promise<{
|
|
5
5
|
ok: true;
|
|
6
6
|
expiresInSeconds?: number;
|
|
7
7
|
}>;
|
|
8
|
-
/**
|
|
8
|
+
/** @deprecated Inline app-origin text OTP is retired. Use loginWithRedirect(). */
|
|
9
9
|
export declare function sendTextOtp(phoneNumber: string): Promise<{
|
|
10
10
|
ok: true;
|
|
11
11
|
expiresInSeconds?: number;
|
|
12
12
|
}>;
|
|
13
|
-
/**
|
|
14
|
-
* Verify the code for `email` and establish the session. Step 2 of the flow.
|
|
15
|
-
* Stores the Bounded id token (the realtime bearer) and sets the current user.
|
|
16
|
-
*/
|
|
13
|
+
/** @deprecated Inline app-origin OTP is retired. Use hosted loginWithRedirect(). */
|
|
17
14
|
export declare function verifyEmailOtp(email: string, otp: string): Promise<User>;
|
|
18
|
-
/**
|
|
19
|
-
* Verify the text-message code for `phoneNumber` and establish the session.
|
|
20
|
-
* Phone-only users have `user.email === null`; use `user.id` for ownership.
|
|
21
|
-
*/
|
|
15
|
+
/** @deprecated Inline app-origin text OTP is retired. Use hosted loginWithRedirect(). */
|
|
22
16
|
export declare function verifyTextOtp(phoneNumber: string, otp: string): Promise<User>;
|
|
23
17
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* which, IF the email is brand-new, makes the new account ADOPT the guest's id so
|
|
27
|
-
* `@user.id` is preserved and the guest's data carries over. If the email already
|
|
28
|
-
* exists, the user just signs into it (stays separate; `linked:false`). On success
|
|
29
|
-
* the upgraded session replaces the guest session and the user is no longer
|
|
30
|
-
* anonymous. `guestToken` is captured by the caller BEFORE switching auth methods.
|
|
18
|
+
* @deprecated Inline app-origin guest upgrade is retired. Use hosted login and
|
|
19
|
+
* transfer guest-owned data explicitly.
|
|
31
20
|
*/
|
|
32
21
|
export declare function linkEmailWithGuest(email: string, otp: string, guestToken: string): Promise<{
|
|
33
22
|
user: User;
|
|
@@ -40,7 +29,7 @@ export declare class EmailAuthProvider implements AuthProvider {
|
|
|
40
29
|
logout(): Promise<void>;
|
|
41
30
|
signMessage(_message: string): Promise<string>;
|
|
42
31
|
runTransaction(_evm?: EVMTransaction, _sol?: SolTransaction, _options?: SetOptions): Promise<TransactionResult>;
|
|
43
|
-
signTransaction(
|
|
32
|
+
signTransaction(_transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
44
33
|
signAndSubmitTransaction(): Promise<string>;
|
|
45
34
|
getNativeMethods(): Promise<any>;
|
|
46
35
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 1. Install polyfills: fast-text-encoding, react-native-get-random-values
|
|
11
11
|
* 2. Install @privy-io/expo, @privy-io/expo-native-extensions
|
|
12
12
|
* 3. Call ReactNativeSessionManager.configure({ storage, atob }) at startup
|
|
13
|
-
* 4. Call setPlatform({ ... }) from @bounded-sh/
|
|
13
|
+
* 4. Call setPlatform({ ... }) from @bounded-sh/client at startup
|
|
14
14
|
* 5. Wrap their app tree with PrivyProvider from @privy-io/expo
|
|
15
15
|
* 6. Create this provider and pass the Privy hooks/methods via setPrivyMethods()
|
|
16
16
|
*
|
package/dist/global.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AuthProvider, User, ClientConfig } from '@bounded-sh/core';
|
|
2
2
|
import { LoginOptions } from './auth';
|
|
3
3
|
export declare function init(newConfig: Partial<ClientConfig>): Promise<void>;
|
|
4
|
-
export declare function onAuthStateChanged(callback: (user: User | null) => void): void;
|
|
5
|
-
export declare function onAuthLoadingChanged(callback: (loading: boolean) => void): void;
|
|
4
|
+
export declare function onAuthStateChanged(callback: (user: User | null) => void): () => void;
|
|
5
|
+
export declare function onAuthLoadingChanged(callback: (loading: boolean) => void): () => void;
|
|
6
6
|
export declare function setAuthLoading(loading: boolean): void;
|
|
7
7
|
export declare function getAuthLoading(): boolean;
|
|
8
8
|
export declare function login(options?: LoginOptions): Promise<User | null>;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,9 +15,6 @@ export { deserializeTransaction } from "./auth/providers/sol/sol-utils";
|
|
|
15
15
|
export { getIdToken } from "./utils";
|
|
16
16
|
export { setPlatform, getPlatform } from "./platform";
|
|
17
17
|
export type { PlatformAdapter, StorageAdapter } from "./platform";
|
|
18
|
-
export { PhantomWalletProvider, PhantomWalletConfig, PhantomProviderType, } from "./auth/providers/phantom-wallet-provider";
|
|
19
18
|
export { OffchainAuthProvider, OffchainAuthProviderConfig, } from "./auth/providers/offchain-auth-provider";
|
|
20
|
-
export { SolanaMobileWalletProvider, SolanaMobileWalletConfig, isMobileWalletAvailable, registerMobileWalletAdapter, } from "./auth/providers/solana-mobile-wallet-provider";
|
|
21
|
-
export { PrivyWalletProvider } from "./auth/providers/privy-wallet-provider";
|
|
22
19
|
export { PrivyExpoProvider } from "./auth/providers/privy-expo-provider";
|
|
23
20
|
export type { PrivyExpoMethods } from "./auth/providers/privy-expo-provider";
|