@dhedge/trading-widget 2.0.3 → 2.0.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/core-kit/abi/index.d.ts +1 -1
- package/core-kit/abi/synthetix-v3/ierc-7412.d.ts +12 -0
- package/core-kit/abi/synthetix-v3/index.d.ts +0 -1
- package/core-kit/const/tokens/arbitrum.d.ts +2 -0
- package/core-kit/const/tokens/base.d.ts +2 -0
- package/core-kit/const/tokens/optimism.d.ts +2 -0
- package/core-kit/const/tokens/polygon.d.ts +1 -0
- package/core-kit/hooks/trading/synthetix-v3/use-oracles-update-transaction-data.d.ts +10 -2
- package/core-kit/types/synthetix-v3.types.d.ts +8 -2
- package/core-kit/types/web3.types.d.ts +1 -1
- package/core-kit/utils/formatter.d.ts +1 -1
- package/core-kit/utils/synthetix-v3/eip-7412.d.ts +21 -10
- package/core-kit/utils/synthetix-v3/parse-error.d.ts +1 -1
- package/core-kit/utils/synthetix-v3/pyth-adapter.d.ts +10 -9
- package/{index-e6929f8a.js → index-6f9f1263.js} +7194 -7120
- package/{index-10b54d48.cjs → index-fcb38d25.cjs} +45 -45
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +204 -198
- package/package.json +1 -1
- package/{pyth-adapter-d7e3f2a8.cjs → pyth-adapter-919fe86e.cjs} +6 -6
- package/{pyth-adapter-afff00ae.js → pyth-adapter-9c02b4f7.js} +53 -40
- package/core-kit/abi/synthetix-v3/ierc-2771-context.d.ts +0 -15
- package/core-kit/utils/synthetix-v3/multicall-forwarder-batcher.d.ts +0 -8
package/core-kit/abi/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export { PoolFactoryAbi } from './pool-factory';
|
|
|
6
6
|
export { PoolLogicAbi } from './pool-logic';
|
|
7
7
|
export { PoolManagerLogicAbi } from './pool-manager-logic';
|
|
8
8
|
export { RewardDistributionAbi } from './reward-distribution';
|
|
9
|
-
export { ITrustedMulticallForwarderAbi,
|
|
9
|
+
export { ITrustedMulticallForwarderAbi, IERC7412Abi, SynthetixV3CoreAbi, SynthetixV3AssetGuard, SynthetixV3ContractGuard, } from './synthetix-v3';
|
|
10
10
|
export { FlatcoinPointsModuleAbi } from './flatcoin-points-module';
|
|
11
11
|
export { EasySwapperV2Abi } from './easy-swapper-v2';
|
|
@@ -18,6 +18,14 @@ export declare const IERC7412Abi: readonly [{
|
|
|
18
18
|
readonly internalType: "bytes32";
|
|
19
19
|
}];
|
|
20
20
|
readonly stateMutability: "view";
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "error";
|
|
23
|
+
readonly name: "Errors";
|
|
24
|
+
readonly inputs: readonly [{
|
|
25
|
+
readonly name: "errors";
|
|
26
|
+
readonly type: "bytes[]";
|
|
27
|
+
readonly internalType: "bytes[]";
|
|
28
|
+
}];
|
|
21
29
|
}, {
|
|
22
30
|
readonly type: "error";
|
|
23
31
|
readonly name: "FeeRequired";
|
|
@@ -37,5 +45,9 @@ export declare const IERC7412Abi: readonly [{
|
|
|
37
45
|
readonly name: "oracleQuery";
|
|
38
46
|
readonly type: "bytes";
|
|
39
47
|
readonly internalType: "bytes";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "feeRequired";
|
|
50
|
+
readonly type: "uint256";
|
|
51
|
+
readonly internalType: "uint256";
|
|
40
52
|
}];
|
|
41
53
|
}];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { SynthetixV3AssetGuard } from './synthetix-v3-asset-guard';
|
|
2
2
|
export { SynthetixV3ContractGuard } from './synthetix-v3-contract-guard';
|
|
3
|
-
export { IERC2771ContextAbi } from './ierc-2771-context';
|
|
4
3
|
export { IERC7412Abi } from './ierc-7412';
|
|
5
4
|
export { ITrustedMulticallForwarderAbi } from './i-trusted-multicall-forwarder';
|
|
6
5
|
export { SynthetixV3CoreAbi } from './synthetix-v3-core';
|
|
@@ -3,3 +3,5 @@ export declare const BRIDGED_USDC_ARBITRUM: TradingToken;
|
|
|
3
3
|
export declare const USDC_ARBITRUM: TradingToken;
|
|
4
4
|
export declare const WETH_ARBITRUM: TradingToken;
|
|
5
5
|
export declare const WBTC_ARBITRUM: TradingToken;
|
|
6
|
+
export declare const TBTC_ARBITRUM: TradingToken;
|
|
7
|
+
export declare const WSTETH_ARBITRUM: TradingToken;
|
|
@@ -4,3 +4,5 @@ export declare const USDCBC_BASE: TradingToken;
|
|
|
4
4
|
export declare const WETH_BASE: TradingToken;
|
|
5
5
|
export declare const CBETH_BASE: TradingToken;
|
|
6
6
|
export declare const RETH_BASE: TradingToken;
|
|
7
|
+
export declare const TBTC_BASE: TradingToken;
|
|
8
|
+
export declare const WSTETH_BASE: TradingToken;
|
|
@@ -8,3 +8,5 @@ export declare const DAI_OPTIMISM: TradingToken;
|
|
|
8
8
|
export declare const WBTC_OPTIMISM: TradingToken;
|
|
9
9
|
export declare const SETH_OPTIMISM: TradingToken;
|
|
10
10
|
export declare const LINK_OPTIMISM: TradingToken;
|
|
11
|
+
export declare const TBTC_OPTIMISM: TradingToken;
|
|
12
|
+
export declare const WSTETH_OPTIMISM: TradingToken;
|
|
@@ -6,10 +6,18 @@ interface UseOraclesUpdateQueryVariables {
|
|
|
6
6
|
chainId: number;
|
|
7
7
|
vaultAddress: string;
|
|
8
8
|
}
|
|
9
|
+
type UseOraclesUpdateQueryResult = {
|
|
10
|
+
isOracleDataUpdateNeeded: boolean;
|
|
11
|
+
prependedTxns: TransactionRequest[];
|
|
12
|
+
};
|
|
13
|
+
export declare const DEFAULT_ORACLES_DATA_RESPONSE: {
|
|
14
|
+
isOracleDataUpdateNeeded: boolean;
|
|
15
|
+
prependedTxns: never[];
|
|
16
|
+
};
|
|
9
17
|
export declare const useOraclesUpdateTransactionData: ({ publicClient, account, chainId, vaultAddress, }: {
|
|
10
18
|
publicClient: NonNullable<ReturnType<typeof usePublicClient>> | undefined;
|
|
11
|
-
} & UseOraclesUpdateQueryVariables, options?: Omit<UseQueryOptions<
|
|
19
|
+
} & UseOraclesUpdateQueryVariables, options?: Omit<UseQueryOptions<UseOraclesUpdateQueryResult, DefaultError, UseOraclesUpdateQueryResult, [
|
|
12
20
|
string,
|
|
13
21
|
UseOraclesUpdateQueryVariables
|
|
14
|
-
]>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<
|
|
22
|
+
]>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<UseOraclesUpdateQueryResult, Error>;
|
|
15
23
|
export {};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type { Address,
|
|
1
|
+
import type { Address, Hex, PublicClient, TransactionRequest } from 'core-kit/types/web3.types';
|
|
2
2
|
export interface OracleAdapter {
|
|
3
3
|
getOracleId: () => string;
|
|
4
|
-
fetchOffchainData: (client:
|
|
4
|
+
fetchOffchainData: (client: PublicClient | undefined, oracleContract: Address, oracleQuery: Array<{
|
|
5
|
+
query: Hex;
|
|
6
|
+
fee: bigint;
|
|
7
|
+
}> | undefined) => Promise<Array<{
|
|
8
|
+
arg: Hex;
|
|
9
|
+
fee?: bigint;
|
|
10
|
+
}>>;
|
|
5
11
|
}
|
|
6
12
|
export interface Batcher {
|
|
7
13
|
batchable: (client: PublicClient, transactions: TransactionRequest[]) => Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Chain, TransactionRequest as ViemTransactionRequest } from 'viem';
|
|
2
2
|
export type { UseWriteContractParameters, UseReadContractsParameters, } from 'wagmi';
|
|
3
|
-
export type { Hex, PublicClient, WalletClient, Client, WaitForTransactionReceiptReturnType, CallExecutionError, MulticallReturnType, ContractFunctionReturnType, } from 'viem';
|
|
3
|
+
export type { Hex, PublicClient, WalletClient, Client, WaitForTransactionReceiptReturnType, CallExecutionError, MulticallReturnType, Hash, ContractFunctionReturnType, } from 'viem';
|
|
4
4
|
export type { Address, Chain };
|
|
5
5
|
export type ChainId = Chain['id'];
|
|
6
6
|
export type TransactionRequest = Pick<ViemTransactionRequest, 'to' | 'data' | 'value' | 'from'>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApyCurrency } from 'core-kit/types';
|
|
2
2
|
export declare const formatPercentage: (value: number, maximumFractionDigits?: number) => string;
|
|
3
3
|
export declare const formatToUsd: ({ value, minimumFractionDigits, maximumFractionDigits, compact, normalize, }: {
|
|
4
|
-
value: number;
|
|
4
|
+
value: number | string;
|
|
5
5
|
minimumFractionDigits?: number | undefined;
|
|
6
6
|
maximumFractionDigits?: number | undefined;
|
|
7
7
|
compact?: boolean | undefined;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { usePublicClient } from 'wagmi';
|
|
3
|
+
import type { Address, OracleAdapter, TransactionRequest } from 'core-kit/types';
|
|
4
|
+
export declare const LEGACY_ODR_ERROR: {
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
inputs: {
|
|
8
|
+
type: string;
|
|
9
|
+
}[];
|
|
10
|
+
}[];
|
|
11
|
+
export declare const makeTrustedForwarderMulticall: (transactions: TransactionRequest[]) => {
|
|
12
|
+
from: `0x${string}`;
|
|
13
|
+
to: `0x${string}`;
|
|
14
|
+
value: bigint;
|
|
15
|
+
data: `0x${string}`;
|
|
16
|
+
};
|
|
17
|
+
export declare function resolveAdapterCalls(origError: unknown, publicClient: NonNullable<ReturnType<typeof usePublicClient>> | undefined): Record<Address, Array<{
|
|
18
|
+
query: Hex;
|
|
19
|
+
fee: bigint;
|
|
20
|
+
}>>;
|
|
21
|
+
export declare function resolvePrependTransaction(origError: unknown, publicClient: NonNullable<ReturnType<typeof usePublicClient>> | undefined, adapters: OracleAdapter[], chainId: number): Promise<TransactionRequest[]>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { Address,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fetchOffchainData(client: Client, oracleContract: Address, oracleQuery: Hex): Promise<Hex>;
|
|
5
|
-
}
|
|
6
|
-
export declare class PythAdapter implements Adapter {
|
|
7
|
-
private connection;
|
|
1
|
+
import type { Address, Hex, OracleAdapter, PublicClient } from 'core-kit/types';
|
|
2
|
+
export declare class PythAdapter implements OracleAdapter {
|
|
3
|
+
private readonly connection;
|
|
8
4
|
constructor(endpoint: string);
|
|
9
5
|
getOracleId(): string;
|
|
10
|
-
fetchOffchainData(_client:
|
|
6
|
+
fetchOffchainData(_client: PublicClient | undefined, _oracleContract: Address, oracleQuery: Array<{
|
|
7
|
+
query: Hex;
|
|
8
|
+
fee?: bigint;
|
|
9
|
+
}> | undefined): Promise<Array<{
|
|
10
|
+
arg: Hex;
|
|
11
|
+
fee: bigint;
|
|
12
|
+
}>>;
|
|
11
13
|
}
|
|
12
|
-
export {};
|