Skip to content

Commit

Permalink
Merge branch 'main' into nicole/fix-nan-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Oct 10, 2024
2 parents ecf60a8 + 8a8c970 commit ed0b303
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cypress/fixtures/proof-of-backing/backingAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export const cakeBackingAddresses = [
},
{
token: "dDOT",
link: "https://polkadot.subscan.io/account/12YfgqECReN4fQppa9BDoyGce43F54ZHYotE77mb5SmCBsUks",
link: "https://polkadot.subscan.io/account/12YfgqECReN4fQppa9BDoyGce43F54ZHYotE77mb5SmCBsUk",
},
{
token: "dSUI",
link: "https://suiexplorer.com/address/0xe319ee27de5d3cb4a2345c8b714a69d6710ca05395e3709983d886061b1b818d",
link: "https://suiscan.xyz/mainnet/account/0xe319ee27de5d3cb4a2345c8b714a69d6710ca05395e3709983d886061b1b818d",
},
];

Expand Down
6 changes: 3 additions & 3 deletions src/components/commons/link/AddressLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ interface AddressLinkProps {
}

export function AddressLink(
props: PropsWithChildren<AddressLinkProps>
props: PropsWithChildren<AddressLinkProps>,
): JSX.Element {
if (props.address === undefined || props.address.length === 0) {
if (!props.address || props.address.length === 0) {
return <></>;
}

Expand All @@ -21,7 +21,7 @@ export function AddressLink(
data-testid={props.testId}
className={classnames(
"hover:underline text-blue-500 cursor-pointer",
props.className
props.className,
)}
>
<Link href={{ pathname: `/address/${props.address}` }}>
Expand Down
4 changes: 2 additions & 2 deletions src/constants/TokenBackedAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ export const TOKEN_BACKED_ADDRESS: BackedAddress = {
},
DOT: {
cake: {
link: "https://polkadot.subscan.io/account/12YfgqECReN4fQppa9BDoyGce43F54ZHYotE77mb5SmCBsUks",
link: "https://polkadot.subscan.io/account/12YfgqECReN4fQppa9BDoyGce43F54ZHYotE77mb5SmCBsUk",
address: "12YfgqECReN4fQppa9BDoyGce43F54ZHYotE77mb5SmCBsUk",
},
},
SUI: {
cake: {
link: "https://suiexplorer.com/address/0xe319ee27de5d3cb4a2345c8b714a69d6710ca05395e3709983d886061b1b818d",
link: "https://suiscan.xyz/mainnet/account/0xe319ee27de5d3cb4a2345c8b714a69d6710ca05395e3709983d886061b1b818d",
address:
"0xe319ee27de5d3cb4a2345c8b714a69d6710ca05395e3709983d886061b1b818d",
},
Expand Down
28 changes: 23 additions & 5 deletions src/layouts/contexts/WhaleContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,25 @@ export function getWhaleApiClient(
): WhaleApiClient {
const network =
context.query.network?.toString() ?? getEnvironment().networks[0];
return newWhaleClient(newOceanOptions(network as EnvironmentNetwork));
return newWhaleClient(
newOceanOptions(
network as EnvironmentNetwork,
process.env.NEXT_PUBLIC_API_CLIENT_ENDPOINT,
),
);
}

export function getWhaleRpcClient(
context: GetServerSidePropsContext,
): WhaleRpcClient {
const network =
context.query.network?.toString() ?? getEnvironment().networks[0];
return newRpcClient(newOceanOptions(network as EnvironmentNetwork));
return newRpcClient(
newOceanOptions(
network as EnvironmentNetwork,
process.env.NEXT_PUBLIC_RPC_CLIENT_ENDPOINT,
),
);
}

export function newPlaygroundRpcClient(
Expand All @@ -66,10 +76,18 @@ export function WhaleProvider(
const connection = useNetwork().connection;

const memo = useMemo(() => {
const options = newOceanOptions(connection);
const apiClientOptions = newOceanOptions(
connection,
process.env.NEXT_PUBLIC_API_CLIENT_ENDPOINT,
);
const rpcClientOptions = newOceanOptions(
connection,
process.env.NEXT_PUBLIC_RPC_CLIENT_ENDPOINT,
);

return {
api: newWhaleClient(options),
rpc: newRpcClient(options),
api: newWhaleClient(apiClientOptions),
rpc: newRpcClient(rpcClientOptions),
};
}, [connection]);

Expand Down

0 comments on commit ed0b303

Please sign in to comment.