Skip to content

Commit

Permalink
Merge pull request #262 from skip-mev/staging
Browse files Browse the repository at this point in the history
sync staging to main
  • Loading branch information
codingki authored May 2, 2024
2 parents 761a4f5 + 18689a0 commit 03bd72e
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 10 deletions.
2 changes: 1 addition & 1 deletion chain-registry
Submodule chain-registry updated 135 files
2 changes: 2 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ declare namespace NodeJS {
readonly WALLETCONNECT_VERIFY_KEY?: string;
readonly WORD_PHRASE_KEY?: string;
readonly NEXT_PUBLIC_IS_TESTNET?: boolean;

readonly SKIP_API_KEY?: string;
}
}

Expand Down
2 changes: 1 addition & 1 deletion initia-registry
Submodule initia-registry updated 36 files
+78 −0 .github/workflows/mahalo-watcher.yml
+77 −198 .github/workflows/utility/validate_data.py
+3 −3 .github/workflows/validate_data.yml
+6 −6 _packages/initia-registry/package-lock.json
+2 −2 _packages/initia-registry/package.json
+2 −0 _packages/initia-registry/src/devnet/assets.ts
+1 −1 _packages/initia-registry/src/devnet/blackwing/chain.ts
+4 −0 _packages/initia-registry/src/devnet/chains.ts
+66 −0 _packages/initia-registry/src/devnet/controverse/assets.ts
+104 −0 _packages/initia-registry/src/devnet/controverse/chain.ts
+5 −0 _packages/initia-registry/src/devnet/controverse/index.ts
+2 −0 _packages/initia-registry/src/devnet/index.ts
+6 −0 _packages/initia-registry/src/devnet/initia/chain.ts
+1 −1 _packages/initia-registry/src/devnet/minimove/chain.ts
+1 −1 _packages/initia-registry/src/devnet/miniwasm/chain.ts
+86 −0 _packages/initia-registry/src/devnet/tucana/chain.ts
+3 −0 _packages/initia-registry/src/devnet/tucana/index.ts
+1 −1 chain.schema.json
+0 −31 devnets/_IBC/blackwing-initia.json
+0 −62 devnets/blackwing/assetlist.json
+0 −98 devnets/blackwing/chain.json
+ devnets/blackwing/images/INIT.png
+0 −11 devnets/blackwing/images/INIT.svg
+ devnets/blackwing/images/USDC.png
+0 −12 devnets/blackwing/images/USDC.svg
+0 −62 devnets/controverse/assetlist.json
+0 −98 devnets/controverse/chain.json
+ devnets/controverse/images/INIT.png
+0 −11 devnets/controverse/images/INIT.svg
+ devnets/controverse/images/USDC.png
+0 −12 devnets/controverse/images/USDC.svg
+23 −35 devnets/initia/chain.json
+2 −2 devnets/minimove/assetlist.json
+24 −24 devnets/minimove/chain.json
+2 −2 devnets/miniwasm/assetlist.json
+21 −21 devnets/miniwasm/chain.json
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ let nextConfig = {
source: "/api/rpc/(.*)",
destination: "/api/rpc/handler",
},
{
source: "/api/skip/(.*)",
destination: "/api/skip/handler",
},
],
transpilePackages:
process.env.NODE_ENV === "test"
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/nextjs": "^7.99.0",
"@skip-router/core": "^2.4.1",
"@skip-router/core": "^2.4.4",
"@solana/spl-token": "^0.4.1",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-wallets": "^0.19.31",
Expand Down
34 changes: 34 additions & 0 deletions src/pages/api/skip/handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest } from "next";
import { PageConfig } from "next";

import { API_URL } from "@/constants/api";

export const config: PageConfig = {
api: {
externalResolver: true,
bodyParser: false,
},
runtime: "edge",
};

export default async function handler(req: NextApiRequest) {
try {
const splitter = "/api/skip/";

const [...args] = req.url!.split(splitter).pop()!.split("/");
const uri = [API_URL, ...args].join("/");
const headers = new Headers();
if (process.env.SKIP_API_KEY) {
headers.set("authorization", process.env.SKIP_API_KEY);
}
return fetch(uri, {
body: req.body,
method: req.method,
headers,
});
} catch (error) {
const data = JSON.stringify({ error });
return new Response(data, { status: 500 });
}
}
4 changes: 2 additions & 2 deletions src/solve/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createContext, ReactNode } from "react";
import { WalletClient } from "viem";

import { chainIdToName } from "@/chains/types";
import { API_URL, appUrl } from "@/constants/api";
import { appUrl } from "@/constants/api";
import { trackWallet } from "@/context/track-wallet";
import { config } from "@/lib/wagmi";
import { gracefullyConnect, isWalletClientUsingLedger } from "@/utils/wallet";
Expand All @@ -19,7 +19,7 @@ export function SkipProvider({ children }: { children: ReactNode }) {

const skipClient = new SkipRouter({
clientID: process.env.NEXT_PUBLIC_CLIENT_ID,
apiURL: API_URL,
apiURL: `${appUrl}/api/skip`,
getCosmosSigner: async (chainID) => {
const chainName = chainIdToName[chainID];
if (!chainName) {
Expand Down

0 comments on commit 03bd72e

Please sign in to comment.