File tree Expand file tree Collapse file tree 7 files changed +24
-16
lines changed
api/services/admin-transfer Expand file tree Collapse file tree 7 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export const handleFreezeBurn = async (
1919 res : NextApiResponse
2020) => {
2121 await dbConnect ( ) ;
22- const web3 = new Web3 ( "https://rpc.syscoin.org" ) ;
22+ const web3 = new Web3 ( process . env . NEVM_RPC_URL ! ) ;
2323
2424 const { address } = req . session . user ! ;
2525
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export const handleSubmitProofs = async (
1919 res : NextApiResponse
2020) => {
2121 await dbConnect ( ) ;
22- const web3 = new Web3 ( "https://rpc.syscoin.org" ) ;
22+ const web3 = new Web3 ( process . env . NEVM_RPC_URL ! ) ;
2323
2424 const { address } = req . session . user ! ;
2525
Original file line number Diff line number Diff line change @@ -4,16 +4,6 @@ import { utils } from "syscoinjs-lib";
44import { useSyscoin } from "../context/Syscoin" ;
55import { usePaliWalletV2 } from "@contexts/PaliWallet/usePaliWallet" ;
66
7- // Component
8-
9- // const freezeBurnConfirmationLog = transfer.logs.find(
10- // (log) => log.status === "confirm-freeze-burn-sys"
11- // );
12- // if (!freezeBurnConfirmationLog) {
13- // return;
14- // }
15- // const receipt = freezeBurnConfirmationLog.payload.data as TransactionReceipt;
16-
177export const useMintSysx = ( transfer : ITransfer ) => {
188 const syscoinInstance = useSyscoin ( ) ;
199 const { sendTransaction } = usePaliWalletV2 ( ) ;
Original file line number Diff line number Diff line change 1+ import { useQuery } from "react-query" ;
2+
3+ type RpcApiResponse = {
4+ nevmRpc : string ;
5+ } ;
6+
7+ export const useRpc = ( ) => {
8+ return useQuery < RpcApiResponse > ( [ "rpc" ] , ( ) => {
9+ return fetch ( "/api/rpc" ) . then (
10+ ( res ) => res . json ( ) as Promise < RpcApiResponse >
11+ ) ;
12+ } ) ;
13+ } ;
Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ export const NEVMNetwork = {
99 symbol : "SYS" ,
1010 decimals : 18 ,
1111 } ,
12- rpcUrls : [ "https://rpc.syscoin.org" ] ,
12+ rpcUrls : [ process . env . NEVM_RPC_URL ! ] ,
1313 blockExplorerUrls : [ "https://explorer.syscoin.org/" ] ,
1414} ;
Original file line number Diff line number Diff line change 1+ import { NextApiRequest , NextApiResponse } from "next" ;
2+
3+ function handler ( req : NextApiRequest , res : NextApiResponse ) {
4+ return res . status ( 200 ) . json ( { nevmRpcUrl : process . env . NEVM_RPC_URL } ) ;
5+ }
6+
7+ export default handler ;
Original file line number Diff line number Diff line change 11import Web3 from "web3" ;
22
3- const web3 = new Web3 (
4- new Web3 . providers . HttpProvider ( "https://rpc.syscoin.org" )
5- ) ;
3+ const web3 = new Web3 ( new Web3 . providers . HttpProvider ( process . env . NEVM_RPC_URL ! ) ) ;
64
75export default web3 ;
You can’t perform that action at this time.
0 commit comments