@bounded-sh/client 0.0.36 → 0.0.37
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 +20 -1
- package/dist/auth/hooks/useAuth.d.ts +2 -1
- package/dist/auth/providers/offchain-auth-provider.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +37 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -4
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.ts +2 -0
- package/dist/index.native.js +37 -3
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +22 -4
- package/dist/index.native.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.native.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getActiveSessionManager, genAuthNonce, genSolanaMessage, createSessionWithSignature, getConfig, WebSessionManager, ReactNativeSessionManager, revokeSession, init as init$1, reconnectWithNewAuth, deriveUserIdentityFromIdToken, getIdToken as getIdToken$1, convertRemainingAccounts, buildSetDocumentsTransaction } from '@bounded-sh/core';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
3
|
-
export { aggregate, count, docId, get, getConfig, getFiles, getMany, queryAggregate, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe } from '@bounded-sh/core';
|
|
3
|
+
export { BoundedDeclineError, DECLINE_EVENT_NAME, aggregate, count, deriveDecline, dispatchDeclineEvent, docId, get, getConfig, getFiles, getMany, queryAggregate, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe } from '@bounded-sh/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { VersionedTransaction, Transaction, Connection, PublicKey } from '@solana/web3.js';
|
|
6
6
|
import * as anchor from '@coral-xyz/anchor';
|
|
@@ -145,6 +145,15 @@ class OffchainAuthProvider {
|
|
|
145
145
|
}
|
|
146
146
|
return null;
|
|
147
147
|
}
|
|
148
|
+
// Forward per-call login overrides (theme/title/subtitle and the `method`
|
|
149
|
+
// directive) to the wrapped provider. Without this, the top-level login()
|
|
150
|
+
// forwarder (which duck-types `setLoginOverrides` on the active provider)
|
|
151
|
+
// skips the wrapper and the override — including `method` — is dropped on
|
|
152
|
+
// offchain/Poofnet builds.
|
|
153
|
+
setLoginOverrides(opts) {
|
|
154
|
+
var _a, _b;
|
|
155
|
+
(_b = (_a = this.wrappedProvider).setLoginOverrides) === null || _b === void 0 ? void 0 : _b.call(_a, opts);
|
|
156
|
+
}
|
|
148
157
|
async logout() {
|
|
149
158
|
await this.wrappedProvider.logout();
|
|
150
159
|
}
|
|
@@ -178,6 +187,15 @@ class OffchainAuthProvider {
|
|
|
178
187
|
async getNativeMethods() {
|
|
179
188
|
return this.wrappedProvider.getNativeMethods();
|
|
180
189
|
}
|
|
190
|
+
// Forward wallet export to the wrapped provider (only Privy embedded wallets
|
|
191
|
+
// implement it). Duck-typed so wrappers around non-embedded providers throw
|
|
192
|
+
// a clear error rather than a "not a function" crash.
|
|
193
|
+
async exportWallet(address) {
|
|
194
|
+
if (typeof this.wrappedProvider.exportWallet !== 'function') {
|
|
195
|
+
throw new Error('Wallet export is not available for this wallet.');
|
|
196
|
+
}
|
|
197
|
+
await this.wrappedProvider.exportWallet(address);
|
|
198
|
+
}
|
|
181
199
|
// ============ signMessage delegates to wrapped provider ============
|
|
182
200
|
async signMessage(message) {
|
|
183
201
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -4844,7 +4862,7 @@ function useAuth() {
|
|
|
4844
4862
|
// Provide a fallback so server render doesn't break
|
|
4845
4863
|
if (isSSR) {
|
|
4846
4864
|
return {
|
|
4847
|
-
login: async () => undefined,
|
|
4865
|
+
login: async (_options) => undefined,
|
|
4848
4866
|
logout: async () => undefined,
|
|
4849
4867
|
loading: true,
|
|
4850
4868
|
user: null,
|
|
@@ -4866,10 +4884,10 @@ function useAuth() {
|
|
|
4866
4884
|
stopLoading();
|
|
4867
4885
|
};
|
|
4868
4886
|
}, []);
|
|
4869
|
-
const login$1 = async () => {
|
|
4887
|
+
const login$1 = async (options) => {
|
|
4870
4888
|
try {
|
|
4871
4889
|
setLoading(true);
|
|
4872
|
-
const user = await login();
|
|
4890
|
+
const user = await login(options);
|
|
4873
4891
|
setUser(user);
|
|
4874
4892
|
}
|
|
4875
4893
|
catch (error) {
|