Skip to content
Open
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: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_SEARCH_INPUT_TEXT_DELAYER=300
REACT_APP_SEARCH_INPUT_TEXT_MINIMUM_LENGTH=3
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@rbl:registry=https://us-central1-npm.pkg.dev/rbl-common/rbl/
//us-central1-npm.pkg.dev/rbl-common/rbl/:_authToken="ya29.A0ARrdaM9VpQcc5egcSN7zzEGQLyvz5jZiXEkIDmnsV2RW3KBbhbq8qkRHMUcC6gxknE9LuDW3mt4Dz3teWYXfI-4WGr6_mTQqj60BhAg4sPA7wov7PM-E3QonNwTN9De41ARPJUyvfc8Mi2GVoYzle3MJ_8KNYo4"
//us-central1-npm.pkg.dev/rbl-common/rbl/:_authToken="ya29.A0ARrdaM-GfFYg4Qg9a29AOiKlQFyYdH5R94i7UZSHz0WNS16b8pe2hFyogr2i25gwXXqfwx9zY9HRG0cO3ydMaPrz-lAXIwmuIEKJBJ26Rgg92mt6FScoaLLH6479ywWMgkgojWgVcaSJy9CxmMG48SpxVCB01Q"
//us-central1-npm.pkg.dev/rbl-common/rbl/:always-auth=true
93 changes: 62 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/redux/tokenSearchSlice.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
import retry from 'async-retry';
import { stringify } from 'flatted';
import {searchTokensAsync} from "../tokenSearch/helpers/async";
import { searchTokensAsync } from "../tokenSearch/helpers/async";

export const setPair = createAsyncThunk(
'token/setPair',
Expand Down Expand Up @@ -29,19 +29,20 @@ const setPairSearchTimestamp = createAsyncThunk(
export const searchTokenPairs = createAsyncThunk(
'token/search',
async (searchString, thunkAPI) => {
console.log("searchTokenPairs")
console.log("searchTokenPairs: " + searchString)
try {
// const { strategy } = thunkAPI.getState().velox;
const pairSearchTimestamp = new Date().getTime();
thunkAPI.dispatch(setPairSearchTimestamp(pairSearchTimestamp));
const data = await retry(
() => searchTokensAsync(searchString, JSON.parse(`{"identifiers":{"blockchain":"Avalanche","chainId":"43114","exchange":"Pangolin"},"key":"pangolin","tableSuffix":"pangolin"}`)),//todo this should be props into the component or something -- from src/containers/exchangeSelector/allowableExchanges.ts in velox
//todo this should be props into the component or something -- from src/containers/exchangeSelector/allowableExchanges.ts in velox
() => searchTokensAsync(searchString, JSON.parse(`{"identifiers":{"blockchain":"Avalanche","chainId":"43114","exchange":"Pangolin"},"key":"pangolin","tableSuffix":"pangolin"}`)),
{ retries: 1 }
);
console.log("data",data)
console.log("data", data)
return { data, pairSearchTimestamp };
} catch (e) {
console.log("err searchTokenPairs",e)
console.log("err searchTokenPairs", e)
throw new Error(stringify(e, Object.getOwnPropertyNames(e)));
}
}
Expand Down Expand Up @@ -116,6 +117,5 @@ export const tokenSearchSlice = createSlice({
},
});

export const { setSearchText, startSelecting, stopSelecting, toggleSelecting } =
tokenSearchSlice.actions;
export const { setSearchText, startSelecting, stopSelecting, toggleSelecting } = tokenSearchSlice.actions;
export default tokenSearchSlice.reducer;
Loading