Skip to content
Merged
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
4 changes: 1 addition & 3 deletions .github/workflows/deploy-proxy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Publish Proxy Package

on:
push:
branches: [hyper-proxy-deploy]

workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
Expand Down
4 changes: 2 additions & 2 deletions packages/mask/src/plugins/Avatar/SNSAdaptor/NFTAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ export function NFTAvatar(props: NFTAvatarProps) {
)
.filter(
(token: ERC721TokenDetailed) =>
token.info.mediaUrl &&
!token.info.mediaUrl?.match(/\.(mp4|webm|mov|ogg|mp3|wav)$/i),
token.info.imageURL &&
!token.info.imageURL?.match(/\.(mp4|webm|mov|ogg|mp3|wav)$/i),
)
.map((token: ERC721TokenDetailed, i) => (
<NFTImage
Expand Down
2 changes: 1 addition & 1 deletion packages/mask/src/plugins/Avatar/SNSAdaptor/NFTImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function NFTImage(props: NFTImageProps) {
<div className={classes.imgBackground}>
<img
onClick={() => onChange(token)}
src={token.info.mediaUrl}
src={token.info.imageURL}
className={classNames(classes.image, isSameNFT(token, selectedToken) ? classes.selected : '')}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ function NFTAvatarInTwitter() {
const [avatarEvent, setAvatarEvent] = useState<NFTAvatarEvent | undefined>()

const onChange = async (token: ERC721TokenDetailed) => {
if (!token.info.mediaUrl) return
const image = await toPNG(token.info.mediaUrl)
if (!token.info.imageURL) return
const image = await toPNG(token.info.imageURL)
if (!image) return
changeImageToActiveElements(image)

Expand Down
5 changes: 3 additions & 2 deletions packages/web3-providers/src/opensea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ function createERC721TokenFromAsset(
chainId: ChainId,
asset: OpenSeaResponse,
): ERC721TokenDetailed {
const imageURL = asset?.image_original_url ?? asset?.image_url ?? asset?.image_preview_url ?? ''
return createERC721Token(
createERC721ContractFromAssetContract(asset?.asset_contract?.address, chainId, asset?.asset_contract),
{
name: asset?.name ?? asset?.asset_contract.name ?? '',
description: asset?.description ?? '',
mediaUrl:
asset?.animation_url ?? asset.image_original_url ?? asset?.image_url ?? asset?.image_preview_url ?? '',
imageURL,
mediaUrl: asset?.animation_url || imageURL,
owner: asset?.owner.address ?? '',
},
tokenId,
Expand Down
6 changes: 5 additions & 1 deletion packages/web3-providers/src/rarible/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function createERC721TokenFromAsset(
tokenId: string,
asset?: RaribleNFTItemMapResponse,
): ERC721TokenDetailed {
const imageURL = toRaribleImage(asset?.meta.image?.url.ORIGINAL ?? asset?.meta.image?.url.PREVIEW ?? '')
return {
contractDetailed: {
type: EthereumTokenType.ERC721,
Expand All @@ -62,7 +63,10 @@ function createERC721TokenFromAsset(
info: {
name: asset?.meta.name ?? '',
description: asset?.meta.description ?? '',
mediaUrl: toRaribleImage(asset?.meta.image?.url.ORIGINAL ?? asset?.meta.image?.url.PREVIEW ?? ''),
mediaUrl:
toRaribleImage(asset?.meta.animation?.url.ORIGINAL ?? asset?.meta.animation?.url.PREVIEW ?? '') ||
imageURL,
imageURL,
owner: asset?.owners[0],
},
tokenId: tokenId,
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-shared/base/proxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ProviderProxy {
private readonly _globalNotify?: NotifyFn

constructor(point: string, notifyFn?: NotifyFn) {
this._socket = new ReconnectingWebSocket(point)
this._socket = new ReconnectingWebSocket(point, undefined, { minUptime: 20000 })
this._pool = new Map<string, SocketPoolItem>()
this._globalNotify = notifyFn
}
Expand Down
1 change: 1 addition & 0 deletions packages/web3-shared/evm/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export interface ERC721TokenInfo {
description?: string
tokenURI?: string
mediaUrl?: string
imageURL?: string
owner?: string
// loading tokenURI
hasTokenDetailed?: boolean
Expand Down