@rhinestone/deposit-modal 0.3.0-alpha.3 → 0.3.0-alpha.4
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/{DepositModalReown-6QBOLFNL.mjs → DepositModalReown-A2E4QTSF.mjs} +1 -1
- package/dist/{DepositModalReown-DVRWDPYV.cjs → DepositModalReown-XV4BEUHT.cjs} +2 -2
- package/dist/{chunk-QLTTDVFU.mjs → chunk-BNY4AL7P.mjs} +74 -2
- package/dist/{chunk-IATY2C5R.cjs → chunk-NSI4BCBV.cjs} +142 -70
- package/dist/deposit.cjs +2 -2
- package/dist/deposit.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNSI4BCBVcjs = require('./chunk-NSI4BCBV.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
|
|
|
32
32
|
reown.disconnect();
|
|
33
33
|
}, [reown.disconnect]);
|
|
34
34
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
35
|
-
|
|
35
|
+
_chunkNSI4BCBVcjs.DepositModalInner,
|
|
36
36
|
{
|
|
37
37
|
...props,
|
|
38
38
|
reownWallet: reownWithSolana,
|
|
@@ -3717,6 +3717,16 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
3717
3717
|
function computeIsCacheable(input) {
|
|
3718
3718
|
return !input.forceRegister && !(input.postBridgeActions?.length ?? 0);
|
|
3719
3719
|
}
|
|
3720
|
+
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
3721
|
+
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
3722
|
+
function readDedupedAccountSetupResult(requestKey) {
|
|
3723
|
+
const now = Date.now();
|
|
3724
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3725
|
+
if (existing?.settled && existing.expiresAt > now && existing.result) {
|
|
3726
|
+
return existing.result;
|
|
3727
|
+
}
|
|
3728
|
+
return null;
|
|
3729
|
+
}
|
|
3720
3730
|
async function runAccountSetup(input, deps) {
|
|
3721
3731
|
const { service, debug } = deps;
|
|
3722
3732
|
const enableSolana = input.enableSolana ?? true;
|
|
@@ -3814,6 +3824,42 @@ async function runAccountSetup(input, deps) {
|
|
|
3814
3824
|
throw mapError(error);
|
|
3815
3825
|
}
|
|
3816
3826
|
}
|
|
3827
|
+
function runAccountSetupDeduped(input, deps, requestKey) {
|
|
3828
|
+
const now = Date.now();
|
|
3829
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3830
|
+
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
3831
|
+
debugLog(deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
3832
|
+
owner: input.ownerAddress,
|
|
3833
|
+
forceRegister: input.forceRegister ?? false
|
|
3834
|
+
});
|
|
3835
|
+
return existing.promise;
|
|
3836
|
+
}
|
|
3837
|
+
const entry = {
|
|
3838
|
+
promise: runAccountSetup(input, deps),
|
|
3839
|
+
settled: false,
|
|
3840
|
+
expiresAt: Number.POSITIVE_INFINITY,
|
|
3841
|
+
result: null
|
|
3842
|
+
};
|
|
3843
|
+
setupRequestDedupe.set(requestKey, entry);
|
|
3844
|
+
entry.promise.then((result) => {
|
|
3845
|
+
entry.settled = true;
|
|
3846
|
+
entry.result = result;
|
|
3847
|
+
entry.expiresAt = Date.now() + SETUP_REQUEST_DEDUPE_TTL_MS;
|
|
3848
|
+
const cleanupTimer = setTimeout(() => {
|
|
3849
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3850
|
+
setupRequestDedupe.delete(requestKey);
|
|
3851
|
+
}
|
|
3852
|
+
}, SETUP_REQUEST_DEDUPE_TTL_MS);
|
|
3853
|
+
if (typeof cleanupTimer === "object" && cleanupTimer && "unref" in cleanupTimer && typeof cleanupTimer.unref === "function") {
|
|
3854
|
+
cleanupTimer.unref();
|
|
3855
|
+
}
|
|
3856
|
+
}).catch(() => {
|
|
3857
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3858
|
+
setupRequestDedupe.delete(requestKey);
|
|
3859
|
+
}
|
|
3860
|
+
});
|
|
3861
|
+
return entry.promise;
|
|
3862
|
+
}
|
|
3817
3863
|
function mapError(error) {
|
|
3818
3864
|
if (error instanceof TypeError) {
|
|
3819
3865
|
return new SetupError(
|
|
@@ -4704,6 +4750,28 @@ function DepositFlow({
|
|
|
4704
4750
|
if (current.requestKey === requestKey) {
|
|
4705
4751
|
return;
|
|
4706
4752
|
}
|
|
4753
|
+
const dedupedResult = readDedupedAccountSetupResult(requestKey);
|
|
4754
|
+
if (dedupedResult) {
|
|
4755
|
+
storeApi.dispatch({
|
|
4756
|
+
type: "setup/started",
|
|
4757
|
+
owner,
|
|
4758
|
+
requestKey,
|
|
4759
|
+
cacheKey,
|
|
4760
|
+
cacheable
|
|
4761
|
+
});
|
|
4762
|
+
storeApi.dispatch({
|
|
4763
|
+
type: "setup/ready",
|
|
4764
|
+
owner,
|
|
4765
|
+
requestKey,
|
|
4766
|
+
result: {
|
|
4767
|
+
smartAccount: dedupedResult.smartAccount,
|
|
4768
|
+
sessionOwnerAddress: dedupedResult.sessionOwnerAddress,
|
|
4769
|
+
solanaDepositAddress: dedupedResult.solanaDepositAddress,
|
|
4770
|
+
cacheKey: dedupedResult.cacheKey
|
|
4771
|
+
}
|
|
4772
|
+
});
|
|
4773
|
+
return;
|
|
4774
|
+
}
|
|
4707
4775
|
storeApi.dispatch({
|
|
4708
4776
|
type: "setup/started",
|
|
4709
4777
|
owner,
|
|
@@ -4712,7 +4780,11 @@ function DepositFlow({
|
|
|
4712
4780
|
cacheable
|
|
4713
4781
|
});
|
|
4714
4782
|
try {
|
|
4715
|
-
const result = await
|
|
4783
|
+
const result = await runAccountSetupDeduped(
|
|
4784
|
+
input,
|
|
4785
|
+
{ service, debug },
|
|
4786
|
+
requestKey
|
|
4787
|
+
);
|
|
4716
4788
|
storeApi.dispatch({
|
|
4717
4789
|
type: "setup/ready",
|
|
4718
4790
|
owner,
|
|
@@ -5651,7 +5723,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
5651
5723
|
// src/DepositModal.tsx
|
|
5652
5724
|
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5653
5725
|
var ReownDepositInner = lazy2(
|
|
5654
|
-
() => import("./DepositModalReown-
|
|
5726
|
+
() => import("./DepositModalReown-A2E4QTSF.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
5655
5727
|
);
|
|
5656
5728
|
function sortByCreatedAtDesc(items) {
|
|
5657
5729
|
return [...items].sort((a, b) => {
|
|
@@ -3717,6 +3717,16 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
3717
3717
|
function computeIsCacheable(input) {
|
|
3718
3718
|
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _91 => _91.postBridgeActions, 'optionalAccess', _92 => _92.length]), () => ( 0)));
|
|
3719
3719
|
}
|
|
3720
|
+
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
3721
|
+
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
3722
|
+
function readDedupedAccountSetupResult(requestKey) {
|
|
3723
|
+
const now = Date.now();
|
|
3724
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3725
|
+
if (_optionalChain([existing, 'optionalAccess', _93 => _93.settled]) && existing.expiresAt > now && existing.result) {
|
|
3726
|
+
return existing.result;
|
|
3727
|
+
}
|
|
3728
|
+
return null;
|
|
3729
|
+
}
|
|
3720
3730
|
async function runAccountSetup(input, deps) {
|
|
3721
3731
|
const { service, debug } = deps;
|
|
3722
3732
|
const enableSolana = _nullishCoalesce(input.enableSolana, () => ( true));
|
|
@@ -3726,7 +3736,7 @@ async function runAccountSetup(input, deps) {
|
|
|
3726
3736
|
_chunkV6NJIPSScjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
3727
3737
|
owner: input.ownerAddress,
|
|
3728
3738
|
sessionOwner: sessionOwner.address,
|
|
3729
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access',
|
|
3739
|
+
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _94 => _94.postBridgeActions, 'optionalAccess', _95 => _95.length])),
|
|
3730
3740
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
3731
3741
|
});
|
|
3732
3742
|
const setup = await service.setupAccount({
|
|
@@ -3788,10 +3798,10 @@ async function runAccountSetup(input, deps) {
|
|
|
3788
3798
|
chain: _chunkV6NJIPSScjs.toEvmCaip2.call(void 0, input.targetChain),
|
|
3789
3799
|
token: input.targetToken,
|
|
3790
3800
|
...input.recipient && { recipient: input.recipient },
|
|
3791
|
-
..._optionalChain([input, 'access',
|
|
3801
|
+
..._optionalChain([input, 'access', _96 => _96.postBridgeActions, 'optionalAccess', _97 => _97.length]) && {
|
|
3792
3802
|
postBridgeActions: input.postBridgeActions
|
|
3793
3803
|
},
|
|
3794
|
-
..._optionalChain([input, 'access',
|
|
3804
|
+
..._optionalChain([input, 'access', _98 => _98.outputTokenRules, 'optionalAccess', _99 => _99.length]) && {
|
|
3795
3805
|
outputTokenRules: input.outputTokenRules
|
|
3796
3806
|
},
|
|
3797
3807
|
...input.rejectUnmapped != null && {
|
|
@@ -3814,6 +3824,42 @@ async function runAccountSetup(input, deps) {
|
|
|
3814
3824
|
throw mapError(error);
|
|
3815
3825
|
}
|
|
3816
3826
|
}
|
|
3827
|
+
function runAccountSetupDeduped(input, deps, requestKey) {
|
|
3828
|
+
const now = Date.now();
|
|
3829
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3830
|
+
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
3831
|
+
_chunkV6NJIPSScjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
3832
|
+
owner: input.ownerAddress,
|
|
3833
|
+
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
3834
|
+
});
|
|
3835
|
+
return existing.promise;
|
|
3836
|
+
}
|
|
3837
|
+
const entry = {
|
|
3838
|
+
promise: runAccountSetup(input, deps),
|
|
3839
|
+
settled: false,
|
|
3840
|
+
expiresAt: Number.POSITIVE_INFINITY,
|
|
3841
|
+
result: null
|
|
3842
|
+
};
|
|
3843
|
+
setupRequestDedupe.set(requestKey, entry);
|
|
3844
|
+
entry.promise.then((result) => {
|
|
3845
|
+
entry.settled = true;
|
|
3846
|
+
entry.result = result;
|
|
3847
|
+
entry.expiresAt = Date.now() + SETUP_REQUEST_DEDUPE_TTL_MS;
|
|
3848
|
+
const cleanupTimer = setTimeout(() => {
|
|
3849
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3850
|
+
setupRequestDedupe.delete(requestKey);
|
|
3851
|
+
}
|
|
3852
|
+
}, SETUP_REQUEST_DEDUPE_TTL_MS);
|
|
3853
|
+
if (typeof cleanupTimer === "object" && cleanupTimer && "unref" in cleanupTimer && typeof cleanupTimer.unref === "function") {
|
|
3854
|
+
cleanupTimer.unref();
|
|
3855
|
+
}
|
|
3856
|
+
}).catch(() => {
|
|
3857
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3858
|
+
setupRequestDedupe.delete(requestKey);
|
|
3859
|
+
}
|
|
3860
|
+
});
|
|
3861
|
+
return entry.promise;
|
|
3862
|
+
}
|
|
3817
3863
|
function mapError(error) {
|
|
3818
3864
|
if (error instanceof TypeError) {
|
|
3819
3865
|
return new SetupError(
|
|
@@ -4031,7 +4077,7 @@ function DepositFlow({
|
|
|
4031
4077
|
const onLifecycleRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onLifecycle);
|
|
4032
4078
|
const onErrorRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onError);
|
|
4033
4079
|
const hasInitialReownSession = Boolean(
|
|
4034
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4080
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _100 => _100.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _101 => _101.address]) : _optionalChain([reownWallet, 'optionalAccess', _102 => _102.address])
|
|
4035
4081
|
);
|
|
4036
4082
|
const hasInitialWalletHydrationPending = Boolean(
|
|
4037
4083
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -4081,12 +4127,12 @@ function DepositFlow({
|
|
|
4081
4127
|
return null;
|
|
4082
4128
|
}, []);
|
|
4083
4129
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
4084
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4130
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _103 => _103.switchChain])) return void 0;
|
|
4085
4131
|
return async (chainId) => {
|
|
4086
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
4132
|
+
await _optionalChain([dappWalletClient, 'access', _104 => _104.switchChain, 'optionalCall', _105 => _105({ id: chainId })]);
|
|
4087
4133
|
};
|
|
4088
4134
|
}, [dappWalletClient]);
|
|
4089
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4135
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _106 => _106.account, 'optionalAccess', _107 => _107.address]), () => ( null));
|
|
4090
4136
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
4091
4137
|
const options = [];
|
|
4092
4138
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -4100,7 +4146,7 @@ function DepositFlow({
|
|
|
4100
4146
|
});
|
|
4101
4147
|
seen.add(id);
|
|
4102
4148
|
}
|
|
4103
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
4149
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _108 => _108.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
4104
4150
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
4105
4151
|
if (!seen.has(id)) {
|
|
4106
4152
|
options.push({
|
|
@@ -4112,7 +4158,7 @@ function DepositFlow({
|
|
|
4112
4158
|
});
|
|
4113
4159
|
seen.add(id);
|
|
4114
4160
|
}
|
|
4115
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4161
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _109 => _109.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
4116
4162
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
4117
4163
|
if (!seen.has(id)) {
|
|
4118
4164
|
options.push({
|
|
@@ -4129,20 +4175,20 @@ function DepositFlow({
|
|
|
4129
4175
|
}, [
|
|
4130
4176
|
connectedWalletAddress,
|
|
4131
4177
|
dappAddress,
|
|
4132
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4133
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4134
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4135
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4136
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4178
|
+
_optionalChain([reownWallet, 'optionalAccess', _110 => _110.address]),
|
|
4179
|
+
_optionalChain([reownWallet, 'optionalAccess', _111 => _111.isConnected]),
|
|
4180
|
+
_optionalChain([reownWallet, 'optionalAccess', _112 => _112.walletClient]),
|
|
4181
|
+
_optionalChain([reownWallet, 'optionalAccess', _113 => _113.publicClient]),
|
|
4182
|
+
_optionalChain([reownWallet, 'optionalAccess', _114 => _114.icon]),
|
|
4137
4183
|
enableSolana,
|
|
4138
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4139
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4140
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4184
|
+
_optionalChain([reownWallet, 'optionalAccess', _115 => _115.isSolana]),
|
|
4185
|
+
_optionalChain([reownWallet, 'optionalAccess', _116 => _116.solanaAddress]),
|
|
4186
|
+
_optionalChain([reownWallet, 'optionalAccess', _117 => _117.caipAddress])
|
|
4141
4187
|
]);
|
|
4142
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4188
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _118 => _118.account]) && dappAddress && !reownWallet;
|
|
4143
4189
|
const hasWalletOptions = walletOptions.length > 0;
|
|
4144
4190
|
const hasReownSession = Boolean(
|
|
4145
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4191
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _119 => _119.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _120 => _120.address]) : _optionalChain([reownWallet, 'optionalAccess', _121 => _121.address])
|
|
4146
4192
|
);
|
|
4147
4193
|
const isWalletHydrationPending = Boolean(
|
|
4148
4194
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -4187,7 +4233,7 @@ function DepositFlow({
|
|
|
4187
4233
|
};
|
|
4188
4234
|
}
|
|
4189
4235
|
if (canAutoLock) {
|
|
4190
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4236
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _122 => _122.chain, 'optionalAccess', _123 => _123.id]), () => ( targetChain));
|
|
4191
4237
|
return {
|
|
4192
4238
|
ownerAddress: dappWalletClient.account.address,
|
|
4193
4239
|
walletClient: dappWalletClient,
|
|
@@ -4209,8 +4255,8 @@ function DepositFlow({
|
|
|
4209
4255
|
switchChain: void 0
|
|
4210
4256
|
};
|
|
4211
4257
|
}
|
|
4212
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4213
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4258
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _124 => _124.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4259
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _125 => _125.chain, 'optionalAccess', _126 => _126.id]), () => ( targetChain));
|
|
4214
4260
|
return {
|
|
4215
4261
|
ownerAddress: dappWalletClient.account.address,
|
|
4216
4262
|
walletClient: dappWalletClient,
|
|
@@ -4218,7 +4264,7 @@ function DepositFlow({
|
|
|
4218
4264
|
switchChain: dappSwitchChain
|
|
4219
4265
|
};
|
|
4220
4266
|
}
|
|
4221
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
4267
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _127 => _127.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4222
4268
|
return {
|
|
4223
4269
|
ownerAddress: reownWallet.address,
|
|
4224
4270
|
walletClient: reownWallet.walletClient,
|
|
@@ -4285,37 +4331,37 @@ function DepositFlow({
|
|
|
4285
4331
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
4286
4332
|
if (!selectedWalletId) return null;
|
|
4287
4333
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
4288
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4334
|
+
if (_optionalChain([opt, 'optionalAccess', _128 => _128.kind]) === "external" && opt.address) {
|
|
4289
4335
|
return opt.address;
|
|
4290
4336
|
}
|
|
4291
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4337
|
+
if (_optionalChain([opt, 'optionalAccess', _129 => _129.kind]) === "connected" && opt.address) {
|
|
4292
4338
|
return opt.address;
|
|
4293
4339
|
}
|
|
4294
4340
|
return null;
|
|
4295
4341
|
}, [selectedWalletId, walletOptions]);
|
|
4296
4342
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
4297
4343
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
4298
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4344
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _130 => _130.address]) && reownWallet.isConnected) {
|
|
4299
4345
|
return reownWallet.address;
|
|
4300
4346
|
}
|
|
4301
4347
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
4302
4348
|
return null;
|
|
4303
4349
|
}, [
|
|
4304
4350
|
selectedEvmWalletOwner,
|
|
4305
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4306
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4351
|
+
_optionalChain([reownWallet, 'optionalAccess', _131 => _131.address]),
|
|
4352
|
+
_optionalChain([reownWallet, 'optionalAccess', _132 => _132.isConnected]),
|
|
4307
4353
|
connectedWalletAddress
|
|
4308
4354
|
]);
|
|
4309
4355
|
const activeOwner = _react.useMemo.call(void 0,
|
|
4310
4356
|
() => resolveOwnerForMode(flowMode, {
|
|
4311
4357
|
dappAddress,
|
|
4312
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
4358
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _133 => _133.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
4313
4359
|
dappImportOwner
|
|
4314
4360
|
}),
|
|
4315
4361
|
[
|
|
4316
4362
|
flowMode,
|
|
4317
4363
|
dappAddress,
|
|
4318
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
4364
|
+
_optionalChain([signerContext, 'optionalAccess', _134 => _134.ownerAddress]),
|
|
4319
4365
|
canAutoLock,
|
|
4320
4366
|
connectedWalletAddress,
|
|
4321
4367
|
selectedEvmWalletOwner,
|
|
@@ -4344,12 +4390,12 @@ function DepositFlow({
|
|
|
4344
4390
|
return;
|
|
4345
4391
|
}
|
|
4346
4392
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
4347
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4393
|
+
_optionalChain([onLifecycleRef, 'access', _135 => _135.current, 'optionalCall', _136 => _136({
|
|
4348
4394
|
type: "smart-account-changed",
|
|
4349
4395
|
evm: activeEntry.smartAccount,
|
|
4350
4396
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
4351
4397
|
})]);
|
|
4352
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4398
|
+
_optionalChain([onLifecycleRef, 'access', _137 => _137.current, 'optionalCall', _138 => _138({
|
|
4353
4399
|
type: "connected",
|
|
4354
4400
|
address: activeOwner,
|
|
4355
4401
|
smartAccount: activeEntry.smartAccount
|
|
@@ -4382,7 +4428,7 @@ function DepositFlow({
|
|
|
4382
4428
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
4383
4429
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
4384
4430
|
_react.useEffect.call(void 0, () => {
|
|
4385
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
4431
|
+
_optionalChain([onStepChangeRef, 'access', _139 => _139.current, 'optionalCall', _140 => _140(currentBackHandler, currentScreen)]);
|
|
4386
4432
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
4387
4433
|
const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
|
|
4388
4434
|
const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
@@ -4397,7 +4443,7 @@ function DepositFlow({
|
|
|
4397
4443
|
}
|
|
4398
4444
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
4399
4445
|
if (effectiveStep.type === "select-asset") {
|
|
4400
|
-
_optionalChain([onEventRef, 'access',
|
|
4446
|
+
_optionalChain([onEventRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142({
|
|
4401
4447
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
4402
4448
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
4403
4449
|
pred_balance: totalBalanceUsd
|
|
@@ -4405,7 +4451,7 @@ function DepositFlow({
|
|
|
4405
4451
|
} else if (effectiveStep.type === "deposit-address") {
|
|
4406
4452
|
const chainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
4407
4453
|
const tokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4408
|
-
_optionalChain([onEventRef, 'access',
|
|
4454
|
+
_optionalChain([onEventRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144({
|
|
4409
4455
|
type: "deposit_modal_transfer_crypto_open",
|
|
4410
4456
|
default_chain: chainName,
|
|
4411
4457
|
default_token: tokenSymbol,
|
|
@@ -4413,7 +4459,7 @@ function DepositFlow({
|
|
|
4413
4459
|
})]);
|
|
4414
4460
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
4415
4461
|
const receiveSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4416
|
-
_optionalChain([onEventRef, 'access',
|
|
4462
|
+
_optionalChain([onEventRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146({
|
|
4417
4463
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
4418
4464
|
send_token: stepSendToken,
|
|
4419
4465
|
receive_token: receiveSymbol,
|
|
@@ -4446,7 +4492,7 @@ function DepositFlow({
|
|
|
4446
4492
|
targetToken
|
|
4447
4493
|
]);
|
|
4448
4494
|
_react.useEffect.call(void 0, () => {
|
|
4449
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4495
|
+
_optionalChain([onLifecycleRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148({
|
|
4450
4496
|
type: "balance-changed",
|
|
4451
4497
|
totalUsd: totalBalanceUsd
|
|
4452
4498
|
})]);
|
|
@@ -4460,7 +4506,7 @@ function DepositFlow({
|
|
|
4460
4506
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
4461
4507
|
(walletId) => {
|
|
4462
4508
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
4463
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
4509
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _149 => _149.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
4464
4510
|
storeApi.dispatch({
|
|
4465
4511
|
type: "connect/wallet-confirmed",
|
|
4466
4512
|
walletId,
|
|
@@ -4478,7 +4524,7 @@ function DepositFlow({
|
|
|
4478
4524
|
const owner = dappImportOwner;
|
|
4479
4525
|
if (owner) {
|
|
4480
4526
|
const wallet = walletOptions.find(
|
|
4481
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
4527
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _150 => _150.toLowerCase, 'call', _151 => _151()]) === owner.toLowerCase()
|
|
4482
4528
|
);
|
|
4483
4529
|
if (wallet) {
|
|
4484
4530
|
storeApi.dispatch({
|
|
@@ -4551,7 +4597,7 @@ function DepositFlow({
|
|
|
4551
4597
|
);
|
|
4552
4598
|
const connectStepDappImports = _react.useMemo.call(void 0,
|
|
4553
4599
|
() => enabledDappImportProviders.map((provider) => {
|
|
4554
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
4600
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _152 => _152.toLowerCase, 'call', _153 => _153()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
|
|
4555
4601
|
const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
|
|
4556
4602
|
const baseRow = {
|
|
4557
4603
|
id: provider.id,
|
|
@@ -4604,7 +4650,7 @@ function DepositFlow({
|
|
|
4604
4650
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
4605
4651
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
4606
4652
|
if (!activeDappImportProviderId) return null;
|
|
4607
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
4653
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _154 => _154.toLowerCase, 'call', _155 => _155()]) !== dappImportOwner.toLowerCase()) {
|
|
4608
4654
|
return null;
|
|
4609
4655
|
}
|
|
4610
4656
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -4617,7 +4663,7 @@ function DepositFlow({
|
|
|
4617
4663
|
dappImportOwner
|
|
4618
4664
|
]);
|
|
4619
4665
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
4620
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4666
|
+
_optionalChain([onLifecycleRef, 'access', _156 => _156.current, 'optionalCall', _157 => _157({
|
|
4621
4667
|
type: "smart-account-changed",
|
|
4622
4668
|
evm: null,
|
|
4623
4669
|
solana: null
|
|
@@ -4665,13 +4711,13 @@ function DepositFlow({
|
|
|
4665
4711
|
};
|
|
4666
4712
|
push(dappAddress);
|
|
4667
4713
|
push(connectedWalletAddress);
|
|
4668
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
4714
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _158 => _158.address]));
|
|
4669
4715
|
push(dappImportOwner);
|
|
4670
4716
|
return owners;
|
|
4671
4717
|
}, [
|
|
4672
4718
|
dappAddress,
|
|
4673
4719
|
connectedWalletAddress,
|
|
4674
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4720
|
+
_optionalChain([reownWallet, 'optionalAccess', _159 => _159.address]),
|
|
4675
4721
|
dappImportOwner
|
|
4676
4722
|
]);
|
|
4677
4723
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4704,6 +4750,28 @@ function DepositFlow({
|
|
|
4704
4750
|
if (current.requestKey === requestKey) {
|
|
4705
4751
|
return;
|
|
4706
4752
|
}
|
|
4753
|
+
const dedupedResult = readDedupedAccountSetupResult(requestKey);
|
|
4754
|
+
if (dedupedResult) {
|
|
4755
|
+
storeApi.dispatch({
|
|
4756
|
+
type: "setup/started",
|
|
4757
|
+
owner,
|
|
4758
|
+
requestKey,
|
|
4759
|
+
cacheKey,
|
|
4760
|
+
cacheable
|
|
4761
|
+
});
|
|
4762
|
+
storeApi.dispatch({
|
|
4763
|
+
type: "setup/ready",
|
|
4764
|
+
owner,
|
|
4765
|
+
requestKey,
|
|
4766
|
+
result: {
|
|
4767
|
+
smartAccount: dedupedResult.smartAccount,
|
|
4768
|
+
sessionOwnerAddress: dedupedResult.sessionOwnerAddress,
|
|
4769
|
+
solanaDepositAddress: dedupedResult.solanaDepositAddress,
|
|
4770
|
+
cacheKey: dedupedResult.cacheKey
|
|
4771
|
+
}
|
|
4772
|
+
});
|
|
4773
|
+
return;
|
|
4774
|
+
}
|
|
4707
4775
|
storeApi.dispatch({
|
|
4708
4776
|
type: "setup/started",
|
|
4709
4777
|
owner,
|
|
@@ -4712,7 +4780,11 @@ function DepositFlow({
|
|
|
4712
4780
|
cacheable
|
|
4713
4781
|
});
|
|
4714
4782
|
try {
|
|
4715
|
-
const result = await
|
|
4783
|
+
const result = await runAccountSetupDeduped(
|
|
4784
|
+
input,
|
|
4785
|
+
{ service, debug },
|
|
4786
|
+
requestKey
|
|
4787
|
+
);
|
|
4716
4788
|
storeApi.dispatch({
|
|
4717
4789
|
type: "setup/ready",
|
|
4718
4790
|
owner,
|
|
@@ -4750,7 +4822,7 @@ function DepositFlow({
|
|
|
4750
4822
|
sourceChain: data.sourceChain,
|
|
4751
4823
|
amount: data.amount
|
|
4752
4824
|
});
|
|
4753
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4825
|
+
_optionalChain([onLifecycleRef, 'access', _160 => _160.current, 'optionalCall', _161 => _161({ type: "submitted", ...data })]);
|
|
4754
4826
|
},
|
|
4755
4827
|
[logFlow, onLifecycleRef]
|
|
4756
4828
|
);
|
|
@@ -4807,7 +4879,7 @@ function DepositFlow({
|
|
|
4807
4879
|
sourceSymbol: tokenAtSubmit.symbol,
|
|
4808
4880
|
sourceDecimals: tokenAtSubmit.decimals
|
|
4809
4881
|
});
|
|
4810
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4882
|
+
_optionalChain([onLifecycleRef, 'access', _162 => _162.current, 'optionalCall', _163 => _163({
|
|
4811
4883
|
type: "submitted",
|
|
4812
4884
|
txHash,
|
|
4813
4885
|
sourceChain: "solana",
|
|
@@ -4818,7 +4890,7 @@ function DepositFlow({
|
|
|
4818
4890
|
);
|
|
4819
4891
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
4820
4892
|
(asset) => {
|
|
4821
|
-
_optionalChain([onEventRef, 'access',
|
|
4893
|
+
_optionalChain([onEventRef, 'access', _164 => _164.current, 'optionalCall', _165 => _165({
|
|
4822
4894
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
4823
4895
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
4824
4896
|
pred_balance: totalBalanceUsd,
|
|
@@ -4871,8 +4943,8 @@ function DepositFlow({
|
|
|
4871
4943
|
sourceChain: chainId,
|
|
4872
4944
|
sourceToken: token,
|
|
4873
4945
|
amount,
|
|
4874
|
-
sourceSymbol: _optionalChain([dappImport, 'optionalAccess',
|
|
4875
|
-
sourceDecimals: _optionalChain([dappImport, 'optionalAccess',
|
|
4946
|
+
sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _166 => _166.symbol]),
|
|
4947
|
+
sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _167 => _167.decimals]),
|
|
4876
4948
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
4877
4949
|
});
|
|
4878
4950
|
},
|
|
@@ -4880,7 +4952,7 @@ function DepositFlow({
|
|
|
4880
4952
|
);
|
|
4881
4953
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
4882
4954
|
(txHash, sourceChain, amount) => {
|
|
4883
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4955
|
+
_optionalChain([onLifecycleRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({
|
|
4884
4956
|
type: "submitted",
|
|
4885
4957
|
txHash,
|
|
4886
4958
|
sourceChain,
|
|
@@ -4892,7 +4964,7 @@ function DepositFlow({
|
|
|
4892
4964
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
4893
4965
|
(txHash, destinationTxHash, context) => {
|
|
4894
4966
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
4895
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4967
|
+
_optionalChain([onLifecycleRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
|
|
4896
4968
|
type: "complete",
|
|
4897
4969
|
txHash,
|
|
4898
4970
|
destinationTxHash,
|
|
@@ -4904,14 +4976,14 @@ function DepositFlow({
|
|
|
4904
4976
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
4905
4977
|
(txHash, error) => {
|
|
4906
4978
|
logFlowError("deposit:failed", error, { txHash });
|
|
4907
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4979
|
+
_optionalChain([onLifecycleRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173({ type: "failed", txHash, error })]);
|
|
4908
4980
|
},
|
|
4909
4981
|
[logFlowError, onLifecycleRef]
|
|
4910
4982
|
);
|
|
4911
4983
|
const handleError = _react.useCallback.call(void 0,
|
|
4912
4984
|
(message, code) => {
|
|
4913
4985
|
logFlowError("flow:error", message, { code });
|
|
4914
|
-
_optionalChain([onErrorRef, 'access',
|
|
4986
|
+
_optionalChain([onErrorRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175({ message, code })]);
|
|
4915
4987
|
},
|
|
4916
4988
|
[logFlowError, onErrorRef]
|
|
4917
4989
|
);
|
|
@@ -5066,7 +5138,7 @@ function DepositFlow({
|
|
|
5066
5138
|
targetChain,
|
|
5067
5139
|
targetToken,
|
|
5068
5140
|
waitForFinalTx,
|
|
5069
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5141
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _176 => _176.length])),
|
|
5070
5142
|
uiConfig,
|
|
5071
5143
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
5072
5144
|
onDepositComplete: handleDepositComplete,
|
|
@@ -5074,7 +5146,7 @@ function DepositFlow({
|
|
|
5074
5146
|
onCopyAddress: () => {
|
|
5075
5147
|
const chainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
5076
5148
|
const tokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5077
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5149
|
+
_optionalChain([onEvent, 'optionalCall', _177 => _177({
|
|
5078
5150
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
5079
5151
|
default_chain: chainName,
|
|
5080
5152
|
default_token: tokenSymbol,
|
|
@@ -5093,8 +5165,8 @@ function DepositFlow({
|
|
|
5093
5165
|
}
|
|
5094
5166
|
if (isSolanaWalletMode) {
|
|
5095
5167
|
if (!dappAddress) return null;
|
|
5096
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
5097
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
5168
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _178 => _178.solanaAddress]);
|
|
5169
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _179 => _179.solanaProvider]);
|
|
5098
5170
|
const solanaShowBanner = effectiveStep.type !== "setup" && effectiveStep.type !== "processing" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5099
5171
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5100
5172
|
solanaShowBanner && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -5205,7 +5277,7 @@ function DepositFlow({
|
|
|
5205
5277
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5206
5278
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5207
5279
|
waitForFinalTx,
|
|
5208
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5280
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _180 => _180.length])),
|
|
5209
5281
|
service,
|
|
5210
5282
|
directTransfer: effectiveStep.directTransfer,
|
|
5211
5283
|
onClose,
|
|
@@ -5218,13 +5290,13 @@ function DepositFlow({
|
|
|
5218
5290
|
)
|
|
5219
5291
|
] });
|
|
5220
5292
|
}
|
|
5221
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
5293
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _181 => _181.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _182 => _182.publicClient])) {
|
|
5222
5294
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet..." }) }) }) }) });
|
|
5223
5295
|
}
|
|
5224
5296
|
const ownerAddress = signerContext.ownerAddress;
|
|
5225
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
5297
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _183 => _183.walletClient, 'optionalAccess', _184 => _184.chain, 'optionalAccess', _185 => _185.id]), () => ( _optionalChain([signerContext, 'access', _186 => _186.publicClient, 'access', _187 => _187.chain, 'optionalAccess', _188 => _188.id]))), () => ( targetChain));
|
|
5226
5298
|
const getReadClientForChain = (chainId) => {
|
|
5227
|
-
if (_optionalChain([signerContext, 'access',
|
|
5299
|
+
if (_optionalChain([signerContext, 'access', _189 => _189.publicClient, 'access', _190 => _190.chain, 'optionalAccess', _191 => _191.id]) === chainId) {
|
|
5228
5300
|
return signerContext.publicClient;
|
|
5229
5301
|
}
|
|
5230
5302
|
return _chunkV6NJIPSScjs.getPublicClient.call(void 0, chainId);
|
|
@@ -5266,7 +5338,7 @@ function DepositFlow({
|
|
|
5266
5338
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5267
5339
|
DappImportAssetSelectStep,
|
|
5268
5340
|
{
|
|
5269
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
5341
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _192 => _192.assets, 'access', _193 => _193[0], 'optionalAccess', _194 => _194.sourceLabel]), () => ( activeDappImportProvider.label)),
|
|
5270
5342
|
assets: activeDappImportAvailability.assets,
|
|
5271
5343
|
onSelect: handleDappImportAssetSelected
|
|
5272
5344
|
}
|
|
@@ -5292,7 +5364,7 @@ function DepositFlow({
|
|
|
5292
5364
|
onContinue: handleAmountContinue,
|
|
5293
5365
|
onCtaClick: (ctaName) => {
|
|
5294
5366
|
const receiveSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5295
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5367
|
+
_optionalChain([onEvent, 'optionalCall', _195 => _195({
|
|
5296
5368
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
5297
5369
|
send_token: effectiveStep.asset.symbol,
|
|
5298
5370
|
receive_token: receiveSymbol,
|
|
@@ -5355,7 +5427,7 @@ function DepositFlow({
|
|
|
5355
5427
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5356
5428
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5357
5429
|
waitForFinalTx,
|
|
5358
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5430
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _196 => _196.length])),
|
|
5359
5431
|
service,
|
|
5360
5432
|
directTransfer: effectiveStep.directTransfer,
|
|
5361
5433
|
uiConfig,
|
|
@@ -5651,7 +5723,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
5651
5723
|
// src/DepositModal.tsx
|
|
5652
5724
|
|
|
5653
5725
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
5654
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
5726
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-XV4BEUHT.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
5655
5727
|
);
|
|
5656
5728
|
function sortByCreatedAtDesc(items) {
|
|
5657
5729
|
return [...items].sort((a, b) => {
|
|
@@ -5730,7 +5802,7 @@ function DepositModalInner({
|
|
|
5730
5802
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
5731
5803
|
void 0
|
|
5732
5804
|
);
|
|
5733
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
5805
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _197 => _197.showHistoryButton]), () => ( false));
|
|
5734
5806
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
5735
5807
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
5736
5808
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -5768,7 +5840,7 @@ function DepositModalInner({
|
|
|
5768
5840
|
}, [solanaRpcUrl]);
|
|
5769
5841
|
_react.useEffect.call(void 0, () => {
|
|
5770
5842
|
if (isOpen) {
|
|
5771
|
-
_optionalChain([onReadyRef, 'access',
|
|
5843
|
+
_optionalChain([onReadyRef, 'access', _198 => _198.current, 'optionalCall', _199 => _199()]);
|
|
5772
5844
|
}
|
|
5773
5845
|
}, [isOpen, onReadyRef]);
|
|
5774
5846
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -5847,7 +5919,7 @@ function DepositModalInner({
|
|
|
5847
5919
|
const onLifecycleRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onLifecycle);
|
|
5848
5920
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
5849
5921
|
(event) => {
|
|
5850
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5922
|
+
_optionalChain([onLifecycleRef, 'access', _200 => _200.current, 'optionalCall', _201 => _201(event)]);
|
|
5851
5923
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
5852
5924
|
historyStaleRef.current = true;
|
|
5853
5925
|
}
|
|
@@ -5873,7 +5945,7 @@ function DepositModalInner({
|
|
|
5873
5945
|
store.dispatch({ type: "flow/reset" });
|
|
5874
5946
|
}
|
|
5875
5947
|
}, [isOpen, store]);
|
|
5876
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
5948
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _202 => _202.showBackButton]), () => ( true));
|
|
5877
5949
|
const canGoBack = backHandler !== void 0;
|
|
5878
5950
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5879
5951
|
_chunkV6NJIPSScjs.Modal,
|
package/dist/deposit.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNSI4BCBVcjs = require('./chunk-NSI4BCBV.cjs');
|
|
4
4
|
require('./chunk-V6NJIPSS.cjs');
|
|
5
5
|
require('./chunk-IVTXEYB2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunkNSI4BCBVcjs.DepositModal;
|
package/dist/deposit.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNSI4BCBVcjs = require('./chunk-NSI4BCBV.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkUEYFJM5Ycjs = require('./chunk-UEYFJM5Y.cjs');
|
|
@@ -70,4 +70,4 @@ var _chunkIVTXEYB2cjs = require('./chunk-IVTXEYB2.cjs');
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
exports.CHAIN_BY_ID = _chunkIVTXEYB2cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal =
|
|
73
|
+
exports.CHAIN_BY_ID = _chunkIVTXEYB2cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkNSI4BCBVcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkIVTXEYB2cjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkIVTXEYB2cjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkUEYFJM5Ycjs.WithdrawModal; exports.chainRegistry = _chunkIVTXEYB2cjs.chainRegistry; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet; exports.findChainIdForToken = _chunkIVTXEYB2cjs.findChainIdForToken; exports.getChainBadge = _chunkIVTXEYB2cjs.getChainBadge; exports.getChainIcon = _chunkIVTXEYB2cjs.getChainIcon; exports.getChainId = _chunkIVTXEYB2cjs.getChainId; exports.getChainName = _chunkIVTXEYB2cjs.getChainName; exports.getChainObject = _chunkIVTXEYB2cjs.getChainObject; exports.getExplorerName = _chunkIVTXEYB2cjs.getExplorerName; exports.getExplorerTxUrl = _chunkIVTXEYB2cjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkIVTXEYB2cjs.getExplorerUrl; exports.getSupportedChainIds = _chunkIVTXEYB2cjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkIVTXEYB2cjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkIVTXEYB2cjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkIVTXEYB2cjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkIVTXEYB2cjs.getTokenAddress; exports.getTokenDecimals = _chunkIVTXEYB2cjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon; exports.getTokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol; exports.getUsdcAddress = _chunkIVTXEYB2cjs.getUsdcAddress; exports.getUsdcDecimals = _chunkIVTXEYB2cjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkIVTXEYB2cjs.isSupportedTokenAddressForChain;
|
package/dist/index.mjs
CHANGED