Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

234 17012024 end to end testing back office and web staging #246

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions apps/web/app/api/webhooks/payment/stripe/checkout/route.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NftClaimable } from '@nft/thirdweb-admin';

export const maxDuration = 300;

// This route has been moved to pages/api regarding a Thirdweb and NextJS 14 error, it should be moved back into app/api when the error will be fix https://github.com/AlexandreG-tech/Server-Action-Error
export async function GET(req: Request, { params: { id } }) {
const order = (await adminSdk.GetOrderFromId({ id })).order_by_pk;
const nft = new NftClaimable();
Expand Down
8 changes: 8 additions & 0 deletions apps/web/pages/api/webhooks/payment/stripe/checkout/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { stripeCheckoutStatus } from '@payment/webhooks';

export const maxDuration = 30;
AlexandreG-tech marked this conversation as resolved.
Show resolved Hide resolved

// This route has been moved to pages/api regarding a Thirdweb and NextJS 14 error, it should be moved back into app/api when the error will be fix https://github.com/AlexandreG-tech/Server-Action-Error
export async function POST(req: Request) {
return stripeCheckoutStatus(req);
}
60 changes: 32 additions & 28 deletions libs/indexer/alchemy/admin/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ interface GetTransfersForContractOptions
toBlock: _GetTransfersForContractOptions['toBlock'];
}

const networkToChainIdMap: { [key in Network | string]?: string } = {
AlexandreG-tech marked this conversation as resolved.
Show resolved Hide resolved
[Network.ETH_MAINNET]: '1',
ETH_MAINNET: '1',
[Network.ETH_GOERLI]: '5',
ETH_GOERLI: '5',
[Network.ETH_SEPOLIA]: '11155111',
ETH_SEPOLIA: '11155111',
[Network.OPT_MAINNET]: '69',
OPT_MAINNET: '69',
[Network.OPT_GOERLI]: '420',
OPT_GOERLI: '420',
[Network.ARB_MAINNET]: '42161',
ARB_MAINNET: '42161',
[Network.ARB_GOERLI]: '421613',
ARB_GOERLI: '421613',
[Network.MATIC_MAINNET]: '137',
MATIC_MAINNET: '137',
[Network.MATIC_MUMBAI]: '80001',
MATIC_MUMBAI: '80001',
[Network.ASTAR_MAINNET]: '592',
ASTAR_MAINNET: '592',
[Network.POLYGONZKEVM_MAINNET]: '1101',
POLYGONZKEVM_MAINNET: '1101',
[Network.POLYGONZKEVM_TESTNET]: '1442',
POLYGONZKEVM_TESTNET: '1442',
};

// Helper function to fetch all pages concurrently
export async function fetchAllPages<T>(
fetchPage: (
Expand Down Expand Up @@ -111,35 +138,12 @@ export class AlchemyWrapper {
});
}

convertNetworkToChainId(network: Network): string {
switch (network) {
case Network.ETH_MAINNET:
return '1';
case Network.ETH_GOERLI:
return '5';
case Network.ETH_SEPOLIA:
return '11155111';
case Network.OPT_MAINNET:
return '69';
case Network.OPT_GOERLI:
return '420';
case Network.ARB_MAINNET:
return '42161';
case Network.ARB_GOERLI:
return '421613';
case Network.MATIC_MAINNET:
return '137';
case Network.MATIC_MUMBAI:
return '80001';
case Network.ASTAR_MAINNET:
return '592';
case Network.POLYGONZKEVM_MAINNET:
return '1101';
case Network.POLYGONZKEVM_TESTNET:
return '1442';
default:
throw new Error(`Unsupported network: ${network}`);
convertNetworkToChainId(network: Network | string): string {
const chainId = networkToChainIdMap[network];
if (!chainId) {
throw new Error(`Unsupported network: ${network}`);
}
return chainId;
}
// NFT API

Expand Down
5 changes: 3 additions & 2 deletions libs/nft/thirdweb-organizer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export class NftCollection {
eventSlug,
} = props;

const res = await createEventPassNftContract(object);
await createEventPassNftContract(object);

const hasuraMetadatas = await this.createHasuraMetadatas(
metadatas,
Expand Down Expand Up @@ -415,7 +415,8 @@ export class NftCollection {
password,
);

const baseUri = (await contract.erc721.getAll())[0].metadata.uri;
const fullBaseUri = (await contract.erc721.getAll())[0].metadata.uri;
const baseUri = fullBaseUri.slice(0, -1);

await this.saveEventPassContractIntoDb({
props,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-table": "^8.10.7",
"@thirdweb-dev/chains": "^0.1.61",
"@thirdweb-dev/sdk": "^4.0.21",
"@thirdweb-dev/sdk": "^4.0.27",
"@uidotdev/usehooks": "2.4.1",
"@vercel/analytics": "^0.1.11",
"@vercel/edge-config": "^0.4.1",
Expand Down
127 changes: 103 additions & 24 deletions pnpm-lock.yaml

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