@trustware/sdk-staging 1.1.11-staging.2 → 1.1.12-staging.2
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/{blockchain-BxAFzp0s.d.cts → blockchain-DmCPxnxr.d.cts} +25 -1
- package/dist/{blockchain-BxAFzp0s.d.ts → blockchain-DmCPxnxr.d.ts} +25 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{core-B1WCJfDI.d.ts → core-B4YDGtJT.d.ts} +3 -3
- package/dist/{core-CeNTuqPz.d.cts → core-Ck7dinYj.d.cts} +3 -3
- package/dist/core.cjs +57 -10
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +4 -4
- package/dist/core.d.ts +4 -4
- package/dist/core.mjs +57 -10
- package/dist/core.mjs.map +1 -1
- package/dist/index.cjs +124 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.mjs +124 -29
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-DNGk1YkR.d.cts → manager-BZ8gyHGT.d.cts} +1 -1
- package/dist/{manager-Bw8b1wSD.d.ts → manager-D8nQsod2.d.ts} +1 -1
- package/dist/{metadata-Dk4R8_-T.d.cts → metadata-B23D0oO9.d.cts} +1 -1
- package/dist/{metadata-C__KMeuz.d.ts → metadata-BOjEF7oo.d.ts} +1 -1
- package/dist/smart-account.cjs +26 -5
- package/dist/smart-account.cjs.map +1 -1
- package/dist/smart-account.d.cts +1 -0
- package/dist/smart-account.d.ts +1 -0
- package/dist/smart-account.mjs +26 -5
- package/dist/smart-account.mjs.map +1 -1
- package/dist/{types-BJY9r-mz.d.ts → types-CMmx0S4U.d.ts} +1 -1
- package/dist/{types-DX3HtFcn.d.cts → types-DEUb5IZA.d.cts} +1 -1
- package/dist/wallet.cjs +12 -2
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +4 -4
- package/dist/wallet.d.ts +4 -4
- package/dist/wallet.mjs +12 -2
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +124 -29
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.d.cts +2 -2
- package/dist/widget.d.ts +2 -2
- package/dist/widget.mjs +124 -29
- package/dist/widget.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { T as Trustware } from './core-
|
|
2
|
-
export { a as TrustwareCore, v as validateAddressForChain, b as validateBtcAddress, c as validateCosmosAddress, d as validateEvmAddress, e as validateRouteAddresses, f as validateSeiAddress, g as validateSolanaAddress } from './core-
|
|
3
|
-
import { R as RateLimitInfo, T as TrustwareConfigOptions, i as WalletInterFaceAPI, j as TrustwareError, k as Transaction, l as TrustwareEvent } from './manager-
|
|
4
|
-
export { B as BuildRouteBody, m as BuildRouteResponse, n as BuildRouteResult, o as DEFAULT_AUTO_DETECT_PROVIDER, p as DEFAULT_FEATURE_FLAGS, q as DEFAULT_MESSAGES, r as DEFAULT_RETRY_CONFIG, s as DEFAULT_SLIPPAGE, D as DetectedWallet, E as EIP1193, t as EIP6963ProviderDetail, v as EvmWalletInterface, F as FeatureFlags, I as IdentityStore, P as PostHookRequest, x as RATE_LIMIT_WAIT_BUDGET_MS, y as ResolvedFeatureFlags, z as ResolvedRetryConfig, A as ResolvedTrustwareConfig, C as ResolvedWalletConnectConfig, G as RetryConfig, H as RouteApproval, J as RouteEstimate, K as RouteIntent, L as RouteParams, M as RoutePlan, N as RouteSponsorship, O as RoutesConfig, Q as SimpleWalletInterface, S as SolanaProviderLike, b as SolanaWalletInterface, U as SponsorshipApproval, V as SwapTokenRef, X as TrustwareTheme, Y as TrustwareWidgetMessages, c as WagmiBridge, d as WagmiConnector, Z as WalletAddressResolution, _ as WalletAddressSource, $ as WalletCategory, a0 as WalletConnectConfig, a1 as WalletEcosystem, a as WalletId, a2 as WalletIdentity, a3 as WalletIdentityAddress, a4 as WalletIdentityChainLike, W as WalletMeta, a5 as assertValidPostHook, a6 as buildWalletIdentityAddress, a7 as createWalletIdentity, a8 as resolveWalletAddressForChain, a9 as upsertWalletIdentityAddress, f as useWalletExternalDisconnect, g as useWalletInfo, h as useWireDetectionIntoManager, w as walletManager } from './manager-
|
|
1
|
+
import { T as Trustware } from './core-Ck7dinYj.cjs';
|
|
2
|
+
export { a as TrustwareCore, v as validateAddressForChain, b as validateBtcAddress, c as validateCosmosAddress, d as validateEvmAddress, e as validateRouteAddresses, f as validateSeiAddress, g as validateSolanaAddress } from './core-Ck7dinYj.cjs';
|
|
3
|
+
import { R as RateLimitInfo, T as TrustwareConfigOptions, i as WalletInterFaceAPI, j as TrustwareError, k as Transaction, l as TrustwareEvent } from './manager-BZ8gyHGT.cjs';
|
|
4
|
+
export { B as BuildRouteBody, m as BuildRouteResponse, n as BuildRouteResult, o as DEFAULT_AUTO_DETECT_PROVIDER, p as DEFAULT_FEATURE_FLAGS, q as DEFAULT_MESSAGES, r as DEFAULT_RETRY_CONFIG, s as DEFAULT_SLIPPAGE, D as DetectedWallet, E as EIP1193, t as EIP6963ProviderDetail, v as EvmWalletInterface, F as FeatureFlags, I as IdentityStore, P as PostHookRequest, x as RATE_LIMIT_WAIT_BUDGET_MS, y as ResolvedFeatureFlags, z as ResolvedRetryConfig, A as ResolvedTrustwareConfig, C as ResolvedWalletConnectConfig, G as RetryConfig, H as RouteApproval, J as RouteEstimate, K as RouteIntent, L as RouteParams, M as RoutePlan, N as RouteSponsorship, O as RoutesConfig, Q as SimpleWalletInterface, S as SolanaProviderLike, b as SolanaWalletInterface, U as SponsorshipApproval, V as SwapTokenRef, X as TrustwareTheme, Y as TrustwareWidgetMessages, c as WagmiBridge, d as WagmiConnector, Z as WalletAddressResolution, _ as WalletAddressSource, $ as WalletCategory, a0 as WalletConnectConfig, a1 as WalletEcosystem, a as WalletId, a2 as WalletIdentity, a3 as WalletIdentityAddress, a4 as WalletIdentityChainLike, W as WalletMeta, a5 as assertValidPostHook, a6 as buildWalletIdentityAddress, a7 as createWalletIdentity, a8 as resolveWalletAddressForChain, a9 as upsertWalletIdentityAddress, f as useWalletExternalDisconnect, g as useWalletInfo, h as useWireDetectionIntoManager, w as walletManager } from './manager-BZ8gyHGT.cjs';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default from 'react';
|
|
7
|
-
import { C as ChainDef } from './blockchain-
|
|
8
|
-
export { B as BalanceRow, a as BalanceStreamOptions, b as
|
|
9
|
-
import { T as Token, Y as YourTokenData } from './types-
|
|
10
|
-
export { P as POPULAR_ORDER, W as WALLETS, c as connectDetectedWallet, t as toWalletInterfaceFromDetected, u as useEIP1193, f as useWagmi, g as useWalletDetection } from './metadata-
|
|
7
|
+
import { C as ChainDef } from './blockchain-DmCPxnxr.cjs';
|
|
8
|
+
export { B as BalanceRow, a as BalanceStreamOptions, b as BalanceStreamSummary, c as ChainMeta, d as ChainType, G as GetBalancesOptions, N as NativeCurrency, T as TokenDef, e as TokenMeta, f as TokenPageInfo, g as TokenPageOptions, h as TokenPageResult, i as TokenType, j as TokenWithBalance, W as WalletAddressBalanceWrapper } from './blockchain-DmCPxnxr.cjs';
|
|
9
|
+
import { T as Token, Y as YourTokenData } from './types-DEUb5IZA.cjs';
|
|
10
|
+
export { P as POPULAR_ORDER, W as WALLETS, c as connectDetectedWallet, t as toWalletInterfaceFromDetected, u as useEIP1193, f as useWagmi, g as useWalletDetection } from './metadata-B23D0oO9.cjs';
|
|
11
11
|
export { TrustwareWidget } from './widget.cjs';
|
|
12
12
|
export { API_PREFIX, API_ROOT, ASSETS_BASE_URL, GTM_ID, SDK_NAME, SDK_VERSION, WALLETCONNECT_PROJECT_ID } from './constants.cjs';
|
|
13
13
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { T as Trustware } from './core-
|
|
2
|
-
export { a as TrustwareCore, v as validateAddressForChain, b as validateBtcAddress, c as validateCosmosAddress, d as validateEvmAddress, e as validateRouteAddresses, f as validateSeiAddress, g as validateSolanaAddress } from './core-
|
|
3
|
-
import { R as RateLimitInfo, T as TrustwareConfigOptions, i as WalletInterFaceAPI, j as TrustwareError, k as Transaction, l as TrustwareEvent } from './manager-
|
|
4
|
-
export { B as BuildRouteBody, m as BuildRouteResponse, n as BuildRouteResult, o as DEFAULT_AUTO_DETECT_PROVIDER, p as DEFAULT_FEATURE_FLAGS, q as DEFAULT_MESSAGES, r as DEFAULT_RETRY_CONFIG, s as DEFAULT_SLIPPAGE, D as DetectedWallet, E as EIP1193, t as EIP6963ProviderDetail, v as EvmWalletInterface, F as FeatureFlags, I as IdentityStore, P as PostHookRequest, x as RATE_LIMIT_WAIT_BUDGET_MS, y as ResolvedFeatureFlags, z as ResolvedRetryConfig, A as ResolvedTrustwareConfig, C as ResolvedWalletConnectConfig, G as RetryConfig, H as RouteApproval, J as RouteEstimate, K as RouteIntent, L as RouteParams, M as RoutePlan, N as RouteSponsorship, O as RoutesConfig, Q as SimpleWalletInterface, S as SolanaProviderLike, b as SolanaWalletInterface, U as SponsorshipApproval, V as SwapTokenRef, X as TrustwareTheme, Y as TrustwareWidgetMessages, c as WagmiBridge, d as WagmiConnector, Z as WalletAddressResolution, _ as WalletAddressSource, $ as WalletCategory, a0 as WalletConnectConfig, a1 as WalletEcosystem, a as WalletId, a2 as WalletIdentity, a3 as WalletIdentityAddress, a4 as WalletIdentityChainLike, W as WalletMeta, a5 as assertValidPostHook, a6 as buildWalletIdentityAddress, a7 as createWalletIdentity, a8 as resolveWalletAddressForChain, a9 as upsertWalletIdentityAddress, f as useWalletExternalDisconnect, g as useWalletInfo, h as useWireDetectionIntoManager, w as walletManager } from './manager-
|
|
1
|
+
import { T as Trustware } from './core-B4YDGtJT.js';
|
|
2
|
+
export { a as TrustwareCore, v as validateAddressForChain, b as validateBtcAddress, c as validateCosmosAddress, d as validateEvmAddress, e as validateRouteAddresses, f as validateSeiAddress, g as validateSolanaAddress } from './core-B4YDGtJT.js';
|
|
3
|
+
import { R as RateLimitInfo, T as TrustwareConfigOptions, i as WalletInterFaceAPI, j as TrustwareError, k as Transaction, l as TrustwareEvent } from './manager-D8nQsod2.js';
|
|
4
|
+
export { B as BuildRouteBody, m as BuildRouteResponse, n as BuildRouteResult, o as DEFAULT_AUTO_DETECT_PROVIDER, p as DEFAULT_FEATURE_FLAGS, q as DEFAULT_MESSAGES, r as DEFAULT_RETRY_CONFIG, s as DEFAULT_SLIPPAGE, D as DetectedWallet, E as EIP1193, t as EIP6963ProviderDetail, v as EvmWalletInterface, F as FeatureFlags, I as IdentityStore, P as PostHookRequest, x as RATE_LIMIT_WAIT_BUDGET_MS, y as ResolvedFeatureFlags, z as ResolvedRetryConfig, A as ResolvedTrustwareConfig, C as ResolvedWalletConnectConfig, G as RetryConfig, H as RouteApproval, J as RouteEstimate, K as RouteIntent, L as RouteParams, M as RoutePlan, N as RouteSponsorship, O as RoutesConfig, Q as SimpleWalletInterface, S as SolanaProviderLike, b as SolanaWalletInterface, U as SponsorshipApproval, V as SwapTokenRef, X as TrustwareTheme, Y as TrustwareWidgetMessages, c as WagmiBridge, d as WagmiConnector, Z as WalletAddressResolution, _ as WalletAddressSource, $ as WalletCategory, a0 as WalletConnectConfig, a1 as WalletEcosystem, a as WalletId, a2 as WalletIdentity, a3 as WalletIdentityAddress, a4 as WalletIdentityChainLike, W as WalletMeta, a5 as assertValidPostHook, a6 as buildWalletIdentityAddress, a7 as createWalletIdentity, a8 as resolveWalletAddressForChain, a9 as upsertWalletIdentityAddress, f as useWalletExternalDisconnect, g as useWalletInfo, h as useWireDetectionIntoManager, w as walletManager } from './manager-D8nQsod2.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default from 'react';
|
|
7
|
-
import { C as ChainDef } from './blockchain-
|
|
8
|
-
export { B as BalanceRow, a as BalanceStreamOptions, b as
|
|
9
|
-
import { T as Token, Y as YourTokenData } from './types-
|
|
10
|
-
export { P as POPULAR_ORDER, W as WALLETS, c as connectDetectedWallet, t as toWalletInterfaceFromDetected, u as useEIP1193, f as useWagmi, g as useWalletDetection } from './metadata-
|
|
7
|
+
import { C as ChainDef } from './blockchain-DmCPxnxr.js';
|
|
8
|
+
export { B as BalanceRow, a as BalanceStreamOptions, b as BalanceStreamSummary, c as ChainMeta, d as ChainType, G as GetBalancesOptions, N as NativeCurrency, T as TokenDef, e as TokenMeta, f as TokenPageInfo, g as TokenPageOptions, h as TokenPageResult, i as TokenType, j as TokenWithBalance, W as WalletAddressBalanceWrapper } from './blockchain-DmCPxnxr.js';
|
|
9
|
+
import { T as Token, Y as YourTokenData } from './types-CMmx0S4U.js';
|
|
10
|
+
export { P as POPULAR_ORDER, W as WALLETS, c as connectDetectedWallet, t as toWalletInterfaceFromDetected, u as useEIP1193, f as useWagmi, g as useWalletDetection } from './metadata-BOjEF7oo.js';
|
|
11
11
|
export { TrustwareWidget } from './widget.js';
|
|
12
12
|
export { API_PREFIX, API_ROOT, ASSETS_BASE_URL, GTM_ID, SDK_NAME, SDK_VERSION, WALLETCONNECT_PROJECT_ID } from './constants.js';
|
|
13
13
|
|
package/dist/index.mjs
CHANGED
|
@@ -37,7 +37,17 @@ var init_config = __esm({
|
|
|
37
37
|
RATE_LIMIT_WAIT_BUDGET_MS = 1e4;
|
|
38
38
|
DEFAULT_FEATURE_FLAGS = {
|
|
39
39
|
tokensPagination: true,
|
|
40
|
-
|
|
40
|
+
// On by default: an address scan covers every configured chain and takes
|
|
41
|
+
// seconds end to end, so streaming turns one long wait into a wallet that
|
|
42
|
+
// fills in as results land — first chunk in ~200ms against a ~2.3s buffered
|
|
43
|
+
// response, measured on a live backend.
|
|
44
|
+
//
|
|
45
|
+
// Safe to default because the path degrades on its own: a backend with
|
|
46
|
+
// BALANCE_STREAM_ENABLED off refuses the stream, and the SDK falls back to
|
|
47
|
+
// the buffered endpoint (emitting balance_stream_fallback), as does any
|
|
48
|
+
// runtime whose fetch has no readable body — React Native, most notably.
|
|
49
|
+
// The cost of defaulting ahead of a backend is one refused request per scan.
|
|
50
|
+
balanceStreaming: true,
|
|
41
51
|
shouldAllowGA4: true,
|
|
42
52
|
swapMode: false,
|
|
43
53
|
swapDefaultDestToken: null,
|
|
@@ -482,7 +492,7 @@ var init_constants = __esm({
|
|
|
482
492
|
"src/constants.ts"() {
|
|
483
493
|
"use strict";
|
|
484
494
|
SDK_NAME = "@trustware/sdk";
|
|
485
|
-
SDK_VERSION = "1.1.
|
|
495
|
+
SDK_VERSION = "1.1.12-staging.2";
|
|
486
496
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
487
497
|
GTM_ID = "GTM-TZDGNCXB";
|
|
488
498
|
API_PREFIX = "/api";
|
|
@@ -530,7 +540,7 @@ function isNotFoundError(err) {
|
|
|
530
540
|
return err instanceof Error && err.message.startsWith("HTTP 404");
|
|
531
541
|
}
|
|
532
542
|
async function validateSdkAccess() {
|
|
533
|
-
const r = await fetch(`${apiBase()}/sdk/validate`, {
|
|
543
|
+
const r = await fetch(`${apiBase()}/v1/sdk/validate`, {
|
|
534
544
|
method: "GET",
|
|
535
545
|
headers: jsonHeaders()
|
|
536
546
|
});
|
|
@@ -5085,6 +5095,16 @@ function mergeBalanceWrappers(current, incoming) {
|
|
|
5085
5095
|
}
|
|
5086
5096
|
return Array.from(merged.values());
|
|
5087
5097
|
}
|
|
5098
|
+
function toSummary(frame, address) {
|
|
5099
|
+
const total = toNumberOrUndefined(frame.total) ?? 0;
|
|
5100
|
+
return {
|
|
5101
|
+
address: toStringOrUndefined(frame.address) ?? address,
|
|
5102
|
+
partial: Boolean(frame.partial),
|
|
5103
|
+
completed: toNumberOrUndefined(frame.completed) ?? 0,
|
|
5104
|
+
total,
|
|
5105
|
+
elapsedMs: toNumberOrUndefined(frame.elapsed)
|
|
5106
|
+
};
|
|
5107
|
+
}
|
|
5088
5108
|
async function parseStreamingBalances(response, address, options = {}) {
|
|
5089
5109
|
if (!response.body) {
|
|
5090
5110
|
throw new Error("balances stream: empty response body");
|
|
@@ -5105,7 +5125,12 @@ async function parseStreamingBalances(response, address, options = {}) {
|
|
|
5105
5125
|
if (!trimmed) continue;
|
|
5106
5126
|
try {
|
|
5107
5127
|
const parsed = JSON.parse(trimmed);
|
|
5108
|
-
if (!parsed.chain_id)
|
|
5128
|
+
if (!parsed.chain_id) {
|
|
5129
|
+
if (parsed.type === "summary") {
|
|
5130
|
+
options.onSummary?.(toSummary(parsed, address));
|
|
5131
|
+
}
|
|
5132
|
+
continue;
|
|
5133
|
+
}
|
|
5109
5134
|
const chunk = normalizeStreamChunk(parsed);
|
|
5110
5135
|
emitBalanceStreamChunk(address, chunk.length);
|
|
5111
5136
|
yield chunk;
|
|
@@ -5124,6 +5149,8 @@ async function parseStreamingBalances(response, address, options = {}) {
|
|
|
5124
5149
|
const chunk = normalizeStreamChunk(parsed);
|
|
5125
5150
|
emitBalanceStreamChunk(address, chunk.length);
|
|
5126
5151
|
yield chunk;
|
|
5152
|
+
} else if (parsed.type === "summary") {
|
|
5153
|
+
options.onSummary?.(toSummary(parsed, address));
|
|
5127
5154
|
}
|
|
5128
5155
|
} catch (error) {
|
|
5129
5156
|
if (options.strict) {
|
|
@@ -5178,7 +5205,7 @@ async function getBalancesByAddress(address, opts) {
|
|
|
5178
5205
|
}
|
|
5179
5206
|
return merged;
|
|
5180
5207
|
}
|
|
5181
|
-
const url = `${apiBase()}/data/balances/${address}`;
|
|
5208
|
+
const url = `${apiBase()}/v1/data/balances/${address}`;
|
|
5182
5209
|
const r = await rateLimitedFetch(url, {
|
|
5183
5210
|
method: "GET",
|
|
5184
5211
|
credentials: "omit",
|
|
@@ -5186,14 +5213,27 @@ async function getBalancesByAddress(address, opts) {
|
|
|
5186
5213
|
});
|
|
5187
5214
|
if (!r.ok) throw new Error(`balances: HTTP ${r.status}`);
|
|
5188
5215
|
const j = await r.json();
|
|
5189
|
-
|
|
5216
|
+
const results = Array.isArray(j) ? j : j.results ?? [];
|
|
5217
|
+
if (opts?.onSummary) {
|
|
5218
|
+
const completed = results.length;
|
|
5219
|
+
opts.onSummary({
|
|
5220
|
+
address,
|
|
5221
|
+
partial: Array.isArray(j) ? false : Boolean(j.partial),
|
|
5222
|
+
completed,
|
|
5223
|
+
total: completed
|
|
5224
|
+
});
|
|
5225
|
+
}
|
|
5226
|
+
return results;
|
|
5227
|
+
}
|
|
5228
|
+
function bufferedOptions(opts) {
|
|
5229
|
+
return { ...opts, stream: false };
|
|
5190
5230
|
}
|
|
5191
5231
|
async function* getBalancesByAddressStream(address, opts = {}) {
|
|
5192
5232
|
if (!TrustwareConfigStore.get().features.balanceStreaming) {
|
|
5193
|
-
yield await getBalancesByAddress(address);
|
|
5233
|
+
yield await getBalancesByAddress(address, bufferedOptions(opts));
|
|
5194
5234
|
return;
|
|
5195
5235
|
}
|
|
5196
|
-
const url = `${apiBase()}/data/balances/${address}?stream=1`;
|
|
5236
|
+
const url = `${apiBase()}/v1/data/balances/${address}?stream=1`;
|
|
5197
5237
|
try {
|
|
5198
5238
|
const response = await rateLimitedFetch(url, {
|
|
5199
5239
|
method: "GET",
|
|
@@ -5209,7 +5249,14 @@ async function* getBalancesByAddressStream(address, opts = {}) {
|
|
|
5209
5249
|
const contentType = response.headers.get("content-type") ?? "";
|
|
5210
5250
|
if (contentType.includes("application/json")) {
|
|
5211
5251
|
const payload = await response.json();
|
|
5212
|
-
|
|
5252
|
+
const results = Array.isArray(payload) ? payload : payload.results ?? [];
|
|
5253
|
+
opts.onSummary?.({
|
|
5254
|
+
address,
|
|
5255
|
+
partial: Array.isArray(payload) ? false : Boolean(payload.partial),
|
|
5256
|
+
completed: results.length,
|
|
5257
|
+
total: results.length
|
|
5258
|
+
});
|
|
5259
|
+
yield results;
|
|
5213
5260
|
return;
|
|
5214
5261
|
}
|
|
5215
5262
|
const stream = await parseStreamingBalances(response, address, opts);
|
|
@@ -5218,7 +5265,7 @@ async function* getBalancesByAddressStream(address, opts = {}) {
|
|
|
5218
5265
|
}
|
|
5219
5266
|
} catch (error) {
|
|
5220
5267
|
emitBalanceStreamFallback(address, error);
|
|
5221
|
-
yield await getBalancesByAddress(address);
|
|
5268
|
+
yield await getBalancesByAddress(address, bufferedOptions(opts));
|
|
5222
5269
|
}
|
|
5223
5270
|
}
|
|
5224
5271
|
async function ensureRegistry() {
|
|
@@ -8272,15 +8319,7 @@ function useTrustwareConfig() {
|
|
|
8272
8319
|
// Shared with the resolver rather than restated, so this placeholder
|
|
8273
8320
|
// can't drift from the real defaults.
|
|
8274
8321
|
retry: { ...DEFAULT_RETRY_CONFIG },
|
|
8275
|
-
features: {
|
|
8276
|
-
tokensPagination: true,
|
|
8277
|
-
balanceStreaming: false,
|
|
8278
|
-
shouldAllowGA4: true,
|
|
8279
|
-
swapMode: false,
|
|
8280
|
-
swapDefaultDestToken: null,
|
|
8281
|
-
swapLockDestToken: false,
|
|
8282
|
-
swapAllowedDestTokens: null
|
|
8283
|
-
}
|
|
8322
|
+
features: { ...DEFAULT_FEATURE_FLAGS }
|
|
8284
8323
|
};
|
|
8285
8324
|
}
|
|
8286
8325
|
});
|
|
@@ -20562,7 +20601,7 @@ var VERSION;
|
|
|
20562
20601
|
var init_version = __esm({
|
|
20563
20602
|
"node_modules/@aa-sdk/core/dist/esm/version.js"() {
|
|
20564
20603
|
"use strict";
|
|
20565
|
-
VERSION = "4.88.
|
|
20604
|
+
VERSION = "4.88.5";
|
|
20566
20605
|
}
|
|
20567
20606
|
});
|
|
20568
20607
|
|
|
@@ -29071,7 +29110,7 @@ var VERSION2;
|
|
|
29071
29110
|
var init_version2 = __esm({
|
|
29072
29111
|
"node_modules/@account-kit/infra/dist/esm/version.js"() {
|
|
29073
29112
|
"use strict";
|
|
29074
|
-
VERSION2 = "4.88.
|
|
29113
|
+
VERSION2 = "4.88.5";
|
|
29075
29114
|
}
|
|
29076
29115
|
});
|
|
29077
29116
|
|
|
@@ -31788,7 +31827,18 @@ async function sendRouteAsUserOperation(params) {
|
|
|
31788
31827
|
);
|
|
31789
31828
|
}
|
|
31790
31829
|
console.debug("[send] UserOp included", { userOpHash, txHash });
|
|
31791
|
-
|
|
31830
|
+
try {
|
|
31831
|
+
void submitReceipt(
|
|
31832
|
+
intentId,
|
|
31833
|
+
txHash,
|
|
31834
|
+
getSponsorshipRequestId(),
|
|
31835
|
+
eoaAddress
|
|
31836
|
+
).catch((err) => {
|
|
31837
|
+
console.debug("[send] receipt submission failed (non-fatal)", err);
|
|
31838
|
+
});
|
|
31839
|
+
} catch (err) {
|
|
31840
|
+
console.debug("[send] receipt submission failed (non-fatal)", err);
|
|
31841
|
+
}
|
|
31792
31842
|
return { userOpHash, txHash, intentId };
|
|
31793
31843
|
}
|
|
31794
31844
|
var NATIVE_ADDRS;
|
|
@@ -34010,10 +34060,6 @@ function useSwapExecution(fromChain) {
|
|
|
34010
34060
|
numericChainId,
|
|
34011
34061
|
{ approvalsEnsured: ownsApprovals }
|
|
34012
34062
|
);
|
|
34013
|
-
try {
|
|
34014
|
-
await submitReceipt(routeResult.intentId, hash);
|
|
34015
|
-
} catch {
|
|
34016
|
-
}
|
|
34017
34063
|
setState((p) => ({
|
|
34018
34064
|
...p,
|
|
34019
34065
|
isSubmitting: false,
|
|
@@ -34022,6 +34068,8 @@ function useSwapExecution(fromChain) {
|
|
|
34022
34068
|
txStatus: "processing"
|
|
34023
34069
|
}));
|
|
34024
34070
|
startPolling(routeResult.intentId, onSuccess, onError);
|
|
34071
|
+
void submitReceipt(routeResult.intentId, hash).catch(() => {
|
|
34072
|
+
});
|
|
34025
34073
|
} catch (err) {
|
|
34026
34074
|
const msg = mapTxError(err);
|
|
34027
34075
|
setState((p) => ({
|
|
@@ -36464,6 +36512,7 @@ function SwapMode({
|
|
|
36464
36512
|
}, [route.loading]);
|
|
36465
36513
|
useEffect34(() => {
|
|
36466
36514
|
if (!route.data) return;
|
|
36515
|
+
if (stage !== "home" && stage !== "review") return;
|
|
36467
36516
|
const id = setInterval(() => {
|
|
36468
36517
|
const ts = quoteTimestampRef.current;
|
|
36469
36518
|
if (ts === null) return;
|
|
@@ -36475,7 +36524,11 @@ function SwapMode({
|
|
|
36475
36524
|
}
|
|
36476
36525
|
}, 1e3);
|
|
36477
36526
|
return () => clearInterval(id);
|
|
36478
|
-
}, [route.data]);
|
|
36527
|
+
}, [route.data, stage]);
|
|
36528
|
+
const handleRetryQuote = useCallback22(() => {
|
|
36529
|
+
if (!latestFetchParamsRef.current) return;
|
|
36530
|
+
void fetchRef.current(latestFetchParamsRef.current);
|
|
36531
|
+
}, []);
|
|
36479
36532
|
useEffect34(() => {
|
|
36480
36533
|
if (stage !== "review") return;
|
|
36481
36534
|
if (!route.data || !walletAddress) return;
|
|
@@ -38004,6 +38057,10 @@ function SwapMode({
|
|
|
38004
38057
|
txStatus: execution.txStatus,
|
|
38005
38058
|
isSubmitting: execution.isSubmitting,
|
|
38006
38059
|
isGasSponsored,
|
|
38060
|
+
hasQuote: !!route.data,
|
|
38061
|
+
isQuoteRefreshing: route.loading,
|
|
38062
|
+
quoteError: route.error,
|
|
38063
|
+
onRetryQuote: handleRetryQuote,
|
|
38007
38064
|
onExecute: () => void handleExecute()
|
|
38008
38065
|
}
|
|
38009
38066
|
)
|
|
@@ -39340,10 +39397,15 @@ function SwapActionArea({
|
|
|
39340
39397
|
txStatus,
|
|
39341
39398
|
isSubmitting,
|
|
39342
39399
|
isGasSponsored,
|
|
39400
|
+
hasQuote,
|
|
39401
|
+
isQuoteRefreshing,
|
|
39402
|
+
quoteError,
|
|
39403
|
+
onRetryQuote,
|
|
39343
39404
|
onExecute
|
|
39344
39405
|
}) {
|
|
39345
39406
|
const needsApproval = allowanceStatus === "needed" && !isGasSponsored;
|
|
39346
39407
|
const isChecking = allowanceStatus === "checking";
|
|
39408
|
+
const quoteUnavailable = !hasQuote && !isQuoteRefreshing && !isSubmitting && txStatus === "idle";
|
|
39347
39409
|
let label;
|
|
39348
39410
|
if (isChecking) {
|
|
39349
39411
|
label = "Checking approval...";
|
|
@@ -39351,12 +39413,14 @@ function SwapActionArea({
|
|
|
39351
39413
|
label = `Approving ${fromTokenSymbol}...`;
|
|
39352
39414
|
} else if (isSubmitting) {
|
|
39353
39415
|
label = "Confirm in wallet...";
|
|
39416
|
+
} else if (isQuoteRefreshing) {
|
|
39417
|
+
label = "Refreshing quote...";
|
|
39354
39418
|
} else if (needsApproval) {
|
|
39355
39419
|
label = `Approve ${fromTokenSymbol}`;
|
|
39356
39420
|
} else {
|
|
39357
39421
|
label = "Swap";
|
|
39358
39422
|
}
|
|
39359
|
-
const isDisabled = isSubmitting || isChecking;
|
|
39423
|
+
const isDisabled = isSubmitting || isChecking || isQuoteRefreshing || !hasQuote;
|
|
39360
39424
|
return /* @__PURE__ */ jsxs47("div", { style: { marginTop: spacing[6] }, children: [
|
|
39361
39425
|
isGasSponsored && !isSubmitting && /* @__PURE__ */ jsxs47(
|
|
39362
39426
|
"div",
|
|
@@ -39396,7 +39460,38 @@ function SwapActionArea({
|
|
|
39396
39460
|
]
|
|
39397
39461
|
}
|
|
39398
39462
|
),
|
|
39399
|
-
/* @__PURE__ */
|
|
39463
|
+
quoteUnavailable ? /* @__PURE__ */ jsxs47(Fragment13, { children: [
|
|
39464
|
+
/* @__PURE__ */ jsx59(
|
|
39465
|
+
"p",
|
|
39466
|
+
{
|
|
39467
|
+
style: {
|
|
39468
|
+
fontSize: fontSize.xs,
|
|
39469
|
+
color: colors.destructive,
|
|
39470
|
+
textAlign: "center",
|
|
39471
|
+
marginBottom: spacing[3]
|
|
39472
|
+
},
|
|
39473
|
+
children: quoteError ?? "This quote expired."
|
|
39474
|
+
}
|
|
39475
|
+
),
|
|
39476
|
+
/* @__PURE__ */ jsx59(
|
|
39477
|
+
"button",
|
|
39478
|
+
{
|
|
39479
|
+
onClick: onRetryQuote,
|
|
39480
|
+
style: {
|
|
39481
|
+
width: "100%",
|
|
39482
|
+
height: "3.5rem",
|
|
39483
|
+
borderRadius: "1.5rem",
|
|
39484
|
+
backgroundColor: colors.primary,
|
|
39485
|
+
color: colors.primaryForeground,
|
|
39486
|
+
fontSize: fontSize.base,
|
|
39487
|
+
fontWeight: fontWeight.semibold,
|
|
39488
|
+
border: 0,
|
|
39489
|
+
cursor: "pointer"
|
|
39490
|
+
},
|
|
39491
|
+
children: "Get a new quote"
|
|
39492
|
+
}
|
|
39493
|
+
)
|
|
39494
|
+
] }) : /* @__PURE__ */ jsx59(
|
|
39400
39495
|
"button",
|
|
39401
39496
|
{
|
|
39402
39497
|
onClick: onExecute,
|