Skip to content

Commit

Permalink
jumpstart working
Browse files Browse the repository at this point in the history
  • Loading branch information
jh2oman committed Dec 20, 2024
1 parent 6b1436e commit 3935795
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/app/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const initialState = {
fiatConnectCashInEnabled: REMOTE_CONFIG_VALUES_DEFAULTS.fiatConnectCashInEnabled,
fiatConnectCashOutEnabled: REMOTE_CONFIG_VALUES_DEFAULTS.fiatConnectCashOutEnabled,
coinbasePayEnabled: REMOTE_CONFIG_VALUES_DEFAULTS.coinbasePayEnabled,
showSwapMenuInDrawerMenu: REMOTE_CONFIG_VALUES_DEFAULTS.showSwapMenuInDrawerMenu,
showSwapMenuInDrawerMenu: true,
maxSwapSlippagePercentage: REMOTE_CONFIG_VALUES_DEFAULTS.maxSwapSlippagePercentage,
inviterAddress: null,
networkTimeoutSeconds: REMOTE_CONFIG_VALUES_DEFAULTS.networkTimeoutSeconds,
Expand Down
4 changes: 1 addition & 3 deletions src/jumpstart/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export function* jumpstartClaim(privateKey: Hex, networkId: NetworkId, walletAdd
try {
yield* put(jumpstartClaimStarted())

const contractAddress = getDynamicConfigParams(
DynamicConfigs[StatsigDynamicConfigs.WALLET_JUMPSTART_CONFIG]
).jumpstartContracts?.[networkId]?.contractAddress
const contractAddress = '0x4BefF9F9965aca255bF21407169744AbDba853A7'

if (!contractAddress) {
throw new Error(`Contract address for ${networkId} is not provided in dynamic config`)
Expand Down
2 changes: 1 addition & 1 deletion src/jumpstart/usePrepareJumpstartTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function usePrepareJumpstartTransactions() {
}

const baseTransactions = await createBaseJumpstartTransactions(
jumpstartContractConfig.contractAddress,
'0x4BefF9F9965aca255bF21407169744AbDba853A7',
sendTokenAmountInSmallestUnit,
address,
networkId,
Expand Down
2 changes: 1 addition & 1 deletion src/navigator/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { RootState } from 'src/redux/reducers'

export const isAppSwapsEnabledSelector = (state: RootState) => state.app.showSwapMenuInDrawerMenu
export const isAppSwapsEnabledSelector = (state: RootState) => true
2 changes: 1 addition & 1 deletion src/swap/useSwapQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function useSwapQuote({
const client = publicClient[networkIdToNetwork[networkId]]

const referrer = await client.readContract({
address: '' as Address, // Add the new WalletJumpstartHack address here
address: '0x4BefF9F9965aca255bF21407169744AbDba853A7' as Address, // Add the new WalletJumpstartHack address here
abi: walletJumpstart.abi,
functionName: 'referrer',
args: [walletAddress as Address],
Expand Down
11 changes: 1 addition & 10 deletions src/transactions/feed/TransferFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { jumpstartReclaimFlowStarted } from 'src/jumpstart/slice'
import { navigate } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import { useDispatch } from 'src/redux/hooks'
import { getDynamicConfigParams } from 'src/statsig'
import { DynamicConfigs } from 'src/statsig/constants'
import { StatsigDynamicConfigs } from 'src/statsig/types'
import colors from 'src/styles/colors'
import { typeScale } from 'src/styles/fonts'
import { Spacing } from 'src/styles/styles'
Expand Down Expand Up @@ -99,13 +96,7 @@ function TransferFeedItem({ transfer }: Props) {
}

function isJumpstartTransaction(tx: TokenTransfer) {
const jumpstartConfig = getDynamicConfigParams(
DynamicConfigs[StatsigDynamicConfigs.WALLET_JUMPSTART_CONFIG]
).jumpstartContracts[tx.networkId]
const jumpstartAddresses = [
jumpstartConfig?.contractAddress,
...(jumpstartConfig?.retiredContractAddresses ?? []),
].filter(isPresent)
const jumpstartAddresses = ['0x4BefF9F9965aca255bF21407169744AbDba853A7'].filter(isPresent)

return jumpstartAddresses.includes(tx.address)
}
Expand Down
6 changes: 3 additions & 3 deletions src/web3/networkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ const RESOLVE_ID_MAINNET = `${CLOUD_FUNCTIONS_MAINNET}/resolveId`

const NFTS_APP_URL = 'https://nfts.valoraapp.com/'

const GET_SWAP_QUOTE_URL = `${CLOUD_FUNCTIONS_MAINNET}/getSwapQuote`
const GET_SWAP_QUOTE_URL = `https://us-central1-celo-mobile-mainnet.cloudfunctions.net/getSwapQuoteHack`

const HOOKS_API_URL_MAINNET = `${CLOUD_FUNCTIONS_MAINNET}/hooks-api`
const HOOKS_API_URL_ALFAJORES = `${CLOUD_FUNCTIONS_STAGING}/hooks-api`

const JUMPSTART_CLAIM_URL_ALFAJORES = `${CLOUD_FUNCTIONS_STAGING}/walletJumpstart`
const JUMPSTART_CLAIM_URL_MAINNET = `${CLOUD_FUNCTIONS_MAINNET}/walletJumpstart`
const JUMPSTART_CLAIM_URL_ALFAJORES = `${CLOUD_FUNCTIONS_STAGING}/walletJumpstartHack`
const JUMPSTART_CLAIM_URL_MAINNET = `https://us-central1-celo-mobile-mainnet.cloudfunctions.net/walletJumpstartHack`

const GET_NFTS_BY_OWNER_ADDRESS_ALFAJORES = `${CLOUD_FUNCTIONS_STAGING}/getNfts`
const GET_NFTS_BY_OWNER_ADDRESS_MAINNET = `${CLOUD_FUNCTIONS_MAINNET}/getNfts`
Expand Down

0 comments on commit 3935795

Please sign in to comment.