@pooflabs/web 0.0.87 → 0.0.89-rc1
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/auth/providers/phantom-wallet-provider.d.ts +1 -0
- package/dist/{index-DYBdUxnT.js → index-B2tbqv9S.js} +3 -3
- package/dist/{index-DYBdUxnT.js.map → index-B2tbqv9S.js.map} +1 -1
- package/dist/{index-x7a-wH2l.esm.js → index-BbBFWBRS.esm.js} +3 -3
- package/dist/{index-x7a-wH2l.esm.js.map → index-BbBFWBRS.esm.js.map} +1 -1
- package/dist/{index-Dj1tZr6X.js → index-Bu0P9-rk.js} +165 -50
- package/dist/index-Bu0P9-rk.js.map +1 -0
- package/dist/{index-DofM-ue2.esm.js → index-C_t7524U.esm.js} +2 -2
- package/dist/{index-DofM-ue2.esm.js.map → index-C_t7524U.esm.js.map} +1 -1
- package/dist/{index-BKN0IwAx.js → index-CaP3L422.js} +2 -2
- package/dist/{index-BKN0IwAx.js.map → index-CaP3L422.js.map} +1 -1
- package/dist/{index-B-x9RTF7.js → index-DIO6OzTK.js} +2 -2
- package/dist/index-DIO6OzTK.js.map +1 -0
- package/dist/{index-BTwX7FYW.esm.js → index-DqaHVIzZ.esm.js} +165 -50
- package/dist/index-DqaHVIzZ.esm.js.map +1 -0
- package/dist/index-Mdx7ymmb.esm.js +6 -0
- package/dist/index-Mdx7ymmb.esm.js.map +1 -0
- package/dist/{index.browser-D7-FFk3q.js → index.browser-BCCeqt95.js} +2 -2
- package/dist/{index.browser-D7-FFk3q.js.map → index.browser-BCCeqt95.js.map} +1 -1
- package/dist/{index.browser-Cndx2raY.esm.js → index.browser-CMH5pzud.esm.js} +2 -2
- package/dist/{index.browser-Cndx2raY.esm.js.map → index.browser-CMH5pzud.esm.js.map} +1 -1
- package/dist/{index.browser-DlA-NKvf.js → index.browser-D2cnbAmp.js} +2 -2
- package/dist/{index.browser-DlA-NKvf.js.map → index.browser-D2cnbAmp.js.map} +1 -1
- package/dist/{index.browser-nVGFrIHK.esm.js → index.browser-K7sgUCDX.esm.js} +2 -2
- package/dist/{index.browser-nVGFrIHK.esm.js.map → index.browser-K7sgUCDX.esm.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-D8vj3Lbr.js → index.native-DGACm1O5.js} +19 -4
- package/dist/index.native-DGACm1O5.js.map +1 -0
- package/dist/{index.native-19VsREMJ.esm.js → index.native-RPvM5J_E.esm.js} +19 -4
- package/dist/index.native-RPvM5J_E.esm.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-BlZZa_3s.js → phantom-wallet-provider-B-5jhIZ6.js} +91 -21
- package/dist/phantom-wallet-provider-B-5jhIZ6.js.map +1 -0
- package/dist/{phantom-wallet-provider-Bz3qEFzX.esm.js → phantom-wallet-provider-BcxNxeLW.esm.js} +91 -21
- package/dist/phantom-wallet-provider-BcxNxeLW.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-DgNFzioA.esm.js → privy-wallet-provider-B8SDd66x.esm.js} +3 -3
- package/dist/{privy-wallet-provider-DgNFzioA.esm.js.map → privy-wallet-provider-B8SDd66x.esm.js.map} +1 -1
- package/dist/{privy-wallet-provider-CqCgq7uT.js → privy-wallet-provider-Du1rVhyc.js} +3 -3
- package/dist/{privy-wallet-provider-CqCgq7uT.js.map → privy-wallet-provider-Du1rVhyc.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-EeQsBTdr.esm.js → solana-mobile-wallet-provider-DKCgh6ep.esm.js} +63 -33
- package/dist/solana-mobile-wallet-provider-DKCgh6ep.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-VqIGfdMV.js → solana-mobile-wallet-provider-DuB_IGjv.js} +63 -33
- package/dist/solana-mobile-wallet-provider-DuB_IGjv.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-B-x9RTF7.js.map +0 -1
- package/dist/index-BTwX7FYW.esm.js.map +0 -1
- package/dist/index-Dj1tZr6X.js.map +0 -1
- package/dist/index-_k6pjuwx.esm.js +0 -6
- package/dist/index-_k6pjuwx.esm.js.map +0 -1
- package/dist/index.native-19VsREMJ.esm.js.map +0 -1
- package/dist/index.native-D8vj3Lbr.js.map +0 -1
- package/dist/phantom-wallet-provider-BlZZa_3s.js.map +0 -1
- package/dist/phantom-wallet-provider-Bz3qEFzX.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-EeQsBTdr.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-VqIGfdMV.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index_native = require('./index.native-
|
|
3
|
+
var index_native = require('./index.native-DGACm1O5.js');
|
|
4
4
|
|
|
5
5
|
var bufferExports = index_native.requireBuffer();
|
|
6
6
|
|
|
7
7
|
exports.bufferExports = bufferExports;
|
|
8
|
-
//# sourceMappingURL=index-
|
|
8
|
+
//# sourceMappingURL=index-DIO6OzTK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DIO6OzTK.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -13009,6 +13009,21 @@ async function login$1(options) {
|
|
|
13009
13009
|
if (loginResult) {
|
|
13010
13010
|
// Store which auth method was used so we restore the right provider on reload
|
|
13011
13011
|
setStoredAuthMethod(currentAuthMethod);
|
|
13012
|
+
// If this top-level tab was opened solely to perform the wallet connect for
|
|
13013
|
+
// an embedded preview (?poofConnect — see openTopLevelForConnect in the
|
|
13014
|
+
// phantom provider), close it now that the session is established. The
|
|
13015
|
+
// session reflects back into the preview's iframe via same-origin storage.
|
|
13016
|
+
try {
|
|
13017
|
+
if (typeof window !== 'undefined'
|
|
13018
|
+
&& window.top === window.self
|
|
13019
|
+
&& new URLSearchParams(window.location.search).get('poofConnect') === '1') {
|
|
13020
|
+
setTimeout(() => { try {
|
|
13021
|
+
window.close();
|
|
13022
|
+
}
|
|
13023
|
+
catch ( /* noop */_a) { /* noop */ } }, 400);
|
|
13024
|
+
}
|
|
13025
|
+
}
|
|
13026
|
+
catch ( /* noop */_a) { /* noop */ }
|
|
13012
13027
|
return Object.assign(Object.assign({}, loginResult), { provider: currentAuthProvider });
|
|
13013
13028
|
}
|
|
13014
13029
|
return null;
|
|
@@ -15660,6 +15675,27 @@ function shouldBreakOutOfIframe(provider) {
|
|
|
15660
15675
|
// exactly the iframe-without-provider case we need to escape.
|
|
15661
15676
|
return provider === 'deeplink' && isInIframe();
|
|
15662
15677
|
}
|
|
15678
|
+
// In a cross-origin iframe (e.g. the poof.new build-page preview) on mobile,
|
|
15679
|
+
// Mobile Wallet Adapter can't run: its localhost association handshake needs
|
|
15680
|
+
// Chrome's Local Network Access, which is denied to cross-origin sub-frames.
|
|
15681
|
+
// So open the app's own URL TOP-LEVEL (a new tab / Custom Tab), where MWA works
|
|
15682
|
+
// natively; the connect happens there and the session — written to same-origin
|
|
15683
|
+
// storage — reflects back into this iframe (awaitTopLevelConnect picks it up).
|
|
15684
|
+
// Must be called synchronously inside a user-gesture handler so window.open
|
|
15685
|
+
// isn't popup-blocked. Returns true if the tab was opened.
|
|
15686
|
+
function openTopLevelForConnect() {
|
|
15687
|
+
if (typeof window === 'undefined' || !isInIframe())
|
|
15688
|
+
return false;
|
|
15689
|
+
try {
|
|
15690
|
+
const url = new URL(window.location.href);
|
|
15691
|
+
url.searchParams.set('poofConnect', '1');
|
|
15692
|
+
const w = window.open(url.toString(), '_blank');
|
|
15693
|
+
return !!w;
|
|
15694
|
+
}
|
|
15695
|
+
catch (_a) {
|
|
15696
|
+
return false;
|
|
15697
|
+
}
|
|
15698
|
+
}
|
|
15663
15699
|
// Dynamically import React and Phantom SDK - only when needed
|
|
15664
15700
|
let React$1;
|
|
15665
15701
|
let ReactDOM$1;
|
|
@@ -15680,7 +15716,7 @@ async function loadDependencies() {
|
|
|
15680
15716
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15681
15717
|
import('react'),
|
|
15682
15718
|
import('react-dom/client'),
|
|
15683
|
-
import('./index-
|
|
15719
|
+
import('./index-C_t7524U.esm.js')
|
|
15684
15720
|
]);
|
|
15685
15721
|
// Extract default export from ESM module namespace
|
|
15686
15722
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -16063,26 +16099,19 @@ class PhantomWalletProvider {
|
|
|
16063
16099
|
const handleWalletClick = async (options) => {
|
|
16064
16100
|
walletClickedRef.current = true;
|
|
16065
16101
|
setShowWalletModal(false);
|
|
16066
|
-
//
|
|
16067
|
-
//
|
|
16068
|
-
//
|
|
16069
|
-
//
|
|
16070
|
-
//
|
|
16071
|
-
//
|
|
16102
|
+
// Cross-origin preview iframe + deeplink: the old approach navigated
|
|
16103
|
+
// the top frame to this URL, but in a TWA that lands out-of-scope and
|
|
16104
|
+
// shows a chrome-error ("bad page"). Instead, open the app TOP-LEVEL
|
|
16105
|
+
// in a new tab where the wallet connect works natively; the session
|
|
16106
|
+
// reflects back into this iframe (see openTopLevelForConnect /
|
|
16107
|
+
// awaitTopLevelConnect).
|
|
16072
16108
|
if (shouldBreakOutOfIframe(options === null || options === void 0 ? void 0 : options.provider)) {
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
// iframe's allow-top-navigation-by-user-activation sandbox
|
|
16076
|
-
// token make this go through.
|
|
16077
|
-
window.top.location.href = window.location.href;
|
|
16109
|
+
if (openTopLevelForConnect()) {
|
|
16110
|
+
that.awaitTopLevelConnect();
|
|
16078
16111
|
return;
|
|
16079
16112
|
}
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
// Fall through to the normal deeplink path — at least the
|
|
16083
|
-
// user gets the original broken-ish behavior instead of a
|
|
16084
|
-
// silently-dead button.
|
|
16085
|
-
}
|
|
16113
|
+
// Popup blocked — fall through to the original deeplink path
|
|
16114
|
+
// (better a broken-ish button than a silently-dead one).
|
|
16086
16115
|
}
|
|
16087
16116
|
try {
|
|
16088
16117
|
if (options === null || options === void 0 ? void 0 : options.walletId) {
|
|
@@ -16128,6 +16157,14 @@ class PhantomWalletProvider {
|
|
|
16128
16157
|
that.loginInProgress = false;
|
|
16129
16158
|
walletClickedRef.current = true;
|
|
16130
16159
|
setShowWalletModal(false);
|
|
16160
|
+
// Cross-origin preview iframe (e.g. poof.new build page) on mobile:
|
|
16161
|
+
// MWA can't run here (Chrome denies Local Network Access to sub-frames,
|
|
16162
|
+
// and its localhost handshake fails). Open the app top-level for the
|
|
16163
|
+
// connect; the session reflects back into this iframe.
|
|
16164
|
+
if (isInIframe() && openTopLevelForConnect()) {
|
|
16165
|
+
that.awaitTopLevelConnect();
|
|
16166
|
+
return;
|
|
16167
|
+
}
|
|
16131
16168
|
if (that.onSwitchToMWA) {
|
|
16132
16169
|
try {
|
|
16133
16170
|
const mwaProvider = await that.onSwitchToMWA();
|
|
@@ -16640,6 +16677,54 @@ class PhantomWalletProvider {
|
|
|
16640
16677
|
}
|
|
16641
16678
|
return null;
|
|
16642
16679
|
}
|
|
16680
|
+
// When connect is delegated to a top-level tab (openTopLevelForConnect — used
|
|
16681
|
+
// for the cross-origin preview iframe on mobile, where MWA can't run), the
|
|
16682
|
+
// actual connect happens in that tab and writes the session to same-origin
|
|
16683
|
+
// storage. This watches for that session to appear and resolves the in-flight
|
|
16684
|
+
// login() with it. It listens for `storage` events and visibility regain (the
|
|
16685
|
+
// user returning from the tab), with a polling fallback and a hard timeout.
|
|
16686
|
+
awaitTopLevelConnect() {
|
|
16687
|
+
if (typeof window === 'undefined')
|
|
16688
|
+
return;
|
|
16689
|
+
let done = false;
|
|
16690
|
+
const cleanup = () => {
|
|
16691
|
+
clearInterval(poll);
|
|
16692
|
+
clearTimeout(timeout);
|
|
16693
|
+
window.removeEventListener('storage', onChange);
|
|
16694
|
+
document.removeEventListener('visibilitychange', onVisible);
|
|
16695
|
+
};
|
|
16696
|
+
const tryResolve = async () => {
|
|
16697
|
+
if (done)
|
|
16698
|
+
return;
|
|
16699
|
+
try {
|
|
16700
|
+
const user = await this.restoreSession();
|
|
16701
|
+
if (user && this.pendingLogin) {
|
|
16702
|
+
done = true;
|
|
16703
|
+
cleanup();
|
|
16704
|
+
this.pendingLogin.resolve(user);
|
|
16705
|
+
this.pendingLogin = null;
|
|
16706
|
+
this.loginInProgress = false;
|
|
16707
|
+
}
|
|
16708
|
+
}
|
|
16709
|
+
catch (_a) {
|
|
16710
|
+
// not ready yet — keep waiting
|
|
16711
|
+
}
|
|
16712
|
+
};
|
|
16713
|
+
const onChange = () => { void tryResolve(); };
|
|
16714
|
+
const onVisible = () => { if (document.visibilityState === 'visible')
|
|
16715
|
+
void tryResolve(); };
|
|
16716
|
+
const poll = setInterval(() => { void tryResolve(); }, 1500);
|
|
16717
|
+
const timeout = setTimeout(() => {
|
|
16718
|
+
cleanup();
|
|
16719
|
+
if (!done && this.pendingLogin) {
|
|
16720
|
+
this.pendingLogin.reject(new Error('Wallet connection timed out'));
|
|
16721
|
+
this.pendingLogin = null;
|
|
16722
|
+
this.loginInProgress = false;
|
|
16723
|
+
}
|
|
16724
|
+
}, 180000);
|
|
16725
|
+
window.addEventListener('storage', onChange);
|
|
16726
|
+
document.addEventListener('visibilitychange', onVisible);
|
|
16727
|
+
}
|
|
16643
16728
|
async address() {
|
|
16644
16729
|
var _a, _b, _c, _d;
|
|
16645
16730
|
await this.ensureReady();
|
|
@@ -21381,13 +21466,13 @@ async function withMwaAssociationRetry(fn) {
|
|
|
21381
21466
|
* next tap is a new activation (a real retry). A timer-based retry would
|
|
21382
21467
|
* just hit the same Chrome block. Cap at 3 attempts before giving up.
|
|
21383
21468
|
*/
|
|
21384
|
-
async function awaitSignInGestureAndSign(theme, signFn) {
|
|
21469
|
+
async function awaitSignInGestureAndSign(theme, signFn, noResultError = 'MWA returned no signature') {
|
|
21385
21470
|
if (typeof document === 'undefined' || typeof window === 'undefined') {
|
|
21386
21471
|
// SSR / non-browser: skip the gesture, just call (the activation
|
|
21387
21472
|
// model doesn't apply outside the browser).
|
|
21388
21473
|
const results = await signFn();
|
|
21389
21474
|
if (!results || results.length === 0)
|
|
21390
|
-
throw new Error(
|
|
21475
|
+
throw new Error(noResultError);
|
|
21391
21476
|
return results[0];
|
|
21392
21477
|
}
|
|
21393
21478
|
return new Promise((resolve, reject) => {
|
|
@@ -21579,7 +21664,7 @@ async function awaitSignInGestureAndSign(theme, signFn) {
|
|
|
21579
21664
|
// launchAssociation(). Do not `await` before calling.
|
|
21580
21665
|
signFn().then((results) => {
|
|
21581
21666
|
if (!results || results.length === 0) {
|
|
21582
|
-
finishReject(new Error(
|
|
21667
|
+
finishReject(new Error(noResultError));
|
|
21583
21668
|
return;
|
|
21584
21669
|
}
|
|
21585
21670
|
finishResolve(results[0]);
|
|
@@ -21607,6 +21692,31 @@ async function awaitSignInGestureAndSign(theme, signFn) {
|
|
|
21607
21692
|
});
|
|
21608
21693
|
});
|
|
21609
21694
|
}
|
|
21695
|
+
/**
|
|
21696
|
+
* Sign through the gesture modal ONLY when transient user activation has
|
|
21697
|
+
* already decayed. Fast transactions still hold the activation from the
|
|
21698
|
+
* user's tap, so the `solana-wallet:` navigation succeeds directly with no
|
|
21699
|
+
* modal (preserves prior UX — no extra tap). Slow transactions — e.g. a swap
|
|
21700
|
+
* whose server-side build exceeds Chrome's ~5s activation window — have lost
|
|
21701
|
+
* it, so we fall back to awaitSignInGestureAndSign to mint a fresh activation
|
|
21702
|
+
* via a "Sign in" tap. Returns the first result (same shape as the bare
|
|
21703
|
+
* wallet-standard feature call and as awaitSignInGestureAndSign).
|
|
21704
|
+
*/
|
|
21705
|
+
async function signWithFreshActivation(theme, signFn, noResultError = 'MWA returned no signature') {
|
|
21706
|
+
var _a;
|
|
21707
|
+
const activationLive = typeof navigator !== 'undefined' &&
|
|
21708
|
+
((_a = navigator.userActivation) === null || _a === void 0 ? void 0 : _a.isActive) === true;
|
|
21709
|
+
if (activationLive) {
|
|
21710
|
+
// Live gesture: invoke synchronously (no await before signFn) so the
|
|
21711
|
+
// activation propagates to the protocol's location.assign navigation.
|
|
21712
|
+
const results = await signFn();
|
|
21713
|
+
if (!results || results.length === 0)
|
|
21714
|
+
throw new Error(noResultError);
|
|
21715
|
+
return results[0];
|
|
21716
|
+
}
|
|
21717
|
+
// Activation gone: surface the modal so the user's tap mints a fresh one.
|
|
21718
|
+
return awaitSignInGestureAndSign(theme, signFn, noResultError);
|
|
21719
|
+
}
|
|
21610
21720
|
/**
|
|
21611
21721
|
* Normalize a chain string to a wallet-standard Solana chain identifier.
|
|
21612
21722
|
*
|
|
@@ -21748,7 +21858,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21748
21858
|
if (typeof window === 'undefined')
|
|
21749
21859
|
return;
|
|
21750
21860
|
try {
|
|
21751
|
-
const walletStandardMobile = await import('./index.browser-
|
|
21861
|
+
const walletStandardMobile = await import('./index.browser-K7sgUCDX.esm.js');
|
|
21752
21862
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21753
21863
|
if (!registerMwa) {
|
|
21754
21864
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21887,7 +21997,7 @@ class SolanaMobileWalletProvider {
|
|
|
21887
21997
|
async ensureWallet() {
|
|
21888
21998
|
if (this.wallet)
|
|
21889
21999
|
return this.wallet;
|
|
21890
|
-
const mod = await import('./index.browser-
|
|
22000
|
+
const mod = await import('./index.browser-K7sgUCDX.esm.js');
|
|
21891
22001
|
const chain = mapChainToWalletStandard(this.cluster);
|
|
21892
22002
|
this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
|
|
21893
22003
|
appIdentity: this.appIdentity,
|
|
@@ -22365,11 +22475,10 @@ class SolanaMobileWalletProvider {
|
|
|
22365
22475
|
try {
|
|
22366
22476
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22367
22477
|
const wireBytes = txToWireBytes(transaction);
|
|
22368
|
-
|
|
22369
|
-
if
|
|
22370
|
-
|
|
22371
|
-
}
|
|
22372
|
-
const { signedTransaction: signedBytes } = results[0];
|
|
22478
|
+
// signTransaction navigates to `solana-wallet:`; only show the
|
|
22479
|
+
// gesture modal if the tap activation has decayed (see runTransaction).
|
|
22480
|
+
const signResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22481
|
+
const { signedTransaction: signedBytes } = signResult;
|
|
22373
22482
|
return txFromWireBytes(new Uint8Array(signedBytes));
|
|
22374
22483
|
}
|
|
22375
22484
|
catch (error) {
|
|
@@ -22475,11 +22584,9 @@ class SolanaMobileWalletProvider {
|
|
|
22475
22584
|
// because the wallet would submit to its own RPC.
|
|
22476
22585
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22477
22586
|
const wireBytes = txToWireBytes(transaction);
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
}
|
|
22482
|
-
const { signedTransaction: signedBytes } = results[0];
|
|
22587
|
+
// Gesture modal only if activation decayed (see runTransaction).
|
|
22588
|
+
const signResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22589
|
+
const { signedTransaction: signedBytes } = signResult;
|
|
22483
22590
|
const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
|
|
22484
22591
|
const signature = await connection.sendRawTransaction(signedTx.serialize(), {
|
|
22485
22592
|
preflightCommitment: 'confirmed',
|
|
@@ -22495,18 +22602,16 @@ class SolanaMobileWalletProvider {
|
|
|
22495
22602
|
return signature;
|
|
22496
22603
|
}
|
|
22497
22604
|
// Non-Surfnet: wallet signs and submits to its own RPC.
|
|
22605
|
+
// Gesture modal only if activation decayed (see runTransaction).
|
|
22498
22606
|
const signSendFeat = getSignAndSendTransactionFeature(wallet);
|
|
22499
22607
|
const wireBytes = txToWireBytes(transaction);
|
|
22500
|
-
const
|
|
22608
|
+
const sendResult = await signWithFreshActivation(this.config.theme, () => signSendFeat.signAndSendTransaction({
|
|
22501
22609
|
account,
|
|
22502
22610
|
transaction: wireBytes,
|
|
22503
22611
|
chain,
|
|
22504
22612
|
options: { commitment: 'confirmed' },
|
|
22505
|
-
});
|
|
22506
|
-
|
|
22507
|
-
throw new Error('MWA returned no signature');
|
|
22508
|
-
}
|
|
22509
|
-
const { signature: sigBytes } = results[0];
|
|
22613
|
+
}));
|
|
22614
|
+
const { signature: sigBytes } = sendResult;
|
|
22510
22615
|
const signature = base58.encode(sigBytes);
|
|
22511
22616
|
await confirmAndCheckTransaction(connection, signature);
|
|
22512
22617
|
return signature;
|
|
@@ -22586,11 +22691,13 @@ class SolanaMobileWalletProvider {
|
|
|
22586
22691
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
22587
22692
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22588
22693
|
const wireBytes = txToWireBytes(tx);
|
|
22589
|
-
|
|
22590
|
-
if
|
|
22694
|
+
// signTransaction also navigates to `solana-wallet:`; only
|
|
22695
|
+
// surface the gesture modal if the tap activation has decayed.
|
|
22696
|
+
const signOnlyResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22697
|
+
if (!signOnlyResult) {
|
|
22591
22698
|
throw new Error('MWA returned no signed transaction');
|
|
22592
22699
|
}
|
|
22593
|
-
const { signedTransaction: signedBytes } =
|
|
22700
|
+
const { signedTransaction: signedBytes } = signOnlyResult;
|
|
22594
22701
|
const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
|
|
22595
22702
|
return {
|
|
22596
22703
|
signedTransaction: signedTx,
|
|
@@ -22603,11 +22710,13 @@ class SolanaMobileWalletProvider {
|
|
|
22603
22710
|
// Surfnet: sign locally via wallet-standard, submit manually.
|
|
22604
22711
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22605
22712
|
const wireBytes = txToWireBytes(tx);
|
|
22606
|
-
|
|
22607
|
-
if
|
|
22713
|
+
// signTransaction also navigates to `solana-wallet:`; only
|
|
22714
|
+
// surface the gesture modal if the tap activation has decayed.
|
|
22715
|
+
const surfnetResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22716
|
+
if (!surfnetResult) {
|
|
22608
22717
|
throw new Error('MWA returned no signed transaction');
|
|
22609
22718
|
}
|
|
22610
|
-
const { signedTransaction: signedBytes } =
|
|
22719
|
+
const { signedTransaction: signedBytes } = surfnetResult;
|
|
22611
22720
|
const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
|
|
22612
22721
|
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
|
|
22613
22722
|
const signature = await connection.sendRawTransaction(signedTx.serialize(), {
|
|
@@ -22633,18 +22742,24 @@ class SolanaMobileWalletProvider {
|
|
|
22633
22742
|
};
|
|
22634
22743
|
}
|
|
22635
22744
|
// Non-Surfnet: wallet signs and submits to its own RPC.
|
|
22745
|
+
// signAndSendTransaction dispatches a `solana-wallet:` navigation
|
|
22746
|
+
// that Chrome blocks without transient user activation. Fast txs
|
|
22747
|
+
// still hold the tap activation and navigate directly; slow ones
|
|
22748
|
+
// (e.g. a swap whose server build exceeds Chrome's ~5s window)
|
|
22749
|
+
// have lost it, so signWithFreshActivation shows the "Sign in"
|
|
22750
|
+
// modal to mint a fresh activation — no modal when not needed.
|
|
22636
22751
|
const signSendFeat = getSignAndSendTransactionFeature(wallet);
|
|
22637
22752
|
const wireBytes = txToWireBytes(tx);
|
|
22638
|
-
const
|
|
22753
|
+
const sendResult = await signWithFreshActivation(this.config.theme, () => signSendFeat.signAndSendTransaction({
|
|
22639
22754
|
account,
|
|
22640
22755
|
transaction: wireBytes,
|
|
22641
22756
|
chain,
|
|
22642
22757
|
options: { commitment: 'confirmed' },
|
|
22643
|
-
});
|
|
22644
|
-
if (!
|
|
22758
|
+
}));
|
|
22759
|
+
if (!sendResult) {
|
|
22645
22760
|
throw new Error('MWA returned no signature');
|
|
22646
22761
|
}
|
|
22647
|
-
const { signature: sigBytes } =
|
|
22762
|
+
const { signature: sigBytes } = sendResult;
|
|
22648
22763
|
const signature = base58.encode(sigBytes);
|
|
22649
22764
|
const txInfo = await confirmAndCheckTransaction(connection, signature);
|
|
22650
22765
|
return {
|
|
@@ -23072,4 +23187,4 @@ class PrivyExpoProvider {
|
|
|
23072
23187
|
}
|
|
23073
23188
|
|
|
23074
23189
|
export { genAuthNonce as $, count as A, aggregate as B, subscribe as C, useAuth as D, deserializeTransaction as E, getIdToken as F, setPlatform as G, getPlatform as H, PrivyWalletProvider as I, DEFAULT_TEST_ADDRESS as J, isMobileWalletAvailable as K, registerMobileWalletAdapter as L, MockAuthProvider as M, PrivyExpoProvider as N, OffchainAuthProvider as O, PhantomWalletProvider as P, InsufficientBalanceError as Q, ReactNativeSessionManager as R, SolanaMobileWalletProvider as S, ServerSessionManager as T, buildSetDocumentsTransaction as U, clearCache as V, WebSessionManager as W, closeAllSubscriptions as X, convertRemainingAccounts as Y, createSessionWithPrivy as Z, createSessionWithSignature as _, base58 as a, genSolanaMessage as a0, getCachedData as a1, getMany as a2, reconnectWithNewAuth as a3, refreshSession as a4, signSessionCreateMessage as a5, bufferExports as b, commonjsRequire as c, getCurrentUser as d, onAuthLoadingChanged as e, getAuthLoading as f, getDefaultExportFromCjs$1 as g, logout as h, init as i, getConfig as j, getAuthProvider as k, login as l, get as m, setMany as n, onAuthStateChanged as o, setFile as p, getFiles as q, require$$0 as r, set as s, runQuery as t, runQueryMany as u, runExpression as v, runExpressionMany as w, signMessage as x, signTransaction as y, signAndSubmitTransaction as z };
|
|
23075
|
-
//# sourceMappingURL=index-
|
|
23190
|
+
//# sourceMappingURL=index-DqaHVIzZ.esm.js.map
|