@solana/web3.js 2.0.0-experimental.8023370 → 2.0.0-experimental.803b2d8

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.
@@ -499,9 +499,20 @@ this.globalThis.solanaWeb3 = (function (exports) {
499
499
  return false;
500
500
  }
501
501
  var SolanaError = class extends Error {
502
- constructor(...[code, context]) {
502
+ constructor(...[code, contextAndErrorOptions]) {
503
+ let context;
504
+ let errorOptions;
505
+ if (contextAndErrorOptions) {
506
+ const { cause, ...contextRest } = contextAndErrorOptions;
507
+ if (cause) {
508
+ errorOptions = { cause };
509
+ }
510
+ if (Object.keys(contextRest).length > 0) {
511
+ context = contextRest;
512
+ }
513
+ }
503
514
  const message = getErrorMessage(code, context);
504
- super(message);
515
+ super(message, errorOptions);
505
516
  __publicField(this, "context");
506
517
  this.context = {
507
518
  __code: code,