@spicenet-io/spiceflow-ui 4.7.11 → 4.8.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-privy.cjs.js +1 -1
- package/dist/auth-privy.js +1 -1
- package/dist/components/AccountDisplay/parts/AccountActions.d.ts +1 -0
- package/dist/components/AccountDisplay/parts/AccountPanel.d.ts +1 -0
- package/dist/components/SpiceSupply/lib/buildBatches.d.ts +1 -0
- package/dist/components/SpiceSupply/lib/executors.d.ts +2 -0
- package/dist/components/SpiceSupply/lib/feePreview.d.ts +2 -0
- package/dist/execution/fundEmbeddedWallet.d.ts +7 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useSpiceSupply.d.ts +59 -0
- package/dist/hooks/useSupplyAssets.d.ts +3 -1
- package/dist/hooks/useSupplyQuote.d.ts +4 -1
- package/dist/index.cjs.js +11 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +13 -13
- package/dist/privy-Bmq5ZKsB.js +2 -0
- package/dist/privy-DB3mdjuj.js +2 -0
- package/dist/providers/SpiceFlowProvider.d.ts +0 -3
- package/dist/types/assets.d.ts +2 -0
- package/dist/types/deposit.d.ts +1 -51
- package/dist/types/supply.d.ts +2 -1
- package/dist/utils/crossChainRouter/algebra.d.ts +83 -0
- package/dist/utils/crossChainRouter/liquidityVenues.d.ts +5 -14
- package/dist/utils/crossChainRouter/uniV3.d.ts +7 -30
- package/dist/utils/crossChainRouter/uniV4.d.ts +0 -34
- package/dist/utils/fees.d.ts +7 -0
- package/dist/utils/spiceConstants.d.ts +2 -0
- package/dist/utils/spicenetBatch.d.ts +18 -0
- package/dist/utils/swapQuotes.d.ts +2 -3
- package/package.json +2 -3
- package/dist/components/SpiceDeposit/lib/swapper.d.ts +0 -35
- package/dist/components/SpiceDeposit/steps/SelectSourceModal.d.ts +0 -3
- package/dist/components/SpiceDeposit/steps/SwapperDepositModal.d.ts +0 -3
- package/dist/hooks/useSwapperEmbed.d.ts +0 -23
- package/dist/privy-BXdQgePJ.js +0 -2
- package/dist/privy-DinsCCJf.js +0 -2
- package/dist/utils/crossChainRouter/nativeWrap.d.ts +0 -6
package/dist/auth-privy.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const r=require("./privy-
|
|
2
|
+
"use strict";const r=require("./privy-DB3mdjuj.js");require("react/jsx-runtime"),require("react"),require("@spicenet-io/spiceflow-core"),require("viem"),require("viem/actions"),require("@privy-io/react-auth"),require("wagmi"),require("@tanstack/react-query"),exports.PrivyLogin=r.PrivyLogin;
|
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-Bmq5ZKsB.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};
|
|
@@ -18,6 +18,7 @@ interface AccountPanelProps {
|
|
|
18
18
|
notice?: AccountNotice | null;
|
|
19
19
|
onDepositClick?: () => void;
|
|
20
20
|
onWithdrawClick?: () => void;
|
|
21
|
+
onDisconnectClick: () => void;
|
|
21
22
|
depositDisabled?: boolean;
|
|
22
23
|
onCompleteDeposit?: (deposit: VerifiedPendingDeposit) => void;
|
|
23
24
|
primaryColor?: string;
|
|
@@ -7,6 +7,7 @@ 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 buildEmbeddedEscrowDepositBatch(token: Address, amount: bigint, chainId: number): ChainBatch;
|
|
10
11
|
export declare function stripSpicenetFundingBatches(batches: ChainBatch[]): ChainBatch[];
|
|
11
12
|
export declare function scaleTokenAmount(amount: bigint, fromDecimals: number, toDecimals: number): bigint;
|
|
12
13
|
export interface BatchBuilderContext {
|
|
@@ -12,12 +12,14 @@ export type PaymentResult = {
|
|
|
12
12
|
txHash?: string;
|
|
13
13
|
error?: string;
|
|
14
14
|
};
|
|
15
|
+
export declare function isExternalSource(asset: SelectedAsset["asset"] | null | undefined, isNon7702: boolean): boolean;
|
|
15
16
|
export type ExecutorContext = {
|
|
16
17
|
selectedAsset: SelectedAsset | null;
|
|
17
18
|
parsedAmount: number;
|
|
18
19
|
currentPaymentAmount: string;
|
|
19
20
|
isInsufficientBalance: boolean;
|
|
20
21
|
isPayMode: boolean;
|
|
22
|
+
isFeeInclusiveInput: boolean;
|
|
21
23
|
isNon7702: boolean;
|
|
22
24
|
isSourceDestToken: boolean;
|
|
23
25
|
needsSwap: boolean;
|
|
@@ -36,6 +36,7 @@ export declare function estimatePayFunding(args: {
|
|
|
36
36
|
export declare function estimateSupplyMaxAmount(ctx: {
|
|
37
37
|
asset: Asset;
|
|
38
38
|
isPayMode: boolean;
|
|
39
|
+
isFeeInclusiveInput?: boolean;
|
|
39
40
|
isNon7702: boolean;
|
|
40
41
|
needsSwap: boolean;
|
|
41
42
|
isQuoting: boolean;
|
|
@@ -49,6 +50,7 @@ export interface FeePreviewContext {
|
|
|
49
50
|
signal?: AbortSignal;
|
|
50
51
|
selectedAsset: SelectedAsset | null;
|
|
51
52
|
isPayMode: boolean;
|
|
53
|
+
isFeeInclusiveInput?: boolean;
|
|
52
54
|
parsedAmount: number;
|
|
53
55
|
needsSwap: boolean;
|
|
54
56
|
exactOutputSwap: ResolvedExactOutputSwap | null;
|
|
@@ -6,6 +6,13 @@ export declare function sendTokenTransferTx(extWc: any, params: {
|
|
|
6
6
|
amount: bigint;
|
|
7
7
|
viemChain?: unknown;
|
|
8
8
|
}): Promise<`0x${string}`>;
|
|
9
|
+
export declare function readEmbeddedShortfall(params: {
|
|
10
|
+
sourceClient: any;
|
|
11
|
+
holder: Address;
|
|
12
|
+
tokenAddr: Address;
|
|
13
|
+
isNative: boolean;
|
|
14
|
+
amount: bigint;
|
|
15
|
+
}): Promise<bigint>;
|
|
9
16
|
export declare function fundEmbeddedWallet(params: {
|
|
10
17
|
extWc: any;
|
|
11
18
|
sourceClient: any;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -19,3 +19,5 @@ export type { PartnerWhitelistCheckResponse, UseIsUserWhitelistedOptions, } from
|
|
|
19
19
|
export { useSupplyAssets, isSupportedSupplyAsset } from "./useSupplyAssets";
|
|
20
20
|
export { useSupplyQuote, resolveInputSupplySwapQuote } from "./useSupplyQuote";
|
|
21
21
|
export type { UseSupplyQuoteOpts, SupplyQuoteResult } from "./useSupplyQuote";
|
|
22
|
+
export { useSpiceSupply } from "./useSpiceSupply";
|
|
23
|
+
export type { UseSpiceSupplyParams, UseSpiceSupplyResult, } from "./useSpiceSupply";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import { type PaymentResult, type SupplyStep } from "../components/SpiceSupply/lib/executors";
|
|
3
|
+
import { useSupplyAssets } from "./useSupplyAssets";
|
|
4
|
+
import { useSupplyQuote } from "./useSupplyQuote";
|
|
5
|
+
import type { LiquidityVenue } from "../utils/crossChainRouter/liquidityVenues";
|
|
6
|
+
import type { SpiceSupplyProps } from "../types/supply";
|
|
7
|
+
import type { Asset, SelectedAsset } from "../types/assets";
|
|
8
|
+
import type { FeePreview } from "../types/ui";
|
|
9
|
+
export interface UseSpiceSupplyParams extends Pick<SpiceSupplyProps, "destinationToken" | "sourceChains" | "supportedSourceAssets" | "includeExternalWalletAssets" | "buildActionCalls" | "feeExecutionMode" | "buildSpicenetBatch" | "onPayExecute" | "resolveExactOutputSwap" | "amountDirection" | "onSuccess" | "onError"> {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
selectedAsset: SelectedAsset | null;
|
|
12
|
+
paymentAmount?: string;
|
|
13
|
+
recipient?: Address;
|
|
14
|
+
maxSlippage?: number;
|
|
15
|
+
resolveInputSwap?: LiquidityVenue["resolve"];
|
|
16
|
+
prependSourceEscrow?: boolean;
|
|
17
|
+
isZeroAmountPay?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface UseSpiceSupplyResult {
|
|
20
|
+
assets: ReturnType<typeof useSupplyAssets> & {
|
|
21
|
+
selectable: Asset[];
|
|
22
|
+
};
|
|
23
|
+
quote: ReturnType<typeof useSupplyQuote>;
|
|
24
|
+
fees: {
|
|
25
|
+
preview: FeePreview | null;
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
ready: boolean;
|
|
28
|
+
error: string | null;
|
|
29
|
+
};
|
|
30
|
+
amount: {
|
|
31
|
+
parsed: number;
|
|
32
|
+
isBelowMinimum: boolean;
|
|
33
|
+
isInsufficientBalance: boolean;
|
|
34
|
+
sourceBalance: number;
|
|
35
|
+
feesExceedAmount: boolean;
|
|
36
|
+
};
|
|
37
|
+
status: {
|
|
38
|
+
step: SupplyStep;
|
|
39
|
+
statusMsg: string;
|
|
40
|
+
txHash: string | null;
|
|
41
|
+
isExecuting: boolean;
|
|
42
|
+
error: string | null;
|
|
43
|
+
showStatusPanel: boolean;
|
|
44
|
+
paymentResult: PaymentResult | null;
|
|
45
|
+
};
|
|
46
|
+
flags: {
|
|
47
|
+
directExecutionFeeNote: boolean;
|
|
48
|
+
};
|
|
49
|
+
canExecute: boolean;
|
|
50
|
+
submitSupply: () => Promise<void>;
|
|
51
|
+
submitPay: () => Promise<void>;
|
|
52
|
+
fundEmbeddedSource: (amount: bigint) => Promise<void>;
|
|
53
|
+
retrySupply: () => void;
|
|
54
|
+
dismissPaymentStatus: () => void;
|
|
55
|
+
resolveMaxAmount: (asset: Asset) => Promise<string | null>;
|
|
56
|
+
resetAfterSuccess: () => void;
|
|
57
|
+
resetPaymentState: () => void;
|
|
58
|
+
}
|
|
59
|
+
export declare function useSpiceSupply(params: UseSpiceSupplyParams): UseSpiceSupplyResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
2
|
import type { Asset } from "../types/assets";
|
|
3
|
-
export declare function isSupportedSupplyAsset(asset: Pick<Asset, "address" | "chainTokens">, supportedSourceAssets?: string[]): boolean;
|
|
3
|
+
export declare function isSupportedSupplyAsset(asset: Pick<Asset, "address" | "chainTokens" | "isNative">, supportedSourceAssets?: string[]): boolean;
|
|
4
4
|
type DestinationToken = {
|
|
5
5
|
address: Address;
|
|
6
6
|
decimals: number;
|
|
@@ -14,9 +14,11 @@ export declare function useSupplyAssets(opts: {
|
|
|
14
14
|
supportedSourceAssets?: string[];
|
|
15
15
|
sourceChains?: number[];
|
|
16
16
|
enabled: boolean;
|
|
17
|
+
includeExternalWalletAssets?: boolean;
|
|
17
18
|
}): {
|
|
18
19
|
displayAssets: (Asset & {
|
|
19
20
|
_source: "wallet" | "spice";
|
|
21
|
+
_fundingWallet?: "embedded" | "external";
|
|
20
22
|
})[];
|
|
21
23
|
filteredSpiceAssets: Asset[];
|
|
22
24
|
walletAssets: Asset[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
-
import type { ResolvedSwap } from "../utils/crossChainRouter/liquidityVenues";
|
|
2
|
+
import type { LiquidityVenue, ResolvedSwap } from "../utils/crossChainRouter/liquidityVenues";
|
|
3
3
|
import { type ExactOutputSwapIntent, type ResolvedExactOutputSwap } from "../utils/swapQuotes";
|
|
4
4
|
import type { SelectedAsset } from "../types/assets";
|
|
5
5
|
export interface UseSupplyQuoteOpts {
|
|
@@ -14,6 +14,8 @@ export interface UseSupplyQuoteOpts {
|
|
|
14
14
|
chainId: number;
|
|
15
15
|
recipient: Address | undefined;
|
|
16
16
|
paymentAmount?: string;
|
|
17
|
+
maxSlippage?: number;
|
|
18
|
+
resolveInputSwap?: LiquidityVenue["resolve"];
|
|
17
19
|
resolveExactOutputSwap?: (intent: ExactOutputSwapIntent, chainId: number, recipient: Address) => Promise<ResolvedExactOutputSwap | null>;
|
|
18
20
|
}
|
|
19
21
|
export interface SupplyQuoteResult {
|
|
@@ -35,5 +37,6 @@ export declare function resolveInputSupplySwapQuote(params: {
|
|
|
35
37
|
tokenIn: Address;
|
|
36
38
|
tokenOut: Address;
|
|
37
39
|
amountIn: bigint;
|
|
40
|
+
maxSlippage?: number;
|
|
38
41
|
}): Promise<ResolvedSwap>;
|
|
39
42
|
export declare function useSupplyQuote(opts: UseSupplyQuoteOpts): SupplyQuoteResult;
|