web3.js: Introduce support for log messages inside ConfirmedTransactionMeta. (#12629)
* feat: add logMessages to ConfirmedTranasactionMeta * feat: add flow type and additional superstruct validators
This commit is contained in:
		
							
								
								
									
										1
									
								
								web3.js/module.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								web3.js/module.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -141,6 +141,7 @@ declare module '@solana/web3.js' { | |||||||
|     fee: number; |     fee: number; | ||||||
|     preBalances: Array<number>; |     preBalances: Array<number>; | ||||||
|     postBalances: Array<number>; |     postBalances: Array<number>; | ||||||
|  |     logMessages?: Array<string>; | ||||||
|     err: TransactionError | null; |     err: TransactionError | null; | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -155,6 +155,7 @@ declare module '@solana/web3.js' { | |||||||
|     fee: number, |     fee: number, | ||||||
|     preBalances: Array<number>, |     preBalances: Array<number>, | ||||||
|     postBalances: Array<number>, |     postBalances: Array<number>, | ||||||
|  |     logMessages?: Array<string>, | ||||||
|     err: TransactionError | null, |     err: TransactionError | null, | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -374,12 +374,14 @@ const SimulatedTransactionResponseValidator = jsonRpcResultAndContext( | |||||||
|  * @property {number} fee The fee charged for processing the transaction |  * @property {number} fee The fee charged for processing the transaction | ||||||
|  * @property {Array<number>} preBalances The balances of the transaction accounts before processing |  * @property {Array<number>} preBalances The balances of the transaction accounts before processing | ||||||
|  * @property {Array<number>} postBalances The balances of the transaction accounts after processing |  * @property {Array<number>} postBalances The balances of the transaction accounts after processing | ||||||
|  |  * @property {Array<string>} logMessages An array of program log messages emitted during a transaction | ||||||
|  * @property {object|null} err The error result of transaction processing |  * @property {object|null} err The error result of transaction processing | ||||||
|  */ |  */ | ||||||
| type ConfirmedTransactionMeta = { | type ConfirmedTransactionMeta = { | ||||||
|   fee: number, |   fee: number, | ||||||
|   preBalances: Array<number>, |   preBalances: Array<number>, | ||||||
|   postBalances: Array<number>, |   postBalances: Array<number>, | ||||||
|  |   logMessages?: Array<string>, | ||||||
|   err: TransactionError | null, |   err: TransactionError | null, | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @@ -1107,6 +1109,7 @@ const ConfirmedTransactionMetaResult = struct.union([ | |||||||
|     fee: 'number', |     fee: 'number', | ||||||
|     preBalances: struct.array(['number']), |     preBalances: struct.array(['number']), | ||||||
|     postBalances: struct.array(['number']), |     postBalances: struct.array(['number']), | ||||||
|  |     logMessages: struct.union([struct.array(['string']), 'undefined']), | ||||||
|   }), |   }), | ||||||
| ]); | ]); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user