Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion governance/xc_admin/packages/proposer_server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { getPythClusterApiUrl, PythCluster } from "@pythnetwork/client";
import SquadsMesh from "@sqds/mesh";
import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";

const PORT: number = Number(process.env.PORT ?? "3000");
const PORT: number = Number(process.env.PORT ?? "4000");
const KEYPAIR: Keypair = Keypair.fromSecretKey(
Uint8Array.from(JSON.parse(fs.readFileSync(envOrErr("WALLET"), "ascii")))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ const PermissionDepermissionKey = ({
isPermission,
pythProgramClient,
squads,
proposerServerUrl,
}: {
isPermission: boolean
pythProgramClient?: Program<PythOracle>
squads?: SquadsMesh
proposerServerUrl: string
}) => {
const [publisherKey, setPublisherKey] = useState(
'JTmFx5zX9mM94itfk2nQcJnQQDPjcv4UPD7SYj6xDCV'
Expand Down Expand Up @@ -104,10 +106,10 @@ const PermissionDepermissionKey = ({
}
setIsSubmitButtonLoading(true)
try {
const response = await axios.post(
process.env.NEXT_PUBLIC_PROPOSER_SERVER_URL + '/api/propose',
{ instructions, cluster }
)
const response = await axios.post(proposerServerUrl + '/api/propose', {
instructions,
cluster,
})
const { proposalPubkey } = response.data
toast.success(`Proposal sent! 🚀 Proposal Pubkey: ${proposalPubkey}`)
setIsSubmitButtonLoading(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Spinner from '../common/Spinner'
import Loadbar from '../loaders/Loadbar'
import PermissionDepermissionKey from '../PermissionDepermissionKey'

const General = () => {
const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
const [data, setData] = useState<any>({})
const [dataChanges, setDataChanges] = useState<Record<string, any>>()
const [existingSymbols, setExistingSymbols] = useState<Set<string>>(new Set())
Expand Down Expand Up @@ -465,10 +465,10 @@ const General = () => {

setIsSendProposalButtonLoading(true)
try {
const response = await axios.post(
process.env.NEXT_PUBLIC_PROPOSER_SERVER_URL + '/api/propose',
{ instructions, cluster }
)
const response = await axios.post(proposerServerUrl + '/api/propose', {
instructions,
cluster,
})
const { proposalPubkey } = response.data
toast.success(`Proposal sent! 🚀 Proposal Pubkey: ${proposalPubkey}`)
setIsSendProposalButtonLoading(false)
Expand Down Expand Up @@ -767,11 +767,13 @@ const General = () => {
isPermission={true}
pythProgramClient={pythProgramClient}
squads={proposeSquads}
proposerServerUrl={proposerServerUrl}
/>
<PermissionDepermissionKey
isPermission={false}
pythProgramClient={pythProgramClient}
squads={proposeSquads}
proposerServerUrl={proposerServerUrl}
/>
</div>
<div className="relative mt-6">
Expand Down
12 changes: 10 additions & 2 deletions governance/xc_admin/packages/xc_admin_frontend/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export const getServerSideProps: GetServerSideProps = async () => {
)
: {}

const proposerServerUrl =
process.env.PROPOSER_SERVER_URL || 'http://localhost:4000'
return {
props: {
proposerServerUrl,
publisherKeyToNameMapping,
multisigSignerKeyToNameMapping,
},
Expand Down Expand Up @@ -77,7 +80,12 @@ const DEFAULT_TAB = 'general'
const Home: NextPage<{
publisherKeyToNameMapping: Record<string, Record<string, string>>
multisigSignerKeyToNameMapping: Record<string, string>
}> = ({ publisherKeyToNameMapping, multisigSignerKeyToNameMapping }) => {
proposerServerUrl: string
}> = ({
publisherKeyToNameMapping,
multisigSignerKeyToNameMapping,
proposerServerUrl,
}) => {
const [currentTabIndex, setCurrentTabIndex] = useState(0)
const tabInfoArray = Object.values(TAB_INFO)
const anchorWallet = useAnchorWallet()
Expand Down Expand Up @@ -143,7 +151,7 @@ const Home: NextPage<{
</div>
{tabInfoArray[currentTabIndex].queryString ===
TAB_INFO.General.queryString ? (
<General />
<General proposerServerUrl={proposerServerUrl} />
) : tabInfoArray[currentTabIndex].queryString ===
TAB_INFO.UpdatePermissions.queryString ? (
<UpdatePermissions />
Expand Down