@portal-hq/web 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,171 @@
1
+ /**
2
+ * API response types shared between browser and iframe packages
3
+ */
4
+
5
+ import type { FeatureFlags, GDriveConfig, PasskeyConfig } from './common'
6
+
7
+ // Asset response types
8
+ export interface GetAssetsResponse {
9
+ nativeBalance: {
10
+ balance: string
11
+ decimals: number
12
+ name: string
13
+ rawBalance: string
14
+ symbol: string
15
+ metadata: Record<string, any>
16
+ }
17
+ tokenBalances: {
18
+ balance: string
19
+ decimals: number
20
+ name: string
21
+ rawBalance: string
22
+ symbol: string
23
+ metadata: Record<string, any>
24
+ }[]
25
+ nfts?: NFTAsset[]
26
+ }
27
+
28
+ export interface NFTAsset {
29
+ nftId: string
30
+ name: string
31
+ description: string
32
+ imageUrl: string
33
+ chain: string
34
+ contractAddress: string
35
+ tokenId: string
36
+ collection: {
37
+ name: string
38
+ description: string | null
39
+ imageUrl: string
40
+ }
41
+ lastSale: {
42
+ price: number
43
+ currency: string
44
+ date: string
45
+ } | null
46
+ rarity: {
47
+ rank: number | null
48
+ score: number | null
49
+ }
50
+ floorPrice: {
51
+ price: number
52
+ currency: string
53
+ } | null
54
+ detailedInfo: {
55
+ ownerCount: number
56
+ tokenCount: number
57
+ createdDate: string | null
58
+ attributes: Attribute[]
59
+ owners: Owner[]
60
+ extendedCollectionInfo: ExtendedCollectionInfo
61
+ extendedSaleInfo: ExtendedSaleInfo | null
62
+ marketplaceInfo: MarketplaceInfo[]
63
+ mediaInfo: MediaInfo
64
+ }
65
+ }
66
+
67
+ interface Attribute {
68
+ traitType: string
69
+ value: string | number
70
+ displayType: string | null
71
+ }
72
+
73
+ interface Owner {
74
+ ownerAddress: string
75
+ quantity: number
76
+ firstAcquiredDate: string
77
+ lastAcquiredDate: string
78
+ }
79
+
80
+ interface ExtendedCollectionInfo {
81
+ bannerImageUrl: string | null
82
+ externalUrl: string | null
83
+ twitterUsername: string | null
84
+ discordUrl: string | null
85
+ instagramUsername: string | null
86
+ mediumUsername: string | null
87
+ telegramUrl: string | null
88
+ distinctOwnerCount: number
89
+ distinctNftCount: number
90
+ totalQuantity: number
91
+ }
92
+
93
+ interface ExtendedSaleInfo {
94
+ fromAddress: string
95
+ toAddress: string
96
+ priceUsdCents: number
97
+ transaction: string
98
+ marketplaceId: string
99
+ marketplaceName: string
100
+ }
101
+
102
+ interface MarketplaceInfo {
103
+ marketplaceId: string
104
+ marketplaceName: string
105
+ marketplaceCollectionId: string
106
+ nftUrl: string
107
+ collectionUrl: string
108
+ verified: boolean | null
109
+ floorPrice: {
110
+ value: number
111
+ paymentToken: {
112
+ paymentTokenId: string
113
+ name: string
114
+ symbol: string
115
+ address: string | null
116
+ decimals: number
117
+ }
118
+ valueUsdCents: number | null
119
+ } | null
120
+ }
121
+
122
+ interface MediaInfo {
123
+ previews: {
124
+ imageSmallUrl: string
125
+ imageMediumUrl: string
126
+ imageLargeUrl: string
127
+ imageOpengraphUrl: string
128
+ blurhash: string
129
+ predominantColor: string
130
+ }
131
+ animationUrl: string | null
132
+ backgroundColor: string | null
133
+ }
134
+
135
+ // Iframe configuration types
136
+ export interface IframeConfigurationOptions {
137
+ autoApprove: boolean
138
+ featureFlags?: FeatureFlags
139
+ gdrive?: GDriveConfig
140
+ passkey?: PasskeyConfig
141
+ host: string
142
+ mpcHost: string
143
+ mpcVersion: string
144
+
145
+ // One of these three is required for authentication
146
+ apiKey?: string
147
+ authToken?: string
148
+ authUrl?: string
149
+ }
150
+
151
+ // Storage types
152
+ export interface StorageHashes {
153
+ android: string
154
+ default: string
155
+ ios: string
156
+ react_native: string
157
+ web_sdk: string
158
+ }
159
+
160
+ // Swaps types
161
+ export interface SwapsRequest {
162
+ apiKey?: string
163
+ chainId: string
164
+ }
165
+
166
+ export type SourcesRequest = SwapsRequest
167
+
168
+ // Portal API error
169
+ export interface PortalApiErrorBody {
170
+ error: string
171
+ }