@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
|
@@ -13030,6 +13030,21 @@ async function login$1(options) {
|
|
|
13030
13030
|
if (loginResult) {
|
|
13031
13031
|
// Store which auth method was used so we restore the right provider on reload
|
|
13032
13032
|
setStoredAuthMethod(currentAuthMethod);
|
|
13033
|
+
// If this top-level tab was opened solely to perform the wallet connect for
|
|
13034
|
+
// an embedded preview (?poofConnect — see openTopLevelForConnect in the
|
|
13035
|
+
// phantom provider), close it now that the session is established. The
|
|
13036
|
+
// session reflects back into the preview's iframe via same-origin storage.
|
|
13037
|
+
try {
|
|
13038
|
+
if (typeof window !== 'undefined'
|
|
13039
|
+
&& window.top === window.self
|
|
13040
|
+
&& new URLSearchParams(window.location.search).get('poofConnect') === '1') {
|
|
13041
|
+
setTimeout(() => { try {
|
|
13042
|
+
window.close();
|
|
13043
|
+
}
|
|
13044
|
+
catch ( /* noop */_a) { /* noop */ } }, 400);
|
|
13045
|
+
}
|
|
13046
|
+
}
|
|
13047
|
+
catch ( /* noop */_a) { /* noop */ }
|
|
13033
13048
|
return Object.assign(Object.assign({}, loginResult), { provider: currentAuthProvider });
|
|
13034
13049
|
}
|
|
13035
13050
|
return null;
|
|
@@ -15681,6 +15696,27 @@ function shouldBreakOutOfIframe(provider) {
|
|
|
15681
15696
|
// exactly the iframe-without-provider case we need to escape.
|
|
15682
15697
|
return provider === 'deeplink' && isInIframe();
|
|
15683
15698
|
}
|
|
15699
|
+
// In a cross-origin iframe (e.g. the poof.new build-page preview) on mobile,
|
|
15700
|
+
// Mobile Wallet Adapter can't run: its localhost association handshake needs
|
|
15701
|
+
// Chrome's Local Network Access, which is denied to cross-origin sub-frames.
|
|
15702
|
+
// So open the app's own URL TOP-LEVEL (a new tab / Custom Tab), where MWA works
|
|
15703
|
+
// natively; the connect happens there and the session — written to same-origin
|
|
15704
|
+
// storage — reflects back into this iframe (awaitTopLevelConnect picks it up).
|
|
15705
|
+
// Must be called synchronously inside a user-gesture handler so window.open
|
|
15706
|
+
// isn't popup-blocked. Returns true if the tab was opened.
|
|
15707
|
+
function openTopLevelForConnect() {
|
|
15708
|
+
if (typeof window === 'undefined' || !isInIframe())
|
|
15709
|
+
return false;
|
|
15710
|
+
try {
|
|
15711
|
+
const url = new URL(window.location.href);
|
|
15712
|
+
url.searchParams.set('poofConnect', '1');
|
|
15713
|
+
const w = window.open(url.toString(), '_blank');
|
|
15714
|
+
return !!w;
|
|
15715
|
+
}
|
|
15716
|
+
catch (_a) {
|
|
15717
|
+
return false;
|
|
15718
|
+
}
|
|
15719
|
+
}
|
|
15684
15720
|
// Dynamically import React and Phantom SDK - only when needed
|
|
15685
15721
|
let React$1;
|
|
15686
15722
|
let ReactDOM$1;
|
|
@@ -15701,7 +15737,7 @@ async function loadDependencies() {
|
|
|
15701
15737
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15702
15738
|
import('react'),
|
|
15703
15739
|
import('react-dom/client'),
|
|
15704
|
-
Promise.resolve().then(function () { return require('./index-
|
|
15740
|
+
Promise.resolve().then(function () { return require('./index-CaP3L422.js'); })
|
|
15705
15741
|
]);
|
|
15706
15742
|
// Extract default export from ESM module namespace
|
|
15707
15743
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -16084,26 +16120,19 @@ class PhantomWalletProvider {
|
|
|
16084
16120
|
const handleWalletClick = async (options) => {
|
|
16085
16121
|
walletClickedRef.current = true;
|
|
16086
16122
|
setShowWalletModal(false);
|
|
16087
|
-
//
|
|
16088
|
-
//
|
|
16089
|
-
//
|
|
16090
|
-
//
|
|
16091
|
-
//
|
|
16092
|
-
//
|
|
16123
|
+
// Cross-origin preview iframe + deeplink: the old approach navigated
|
|
16124
|
+
// the top frame to this URL, but in a TWA that lands out-of-scope and
|
|
16125
|
+
// shows a chrome-error ("bad page"). Instead, open the app TOP-LEVEL
|
|
16126
|
+
// in a new tab where the wallet connect works natively; the session
|
|
16127
|
+
// reflects back into this iframe (see openTopLevelForConnect /
|
|
16128
|
+
// awaitTopLevelConnect).
|
|
16093
16129
|
if (shouldBreakOutOfIframe(options === null || options === void 0 ? void 0 : options.provider)) {
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
// iframe's allow-top-navigation-by-user-activation sandbox
|
|
16097
|
-
// token make this go through.
|
|
16098
|
-
window.top.location.href = window.location.href;
|
|
16130
|
+
if (openTopLevelForConnect()) {
|
|
16131
|
+
that.awaitTopLevelConnect();
|
|
16099
16132
|
return;
|
|
16100
16133
|
}
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
// Fall through to the normal deeplink path — at least the
|
|
16104
|
-
// user gets the original broken-ish behavior instead of a
|
|
16105
|
-
// silently-dead button.
|
|
16106
|
-
}
|
|
16134
|
+
// Popup blocked — fall through to the original deeplink path
|
|
16135
|
+
// (better a broken-ish button than a silently-dead one).
|
|
16107
16136
|
}
|
|
16108
16137
|
try {
|
|
16109
16138
|
if (options === null || options === void 0 ? void 0 : options.walletId) {
|
|
@@ -16149,6 +16178,14 @@ class PhantomWalletProvider {
|
|
|
16149
16178
|
that.loginInProgress = false;
|
|
16150
16179
|
walletClickedRef.current = true;
|
|
16151
16180
|
setShowWalletModal(false);
|
|
16181
|
+
// Cross-origin preview iframe (e.g. poof.new build page) on mobile:
|
|
16182
|
+
// MWA can't run here (Chrome denies Local Network Access to sub-frames,
|
|
16183
|
+
// and its localhost handshake fails). Open the app top-level for the
|
|
16184
|
+
// connect; the session reflects back into this iframe.
|
|
16185
|
+
if (isInIframe() && openTopLevelForConnect()) {
|
|
16186
|
+
that.awaitTopLevelConnect();
|
|
16187
|
+
return;
|
|
16188
|
+
}
|
|
16152
16189
|
if (that.onSwitchToMWA) {
|
|
16153
16190
|
try {
|
|
16154
16191
|
const mwaProvider = await that.onSwitchToMWA();
|
|
@@ -16661,6 +16698,54 @@ class PhantomWalletProvider {
|
|
|
16661
16698
|
}
|
|
16662
16699
|
return null;
|
|
16663
16700
|
}
|
|
16701
|
+
// When connect is delegated to a top-level tab (openTopLevelForConnect — used
|
|
16702
|
+
// for the cross-origin preview iframe on mobile, where MWA can't run), the
|
|
16703
|
+
// actual connect happens in that tab and writes the session to same-origin
|
|
16704
|
+
// storage. This watches for that session to appear and resolves the in-flight
|
|
16705
|
+
// login() with it. It listens for `storage` events and visibility regain (the
|
|
16706
|
+
// user returning from the tab), with a polling fallback and a hard timeout.
|
|
16707
|
+
awaitTopLevelConnect() {
|
|
16708
|
+
if (typeof window === 'undefined')
|
|
16709
|
+
return;
|
|
16710
|
+
let done = false;
|
|
16711
|
+
const cleanup = () => {
|
|
16712
|
+
clearInterval(poll);
|
|
16713
|
+
clearTimeout(timeout);
|
|
16714
|
+
window.removeEventListener('storage', onChange);
|
|
16715
|
+
document.removeEventListener('visibilitychange', onVisible);
|
|
16716
|
+
};
|
|
16717
|
+
const tryResolve = async () => {
|
|
16718
|
+
if (done)
|
|
16719
|
+
return;
|
|
16720
|
+
try {
|
|
16721
|
+
const user = await this.restoreSession();
|
|
16722
|
+
if (user && this.pendingLogin) {
|
|
16723
|
+
done = true;
|
|
16724
|
+
cleanup();
|
|
16725
|
+
this.pendingLogin.resolve(user);
|
|
16726
|
+
this.pendingLogin = null;
|
|
16727
|
+
this.loginInProgress = false;
|
|
16728
|
+
}
|
|
16729
|
+
}
|
|
16730
|
+
catch (_a) {
|
|
16731
|
+
// not ready yet — keep waiting
|
|
16732
|
+
}
|
|
16733
|
+
};
|
|
16734
|
+
const onChange = () => { void tryResolve(); };
|
|
16735
|
+
const onVisible = () => { if (document.visibilityState === 'visible')
|
|
16736
|
+
void tryResolve(); };
|
|
16737
|
+
const poll = setInterval(() => { void tryResolve(); }, 1500);
|
|
16738
|
+
const timeout = setTimeout(() => {
|
|
16739
|
+
cleanup();
|
|
16740
|
+
if (!done && this.pendingLogin) {
|
|
16741
|
+
this.pendingLogin.reject(new Error('Wallet connection timed out'));
|
|
16742
|
+
this.pendingLogin = null;
|
|
16743
|
+
this.loginInProgress = false;
|
|
16744
|
+
}
|
|
16745
|
+
}, 180000);
|
|
16746
|
+
window.addEventListener('storage', onChange);
|
|
16747
|
+
document.addEventListener('visibilitychange', onVisible);
|
|
16748
|
+
}
|
|
16664
16749
|
async address() {
|
|
16665
16750
|
var _a, _b, _c, _d;
|
|
16666
16751
|
await this.ensureReady();
|
|
@@ -21402,13 +21487,13 @@ async function withMwaAssociationRetry(fn) {
|
|
|
21402
21487
|
* next tap is a new activation (a real retry). A timer-based retry would
|
|
21403
21488
|
* just hit the same Chrome block. Cap at 3 attempts before giving up.
|
|
21404
21489
|
*/
|
|
21405
|
-
async function awaitSignInGestureAndSign(theme, signFn) {
|
|
21490
|
+
async function awaitSignInGestureAndSign(theme, signFn, noResultError = 'MWA returned no signature') {
|
|
21406
21491
|
if (typeof document === 'undefined' || typeof window === 'undefined') {
|
|
21407
21492
|
// SSR / non-browser: skip the gesture, just call (the activation
|
|
21408
21493
|
// model doesn't apply outside the browser).
|
|
21409
21494
|
const results = await signFn();
|
|
21410
21495
|
if (!results || results.length === 0)
|
|
21411
|
-
throw new Error(
|
|
21496
|
+
throw new Error(noResultError);
|
|
21412
21497
|
return results[0];
|
|
21413
21498
|
}
|
|
21414
21499
|
return new Promise((resolve, reject) => {
|
|
@@ -21600,7 +21685,7 @@ async function awaitSignInGestureAndSign(theme, signFn) {
|
|
|
21600
21685
|
// launchAssociation(). Do not `await` before calling.
|
|
21601
21686
|
signFn().then((results) => {
|
|
21602
21687
|
if (!results || results.length === 0) {
|
|
21603
|
-
finishReject(new Error(
|
|
21688
|
+
finishReject(new Error(noResultError));
|
|
21604
21689
|
return;
|
|
21605
21690
|
}
|
|
21606
21691
|
finishResolve(results[0]);
|
|
@@ -21628,6 +21713,31 @@ async function awaitSignInGestureAndSign(theme, signFn) {
|
|
|
21628
21713
|
});
|
|
21629
21714
|
});
|
|
21630
21715
|
}
|
|
21716
|
+
/**
|
|
21717
|
+
* Sign through the gesture modal ONLY when transient user activation has
|
|
21718
|
+
* already decayed. Fast transactions still hold the activation from the
|
|
21719
|
+
* user's tap, so the `solana-wallet:` navigation succeeds directly with no
|
|
21720
|
+
* modal (preserves prior UX — no extra tap). Slow transactions — e.g. a swap
|
|
21721
|
+
* whose server-side build exceeds Chrome's ~5s activation window — have lost
|
|
21722
|
+
* it, so we fall back to awaitSignInGestureAndSign to mint a fresh activation
|
|
21723
|
+
* via a "Sign in" tap. Returns the first result (same shape as the bare
|
|
21724
|
+
* wallet-standard feature call and as awaitSignInGestureAndSign).
|
|
21725
|
+
*/
|
|
21726
|
+
async function signWithFreshActivation(theme, signFn, noResultError = 'MWA returned no signature') {
|
|
21727
|
+
var _a;
|
|
21728
|
+
const activationLive = typeof navigator !== 'undefined' &&
|
|
21729
|
+
((_a = navigator.userActivation) === null || _a === void 0 ? void 0 : _a.isActive) === true;
|
|
21730
|
+
if (activationLive) {
|
|
21731
|
+
// Live gesture: invoke synchronously (no await before signFn) so the
|
|
21732
|
+
// activation propagates to the protocol's location.assign navigation.
|
|
21733
|
+
const results = await signFn();
|
|
21734
|
+
if (!results || results.length === 0)
|
|
21735
|
+
throw new Error(noResultError);
|
|
21736
|
+
return results[0];
|
|
21737
|
+
}
|
|
21738
|
+
// Activation gone: surface the modal so the user's tap mints a fresh one.
|
|
21739
|
+
return awaitSignInGestureAndSign(theme, signFn, noResultError);
|
|
21740
|
+
}
|
|
21631
21741
|
/**
|
|
21632
21742
|
* Normalize a chain string to a wallet-standard Solana chain identifier.
|
|
21633
21743
|
*
|
|
@@ -21769,7 +21879,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21769
21879
|
if (typeof window === 'undefined')
|
|
21770
21880
|
return;
|
|
21771
21881
|
try {
|
|
21772
|
-
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21882
|
+
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-D2cnbAmp.js'); });
|
|
21773
21883
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21774
21884
|
if (!registerMwa) {
|
|
21775
21885
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21908,7 +22018,7 @@ class SolanaMobileWalletProvider {
|
|
|
21908
22018
|
async ensureWallet() {
|
|
21909
22019
|
if (this.wallet)
|
|
21910
22020
|
return this.wallet;
|
|
21911
|
-
const mod = await Promise.resolve().then(function () { return require('./index.browser-
|
|
22021
|
+
const mod = await Promise.resolve().then(function () { return require('./index.browser-D2cnbAmp.js'); });
|
|
21912
22022
|
const chain = mapChainToWalletStandard(this.cluster);
|
|
21913
22023
|
this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
|
|
21914
22024
|
appIdentity: this.appIdentity,
|
|
@@ -22386,11 +22496,10 @@ class SolanaMobileWalletProvider {
|
|
|
22386
22496
|
try {
|
|
22387
22497
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22388
22498
|
const wireBytes = txToWireBytes(transaction);
|
|
22389
|
-
|
|
22390
|
-
if
|
|
22391
|
-
|
|
22392
|
-
}
|
|
22393
|
-
const { signedTransaction: signedBytes } = results[0];
|
|
22499
|
+
// signTransaction navigates to `solana-wallet:`; only show the
|
|
22500
|
+
// gesture modal if the tap activation has decayed (see runTransaction).
|
|
22501
|
+
const signResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22502
|
+
const { signedTransaction: signedBytes } = signResult;
|
|
22394
22503
|
return txFromWireBytes(new Uint8Array(signedBytes));
|
|
22395
22504
|
}
|
|
22396
22505
|
catch (error) {
|
|
@@ -22496,11 +22605,9 @@ class SolanaMobileWalletProvider {
|
|
|
22496
22605
|
// because the wallet would submit to its own RPC.
|
|
22497
22606
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22498
22607
|
const wireBytes = txToWireBytes(transaction);
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
}
|
|
22503
|
-
const { signedTransaction: signedBytes } = results[0];
|
|
22608
|
+
// Gesture modal only if activation decayed (see runTransaction).
|
|
22609
|
+
const signResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22610
|
+
const { signedTransaction: signedBytes } = signResult;
|
|
22504
22611
|
const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
|
|
22505
22612
|
const signature = await connection.sendRawTransaction(signedTx.serialize(), {
|
|
22506
22613
|
preflightCommitment: 'confirmed',
|
|
@@ -22516,18 +22623,16 @@ class SolanaMobileWalletProvider {
|
|
|
22516
22623
|
return signature;
|
|
22517
22624
|
}
|
|
22518
22625
|
// Non-Surfnet: wallet signs and submits to its own RPC.
|
|
22626
|
+
// Gesture modal only if activation decayed (see runTransaction).
|
|
22519
22627
|
const signSendFeat = getSignAndSendTransactionFeature(wallet);
|
|
22520
22628
|
const wireBytes = txToWireBytes(transaction);
|
|
22521
|
-
const
|
|
22629
|
+
const sendResult = await signWithFreshActivation(this.config.theme, () => signSendFeat.signAndSendTransaction({
|
|
22522
22630
|
account,
|
|
22523
22631
|
transaction: wireBytes,
|
|
22524
22632
|
chain,
|
|
22525
22633
|
options: { commitment: 'confirmed' },
|
|
22526
|
-
});
|
|
22527
|
-
|
|
22528
|
-
throw new Error('MWA returned no signature');
|
|
22529
|
-
}
|
|
22530
|
-
const { signature: sigBytes } = results[0];
|
|
22634
|
+
}));
|
|
22635
|
+
const { signature: sigBytes } = sendResult;
|
|
22531
22636
|
const signature = base58.encode(sigBytes);
|
|
22532
22637
|
await confirmAndCheckTransaction(connection, signature);
|
|
22533
22638
|
return signature;
|
|
@@ -22607,11 +22712,13 @@ class SolanaMobileWalletProvider {
|
|
|
22607
22712
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
22608
22713
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22609
22714
|
const wireBytes = txToWireBytes(tx);
|
|
22610
|
-
|
|
22611
|
-
if
|
|
22715
|
+
// signTransaction also navigates to `solana-wallet:`; only
|
|
22716
|
+
// surface the gesture modal if the tap activation has decayed.
|
|
22717
|
+
const signOnlyResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22718
|
+
if (!signOnlyResult) {
|
|
22612
22719
|
throw new Error('MWA returned no signed transaction');
|
|
22613
22720
|
}
|
|
22614
|
-
const { signedTransaction: signedBytes } =
|
|
22721
|
+
const { signedTransaction: signedBytes } = signOnlyResult;
|
|
22615
22722
|
const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
|
|
22616
22723
|
return {
|
|
22617
22724
|
signedTransaction: signedTx,
|
|
@@ -22624,11 +22731,13 @@ class SolanaMobileWalletProvider {
|
|
|
22624
22731
|
// Surfnet: sign locally via wallet-standard, submit manually.
|
|
22625
22732
|
const signTxFeat = getSignTransactionFeature(wallet);
|
|
22626
22733
|
const wireBytes = txToWireBytes(tx);
|
|
22627
|
-
|
|
22628
|
-
if
|
|
22734
|
+
// signTransaction also navigates to `solana-wallet:`; only
|
|
22735
|
+
// surface the gesture modal if the tap activation has decayed.
|
|
22736
|
+
const surfnetResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
|
|
22737
|
+
if (!surfnetResult) {
|
|
22629
22738
|
throw new Error('MWA returned no signed transaction');
|
|
22630
22739
|
}
|
|
22631
|
-
const { signedTransaction: signedBytes } =
|
|
22740
|
+
const { signedTransaction: signedBytes } = surfnetResult;
|
|
22632
22741
|
const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
|
|
22633
22742
|
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
|
|
22634
22743
|
const signature = await connection.sendRawTransaction(signedTx.serialize(), {
|
|
@@ -22654,18 +22763,24 @@ class SolanaMobileWalletProvider {
|
|
|
22654
22763
|
};
|
|
22655
22764
|
}
|
|
22656
22765
|
// Non-Surfnet: wallet signs and submits to its own RPC.
|
|
22766
|
+
// signAndSendTransaction dispatches a `solana-wallet:` navigation
|
|
22767
|
+
// that Chrome blocks without transient user activation. Fast txs
|
|
22768
|
+
// still hold the tap activation and navigate directly; slow ones
|
|
22769
|
+
// (e.g. a swap whose server build exceeds Chrome's ~5s window)
|
|
22770
|
+
// have lost it, so signWithFreshActivation shows the "Sign in"
|
|
22771
|
+
// modal to mint a fresh activation — no modal when not needed.
|
|
22657
22772
|
const signSendFeat = getSignAndSendTransactionFeature(wallet);
|
|
22658
22773
|
const wireBytes = txToWireBytes(tx);
|
|
22659
|
-
const
|
|
22774
|
+
const sendResult = await signWithFreshActivation(this.config.theme, () => signSendFeat.signAndSendTransaction({
|
|
22660
22775
|
account,
|
|
22661
22776
|
transaction: wireBytes,
|
|
22662
22777
|
chain,
|
|
22663
22778
|
options: { commitment: 'confirmed' },
|
|
22664
|
-
});
|
|
22665
|
-
if (!
|
|
22779
|
+
}));
|
|
22780
|
+
if (!sendResult) {
|
|
22666
22781
|
throw new Error('MWA returned no signature');
|
|
22667
22782
|
}
|
|
22668
|
-
const { signature: sigBytes } =
|
|
22783
|
+
const { signature: sigBytes } = sendResult;
|
|
22669
22784
|
const signature = base58.encode(sigBytes);
|
|
22670
22785
|
const txInfo = await confirmAndCheckTransaction(connection, signature);
|
|
22671
22786
|
return {
|
|
@@ -23152,4 +23267,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
23152
23267
|
exports.signTransaction = signTransaction;
|
|
23153
23268
|
exports.subscribe = subscribe;
|
|
23154
23269
|
exports.useAuth = useAuth;
|
|
23155
|
-
//# sourceMappingURL=index-
|
|
23270
|
+
//# sourceMappingURL=index-Bu0P9-rk.js.map
|