Skip to content

Commit 67c67bc

Browse files
author
eericxu
committed
[all] update gateway
1 parent 3fedec2 commit 67c67bc

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

components/pages/main/Bucket.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { useOnce } from "@react-spring/shared";
2626
import { genUrl, pinUrl } from "@lib/http";
2727
import { useToast } from "@lib/hooks/useToast";
2828
import { useAccount } from "wagmi";
29-
import { docsUrl, GatewayBase2, GatewayBaseBucket } from "@lib/config";
29+
import { docsUrl, GatewayBase2, GatewayBaseBucket, GatewayIPNS } from "@lib/config";
3030
import algoWallet from "@lib/algorand/algoWallet";
3131
import algodClient from "@lib/algorand/algodClient";
3232

@@ -140,7 +140,7 @@ export const Bucket = React.memo(() => {
140140
params: {
141141
arg: ipnsId,
142142
},
143-
url: `${GatewayBase2}/api/v0/name/resolve`,
143+
url: `${GatewayIPNS()}/api/v0/name/resolve`,
144144
});
145145
const filesRes = await axios.request({
146146
url: `${GatewayBase2}${pathRes.data.Path}`,

lib/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export const GatewayList = (): AuthIpfsEndpoint[] => [
7373
// 'https://ipfs-gw.decloud.foundation'
7474
export const DeCloudLink = "https://crustipfs.xyz";
7575
export const GatewayBase = "https://gw.crustgw.work";
76-
export const GatewayBase2 = "https://gw-seattle.crust-gateway.com";
76+
export const GatewayIPNS = () => `https://gw-seattle.${DomainRef.value}`
77+
export const GatewayBase2 = "https://gw.crust-gateway.cc";
7778

7879
// for BucketGatewayBase
7980
export const GatewayBaseBucket = "https://ipfsgw.live";

lib/hooks/useBuckets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BucketDTO } from "@lib/http";
2-
import { GatewayBase2, SupportChain } from "./../config";
2+
import { GatewayBase2, GatewayIPNS, SupportChain } from "./../config";
33

44
import algoWallet from "@lib/algorand/algoWallet";
55
import algodClient from "@lib/algorand/algodClient";
@@ -13,8 +13,8 @@ import { useW3BucketAbi } from "./useW3BucketAbi";
1313
export async function getFileHistory(ipns: string) {
1414
try {
1515
const cid = (
16-
await axios.get<{ Path: string }>(
17-
`${GatewayBase2}/api/v0/name/resolve?arg=${ipns}`
16+
await axios.post<{ Path: string }>(
17+
`${GatewayIPNS()}/api/v0/name/resolve?arg=${ipns}`
1818
)
1919
).data;
2020
const fileList = (

0 commit comments

Comments
 (0)