@wormhole-foundation/sdk-connect
Version:
The core package for the Connect SDK, used in conjunction with 1 or more of the chain packages
60 lines • 1.82 kB
TypeScript
import type { TokenId } from "@wormhole-foundation/sdk-definitions";
import type { AttestationReceipt, TransferReceipt } from "../types.js";
import { amount } from "@wormhole-foundation/sdk-base";
import type { QuoteWarning } from "../warnings.js";
export interface Options {
}
export interface TransferParams<OP> {
amount: string;
options?: OP;
}
export type Receipt<AT extends AttestationReceipt = AttestationReceipt> = TransferReceipt<AT>;
export interface ValidatedTransferParams<OP> extends Required<TransferParams<OP>> {
}
export type ValidationResult<OP> = {
params: ValidatedTransferParams<OP>;
valid: true;
} | {
params: TransferParams<OP>;
valid: false;
error: Error;
};
export type QuoteResult<OP, VP extends ValidatedTransferParams<OP> = ValidatedTransferParams<OP>, D = any> = Quote<OP, VP, D> | QuoteError;
export type Quote<OP, VP extends ValidatedTransferParams<OP> = ValidatedTransferParams<OP>, D = any> = {
success: true;
params: VP;
sourceToken: {
token: TokenId;
amount: amount.Amount;
};
destinationToken: {
token: TokenId;
amount: amount.Amount;
};
relayFee?: {
token: TokenId;
amount: amount.Amount;
};
destinationNativeGas?: amount.Amount;
details?: D;
warnings?: QuoteWarning[];
eta?: number;
expires?: Date;
};
export type QuoteError = {
success: false;
error: Error;
};
export declare class MinAmountError extends Error {
min: amount.Amount;
constructor(min: amount.Amount);
minAmount(): amount.Amount;
}
export declare class UnavailableError extends Error {
internalError: Error;
constructor(internalErr: Error);
}
export declare class RelayFailedError extends Error {
constructor(message: string);
}
//# sourceMappingURL=types.d.ts.map