-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nfts: mints #5019
nfts: mints #5019
Changes from 38 commits
eedad81
a00e204
6eb4f52
37663f9
42fa90c
7bc1844
aa08232
5088ca9
5a78dda
811519f
28902bd
294b38c
c9eb904
4dc00ea
e21b950
aaca2f1
4ce4a6f
f071f67
88f6a75
43b4151
0d1c089
8d35ff1
fca66f2
b3f9396
d026b65
37b9070
3236ea8
4e86cac
3262ddc
88f1152
a54b0d8
6bae34e
1b2246f
3a05954
294a42a
b253c49
fe4d705
f6421b4
60faf6f
9c9a88b
5b55e97
35e1320
21e4798
60bd8b3
8df2f45
b15a955
b886fa1
bdcf4c6
ed6bd58
4241c16
88a7c9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { CardType } from '@/components/cards/GenericCard'; | ||
import { LearnCategory } from '@/components/cards/utils/types'; | ||
import { FiatProviderName } from '@/entities/f2c'; | ||
import { Network } from '@/networks/types'; | ||
|
||
/** | ||
* All events, used by `analytics.track()` | ||
|
@@ -78,9 +79,14 @@ export const event = { | |
nftOffersSelectedSortCriterion: 'Selected NFT Offers Sort Criterion', | ||
nftOffersAcceptedOffer: 'Accepted NFT Offer', | ||
|
||
nftMintsOpenedSheet: 'Opened NFT Mint Sheet', | ||
nftMintsMintingNFT: 'Minting NFT', | ||
nftMintsMintedNFT: 'Minted NFT', | ||
|
||
poapsOpenedMintSheet: 'Opened POAP mint sheet', | ||
poapsMintedPoap: 'Minted POAP', | ||
poapsViewedOnPoap: 'Viewed POAP on poap.gallery', | ||
|
||
positionsOpenedSheet: 'Opened position Sheet', | ||
positionsOpenedExternalDapp: 'Viewed external dapp', | ||
|
||
|
@@ -292,6 +298,23 @@ export type EventProperties = { | |
rainbowFee: number; | ||
offerCurrency: { symbol: string; contractAddress: string }; | ||
}; | ||
[event.nftMintsMintingNFT]: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we should use chainId instead of Network. network might have been a better call tbh, but i already used chainId for existing events. aligning them would make amplitude stuff a lot more straightforward also can we add priceInEth like the existing events below? currently we're using this to group mints in amplitude by free/paid. https://github.com/rainbow-me/rainbow/blob/develop/src/components/cards/FeaturedMintCard.tsx#L119-L123 |
||
contract: string; | ||
network: Network; | ||
quantity: number; | ||
collectionName: string; | ||
}; | ||
[event.nftMintsMintedNFT]: { | ||
contract: string; | ||
network: Network; | ||
quantity: number; | ||
collectionName: string; | ||
}; | ||
[event.nftMintsOpenedSheet]: { | ||
contract: string; | ||
network: Network; | ||
collectionName: string; | ||
}; | ||
[event.poapsMintedPoap]: { | ||
eventId: number; | ||
type: 'qrHash' | 'secretWord'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ import { IS_IOS } from '@/env'; | |
import { Media } from '../Media'; | ||
import { analyticsV2 } from '@/analytics'; | ||
import * as i18n from '@/languages'; | ||
import { navigateToMintCollection } from '@/resources/reservoir/mints'; | ||
import { ethereumUtils } from '@/utils'; | ||
|
||
const IMAGE_SIZE = 111; | ||
|
||
|
@@ -123,7 +125,11 @@ export function FeaturedMintCard() { | |
), | ||
} | ||
); | ||
Linking.openURL(featuredMint.externalURL); | ||
const network = ethereumUtils.getNetworkFromChainId( | ||
featuredMint.chainId | ||
); | ||
navigateToMintCollection(featuredMint.contract, network); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. im no expert on this but could be worth pulling out into a useCallback so the callback isn't recreated multiple times |
||
// Linking.openURL(featuredMint.externalURL); | ||
}} | ||
scaleTo={0.96} | ||
> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,13 @@ import { ButtonPressAnimation } from '@/components/animations'; | |
import { useTheme } from '@/theme'; | ||
import { Linking, View } from 'react-native'; | ||
import { MintableCollection } from '@/graphql/__generated__/arc'; | ||
import { getNetworkFromChainId } from '@/utils/ethereumUtils'; | ||
import ethereumUtils, { getNetworkFromChainId } from '@/utils/ethereumUtils'; | ||
import { getNetworkObj } from '@/networks'; | ||
import { analyticsV2 } from '@/analytics'; | ||
import * as i18n from '@/languages'; | ||
import { IS_IOS } from '@/env'; | ||
import { ImgixImage } from '@/components/images'; | ||
import { navigateToMintCollection } from '@/resources/reservoir/mints'; | ||
|
||
export const NFT_IMAGE_SIZE = 111; | ||
|
||
|
@@ -98,7 +99,9 @@ export function CollectionCell({ | |
chainId: collection.chainId, | ||
priceInEth: amount, | ||
}); | ||
Linking.openURL(collection.externalURL); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. im no expert on this but could be worth pulling out into a |
||
const network = ethereumUtils.getNetworkFromChainId(collection.chainId); | ||
navigateToMintCollection(collection.contract, network); | ||
}} | ||
style={{ width: NFT_IMAGE_SIZE }} | ||
> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,19 @@ const StatusProps = { | |
marginTop: ios ? -3 : -5, | ||
}, | ||
}, | ||
[TransactionStatusTypes.minted]: { | ||
name: 'sunflower', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lfg sunflower gang |
||
style: { | ||
fontSize: 11, | ||
left: -1.3, | ||
marginRight: 1, | ||
marginTop: ios ? -3 : -5, | ||
}, | ||
}, | ||
[TransactionStatusTypes.minting]: { | ||
marginRight: 4, | ||
marginTop: ios ? 1 : 0, | ||
}, | ||
}; | ||
|
||
const sx = StyleSheet.create({ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ exports.config = { | |
document: './queries/arc.graphql', | ||
schema: { | ||
method: 'GET', | ||
url: 'https://arc-graphql.rainbow.me/graphql', | ||
url: 'https://arc-graphql.rainbowdotme.workers.dev/graphql', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't forget to switch back to prod endpoint |
||
headers: { | ||
'x-api-key': 'ARC_GRAPHQL_API_KEY', | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ export const ensClient = getEnsSdk(getFetchRequester(config.ens)); | |
export const metadataClient = getMetadataSdk( | ||
getFetchRequester(config.metadata) | ||
); | ||
export const arcClient = getArcSdk(getFetchRequester(config.arc)); | ||
export const arcClient = getArcSdk(getFetchRequester(config.arcDev)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't forget to switch back to prod endpoint |
||
export const arcDevClient = getArcDevSdk(getFetchRequester(config.arcDev)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,6 +186,18 @@ export default function useGas({ | |
[dispatch] | ||
); | ||
|
||
const getTotalGasPrice = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prob should be in useCallback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yess ty king |
||
const txFee = gasData?.selectedGasFee?.gasFee; | ||
const isLegacyGasNetwork = | ||
getNetworkObj(gasData?.txNetwork).gas.gasType === 'legacy'; | ||
const txFeeValue = isLegacyGasNetwork | ||
? (txFee as LegacyGasFee)?.estimatedFee | ||
: (txFee as GasFee)?.maxFee; | ||
|
||
const txFeeAmount = fromWei(txFeeValue?.value?.amount); | ||
return txFeeAmount; | ||
}; | ||
|
||
return { | ||
isGasReady, | ||
isSufficientGas, | ||
|
@@ -197,6 +209,7 @@ export default function useGas({ | |
updateGasFeeOption, | ||
updateToCustomGasFee, | ||
updateTxFee, | ||
getTotalGasPrice, | ||
...gasData, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a big deal but i think the naming convention should match the existing ones that i created for mints (see line 93 and below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it