-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rate_limiter
- Loading branch information
Showing
20 changed files
with
361 additions
and
14,972 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ package-lock.json | |
yarn.lock | ||
|
||
src/generated/* | ||
|
||
.vercel/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ CHANGELOG.md | |
pnpm-lock.yaml | ||
package-lock.json | ||
yarn.lock | ||
.vercel/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/bridge-ui/src/libs/nft/domain/interfaces/INFTRepository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { NFT } from '$nftAPI/domain/models/NFT'; | ||
import type { FetchNftArgs } from '$nftAPI/infrastructure/types/common'; | ||
|
||
export interface INFTRepository { | ||
findByAddress({ address, chainId, refresh }: FetchNftArgs): Promise<NFT[]>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Address } from 'viem'; | ||
|
||
import type { NFTMetadata, TokenType } from '$libs/token'; | ||
|
||
export interface NFT { | ||
type: TokenType; | ||
name: string; | ||
symbol: string; | ||
addresses: Record<string, Address>; | ||
owner: Address; | ||
imported?: boolean; | ||
mintable?: boolean; | ||
balance: string | number; | ||
tokenId: number | string; | ||
uri?: string; | ||
metadata?: NFTMetadata; | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/bridge-ui/src/libs/nft/domain/services/NFTService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Address } from 'viem'; | ||
|
||
import type { INFTRepository } from '../interfaces/INFTRepository'; | ||
import type { NFT } from '../models/NFT'; | ||
|
||
export class NFTService { | ||
constructor(private repository: INFTRepository) {} | ||
|
||
async fetchNFTsByAddress({ | ||
address, | ||
chainId, | ||
refresh, | ||
}: { | ||
address: Address; | ||
chainId: number; | ||
refresh: boolean; | ||
}): Promise<NFT[]> { | ||
return await this.repository.findByAddress({ address, chainId, refresh }); | ||
} | ||
} |
Oops, something went wrong.