@reservoir0x/relay-sdk
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
838 lines • 245 kB
TypeScript
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/chains": {
get: {
parameters: {
query?: {
includeChains?: string | null;
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
/** @description An array of supported chains */
chains?: ({
id?: number;
name?: string;
displayName?: string;
httpRpcUrl?: string;
wsRpcUrl?: string;
explorerUrl?: string;
explorerName?: string;
explorerPaths?: {
transaction?: string;
} | null;
/** @description If the network supports depositing to this chain, e.g. allows this chain to be set as the destination chain */
depositEnabled?: boolean;
/** @enum {string} */
tokenSupport?: "All" | "Limited";
/** @description If relaying to and from this chain is disabled */
disabled?: boolean;
/** @description The value limit at which the chain is partially disabled, if 0, the chain is not partially disabled. i.e, 1000000000000000000 to designate 1 ETH max withdrawal/deposit */
partialDisableLimit?: number;
/** @description If the chain is experiencing issues where blocks are lagging behind or not being produced */
blockProductionLagging?: boolean;
currency?: {
id?: string;
symbol?: string;
name?: string;
address?: string;
decimals?: number;
supportsBridging?: boolean;
};
/** @description The fee in bps for withdrawing from this chain */
withdrawalFee?: number;
/** @description The fee in bps for depositing to this chain */
depositFee?: number;
/** @description If the chain has surge pricing enabled */
surgeEnabled?: boolean;
/** @description An array of featured erc20 currencies */
featuredTokens?: {
id?: string;
symbol?: string;
name?: string;
address?: string;
decimals?: number;
/** @description If the currency supports bridging */
supportsBridging?: boolean;
/** @description If the erc20 currency supports permit via signature (EIP-2612) */
supportsPermit?: boolean;
/** @description The fee in bps for withdrawing from this chain */
withdrawalFee?: number;
/** @description The fee in bps for depositing to this chain */
depositFee?: number;
/** @description If the chain has surge pricing enabled */
surgeEnabled?: boolean;
}[];
/** @description An array of erc20 currencies that the chain supports */
erc20Currencies?: {
id?: string;
symbol?: string;
name?: string;
address?: string;
decimals?: number;
/** @description If the currency supports bridging */
supportsBridging?: boolean;
/** @description If the erc20 currency supports permit via signature (EIP-2612) */
supportsPermit?: boolean;
/** @description The fee in bps for withdrawing from this chain */
withdrawalFee?: number;
/** @description The fee in bps for depositing to this chain */
depositFee?: number;
/** @description If the chain has surge pricing enabled */
surgeEnabled?: boolean;
}[];
/** @description The URL to the chain icon */
iconUrl?: string | null;
/** @description The URL to the chain logo */
logoUrl?: string | null;
/** @description Brand color code */
brandColor?: string | null;
/** @description Relay contract addresses */
contracts?: {
multicall3?: string;
multicaller?: string;
onlyOwnerMulticaller?: string;
relayReceiver?: string;
erc20Router?: string;
approvalProxy?: string;
};
/**
* @description The type of VM the chain runs on
* @enum {string}
*/
vmType?: "bvm" | "evm" | "svm";
explorerQueryParams?: {
[key: string]: unknown;
} | null;
/** @description The chain id which the chain rolls up to. This is always set as Ethereum for L1 chains */
baseChainId?: number | null;
/** @description If applicable, a status message for the chain */
statusMessage?: string | null;
tags?: string[];
})[];
};
};
};
};
};
};
"/chains/health": {
get: {
parameters: {
query?: {
chainId?: string;
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
/** @description A boolean indicating if the chain is healthy (true) or not (false) */
healthy?: boolean;
};
};
};
/** @description Default Response */
400: {
content: {
"application/json": {
message?: string;
code?: string;
};
};
};
};
};
};
"/config": {
get: {
parameters: {
query: {
originChainId: string;
destinationChainId: string;
/** @description User address, when supplied returns user balance and max bridge amount */
user?: string;
/** @description Restricts the user balance and capacity to a particular currency when supplied with a currency address. Defaults to native currency */
currency?: string;
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
enabled?: boolean;
user?: {
/** @description Balance on the origin chain in the native or supplied currency */
balance?: string;
/** @description Maximum amount that the user can bridge after fees in the native or supplied currency */
maxBridgeAmount?: string;
};
solver?: {
address?: string;
/** @description Balance of the solver on the destination chain. Denoted in wei */
balance?: string;
/** @description How much of the given currency is available to be bridged per bridge request. Denoted in wei */
capacityPerRequest?: string;
};
/** @description This denotes if the chain combination supports canonical plus bridging */
supportsExternalLiquidity?: boolean;
};
};
};
};
};
};
"/config/v2": {
get: {
parameters: {
query: {
originChainId: string;
destinationChainId: string;
/** @description User address, when supplied returns user balance and max bridge amount */
user?: string;
/** @description Restricts the user balance and capacity to a particular currency when supplied with a currency id. Defaults to the native currency of the destination chain. */
currency?: "anime" | "btc" | "cgt" | "degen" | "eth" | "omi" | "pop" | "power" | "sipher" | "tg7" | "tia" | "topia" | "usdc" | "usdt" | "xai" | "weth" | "apeeth" | "ape" | "g" | "dmt" | "g7" | "god" | "pengu" | "plume";
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
enabled?: boolean;
user?: {
/** @description Balance on the origin chain in the native or supplied currency */
balance?: string;
/** @description Maximum amount that the user can bridge after fees in the native or supplied currency */
maxBridgeAmount?: string;
};
/** @description Total fee in the native or supplied currency for the bridge operation */
fee?: string;
solver?: {
address?: string;
/** @description Balance of the solver on the destination chain. Denoted in wei */
balance?: string;
/** @description How much of the given currency is available to be bridged per bridge request. Denoted in wei */
capacityPerRequest?: string;
};
/** @description This denotes if the chain combination supports canonical plus bridging */
supportsExternalLiquidity?: boolean;
};
};
};
/** @description Default Response */
500: {
content: {
"application/json": {
message?: string;
code?: string;
};
};
};
};
};
};
"/execute/bridge": {
post: {
requestBody: {
content: {
"application/json": {
/** @description Address that is depositing funds on the origin chain and submitting transactions or signatures */
user: string;
/** @description Address that is receiving the funds on the destination chain, if not specified then this will default to the user address */
recipient?: string;
originChainId: number;
destinationChainId: number;
/** @enum {string} */
currency: "anime" | "btc" | "cgt" | "degen" | "eth" | "omi" | "pop" | "power" | "sipher" | "tg7" | "tia" | "topia" | "usdc" | "usdt" | "xai" | "weth" | "apeeth" | "ape" | "g" | "dmt" | "g7" | "god" | "pengu" | "plume";
/** @description Amount to bridge as the base amount (can be switched to exact input using the dedicated flag), denoted in wei */
amount: string;
/** @description App fees to be charged for execution */
appFees?: string[];
source?: string;
/** @description Address to send the refund to in the case of failure, if not specified then the receipient address or user address is used */
refundTo?: string;
/** @description Always refund on the origin chain in case of any issues */
refundOnOrigin?: boolean;
/** @description Enable this to use the exact input rather than exact output */
useExactInput?: boolean;
/** @description Enable this to use canonical+ bridging, trading speed for more liquidity */
useExternalLiquidity?: boolean;
/**
* @description Enable this to route payments via a forwarder contract. This contract will emit an event when receiving payments before forwarding to the solver. This is needed when depositing from a smart contract as the payment will be an internal transaction and detecting such a transaction requires obtaining the transaction traces.
* @default true
*/
useForwarder?: boolean;
/** @description Enable this to use permit (eip3009), only works on supported currency such as usdc */
usePermit?: boolean;
};
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
/**
* @description An array of steps detailing what needs to be done to bridge, steps includes multiple items of the same kind (signature, transaction, etc)
* @example [
* {
* "id": "deposit",
* "action": "Confirm transaction in your wallet",
* "description": "Deposit funds for executing the calls",
* "kind": "transaction",
* "items": [
* {
* "status": "incomplete",
* "data": {
* "from": "0x03508bB71268BBA25ECaCC8F620e01866650532c",
* "to": "0xf70da97812cb96acdf810712aa562db8dfa3dbef",
* "data": "0x58109c",
* "value": "995010715204139091",
* "maxFeePerGas": "18044119466",
* "maxPriorityFeePerGas": "2060264926",
* "chainId": 1,
* "gas": 21064
* },
* "check": {
* "endpoint": "/intents/status?requestId=0x341b28c6467bfbffb72ad78ec5ddf1f77b8f9c79be134223e3248a7d4fcd43b6",
* "method": "GET"
* }
* }
* ]
* }
* ]
*/
steps?: {
/** @description Unique identifier tied to the step */
id?: string;
/** @description A call to action for the step */
action?: string;
/** @description A short description of the step and what it entails */
description?: string;
/** @description The kind of step, can either be a transaction or a signature. Transaction steps require submitting a transaction while signature steps require submitting a signature */
kind?: string;
/** @description While uncommon it is possible for steps to contain multiple items of the same kind (transaction/signature) grouped together that can be executed simultaneously. */
items?: {
/** @description Can either be complete or incomplete, this can be locally controlled once the step item is completed (depending on the kind) and the check object (if returned) has been verified. Once all step items are complete, the bridge is complete */
status?: string;
data?: unknown;
/** @description Details an endpoint and a method you should poll to get confirmation, the endpoint should return a boolean success flag which can be used to determine if the step item is complete */
check?: {
/** @description The endpoint to confirm that the step item was successfully completed */
endpoint?: string;
/** @description The REST method to access the endpoint */
method?: string;
};
}[];
}[];
/**
* @example {
* "gas": "384398515652800",
* "gasCurrency": "eth",
* "relayer": "-4989478842712964",
* "relayerGas": "521157287036",
* "relayerService": "-4990000000000000",
* "relayerCurrency": "eth"
* }
*/
fees?: {
/** @description Origin chain gas fee in wei */
gas?: string;
/**
* @description Origin chain gas currency
* @enum {string}
*/
gasCurrency?: "anime" | "btc" | "cgt" | "degen" | "eth" | "omi" | "pop" | "power" | "sipher" | "tg7" | "tia" | "topia" | "usdc" | "usdt" | "xai" | "weth" | "apeeth" | "ape" | "g" | "dmt" | "g7" | "god" | "pengu" | "plume" | "avax" | "bnb" | "dai" | "matic" | "sol" | "sei" | "mnt" | "trx" | "bera" | "ip" | "s" | "lrds" | "celo" | "flow" | "ron" | "metis" | "btcn" | "core" | "sui" | "ton" | "cronos" | "hype";
/** @description Combination of the relayerGas and relayerService to give you the full relayer fee in wei */
relayer?: string;
/** @description Destination chain gas fee in wei */
relayerGas?: string;
/** @description Fee paid to the relay solver in wei, note that this value can be negative (which represents network rewards for moving in a direction that optimizes liquidity distribution) */
relayerService?: string;
/**
* @description The currency for all relayer fees (gas and service)
* @enum {string}
*/
relayerCurrency?: "anime" | "btc" | "cgt" | "degen" | "eth" | "omi" | "pop" | "power" | "sipher" | "tg7" | "tia" | "topia" | "usdc" | "usdt" | "xai" | "weth" | "apeeth" | "ape" | "g" | "dmt" | "g7" | "god" | "pengu" | "plume";
app?: string;
/** @enum {string} */
appCurrency?: "anime" | "btc" | "cgt" | "degen" | "eth" | "omi" | "pop" | "power" | "sipher" | "tg7" | "tia" | "topia" | "usdc" | "usdt" | "xai" | "weth" | "apeeth" | "ape" | "g" | "dmt" | "g7" | "god" | "pengu" | "plume";
};
breakdown?: {
/** @description Amount that will be bridged in the estimated time */
value?: string;
/** @description Estimated bridge time in seconds */
timeEstimate?: number;
}[];
/**
* @example {
* "userBalance": "54764083517303347",
* "requiredToSolve": "995010521157287036"
* }
*/
balances?: {
/** @description The user's balance in the given currency on the origin chain */
userBalance?: string;
/** @description The minimum balance the user needs to have to bridge */
requiredToSolve?: string;
};
};
};
};
/** @description Default Response */
400: {
content: {
"application/json": {
message?: string;
};
};
};
/** @description Default Response */
401: {
content: {
"application/json": {
message?: string;
};
};
};
/** @description Default Response */
500: {
content: {
"application/json": {
message?: string;
};
};
};
};
};
};
"/execute/bridge/v2": {
post: {
requestBody: {
content: {
"application/json": {
/** @description Address that is depositing funds on the origin chain and submitting transactions or signatures */
user: string;
/** @description Address that is receiving the funds on the destination chain, if not specified then this will default to the user address */
recipient?: string;
originChainId: number;
destinationChainId: number;
/** @enum {string} */
currency: "anime" | "btc" | "cgt" | "degen" | "eth" | "omi" | "pop" | "power" | "sipher" | "tg7" | "tia" | "topia" | "usdc" | "usdt" | "xai" | "weth" | "apeeth" | "ape" | "g" | "dmt" | "g7" | "god" | "pengu" | "plume";
/** @description Amount to bridge as the base amount (can be switched to exact input using the dedicated flag), denoted in wei */
amount: string;
/** @description App fees to be charged for execution */
appFees?: string[];
source?: string;
/** @description Address to send the refund to in the case of failure, if not specified then the receipient address or user address is used */
refundTo?: string;
/** @description Always refund on the origin chain in case of any issues */
refundOnOrigin?: boolean;
/** @description Enable this to use the exact input rather than exact output */
useExactInput?: boolean;
/** @description Enable this to use canonical+ bridging, trading speed for more liquidity */
useExternalLiquidity?: boolean;
/**
* @description Enable this to route payments via a forwarder contract. This contract will emit an event when receiving payments before forwarding to the solver. This is needed when depositing from a smart contract as the payment will be an internal transaction and detecting such a transaction requires obtaining the transaction traces.
* @default true
*/
useForwarder?: boolean;
/** @description Enable this to use permit (eip3009), only works on supported currency such as usdc */
usePermit?: boolean;
};
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
/**
* @description An array of steps detailing what needs to be done to bridge, steps includes multiple items of the same kind (signature, transaction, etc)
* @example [
* {
* "id": "deposit",
* "action": "Confirm transaction in your wallet",
* "description": "Deposit funds for executing the calls",
* "kind": "transaction",
* "items": [
* {
* "status": "incomplete",
* "data": {
* "from": "0x03508bB71268BBA25ECaCC8F620e01866650532c",
* "to": "0xf70da97812cb96acdf810712aa562db8dfa3dbef",
* "data": "0x58109c",
* "value": "995010715204139091",
* "maxFeePerGas": "18044119466",
* "maxPriorityFeePerGas": "2060264926",
* "chainId": 1,
* "gas": 21064
* },
* "check": {
* "endpoint": "/intents/status?requestId=0x341b28c6467bfbffb72ad78ec5ddf1f77b8f9c79be134223e3248a7d4fcd43b6",
* "method": "GET"
* }
* }
* ]
* }
* ]
*/
steps?: {
/** @description Unique identifier tied to the step */
id?: string;
/** @description A call to action for the step */
action?: string;
/** @description A short description of the step and what it entails */
description?: string;
/** @description The kind of step, can either be a transaction or a signature. Transaction steps require submitting a transaction while signature steps require submitting a signature */
kind?: string;
/** @description While uncommon it is possible for steps to contain multiple items of the same kind (transaction/signature) grouped together that can be executed simultaneously. */
items?: {
/** @description Can either be complete or incomplete, this can be locally controlled once the step item is completed (depending on the kind) and the check object (if returned) has been verified. Once all step items are complete, the bridge is complete */
status?: string;
data?: unknown;
/** @description Details an endpoint and a method you should poll to get confirmation, the endpoint should return a boolean success flag which can be used to determine if the step item is complete */
check?: {
/** @description The endpoint to confirm that the step item was successfully completed */
endpoint?: string;
/** @description The REST method to access the endpoint */
method?: string;
};
}[];
}[];
fees?: {
/**
* @description Origin chain gas fee
* @example {
* "currency": {
* "chainId": 8453,
* "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
* "symbol": "USDC",
* "name": "USD Coin",
* "decimals": 6,
* "metadata": {
* "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png",
* "verified": false,
* "isNative": false
* }
* },
* "amount": "30754920",
* "amountFormatted": "30.75492",
* "amountUsd": "30.901612",
* "minimumAmount": "30454920"
* }
*/
gas?: {
currency?: {
chainId?: number;
address?: string;
symbol?: string;
name?: string;
decimals?: number;
metadata?: {
logoURI?: string;
verified?: boolean;
isNative?: boolean;
};
};
amount?: string;
amountFormatted?: string;
amountUsd?: string;
minimumAmount?: string;
};
/**
* @description Combination of the relayerGas and relayerService to give you the full relayer fee
* @example {
* "currency": {
* "chainId": 8453,
* "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
* "symbol": "USDC",
* "name": "USD Coin",
* "decimals": 6,
* "metadata": {
* "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png",
* "verified": false,
* "isNative": false
* }
* },
* "amount": "30754920",
* "amountFormatted": "30.75492",
* "amountUsd": "30.901612",
* "minimumAmount": "30454920"
* }
*/
relayer?: {
currency?: {
chainId?: number;
address?: string;
symbol?: string;
name?: string;
decimals?: number;
metadata?: {
logoURI?: string;
verified?: boolean;
isNative?: boolean;
};
};
amount?: string;
amountFormatted?: string;
amountUsd?: string;
minimumAmount?: string;
};
/**
* @description Destination chain gas fee
* @example {
* "currency": {
* "chainId": 8453,
* "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
* "symbol": "USDC",
* "name": "USD Coin",
* "decimals": 6,
* "metadata": {
* "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png",
* "verified": false,
* "isNative": false
* }
* },
* "amount": "30754920",
* "amountFormatted": "30.75492",
* "amountUsd": "30.901612",
* "minimumAmount": "30454920"
* }
*/
relayerGas?: {
currency?: {
chainId?: number;
address?: string;
symbol?: string;
name?: string;
decimals?: number;
metadata?: {
logoURI?: string;
verified?: boolean;
isNative?: boolean;
};
};
amount?: string;
amountFormatted?: string;
amountUsd?: string;
minimumAmount?: string;
};
/**
* @description Fees paid to the relay solver, note that this value can be negative (which represents network rewards for moving in a direction that optimizes liquidity distribution)
* @example {
* "currency": {
* "chainId": 8453,
* "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
* "symbol": "USDC",
* "name": "USD Coin",
* "decimals": 6,
* "metadata": {
* "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png",
* "verified": false,
* "isNative": false
* }
* },
* "amount": "30754920",
* "amountFormatted": "30.75492",
* "amountUsd": "30.901612",
* "minimumAmount": "30454920"
* }
*/
relayerService?: {
currency?: {
chainId?: number;
address?: string;
symbol?: string;
name?: string;
decimals?: number;
metadata?: {
logoURI?: string;
verified?: boolean;
isNative?: boolean;
};
};
amount?: string;
amountFormatted?: string;
amountUsd?: string;
minimumAmount?: string;
};
/**
* @description Fees paid to the app. Currency will be the same as the relayer fee currency. This needs to be claimed later by the app owner and is not immediately distributed to the app
* @example {
* "currency": {
* "chainId": 8453,
* "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
* "symbol": "USDC",
* "name": "USD Coin",
* "decimals": 6,
* "metadata": {
* "logoURI": "https://ethereum-optimism.github.io/data/USDC/logo.png",
* "verified": false,
* "isNative": false
* }
* },
* "amount": "30754920",
* "amountFormatted": "30.75492",
* "amountUsd": "30.901612",
* "minimumAmount": "30454920"
* }
*/
app?: {
currency?: {
chainId?: number;
address?: string;
symbol?: string;
name?: string;
decimals?: number;
metadata?: {
logoURI?: string;
verified?: boolean;
isNative?: boolean;
};
};
amount?: string;
amountFormatted?: string;
amountUsd?: string;
minimumAmount?: string;
};
};
breakdown?: {
/** @description Amount that will be bridged in the estimated time */
value?: string;
/** @description Estimated bridge time in seconds */
timeEstimate?: number;
}[];
/**
* @example {
* "userBalance": "54764083517303347",
* "requiredToSolve": "995010521157287036"
* }
*/
balances?: {
/** @description The user's balance in the given currency on the origin chain */
userBalance?: string;
/** @description The minimum balance the user needs to have to bridge */
requiredToSolve?: string;
};
};
};
};
/** @description Default Response */
400: {
content: {
"application/json": {
message?: string;
code?: string;
};
};
};
/** @description Default Response */
401: {
content: {
"application/json": {
message?: string;
code?: string;
};
};
};
/** @description Default Response */
500: {
content: {
"application/json": {
message?: string;
code?: string;
};
};
};
};
};
};
"/execute/call": {
post: {
requestBody: {
content: {
"application/json": {
/** @description Address that is depositing funds on the origin chain and submitting transactions or signatures */
user: string;
originChainId: number;
destinationChainId: number;
txs?: {
to?: string;
value?: string;
data?: string;
}[];
/** @description App fees to be charged for execution */
appFees?: string[];
/** @description Address to send the refund to in the case of failure, if not specified then the receipient address or user address is used */
refundTo?: string;
/** @description Always refund on the origin chain in case of any issues */
refundOnOrigin?: boolean;
source?: string;
/**
* @description Enable this to route payments via a forwarder contract. This contract will emit an event when receiving payments before forwarding to the solver. This is needed when depositing from a smart contract as the payment will be an internal transaction and detecting such a transaction requires obtaining the transaction traces.
* @default true
*/
useForwarder?: boolean;
};
};
};
responses: {
/** @description Default Response */
200: {
content: {
"application/json": {
/**
* @description An array of steps detailing what needs to be done to bridge, steps includes multiple items of the same kind (signature, transaction, etc)
* @example [
* {
* "id": "deposit",
* "action": "Confirm transaction in your wallet",
* "description": "Deposit funds for executing the calls",
* "kind": "transaction",
* "items": [
* {
* "status": "incomplete",
* "data": {
* "from": "0x03508bB71268BBA25ECaCC8F620e01866650532c",
* "to": "0xf70da97812cb96acdf810712aa562db8dfa3dbef",
* "data": "0x58109c",
* "value": "995010715204139091",
* "maxFeePerGas": "18044119466",
* "maxPriorityFeePerGas": "2060264926",
* "chainId": 1,
* "gas": 21064
* },
* "check": {
* "endpoint": "/intents/status?requestId=0x341b28c6467bfbffb72ad78ec5ddf1f77b8f9c79be134223e3248a7d4fcd43b6",
* "method": "GET"
* }
* }
* ]
* }
* ]
*/
steps?: {
/** @description Unique identifier tied to the step */
id?: string;
/** @description A call to action for the step */
action?: string;
/** @description A short description of the step and what it entails */
description?: string;
/** @description The kind of step, can either be a transaction or a signature. Transaction steps require submitting a transaction while signature steps require submitting a signature */
kind?: string;
/** @description While uncommon it is possible for steps to contain multiple items of the same kind (transaction/signature) grouped together that can be executed simultaneously. */
items?: {
/** @description Can either be complete or incomplete, this can be locally controlled once the step item is completed (depending on the kind) and the check object (if returned) has been verified. Once all step items are complete, the bridge is complete */
status?: string;
data?: unknown;
/**