Created
December 20, 2024 13:12
-
-
Save ajtransak/d1501080b839e4d009e1cd53d3399201 to your computer and use it in GitHub Desktop.
Transak Sandbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from "react"; | |
import Stack from "@mui/material/Stack"; | |
import Box from "@mui/material/Box"; | |
import { Transak } from "@transak/transak-sdk"; | |
import config from "../config"; | |
export default function OffRampStreamSDK() { | |
useEffect(() => { | |
const transakConfig = { | |
apiKey: config.apiKeyGlobalStaging, | |
environment: Transak.ENVIRONMENTS.STAGING, | |
containerId: "transakContainer", | |
isTransakStreamOffRamp: true, | |
cryptoCurrencyCode: "ETH", | |
network: "ethereum", | |
}; | |
const transak = new Transak(transakConfig); | |
transak.init(); | |
return () => { | |
transak.close(); | |
}; | |
}, []); | |
return ( | |
<Stack direction="column" alignItems="center" sx={{ p: "4px" }}> | |
<Box | |
sx={{ | |
width: "100%", | |
minHeight: "100px", | |
p: "16px", | |
border: "1px dashed grey", | |
}} | |
> | |
<Stack direction="column" justifyContent="center" alignItems="center"> | |
<div | |
style={{ | |
display: "flex", | |
justifyContent: "center", | |
alignItems: "center", | |
flexDirection: "column", | |
}} | |
> | |
<div id="transakContainer" /> | |
</div> | |
</Stack> | |
</Box> | |
</Stack> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment