import { Connection, PublicKey } from '@solana/web3.js'; import { ProtocolType } from '@hyperlane-xyz/provider-sdk'; import { IToken } from '../token/IToken.js'; import { TokenAmount } from '../token/TokenAmount.js'; import { ChainNameOrId } from '../types.js'; import type { WarpCore } from '../warp/WarpCore.js'; import { WarpTypedTransaction } from '../warp/types.js'; import { FeeQuotingV2Client } from './client.js'; import type { QuotedTransferProvider } from './QuotedTransferProvider.js'; /** * `keccak256(payer || clientSalt)` — mirrors the on-chain * `SvmSignedQuote::compute_scoped_salt` in the Rust quote-verifier. * * Duplicated from svm-sdk's `computeScopedSalt` per * `[no-svm-sdk-dep-in-main-sdk]`. The provider keeps the raw client salt * (for the API request + the signed-quote payload) and the scoped salt * (for the bundle PDA cascade + IGP transient PDA derivation) as * separate values. * * Exported for testing — not part of the package's external API surface. */ export declare function computeSealevelScopedSalt(payer: PublicKey, clientSalt: Uint8Array): Uint8Array; export interface SealevelQuotedTransferProviderOpts { feeQuotingClient: FeeQuotingV2Client; connection: Connection; /** * Random-salt source — override for deterministic tests. Defaults to ethers' * isomorphic `randomBytes` (works in Node + browser). */ randomSalt?: () => Uint8Array; } /** * Sealevel implementation of `QuotedTransferProvider`. Produces a single * atomic tx that prepends `SubmitFeeQuote` (and, when configured, * `SubmitIgpQuote`) ixs onto the Sealevel adapter's `transfer_remote` / * `transfer_remote_to` ix bundle. * * Tx layout: * [...computeBudgetIxs, submitFeeQuote, submitIgpQuote?, transferRemote] * * Atomicity is required for transient mode (one-shot PDA — racy if split * across txs) and uniform with standing mode (one wallet confirmation). */ export declare class SealevelQuotedTransferProvider implements QuotedTransferProvider { private readonly opts; readonly protocol = ProtocolType.Sealevel; constructor(opts: SealevelQuotedTransferProviderOpts); /** * Shared prep for both quote entry points. Resolves the SVM adapter + token * account, builds the identical warp/IGP request shapes (same salt, * targetRouter, recipient, and same-domain IGP gate), and fetches the warp + * optional IGP signed quotes in parallel. `getQuotedTransferFee` prices these * for display; `buildQuotedTransferTxs` composes them into submit txs — * keeping the derivation in one place so displayed and paid quotes can't * drift. */ private prepareSealevelQuote; /** * Display-time fee fetch. Hits the offchain quoter for warp (+ optional * IGP) signed quotes, decodes each `data` as a `FeeDataStrategy`, and * applies the Linear formula at `originTokenAmount.amount` to produce the * priced tuple. Standalone from `buildQuotedTransferTxs` — the submit path * re-fetches independently rather than reusing display state. * * `tokenFeeQuote.token` is the bridged token (matches what the on-chain * fee program charges); `igpQuote.token` is the origin chain's native * (SOL on Solana mainnet). */ getQuotedTransferFee({ warpCore, originTokenAmount, destination, sender, recipient, destinationToken, }: { warpCore: WarpCore; originTokenAmount: TokenAmount; destination: ChainNameOrId; sender: string; recipient: string; destinationToken?: IToken; }): Promise<{ igpQuote: TokenAmount; tokenFeeQuote?: TokenAmount; }>; buildQuotedTransferTxs({ warpCore, originTokenAmount, destination, sender, recipient, destinationToken, }: { warpCore: WarpCore; originTokenAmount: TokenAmount; destination: ChainNameOrId; sender: string; recipient: string; destinationToken?: IToken; }): Promise>; } //# sourceMappingURL=SealevelQuotedTransferProvider.d.ts.map