@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
93 lines • 3.16 kB
TypeScript
import { ethers } from 'ethers';
import { z } from 'zod';
import { ProtocolType } from '@hyperlane-xyz/utils';
export declare const StorageGasOracleConfigSchema: z.ZodObject<{
gasPrice: z.ZodString;
tokenExchangeRate: z.ZodString;
}, "strip", z.ZodTypeAny, {
gasPrice: string;
tokenExchangeRate: string;
}, {
gasPrice: string;
tokenExchangeRate: string;
}>;
export type StorageGasOracleConfig = z.output<typeof StorageGasOracleConfigSchema>;
export declare const ProtocolAgnositicGasOracleConfigSchema: z.ZodObject<{
gasPrice: z.ZodString;
tokenExchangeRate: z.ZodString;
} & {
tokenDecimals: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
gasPrice: string;
tokenExchangeRate: string;
tokenDecimals?: number | undefined;
}, {
gasPrice: string;
tokenExchangeRate: string;
tokenDecimals?: number | undefined;
}>;
export type ProtocolAgnositicGasOracleConfig = z.output<typeof ProtocolAgnositicGasOracleConfigSchema>;
export declare const IgpCostDataSchema: z.ZodObject<{
handleGasAmount: z.ZodNumber;
totalGasAmount: z.ZodNumber;
totalUsdCost: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
handleGasAmount: number;
totalGasAmount: number;
totalUsdCost: number;
}, {
handleGasAmount: number;
totalGasAmount: number;
totalUsdCost: number;
}>;
export type IgpCostData = z.output<typeof IgpCostDataSchema>;
export declare const ProtocolAgnositicGasOracleConfigWithTypicalCostSchema: z.ZodObject<{
gasPrice: z.ZodString;
tokenExchangeRate: z.ZodString;
} & {
tokenDecimals: z.ZodOptional<z.ZodNumber>;
} & {
typicalCost: z.ZodOptional<z.ZodObject<{
handleGasAmount: z.ZodNumber;
totalGasAmount: z.ZodNumber;
totalUsdCost: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
handleGasAmount: number;
totalGasAmount: number;
totalUsdCost: number;
}, {
handleGasAmount: number;
totalGasAmount: number;
totalUsdCost: number;
}>>;
}, "strip", z.ZodTypeAny, {
gasPrice: string;
tokenExchangeRate: string;
tokenDecimals?: number | undefined;
typicalCost?: {
handleGasAmount: number;
totalGasAmount: number;
totalUsdCost: number;
} | undefined;
}, {
gasPrice: string;
tokenExchangeRate: string;
tokenDecimals?: number | undefined;
typicalCost?: {
handleGasAmount: number;
totalGasAmount: number;
totalUsdCost: number;
} | undefined;
}>;
export type ProtocolAgnositicGasOracleConfigWithTypicalCost = z.output<typeof ProtocolAgnositicGasOracleConfigWithTypicalCostSchema>;
export type OracleData = {
tokenExchangeRate: ethers.BigNumber;
gasPrice: ethers.BigNumber;
};
export declare const formatGasOracleConfig: (localChainProtocol: ProtocolType, config: OracleData) => {
tokenExchangeRate: string;
gasPrice: string;
};
export declare const oracleConfigToOracleData: (config: StorageGasOracleConfig) => OracleData;
export declare const serializeDifference: (localChainProtocol: ProtocolType, actual: OracleData, expected: OracleData) => string;
//# sourceMappingURL=types.d.ts.map