@spicenet-io/spiceflow-ui 4.9.3-xchain.0 → 4.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -43
- package/dist/auth-privy.js +1 -1
- package/dist/components/AccountDisplay/parts/AccountIdleBalances.d.ts +5 -2
- package/dist/components/AccountDisplay/parts/AccountPanel.d.ts +2 -2
- package/dist/components/AccountDisplay/types.d.ts +2 -5
- package/dist/components/SpiceSupply/lib/buildBatches.d.ts +1 -8
- package/dist/components/SpiceSupply/lib/executors.d.ts +1 -4
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +1 -11
- package/dist/components/SpiceWithdraw/lib/helpers.d.ts +1 -1
- package/dist/components/SpiceWithdraw/parts/WithdrawBalanceCardHeader.d.ts +1 -0
- package/dist/components/SpiceWithdraw/parts/WithdrawBalancePopover.d.ts +15 -0
- package/dist/execution/pollIntentStep.d.ts +0 -1
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/useDirectWithdraw.d.ts +2 -8
- package/dist/hooks/useSpiceAssets.d.ts +1 -2
- package/dist/hooks/useSupplyAssets.d.ts +2 -11
- package/dist/hooks/useSupplyQuote.d.ts +0 -3
- package/dist/hooks/useWalletBalances.d.ts +1 -2
- package/dist/index.cjs.js +9 -9
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/{privy-BKkDy7CR.js → privy-DhjzUaUt.js} +1 -1
- package/dist/types/assets.d.ts +0 -1
- package/dist/types/supply.d.ts +0 -11
- package/dist/types/withdraw.d.ts +0 -1
- package/dist/utils/crossChainRouter/liquidityVenues.d.ts +0 -2
- package/dist/utils/directWithdraw.d.ts +4 -0
- package/dist/utils/tokenResolution.d.ts +2 -6
- package/package.json +1 -1
- package/dist/components/SpiceDeposit/lib/escrowCredit.d.ts +0 -2
- package/dist/execution/escrowCredit.d.ts +0 -18
- package/dist/hooks/useSpiceRollupPrices.d.ts +0 -2
- package/dist/utils/prices/providerPrices.d.ts +0 -12
package/README.md
CHANGED
|
@@ -108,49 +108,6 @@ it becomes a `protocol` everyone can name.
|
|
|
108
108
|
|
|
109
109
|
## Development
|
|
110
110
|
|
|
111
|
-
### Rollup balance pricing
|
|
112
|
-
|
|
113
|
-
Rollup USD values use the host-configured RPC provider's pricing capability when the balance API has no valid value. The built-in account panel and withdrawal modal enable this while open; custom `useSpiceAssets` consumers can opt in with `priceEnabled`. Quantities arrive independently. Lookups follow receipt mappings, prefer `nativeChainId`, and fall back to other supported chains with a configured Alchemy endpoint. Explicit account `tokenPrices` overrides still take precedence over provider quotes.
|
|
114
|
-
|
|
115
|
-
Wallet discovery and rollup balances share a one-minute quote cache. Pricing polls only while the view is open and the page is visible. A failed refresh can retain a marked stale quote for up to five minutes; an unavailable quote displays `—`. No extra key, internal RPC, or symbol-based ERC-20 price fallback is used.
|
|
116
|
-
|
|
117
|
-
### Direct withdrawal in a custom balance row
|
|
118
|
-
|
|
119
|
-
`useSpiceDirectWithdraw()` uses the same embedded-wallet transfer and fee path as the account panel's direct Withdraw buttons. It selects the connected external wallet as recipient, exposes `canWithdraw` and `state`, and rejects duplicate submissions while pending. Pass the raw `bigint` balance to `withdraw({ tokenAddress, chainId, balance })` and refresh the host's balance after it resolves. Rejections are available as `state.message` for the host to render.
|
|
120
|
-
|
|
121
|
-
Custom account rows accept React content in `displayValue`, so a host can render its own button with that controller. Set the row's `asset: { tokenAddress, chainId }` when it represents an on-chain balance; the account panel then omits that token from discovered idle balances. Existing string values continue to work.
|
|
122
|
-
|
|
123
|
-
### Withdraw from an account balance
|
|
124
|
-
|
|
125
|
-
`AccountDisplay.onWithdrawClick` receives the rollup receipt-token ID when a
|
|
126
|
-
user clicks Withdraw on an idle rollup balance. The main Withdraw button calls
|
|
127
|
-
it without an ID. Pass the ID to `SpiceWithdraw.initialSourceAssetId` to open
|
|
128
|
-
the existing modal with that asset selected; the user chooses the destination
|
|
129
|
-
network inside the modal. Existing callbacks that take no arguments continue
|
|
130
|
-
to work.
|
|
131
|
-
|
|
132
|
-
```tsx
|
|
133
|
-
const [withdrawOpen, setWithdrawOpen] = useState(false);
|
|
134
|
-
const [withdrawAssetId, setWithdrawAssetId] = useState<string>();
|
|
135
|
-
|
|
136
|
-
<AccountDisplay
|
|
137
|
-
onWithdrawClick={(receiptTokenId) => {
|
|
138
|
-
setWithdrawAssetId(receiptTokenId);
|
|
139
|
-
setWithdrawOpen(true);
|
|
140
|
-
}}
|
|
141
|
-
/>
|
|
142
|
-
<SpiceWithdraw
|
|
143
|
-
isOpen={withdrawOpen}
|
|
144
|
-
onClose={() => setWithdrawOpen(false)}
|
|
145
|
-
initialSourceAssetId={withdrawAssetId}
|
|
146
|
-
buildSpicenetBatch={buildSpicenetWithdrawalBatch}
|
|
147
|
-
/>
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Keep the integration's existing withdrawal batch builder and callbacks.
|
|
151
|
-
`initialSourceAssetId` selects a current balance by ID; it does not supply a
|
|
152
|
-
cached balance or change the receipt's supported withdrawal routes.
|
|
153
|
-
|
|
154
111
|
### Fee-Charging Intent Flows
|
|
155
112
|
|
|
156
113
|
- `SpiceSupply` and `SpicePay` are fee-charging intent-execution flows and must surface fee estimation before enabling submission.
|
package/dist/auth-privy.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{P as g}from"./privy-
|
|
2
|
+
import{P as g}from"./privy-DhjzUaUt.js";import"react/jsx-runtime";import"react";import"@spicenet-io/spiceflow-core";import"viem";import"viem/actions";import"@privy-io/react-auth";import"wagmi";import"@tanstack/react-query";export{g as PrivyLogin};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpiceAsset } from "../types";
|
|
3
3
|
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
4
|
-
|
|
4
|
+
export interface DirectWithdrawState {
|
|
5
|
+
key: string;
|
|
6
|
+
step: "pending" | "error";
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
5
9
|
interface AccountIdleBalancesProps {
|
|
6
10
|
spiceAssets: SpiceAsset[];
|
|
7
11
|
loading: boolean;
|
|
@@ -10,7 +14,6 @@ interface AccountIdleBalancesProps {
|
|
|
10
14
|
canDirectWithdraw?: boolean;
|
|
11
15
|
onDirectWithdraw?: (asset: SpiceAsset) => void;
|
|
12
16
|
directWithdrawState?: DirectWithdrawState | null;
|
|
13
|
-
onWithdrawClick?: (receiptTokenId?: string) => void;
|
|
14
17
|
}
|
|
15
18
|
export declare const AccountIdleBalances: React.NamedExoticComponent<AccountIdleBalancesProps>;
|
|
16
19
|
export {};
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { SpiceAsset, CustomSection, AccountNotice } from "../types";
|
|
3
3
|
import { VerifiedPendingDeposit } from "../../../hooks/usePendingDeposit";
|
|
4
4
|
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
5
|
-
import type
|
|
5
|
+
import { type DirectWithdrawState } from "./AccountIdleBalances";
|
|
6
6
|
interface AccountPanelProps {
|
|
7
7
|
appName: string;
|
|
8
8
|
status: "active" | "inactive";
|
|
@@ -17,7 +17,7 @@ interface AccountPanelProps {
|
|
|
17
17
|
customSections: CustomSection[];
|
|
18
18
|
notice?: AccountNotice | null;
|
|
19
19
|
onDepositClick?: () => void;
|
|
20
|
-
onWithdrawClick?: (
|
|
20
|
+
onWithdrawClick?: () => void;
|
|
21
21
|
depositDisabled?: boolean;
|
|
22
22
|
onCompleteDeposit?: (deposit: VerifiedPendingDeposit) => void;
|
|
23
23
|
primaryColor?: string;
|
|
@@ -5,8 +5,7 @@ export interface CustomSectionItem {
|
|
|
5
5
|
tokenSymbol: string;
|
|
6
6
|
tokenLogoURI?: string;
|
|
7
7
|
label: string;
|
|
8
|
-
displayValue:
|
|
9
|
-
asset?: Pick<SpiceAsset, "tokenAddress" | "chainId">;
|
|
8
|
+
displayValue: string;
|
|
10
9
|
valueColor?: "green" | "red" | "default";
|
|
11
10
|
}
|
|
12
11
|
export interface CustomSection {
|
|
@@ -25,9 +24,7 @@ export interface SpiceAsset {
|
|
|
25
24
|
balance: string;
|
|
26
25
|
balanceFormatted: number;
|
|
27
26
|
usdValue: number;
|
|
28
|
-
priceStatus?: "fresh" | "stale" | "unavailable";
|
|
29
27
|
logoURI?: string;
|
|
30
|
-
receiptTokenId?: string;
|
|
31
28
|
directWithdraw?: boolean;
|
|
32
29
|
}
|
|
33
30
|
export interface BreakdownLabel {
|
|
@@ -51,7 +48,7 @@ export interface AccountDisplayProps {
|
|
|
51
48
|
dark?: boolean;
|
|
52
49
|
onDepositSuccess?: () => void;
|
|
53
50
|
onDepositClick?: () => void;
|
|
54
|
-
onWithdrawClick?: (
|
|
51
|
+
onWithdrawClick?: () => void;
|
|
55
52
|
onCompleteDeposit?: (deposit: VerifiedPendingDeposit) => void;
|
|
56
53
|
showModeToggle?: boolean;
|
|
57
54
|
defaultMode?: "7702" | "non7702";
|
|
@@ -2,12 +2,11 @@ import { type Address } from "viem";
|
|
|
2
2
|
import type { ResolvedSwap } from "@spicenet-io/spiceflow-core";
|
|
3
3
|
import type { ChainBatch } from "../../../types/authorization";
|
|
4
4
|
import type { SelectedAsset } from "../../../types/assets";
|
|
5
|
-
import type {
|
|
5
|
+
import type { SpiceSupplyProps, SupplyBatchBuildOptions } from "../../../types/supply";
|
|
6
6
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
7
7
|
import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
8
8
|
import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
9
9
|
type EstimateFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: ExecutionOptions) => Promise<FeeEstimateSummary>;
|
|
10
|
-
export declare function getPivotEscrowAmount(sourceSwap: Pick<ResolvedSwap, "amountOutMinimum">, gasSkim: bigint): bigint;
|
|
11
10
|
export declare function isExternalInPlacePaySource(selectedAsset: SelectedAsset | null, isNon7702: boolean, resolvedChainId: number): boolean;
|
|
12
11
|
export declare function stripSpicenetFundingBatches(batches: ChainBatch[]): ChainBatch[];
|
|
13
12
|
export declare function scaleTokenAmount(amount: bigint, fromDecimals: number, toDecimals: number): bigint;
|
|
@@ -32,14 +31,8 @@ export interface BatchBuilderContext {
|
|
|
32
31
|
exactOutputSwap: ResolvedExactOutputSwap | null;
|
|
33
32
|
quoteAmountOut: bigint | null;
|
|
34
33
|
resolvedTokenIn: Address | null;
|
|
35
|
-
sourceSwap?: ResolvedSwap | null;
|
|
36
|
-
pivot?: PivotRoute | null;
|
|
37
34
|
requestTimestampMs?: number;
|
|
38
35
|
}
|
|
39
|
-
export declare function isPivotSupply(ctx: Pick<BatchBuilderContext, "isPayMode" | "selectedAsset" | "resolvedChainId" | "sourceSwap" | "pivot">): ctx is typeof ctx & {
|
|
40
|
-
sourceSwap: ResolvedSwap;
|
|
41
|
-
pivot: PivotRoute;
|
|
42
|
-
};
|
|
43
36
|
export declare function buildPayChainBatches(ctx: BatchBuilderContext, options?: SupplyBatchBuildOptions): Promise<ChainBatch[]>;
|
|
44
37
|
export declare function buildSupplyChainBatches(ctx: BatchBuilderContext, options?: SupplyBatchBuildOptions): Promise<ChainBatch[]>;
|
|
45
38
|
export declare function estimateRequiredGrossFunding(requiredNetFunding: bigint, buildBatches: (grossFundingAmount: bigint) => ChainBatch[] | Promise<ChainBatch[]>, fundingToken: Address, estimate: EstimateFn, executionOptions?: Pick<ExecutionOptions, "useCustomTransfers" | "userOverride">): Promise<bigint>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
2
|
import { type Address } from "viem";
|
|
3
3
|
import type { SelectedAsset } from "../../../types/assets";
|
|
4
|
-
import type { BuildPayBatchesFn, BuildSupplyBatchesFn,
|
|
5
|
-
import type { ResolvedSwap } from "@spicenet-io/spiceflow-core";
|
|
4
|
+
import type { BuildPayBatchesFn, BuildSupplyBatchesFn, SpiceSupplyProps } from "../../../types/supply";
|
|
6
5
|
import { type SupplyFeeQuote } from "./feePreview";
|
|
7
6
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
8
7
|
import type { ExecutionProgress } from "../../../hooks/useSpiceExecution";
|
|
@@ -26,8 +25,6 @@ export type ExecutorContext = {
|
|
|
26
25
|
exactOutputSwap: ResolvedExactOutputSwap | null;
|
|
27
26
|
selectedIsEquivalent: boolean;
|
|
28
27
|
resolvedTokenIn: Address | null;
|
|
29
|
-
sourceSwap: ResolvedSwap | null;
|
|
30
|
-
pivot: PivotRoute | null;
|
|
31
28
|
embeddedWalletAddress: string | null | undefined;
|
|
32
29
|
providerEmbeddedAddress: string | null | undefined;
|
|
33
30
|
recipient?: Address;
|
|
@@ -3,7 +3,7 @@ import { type FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
|
|
|
3
3
|
import type { FeePreview } from "../../../types/ui";
|
|
4
4
|
import type { ChainBatch } from "../../../types/authorization";
|
|
5
5
|
import type { Asset, SelectedAsset } from "../../../types/assets";
|
|
6
|
-
import type {
|
|
6
|
+
import type { SpiceSupplyProps, SupplyBatchBuildOptions } from "../../../types/supply";
|
|
7
7
|
import type { ResolvedExactOutputSwap } from "../../../utils/swapQuotes";
|
|
8
8
|
import type { ResolvedSwap } from "@spicenet-io/spiceflow-core";
|
|
9
9
|
import type { ExecutionOptions } from "../../../hooks/useSpiceExecution";
|
|
@@ -14,14 +14,7 @@ export type SupplyFeeQuote = {
|
|
|
14
14
|
preview: FeePreview;
|
|
15
15
|
feeEstimate: FeeEstimateSummary | null;
|
|
16
16
|
grossFundingAmount?: bigint;
|
|
17
|
-
sourceGasSkim?: bigint;
|
|
18
17
|
};
|
|
19
|
-
export declare function sizePivotSourceGasSkim(params: {
|
|
20
|
-
user: Address;
|
|
21
|
-
pivot: PivotRoute;
|
|
22
|
-
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
23
|
-
signal?: AbortSignal;
|
|
24
|
-
}): Promise<bigint>;
|
|
25
18
|
export declare function solveGrossFunding(fees: Pick<FeePreview, "grossAmount" | "gasFee" | "spicenetFee" | "bridgeFee">, requiredNetFunding: bigint): bigint;
|
|
26
19
|
export declare function estimatePayFunding(args: {
|
|
27
20
|
requiredNetFunding: bigint;
|
|
@@ -46,7 +39,6 @@ export declare function estimateSupplyMaxAmount(ctx: {
|
|
|
46
39
|
isNon7702: boolean;
|
|
47
40
|
needsSwap: boolean;
|
|
48
41
|
isQuoting: boolean;
|
|
49
|
-
pivot?: PivotRoute | null;
|
|
50
42
|
embeddedWalletAddress: string | null | undefined;
|
|
51
43
|
buildSupplyChainBatches: BuildSupplyBatchesFn;
|
|
52
44
|
estimate: EstimateFn;
|
|
@@ -77,8 +69,6 @@ export interface FeePreviewContext {
|
|
|
77
69
|
authenticated: boolean;
|
|
78
70
|
isDirect: boolean;
|
|
79
71
|
resolvedSwap: ResolvedSwap | null;
|
|
80
|
-
sourceSwap?: ResolvedSwap | null;
|
|
81
|
-
pivot?: PivotRoute | null;
|
|
82
72
|
isQuoting: boolean;
|
|
83
73
|
executionTokenAddress: Address;
|
|
84
74
|
buildPayChainBatches: BuildPayBatchesFn;
|
|
@@ -2,5 +2,5 @@ import type { ChainBatch } from "../../../types/authorization";
|
|
|
2
2
|
export declare function normalizeTokenLabel(value?: string | null): string;
|
|
3
3
|
export declare function formatTokenAmount(rawAmount: bigint, decimals: number): string;
|
|
4
4
|
export declare function scaleAmountBetweenDecimals(amount: bigint, fromDecimals: number, toDecimals: number): bigint;
|
|
5
|
-
export declare function estimateUsd(amount: number,
|
|
5
|
+
export declare function estimateUsd(amount: number, symbol?: string): string;
|
|
6
6
|
export declare function buildWithdrawFeeEstimateKey(batches: ChainBatch[], tokenAddress?: string | null): string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResolvedDarkPalette } from "../../../utils/theme";
|
|
3
|
+
interface BalancePopoverProps {
|
|
4
|
+
show: boolean;
|
|
5
|
+
position: {
|
|
6
|
+
top: number;
|
|
7
|
+
left: number;
|
|
8
|
+
} | null;
|
|
9
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
10
|
+
spiceAssets: any[] | null | undefined;
|
|
11
|
+
dark: boolean;
|
|
12
|
+
dk: ResolvedDarkPalette;
|
|
13
|
+
}
|
|
14
|
+
export declare const BalancePopover: React.FC<BalancePopoverProps>;
|
|
15
|
+
export {};
|
|
@@ -24,7 +24,6 @@ export declare function runAllIntentSteps(options: {
|
|
|
24
24
|
totalSteps: number;
|
|
25
25
|
delayBeforeSpicenetStepMs?: number;
|
|
26
26
|
isSpicenetStep?: (stepIndex: number) => boolean;
|
|
27
|
-
beforeStep?: (stepIndex: number) => Promise<void>;
|
|
28
27
|
maxExecuteAttemptsForStep?: (stepIndex: number) => number;
|
|
29
28
|
maxPolls?: number;
|
|
30
29
|
onStatusMessage?: (message: string, txHash?: string) => void;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ export type { UseWalletReturn, WalletState, WalletActions } from "./useWallet";
|
|
|
6
6
|
export { useSpiceAssets } from "./useSpiceAssets";
|
|
7
7
|
export type { UseSpiceAssetsConfig, UseSpiceAssetsReturn, } from "./useSpiceAssets";
|
|
8
8
|
export { useSpiceExecution } from "./useSpiceExecution";
|
|
9
|
-
export { useDirectWithdraw as useSpiceDirectWithdraw } from "./useDirectWithdraw";
|
|
10
|
-
export type { DirectWithdrawParams, DirectWithdrawState, } from "./useDirectWithdraw";
|
|
11
9
|
export type { ExecutionProgress, ExecutionStep, ExecutionOptions, OnProgress, } from "./useSpiceExecution";
|
|
12
10
|
export { useLockDuration } from "./useLockDuration";
|
|
13
11
|
export type { UseLockDurationReturn } from "./useLockDuration";
|
|
@@ -4,15 +4,9 @@ export interface DirectWithdrawParams {
|
|
|
4
4
|
tokenAddress: Address | string;
|
|
5
5
|
chainId: number;
|
|
6
6
|
balance: bigint;
|
|
7
|
+
recipient: Address | string;
|
|
7
8
|
onProgress?: (progress: ExecutionProgress) => void;
|
|
8
9
|
}
|
|
9
|
-
export interface DirectWithdrawState {
|
|
10
|
-
key: string;
|
|
11
|
-
step: "pending" | "error";
|
|
12
|
-
message?: string;
|
|
13
|
-
}
|
|
14
10
|
export declare function useDirectWithdraw(): {
|
|
15
|
-
withdraw: ({ tokenAddress, chainId, balance, onProgress, }: DirectWithdrawParams) => Promise<string>;
|
|
16
|
-
canWithdraw: boolean;
|
|
17
|
-
state: DirectWithdrawState | null;
|
|
11
|
+
withdraw: ({ tokenAddress, chainId, balance, recipient, onProgress, }: DirectWithdrawParams) => Promise<string>;
|
|
18
12
|
};
|
|
@@ -5,7 +5,6 @@ export interface UseSpiceAssetsConfig {
|
|
|
5
5
|
supportedChains?: number[];
|
|
6
6
|
enabled?: boolean;
|
|
7
7
|
refetchInterval?: number;
|
|
8
|
-
priceEnabled?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export interface UseSpiceAssetsReturn {
|
|
11
10
|
assets: Asset[];
|
|
@@ -15,4 +14,4 @@ export interface UseSpiceAssetsReturn {
|
|
|
15
14
|
refetch: () => Promise<void>;
|
|
16
15
|
getAssetsByChain: (chainId: number) => Asset[];
|
|
17
16
|
}
|
|
18
|
-
export declare const useSpiceAssets: ({ address, supportedChains, enabled, refetchInterval,
|
|
17
|
+
export declare const useSpiceAssets: ({ address, supportedChains, enabled, refetchInterval, }: UseSpiceAssetsConfig) => UseSpiceAssetsReturn;
|
|
@@ -8,19 +8,10 @@ export declare function compareSupplyAssets(a: Asset & {
|
|
|
8
8
|
export declare function isSupportedSupplyAsset(asset: Pick<Asset, "address" | "chainTokens">, supportedSourceAssets?: string[]): boolean;
|
|
9
9
|
export declare function isSpendableSupplyAsset(asset: Pick<Asset, "address" | "chainTokens" | "chainId"> & {
|
|
10
10
|
_source?: string;
|
|
11
|
-
|
|
12
|
-
}, destinationChainId: number, supportedSourceAssets?: string[], options?: {
|
|
13
|
-
allowPivot?: boolean;
|
|
14
|
-
}): boolean;
|
|
15
|
-
export declare function isSpendablePayAsset(asset: Pick<Asset, "chainId"> & {
|
|
16
|
-
_source?: string;
|
|
17
|
-
}, destinationChainId: number): boolean;
|
|
11
|
+
}, destinationChainId: number, supportedSourceAssets?: string[]): boolean;
|
|
18
12
|
export declare function isSpendableExternalAsset(asset: Pick<Asset, "address" | "chainTokens" | "chainId"> & {
|
|
19
13
|
_source?: string;
|
|
20
|
-
|
|
21
|
-
}, destinationToken: Pick<DestinationToken, "address" | "chainId">, supportedSourceAssets?: string[], options?: {
|
|
22
|
-
allowPivot?: boolean;
|
|
23
|
-
}): boolean;
|
|
14
|
+
}, destinationToken: Pick<DestinationToken, "address" | "chainId">, supportedSourceAssets?: string[]): boolean;
|
|
24
15
|
type DestinationToken = {
|
|
25
16
|
address: Address;
|
|
26
17
|
decimals: number;
|
|
@@ -3,7 +3,6 @@ import { type LiquidityVenuesConfig } from "../utils/crossChainRouter/venueConfi
|
|
|
3
3
|
import type { ResolvedSwap } from "../utils/crossChainRouter/liquidityVenues";
|
|
4
4
|
import { type ExactOutputSwapIntent, type ResolvedExactOutputSwap } from "../utils/swapQuotes";
|
|
5
5
|
import type { SelectedAsset } from "../types/assets";
|
|
6
|
-
import type { PivotRoute } from "../types/supply";
|
|
7
6
|
export interface UseSupplyQuoteOpts {
|
|
8
7
|
direction: "input" | "output";
|
|
9
8
|
selectedAsset: SelectedAsset | null;
|
|
@@ -35,8 +34,6 @@ export interface SupplyQuoteResult {
|
|
|
35
34
|
isDirect: boolean;
|
|
36
35
|
needsSwap: boolean;
|
|
37
36
|
selectedIsEquivalent: boolean;
|
|
38
|
-
sourceSwap: ResolvedSwap | null;
|
|
39
|
-
pivot: PivotRoute | null;
|
|
40
37
|
}
|
|
41
38
|
export declare function resolveInputSupplySwapQuote(params: {
|
|
42
39
|
chainId: number;
|
|
@@ -8,7 +8,6 @@ export interface UseAssetsConfig {
|
|
|
8
8
|
fetchBalances: (address: Address, supportedChains?: number[]) => Promise<MultiChainBalances>;
|
|
9
9
|
enabled?: boolean;
|
|
10
10
|
refreshInterval?: number;
|
|
11
|
-
priceEnabled?: boolean;
|
|
12
11
|
}
|
|
13
12
|
export interface UseAssetsReturn {
|
|
14
13
|
assets: Asset[];
|
|
@@ -18,4 +17,4 @@ export interface UseAssetsReturn {
|
|
|
18
17
|
getAssetsByChain: (chainId: number) => Asset[];
|
|
19
18
|
getNativeAssets: () => Asset[];
|
|
20
19
|
}
|
|
21
|
-
export declare const useWalletBalances: ({ address, supportedChains, fetchBalances, enabled, refreshInterval,
|
|
20
|
+
export declare const useWalletBalances: ({ address, supportedChains, fetchBalances, enabled, refreshInterval, }: UseAssetsConfig) => UseAssetsReturn;
|