Skip to content

Commit

Permalink
chore: merge
Browse files Browse the repository at this point in the history
Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris committed Jan 20, 2025
2 parents 7cadd80 + 0985627 commit 9c1f3b5
Show file tree
Hide file tree
Showing 42 changed files with 3,719 additions and 1,601 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
gas-price-comparison.csv

# production
/build
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# These owners will be the default owners for everything in
# the repo unless a later match takes precedence.
* @mrice32 @nicholaspai @dohaki @james-a-morris
* @mrice32 @nicholaspai @dohaki @james-a-morris @gsteenkamp89

# Serverless api
/api/ @mrice32 @nicholaspai @dohaki @james-a-morris @pxrl
Expand Down
14 changes: 10 additions & 4 deletions api-docs-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ paths:
"quoteBlock": "19237525",
"spokePoolAddress": "0xe35e9842fceaCA96570B734083f4a58e8F7C5f2A",
"expectedFillTimeSec": "4",
"limits": {
"fillDeadline": "1737033609",
"limits":
{
"minDeposit": "7799819",
"maxDeposit": "22287428516241",
"maxDepositInstant": "201958902363",
"maxDepositShortDelay": "2045367713809",
"recommendedDepositInstant": "201958902363"
}
"recommendedDepositInstant": "201958902363",
},
}
"400":
description: Invalid input
Expand Down Expand Up @@ -527,8 +529,12 @@ components:
description: >
The expected time (in seconds) for a fill to be made. Represents 75th percentile of the 7-day rolling average of times (updated daily). Times are dynamic by origin/destination token/chain for a given amount.
example: "4"
fillDeadline:
type: string
description: >
The recommended deadline (UNIX timestamp in seconds) for the relayer to fill the deposit. After this destination chain timestamp, the fill will revert on the destination chain.
limits:
$ref: '#/components/schemas/TransferLimits'
$ref: "#/components/schemas/TransferLimits"
TransferLimits:
type: object
properties:
Expand Down
5 changes: 4 additions & 1 deletion api/_cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export function buildCacheKey(
}

export function buildInternalCacheKey(...args: (string | number)[]): string {
return buildCacheKey("QUOTES_API", ...args);
return buildCacheKey(
`${process.env.CACHE_PREFIX ? process.env.CACHE_PREFIX + "-" : ""}QUOTES_API`,
...args
);
}

export async function getCachedValue<T>(
Expand Down
6 changes: 6 additions & 0 deletions api/_constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ const defaultRelayerFeeCapitalCostConfig: {
cutoff: ethers.utils.parseUnits("10000").toString(),
decimals: 18,
},
GRASS: {
lowerBound: ethers.utils.parseUnits("0.0001").toString(),
upperBound: ethers.utils.parseUnits("0.0005").toString(),
cutoff: ethers.utils.parseUnits("10000").toString(),
decimals: 18,
},
};

defaultRelayerFeeCapitalCostConfig["USDC.e"] = {
Expand Down
14 changes: 9 additions & 5 deletions api/_errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@ export function handleErrorCondition(
const { type, path } = error;
// Sanitize the error message that will be sent to client
const message = `Invalid parameter at path '${path}'. Expected type '${type}'`;
acrossApiError = new InputError({
message,
code: AcrossErrorCode.INVALID_PARAM,
param: path.join("."),
});
acrossApiError = new InputError(
{
message,
code: AcrossErrorCode.INVALID_PARAM,
param: path.join("."),
},
{ cause: error }
);
}
// Handle axios errors
else if (error instanceof AxiosError) {
Expand Down Expand Up @@ -267,6 +270,7 @@ export function handleErrorCondition(
at: endpoint,
code: acrossApiError.code,
message: `Status ${acrossApiError.status} - ${acrossApiError.message}`,
cause: acrossApiError.cause,
});

return response.status(acrossApiError.status).json(acrossApiError);
Expand Down
9 changes: 9 additions & 0 deletions api/_types/utility.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ export type TokenInfo = {
name: string;
addresses: Record<number, string>;
};

export type DepositRoute = {
originChainId: number;
originToken: string;
destinationChainId: number;
destinationToken: string;
originTokenSymbol: string;
destinationTokenSymbol: string;
};
Loading

0 comments on commit 9c1f3b5

Please sign in to comment.