@deserialize/multi-vm-wallet 1.2.2 → 1.2.4

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.
Files changed (42) hide show
  1. package/dist/IChainWallet.d.ts +6 -1
  2. package/dist/IChainWallet.js.map +1 -1
  3. package/dist/constant.js +32 -18
  4. package/dist/constant.js.map +1 -1
  5. package/dist/evm/evm.d.ts +5 -1
  6. package/dist/evm/evm.js +11 -2
  7. package/dist/evm/evm.js.map +1 -1
  8. package/dist/evm/transaction.utils.d.ts +362 -0
  9. package/dist/evm/transaction.utils.js +669 -0
  10. package/dist/evm/transaction.utils.js.map +1 -0
  11. package/dist/evm/transactionParsing.d.ts +1 -3633
  12. package/dist/evm/transactionParsing.js +0 -27
  13. package/dist/evm/transactionParsing.js.map +1 -1
  14. package/dist/evm/utils.d.ts +13 -1
  15. package/dist/evm/utils.js +101 -2
  16. package/dist/evm/utils.js.map +1 -1
  17. package/dist/helpers/index.d.ts +2 -1
  18. package/dist/helpers/index.js +5 -0
  19. package/dist/helpers/index.js.map +1 -1
  20. package/dist/svm/svm.d.ts +14 -4
  21. package/dist/svm/svm.js +25 -7
  22. package/dist/svm/svm.js.map +1 -1
  23. package/dist/svm/utils.d.ts +9 -3
  24. package/dist/svm/utils.js +94 -12
  25. package/dist/svm/utils.js.map +1 -1
  26. package/dist/test.d.ts +4 -0
  27. package/dist/test.js +38 -18
  28. package/dist/test.js.map +1 -1
  29. package/dist/types.d.ts +110 -0
  30. package/dist/types.js.map +1 -1
  31. package/package.json +5 -2
  32. package/utils/IChainWallet.ts +6 -3
  33. package/utils/constant.ts +34 -18
  34. package/utils/evm/evm.ts +17 -4
  35. package/utils/evm/transaction.utils.ts +824 -0
  36. package/utils/evm/transactionParsing.ts +0 -26
  37. package/utils/evm/utils.ts +110 -3
  38. package/utils/helpers/index.ts +7 -1
  39. package/utils/svm/svm.ts +40 -9
  40. package/utils/svm/utils.ts +131 -16
  41. package/utils/test.ts +48 -18
  42. package/utils/types.ts +140 -0
package/utils/types.ts CHANGED
@@ -39,6 +39,146 @@ export interface NFTInfo {
39
39
  image?: string;
40
40
  }
41
41
 
42
+ // Unified NFT interface for both EVM and SVM chains
43
+ export interface NFT {
44
+ // Unique identifier
45
+ id: string; // For Solana: mint address, For EVM: contractAddress:tokenId
46
+
47
+ // Basic metadata
48
+ name: string;
49
+ symbol?: string;
50
+ description: string;
51
+ image?: string;
52
+ uri: string; // Metadata URI
53
+
54
+ // Collection/Contract info
55
+ collection: {
56
+ address: string;
57
+ name: string;
58
+ verified?: boolean;
59
+ };
60
+
61
+ // Chain-specific data
62
+ chainType: 'SVM' | 'EVM';
63
+
64
+ // Ownership
65
+ balance?: string; // Quantity owned (useful for ERC1155)
66
+
67
+ // Optional metadata
68
+ attributes?: Array<{
69
+ trait_type: string;
70
+ value: string | number;
71
+ display_type?: string;
72
+ }>;
73
+
74
+ // Creators/Royalties (mainly for Solana)
75
+ creators?: Array<{
76
+ address: string;
77
+ verified: boolean;
78
+ share: number;
79
+ }>;
80
+
81
+ // Additional metadata
82
+ sellerFeeBasisPoints?: number; // Royalty percentage
83
+ tokenStandard?: string; // e.g., "ERC721", "ERC1155", "NonFungible", etc.
84
+
85
+ // Spam detection (mainly for EVM)
86
+ isSpam?: boolean;
87
+
88
+ // Raw chain-specific data for advanced use cases
89
+ raw?: {
90
+ svm?: SolanaNFT;
91
+ evm?: EVMNFT;
92
+ };
93
+ }
94
+
95
+ export interface SolanaNFT {
96
+ mint: string;
97
+ name: string;
98
+ symbol: string;
99
+ uri: string;
100
+ updateAuthority: string;
101
+ sellerFeeBasisPoints: number;
102
+ creators?: Array<{
103
+ address: string;
104
+ verified: boolean;
105
+ share: number;
106
+ }>;
107
+ }
108
+
109
+ export interface EVMNFTContract {
110
+ address: string;
111
+ name: string;
112
+ symbol: string;
113
+ totalSupply: string;
114
+ tokenType: string;
115
+ contractDeployer: string;
116
+ deployedBlockNumber: number;
117
+ isSpam: boolean;
118
+ spamClassifications?: string[];
119
+ }
120
+
121
+ export interface EVMNFTOpenSeaMetadata {
122
+ collectionName: string;
123
+ collectionSlug: string;
124
+ floorPrice?: number;
125
+ safelistRequestStatus: string;
126
+ imageUrl?: string;
127
+ lastIngestedAt: string;
128
+ }
129
+
130
+ export interface EVMNFTImage {
131
+ cachedUrl?: string;
132
+ thumbnailUrl?: string;
133
+ pngUrl?: string;
134
+ contentType?: string;
135
+ size?: number;
136
+ originalUrl?: string;
137
+ }
138
+
139
+ export interface EVMNFTAttribute {
140
+ trait_type: string;
141
+ value: string | number;
142
+ display_type?: string;
143
+ }
144
+
145
+ export interface EVMNFTRawMetadata {
146
+ tokenUri?: string;
147
+ metadata?: {
148
+ name?: string;
149
+ description?: string;
150
+ image?: string;
151
+ attributes?: EVMNFTAttribute[];
152
+ [key: string]: any;
153
+ };
154
+ }
155
+
156
+ export interface EVMNFTMint {
157
+ mintAddress?: string;
158
+ blockNumber?: number;
159
+ timestamp?: string;
160
+ transactionHash?: string;
161
+ }
162
+
163
+ export interface EVMNFT {
164
+ contract: EVMNFTContract;
165
+ openSeaMetadata?: EVMNFTOpenSeaMetadata;
166
+ tokenId: string;
167
+ tokenType: string;
168
+ name: string;
169
+ description: string;
170
+ balance: string;
171
+ image?: EVMNFTImage;
172
+ raw?: EVMNFTRawMetadata;
173
+ mint?: EVMNFTMint;
174
+ timeLastUpdated: string;
175
+ acquiredAt?: string;
176
+ }
177
+
178
+ export interface EVMNFTResponse {
179
+ data: EVMNFT[];
180
+ }
181
+
42
182
  export interface TransactionResult {
43
183
  hash: string;
44
184
  success: boolean;