UNPKG

ulysses-sdk

Version:

An sdk for interacting with the Ulysses contracts

68 lines (67 loc) 4.7 kB
import { Interface } from '@ethersproject/abi'; import { IRootRouterCallOutAndBridgeMultipleParams, IRootRouterCallOutAndBridgeParams, IRootRouterRetrySettlementParams } from '../../types'; import { IMulticallCall, IOutputMultipleTokenParams, IOutputTokenParams } from '../../types/encodingTypes'; export declare abstract class RootRouter { static readonly INTERFACE: Interface; private constructor(); /** * Used to call out to a destination branch router and bridge a single token. * @param settlementOwnerAndGasRefundee The address that will receive the gas refund and the settlement owner. * @param recipient The address of the account that will receive the output tokens in destination branch chain. * @param outputToken The address of the output token. * @param amountOut The amount of output tokens to be received. * @param depositOut The amount of deposit tokens to be bridged. * @param dstChainId The id of the destination branch chain. * @param gasParams params that hold information about the gasLimit and remoteBranchExecutionGas. * @returns encoded calldata for the callOutAndBridge function. */ static encodeCallOutAndBridgeCalldata({ settlementOwnerAndGasRefundee, recipient, outputToken, amountOut, depositOut, dstChainId, gasParams, }: IRootRouterCallOutAndBridgeParams): string; /** * Used to call out to a destination branch router and bridge multiple tokens. * @param settlementOwnerAndGasRefundee The address that will receive the gas refund and the settlement owner. * @param recipient The address of the account that will receive the output tokens in destination branch chain. * @param outputTokens The addresses of the output tokens. * @param amountsOut The amounts of output tokens to be received. * @param depositsOut The amounts of deposit tokens to be bridged. * @param dstChainId The id of the destination branch chain. * @param gasParams params that hold information about the gasLimit and remoteBranchExecutionGas. * @returns encoded calldata for the callOutAndBridgeMultiple function. */ static encodeCallOutAndBridgeMultipleCalldata({ settlementOwnerAndGasRefundee, recipient, outputTokens, amountsOut, depositsOut, dstChainId, gasParams, }: IRootRouterCallOutAndBridgeMultipleParams): string; /** * Used to retry a failed settlement. * @param settlementNonce The nonce of the settlement to retry. * @param recipient The address of the account that will receive the output tokens in destination branch chain. * @param gasParams params that hold information about the gasLimit and remoteBranchExecutionGas * @param hasFallbackToggled defaults to true * @returns encoded calldata for the retrySettlement function */ static encodeRetrySettlementCalldata({ settlementNonce, recipient, gasParams, hasFallbackToggled, }: IRootRouterRetrySettlementParams): string; /** * Append funcId to calls for remote execution in a MulticallRootRouter with no token output to another chain. * @param calls list of calls to aggregate. */ static encodeRemoteMulticallNoOutput(calls: IMulticallCall[]): string; /** * Append funcId to calls for remote execution in a MulticallRootRouter with no token output to another chain. * @param calls list of calls to aggregate. */ static encodeRemoteMulticallNoOutputLibZip(calls: IMulticallCall[]): string; private static encodeMulticallNoOutput; /** * Append funcId to calls for remote execution in a MulticallRootRouter with token output to another chain. * @param calls list of calls to aggregate. * @param outputTokenParams output token params object. */ static encodeRemoteMulticallWithOutput(calls: IMulticallCall[], outputTokenParams: IOutputTokenParams): string; static encodeRemoteMulticallWithOutputLibZip(calls: IMulticallCall[], outputTokenParams: IOutputTokenParams): string; private static encodeMulticallWithOutput; /** * Append funcId to calls for remote execution in a MulticallRootRouter with multiple token outputs to another chain. * @param calls list of calls to aggregate. * @param outputMultipleTokenParams output token params object. */ static encodeRemoteMulticallWithMultipleOutput(calls: IMulticallCall[], outputMultipleTokenParams: IOutputMultipleTokenParams): string; static encodeRemoteMulticallWithMultipleOutputLibZip(calls: IMulticallCall[], outputMultipleTokenParams: IOutputMultipleTokenParams): string; private static encodeMulticallWithMultipleOutput; }