Skip to content

Commit

Permalink
Rpc select (#465)
Browse files Browse the repository at this point in the history
* update rpc list

* add orderly log

* add orderly key for spot

---------

Co-authored-by: yuho <[email protected]>
Co-authored-by: nature.xie <[email protected]>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent 52509d6 commit 7287e5f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Content } from 'src/Content';
import { LedgerTransactionModal } from './context/modal-ui/modal';
import { XmasActivityContextProvider } from './context/XmasActivity';
import { ModalGAPrivacy } from 'src/context/modal-ui/modalGAPrivacy/modalGAPrivacy';
import RpcList from "src/components/rpc";

function App() {
return (
Expand All @@ -28,7 +29,7 @@ function App() {
</div>
</XmasActivityContextProvider>
</WalletSelectorContextProvider>

<RpcList></RpcList>
<LedgerTransactionModal />
<ModalGAPrivacy />
</Router>
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function Footer() {
})}
</div>
</footer>
<RpcList></RpcList>
{/*<RpcList></RpcList>*/}
</div>
</>
);
Expand Down
9 changes: 8 additions & 1 deletion src/pages/Orderly/components/UserBoard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,10 @@ export function UserBoardMobileSpot({ maintenance }: { maintenance: boolean }) {

useEffect(() => {
if (!accountId || !storageEnough) return;

console.log(
'storedValidstoredValidstoredValidstoredValidstoredValid---spot',
storedValid
);
if (!!storedValid) {
setValidAccountSig(true);
setKeyAnnounced(true);
Expand All @@ -2391,18 +2394,22 @@ export function UserBoardMobileSpot({ maintenance }: { maintenance: boolean }) {

is_orderly_key_announced(accountId, true)
.then(async (key_announce) => {
console.log('search result key_announce_spot', key_announce);
setKeyAnnounced(key_announce);
if (!key_announce) {
const res = await announceKey(accountId).then((res) => {
console.log('set key_announce_spot as true');
setKeyAnnounced(true);
});
} else return;
})
.then(() => {
is_trading_key_set(accountId).then(async (trading_key_set) => {
console.log('search result trading_announce_spot', trading_key_set);
setTradingKeySet(trading_key_set);
if (!trading_key_set) {
await setTradingKey(accountId).then(() => {
console.log('set trading_key_spot as true');
setTradingKeySet(true);
});
}
Expand Down
11 changes: 9 additions & 2 deletions src/pages/Orderly/components/UserBoardPerp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -826,10 +826,13 @@ export default function UserBoard({ maintenance }: { maintenance: boolean }) {
const [errorTipMsg, setErrorTipMsg] = useState<string>('');

const storedValid = localStorage.getItem(REF_ORDERLY_ACCOUNT_VALID);

// TODO connect entry
useEffect(() => {
if (!accountId || !storageEnough) return;

console.log(
'storedValidstoredValidstoredValidstoredValidstoredValid',
storedValid
);
if (!!storedValid) {
setValidAccountSig(true);
setKeyAnnounced(true);
Expand All @@ -840,10 +843,12 @@ export default function UserBoard({ maintenance }: { maintenance: boolean }) {

is_orderly_key_announced(accountId, true)
.then(async (key_announce) => {
console.log('search result key_announce', key_announce);
setKeyAnnounced(key_announce);
if (!key_announce) {
const res = await announceKey(accountId)
.then((res) => {
console.log('set key_announce as true');
setKeyAnnounced(true);
})
.catch((e) => {
Expand All @@ -854,10 +859,12 @@ export default function UserBoard({ maintenance }: { maintenance: boolean }) {
})
.then(() => {
is_trading_key_set(accountId).then(async (trading_key_set) => {
console.log('search result trading_announce', trading_key_set);
setTradingKeySet(trading_key_set);
if (!trading_key_set) {
await setTradingKey(accountId)
.then(() => {
console.log('set trading_key as true');
setTradingKeySet(true);
})
.catch((e) => {
Expand Down

0 comments on commit 7287e5f

Please sign in to comment.