@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.iife.js
CHANGED
|
@@ -13357,15 +13357,15 @@ var solanaWeb3 = (function (exports) {
|
|
|
13357
13357
|
action,
|
|
13358
13358
|
signature,
|
|
13359
13359
|
transactionMessage,
|
|
13360
|
-
|
|
13360
|
+
logs: logs
|
|
13361
13361
|
}) {
|
|
13362
13362
|
let message;
|
|
13363
13363
|
switch (action) {
|
|
13364
13364
|
case 'send':
|
|
13365
|
-
message = `Transaction ${signature} resulted in an error. \n` + `${transactionMessage}. ` + (
|
|
13365
|
+
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.';
|
|
13366
13366
|
break;
|
|
13367
13367
|
case 'simulate':
|
|
13368
|
-
message = `Simulation failed. \nMessage: ${transactionMessage}. \n` + (
|
|
13368
|
+
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.';
|
|
13369
13369
|
break;
|
|
13370
13370
|
default:
|
|
13371
13371
|
message = 'Unknown action';
|
|
@@ -13373,27 +13373,24 @@ var solanaWeb3 = (function (exports) {
|
|
|
13373
13373
|
super(message);
|
|
13374
13374
|
this.signature = void 0;
|
|
13375
13375
|
this.transactionMessage = void 0;
|
|
13376
|
-
this.
|
|
13377
|
-
this.resolvedLogs = void 0;
|
|
13376
|
+
this.logs = void 0;
|
|
13378
13377
|
this.signature = signature;
|
|
13379
13378
|
this.transactionMessage = transactionMessage;
|
|
13380
|
-
this.
|
|
13381
|
-
this.resolvedLogs = transactionLogs ? transactionLogs : undefined;
|
|
13379
|
+
this.logs = logs ? logs : undefined;
|
|
13382
13380
|
}
|
|
13383
13381
|
get transactionError() {
|
|
13384
13382
|
return {
|
|
13385
13383
|
message: this.transactionMessage,
|
|
13386
|
-
logs: this.
|
|
13384
|
+
logs: Array.isArray(this.logs) ? this.logs : undefined
|
|
13387
13385
|
};
|
|
13388
13386
|
}
|
|
13389
13387
|
async getLogs(connection) {
|
|
13390
|
-
if (this.
|
|
13391
|
-
this.
|
|
13388
|
+
if (!Array.isArray(this.logs)) {
|
|
13389
|
+
this.logs = new Promise((resolve, reject) => {
|
|
13392
13390
|
connection.getTransaction(this.signature).then(tx => {
|
|
13393
13391
|
if (tx && tx.meta && tx.meta.logMessages) {
|
|
13394
13392
|
const logs = tx.meta.logMessages;
|
|
13395
|
-
this.
|
|
13396
|
-
this.transactionLogs = logs;
|
|
13393
|
+
this.logs = logs;
|
|
13397
13394
|
resolve(logs);
|
|
13398
13395
|
} else {
|
|
13399
13396
|
reject(new Error('Log messages not found'));
|
|
@@ -13401,7 +13398,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
13401
13398
|
}).catch(reject);
|
|
13402
13399
|
});
|
|
13403
13400
|
}
|
|
13404
|
-
return await this.
|
|
13401
|
+
return await this.logs;
|
|
13405
13402
|
}
|
|
13406
13403
|
}
|
|
13407
13404
|
|
|
@@ -20698,7 +20695,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20698
20695
|
action: 'simulate',
|
|
20699
20696
|
signature: '',
|
|
20700
20697
|
transactionMessage: res.error.message,
|
|
20701
|
-
|
|
20698
|
+
logs: logs
|
|
20702
20699
|
});
|
|
20703
20700
|
}
|
|
20704
20701
|
return res.result;
|
|
@@ -20808,7 +20805,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20808
20805
|
action: skipPreflight ? 'send' : 'simulate',
|
|
20809
20806
|
signature: '',
|
|
20810
20807
|
transactionMessage: res.error.message,
|
|
20811
|
-
|
|
20808
|
+
logs: logs
|
|
20812
20809
|
});
|
|
20813
20810
|
}
|
|
20814
20811
|
return res.result;
|