Skip to content

Commit 654351a

Browse files
Merge pull request #117 from Concordium/fix-nft-marketplace-ipfs-prefix
Fix the ipfs prefix problem by adding https://ipfs.io/ipfs
2 parents 7409f9f + 9a37095 commit 654351a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

low-code-nft-marketplace/common-ui/src/models/PinataClient.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export class PinataClient {
3333
}
3434

3535
const responseData = response.data as PinFileToIPFSResponse;
36-
return `ipfs://${responseData.IpfsHash}`;
36+
// usually platforms(wallets) should handle the gateway OR prefix usage but wallet doesnt at the moment.
37+
// since this is an example, we can use it like below.
38+
return `https://ipfs.io/ipfs/${responseData.IpfsHash}`;
39+
// return `ipfs://${responseData.IpfsHash}`;
3740
}
3841

3942
async uploadJson(json: object, fileName: string): Promise<string> {
@@ -60,7 +63,10 @@ export class PinataClient {
6063
}
6164

6265
const responseData = response.data as PinFileToIPFSResponse;
63-
return `ipfs://${responseData.IpfsHash}`;
66+
// usually platforms(wallets) should handle the gateway OR prefix usage but wallet doesnt at the moment.
67+
// since this is an example, we can use it like below.
68+
return `https://ipfs.io/ipfs/${responseData.IpfsHash}`;
69+
// return `ipfs://${responseData.IpfsHash}`;
6470
}
6571
}
6672

low-code-nft-marketplace/market-ui/src/Constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const CIS2_MULTI_CONTRACT_INFO: Cis2ContractInfo = {
3636
moduleRef: new ModuleReference(MULTI_CONTRACT_MODULE_REF),
3737
tokenIdByteSize: 1,
3838
};
39-
export const IPFS_GATEWAY_URL = 'https://gateway.pinata.cloud/ipfs/';
39+
export const IPFS_GATEWAY_URL = 'https://ipfs.io/ipfs/';
4040

4141
// Default value of the new marketplace contract init flag is false.
4242
// It needs to be set as true in order to allow to create a new marketplace contract instance

low-code-nft-marketplace/mint-ui/src/Constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const CIS2_MULTI_CONTRACT_INFO: Cis2ContractInfo = {
1212
moduleRef: new ModuleReference(MULTI_CONTRACT_MODULE_REF),
1313
tokenIdByteSize: 1,
1414
};
15-
export const IPFS_GATEWAY_URL = 'https://gateway.pinata.cloud/ipfs/';
15+
export const IPFS_GATEWAY_URL = 'https://ipfs.io/ipfs/';
1616

1717
export const CONNCORDIUM_NODE_ENDPOINT = 'https://grpc.testnet.concordium.com';
1818
export const CONCORDIUM_NODE_PORT = 20000;

0 commit comments

Comments
 (0)