Skip to content
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

Firefly PC v5.2.0 #11610

Draft
wants to merge 71 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7b2c864
feat: add `getOwnersByContract` api (#11609)
LeifXu May 10, 2024
e09739b
feat: add `getTopCollectorsByContract` api to `SimpleHashEVM` (#11611)
LeifXu May 10, 2024
ce7b7fe
fix: fw-555 wallet address is required to claim redpacket (#11614)
swkatmask May 13, 2024
3d04506
feat: export `resolveChainId` from `SimpleHash`
LeifXu May 13, 2024
2d17011
refactor: export simple hash helpers (#11615)
guanbinrui May 13, 2024
374fbef
refactor: revert resolveChainId
guanbinrui May 13, 2024
b1753de
feat: add params contract address to `getAssets` api in `SimpleHashAP…
LeifXu May 23, 2024
2a5f496
fix: simple hash (#11646)
guanbinrui May 23, 2024
eec9063
fix: entry helpers
guanbinrui May 23, 2024
3468d4e
fix: navigator is undefined
guanbinrui May 23, 2024
17bf902
fix: fix function `createNonFungibleAsset` hasn't owner (#11650)
LeifXu May 27, 2024
342617f
feat: add chain configs (#11651)
LeifXu May 28, 2024
fba63a8
feat: add new chain to resolveChainId (#11652)
LeifXu May 28, 2024
85e2b24
feat: add chain configs (#11654)
LeifXu May 29, 2024
deaae6f
feat: new zora icon (#11666)
LeifXu Jun 12, 2024
fd24ab6
feat: add poap event api (#11671)
LeifXu Jun 13, 2024
d7e37a5
fix: add collection id (#11672)
swkatmask Jun 13, 2024
34014b6
[Release] Hotfix 2.26.1 => 2.26.2 (patch) (#11673)
guanbinrui Jun 18, 2024
610f09e
feat: get params `count` to poap event api (#11674)
LeifXu Jun 19, 2024
8a41343
fix(Redpacket): address could be empty (#11678)
swkatmask Jun 22, 2024
1f13058
fix(RedPacket): disable share for twitter on Firefly (#11680)
swkatmask Jun 22, 2024
eaa720f
fix: coingecko data (#11683)
swkatmask Jun 30, 2024
bb3ae3a
fix: fw-1508 update repost text for lens (#11685)
swkatmask Jul 3, 2024
1b1ebcd
fix: disable history button when wallet not connected (#11679)
swkatmask Jul 4, 2024
adefeff
fix: fw-1575 only list supported chains in token picker (#11687)
swkatmask Jul 4, 2024
2bae552
fix: fw-1591 parsing redpacket could get null (#11688)
swkatmask Jul 4, 2024
74f4f10
refactor: remove sol sdk
guanbinrui Jul 15, 2024
9a81464
refactor: remove domain api
guanbinrui Jul 15, 2024
a08bf54
chore: engine
guanbinrui Jul 17, 2024
8d25af7
fix: adjust text (#11700)
LeifXu Jul 22, 2024
8bdd62a
chore: lock file
guanbinrui Jul 23, 2024
0144ce4
fix: remove calendar provider icon
LeifXu Jul 23, 2024
c42a267
feat: traditional chinese translation for calendar (#11702)
dudu0506 Jul 23, 2024
32e0f6f
fix: lazy load calendar data
swkatmask Jul 24, 2024
6648572
refactor: slim maskbook for firefly (#11694)
swkatmask Jul 26, 2024
97f9655
refactor: remove some more unused files (#11707)
swkatmask Jul 26, 2024
bec7d96
chore: remove more unused files (#11711)
swkatmask Jul 31, 2024
13fb5a3
fix: fw-1922 remain amount of refunded redpacket (#11712)
swkatmask Jul 31, 2024
f737512
feat: make red packet api root dynamic (#11719)
dudu0506 Aug 5, 2024
fe567e9
fix: bring back RecentTransaction
swkatmask Aug 6, 2024
c4b3c68
refactor: remove web3-telemetry
guanbinrui Aug 6, 2024
b7a2d39
refactor: remove unused hooks
guanbinrui Aug 6, 2024
0b04e48
chore: clean up web3-constants
guanbinrui Aug 6, 2024
e59654e
chore: remove Twitter API
guanbinrui Aug 6, 2024
0ca4da6
chore: cleanup web3-providers
guanbinrui Aug 6, 2024
31df4cd
chore: cleanup web3-providers
guanbinrui Aug 6, 2024
71ae464
chore: lock file
guanbinrui Aug 6, 2024
f59f981
fix: type errors
guanbinrui Aug 6, 2024
269980a
refactor: base contract wallet
guanbinrui Aug 6, 2024
8b5f76d
chore: remove pkgs
guanbinrui Aug 6, 2024
bd10d7d
refactor: update pkgs
guanbinrui Aug 6, 2024
f4e4afa
chore: shared-base-ui
guanbinrui Aug 7, 2024
d71c5b4
fix: fix polyfill decorate in brave (#11728)
LeifXu Aug 8, 2024
4047267
chore: upgrade anchormore
guanbinrui Aug 14, 2024
03f0fa4
chore: anchormore
guanbinrui Aug 14, 2024
9a51eca
chore: anchormore
guanbinrui Aug 14, 2024
1731223
chore: solana/web3
guanbinrui Aug 14, 2024
97dd868
chore: upgrade react use (#11735)
nuanyang233 Aug 14, 2024
411d146
refactor: remove unused icons
guanbinrui Aug 17, 2024
5a61def
feat: add `tokenCount` to NonFungibleAsset (#11750)
LeifXu Aug 19, 2024
07068d3
chore: add skip score check option
nuanyang233 Aug 20, 2024
da9173c
chore: candle.svg
guanbinrui Aug 20, 2024
332d143
fix: add skip score check for get asset
nuanyang233 Aug 20, 2024
0f14c04
fix: bugfix for rp history detail
nuanyang233 Aug 28, 2024
3aafab6
chore: up use-subscription (#11785)
guanbinrui Sep 11, 2024
c0ef310
refactor: remove calendar (#11751)
guanbinrui Sep 11, 2024
62ffa51
chore: codegen
guanbinrui Sep 11, 2024
f1dcbdf
feat: support scroll sdk (#11815)
dudu0506 Sep 26, 2024
0f388d6
Revert "feat: support scroll sdk (#11815)" (#11816)
dudu0506 Sep 26, 2024
153a169
refactor: remove some more unused files (#11772)
swkatmask Sep 30, 2024
4d63206
fix: export
guanbinrui Oct 1, 2024
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: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"yarn": ">=999.0.0",
"npm": ">=999.0.0"
},
"version": "2.25.0",
"version": "2.26.2",
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
Expand Down
8 changes: 3 additions & 5 deletions packages/icons/brands/FacebookColored.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 3 additions & 14 deletions packages/mask/.webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
const polyfillFolder = join(nonWebpackJSFiles, './polyfill')

const pnpmPatches = readdir(patchesDir).then((files) => files.map((x) => join(patchesDir, x)))

let WEB3_CONSTANTS_RPC = process.env.WEB3_CONSTANTS_RPC || ''
if (WEB3_CONSTANTS_RPC) {
try {
if (typeof JSON.parse(WEB3_CONSTANTS_RPC) === 'object') {
console.error("Environment variable WEB3_CONSTANTS_RPC should be JSON.stringify'ed twice")
WEB3_CONSTANTS_RPC = JSON.stringify(WEB3_CONSTANTS_RPC)
}
} catch (err) {}
}
const baseConfig = {
name: 'mask',
// to set a correct base path for source map
Expand Down Expand Up @@ -201,11 +191,10 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
new EnvironmentPlugin({
NODE_ENV: productionLike ? 'production' : flags.mode,
NODE_DEBUG: false,
/** JSON.stringify twice */
WEB3_CONSTANTS_RPC: WEB3_CONSTANTS_RPC,
WEB3_CONSTANTS_RPC: process.env.WEB3_CONSTANTS_RPC || '{}',
MASK_SENTRY_DSN: process.env.MASK_SENTRY_DSN || '',
MASK_SENTRY: process.env.MASK_SENTRY || JSON.stringify('disabled'),
MASK_MIXPANEL: process.env.MASK_MIXPANEL || JSON.stringify('disabled'),
MASK_SENTRY: process.env.MASK_SENTRY || 'disabled',
MASK_MIXPANEL: process.env.MASK_MIXPANEL || 'disabled',
NEXT_PUBLIC_FIREFLY_API_URL: process.env.NEXT_PUBLIC_FIREFLY_API_URL || '',
}),
new DefinePlugin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface OperationFooterProps {
chainId?: ChainId
canClaim: boolean
canRefund: boolean
canShare?: boolean
/** Is claiming or checking claim status */
isClaiming: boolean
isRefunding: boolean
Expand All @@ -40,6 +41,7 @@ export function OperationFooter({
chainId,
canClaim,
canRefund,
canShare = true,
isClaiming,
isRefunding,
onShare,
Expand Down Expand Up @@ -97,7 +99,7 @@ export function OperationFooter({
return (
<Box style={{ flex: 1, padding: 12 }}>
<Box className={classes.footer}>
{canRefund ? null : (
{canRefund || !canShare ? null : (
<ActionButton
fullWidth
variant="roundedDark"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export const RedPacket = memo(function RedPacket({ payload }: RedPacketProps) {
const [{ loading: isClaiming, value: claimTxHash }, claimCallback] = useClaimCallback(account, payload)
const site = usePostInfoDetails.site()
const source = usePostInfoDetails.source()
const platform = source?.toLowerCase() as 'lens' | 'farcaster'
const platform = source?.toLowerCase() as 'lens' | 'farcaster' | 'twitter'
const isOnFirefly = site === EnhanceableSite.Firefly
const postUrl = usePostInfoDetails.url()
const handle = usePostInfoDetails.handle()
Expand All @@ -201,7 +201,7 @@ export const RedPacket = memo(function RedPacket({ payload }: RedPacketProps) {
const getShareText = useCallback(
(hasClaimed: boolean) => {
if (isOnFirefly) {
const context = hasClaimed ? (`${platform}_claimed` as 'lens_claimed' | 'farcaster_claimed') : platform
const context = hasClaimed ? (`${platform}_claimed` as const) : platform
return t.share_on_firefly({
context,
sender: handle ?? '',
Expand Down Expand Up @@ -435,6 +435,7 @@ export const RedPacket = memo(function RedPacket({ payload }: RedPacketProps) {
chainId={payloadChainId}
canClaim={canClaim}
canRefund={canRefund}
canShare={platform !== 'twitter'}
isClaiming={isClaiming || checkingClaimStatus}
isRefunding={isRefunding}
onShare={handleShare}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useClaimStrategyStatus(payload: RedPacketJSONPayload | RedPacket
enabled: !signedMessage && !!platform,
queryKey: ['red-packet', 'claim-strategy', rpid, platform, account, me],
queryFn: async () => {
if (!platform) return null
if (!platform || !account) return null
return FireflyRedPacket.checkClaimStrategyStatus({
rpid,
profile: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function useSignedMessage(
} catch {}
if (version <= 3) return password
if (password) return signMessage(account, password).signature
if (!profile) return ''
if (!profile || !account) return ''
return FireflyRedPacket.createClaimSignature({
rpid,
profile,
Expand Down
2 changes: 2 additions & 0 deletions packages/plugins/RedPacket/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@
"share_on_firefly$default": "🤑 Check this Lucky Drop 🧧💰✨ sent by @{{- sender }} .\n\nGrow your followers and engagement with Lucky Drop on Firefly mobile app or http://firefly.mask.social !\n\nClaim on: {{- link }}",
"share_on_firefly$lens": "🤑 Check this Lucky Drop 🧧💰✨ sent by @{{- sender }} .\n\nGrow your followers and engagement with Lucky Drop on Firefly mobile app or http://firefly.mask.social !\n\nClaim on Lens: {{- link }}",
"share_on_firefly$farcaster": "🤑 Check this Lucky Drop 🧧💰✨ sent by @{{- sender }} .\n\nGrow your followers and engagement with Lucky Drop on Firefly mobile app or http://firefly.mask.social !\n\nClaim on Farcaster: {{- link }}",
"share_on_firefly$twitter": "🤑 Check this Lucky Drop 🧧💰✨ sent by @{{- sender }} .\n\nGrow your followers and engagement with Lucky Drop on Firefly mobile app or http://firefly.mask.social !\n\nClaim on Twitter: {{- link }}",
"share_on_firefly$lens_claimed": "🤑 Just claimed a #LuckyDrop 🧧💰✨ on https://firefly.mask.social from @{{- sender }} ! \n\nClaim on Lens: {{- link }}",
"share_on_firefly$farcaster_claimed": "🤑 Just claimed a #LuckyDrop 🧧💰✨ on https://firefly.mask.social from @{{- sender }} ! \n\nClaim on Farcaster: {{- link }}",
"share_on_firefly$twitter_claimed": "🤑 Just claimed a #LuckyDrop 🧧💰✨ on https://firefly.mask.social from @{{- sender }} ! \n\nClaim on Twitter: {{- link }}",
"no_claim_data": "No claims yet for this Lucky Drop",
"no_claim_history_data": "No Lucky Drops claimed",
"no_sent_history_data": "<div>No Lucky Drops created.</div> <div>Select 🎁 when you compose a post to start your first drop.<div>",
Expand Down
27 changes: 14 additions & 13 deletions packages/plugins/Trader/src/SiteAdaptor/trending/PriceChart.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useRef } from 'react'
import { useRef, useMemo } from 'react'
import { Stack, Typography } from '@mui/material'
import { LoadingBase, makeStyles } from '@masknet/theme'
import { openWindow } from '@masknet/shared-base-ui'
Expand Down Expand Up @@ -53,28 +53,29 @@ export function PriceChart(props: PriceChartProps) {
const { classes } = useStyles(props, { props })
const rootRef = useRef<HTMLDivElement>(null)
const svgRef = useRef<SVGSVGElement>(null)
const { stats, loading, currency, coin, children } = props

useDimension(svgRef, DEFAULT_DIMENSION)

usePriceLineChart(
svgRef,
props.stats.map(([date, price]) => ({
const data = useMemo(() => {
return stats.map(([date, price]) => ({
date: new Date(date),
value: price,
})),
DEFAULT_DIMENSION,
'x-trader-price-line-chart',
{ sign: props.currency.name ?? 'USD' },
)
}))
}, [stats])

usePriceLineChart(svgRef, data, DEFAULT_DIMENSION, 'x-trader-price-line-chart', {
sign: currency.name ?? 'USD',
})

return (
<div className={classes.root} ref={rootRef}>
{props.loading && props.stats.length ?
{loading && stats.length ?
<LoadingBase className={classes.progress} color="primary" size={15} />
: null}

<Stack gap={2}>
{props.stats.length ?
{stats.length ?
<svg
className={classes.svg}
ref={svgRef}
Expand All @@ -83,14 +84,14 @@ export function PriceChart(props: PriceChartProps) {
viewBox={`0 0 ${DEFAULT_DIMENSION.width} ${DEFAULT_DIMENSION.height}`}
preserveAspectRatio="xMidYMid meet"
onClick={() => {
props.stats.length && openWindow(props.coin?.platform_url)
stats.length && openWindow(coin?.platform_url)
}}
/>
: <Typography className={classes.placeholder} align="center" color="textSecondary">
{t.plugin_trader_no_data()}
</Typography>
}
{props.children}
{children}
</Stack>
</div>
)
Expand Down
7 changes: 6 additions & 1 deletion packages/shared-base/src/Pageable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export interface Pageable<Item, Indicator = unknown> {
nextIndicator?: Indicator
/** items data */
data: Item[]
/** items total */
total?: number
}

export interface PageIndicator {
Expand Down Expand Up @@ -51,21 +53,24 @@ export function createPageable<Item, Indicator = PageIndicator>(
data: Item[],
indicator: Indicator,
nextIndicator?: Indicator,
) {
total?: number,
): Pageable<Item, Indicator> {
// with next page
if (typeof nextIndicator !== 'undefined') {
return {
__type__: $Pageable,
data,
indicator,
nextIndicator,
total,
}
}
// without next page
return {
__type__: $Pageable,
data,
indicator,
total,
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/shared-base/src/Sniffings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ enum SiteHost {
Facebook = 'facebook.com',
}

const navigator_ = process.env.NODE_ENV === 'test' ? null : navigator
const location_ = process.env.NODE_ENV === 'test' ? null : location
const navigator_ = typeof navigator === 'undefined' ? null : navigator
const location_ = typeof location === 'undefined' ? null : location

const isChromium = navigator_?.userAgent.includes('Chrome') || navigator_?.userAgent.includes('Chromium')

Expand Down
7 changes: 3 additions & 4 deletions packages/shared/src/hooks/useLineChart/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { alpha, useTheme } from '@mui/material'
import * as d3 from 'd3'
import { format } from 'date-fns'
import { useEffect, type RefObject } from 'react'
import stringify from 'json-stable-stringify'
import type { Dimension } from '../useDimension.js'
import { format } from 'date-fns'
import { alpha, useTheme } from '@mui/material'
import { fixOverPosition } from './utils.js'

// TODO chart morph transform
Expand Down Expand Up @@ -244,5 +243,5 @@ export function useLineChart(
})

d3.select(svgRef.current).on('mouseleave', hide)
}, [svgRef.current, data.length, stringify(dimension), tickFormat, formatTooltip])
}, [svgRef.current, data, dimension, tickFormat, formatTooltip])
}
2 changes: 2 additions & 0 deletions packages/web3-providers/src/CoinGecko/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const COINGECKO_CHAIN_ID_LIST = [
ChainId.Cronos,
ChainId.BitTorrent,
ChainId.Boba,
ChainId.Metis,
ChainId.Scroll,
]

if (process.env.NODE_ENV === 'development') {
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/src/CoinGecko/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ChainId as ChainIdSolana } from '@masknet/web3-shared-solana'
export const resolveCoinGeckoChainId = createLookupTableResolver<string, Web3Helper.ChainIdAll | undefined>(
{
ethereum: ChainId.Mainnet,
'binance-smart-chain': ChainId.BSCT,
'binance-smart-chain': ChainId.BSC,
'polygon-pos': ChainId.Matic,
solana: ChainIdSolana.Mainnet,
astar: ChainId.Astar,
Expand Down
4 changes: 4 additions & 0 deletions packages/web3-providers/src/Firefly/RedPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
type PageIndicator,
getSiteType,
EnhanceableSite,
EMPTY_LIST,
} from '@masknet/shared-base'
import urlcat from 'urlcat'
import { fetchJSON } from '../entry-helpers.js'
Expand Down Expand Up @@ -179,6 +180,9 @@ export class FireflyRedPacket {
platform: FireflyRedPacketAPI.SourceType,
indicator?: PageIndicator,
): Promise<Pageable<R, PageIndicator>> {
if (!from) {
return createPageable(EMPTY_LIST, createIndicator(indicator))
}
const url = urlcat(FIREFLY_ROOT_URL, '/v1/redpacket/history', {
address: from,
redpacketType: actionType,
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/src/GoPlusLabs/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const SecurityMessages: SecurityMessage[] = [
level: SecurityMessageLevel.Safe,
condition: (info: SecurityAPI.TokenSecurityType) => info.transfer_pausable === '0',
titleKey: 'risk_no_code_transfer_pausable_title',
messageKey: 'risk_no_code_transfer_pausable_title',
messageKey: 'risk_no_code_transfer_pausable_body',
shouldHide: isUnset('transfer_pausable'),
},
{
Expand Down
72 changes: 70 additions & 2 deletions packages/web3-providers/src/SimpleHash/apis/EVM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,65 @@ class SimpleHashAPI_EVM implements NonFungibleTokenAPI.Provider<ChainId, SchemaT
return asset
}

async getOwnersByContract(
address: string,
{ chainId = ChainId.Mainnet, indicator, size = 20 }: BaseHubOptions<ChainId> = {},
) {
const chain = resolveChain(NetworkPluginID.PLUGIN_EVM, chainId)
const path = urlcat('/api/v0/nfts/owners/:chain/:contract_address', {
chain,
contract_address: address,
cursor: indicator?.id || undefined,
limit: size,
})
const response = await fetchFromSimpleHash<{ next_cursor: string; owners: SimpleHash.Owner[] }>(path)
return createPageable(
response.owners,
indicator,
response.next_cursor ? createNextIndicator(indicator, response.next_cursor) : undefined,
)
}

async getPoapEvent(eventId: number, { indicator, size = 20 }: Omit<BaseHubOptions<ChainId>, 'chainId'> = {}) {
const path = urlcat('/api/v0/nfts/poap_event/:event_id', {
cursor: indicator?.id || undefined,
limit: size,
event_id: eventId,
count: 1,
})
const response = await fetchFromSimpleHash<{ next_cursor: string; nfts: SimpleHash.Asset[]; count?: number }>(
path,
)
return createPageable(
response.nfts,
indicator,
response.next_cursor ? createNextIndicator(indicator, response.next_cursor) : undefined,
response.count,
)
}

async getTopCollectorsByContract(
address: string,
{ chainId = ChainId.Mainnet, indicator, size = 20 }: BaseHubOptions<ChainId> = {},
) {
const chain = resolveChain(NetworkPluginID.PLUGIN_EVM, chainId)
const path = urlcat('/api/v0/nfts/top_collectors/:chain/:contract_address', {
chain,
contract_address: address,
cursor: indicator?.id || undefined,
limit: size,
include_owner_image: '1',
})
const response = await fetchFromSimpleHash<{ next_cursor: string; top_collectors: SimpleHash.TopCollector[] }>(
path,
)
return createPageable(
response.top_collectors,
indicator,
response.next_cursor ? createNextIndicator(indicator, response.next_cursor) : undefined,
)
}

async getCollectionOverview(chainId: ChainId, id: string): Promise<NonFungibleCollectionOverview | undefined> {
// SimpleHash collection id is not address
if (isValidAddress(id)) return
Expand All @@ -120,15 +179,24 @@ class SimpleHashAPI_EVM implements NonFungibleTokenAPI.Provider<ChainId, SchemaT
}
}

async getAssets(account: string, { chainId = ChainId.Mainnet, indicator }: BaseHubOptions<ChainId> = {}) {
async getAssets(
account: string,
{
chainId = ChainId.Mainnet,
indicator,
contractAddress = '',
}: BaseHubOptions<ChainId> & {
contractAddress?: string
} = {},
) {
const chain = resolveChain(NetworkPluginID.PLUGIN_EVM, chainId)
if (!account || !isValidChainId(chainId) || !chain) {
return createPageable(EMPTY_LIST, createIndicator(indicator))
}
const path = urlcat('/api/v0/nfts/owners', {
chains: chain,
wallet_addresses: account,
contract_addresses: '',
contract_addresses: contractAddress,
cursor: typeof indicator?.index !== 'undefined' && indicator.index !== 0 ? indicator.id : undefined,
})

Expand Down
Loading