@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
408 lines • 15.9 kB
TypeScript
import { z } from 'zod';
export declare enum OnchainTokenFeeType {
LinearFee = 1,
RegressiveFee = 2,
ProgressiveFee = 3,
RoutingFee = 4
}
export declare enum TokenFeeType {
LinearFee = "LinearFee",
ProgressiveFee = "ProgressiveFee",
RegressiveFee = "RegressiveFee",
RoutingFee = "RoutingFee"
}
export declare const ImmutableTokenFeeType: readonly [TokenFeeType.LinearFee, TokenFeeType.RegressiveFee, TokenFeeType.ProgressiveFee];
export declare const onChainTypeToTokenFeeTypeMap: Record<OnchainTokenFeeType, TokenFeeType>;
export declare const BaseFeeConfigSchema: z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
}, "strip", z.ZodTypeAny, {
owner: string;
token: string;
}, {
owner: string;
token: string;
}>;
export type BaseTokenFeeConfig = z.infer<typeof BaseFeeConfigSchema>;
export declare const FeeParametersSchema: z.ZodObject<{
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
}, "strip", z.ZodTypeAny, {
maxFee: bigint;
halfAmount: bigint;
}, {
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>;
export type FeeParameters = z.infer<typeof FeeParametersSchema>;
export declare const LinearFeeConfigSchema: z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.LinearFee>;
bps: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
bps: bigint;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
bps: string | number | bigint;
}>;
export type LinearFeeConfig = z.infer<typeof LinearFeeConfigSchema>;
export declare const LinearFeeInputConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
halfAmount: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
type: z.ZodLiteral<TokenFeeType.LinearFee>;
bps: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
bps?: bigint | undefined;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
bps?: string | number | bigint | undefined;
}>, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
bps?: bigint | undefined;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
bps?: string | number | bigint | undefined;
}>, {
bps: bigint;
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
bps?: string | number | bigint | undefined;
}>;
export type LinearFeeInputConfig = z.infer<typeof LinearFeeInputConfigSchema>;
export declare const ProgressiveFeeConfigSchema: z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.ProgressiveFee>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.ProgressiveFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
}, {
type: TokenFeeType.ProgressiveFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>;
export type ProgressiveFeeConfig = z.infer<typeof ProgressiveFeeConfigSchema>;
export declare const RegressiveFeeConfigSchema: z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.RegressiveFee>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RegressiveFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
}, {
type: TokenFeeType.RegressiveFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>;
export type RegressiveFeeConfig = z.infer<typeof RegressiveFeeConfigSchema>;
export declare const RoutingFeeConfigSchema: z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
type: z.ZodLiteral<TokenFeeType.RoutingFee>;
feeContracts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>>>;
maxFee: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
halfAmount: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}>;
export type RoutingFeeConfig = z.infer<typeof RoutingFeeConfigSchema>;
export declare const RoutingFeeInputConfigSchema: z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
type: z.ZodLiteral<TokenFeeType.RoutingFee>;
maxFee: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
halfAmount: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
} & {
feeContracts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>>>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}>;
export type RoutingFeeInputConfig = z.infer<typeof RoutingFeeInputConfigSchema>;
export declare const TokenFeeConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.LinearFee>;
bps: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
bps: bigint;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
bps: string | number | bigint;
}>, z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.ProgressiveFee>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.ProgressiveFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
}, {
type: TokenFeeType.ProgressiveFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>, z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.RegressiveFee>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RegressiveFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
}, {
type: TokenFeeType.RegressiveFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>, z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
type: z.ZodLiteral<TokenFeeType.RoutingFee>;
feeContracts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>>>;
maxFee: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
halfAmount: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}>]>;
export type TokenFeeConfig = z.infer<typeof TokenFeeConfigSchema>;
export declare const TokenFeeConfigInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
halfAmount: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
type: z.ZodLiteral<TokenFeeType.LinearFee>;
bps: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
bps?: bigint | undefined;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
bps?: string | number | bigint | undefined;
}>, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
bps?: bigint | undefined;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
bps?: string | number | bigint | undefined;
}>, {
bps: bigint;
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
}, {
type: TokenFeeType.LinearFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
bps?: string | number | bigint | undefined;
}>, z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.ProgressiveFee>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.ProgressiveFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
}, {
type: TokenFeeType.ProgressiveFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>, z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
} & {
maxFee: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
halfAmount: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>;
} & {
type: z.ZodLiteral<TokenFeeType.RegressiveFee>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RegressiveFee;
owner: string;
token: string;
maxFee: bigint;
halfAmount: bigint;
}, {
type: TokenFeeType.RegressiveFee;
owner: string;
token: string;
maxFee: string | number | bigint;
halfAmount: string | number | bigint;
}>, z.ZodObject<{
token: z.ZodString;
owner: z.ZodString;
type: z.ZodLiteral<TokenFeeType.RoutingFee>;
maxFee: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
halfAmount: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodBigInt, z.ZodNumber]>, z.ZodString]>, bigint, string | number | bigint>>;
} & {
feeContracts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>>>;
}, "strip", z.ZodTypeAny, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: bigint | undefined;
halfAmount?: bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}, {
type: TokenFeeType.RoutingFee;
owner: string;
token: string;
maxFee?: string | number | bigint | undefined;
halfAmount?: string | number | bigint | undefined;
feeContracts?: Record<string, any> | undefined;
}>]>;
export type TokenFeeConfigInput = z.infer<typeof TokenFeeConfigInputSchema>;
//# sourceMappingURL=types.d.ts.map