///
import { HttpClientError } from "./http-client.js";
export interface Wormholescan {
listVaas: (chain: number, emitterAddress: string, opts?: WormholescanOptions) => Promise>;
getVaa: (chain: number, emitterAddress: string, sequence: bigint, opts?: WormholescanOptions) => Promise>;
}
/**
* Client for the wormholescan API that never throws, but instead returns a WormholescanResult that may contain an error.
*/
export declare class WormholescanClient implements Wormholescan {
private baseUrl;
private defaultOptions?;
private client;
constructor(baseUrl: URL, defaultOptions?: WormholescanOptions);
listVaas(chain: number, emitterAddress: string, opts?: WormholescanOptions): Promise>;
getVaa(chain: number, emitterAddress: string, sequence: bigint, opts?: WormholescanOptions): Promise>;
getTransaction(chain: number, emitterAddress: string, sequence: bigint, opts?: WormholescanOptions): Promise>;
private mapError;
private getPage;
private getPageSize;
}
export type WormholescanOptions = {
pageSize?: number;
page?: number;
retries?: number;
initialDelay?: number;
maxDelay?: number;
timeout?: number;
noCache?: boolean;
};
/**
* Parsed response model.
*/
export type WormholescanVaa = {
id: string;
sequence: bigint;
vaa: Buffer;
emitterAddr: string;
emitterChain: number;
txHash?: string;
};
/**
* Wormhole Transaction response
*/
export interface WormholescanTransactionResponse {
id: string;
timestamp: string;
txHash: string;
emitterChain: number;
emitterAddress: string;
emitterNativeAddress: string;
tokenAmount: string;
usdAmount: string;
symbol: string;
payload: Payload;
standardizedProperties: StandardizedProperties;
globalTx: GlobalTransaction;
}
export type WormholescanTransaction = {
id: string;
timestamp: string;
txHash: string;
emitterChain: number;
emitterAddress: string;
emitterNativeAddress: string;
tokenAmount: string;
usdAmount: string;
symbol: string;
payload: Payload;
standardizedProperties: StandardizedProperties;
globalTx: GlobalTransaction;
};
export type GlobalTransaction = {
id: string;
originTx: {
txHash: string;
from: string;
status: string;
attribute: null | string;
};
destinationTx: {
chainId: number;
status: string;
method: string;
txHash: string;
from: string;
to: string;
blockNumber: string;
timestamp: string;
updatedAt: string;
};
};
interface StandardizedProperties {
amount: string;
appIds: string[];
fee: string;
feeAddress: string;
feeChain: number;
fromAddress: string;
fromChain: number;
toAddress: string;
toChain: number;
tokenAddress: string;
tokenChain: number;
}
interface Payload {
amount: string;
fee: string;
fromAddress: null | string;
parsedPayload: null | string;
payload: string;
payloadType: number;
toAddress: string;
toChain: number;
tokenAddress: string;
tokenChain: number;
}
export type WormholescanResult = {
error: HttpClientError;
} | {
data: T;
};
export {};