import { Chain } from "../../lib/caip2.js"; import { FeeEstimation } from "../../shared-types.js"; import { ChainKind, OmniAddress } from "@omni-bridge/core"; //#region src/bridges/omni-bridge/omni-withdraw-params.d.ts /** * The values an Omni withdrawal computes before it builds the intents. * * `storageDepositAccountId` is derived from `externalId`, and letter case takes part in that * derivation, so recomputing any of these sends the native fee to a different account. */ type OmniWithdrawIntentParams = { /** The NEP-141 account of the asset. */ tokenAccountId: string; recipient: OmniAddress; /** Empty, except for a UTXO chain. Then it contains `MaxGasFee`. */ msg: string; /** * This value makes the storage account unique. The hash covers the rest of the transfer, * so two withdrawals that match on every field would otherwise land on one account. * `calculateStorageAccountId` throws above 64 UTF-8 bytes. */ externalId: string; /** The account that gets the native fee. Null if there is no native fee. */ storageDepositAccountId: string | null; /** * The amount the `ft_withdraw` carries. A UTXO chain adds its own fees to the amount the * caller asked for, because they are paid from the asset and not from wrap.near. */ amount: bigint; /** The relayer fee. It goes in `native_token_fee`, and the storage deposit transfers it. */ nativeFee: bigint; /** The `storage_deposit` of the `ft_withdraw`. Zero leaves the field out. */ storageDepositAmount: bigint; }; /** * Computes the values of an Omni withdrawal without building the intents. `OmniBridge` calls * it too, so a caller that signs the payload elsewhere gets the same numbers. * @param params.actualAmount Net of `feeEstimation.amount`. `IntentsSDK` subtracts it for a * fee-inclusive withdrawal, so a caller that builds the payload itself has to do the same * @param params.feeEstimation Read for every fee of the route, one of which raises the amount * @param params.externalId Supply one to repeat an earlier call. * `calculateStorageAccountId` throws above 64 UTF-8 bytes. Omit it and the function draws a * random one * @returns The values the `ft_withdraw` carries */ declare function deriveOmniWithdrawIntentParams(params: { assetId: string; destinationAddress: string; actualAmount: bigint; omniChainKind: ChainKind; intentsContract: string; feeEstimation: FeeEstimation; externalId?: string; caip2Identifier?: Chain; }): OmniWithdrawIntentParams; declare function caip2ToChainKind(network: Chain): ChainKind | null; declare function isUtxoChain(network: ChainKind): boolean; //#endregion export { OmniWithdrawIntentParams, caip2ToChainKind, deriveOmniWithdrawIntentParams, isUtxoChain };