@solana/web3.js 1.92.0 → 1.92.1
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.
- package/lib/index.browser.cjs.js +12 -15
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +12 -15
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +12 -15
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +3 -4
- package/lib/index.esm.js +12 -15
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +12 -15
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +12 -15
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +2 -2
- package/src/errors.ts +16 -16
package/lib/index.browser.esm.js
CHANGED
|
@@ -2126,15 +2126,15 @@ class SendTransactionError extends Error {
|
|
|
2126
2126
|
action,
|
|
2127
2127
|
signature,
|
|
2128
2128
|
transactionMessage,
|
|
2129
|
-
|
|
2129
|
+
logs: logs
|
|
2130
2130
|
}) {
|
|
2131
2131
|
let message;
|
|
2132
2132
|
switch (action) {
|
|
2133
2133
|
case 'send':
|
|
2134
|
-
message = `Transaction ${signature} resulted in an error. \n` + `${transactionMessage}. ` + (
|
|
2134
|
+
message = `Transaction ${signature} resulted in an error. \n` + `${transactionMessage}. ` + (logs ? `Logs: \n${JSON.stringify(logs.slice(-10), null, 2)}. ` : '') + '\nCatch the SendTransactionError and call `getLogs()` on it for full details.';
|
|
2135
2135
|
break;
|
|
2136
2136
|
case 'simulate':
|
|
2137
|
-
message = `Simulation failed. \nMessage: ${transactionMessage}. \n` + (
|
|
2137
|
+
message = `Simulation failed. \nMessage: ${transactionMessage}. \n` + (logs ? `Logs: \n${JSON.stringify(logs.slice(-10), null, 2)}. ` : '') + '\nCatch the SendTransactionError and call `getLogs()` on it for full details.';
|
|
2138
2138
|
break;
|
|
2139
2139
|
default:
|
|
2140
2140
|
message = 'Unknown action';
|
|
@@ -2142,27 +2142,24 @@ class SendTransactionError extends Error {
|
|
|
2142
2142
|
super(message);
|
|
2143
2143
|
this.signature = void 0;
|
|
2144
2144
|
this.transactionMessage = void 0;
|
|
2145
|
-
this.
|
|
2146
|
-
this.resolvedLogs = void 0;
|
|
2145
|
+
this.logs = void 0;
|
|
2147
2146
|
this.signature = signature;
|
|
2148
2147
|
this.transactionMessage = transactionMessage;
|
|
2149
|
-
this.
|
|
2150
|
-
this.resolvedLogs = transactionLogs ? transactionLogs : undefined;
|
|
2148
|
+
this.logs = logs ? logs : undefined;
|
|
2151
2149
|
}
|
|
2152
2150
|
get transactionError() {
|
|
2153
2151
|
return {
|
|
2154
2152
|
message: this.transactionMessage,
|
|
2155
|
-
logs: this.
|
|
2153
|
+
logs: Array.isArray(this.logs) ? this.logs : undefined
|
|
2156
2154
|
};
|
|
2157
2155
|
}
|
|
2158
2156
|
async getLogs(connection) {
|
|
2159
|
-
if (this.
|
|
2160
|
-
this.
|
|
2157
|
+
if (!Array.isArray(this.logs)) {
|
|
2158
|
+
this.logs = new Promise((resolve, reject) => {
|
|
2161
2159
|
connection.getTransaction(this.signature).then(tx => {
|
|
2162
2160
|
if (tx && tx.meta && tx.meta.logMessages) {
|
|
2163
2161
|
const logs = tx.meta.logMessages;
|
|
2164
|
-
this.
|
|
2165
|
-
this.transactionLogs = logs;
|
|
2162
|
+
this.logs = logs;
|
|
2166
2163
|
resolve(logs);
|
|
2167
2164
|
} else {
|
|
2168
2165
|
reject(new Error('Log messages not found'));
|
|
@@ -2170,7 +2167,7 @@ class SendTransactionError extends Error {
|
|
|
2170
2167
|
}).catch(reject);
|
|
2171
2168
|
});
|
|
2172
2169
|
}
|
|
2173
|
-
return await this.
|
|
2170
|
+
return await this.logs;
|
|
2174
2171
|
}
|
|
2175
2172
|
}
|
|
2176
2173
|
|
|
@@ -7273,7 +7270,7 @@ class Connection {
|
|
|
7273
7270
|
action: 'simulate',
|
|
7274
7271
|
signature: '',
|
|
7275
7272
|
transactionMessage: res.error.message,
|
|
7276
|
-
|
|
7273
|
+
logs: logs
|
|
7277
7274
|
});
|
|
7278
7275
|
}
|
|
7279
7276
|
return res.result;
|
|
@@ -7383,7 +7380,7 @@ class Connection {
|
|
|
7383
7380
|
action: skipPreflight ? 'send' : 'simulate',
|
|
7384
7381
|
signature: '',
|
|
7385
7382
|
transactionMessage: res.error.message,
|
|
7386
|
-
|
|
7383
|
+
logs: logs
|
|
7387
7384
|
});
|
|
7388
7385
|
}
|
|
7389
7386
|
return res.result;
|