@spicenet-io/spiceflow-ui 4.0.14 → 4.1.0
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/index.cjs.js +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/privy-BpFzOWq5.js +0 -0
- package/dist/privy-DayQIFrD.js +0 -0
- package/dist/types/deposit.d.ts +3 -2
- package/dist/types/lock.d.ts +2 -1
- package/dist/types/supply.d.ts +2 -1
- package/dist/types/withdraw.d.ts +2 -1
- package/dist/utils/errors.d.ts +7 -0
- package/dist/utils/relayer/index.d.ts +3 -1
- package/package.json +1 -1
- package/dist/privy-BdHp5Owr.js +0 -0
- package/dist/privy-Ds5DCgFX.js +0 -0
|
Binary file
|
|
Binary file
|
package/dist/types/deposit.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ChainBatch } from ".";
|
|
|
3
3
|
import { UseAssetInputReturn } from "../hooks/useAssetInput";
|
|
4
4
|
import { Asset } from "./assets";
|
|
5
5
|
import { CustomStyles, Theme } from "./theme";
|
|
6
|
+
import type { RelayerErrorDetail } from "../utils/errors";
|
|
6
7
|
import type { IntentStatus } from "./status";
|
|
7
8
|
import type { Network } from "@spicenet-io/spiceflow-core";
|
|
8
9
|
import type { VerifiedPendingDeposit } from "../hooks/usePendingDeposit";
|
|
@@ -52,7 +53,7 @@ export interface DepositModalProps {
|
|
|
52
53
|
sourceChain?: string;
|
|
53
54
|
txHash?: string;
|
|
54
55
|
}) => void;
|
|
55
|
-
onDepositError?: (error: string) => void;
|
|
56
|
+
onDepositError?: (error: string, detail?: RelayerErrorDetail) => void;
|
|
56
57
|
onViewAllAssets?: () => void;
|
|
57
58
|
}
|
|
58
59
|
export interface EscrowRecovery {
|
|
@@ -84,7 +85,7 @@ export interface SpiceDepositProps {
|
|
|
84
85
|
sourceChain?: string;
|
|
85
86
|
txHash?: string;
|
|
86
87
|
}) => void;
|
|
87
|
-
onDepositError?: (error: string) => void;
|
|
88
|
+
onDepositError?: (error: string, detail?: RelayerErrorDetail) => void;
|
|
88
89
|
skipRecovery?: boolean;
|
|
89
90
|
}
|
|
90
91
|
export interface SelectTokenModalProps {
|
package/dist/types/lock.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CustomStyles } from "./theme";
|
|
2
|
+
import type { RelayerErrorDetail } from "../utils/errors";
|
|
2
3
|
import { Address } from "viem";
|
|
3
4
|
import { ChainBatch } from ".";
|
|
4
5
|
import { UseAssetInputReturn } from "../hooks/useAssetInput";
|
|
@@ -39,7 +40,7 @@ export interface SpiceLockModalProps {
|
|
|
39
40
|
votingPowerEstimate?: (amount: number, months: number) => number;
|
|
40
41
|
escrowAddress?: Address;
|
|
41
42
|
onLockSuccess?: (txHash?: string) => void;
|
|
42
|
-
onLockError?: (error: string) => void;
|
|
43
|
+
onLockError?: (error: string, detail?: RelayerErrorDetail) => void;
|
|
43
44
|
onLockExecute?: (ctx: LockExecuteContext) => Promise<string | void>;
|
|
44
45
|
sourceToDestinationConversionRate?: number;
|
|
45
46
|
onAddFunds?: () => void;
|
package/dist/types/supply.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Address } from "viem";
|
|
|
3
3
|
import type { Asset } from "./assets";
|
|
4
4
|
import type { Call, ChainBatch } from "./authorization";
|
|
5
5
|
import type { CustomStyles } from "./theme";
|
|
6
|
+
import type { RelayerErrorDetail } from "../utils/errors";
|
|
6
7
|
import type { ExactOutputSwapIntent, ResolvedExactOutputSwap } from "../utils/swapQuotes";
|
|
7
8
|
export interface DestinationTokenConfig {
|
|
8
9
|
address: Address;
|
|
@@ -87,7 +88,7 @@ export interface SpiceSupplyProps {
|
|
|
87
88
|
subtitle?: React.ReactNode;
|
|
88
89
|
onAddFunds?: () => void;
|
|
89
90
|
onSuccess?: (txHash: string) => void;
|
|
90
|
-
onError?: (error: Error) => void;
|
|
91
|
+
onError?: (error: Error, detail?: RelayerErrorDetail) => void;
|
|
91
92
|
}
|
|
92
93
|
export interface SupplyEstimateProps {
|
|
93
94
|
isQuoting: boolean;
|
package/dist/types/withdraw.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
2
|
import type { CustomStyles } from "./theme";
|
|
3
3
|
import type { ChainBatch } from "./authorization";
|
|
4
|
+
import type { RelayerErrorDetail } from "../utils/errors";
|
|
4
5
|
export interface DestinationToken {
|
|
5
6
|
address: Address;
|
|
6
7
|
symbol: string;
|
|
@@ -24,7 +25,7 @@ export interface SpiceWithdrawProps {
|
|
|
24
25
|
amount: string;
|
|
25
26
|
chainId: number;
|
|
26
27
|
}) => void;
|
|
27
|
-
onWithdrawError?: (error: string) => void;
|
|
28
|
+
onWithdrawError?: (error: string, detail?: RelayerErrorDetail) => void;
|
|
28
29
|
availableTokens?: Record<number, DestinationToken[]>;
|
|
29
30
|
buildSpicenetBatch?: (params: {
|
|
30
31
|
destinationChainId: number;
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -8,6 +8,13 @@ export declare class SpiceflowError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
export declare function isSpiceflowError(err: unknown): err is SpiceflowError;
|
|
10
10
|
export declare const isUserRejection: (error: unknown) => boolean;
|
|
11
|
+
export interface RelayerErrorDetail {
|
|
12
|
+
requestId?: string;
|
|
13
|
+
httpStatus?: number;
|
|
14
|
+
responseBody?: string;
|
|
15
|
+
endpoint?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function getRelayerErrorDetail(message: string): RelayerErrorDetail | undefined;
|
|
11
18
|
export declare const sanitizeError: (error: unknown, fallback?: string) => string;
|
|
12
19
|
export declare function decodeRevertReason(input: unknown): string | undefined;
|
|
13
20
|
export declare function formatFeeEstimateError(request: CreateActionRequest, message: string): string;
|
|
@@ -3,11 +3,13 @@ import { SwapStep } from "../../types/status";
|
|
|
3
3
|
import { ChainBatch, ChainAuthorization } from "../../types/authorization";
|
|
4
4
|
import type { RollupBalanceEntry } from "../rollupBalances";
|
|
5
5
|
export declare const RELAYER_API_URL: string;
|
|
6
|
+
export declare function relayerFetch(endpoint: string, init?: RequestInit): Promise<Response & {
|
|
7
|
+
requestId?: string;
|
|
8
|
+
}>;
|
|
6
9
|
export declare class RelayerService {
|
|
7
10
|
private baseUrl;
|
|
8
11
|
setBaseUrl(url: string): void;
|
|
9
12
|
getBaseUrl(): string;
|
|
10
|
-
private postJson;
|
|
11
13
|
createAction(request: CreateActionRequest): Promise<CreateActionResponse>;
|
|
12
14
|
estimateActionFees(request: CreateActionRequest): Promise<FeeEstimateSummary>;
|
|
13
15
|
estimateBatchGas(request: {
|
package/package.json
CHANGED
package/dist/privy-BdHp5Owr.js
DELETED
|
Binary file
|
package/dist/privy-Ds5DCgFX.js
DELETED
|
Binary file
|