@stellar/typescript-wallet-sdk 5.1.0 → 6.0.0-beta.1793996806758

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.
@@ -2246,7 +2246,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2246
2246
  };
2247
2247
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2248
2248
  exports.DefaultSignerDomainAccountError = exports.SigningKeypairMissingSecretError = exports.InvalidJsonError = exports.UnknownAnchorTransactionError = exports.AllowHttpOnNonTestnetError = exports.ChallengeTxnClientAccountMismatchError = exports.ChallengeTxnInvalidSignatureError = exports.ChallengeTxnIncorrectSequenceError = exports.NetworkPassphraseMismatchError = exports.ChallengeValidationFailedError = exports.MissingSigningKeyError = exports.Sep38PriceOnlyOneAmountError = exports.NoAccountAndNoSponsorError = exports.SignerKeyEqualsMasterKeyError = exports.DuplicateAccountSignerError = exports.RecoverySignerEqualsDeviceKeyError = exports.DuplicateRecoverySignerError = exports.DeviceKeyEqualsMasterKeyError = exports.NoAccountSignersError = exports.UnableToDeduceKeyError = exports.NoDeviceKeyForAccountError = exports.LostSignerKeyNotFound = exports.NotAllSignaturesFetchedError = exports.RecoveryIdentityNotFoundError = exports.RecoveryServerNotFoundError = exports.KYCServerNotFoundError = exports.CustomerNotFoundError = exports.Sep9InfoRequiredError = exports.WithdrawalTxMemoError = exports.PathPayBoundRequiredError = exports.PathPayOnlyOneAmountError = exports.WithdrawalTxMissingMemoError = exports.WithdrawalTxMissingDestinationError = exports.WithdrawalTxNotPendingUserTransferStartError = exports.OperationsLimitExceededError = exports.SignerRequiredError = exports.TransactionSubmitWithFeeIncreaseFailedError = exports.ExpiredTokenError = exports.InvalidTokenError = exports.MissingTokenError = exports.InsufficientStartingBalanceError = exports.TransactionSubmitFailedError = exports.AccountDoesNotExistError = exports.InvalidTransactionsResponseError = exports.InvalidTransactionResponseError = exports.MissingTransactionIdError = exports.ClientDomainWithMemoError = exports.InvalidMemoError = exports.AssetNotSupportedError = exports.ServerRequestFailedError = void 0;
2249
- exports.Sep7UriTypeNotSupportedError = exports.Sep7LongMsgError = exports.Sep7InvalidUriError = exports.AuthHeaderClientDomainRequiredError = exports.AuthHeaderSigningKeypairRequiredError = exports.DomainSigningModifiedError = void 0;
2249
+ exports.Sep7UriTypeNotSupportedError = exports.Sep7ContractMemoError = exports.Sep7LongMsgError = exports.Sep7InvalidUriError = exports.AuthHeaderClientDomainRequiredError = exports.AuthHeaderSigningKeypairRequiredError = exports.DomainSigningModifiedError = void 0;
2250
2250
  var axios_1 = __importDefault(__webpack_require__(/*! axios */ "../../node_modules/axios/dist/browser/axios.cjs"));
2251
2251
  var Utils_1 = __webpack_require__(/*! ../Utils */ "./src/walletSdk/Utils/index.ts");
2252
2252
  var ServerRequestFailedError = /** @class */ (function (_super) {
@@ -2832,6 +2832,16 @@ var Sep7LongMsgError = /** @class */ (function (_super) {
2832
2832
  return Sep7LongMsgError;
2833
2833
  }(Error));
2834
2834
  exports.Sep7LongMsgError = Sep7LongMsgError;
2835
+ var Sep7ContractMemoError = /** @class */ (function (_super) {
2836
+ __extends(Sep7ContractMemoError, _super);
2837
+ function Sep7ContractMemoError() {
2838
+ var _this = _super.call(this, "the 'memo' parameter is not supported for a contract ('C') or muxed contract ('W') 'destination'") || this;
2839
+ Object.setPrototypeOf(_this, Sep7ContractMemoError.prototype);
2840
+ return _this;
2841
+ }
2842
+ return Sep7ContractMemoError;
2843
+ }(Error));
2844
+ exports.Sep7ContractMemoError = Sep7ContractMemoError;
2835
2845
  var Sep7UriTypeNotSupportedError = /** @class */ (function (_super) {
2836
2846
  __extends(Sep7UriTypeNotSupportedError, _super);
2837
2847
  function Sep7UriTypeNotSupportedError(type) {
@@ -5554,8 +5564,28 @@ var __extends = (this && this.__extends) || (function () {
5554
5564
  })();
5555
5565
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5556
5566
  exports.Sep7Pay = void 0;
5567
+ var stellar_sdk_1 = __webpack_require__(/*! @stellar/stellar-sdk */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/index.js");
5557
5568
  var Uri_1 = __webpack_require__(/*! ../Uri */ "./src/walletSdk/Uri/index.ts");
5558
5569
  var Types_1 = __webpack_require__(/*! ../Types */ "./src/walletSdk/Types/index.ts");
5570
+ var Exceptions_1 = __webpack_require__(/*! ../Exceptions */ "./src/walletSdk/Exceptions/index.ts");
5571
+ /**
5572
+ * Throws if a uri would have a memo with a contract ("C...") or muxed
5573
+ * contract ("W...") destination, which 'parseSep7Uri' rejects. Paying either
5574
+ * takes a Soroban transaction, which can't have a memo.
5575
+ *
5576
+ * @param {string | undefined} destination the uri 'destination' param.
5577
+ * @param {string | undefined} memo the uri 'memo' param.
5578
+ * @throws {Sep7ContractMemoError} if both are set and 'destination' is a
5579
+ * contract or muxed contract address.
5580
+ */
5581
+ var assertNoContractMemo = function (destination, memo) {
5582
+ if (memo &&
5583
+ destination &&
5584
+ (stellar_sdk_1.StrKey.isValidContract(destination) ||
5585
+ stellar_sdk_1.StrKey.isValidMuxedContract(destination))) {
5586
+ throw new Exceptions_1.Sep7ContractMemoError();
5587
+ }
5588
+ };
5559
5589
  /**
5560
5590
  * The Sep-7 'pay' operation represents a request to pay a specific address
5561
5591
  * with a specific asset, regardless of the source asset used by the payer.
@@ -5569,9 +5599,13 @@ var Sep7Pay = /** @class */ (function (_super) {
5569
5599
  *
5570
5600
  * @constructor
5571
5601
  * @param {URL | string} [uri] - uri to initialize the Sep7 instance.
5602
+ * @throws {Sep7ContractMemoError} if 'uri' has a memo and a contract ("C...")
5603
+ * or muxed contract ("W...") destination.
5572
5604
  */
5573
5605
  function Sep7Pay(uri) {
5574
- return _super.call(this, uri !== null && uri !== void 0 ? uri : new URL("".concat(Types_1.WEB_STELLAR_SCHEME).concat(Types_1.Sep7OperationType.pay))) || this;
5606
+ var _this = _super.call(this, uri !== null && uri !== void 0 ? uri : new URL("".concat(Types_1.WEB_STELLAR_SCHEME).concat(Types_1.Sep7OperationType.pay))) || this;
5607
+ assertNoContractMemo(_this.destination, _this.memo);
5608
+ return _this;
5575
5609
  }
5576
5610
  /**
5577
5611
  * Creates a Sep7Pay instance with given destination.
@@ -5598,6 +5632,10 @@ var Sep7Pay = /** @class */ (function (_super) {
5598
5632
  * Gets the destination of the payment request, which should be a valid
5599
5633
  * Stellar address.
5600
5634
  *
5635
+ * A contract ("C...") or muxed contract ("W...") destination can only be
5636
+ * paid with a Stellar Asset Contract transfer, not a classic payment, and a
5637
+ * uri with one can't have a memo.
5638
+ *
5601
5639
  * @returns {string | undefined} the 'destination' uri param if present.
5602
5640
  */
5603
5641
  get: function () {
@@ -5610,8 +5648,11 @@ var Sep7Pay = /** @class */ (function (_super) {
5610
5648
  * Deletes the uri 'destination' param if set as 'undefined'.
5611
5649
  *
5612
5650
  * @param {string | undefined} destination the uri 'destination' param to be set.
5651
+ * @throws {Sep7ContractMemoError} if 'destination' is a contract ("C...") or
5652
+ * muxed contract ("W...") address and the uri has a memo.
5613
5653
  */
5614
5654
  set: function (destination) {
5655
+ assertNoContractMemo(destination, this.memo);
5615
5656
  this.setParam("destination", destination);
5616
5657
  },
5617
5658
  enumerable: false,
@@ -5702,8 +5743,11 @@ var Sep7Pay = /** @class */ (function (_super) {
5702
5743
  * Deletes the uri 'memo' param if set as 'undefined'.
5703
5744
  *
5704
5745
  * @param {string | undefined} memo the uri 'memo' param to be set.
5746
+ * @throws {Sep7ContractMemoError} if 'memo' is set and the uri's destination
5747
+ * is a contract ("C...") or muxed contract ("W...") address.
5705
5748
  */
5706
5749
  set: function (memo) {
5750
+ assertNoContractMemo(this.destination, memo);
5707
5751
  this.setParam("memo", memo);
5708
5752
  },
5709
5753
  enumerable: false,
@@ -6048,16 +6092,28 @@ var isValidSep7Uri = function (uri) {
6048
6092
  };
6049
6093
  }
6050
6094
  if (type === Types_1.Sep7OperationType.pay && destination) {
6051
- // Checks if it's a valid "G", "M" or "C" Stellar address
6095
+ var isContract = stellar_sdk_1.StrKey.isValidContract(destination) ||
6096
+ stellar_sdk_1.StrKey.isValidMuxedContract(destination);
6097
+ // Checks if it's a valid "G", "M", "C" or "W" Stellar address
6052
6098
  var isValidStellarAddress = stellar_sdk_1.StrKey.isValidEd25519PublicKey(destination) ||
6053
6099
  stellar_sdk_1.StrKey.isValidMed25519PublicKey(destination) ||
6054
- stellar_sdk_1.StrKey.isValidContract(destination);
6100
+ isContract;
6055
6101
  if (!isValidStellarAddress) {
6056
6102
  return {
6057
6103
  result: false,
6058
6104
  reason: "the provided 'destination' parameter is not a valid Stellar address",
6059
6105
  };
6060
6106
  }
6107
+ // A "C" (contract) or "W" (muxed contract) address can only be paid with
6108
+ // a Stellar Asset Contract transfer. That's a Soroban transaction, which
6109
+ // can't have a memo, so a wallet could only drop it. A "W" address's mux
6110
+ // ID already identifies the payee.
6111
+ if (isContract && url.searchParams.get("memo")) {
6112
+ return {
6113
+ result: false,
6114
+ reason: "the 'memo' parameter is not supported for a contract ('C') or muxed contract ('W') 'destination'",
6115
+ };
6116
+ }
6061
6117
  }
6062
6118
  if ((msg === null || msg === void 0 ? void 0 : msg.length) > Types_1.URI_MSG_MAX_LENGTH) {
6063
6119
  return {
@@ -60629,9 +60685,10 @@ var claimableBalanceIdType = __webpack_require__(/*! ../xdr/generated/claimable-
60629
60685
  var muxedEd25519Account = __webpack_require__(/*! ../xdr/generated/muxed-ed25519-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-ed25519-account.js");
60630
60686
  var scVal = __webpack_require__(/*! ../xdr/generated/sc-val.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val.js");
60631
60687
  var scAddress = __webpack_require__(/*! ../xdr/generated/sc-address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-address.js");
60688
+ var muxedContract = __webpack_require__(/*! ../xdr/generated/muxed-contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-contract.js");
60689
+ var contractId = __webpack_require__(/*! ../xdr/generated/contract-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/contract-id.js");
60632
60690
  var claimableBalanceId = __webpack_require__(/*! ../xdr/generated/claimable-balance-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/claimable-balance-id.js");
60633
60691
  var hash = __webpack_require__(/*! ../xdr/generated/hash.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/hash.js");
60634
- var contractId = __webpack_require__(/*! ../xdr/generated/contract-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/contract-id.js");
60635
60692
  var poolId = __webpack_require__(/*! ../xdr/generated/pool-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/pool-id.js");
60636
60693
  var publicKey = __webpack_require__(/*! ../xdr/generated/public-key.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/public-key.js");
60637
60694
 
@@ -60651,6 +60708,9 @@ class Address {
60651
60708
  } else if (strkey.StrKey.isValidMed25519PublicKey(address)) {
60652
60709
  this._type = "muxedAccount";
60653
60710
  this._key = strkey.StrKey.decodeMed25519PublicKey(address);
60711
+ } else if (strkey.StrKey.isValidMuxedContract(address)) {
60712
+ this._type = "muxedContract";
60713
+ this._key = strkey.StrKey.decodeMuxedContract(address);
60654
60714
  } else if (strkey.StrKey.isValidClaimableBalance(address)) {
60655
60715
  this._type = "claimableBalance";
60656
60716
  this._key = strkey.StrKey.decodeClaimableBalance(address);
@@ -60709,6 +60769,15 @@ class Address {
60709
60769
  static muxedAccount(buffer) {
60710
60770
  return new Address(strkey.StrKey.encodeMed25519PublicKey(buffer));
60711
60771
  }
60772
+ /**
60773
+ * Creates a new muxed contract Address object from raw bytes: the 32-byte
60774
+ * contract ID followed by the 8-byte big-endian mux ID.
60775
+ *
60776
+ * @param buffer - The bytes of an address to parse.
60777
+ */
60778
+ static muxedContract(buffer) {
60779
+ return new Address(strkey.StrKey.encodeMuxedContract(buffer));
60780
+ }
60712
60781
  /**
60713
60782
  * Convert this from an xdr.ScVal type.
60714
60783
  *
@@ -60752,6 +60821,12 @@ class Address {
60752
60821
  }
60753
60822
  case "scAddressTypeLiquidityPool":
60754
60823
  return Address.liquidityPool(scAddress.value.toBytes());
60824
+ case "scAddressTypeMuxedContract": {
60825
+ const muxed = scAddress.value;
60826
+ return Address.muxedContract(
60827
+ strkey.packMuxedContract(muxed.contractId.value, muxed.id)
60828
+ );
60829
+ }
60755
60830
  default:
60756
60831
  throw new Error("Unsupported address type");
60757
60832
  }
@@ -60771,6 +60846,8 @@ class Address {
60771
60846
  return strkey.StrKey.encodeLiquidityPool(this._key);
60772
60847
  case "muxedAccount":
60773
60848
  return strkey.StrKey.encodeMed25519PublicKey(this._key);
60849
+ case "muxedContract":
60850
+ return strkey.StrKey.encodeMuxedContract(this._key);
60774
60851
  default:
60775
60852
  throw new Error("Unsupported address type");
60776
60853
  }
@@ -60805,6 +60882,12 @@ class Address {
60805
60882
  id: index.Uint64.fromXdr(this._key.subarray(32, 40), "raw")
60806
60883
  })
60807
60884
  );
60885
+ case "muxedContract": {
60886
+ const { contractId: contractId$1, id } = strkey.unpackMuxedContract(this._key);
60887
+ return scAddress.ScAddress.scAddressTypeMuxedContract(
60888
+ new muxedContract.MuxedContract({ id, contractId: new contractId.ContractId(contractId$1) })
60889
+ );
60890
+ }
60808
60891
  default:
60809
60892
  throw new Error("Unsupported address type");
60810
60893
  }
@@ -60822,8 +60905,15 @@ class Address {
60822
60905
  return this._type;
60823
60906
  }
60824
60907
  }
60908
+ function assertNotMuxed(address, reason) {
60909
+ const muxed = typeof address === "string" ? strkey.StrKey.isValidMed25519PublicKey(address) || strkey.StrKey.isValidMuxedContract(address) : address.type === "muxedAccount" || address.type === "muxedContract";
60910
+ if (muxed) {
60911
+ throw new TypeError(`muxed address ${address.toString()} ${reason}`);
60912
+ }
60913
+ }
60825
60914
 
60826
60915
  exports.Address = Address;
60916
+ exports.assertNotMuxed = assertNotMuxed;
60827
60917
  //# sourceMappingURL=address.js.map
60828
60918
 
60829
60919
 
@@ -60844,6 +60934,7 @@ __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-
60844
60934
  var keypair = __webpack_require__(/*! ./keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
60845
60935
  var strkey = __webpack_require__(/*! ./strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
60846
60936
  var hashing = __webpack_require__(/*! ./hashing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/hashing.js");
60937
+ var assetType = __webpack_require__(/*! ../xdr/generated/asset-type.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/asset-type.js");
60847
60938
  var asset = __webpack_require__(/*! ../xdr/generated/asset.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/asset.js");
60848
60939
  var changeTrustAsset = __webpack_require__(/*! ../xdr/generated/change-trust-asset.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/change-trust-asset.js");
60849
60940
  var trustLineAsset = __webpack_require__(/*! ../xdr/generated/trust-line-asset.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/trust-line-asset.js");
@@ -60852,7 +60943,6 @@ var hashIdPreimageContractId = __webpack_require__(/*! ../xdr/generated/hash-id-
60852
60943
  var contractIdPreimage = __webpack_require__(/*! ../xdr/generated/contract-id-preimage.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/contract-id-preimage.js");
60853
60944
  var alphaNum4 = __webpack_require__(/*! ../xdr/generated/alpha-num4.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/alpha-num4.js");
60854
60945
  var alphaNum12 = __webpack_require__(/*! ../xdr/generated/alpha-num12.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/alpha-num12.js");
60855
- var assetType = __webpack_require__(/*! ../xdr/generated/asset-type.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/asset-type.js");
60856
60946
 
60857
60947
  const AssetType = {
60858
60948
  native: "native",
@@ -60868,6 +60958,11 @@ class Asset {
60868
60958
  code;
60869
60959
  /** The account ID of the issuer. Undefined for the native asset. */
60870
60960
  issuer;
60961
+ /**
60962
+ * The XDR union arm this asset encodes to. A private field so the object's
60963
+ * JSON/spread shape keeps only the code and issuer.
60964
+ */
60965
+ #rawAssetType;
60871
60966
  /**
60872
60967
  * @param code - The asset code.
60873
60968
  * @param issuer - The account ID of the issuer.
@@ -60884,12 +60979,19 @@ class Asset {
60884
60979
  if (issuer && !strkey.StrKey.isValidEd25519PublicKey(issuer)) {
60885
60980
  throw new Error("Issuer is invalid");
60886
60981
  }
60887
- if (String(code).toLowerCase() === "xlm") {
60982
+ if (!issuer && String(code).toLowerCase() === "xlm") {
60888
60983
  this.code = "XLM";
60889
60984
  } else {
60890
60985
  this.code = code;
60891
60986
  }
60892
60987
  this.issuer = issuer;
60988
+ this.#rawAssetType = Asset.#deriveRawAssetType(this.code, issuer);
60989
+ }
60990
+ static #deriveRawAssetType(code, issuer) {
60991
+ if (!issuer) {
60992
+ return assetType.AssetType.assetTypeNative;
60993
+ }
60994
+ return code.length <= 4 ? assetType.AssetType.assetTypeCreditAlphanum4 : assetType.AssetType.assetTypeCreditAlphanum12;
60893
60995
  }
60894
60996
  /**
60895
60997
  * Returns an asset object for the native asset.
@@ -60916,14 +61018,17 @@ class Asset {
60916
61018
  "\0"
60917
61019
  );
60918
61020
  return new this(code, issuer);
60919
- case "assetTypeCreditAlphanum12":
61021
+ case "assetTypeCreditAlphanum12": {
60920
61022
  anum = assetXdr.alphaNum12;
60921
61023
  issuer = strkey.StrKey.encodeEd25519PublicKey(anum.issuer.ed25519.toBytes());
60922
61024
  code = util.trimEnd(
60923
61025
  uint8arrayExtras.uint8ArrayToString(anum.assetCode.toBytes()),
60924
61026
  "\0"
60925
61027
  );
60926
- return new this(code, issuer);
61028
+ const asset = new this(code, issuer);
61029
+ asset.#rawAssetType = assetType.AssetType.assetTypeCreditAlphanum12;
61030
+ return asset;
61031
+ }
60927
61032
  default:
60928
61033
  throw new Error("Invalid asset type received: " + assetXdr.type);
60929
61034
  }
@@ -61001,18 +61106,18 @@ class Asset {
61001
61106
  if (!this.issuer) {
61002
61107
  throw new Error("Issuer cannot be null for non-native asset");
61003
61108
  }
61004
- if (this.code.length <= 4) {
61109
+ if (this.getRawAssetType().value === assetType.AssetType.assetTypeCreditAlphanum4.value) {
61005
61110
  const assetType2 = new alphaNum4.AlphaNum4({
61006
61111
  assetCode: uint8arrayExtras.stringToUint8Array(this.code.padEnd(4, "\0")),
61007
61112
  issuer: keypair.Keypair.fromPublicKey(this.issuer).xdrAccountId()
61008
61113
  });
61009
61114
  return xdrAsset.assetTypeCreditAlphanum4(assetType2);
61010
61115
  }
61011
- const assetType = new alphaNum12.AlphaNum12({
61116
+ const assetType$1 = new alphaNum12.AlphaNum12({
61012
61117
  assetCode: uint8arrayExtras.stringToUint8Array(this.code.padEnd(12, "\0")),
61013
61118
  issuer: keypair.Keypair.fromPublicKey(this.issuer).xdrAccountId()
61014
61119
  });
61015
- return xdrAsset.assetTypeCreditAlphanum12(assetType);
61120
+ return xdrAsset.assetTypeCreditAlphanum12(assetType$1);
61016
61121
  }
61017
61122
  /**
61018
61123
  * Returns the asset code
@@ -61056,13 +61161,11 @@ class Asset {
61056
61161
  * Returns the raw XDR representation of the asset type
61057
61162
  */
61058
61163
  getRawAssetType() {
61059
- if (this.isNative()) {
61060
- return assetType.AssetType.assetTypeNative;
61164
+ const { code, issuer } = this;
61165
+ if (#rawAssetType in this) {
61166
+ return this.#rawAssetType;
61061
61167
  }
61062
- if (this.code.length <= 4) {
61063
- return assetType.AssetType.assetTypeCreditAlphanum4;
61064
- }
61065
- return assetType.AssetType.assetTypeCreditAlphanum12;
61168
+ return Asset.#deriveRawAssetType(code, issuer);
61066
61169
  }
61067
61170
  /**
61068
61171
  * Returns true if this asset object is the native asset.
@@ -61076,7 +61179,7 @@ class Asset {
61076
61179
  * @param asset - Asset to compare
61077
61180
  */
61078
61181
  equals(asset) {
61079
- return this.code === asset.getCode() && this.issuer === asset.getIssuer();
61182
+ return this.code === asset.getCode() && this.issuer === asset.getIssuer() && this.getRawAssetType().value === asset.getRawAssetType().value;
61080
61183
  }
61081
61184
  /**
61082
61185
  * Returns a string representation of this asset.
@@ -61123,7 +61226,10 @@ class Asset {
61123
61226
  if (issuerA === void 0 || issuerB === void 0) {
61124
61227
  throw new Error("Issuer is undefined for non-native asset");
61125
61228
  }
61126
- return asciiCompare(issuerA, issuerB);
61229
+ return uint8arrayExtras.compareUint8Arrays(
61230
+ strkey.StrKey.decodeEd25519PublicKey(issuerA),
61231
+ strkey.StrKey.decodeEd25519PublicKey(issuerB)
61232
+ );
61127
61233
  }
61128
61234
  }
61129
61235
 
@@ -61160,6 +61266,7 @@ var sorobanAuthorizationEntry = __webpack_require__(/*! ../xdr/generated/soroban
61160
61266
  var sorobanCredentials = __webpack_require__(/*! ../xdr/generated/soroban-credentials.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/soroban-credentials.js");
61161
61267
  var hashIdPreimage = __webpack_require__(/*! ../xdr/generated/hash-id-preimage.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/hash-id-preimage.js");
61162
61268
 
61269
+ const MUXED_CREDENTIAL_REASON = "cannot sign authorization entries; use its base address";
61163
61270
  function toScVal(value) {
61164
61271
  if (scVal.ScVal.is(value)) return value;
61165
61272
  if (typeof value !== "object" || value === null) return null;
@@ -61182,6 +61289,17 @@ async function authorizeEntry(entry, signer, validUntilLedgerSeq, networkPassphr
61182
61289
  if (addrAuth === null) {
61183
61290
  throw new Error(`unsupported credential type ${credentials.type}`);
61184
61291
  }
61292
+ const addresses = collectSignatureNodes(credentials).map(
61293
+ (node) => address.Address.fromScAddress(node.address)
61294
+ );
61295
+ addresses.forEach(
61296
+ (address$1) => address.assertNotMuxed(address$1, MUXED_CREDENTIAL_REASON)
61297
+ );
61298
+ if (forAddress !== void 0 && !addresses.some((address) => address.toString() === forAddress)) {
61299
+ throw new Error(
61300
+ `the authorization entry has no credential node for address ${forAddress}`
61301
+ );
61302
+ }
61185
61303
  const preimage = buildAuthorizationEntryPreimage(
61186
61304
  entry,
61187
61305
  validUntilLedgerSeq,
@@ -61213,7 +61331,7 @@ async function authorizeEntry(entry, signer, validUntilLedgerSeq, networkPassphr
61213
61331
  publicKey = sigResult.publicKey;
61214
61332
  } else if (uint8arrayExtras.isUint8Array(sigResult)) {
61215
61333
  signature = sigResult;
61216
- publicKey = address.Address.fromScAddress(addrAuth.address).toString();
61334
+ publicKey = targetAddress ?? address.Address.fromScAddress(addrAuth.address).toString();
61217
61335
  } else {
61218
61336
  throw new TypeError(
61219
61337
  `SigningCallback must resolve to a Uint8Array, { signature, publicKey }, or { signatureScVal }; got ${sigResult === null ? "null" : typeof sigResult}`
@@ -61233,6 +61351,11 @@ async function authorizeEntry(entry, signer, validUntilLedgerSeq, networkPassphr
61233
61351
  `expected a Uint8Array signature from the signer, got ${signature === null ? "null" : typeof signature}`
61234
61352
  );
61235
61353
  }
61354
+ if (!strkey.StrKey.isValidEd25519PublicKey(publicKey)) {
61355
+ throw new TypeError(
61356
+ strkey.StrKey.isValidContract(publicKey) || strkey.StrKey.isValidMuxedContract(publicKey) ? `cannot verify an Ed25519 signature against contract ${publicKey}; sign for a contract address with a callback returning { signatureScVal }, or with a custom \`authorizeEntry\` when signing through signAuthEntries` : `expected an Ed25519 public key (G...) to verify the signature against, got ${JSON.stringify(publicKey)}`
61357
+ );
61358
+ }
61236
61359
  if (!keypair.Keypair.fromPublicKey(publicKey).verify(payload, signature)) {
61237
61360
  throw new Error(`signature doesn't match payload`);
61238
61361
  }
@@ -61254,6 +61377,7 @@ async function authorizeEntry(entry, signer, validUntilLedgerSeq, networkPassphr
61254
61377
  credentials,
61255
61378
  validUntilLedgerSeq,
61256
61379
  signatureScVal,
61380
+ payload,
61257
61381
  targetAddress
61258
61382
  );
61259
61383
  if (matched === 0) {
@@ -61282,7 +61406,7 @@ function authorizeInvocation(params) {
61282
61406
  throw new Error(`authorizeInvocation requires publicKey parameter`);
61283
61407
  }
61284
61408
  const addressCredentials = new sorobanAddressCredentials.SorobanAddressCredentials({
61285
- address: new address.Address(pk).toScAddress(),
61409
+ address: credentialAddress(pk),
61286
61410
  nonce,
61287
61411
  signatureExpirationLedger: 0,
61288
61412
  // replaced
@@ -61341,6 +61465,10 @@ function buildWithDelegatesEntry(params) {
61341
61465
  `buildWithDelegatesEntry expects ADDRESS or ADDRESS_V2 credentials, got ${credentials.type}`
61342
61466
  );
61343
61467
  }
61468
+ address.assertNotMuxed(
61469
+ address.Address.fromScAddress(addrAuth.address),
61470
+ MUXED_CREDENTIAL_REASON
61471
+ );
61344
61472
  return new sorobanAuthorizationEntry.SorobanAuthorizationEntry({
61345
61473
  rootInvocation: entry.rootInvocation,
61346
61474
  credentials: sorobanCredentials.SorobanCredentials.sorobanCredentialsAddressWithDelegates(
@@ -61356,10 +61484,15 @@ function buildWithDelegatesEntry(params) {
61356
61484
  )
61357
61485
  });
61358
61486
  }
61487
+ function credentialAddress(address$1) {
61488
+ const addr = new address.Address(address$1);
61489
+ address.assertNotMuxed(addr, MUXED_CREDENTIAL_REASON);
61490
+ return addr.toScAddress();
61491
+ }
61359
61492
  function buildDelegateNodes(delegates) {
61360
61493
  const nodes = delegates.map(
61361
61494
  (delegate) => new sorobanDelegateSignature.SorobanDelegateSignature({
61362
- address: new address.Address(delegate.address).toScAddress(),
61495
+ address: credentialAddress(delegate.address),
61363
61496
  signature: delegate.signature ?? scVal.ScVal.scvVoid(),
61364
61497
  nestedDelegates: buildDelegateNodes(delegate.nestedDelegates ?? [])
61365
61498
  })
@@ -61393,7 +61526,7 @@ function getAddressCredentials(credentials) {
61393
61526
  return null;
61394
61527
  }
61395
61528
  }
61396
- function applyExpirationAndSignature(credentials, validUntilLedgerSeq, signature, forAddress) {
61529
+ function applyExpirationAndSignature(credentials, validUntilLedgerSeq, signature, payload, forAddress) {
61397
61530
  const topAddr = getAddressCredentials(credentials);
61398
61531
  if (topAddr === null) {
61399
61532
  return { credentials, matched: 0 };
@@ -61403,11 +61536,24 @@ function applyExpirationAndSignature(credentials, validUntilLedgerSeq, signature
61403
61536
  if (topIsTarget) {
61404
61537
  matched++;
61405
61538
  }
61539
+ const stored = topAddr.signatureExpirationLedger;
61540
+ const keepOther = (other) => {
61541
+ if (stored === validUntilLedgerSeq || !signaturePresent(other)) {
61542
+ return true;
61543
+ }
61544
+ if (stored !== 0) {
61545
+ return false;
61546
+ }
61547
+ const pairs = parseEd25519Signatures(other);
61548
+ return pairs === null || pairs.every(
61549
+ (pair) => keypair.Keypair.fromPublicKey(pair.publicKey).verify(payload, pair.signature)
61550
+ );
61551
+ };
61406
61552
  const newTopAddr = new sorobanAddressCredentials.SorobanAddressCredentials({
61407
61553
  address: topAddr.address,
61408
61554
  nonce: topAddr.nonce,
61409
61555
  signatureExpirationLedger: validUntilLedgerSeq,
61410
- signature: topIsTarget ? signature : topAddr.signature
61556
+ signature: topIsTarget ? signature : carryOver(topAddr.signature, keepOther)
61411
61557
  });
61412
61558
  switch (credentials.type) {
61413
61559
  case "sorobanCredentialsAddress":
@@ -61422,10 +61568,11 @@ function applyExpirationAndSignature(credentials, validUntilLedgerSeq, signature
61422
61568
  };
61423
61569
  case "sorobanCredentialsAddressWithDelegates": {
61424
61570
  const withDelegates = credentials.addressWithDelegates;
61425
- const newDelegates = forAddress === void 0 ? withDelegates.delegates : rebuildDelegatesWithSignature(
61571
+ const newDelegates = forAddress === void 0 && stored === validUntilLedgerSeq ? withDelegates.delegates : rebuildDelegatesWithSignature(
61426
61572
  withDelegates.delegates,
61427
61573
  forAddress,
61428
61574
  signature,
61575
+ keepOther,
61429
61576
  () => {
61430
61577
  matched++;
61431
61578
  }
@@ -61444,19 +61591,23 @@ function applyExpirationAndSignature(credentials, validUntilLedgerSeq, signature
61444
61591
  return { credentials, matched };
61445
61592
  }
61446
61593
  }
61447
- function rebuildDelegatesWithSignature(delegates, forAddress, signature, onMatch) {
61594
+ function carryOver(signature, keep) {
61595
+ return keep(signature) ? signature : scVal.ScVal.scvVoid();
61596
+ }
61597
+ function rebuildDelegatesWithSignature(delegates, forAddress, signature, keepOther, onMatch) {
61448
61598
  return delegates.map((delegate) => {
61449
- const isMatch = address.Address.fromScAddress(delegate.address).toString() === forAddress;
61599
+ const isMatch = forAddress !== void 0 && address.Address.fromScAddress(delegate.address).toString() === forAddress;
61450
61600
  if (isMatch) {
61451
61601
  onMatch();
61452
61602
  }
61453
61603
  return new sorobanDelegateSignature.SorobanDelegateSignature({
61454
61604
  address: delegate.address,
61455
- signature: isMatch ? signature : delegate.signature,
61605
+ signature: isMatch ? signature : carryOver(delegate.signature, keepOther),
61456
61606
  nestedDelegates: rebuildDelegatesWithSignature(
61457
61607
  delegate.nestedDelegates,
61458
61608
  forAddress,
61459
61609
  signature,
61610
+ keepOther,
61460
61611
  onMatch
61461
61612
  )
61462
61613
  });
@@ -61604,6 +61755,7 @@ exports.buildWithDelegatesEntry = buildWithDelegatesEntry;
61604
61755
  exports.checkAuthEntryReadiness = checkAuthEntryReadiness;
61605
61756
  exports.getAddressCredentials = getAddressCredentials;
61606
61757
  exports.inspectAuthEntry = inspectAuthEntry;
61758
+ exports.signaturePresent = signaturePresent;
61607
61759
  //# sourceMappingURL=auth.js.map
61608
61760
 
61609
61761
 
@@ -61692,9 +61844,9 @@ class Claimant {
61692
61844
  /**
61693
61845
  * Returns a `BeforeAbsoluteTime` claim predicate
61694
61846
  *
61695
- * This predicate will be fulfilled if the closing time of the ledger that
61696
- * includes the CreateClaimableBalance operation is less than this (absolute)
61697
- * Unix timestamp (expressed in seconds).
61847
+ * This predicate will be fulfilled if the closing time of the ledger in
61848
+ * which the balance is claimed is less than this (absolute) Unix timestamp
61849
+ * (expressed in seconds).
61698
61850
  *
61699
61851
  * @param absBefore - Unix epoch (in seconds) as a string
61700
61852
  */
@@ -61706,9 +61858,11 @@ class Claimant {
61706
61858
  /**
61707
61859
  * Returns a `BeforeRelativeTime` claim predicate
61708
61860
  *
61709
- * This predicate will be fulfilled if the closing time of the ledger that
61710
- * includes the CreateClaimableBalance operation plus this relative time delta
61711
- * (in seconds) is less than the current time.
61861
+ * When the balance is created, this is converted to a `BeforeAbsoluteTime`
61862
+ * predicate by adding this relative time delta (in seconds) to the closing
61863
+ * time of the ledger that includes the CreateClaimableBalance operation. The
61864
+ * predicate is then fulfilled while the closing time of the ledger in which
61865
+ * the balance is claimed is less than that sum.
61712
61866
  *
61713
61867
  * @param seconds - seconds since closeTime of the ledger in which the ClaimableBalanceEntry was created (as string)
61714
61868
  */
@@ -61812,6 +61966,11 @@ class Contract {
61812
61966
  try {
61813
61967
  this._id = strkey.StrKey.decodeContract(contractId);
61814
61968
  } catch {
61969
+ if (strkey.StrKey.isValidMuxedContract(contractId)) {
61970
+ throw new Error(
61971
+ `Invalid contract ID: ${contractId} is a muxed contract address; use its base address (C...)`
61972
+ );
61973
+ }
61815
61974
  throw new Error(`Invalid contract ID: ${contractId}`);
61816
61975
  }
61817
61976
  }
@@ -61919,11 +62078,11 @@ exports.humanizeEvents = humanizeEvents;
61919
62078
  "use strict";
61920
62079
 
61921
62080
 
61922
- var base64 = __webpack_require__(/*! ./util/base64.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/base64.js");
61923
62081
  __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
61924
62082
  var hashing = __webpack_require__(/*! ./hashing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/hashing.js");
61925
62083
  var transaction = __webpack_require__(/*! ./transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction.js");
61926
62084
  var transaction_base = __webpack_require__(/*! ./transaction_base.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_base.js");
62085
+ var util = __webpack_require__(/*! ../xdr/util.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/util.js");
61927
62086
  var decode_encode_muxed_account = __webpack_require__(/*! ./util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
61928
62087
  var feeBumpTransactionEnvelope = __webpack_require__(/*! ../xdr/generated/fee-bump-transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/fee-bump-transaction-envelope.js");
61929
62088
  var transactionEnvelope = __webpack_require__(/*! ../xdr/generated/transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-envelope.js");
@@ -61941,17 +62100,12 @@ class FeeBumpTransaction extends transaction_base.TransactionBase {
61941
62100
  * (e.g. "Public Global Stellar Network ; September 2015").
61942
62101
  */
61943
62102
  constructor(envelope, networkPassphrase) {
61944
- if (typeof envelope === "string") {
61945
- const bytes = base64.base64ToUint8Array(envelope);
61946
- envelope = transactionEnvelope.TransactionEnvelope.fromXdr(bytes);
61947
- }
61948
- const envelopeType = envelope.type;
61949
- if (envelopeType !== "envelopeTypeTxFeeBump") {
61950
- throw new Error(
61951
- `Invalid TransactionEnvelope: expected an envelopeTypeTxFeeBump but received an ${envelopeType}.`
61952
- );
61953
- }
61954
- const txEnvelope = envelope.value;
62103
+ const own = transaction_base.ownEnvelope(
62104
+ envelope,
62105
+ (value) => util.isUnionVariant(value, "envelopeTypeTxFeeBump"),
62106
+ "envelopeTypeTxFeeBump"
62107
+ );
62108
+ const txEnvelope = own.value;
61955
62109
  const tx = txEnvelope.tx;
61956
62110
  const fee = tx.fee.toString();
61957
62111
  const signatures = (txEnvelope.signatures || []).slice();
@@ -61961,7 +62115,7 @@ class FeeBumpTransaction extends transaction_base.TransactionBase {
61961
62115
  );
61962
62116
  this._feeSource = decode_encode_muxed_account.encodeMuxedAccountToAddress(this.tx.feeSource);
61963
62117
  this._innerTransaction = new transaction.Transaction(
61964
- innerTxEnvelope,
62118
+ transaction_base.markSdkOwned(innerTxEnvelope),
61965
62119
  networkPassphrase
61966
62120
  );
61967
62121
  }
@@ -62019,6 +62173,88 @@ exports.FeeBumpTransaction = FeeBumpTransaction;
62019
62173
  //# sourceMappingURL=fee_bump_transaction.js.map
62020
62174
 
62021
62175
 
62176
+ /***/ }),
62177
+
62178
+ /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/get_claimable_balance_id.js":
62179
+ /*!****************************************************************************************!*\
62180
+ !*** ../../node_modules/@stellar/stellar-sdk/lib/cjs/base/get_claimable_balance_id.js ***!
62181
+ \****************************************************************************************/
62182
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
62183
+
62184
+ "use strict";
62185
+
62186
+
62187
+ __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
62188
+ var transactionResult = __webpack_require__(/*! ../xdr/generated/transaction-result.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-result.js");
62189
+
62190
+ function isTransactionResult(value) {
62191
+ if (value instanceof transactionResult.TransactionResult) return true;
62192
+ if (typeof value !== "object" || value === null) return false;
62193
+ const ctor = value.constructor;
62194
+ return ctor?.schema?.name === transactionResult.TransactionResult.schema.name;
62195
+ }
62196
+ function successfulOperationResults(result) {
62197
+ const txResult = result.result;
62198
+ switch (txResult.type) {
62199
+ case "txSuccess":
62200
+ return txResult.results;
62201
+ case "txFeeBumpInnerSuccess": {
62202
+ const innerResult = txResult.innerResultPair.result.result;
62203
+ if (innerResult.type !== "txSuccess") {
62204
+ throw new TypeError(
62205
+ `expected a successful inner transaction result, got ${innerResult.type}`
62206
+ );
62207
+ }
62208
+ return innerResult.results;
62209
+ }
62210
+ default:
62211
+ throw new TypeError(
62212
+ `expected a successful transaction result, got ${txResult.type}`
62213
+ );
62214
+ }
62215
+ }
62216
+ function getClaimableBalanceIdFromResult(result, opIndex) {
62217
+ if (!isTransactionResult(result)) {
62218
+ throw new TypeError(
62219
+ 'expected an xdr.TransactionResult; decode a base64 `result_xdr` with xdr.TransactionResult.fromXdr(result_xdr, "base64") first'
62220
+ );
62221
+ }
62222
+ const opResults = successfulOperationResults(result);
62223
+ if (!Array.isArray(opResults)) {
62224
+ throw new TypeError(
62225
+ "expected an xdr.TransactionResult; its operation results are missing"
62226
+ );
62227
+ }
62228
+ if (!Number.isInteger(opIndex) || opIndex < 0 || opIndex >= opResults.length) {
62229
+ throw new RangeError(
62230
+ `invalid operation index ${opIndex}; the transaction has ${opResults.length} operation result(s)`
62231
+ );
62232
+ }
62233
+ const opResult = opResults[opIndex];
62234
+ if (opResult.type !== "opInner") {
62235
+ throw new TypeError(
62236
+ `expected opInner at index ${opIndex}, got ${opResult.type}`
62237
+ );
62238
+ }
62239
+ const opTypeResult = opResult.tr;
62240
+ if (opTypeResult.type !== "createClaimableBalance") {
62241
+ throw new TypeError(
62242
+ `expected createClaimableBalance at index ${opIndex}, got ${opTypeResult.type}`
62243
+ );
62244
+ }
62245
+ const balanceResult = opTypeResult.createClaimableBalanceResult;
62246
+ if (balanceResult.type !== "createClaimableBalanceSuccess") {
62247
+ throw new TypeError(
62248
+ `expected createClaimableBalanceSuccess at index ${opIndex}, got ${balanceResult.type}`
62249
+ );
62250
+ }
62251
+ return balanceResult.balanceId.toXdr("hex");
62252
+ }
62253
+
62254
+ exports.getClaimableBalanceIdFromResult = getClaimableBalanceIdFromResult;
62255
+ //# sourceMappingURL=get_claimable_balance_id.js.map
62256
+
62257
+
62022
62258
  /***/ }),
62023
62259
 
62024
62260
  /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/get_liquidity_pool_id.js":
@@ -62204,12 +62440,13 @@ var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_
62204
62440
  var signing = __webpack_require__(/*! ./signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
62205
62441
  var strkey = __webpack_require__(/*! ./strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
62206
62442
  var hashing = __webpack_require__(/*! ./hashing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/hashing.js");
62443
+ var decode_encode_muxed_account = __webpack_require__(/*! ./util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
62207
62444
  var index = __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
62208
62445
  var publicKey = __webpack_require__(/*! ../xdr/generated/public-key.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/public-key.js");
62209
- var muxedAccount = __webpack_require__(/*! ../xdr/generated/muxed-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account.js");
62210
- var muxedAccountMed25519 = __webpack_require__(/*! ../xdr/generated/muxed-account-med25519.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account-med25519.js");
62211
62446
  var decoratedSignature = __webpack_require__(/*! ../xdr/generated/decorated-signature.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/decorated-signature.js");
62212
62447
  var signature = __webpack_require__(/*! ../xdr/generated/signature.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/signature.js");
62448
+ var muxedAccount = __webpack_require__(/*! ../xdr/generated/muxed-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account.js");
62449
+ var muxedAccountMed25519 = __webpack_require__(/*! ../xdr/generated/muxed-account-med25519.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account-med25519.js");
62213
62450
 
62214
62451
  function _interopNamespace(e) {
62215
62452
  if (e && e.__esModule) return e;
@@ -62342,8 +62579,8 @@ class Keypair {
62342
62579
  * You will get a different type of muxed account depending on whether or not
62343
62580
  * you pass an ID.
62344
62581
  *
62345
- * @param id - stringified integer indicating the underlying muxed
62346
- * ID of the new account object
62582
+ * @param id - the underlying muxed ID of the new account object, as a
62583
+ * uint64 in decimal digits. Leading zeros are removed. At most 22 digits.
62347
62584
  */
62348
62585
  xdrMuxedAccount(id) {
62349
62586
  if (typeof id !== "undefined") {
@@ -62352,7 +62589,7 @@ class Keypair {
62352
62589
  }
62353
62590
  return muxedAccount.MuxedAccount.keyTypeMuxedEd25519(
62354
62591
  new muxedAccountMed25519.MuxedAccountMed25519({
62355
- id: index.Uint64.fromString(id),
62592
+ id: index.Uint64.fromString(decode_encode_muxed_account.canonicalUint64Id(id)),
62356
62593
  ed25519: this._publicKey
62357
62594
  })
62358
62595
  );
@@ -62926,8 +63163,9 @@ class Memo {
62926
63163
  /**
62927
63164
  * Creates and returns a `MemoText` memo.
62928
63165
  *
62929
- * @param text - memo text. A JS string is UTF-8 encoded on the wire;
62930
- * pass a `Uint8Array` for byte-exact content. A plain `number[]` is not
63166
+ * @param text - memo text. A JS string is UTF-8 encoded on the wire, and
63167
+ * a lone surrogate becomes U+FFFD with no error; pass a `Uint8Array`
63168
+ * for byte-exact content. A plain `number[]` is not
62931
63169
  * accepted (16.2.0 and earlier took one); wrap it: `new Uint8Array(arr)`.
62932
63170
  */
62933
63171
  static text(text) {
@@ -63036,20 +63274,6 @@ var account = __webpack_require__(/*! ./account.js */ "../../node_modules/@stell
63036
63274
  var strkey = __webpack_require__(/*! ./strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
63037
63275
  var decode_encode_muxed_account = __webpack_require__(/*! ./util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
63038
63276
 
63039
- const MAX_UINT64 = BigInt("18446744073709551615");
63040
- function validateUint64Id(id) {
63041
- let value;
63042
- try {
63043
- value = BigInt(id);
63044
- } catch {
63045
- throw new Error(`id is not a valid uint64 string: ${id}`);
63046
- }
63047
- if (value < BigInt(0) || value > MAX_UINT64) {
63048
- throw new Error(
63049
- `id value out of range for uint64 [0, ${MAX_UINT64}]: ${id}`
63050
- );
63051
- }
63052
- }
63053
63277
  class MuxedAccount {
63054
63278
  account;
63055
63279
  _muxedXdr;
@@ -63058,19 +63282,19 @@ class MuxedAccount {
63058
63282
  /**
63059
63283
  * @param baseAccount - the {@link Account} instance representing the
63060
63284
  * underlying G... address
63061
- * @param id - a stringified uint64 value that represents the ID of the
63062
- * muxed account
63285
+ * @param id - the ID of the muxed account, as a uint64 in decimal digits.
63286
+ * Leading zeros are removed. At most 22 digits.
63063
63287
  */
63064
63288
  constructor(baseAccount, id) {
63065
63289
  const accountId = baseAccount.accountId();
63066
63290
  if (!strkey.StrKey.isValidEd25519PublicKey(accountId)) {
63067
63291
  throw new Error("accountId is invalid");
63068
63292
  }
63069
- validateUint64Id(id);
63293
+ const canonicalId = decode_encode_muxed_account.canonicalUint64Id(id);
63070
63294
  this.account = baseAccount;
63071
- this._muxedXdr = decode_encode_muxed_account.encodeMuxedAccount(accountId, id);
63295
+ this._muxedXdr = decode_encode_muxed_account.encodeMuxedAccount(accountId, canonicalId);
63072
63296
  this._mAddress = decode_encode_muxed_account.encodeMuxedAccountToAddress(this._muxedXdr);
63073
- this._id = id;
63297
+ this._id = canonicalId;
63074
63298
  }
63075
63299
  /**
63076
63300
  * Parses an M-address into a MuxedAccount object.
@@ -63112,16 +63336,14 @@ class MuxedAccount {
63112
63336
  /**
63113
63337
  * Updates the muxed account's ID, regenerating the M-address accordingly.
63114
63338
  *
63115
- * @param id - a stringified uint64 value to set as the new muxed account ID
63339
+ * @param id - the new muxed account ID, as a uint64 in decimal digits.
63340
+ * Leading zeros are removed. At most 22 digits.
63116
63341
  */
63117
63342
  setId(id) {
63118
- if (typeof id !== "string") {
63119
- throw new Error("id should be a string representing a number (uint64)");
63120
- }
63121
- validateUint64Id(id);
63122
- this._muxedXdr = decode_encode_muxed_account.encodeMuxedAccount(this.account.accountId(), id);
63343
+ const canonicalId = decode_encode_muxed_account.canonicalUint64Id(id);
63344
+ this._muxedXdr = decode_encode_muxed_account.encodeMuxedAccount(this.account.accountId(), canonicalId);
63123
63345
  this._mAddress = decode_encode_muxed_account.encodeMuxedAccountToAddress(this._muxedXdr);
63124
- this._id = id;
63346
+ this._id = canonicalId;
63125
63347
  return this;
63126
63348
  }
63127
63349
  /**
@@ -65011,7 +65233,7 @@ exports.liquidityPoolWithdraw = liquidityPoolWithdraw;
65011
65233
 
65012
65234
 
65013
65235
  var operations = __webpack_require__(/*! ../util/operations.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/operations.js");
65014
- var index = __webpack_require__(/*! ../../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65236
+ __webpack_require__(/*! ../../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65015
65237
  var manageBuyOfferOp = __webpack_require__(/*! ../../xdr/generated/manage-buy-offer-op.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/manage-buy-offer-op.js");
65016
65238
  var operationBody = __webpack_require__(/*! ../../xdr/generated/operation-body.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/operation-body.js");
65017
65239
  var operation = __webpack_require__(/*! ../../xdr/generated/operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/operation.js");
@@ -65027,8 +65249,7 @@ function manageBuyOffer(opts) {
65027
65249
  throw new TypeError("price argument is required");
65028
65250
  }
65029
65251
  const price = operations.toXdrPrice(opts.price);
65030
- const offerIdStr = opts.offerId !== void 0 ? opts.offerId.toString() : "0";
65031
- const offerId = index.Int64.fromString(offerIdStr);
65252
+ const offerId = operations.toXdrOfferId(opts.offerId);
65032
65253
  const manageBuyOfferOp$1 = new manageBuyOfferOp.ManageBuyOfferOp({
65033
65254
  selling,
65034
65255
  buying,
@@ -65113,7 +65334,7 @@ exports.manageData = manageData;
65113
65334
 
65114
65335
 
65115
65336
  var operations = __webpack_require__(/*! ../util/operations.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/operations.js");
65116
- var index = __webpack_require__(/*! ../../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65337
+ __webpack_require__(/*! ../../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65117
65338
  var manageSellOfferOp = __webpack_require__(/*! ../../xdr/generated/manage-sell-offer-op.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/manage-sell-offer-op.js");
65118
65339
  var operationBody = __webpack_require__(/*! ../../xdr/generated/operation-body.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/operation-body.js");
65119
65340
  var operation = __webpack_require__(/*! ../../xdr/generated/operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/operation.js");
@@ -65129,8 +65350,7 @@ function manageSellOffer(opts) {
65129
65350
  throw new TypeError("price argument is required");
65130
65351
  }
65131
65352
  const price = operations.toXdrPrice(opts.price);
65132
- const offerIdStr = opts.offerId !== void 0 ? opts.offerId.toString() : "0";
65133
- const offerId = index.Int64.fromString(offerIdStr);
65353
+ const offerId = operations.toXdrOfferId(opts.offerId);
65134
65354
  const manageSellOfferOp$1 = new manageSellOfferOp.ManageSellOfferOp({
65135
65355
  selling,
65136
65356
  buying,
@@ -65363,7 +65583,7 @@ exports.restoreFootprint = restoreFootprint;
65363
65583
  "use strict";
65364
65584
 
65365
65585
 
65366
- var index = __webpack_require__(/*! ../../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65586
+ __webpack_require__(/*! ../../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65367
65587
  var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extras/index.js");
65368
65588
  var strkey = __webpack_require__(/*! ../strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
65369
65589
  var keypair = __webpack_require__(/*! ../keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
@@ -65433,13 +65653,13 @@ function revokeOfferSponsorship(opts = {}) {
65433
65653
  if (!strkey.StrKey.isValidEd25519PublicKey(opts.seller)) {
65434
65654
  throw new Error("seller is invalid");
65435
65655
  }
65436
- if (typeof opts.offerId !== "string") {
65656
+ if (opts.offerId === void 0) {
65437
65657
  throw new Error("offerId is invalid");
65438
65658
  }
65439
65659
  const ledgerKey$1 = ledgerKey.LedgerKey.offer(
65440
65660
  new ledgerKeyOffer.LedgerKeyOffer({
65441
65661
  sellerId: keypair.Keypair.fromPublicKey(opts.seller).xdrAccountId(),
65442
- offerId: index.Int64.fromString(opts.offerId)
65662
+ offerId: operations.toXdrOfferId(opts.offerId)
65443
65663
  })
65444
65664
  );
65445
65665
  const op = revokeSponsorshipOp.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey$1);
@@ -65810,6 +66030,7 @@ exports.setTrustLineFlags = setTrustLineFlags;
65810
66030
  "use strict";
65811
66031
 
65812
66032
 
66033
+ var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extras/index.js");
65813
66034
  var index = __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
65814
66035
  var keypair = __webpack_require__(/*! ./keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
65815
66036
  var address = __webpack_require__(/*! ./address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
@@ -65819,6 +66040,7 @@ var xdr_large_int = __webpack_require__(/*! ./numbers/xdr_large_int.js */ "../..
65819
66040
  var sc_int = __webpack_require__(/*! ./numbers/sc_int.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/numbers/sc_int.js");
65820
66041
  var scBytes = __webpack_require__(/*! ../xdr/generated/sc-bytes.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-bytes.js");
65821
66042
  var scVal = __webpack_require__(/*! ../xdr/generated/sc-val.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val.js");
66043
+ var scValType = __webpack_require__(/*! ../xdr/generated/sc-val-type.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val-type.js");
65822
66044
 
65823
66045
  function nativeToScVal(val, opts = {}) {
65824
66046
  switch (typeof val) {
@@ -65915,8 +66137,8 @@ function nativeToScVal(val, opts = {}) {
65915
66137
  );
65916
66138
  }
65917
66139
  const mapTypeSpec = opts?.type ?? {};
65918
- return scVal.ScVal.scvMap(
65919
- Object.entries(val).sort(([key1], [key2]) => key1 < key2 ? -1 : key1 > key2 ? 1 : 0).map(([k, v]) => {
66140
+ return scvSortedMap(
66141
+ Object.entries(val).map(([k, v]) => {
65920
66142
  const [keyType, valType] = Object.hasOwn(mapTypeSpec, k) ? mapTypeSpec[k] ?? [null, null] : [null, null];
65921
66143
  const keyOpts = keyType ? { type: keyType } : {};
65922
66144
  const valOpts = valType ? { type: valType } : {};
@@ -65980,8 +66202,6 @@ function nativeToScVal(val, opts = {}) {
65980
66202
  return scVal.ScVal.scvBool(val);
65981
66203
  case "undefined":
65982
66204
  return scVal.ScVal.scvVoid();
65983
- case "function":
65984
- return nativeToScVal(val());
65985
66205
  default:
65986
66206
  throw new TypeError(
65987
66207
  `failed to convert typeof ${typeof val} (${JSON.stringify(val)})`
@@ -66008,13 +66228,23 @@ function scValToNative(scv) {
66008
66228
  return (scv.value ?? []).map(scValToNative);
66009
66229
  case "scvAddress":
66010
66230
  return address.Address.fromScVal(scv).toString();
66011
- case "scvMap":
66012
- return Object.fromEntries(
66013
- (scv.value ?? []).map((entry) => [
66014
- scValToNative(entry.key),
66015
- scValToNative(entry.val)
66016
- ])
66017
- );
66231
+ case "scvMap": {
66232
+ const pairs = (scv.value ?? []).map((entry) => [
66233
+ scValToNative(entry.key),
66234
+ scValToNative(entry.val)
66235
+ ]);
66236
+ const seen = /* @__PURE__ */ new Set();
66237
+ for (const [key] of pairs) {
66238
+ const prop = String(key);
66239
+ if (seen.has(prop)) {
66240
+ throw new TypeError(
66241
+ `scvMap has more than one key that converts to "${prop}"; read the raw map entries instead`
66242
+ );
66243
+ }
66244
+ seen.add(prop);
66245
+ }
66246
+ return Object.fromEntries(pairs);
66247
+ }
66018
66248
  // these return the primitive type directly
66019
66249
  case "scvBool":
66020
66250
  case "scvU32":
@@ -66063,23 +66293,71 @@ function scValToNative(scv) {
66063
66293
  }
66064
66294
  }
66065
66295
  function scvSortedMap(items) {
66066
- const sorted = Array.from(items).sort((a, b) => {
66067
- const nativeA = scValToNative(a.key);
66068
- const nativeB = scValToNative(b.key);
66069
- switch (typeof nativeA) {
66070
- case "number":
66071
- case "bigint":
66072
- if (nativeA === nativeB) return 0;
66073
- return nativeA < nativeB ? -1 : 1;
66074
- default: {
66075
- const strA = nativeA.toString();
66076
- const strB = nativeB.toString();
66077
- return strA < strB ? -1 : strA > strB ? 1 : 0;
66078
- }
66079
- }
66080
- });
66296
+ const sorted = Array.from(items).sort((a, b) => compareScVal(a.key, b.key));
66081
66297
  return scVal.ScVal.scvMap(sorted);
66082
66298
  }
66299
+ function compareScVal(a, b) {
66300
+ if (a.type !== b.type) {
66301
+ return scValType.ScValType[a.type].value - scValType.ScValType[b.type].value;
66302
+ }
66303
+ switch (a.type) {
66304
+ case "scvBool":
66305
+ return Number(a.b) - Number(b.b);
66306
+ case "scvVoid":
66307
+ case "scvLedgerKeyContractInstance":
66308
+ return 0;
66309
+ case "scvU32":
66310
+ case "scvI32":
66311
+ case "scvU64":
66312
+ case "scvI64":
66313
+ case "scvTimepoint":
66314
+ case "scvDuration":
66315
+ case "scvU128":
66316
+ case "scvI128":
66317
+ case "scvU256":
66318
+ case "scvI256":
66319
+ return compareBigInts(index$1.scValToBigInt(a), index$1.scValToBigInt(b));
66320
+ case "scvBytes":
66321
+ return uint8arrayExtras.compareUint8Arrays(a.bytes.value, b.bytes.value);
66322
+ case "scvString":
66323
+ return uint8arrayExtras.compareUint8Arrays(a.str.bytes, b.str.bytes);
66324
+ case "scvSymbol":
66325
+ return uint8arrayExtras.compareUint8Arrays(a.sym.bytes, b.sym.bytes);
66326
+ case "scvExecutableTag":
66327
+ return uint8arrayExtras.compareUint8Arrays(
66328
+ a.executableTag.bytes,
66329
+ b.executableTag.bytes
66330
+ );
66331
+ case "scvVec":
66332
+ return compareOptionalLists(a.vec, b.vec, compareScVal);
66333
+ case "scvMap":
66334
+ return compareOptionalLists(
66335
+ a.map,
66336
+ b.map,
66337
+ (x, y) => compareScVal(x.key, y.key) || compareScVal(x.val, y.val)
66338
+ );
66339
+ case "scvLedgerKeyNonce":
66340
+ return compareBigInts(a.nonceKey.nonce, b.nonceKey.nonce);
66341
+ // Errors and addresses hold only fixed-size unsigned fields, so their XDR
66342
+ // bytes sort the same as their values. Contract instances are never
66343
+ // sensible map keys, so best-effort byte order is enough there.
66344
+ default:
66345
+ return uint8arrayExtras.compareUint8Arrays(a.toXdr(), b.toXdr());
66346
+ }
66347
+ }
66348
+ function compareBigInts(a, b) {
66349
+ return a < b ? -1 : a > b ? 1 : 0;
66350
+ }
66351
+ function compareOptionalLists(a, b, compare) {
66352
+ if (a === null || b === null) {
66353
+ return Number(a !== null) - Number(b !== null);
66354
+ }
66355
+ for (let i = 0; i < Math.min(a.length, b.length); i++) {
66356
+ const result = compare(a[i], b[i]);
66357
+ if (result !== 0) return result;
66358
+ }
66359
+ return a.length - b.length;
66360
+ }
66083
66361
 
66084
66362
  exports.nativeToScVal = nativeToScVal;
66085
66363
  exports.scValToNative = scValToNative;
@@ -66546,6 +66824,7 @@ exports.SorobanDataBuilder = SorobanDataBuilder;
66546
66824
  var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extras/index.js");
66547
66825
  var base32_js = __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
66548
66826
  var checksum = __webpack_require__(/*! ./util/checksum.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/checksum.js");
66827
+ var bigintParts = __webpack_require__(/*! ../xdr/values/bigint-parts.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/values/bigint-parts.js");
66549
66828
 
66550
66829
  const versionBytes = {
66551
66830
  ed25519PublicKey: 6 << 3,
@@ -66564,8 +66843,10 @@ const versionBytes = {
66564
66843
  // C
66565
66844
  liquidityPool: 11 << 3,
66566
66845
  // L
66567
- claimableBalance: 1 << 3
66846
+ claimableBalance: 1 << 3,
66568
66847
  // B
66848
+ muxedContract: 22 << 3
66849
+ // W
66569
66850
  };
66570
66851
  const strkeyTypes = {
66571
66852
  G: "ed25519PublicKey",
@@ -66576,7 +66857,8 @@ const strkeyTypes = {
66576
66857
  P: "signedPayload",
66577
66858
  C: "contract",
66578
66859
  L: "liquidityPool",
66579
- B: "claimableBalance"
66860
+ B: "claimableBalance",
66861
+ W: "muxedContract"
66580
66862
  };
66581
66863
  function hasVersionByteName(versionByteName) {
66582
66864
  return Object.prototype.hasOwnProperty.call(versionBytes, versionByteName);
@@ -66593,6 +66875,7 @@ function encodedLengthRange(name) {
66593
66875
  case "claimableBalance":
66594
66876
  return [58, 58];
66595
66877
  case "med25519PublicKey":
66878
+ case "muxedContract":
66596
66879
  return [69, 69];
66597
66880
  case "signedPayload":
66598
66881
  return [56, 165];
@@ -66828,6 +67111,31 @@ class StrKey {
66828
67111
  static isValidClaimableBalance(address) {
66829
67112
  return isValid("claimableBalance", address);
66830
67113
  }
67114
+ /**
67115
+ * Encodes raw data to strkey muxed contract (W...): the 32-byte contract ID
67116
+ * followed by the 8-byte big-endian mux ID.
67117
+ *
67118
+ * @param data - data to encode
67119
+ */
67120
+ static encodeMuxedContract(data) {
67121
+ return encodeCheck("muxedContract", data);
67122
+ }
67123
+ /**
67124
+ * Decodes strkey muxed contract (W...) to raw data.
67125
+ *
67126
+ * @param address - address to decode
67127
+ */
67128
+ static decodeMuxedContract(address) {
67129
+ return decodeCheck("muxedContract", address);
67130
+ }
67131
+ /**
67132
+ * Checks validity of alleged muxed contract (W...) strkey address.
67133
+ *
67134
+ * @param address - address to check
67135
+ */
67136
+ static isValidMuxedContract(address) {
67137
+ return isValid("muxedContract", address);
67138
+ }
66831
67139
  /**
66832
67140
  * Encodes raw data to strkey liquidity pool (L...).
66833
67141
  *
@@ -66898,6 +67206,7 @@ function isValid(versionByteName, encoded) {
66898
67206
  return decoded.length === 32 + 1;
66899
67207
  // +1 byte for discriminant
66900
67208
  case "med25519PublicKey":
67209
+ case "muxedContract":
66901
67210
  return decoded.length === 40;
66902
67211
  // +8 bytes for the ID
66903
67212
  case "signedPayload":
@@ -67227,10 +67536,27 @@ function calculateChecksum(payload) {
67227
67536
  checksum[1] = crc16 >> 8 & 255;
67228
67537
  return checksum;
67229
67538
  }
67539
+ function packMuxedContract(contractId, id) {
67540
+ bigintParts.assertBigIntFits(id, false, 64, "MuxedContract.id");
67541
+ const raw = new Uint8Array(40);
67542
+ raw.set(contractId, 0);
67543
+ new DataView(raw.buffer).setBigUint64(32, id);
67544
+ return raw;
67545
+ }
67546
+ function unpackMuxedContract(raw) {
67547
+ return {
67548
+ contractId: raw.subarray(0, 32),
67549
+ id: new DataView(raw.buffer, raw.byteOffset, raw.byteLength).getBigUint64(
67550
+ 32
67551
+ )
67552
+ };
67553
+ }
67230
67554
 
67231
67555
  exports.StrKey = StrKey;
67232
67556
  exports.decodeCheck = decodeCheck;
67233
67557
  exports.encodeCheck = encodeCheck;
67558
+ exports.packMuxedContract = packMuxedContract;
67559
+ exports.unpackMuxedContract = unpackMuxedContract;
67234
67560
  //# sourceMappingURL=strkey.js.map
67235
67561
 
67236
67562
 
@@ -67246,15 +67572,14 @@ exports.encodeCheck = encodeCheck;
67246
67572
 
67247
67573
 
67248
67574
  var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extras/index.js");
67249
- var base64 = __webpack_require__(/*! ./util/base64.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/base64.js");
67250
67575
  var index = __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
67251
67576
  var hashing = __webpack_require__(/*! ./hashing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/hashing.js");
67252
67577
  var strkey = __webpack_require__(/*! ./strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
67253
67578
  var operation = __webpack_require__(/*! ./operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/operation.js");
67254
67579
  var memo = __webpack_require__(/*! ./memo.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/memo.js");
67255
67580
  var transaction_base = __webpack_require__(/*! ./transaction_base.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_base.js");
67581
+ var util = __webpack_require__(/*! ../xdr/util.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/util.js");
67256
67582
  var decode_encode_muxed_account = __webpack_require__(/*! ./util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
67257
- var transactionEnvelope = __webpack_require__(/*! ../xdr/generated/transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-envelope.js");
67258
67583
  var transactionSignaturePayloadTaggedTransaction = __webpack_require__(/*! ../xdr/generated/transaction-signature-payload-tagged-transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-signature-payload-tagged-transaction.js");
67259
67584
  var transactionSignaturePayload = __webpack_require__(/*! ../xdr/generated/transaction-signature-payload.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-signature-payload.js");
67260
67585
  var transactionV1Envelope = __webpack_require__(/*! ../xdr/generated/transaction-v1-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-v1-envelope.js");
@@ -67262,6 +67587,7 @@ var transactionV0Envelope = __webpack_require__(/*! ../xdr/generated/transaction
67262
67587
  var hashIdPreimageOperationId = __webpack_require__(/*! ../xdr/generated/hash-id-preimage-operation-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/hash-id-preimage-operation-id.js");
67263
67588
  var transaction = __webpack_require__(/*! ../xdr/generated/transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction.js");
67264
67589
  var hash = __webpack_require__(/*! ../xdr/generated/hash.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/hash.js");
67590
+ var transactionEnvelope = __webpack_require__(/*! ../xdr/generated/transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-envelope.js");
67265
67591
  var transactionV0 = __webpack_require__(/*! ../xdr/generated/transaction-v0.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-v0.js");
67266
67592
  var hashIdPreimage = __webpack_require__(/*! ../xdr/generated/hash-id-preimage.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/hash-id-preimage.js");
67267
67593
  var publicKey = __webpack_require__(/*! ../xdr/generated/public-key.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/public-key.js");
@@ -67285,17 +67611,13 @@ class Transaction extends transaction_base.TransactionBase {
67285
67611
  * (e.g. "Public Global Stellar Network ; September 2015")
67286
67612
  */
67287
67613
  constructor(envelope, networkPassphrase) {
67288
- if (typeof envelope === "string") {
67289
- const bytes = base64.base64ToUint8Array(envelope);
67290
- envelope = transactionEnvelope.TransactionEnvelope.fromXdr(bytes);
67291
- }
67292
- const envelopeType = envelope.type;
67293
- if (envelopeType !== "envelopeTypeTxV0" && envelopeType !== "envelopeTypeTx") {
67294
- throw new Error(
67295
- `Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ${envelopeType}.`
67296
- );
67297
- }
67298
- const txEnvelope = envelope.value;
67614
+ const own = transaction_base.ownEnvelope(
67615
+ envelope,
67616
+ (value) => util.isUnionVariant(value, "envelopeTypeTxV0") || util.isUnionVariant(value, "envelopeTypeTx"),
67617
+ "envelopeTypeTxV0 or envelopeTypeTx"
67618
+ );
67619
+ const envelopeType = own.type;
67620
+ const txEnvelope = own.value;
67299
67621
  const tx = txEnvelope.tx;
67300
67622
  const fee = tx.fee.toString();
67301
67623
  const signatures = (txEnvelope.signatures || []).slice();
@@ -67574,8 +67896,40 @@ var keypair = __webpack_require__(/*! ./keypair.js */ "../../node_modules/@stell
67574
67896
  var transaction = __webpack_require__(/*! ../xdr/generated/transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction.js");
67575
67897
  var transactionV0 = __webpack_require__(/*! ../xdr/generated/transaction-v0.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-v0.js");
67576
67898
  var feeBumpTransaction = __webpack_require__(/*! ../xdr/generated/fee-bump-transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/fee-bump-transaction.js");
67899
+ var transactionEnvelope = __webpack_require__(/*! ../xdr/generated/transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-envelope.js");
67577
67900
  var decoratedSignature = __webpack_require__(/*! ../xdr/generated/decorated-signature.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/decorated-signature.js");
67578
67901
 
67902
+ const sdkOwned = /* @__PURE__ */ new WeakSet();
67903
+ function markSdkOwned(envelope) {
67904
+ sdkOwned.add(envelope);
67905
+ return envelope;
67906
+ }
67907
+ function ownEnvelope(envelope, isExpected, expected) {
67908
+ const isString = typeof envelope === "string";
67909
+ const input = isString ? transactionEnvelope.TransactionEnvelope.fromXdr(base64.base64ToUint8Array(envelope)) : envelope;
67910
+ if (!isExpected(input)) {
67911
+ throw new Error(
67912
+ `Invalid TransactionEnvelope: expected an ${expected} but received an ${input.type}.`
67913
+ );
67914
+ }
67915
+ if (isString || sdkOwned.has(input)) {
67916
+ return input;
67917
+ }
67918
+ let own;
67919
+ try {
67920
+ own = transactionEnvelope.TransactionEnvelope.fromXdr(input.toXdr());
67921
+ } catch (error) {
67922
+ throw new Error(
67923
+ `Invalid TransactionEnvelope: ${error instanceof Error ? error.message : String(error)}`
67924
+ );
67925
+ }
67926
+ if (!isExpected(own)) {
67927
+ throw new Error(
67928
+ `TransactionEnvelope changed type in the copy: ${input.type} became ${own.type}.`
67929
+ );
67930
+ }
67931
+ return own;
67932
+ }
67579
67933
  class TransactionBase {
67580
67934
  _tx;
67581
67935
  _signatures;
@@ -67780,6 +68134,8 @@ class TransactionBase {
67780
68134
  }
67781
68135
 
67782
68136
  exports.TransactionBase = TransactionBase;
68137
+ exports.markSdkOwned = markSdkOwned;
68138
+ exports.ownEnvelope = ownEnvelope;
67783
68139
  //# sourceMappingURL=transaction_base.js.map
67784
68140
 
67785
68141
 
@@ -67801,6 +68157,7 @@ var muxed_account = __webpack_require__(/*! ./muxed_account.js */ "../../node_mo
67801
68157
  var decode_encode_muxed_account = __webpack_require__(/*! ./util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
67802
68158
  var transaction = __webpack_require__(/*! ./transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction.js");
67803
68159
  var fee_bump_transaction = __webpack_require__(/*! ./fee_bump_transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/fee_bump_transaction.js");
68160
+ var transaction_base = __webpack_require__(/*! ./transaction_base.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_base.js");
67804
68161
  var sorobandata_builder = __webpack_require__(/*! ./sorobandata_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/sorobandata_builder.js");
67805
68162
  var strkey = __webpack_require__(/*! ./strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
67806
68163
  var signerkey = __webpack_require__(/*! ./signerkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signerkey.js");
@@ -67839,6 +68196,19 @@ var feeBumpTransaction = __webpack_require__(/*! ../xdr/generated/fee-bump-trans
67839
68196
  var feeBumpTransactionEnvelope = __webpack_require__(/*! ../xdr/generated/fee-bump-transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/fee-bump-transaction-envelope.js");
67840
68197
 
67841
68198
  const UINT32_MAX = 4294967295;
68199
+ const MAX_RESOURCE_FEE = 2n ** 50n;
68200
+ function checkResourceFee(resourceFee) {
68201
+ if (resourceFee < 0n || resourceFee > MAX_RESOURCE_FEE) {
68202
+ throw new Error(
68203
+ `Invalid resourceFee ${resourceFee}: must be between 0 and ${MAX_RESOURCE_FEE}`
68204
+ );
68205
+ }
68206
+ }
68207
+ const SOROBAN_OPERATION_TYPES = /* @__PURE__ */ new Set([
68208
+ "invokeHostFunction",
68209
+ "extendFootprintTtl",
68210
+ "restoreFootprint"
68211
+ ]);
67842
68212
  const BASE_FEE = "100";
67843
68213
  const TimeoutInfinite = 0;
67844
68214
  class TransactionBuilder {
@@ -67930,6 +68300,8 @@ class TransactionBuilder {
67930
68300
  * as needed, instead..
67931
68301
  *
67932
68302
  * **TODO:** This cannot clone {@link FeeBumpTransaction}s, yet.
68303
+ *
68304
+ * @throws If the transaction's `resourceFee` is below 0 or above 2^50.
67933
68305
  */
67934
68306
  static cloneFrom(tx, opts = {}) {
67935
68307
  if (!(tx instanceof transaction.Transaction)) {
@@ -67956,15 +68328,18 @@ class TransactionBuilder {
67956
68328
  sorobanData = ext.type === "sorobanData" ? ext.value : void 0;
67957
68329
  }
67958
68330
  let totalFee = parseInt(tx.fee, 10);
68331
+ let zeroInclusionFee = false;
67959
68332
  if (sorobanData) {
67960
- const resourceFee = Number(sorobanData.resourceFee.toString());
68333
+ checkResourceFee(sorobanData.resourceFee);
68334
+ const resourceFee = Number(sorobanData.resourceFee);
68335
+ zeroInclusionFee = totalFee === resourceFee;
67961
68336
  if (totalFee - resourceFee > 0) {
67962
68337
  totalFee -= resourceFee;
67963
68338
  }
67964
68339
  }
67965
68340
  const unscaledFee = Math.floor(totalFee / tx.operations.length);
67966
68341
  const builderOpts = {
67967
- fee: (unscaledFee || BASE_FEE).toString(),
68342
+ fee: (zeroInclusionFee ? 0 : unscaledFee || BASE_FEE).toString(),
67968
68343
  memo: tx.memo,
67969
68344
  networkPassphrase: tx.networkPassphrase
67970
68345
  };
@@ -68061,7 +68436,8 @@ class TransactionBuilder {
68061
68436
  *
68062
68437
  * @param timeoutSeconds - Number of seconds the transaction is good.
68063
68438
  * Can't be negative. If the value is {@link TimeoutInfinite}, the
68064
- * transaction is good indefinitely.
68439
+ * transaction is good indefinitely. An existing `minTime` is kept in
68440
+ * both cases, and a timeout that ends before it throws.
68065
68441
  *
68066
68442
  * @see {@link TimeoutInfinite}
68067
68443
  * @see https://developers.stellar.org/docs/tutorials/handling-errors/
@@ -68075,21 +68451,18 @@ class TransactionBuilder {
68075
68451
  if (timeoutSeconds < 0) {
68076
68452
  throw new Error("timeout cannot be negative");
68077
68453
  }
68454
+ const minTime = this.timebounds?.minTime ?? 0;
68078
68455
  if (timeoutSeconds > 0) {
68079
68456
  const timeoutTimestamp = Math.floor(Date.now() / 1e3) + timeoutSeconds;
68080
- if (this.timebounds === null) {
68081
- this.timebounds = { minTime: 0, maxTime: timeoutTimestamp };
68082
- } else {
68083
- this.timebounds = {
68084
- minTime: this.timebounds.minTime ?? 0,
68085
- maxTime: timeoutTimestamp
68086
- };
68457
+ const minSeconds = toEpochSeconds(minTime) ?? 0;
68458
+ if (minSeconds > timeoutTimestamp) {
68459
+ throw new Error(
68460
+ `timeout ends before min_time (${timeoutTimestamp} < ${minSeconds})`
68461
+ );
68087
68462
  }
68463
+ this.timebounds = { minTime, maxTime: timeoutTimestamp };
68088
68464
  } else {
68089
- this.timebounds = {
68090
- minTime: 0,
68091
- maxTime: 0
68092
- };
68465
+ this.timebounds = { minTime, maxTime: 0 };
68093
68466
  }
68094
68467
  return this;
68095
68468
  }
@@ -68297,12 +68670,15 @@ class TransactionBuilder {
68297
68670
  * This method removes the need for simulation by handling the creation of the
68298
68671
  * appropriate authorization entries and ledger footprint for the transfer operation.
68299
68672
  *
68300
- * @param destination - the address of the recipient of the SAC transfer (should be a valid Stellar address or contract ID)
68673
+ * @param destination - the address of the recipient of the SAC transfer (a G, M, C or W address)
68301
68674
  * @param asset - the SAC asset to be transferred
68302
68675
  * @param amount - the amount of tokens to be transferred in 7 decimals. IE 1 token with 7 decimals of precision would be represented as "1_0000000"
68303
68676
  * @param sorobanFees - optional Soroban fees for the transaction to override the default fees used
68677
+ *
68678
+ * @throws If the builder's source is a muxed (`M...`) account.
68304
68679
  */
68305
68680
  addSacTransferOperation(destination, asset, amount, sorobanFees) {
68681
+ this.assertSorobanSourceNotMuxed();
68306
68682
  if (BigInt(amount) <= 0n) {
68307
68683
  throw new Error("Amount must be a positive integer");
68308
68684
  } else if (BigInt(amount) > index.Int64.MAX_VALUE) {
@@ -68332,7 +68708,7 @@ class TransactionBuilder {
68332
68708
  );
68333
68709
  }
68334
68710
  }
68335
- const isDestinationContract = strkey.StrKey.isValidContract(destination);
68711
+ const isDestinationContract = strkey.StrKey.isValidContract(destination) || strkey.StrKey.isValidMuxedContract(destination);
68336
68712
  if (!isDestinationContract) {
68337
68713
  if (!strkey.StrKey.isValidEd25519PublicKey(destination) && !strkey.StrKey.isValidMed25519PublicKey(destination)) {
68338
68714
  throw new Error(
@@ -68340,8 +68716,9 @@ class TransactionBuilder {
68340
68716
  );
68341
68717
  }
68342
68718
  }
68343
- const destinationBaseAddress = isDestinationContract ? destination : decode_encode_muxed_account.extractBaseAddress(destination);
68344
- if (destinationBaseAddress === decode_encode_muxed_account.extractBaseAddress(this.source.accountId())) {
68719
+ const destinationBaseAddress = decode_encode_muxed_account.extractBaseAddress(destination);
68720
+ const source = this.source.accountId();
68721
+ if (destinationBaseAddress === source) {
68345
68722
  throw new Error("Destination cannot be the same as the source account.");
68346
68723
  }
68347
68724
  if (this.networkPassphrase === null) {
@@ -68351,8 +68728,6 @@ class TransactionBuilder {
68351
68728
  }
68352
68729
  const contractId = asset.contractId(this.networkPassphrase);
68353
68730
  const functionName = "transfer";
68354
- const source = this.source.accountId();
68355
- const sourceBaseAddress = decode_encode_muxed_account.extractBaseAddress(source);
68356
68731
  const args = [
68357
68732
  scval.nativeToScVal(source, { type: "address" }),
68358
68733
  scval.nativeToScVal(destination, { type: "address" }),
@@ -68391,7 +68766,7 @@ class TransactionBuilder {
68391
68766
  contract: address.Address.fromString(contractId).toScAddress(),
68392
68767
  key: scVal.ScVal.scvVec([
68393
68768
  scval.nativeToScVal("Balance", { type: "symbol" }),
68394
- scval.nativeToScVal(destination, { type: "address" })
68769
+ scval.nativeToScVal(destinationBaseAddress, { type: "address" })
68395
68770
  ]),
68396
68771
  durability: contractDataDurability.ContractDataDurability.persistent
68397
68772
  })
@@ -68436,15 +68811,15 @@ class TransactionBuilder {
68436
68811
  footprint.readWrite.push(
68437
68812
  ledgerKey.LedgerKey.account(
68438
68813
  new ledgerKeyAccount.LedgerKeyAccount({
68439
- accountId: keypair.Keypair.fromPublicKey(sourceBaseAddress).xdrPublicKey()
68814
+ accountId: keypair.Keypair.fromPublicKey(source).xdrPublicKey()
68440
68815
  })
68441
68816
  )
68442
68817
  );
68443
- } else if (asset.getIssuer() !== sourceBaseAddress) {
68818
+ } else if (asset.getIssuer() !== source) {
68444
68819
  footprint.readWrite.push(
68445
68820
  ledgerKey.LedgerKey.trustline(
68446
68821
  new ledgerKeyTrustLine.LedgerKeyTrustLine({
68447
- accountId: keypair.Keypair.fromPublicKey(sourceBaseAddress).xdrPublicKey(),
68822
+ accountId: keypair.Keypair.fromPublicKey(source).xdrPublicKey(),
68448
68823
  asset: asset.toTrustLineXdrObject()
68449
68824
  })
68450
68825
  )
@@ -68477,11 +68852,42 @@ class TransactionBuilder {
68477
68852
  this.setSorobanData(sorobanData);
68478
68853
  return this.addOperation(operation$1);
68479
68854
  }
68855
+ // Core rejects any Soroban transaction with a muxed source account.
68856
+ assertSorobanSourceNotMuxed() {
68857
+ if (strkey.StrKey.isValidMed25519PublicKey(this.source.accountId())) {
68858
+ throw new Error(
68859
+ "Soroban transactions cannot use a muxed source account; use the base account"
68860
+ );
68861
+ }
68862
+ }
68863
+ // Core also rejects a muxed operation source and a memo.
68864
+ assertValidSoroban() {
68865
+ this.assertSorobanSourceNotMuxed();
68866
+ if (this.operations.some(
68867
+ (op) => op.sourceAccount?.type === "keyTypeMuxedEd25519"
68868
+ )) {
68869
+ throw new Error(
68870
+ "Soroban operations cannot use a muxed source account; use the base account"
68871
+ );
68872
+ }
68873
+ if (this.memo.type !== "none") {
68874
+ throw new Error("Soroban transactions cannot have a memo");
68875
+ }
68876
+ }
68480
68877
  /**
68481
68878
  * Builds the transaction and increments the source account's sequence
68482
68879
  * number by 1.
68880
+ *
68881
+ * @throws If a Soroban transaction has a muxed (`M...`) source account,
68882
+ * on the transaction or an operation, or has a memo. Also if the Soroban
68883
+ * data's `resourceFee` is below 0, or if the total fee is above the uint32
68884
+ * maximum.
68483
68885
  */
68484
68886
  build() {
68887
+ const isSoroban = this.sorobanData !== null || this.operations.some((op) => SOROBAN_OPERATION_TYPES.has(op.body.type));
68888
+ if (isSoroban) {
68889
+ this.assertValidSoroban();
68890
+ }
68485
68891
  const sequenceNumber = new bignumber.default(this.source.sequenceNumber()).plus(1);
68486
68892
  const fee = new bignumber.default(this.baseFee).times(this.operations.length).toNumber();
68487
68893
  if (fee > UINT32_MAX) {
@@ -68548,6 +68954,7 @@ class TransactionBuilder {
68548
68954
  `Total fee (baseFee * operations + resourceFee) exceeds the maximum uint32 value (${UINT32_MAX}). Got ${attrs.fee}.`
68549
68955
  );
68550
68956
  }
68957
+ checkResourceFee(this.sorobanData.resourceFee);
68551
68958
  } else {
68552
68959
  attrs.ext = transactionExt.TransactionExt.v0();
68553
68960
  }
@@ -68593,6 +69000,8 @@ class TransactionBuilder {
68593
69000
  *
68594
69001
  * Your fee-bump amount should be `>= 10x` the original fee.
68595
69002
  * @see https://developers.stellar.org/docs/glossary/fee-bumps/#replace-by-fee
69003
+ *
69004
+ * @throws If the inner transaction's `resourceFee` is below 0 or above 2^50.
68596
69005
  */
68597
69006
  static buildFeeBumpTransaction(feeSource, baseFee, innerTx, networkPassphrase) {
68598
69007
  const innerOps = innerTx.operations.length;
@@ -68603,7 +69012,10 @@ class TransactionBuilder {
68603
69012
  case "envelopeTypeTx": {
68604
69013
  const ext = env.value.tx.ext;
68605
69014
  const sorobanData = ext.type === "sorobanData" ? ext.value : void 0;
68606
- resourceFee = new bignumber.default(sorobanData?.resourceFee.toString() ?? 0);
69015
+ if (sorobanData) {
69016
+ checkResourceFee(sorobanData.resourceFee);
69017
+ resourceFee = new bignumber.default(sorobanData.resourceFee.toString());
69018
+ }
68607
69019
  break;
68608
69020
  }
68609
69021
  }
@@ -68680,7 +69092,7 @@ class TransactionBuilder {
68680
69092
  */
68681
69093
  static fromXdr(envelope, networkPassphrase) {
68682
69094
  if (typeof envelope === "string") {
68683
- envelope = transactionEnvelope.TransactionEnvelope.fromXdr(envelope, "base64");
69095
+ envelope = transaction_base.markSdkOwned(transactionEnvelope.TransactionEnvelope.fromXdr(envelope, "base64"));
68684
69096
  }
68685
69097
  if (envelope.type === "envelopeTypeTxFeeBump") {
68686
69098
  return new fee_bump_transaction.FeeBumpTransaction(envelope, networkPassphrase);
@@ -68925,6 +69337,28 @@ var strkey = __webpack_require__(/*! ../strkey.js */ "../../node_modules/@stella
68925
69337
  var muxedAccount = __webpack_require__(/*! ../../xdr/generated/muxed-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account.js");
68926
69338
  var muxedAccountMed25519 = __webpack_require__(/*! ../../xdr/generated/muxed-account-med25519.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account-med25519.js");
68927
69339
 
69340
+ const MAX_UINT64 = BigInt("18446744073709551615");
69341
+ function canonicalUint64Id(id) {
69342
+ return parseUint64Id(id).toString();
69343
+ }
69344
+ function parseUint64Id(id) {
69345
+ if (typeof id !== "string") {
69346
+ throw new Error("id should be a string representing a number (uint64)");
69347
+ }
69348
+ if (id.length > 22) {
69349
+ throw new Error("id must have at most 22 digits");
69350
+ }
69351
+ if (!/^\d+$/.test(id)) {
69352
+ throw new Error(`id is not a valid uint64 string: ${id}`);
69353
+ }
69354
+ const value = BigInt(id);
69355
+ if (value > MAX_UINT64) {
69356
+ throw new Error(
69357
+ `id value out of range for uint64 [0, ${MAX_UINT64}]: ${id}`
69358
+ );
69359
+ }
69360
+ return value;
69361
+ }
68928
69362
  function decodeAddressToMuxedAccount(address) {
68929
69363
  if (strkey.StrKey.isValidMed25519PublicKey(address)) {
68930
69364
  return _decodeAddressFullyToMuxedAccount(address);
@@ -68941,22 +69375,34 @@ function encodeMuxedAccount(address, id) {
68941
69375
  if (!strkey.StrKey.isValidEd25519PublicKey(address)) {
68942
69376
  throw new Error("address should be a Stellar account ID (G...)");
68943
69377
  }
68944
- if (typeof id !== "string") {
68945
- throw new Error("id should be a string representing a number (uint64)");
68946
- }
68947
69378
  return muxedAccount.MuxedAccount.keyTypeMuxedEd25519(
68948
69379
  new muxedAccountMed25519.MuxedAccountMed25519({
68949
- id: index.Uint64.fromString(id),
69380
+ id: index.Uint64.fromString(canonicalUint64Id(id)),
68950
69381
  ed25519: strkey.StrKey.decodeEd25519PublicKey(address)
68951
69382
  })
68952
69383
  );
68953
69384
  }
69385
+ function encodeMuxedContractAddress(contractId, id) {
69386
+ if (!strkey.StrKey.isValidContract(contractId)) {
69387
+ throw new Error("contractId should be a contract address (C...)");
69388
+ }
69389
+ return strkey.StrKey.encodeMuxedContract(
69390
+ strkey.packMuxedContract(strkey.StrKey.decodeContract(contractId), parseUint64Id(id))
69391
+ );
69392
+ }
68954
69393
  function extractBaseAddress(address) {
68955
- if (strkey.StrKey.isValidEd25519PublicKey(address)) {
69394
+ if (strkey.StrKey.isValidEd25519PublicKey(address) || strkey.StrKey.isValidContract(address)) {
68956
69395
  return address;
68957
69396
  }
69397
+ if (strkey.StrKey.isValidMuxedContract(address)) {
69398
+ return strkey.StrKey.encodeContract(
69399
+ strkey.StrKey.decodeMuxedContract(address).subarray(0, 32)
69400
+ );
69401
+ }
68958
69402
  if (!strkey.StrKey.isValidMed25519PublicKey(address)) {
68959
- throw new TypeError(`expected muxed account (M...), got ${address}`);
69403
+ throw new TypeError(
69404
+ `expected an account or contract address (G..., M..., C... or W...), got ${address}`
69405
+ );
68960
69406
  }
68961
69407
  const muxedAccount = decodeAddressToMuxedAccount(address);
68962
69408
  if (muxedAccount.type !== "keyTypeMuxedEd25519") {
@@ -68986,9 +69432,11 @@ function _encodeMuxedAccountFullyToAddress(muxedAccount) {
68986
69432
  );
68987
69433
  }
68988
69434
 
69435
+ exports.canonicalUint64Id = canonicalUint64Id;
68989
69436
  exports.decodeAddressToMuxedAccount = decodeAddressToMuxedAccount;
68990
69437
  exports.encodeMuxedAccount = encodeMuxedAccount;
68991
69438
  exports.encodeMuxedAccountToAddress = encodeMuxedAccountToAddress;
69439
+ exports.encodeMuxedContractAddress = encodeMuxedContractAddress;
68992
69440
  exports.extractBaseAddress = extractBaseAddress;
68993
69441
  //# sourceMappingURL=decode_encode_muxed_account.js.map
68994
69442
 
@@ -69041,6 +69489,41 @@ function toXdrAmount(value) {
69041
69489
  const amount = new bignumber.default(value).times(ONE);
69042
69490
  return index.Int64.fromString(amount.toString());
69043
69491
  }
69492
+ function toXdrOfferId(offerId) {
69493
+ if (offerId === void 0) {
69494
+ return index.Int64.fromString("0");
69495
+ }
69496
+ let value;
69497
+ if (typeof offerId === "number") {
69498
+ if (!Number.isSafeInteger(offerId) || offerId < 0) {
69499
+ throw new Error(
69500
+ "offerId must be a non-negative safe integer; pass a larger ID as a bigint or a decimal string"
69501
+ );
69502
+ }
69503
+ value = BigInt(offerId);
69504
+ } else if (typeof offerId === "bigint") {
69505
+ if (offerId < 0n) {
69506
+ throw new Error("offerId must not be negative");
69507
+ }
69508
+ value = offerId;
69509
+ } else if (typeof offerId === "string") {
69510
+ if (offerId.length > 22) {
69511
+ throw new Error("offerId must have at most 22 digits");
69512
+ }
69513
+ if (!/^\d+$/.test(offerId)) {
69514
+ throw new Error("offerId must be a string of decimal digits");
69515
+ }
69516
+ value = BigInt(offerId);
69517
+ } else {
69518
+ throw new Error(
69519
+ "offerId must be a number, a bigint, or a string of decimal digits"
69520
+ );
69521
+ }
69522
+ if (value > index.Int64.MAX_VALUE) {
69523
+ throw new Error(`offerId must not exceed ${index.Int64.MAX_VALUE}`);
69524
+ }
69525
+ return index.Int64.fromString(value.toString());
69526
+ }
69044
69527
  function fromXdrAmount(value) {
69045
69528
  return new bignumber.default(value.toString()).div(ONE).toFixed(7);
69046
69529
  }
@@ -69063,7 +69546,7 @@ function toXdrPrice(price$1) {
69063
69546
  d: parseInt(String(approx[1]), 10)
69064
69547
  });
69065
69548
  }
69066
- if (xdrObject.n < 0 || xdrObject.d <= 0) {
69549
+ if (xdrObject.n <= 0 || xdrObject.d <= 0) {
69067
69550
  throw new Error("price must be positive");
69068
69551
  }
69069
69552
  return xdrObject;
@@ -69102,6 +69585,7 @@ exports.fromXdrPrice = fromXdrPrice;
69102
69585
  exports.isValidAmount = isValidAmount;
69103
69586
  exports.setSourceAccount = setSourceAccount;
69104
69587
  exports.toXdrAmount = toXdrAmount;
69588
+ exports.toXdrOfferId = toXdrOfferId;
69105
69589
  exports.toXdrPrice = toXdrPrice;
69106
69590
  //# sourceMappingURL=operations.js.map
69107
69591
 
@@ -69341,8 +69825,7 @@ ${eventMethods}
69341
69825
  (param) => param.location.value === scSpecEventParamLocationV0.ScSpecEventParamLocationV0.scSpecEventParamLocationTopicList.value
69342
69826
  );
69343
69827
  const fields = topicParams.map((param) => {
69344
- const rawParamName = param.name.toString();
69345
- const fieldName = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(rawParamName) ? rawParamName : `"${utils.escapeStringLiteral(rawParamName)}"`;
69828
+ const fieldName = utils.propertyKey(param.name.toString());
69346
69829
  const fieldType = utils.parseTypeFromTypeDef(param.type, true);
69347
69830
  return `${fieldName}?: ${fieldType}`;
69348
69831
  }).join("; ");
@@ -69366,13 +69849,10 @@ ${eventMethods}
69366
69849
  */
69367
69850
  generateInterfaceMethod(func) {
69368
69851
  const name = utils.sanitizeIdentifier(func.name.toString());
69369
- const inputs = func.inputs.map((input) => ({
69370
- name: utils.sanitizeIdentifier(input.name.toString()),
69371
- type: utils.parseTypeFromTypeDef(input.type, true)
69372
- }));
69852
+ const inputs = func.inputs.map(ClientGenerator.methodInput);
69373
69853
  const outputType = func.outputs.length > 0 ? utils.parseTypeFromTypeDef(func.outputs[0]) : "void";
69374
69854
  const docs = utils.formatJSDocComment(func.doc.toString(), 2);
69375
- const params = this.formatMethodParameters(inputs);
69855
+ const params = ClientGenerator.formatParameters(inputs);
69376
69856
  return `${docs} ${name}(${params}): Promise<AssembledTransaction<${outputType}>>;`;
69377
69857
  }
69378
69858
  generateFromJsonMethod(func) {
@@ -69384,50 +69864,44 @@ ${eventMethods}
69384
69864
  * Generate deploy method
69385
69865
  */
69386
69866
  generateDeployMethod(constructorFunc) {
69387
- if (!constructorFunc) {
69388
- const params2 = this.formatConstructorParameters([]);
69389
- return ` static deploy<T = Client>(${params2}): Promise<AssembledTransaction<T>> {
69390
- return ContractClient.deploy(null, options);
69391
- }`;
69392
- }
69393
- const inputs = constructorFunc.inputs.map((input) => ({
69394
- name: utils.sanitizeIdentifier(input.name.toString()),
69395
- type: utils.parseTypeFromTypeDef(input.type, true)
69396
- }));
69397
- const params = this.formatConstructorParameters(inputs);
69398
- const inputsDestructure = inputs.length > 0 ? `{ ${inputs.map((i) => i.name).join(", ")} }, ` : "";
69867
+ const inputs = constructorFunc?.inputs.map(ClientGenerator.methodInput) ?? [];
69868
+ const params = ClientGenerator.formatParameters(
69869
+ inputs,
69870
+ ClientGenerator.DEPLOY_OPTIONS_PARAM
69871
+ );
69872
+ const inputsArg = inputs.length > 0 ? "args" : "null";
69399
69873
  return ` static deploy<T = Client>(${params}): Promise<AssembledTransaction<T>> {
69400
- return ContractClient.deploy(${inputsDestructure}options);
69874
+ return ContractClient.deploy(${inputsArg}, options);
69401
69875
  }`;
69402
69876
  }
69403
69877
  /**
69404
- * Format method parameters
69878
+ * Describe one function input for the generated signature. `key` is the
69879
+ * raw spec name as a property key, since the runtime reads arguments by
69880
+ * that name.
69405
69881
  */
69406
- formatMethodParameters(inputs) {
69407
- const params = [];
69408
- if (inputs.length > 0) {
69409
- const inputsParam = `{ ${inputs.map((i) => `${i.name}: ${i.type}`).join("; ")} }`;
69410
- params.push(
69411
- `{ ${inputs.map((i) => i.name).join(", ")} }: ${inputsParam}`
69412
- );
69413
- }
69414
- params.push("options?: MethodOptions");
69415
- return params.join(", ");
69882
+ static methodInput(input) {
69883
+ return {
69884
+ key: utils.propertyKey(input.name.toString()),
69885
+ type: utils.parseTypeFromTypeDef(input.type, true)
69886
+ };
69887
+ }
69888
+ static inputsType(inputs) {
69889
+ return `{ ${inputs.map((i) => `${i.key}: ${i.type}`).join("; ")} }`;
69416
69890
  }
69891
+ static DEPLOY_OPTIONS_PARAM = `options: MethodOptions & Omit<ContractClientOptions, 'contractId'> & { salt?: Uint8Array; address?: string; } & ({ wasmHash: Uint8Array | string; format?: "hex" | "base64"; externalRef?: never; } | { externalRef: ExternalExecutableRef; wasmHash?: never; format?: never; })`;
69417
69892
  /**
69418
- * Format constructor parameters
69893
+ * Format the parameter list for a generated method or `deploy`. The inputs
69894
+ * are always a single `args` object, never destructured: a reserved word,
69895
+ * a strict-mode restricted name or a quoted key can't be a binding, and an
69896
+ * alias in a bodiless interface method is an error (TS2842), so one shape
69897
+ * for every method keeps the output uniform.
69419
69898
  */
69420
- formatConstructorParameters(inputs) {
69899
+ static formatParameters(inputs, optionsParam = "options?: MethodOptions") {
69421
69900
  const params = [];
69422
69901
  if (inputs.length > 0) {
69423
- const inputsParam = `{ ${inputs.map((i) => `${i.name}: ${i.type}`).join("; ")} }`;
69424
- params.push(
69425
- `{ ${inputs.map((i) => i.name).join(", ")} }: ${inputsParam}`
69426
- );
69902
+ params.push(`args: ${ClientGenerator.inputsType(inputs)}`);
69427
69903
  }
69428
- params.push(
69429
- `options: MethodOptions & Omit<ContractClientOptions, 'contractId'> & { salt?: Uint8Array; address?: string; } & ({ wasmHash: Uint8Array | string; format?: "hex" | "base64"; externalRef?: never; } | { externalRef: ExternalExecutableRef; wasmHash?: never; format?: never; })`
69430
- );
69904
+ params.push(optionsParam);
69431
69905
  return params.join(", ");
69432
69906
  }
69433
69907
  }
@@ -69475,7 +69949,7 @@ class ConfigGenerator {
69475
69949
  build: "tsc"
69476
69950
  },
69477
69951
  dependencies: {
69478
- "@stellar/stellar-sdk": `^${"17.0.1"}`,
69952
+ "@stellar/stellar-sdk": `^${"17.4.0"}`,
69479
69953
  buffer: "6.0.3"
69480
69954
  },
69481
69955
  devDependencies: {
@@ -69603,10 +70077,10 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
69603
70077
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
69604
70078
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
69605
70079
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
70080
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
70081
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
69606
70082
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
69607
70083
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
69608
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
69609
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
69610
70084
  __webpack_require__(/*! ../rpc/api.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/rpc/api.js");
69611
70085
  __webpack_require__(/*! ../http-client/fetch-client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/http-client/fetch-client.js");
69612
70086
  var spec = __webpack_require__(/*! ../contract/spec.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/spec.js");
@@ -69655,6 +70129,7 @@ class BindingGenerator {
69655
70129
  * @param wasmBytes - The raw WASM binary as a Uint8Array
69656
70130
  * @returns A Promise resolving to a new BindingGenerator instance
69657
70131
  * @throws If the WASM file doesn't contain a valid contract spec
70132
+ * @throws If the WASM file has more than one `contractspecv0` section
69658
70133
  *
69659
70134
  * @example
69660
70135
  * ```ts
@@ -69959,7 +70434,7 @@ class TypeGenerator {
69959
70434
  0
69960
70435
  );
69961
70436
  const fields = struct.fields.map((field) => {
69962
- const fieldName = utils.sanitizeIdentifier(field.name.toString());
70437
+ const fieldName = utils.propertyKey(field.name.toString());
69963
70438
  const fieldType = utils.parseTypeFromTypeDef(field.type);
69964
70439
  const fieldDoc = utils.formatJSDocComment(field.doc.toString(), 2);
69965
70440
  return `${fieldDoc} ${fieldName}: ${fieldType};`;
@@ -70154,10 +70629,9 @@ Note: renamed from "${preferred}" to avoid a collision with another generated na
70154
70629
  (event.doc.toString() || `Event: ${rawName}`) + renameNote,
70155
70630
  0
70156
70631
  );
70157
- const fieldKey = (rawParamName) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(rawParamName) ? rawParamName : `"${utils.escapeStringLiteral(rawParamName)}"`;
70158
70632
  const dataIsMapFormat = event.dataFormat.value === scSpecEventDataFormat.ScSpecEventDataFormat.scSpecEventDataFormatMap.value;
70159
70633
  const dataFields = event.params.map((param) => {
70160
- const fieldName = fieldKey(param.name.toString());
70634
+ const fieldName = utils.propertyKey(param.name.toString());
70161
70635
  const fieldType = utils.parseTypeFromTypeDef(param.type);
70162
70636
  const fieldDoc = utils.formatJSDocComment(param.doc.toString(), 4);
70163
70637
  const optional = dataIsMapFormat && param.location.value === scSpecEventParamLocationV0.ScSpecEventParamLocationV0.scSpecEventParamLocationData.value;
@@ -70285,6 +70759,12 @@ function sanitizeIdentifier(identifier) {
70285
70759
  function escapeStringLiteral(str) {
70286
70760
  return str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
70287
70761
  }
70762
+ function propertyKey(rawName) {
70763
+ return isIdentifier(rawName) ? rawName : `"${escapeStringLiteral(rawName)}"`;
70764
+ }
70765
+ function isIdentifier(name) {
70766
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name);
70767
+ }
70288
70768
  function parseTypeFromTypeDef(typeDef, isFunctionInput = false) {
70289
70769
  switch (typeDef.type) {
70290
70770
  case "scSpecTypeVal":
@@ -70511,6 +70991,7 @@ exports.generateTypeImports = generateTypeImports;
70511
70991
  exports.isNameReserved = isNameReserved;
70512
70992
  exports.isTupleStruct = isTupleStruct;
70513
70993
  exports.parseTypeFromTypeDef = parseTypeFromTypeDef;
70994
+ exports.propertyKey = propertyKey;
70514
70995
  exports.sanitizeIdentifier = sanitizeIdentifier;
70515
70996
  exports.toCamelCase = toCamelCase;
70516
70997
  exports.toPascalCase = toPascalCase;
@@ -70534,10 +71015,10 @@ __webpack_require__(/*! @noble/hashes/sha2.js */ "../../node_modules/@noble/hash
70534
71015
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
70535
71016
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
70536
71017
  var strkey = __webpack_require__(/*! ../base/strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
71018
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
70537
71019
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
70538
71020
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
70539
71021
  var address = __webpack_require__(/*! ../base/address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
70540
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
70541
71022
  var contract = __webpack_require__(/*! ../base/contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/contract.js");
70542
71023
  __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
70543
71024
  var ledgerKey = __webpack_require__(/*! ../xdr/generated/ledger-key.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-key.js");
@@ -70735,14 +71216,14 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
70735
71216
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
70736
71217
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
70737
71218
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
71219
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
70738
71220
  var base64 = __webpack_require__(/*! ../base/util/base64.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/base64.js");
70739
71221
  var operation = __webpack_require__(/*! ../base/operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/operation.js");
70740
71222
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
71223
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
70741
71224
  var transaction_builder = __webpack_require__(/*! ../base/transaction_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_builder.js");
70742
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
70743
71225
  var contract = __webpack_require__(/*! ../base/contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/contract.js");
70744
71226
  var address = __webpack_require__(/*! ../base/address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
70745
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
70746
71227
  var sorobandata_builder = __webpack_require__(/*! ../base/sorobandata_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/sorobandata_builder.js");
70747
71228
  var auth = __webpack_require__(/*! ../base/auth.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/auth.js");
70748
71229
  var signer = __webpack_require__(/*! ./signer.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/signer.js");
@@ -70757,7 +71238,6 @@ var errors = __webpack_require__(/*! ./errors.js */ "../../node_modules/@stellar
70757
71238
  var scVal = __webpack_require__(/*! ../xdr/generated/sc-val.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val.js");
70758
71239
  var sorobanAuthorizationEntry = __webpack_require__(/*! ../xdr/generated/soroban-authorization-entry.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/soroban-authorization-entry.js");
70759
71240
  var sorobanTransactionData = __webpack_require__(/*! ../xdr/generated/soroban-transaction-data.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/soroban-transaction-data.js");
70760
- var transactionEnvelope = __webpack_require__(/*! ../xdr/generated/transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-envelope.js");
70761
71241
  var sorobanCredentials = __webpack_require__(/*! ../xdr/generated/soroban-credentials.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/soroban-credentials.js");
70762
71242
 
70763
71243
  class AssembledTransaction {
@@ -70778,7 +71258,7 @@ class AssembledTransaction {
70778
71258
  * { args: 'for', my: 'method', ... },
70779
71259
  * { simulate: false }
70780
71260
  * );
70781
- * tx.raw.addMemo(Memo.text('Nice memo, friend!'))
71261
+ * tx.raw.setLedgerbounds(0, latestLedger + 100)
70782
71262
  * await tx.simulate();
70783
71263
  * ```
70784
71264
  */
@@ -70974,9 +71454,8 @@ class AssembledTransaction {
70974
71454
  * Deserialize the AssembledTransaction from a base64-encoded XDR string.
70975
71455
  */
70976
71456
  static fromXdr(options, encodedXDR, spec) {
70977
- const envelope = transactionEnvelope.TransactionEnvelope.fromXdr(encodedXDR, "base64");
70978
71457
  const built = transaction_builder.TransactionBuilder.fromXdr(
70979
- envelope,
71458
+ encodedXDR,
70980
71459
  options.networkPassphrase
70981
71460
  );
70982
71461
  const invokeContractArgs = AssembledTransaction.validateInvokeContractOp(
@@ -71084,10 +71563,10 @@ class AssembledTransaction {
71084
71563
  if (options.simulate) await tx.simulate();
71085
71564
  return tx;
71086
71565
  }
71087
- static async buildFootprintRestoreTransaction(options, sorobanData, account, fee) {
71566
+ static async buildFootprintRestoreTransaction(options, sorobanData, account) {
71088
71567
  const tx = new AssembledTransaction(options);
71089
71568
  tx.raw = new transaction_builder.TransactionBuilder(account, {
71090
- fee,
71569
+ fee: options.fee ?? transaction_builder.BASE_FEE,
71091
71570
  networkPassphrase: options.networkPassphrase
71092
71571
  }).setSorobanData(
71093
71572
  sorobanData instanceof sorobandata_builder.SorobanDataBuilder ? sorobanData.build() : sorobanData
@@ -71208,7 +71687,8 @@ You can set \`restore\` to true in the method options in order to automatically
71208
71687
  */
71209
71688
  sign = async ({
71210
71689
  force = false,
71211
- signTransaction = this.options.signTransaction
71690
+ signTransaction = this.options.signTransaction,
71691
+ ignoreContractDelegates = false
71212
71692
  } = {}) => {
71213
71693
  if (!this.built) {
71214
71694
  throw new Error("Transaction has not yet been simulated");
@@ -71232,9 +71712,9 @@ You can set \`restore\` to true in the method options in order to automatically
71232
71712
  "This transaction was constructed using a default account. Provide a valid publicKey in the AssembledTransactionOptions."
71233
71713
  );
71234
71714
  }
71235
- const sigsNeeded = this.needsNonInvokerSigningBy().filter(
71236
- (id) => !id.startsWith("C")
71237
- );
71715
+ const sigsNeeded = this.unsignedAddresses({
71716
+ includeDelegates: !ignoreContractDelegates
71717
+ }).filter((id) => !id.startsWith("C"));
71238
71718
  if (sigsNeeded.length) {
71239
71719
  throw new AssembledTransaction.Errors.NeedsMoreSignatures(
71240
71720
  `Transaction requires signatures from ${sigsNeeded}. See \`needsNonInvokerSigningBy\` for details.`
@@ -71242,7 +71722,6 @@ You can set \`restore\` to true in the method options in order to automatically
71242
71722
  }
71243
71723
  const timeoutInSeconds = this.options.timeoutInSeconds ?? types.DEFAULT_TIMEOUT;
71244
71724
  this.built = transaction_builder.TransactionBuilder.cloneFrom(this.built, {
71245
- fee: this.built.fee,
71246
71725
  timebounds: void 0,
71247
71726
  sorobanData: this.simulationData.transactionData
71248
71727
  }).setTimeout(timeoutInSeconds).build();
@@ -71289,6 +71768,7 @@ You can set \`restore\` to true in the method options in order to automatically
71289
71768
  signAndSend = async ({
71290
71769
  force = false,
71291
71770
  signTransaction = this.options.signTransaction,
71771
+ ignoreContractDelegates = false,
71292
71772
  watcher
71293
71773
  } = {}) => {
71294
71774
  if (!this.signed) {
@@ -71297,32 +71777,38 @@ You can set \`restore\` to true in the method options in order to automatically
71297
71777
  this.options.networkPassphrase
71298
71778
  );
71299
71779
  const wrappedSignTransaction = this.options.submit && signer$1 ? (tx, opts) => signer$1(tx, { ...opts, submit: false }) : signTransaction;
71300
- await this.sign({ force, signTransaction: wrappedSignTransaction });
71780
+ await this.sign({
71781
+ force,
71782
+ signTransaction: wrappedSignTransaction,
71783
+ ignoreContractDelegates
71784
+ });
71301
71785
  }
71302
71786
  return this.send(watcher);
71303
71787
  };
71304
71788
  /**
71305
- * Get a list of accounts, other than the invoker of the simulation, that
71306
- * need to sign auth entries in this transaction.
71789
+ * Lists each address in the address-credential auth entries that still
71790
+ * lacks a signature (or every such address, with `includeAlreadySigned`):
71791
+ * the top-level address, plus the CAP-71 delegates under a `C…` account,
71792
+ * signed or not. On p27 a `G…` account's delegates are never listed. Source
71793
+ * account credentials are skipped, since the envelope signature covers them;
71794
+ * address credentials are listed even when their address is the transaction
71795
+ * source.
71307
71796
  *
71308
- * Soroban allows multiple people to sign a transaction. Someone needs to
71309
- * sign the final transaction envelope; this person/account is called the
71310
- * _invoker_, or _source_. Other accounts might need to sign individual auth
71311
- * entries in the transaction, if they're not also the invoker.
71312
- *
71313
- * This function returns a list of accounts that need to sign auth entries,
71314
- * assuming that the same invoker/source account will sign the final
71315
- * transaction envelope as signed the initial simulation.
71316
- *
71317
- * One at a time, for each public key in this array, you will need to
71318
- * serialize this transaction with `toJson`, send to the owner of that key,
71319
- * deserialize the transaction with `txFromJson`, and call
71320
- * {@link AssembledTransaction.signAuthEntries}. Then re-serialize and send to
71321
- * the next account in this list.
71797
+ * An unsigned `C…` account stays listed even once its delegates have signed;
71798
+ * filter it out if it authorizes only through delegates. `signAuthEntries`
71799
+ * signs top-level addresses only; sign delegates with `authorizeEntry` and
71800
+ * `forAddress`.
71801
+ * This is a signature-presence heuristic, not an authorization check: it
71802
+ * does not see custom account policy or requirements raised inside
71803
+ * `__check_auth`. The contract auth guide covers the caveats.
71322
71804
  */
71323
71805
  needsNonInvokerSigningBy = ({
71324
71806
  includeAlreadySigned = false
71325
- } = {}) => {
71807
+ } = {}) => this.unsignedAddresses({ includeAlreadySigned, includeDelegates: true });
71808
+ unsignedAddresses({
71809
+ includeAlreadySigned = false,
71810
+ includeDelegates
71811
+ }) {
71326
71812
  if (!this.built) {
71327
71813
  throw new Error("Transaction has not yet been simulated");
71328
71814
  }
@@ -71336,19 +71822,15 @@ You can set \`restore\` to true in the method options in order to automatically
71336
71822
  const rawInvokeHostFunctionOp = this.built.operations[0];
71337
71823
  return [
71338
71824
  ...new Set(
71339
- (rawInvokeHostFunctionOp.auth ?? []).map((entry) => auth.inspectAuthEntry(entry)).filter(
71340
- (info) => (
71341
- // skip source-account credentials (no address payload), which
71342
- // are covered by the envelope signature on the source account.
71343
- // Only the top-level credentials (signers[0]) matter here — this
71344
- // method reports (and signAuthEntries signs) the top-level
71345
- // address, so unsigned delegate nodes must not keep it listed.
71346
- info.address !== null && (includeAlreadySigned || !info.signers[0].signed)
71347
- )
71348
- ).map((info) => info.address)
71825
+ (rawInvokeHostFunctionOp.auth ?? []).flatMap(
71826
+ (entry) => utils.pendingSigners(entry.credentials, {
71827
+ includeSigned: includeAlreadySigned,
71828
+ includeDelegates
71829
+ })
71830
+ )
71349
71831
  )
71350
71832
  ];
71351
- };
71833
+ }
71352
71834
  /**
71353
71835
  * If {@link AssembledTransaction#needsNonInvokerSigningBy} returns a
71354
71836
  * non-empty list, you can serialize the transaction with `toJson`, send it to
@@ -71364,30 +71846,52 @@ You can set \`restore\` to true in the method options in order to automatically
71364
71846
  *
71365
71847
  * Sending to all `needsNonInvokerSigningBy` owners in parallel is not
71366
71848
  * currently supported!
71849
+ *
71850
+ * Only top-level address credentials are selected; delegate nodes and
71851
+ * requirements raised inside a custom account's `__check_auth` are not.
71852
+ * `needsNonInvokerSigningBy` also lists `C…` delegates, which this method
71853
+ * rejects, and keeps a `C…` account listed after its delegates sign, so a
71854
+ * loop until that list is empty may never finish. Sign delegates with
71855
+ * `authorizeEntry` and `forAddress` instead.
71856
+ *
71857
+ * With the default authorizer, the wallet's returned `signerAddress` names
71858
+ * the key the signature is verified against, which may differ from `address`.
71367
71859
  */
71368
71860
  signAuthEntries = async ({
71369
- expiration = (async () => (await this.server.getLatestLedger()).sequence + 100)(),
71861
+ expiration,
71370
71862
  signAuthEntry = this.options.signAuthEntry,
71371
- address: address$1 = signer.signerAddress(signAuthEntry) ?? this.options.publicKey,
71863
+ address: addressArg,
71372
71864
  authorizeEntry = auth.authorizeEntry
71373
71865
  } = {}) => {
71374
71866
  if (!this.built)
71375
71867
  throw new Error("Transaction has not yet been assembled or simulated");
71868
+ const derivedAddress = signer.signerAddress(signAuthEntry);
71869
+ const address$1 = addressArg ?? derivedAddress ?? this.options.publicKey;
71870
+ const noEntriesFor = () => {
71871
+ const base = `No auth entries for public key "${address$1}"`;
71872
+ if (addressArg != null || derivedAddress !== void 0) return base;
71873
+ const unnamed = "`address` was not given and `signAuthEntry` does not name one";
71874
+ const fix = "Pass `address` to say who is signing.";
71875
+ return address$1 === void 0 ? `No account to sign for: ${unnamed}. ${fix}` : `${base}; ${unnamed}, so it defaulted to the account that built this transaction. ${fix}`;
71876
+ };
71376
71877
  const signAuth = signer.toSignAuthEntry(
71377
71878
  signAuthEntry,
71378
71879
  this.options.networkPassphrase
71379
71880
  );
71380
71881
  if (authorizeEntry === auth.authorizeEntry) {
71381
- const needsNonInvokerSigningBy = this.needsNonInvokerSigningBy();
71382
- if (needsNonInvokerSigningBy.length === 0) {
71882
+ const unsigned = this.unsignedAddresses({ includeDelegates: false });
71883
+ if (address$1 !== void 0 && !unsigned.includes(address$1) && this.needsNonInvokerSigningBy().includes(address$1)) {
71884
+ throw new AssembledTransaction.Errors.NoSignatureNeeded(
71885
+ `"${address$1}" is an unsigned delegate, and \`signAuthEntries\` signs top-level addresses only. Sign it with \`authorizeEntry\` and \`forAddress\`.`
71886
+ );
71887
+ }
71888
+ if (unsigned.length === 0) {
71383
71889
  throw new AssembledTransaction.Errors.NoUnsignedNonInvokerAuthEntries(
71384
71890
  "No unsigned non-invoker auth entries; maybe you already signed?"
71385
71891
  );
71386
71892
  }
71387
- if (needsNonInvokerSigningBy.indexOf(address$1 ?? "") === -1) {
71388
- throw new AssembledTransaction.Errors.NoSignatureNeeded(
71389
- `No auth entries for public key "${address$1}"`
71390
- );
71893
+ if (unsigned.indexOf(address$1 ?? "") === -1) {
71894
+ throw new AssembledTransaction.Errors.NoSignatureNeeded(noEntriesFor());
71391
71895
  }
71392
71896
  if (!signAuth) {
71393
71897
  throw new AssembledTransaction.Errors.NoSigner(
@@ -71397,6 +71901,13 @@ You can set \`restore\` to true in the method options in order to automatically
71397
71901
  }
71398
71902
  const rawInvokeHostFunctionOp = this.built.operations[0];
71399
71903
  const authEntries = rawInvokeHostFunctionOp.auth ?? [];
71904
+ let signedAny = false;
71905
+ let latestLedger;
71906
+ const defaultExpiration = async (credentials, stored) => {
71907
+ latestLedger ??= this.server.getLatestLedger().then((ledger) => ledger.sequence);
71908
+ const latest = await latestLedger;
71909
+ return credentials.type === "sorobanCredentialsAddressWithDelegates" && stored > latest && stored <= latest + 100 ? stored : latest + 100;
71910
+ };
71400
71911
  for (const [i, entry] of authEntries.entries()) {
71401
71912
  const credentials = sorobanCredentials.SorobanCredentials.fromXdr(entry.credentials.toXdr());
71402
71913
  const addrAuth = auth.getAddressCredentials(credentials);
@@ -71411,18 +71922,25 @@ You can set \`restore\` to true in the method options in order to automatically
71411
71922
  authEntries[i] = await authorizeEntry(
71412
71923
  entry,
71413
71924
  async (preimage) => {
71414
- const { signedAuthEntry, error } = await sign(
71415
- preimage.toXdr("base64"),
71416
- {
71417
- address: address$1
71418
- }
71419
- );
71925
+ const {
71926
+ signedAuthEntry,
71927
+ signerAddress: resultAddress,
71928
+ error
71929
+ } = await sign(preimage.toXdr("base64"), {
71930
+ address: address$1
71931
+ });
71420
71932
  this.handleWalletError(error);
71421
- return base64.base64ToUint8Array(signedAuthEntry);
71933
+ const signature = base64.base64ToUint8Array(signedAuthEntry);
71934
+ const signingKey = authorizeEntry === auth.authorizeEntry ? signer.walletSigningKey(resultAddress) : void 0;
71935
+ return signingKey === void 0 ? signature : { signature, publicKey: signingKey };
71422
71936
  },
71423
- await expiration,
71937
+ await (expiration ?? defaultExpiration(credentials, addrAuth.signatureExpirationLedger)),
71424
71938
  this.options.networkPassphrase
71425
71939
  );
71940
+ signedAny = true;
71941
+ }
71942
+ if (!signedAny) {
71943
+ throw new AssembledTransaction.Errors.NoSignatureNeeded(noEntriesFor());
71426
71944
  }
71427
71945
  };
71428
71946
  /**
@@ -71446,10 +71964,13 @@ You can set \`restore\` to true in the method options in order to automatically
71446
71964
  * 3. Send the signed transaction to the network.
71447
71965
  * 4. Await and return the response from the network.
71448
71966
  *
71967
+ * The restore transaction uses the `fee` option (default: {@link BASE_FEE}) as
71968
+ * its inclusion fee, and takes its resource fee from its own simulation.
71969
+ * `restorePreamble.minResourceFee` is not used.
71970
+ *
71449
71971
  * Preconditions:
71450
71972
  * - A `signTransaction` function must be provided during the Client initialization.
71451
- * - The provided `restorePreamble` should include a minimum resource fee and valid
71452
- * transaction data.
71973
+ * - The provided `restorePreamble` should include valid transaction data.
71453
71974
  *
71454
71975
  * @throws - Throws an error if no `signTransaction` function is provided during
71455
71976
  * Client initialization.
@@ -71466,8 +71987,7 @@ You can set \`restore\` to true in the method options in order to automatically
71466
71987
  const restoreTx = await AssembledTransaction.buildFootprintRestoreTransaction(
71467
71988
  { ...this.options },
71468
71989
  restorePreamble.transactionData,
71469
- account,
71470
- restorePreamble.minResourceFee
71990
+ account
71471
71991
  );
71472
71992
  const sentTransaction = await restoreTx.signAndSend();
71473
71993
  if (!sentTransaction.getTransactionResponse) {
@@ -71526,12 +72046,12 @@ var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_
71526
72046
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
71527
72047
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
71528
72048
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
72049
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
71529
72050
  var base64 = __webpack_require__(/*! ../base/util/base64.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/base64.js");
71530
72051
  var operation = __webpack_require__(/*! ../base/operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/operation.js");
71531
72052
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
71532
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
72053
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
71533
72054
  var address = __webpack_require__(/*! ../base/address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
71534
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
71535
72055
  var spec = __webpack_require__(/*! ./spec.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/spec.js");
71536
72056
  __webpack_require__(/*! ../rpc/api.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/rpc/api.js");
71537
72057
  var server = __webpack_require__(/*! ../rpc/server.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/rpc/server.js");
@@ -71674,6 +72194,7 @@ class Client {
71674
72194
  * @param options - The ClientOptions object containing the necessary configuration.
71675
72195
  * @returns A Promise that resolves to a Client instance.
71676
72196
  * @throws If the contract spec cannot be obtained from the provided wasm binary.
72197
+ * @throws If the wasm binary has more than one `contractspecv0` section.
71677
72198
  *
71678
72199
  * @example
71679
72200
  * ```ts
@@ -71834,7 +72355,6 @@ exports.UserRejectedError = UserRejectedError;
71834
72355
 
71835
72356
 
71836
72357
  __webpack_require__(/*! ../xdr/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/index.js");
71837
- var scSpecEventDataFormat = __webpack_require__(/*! ../xdr/generated/sc-spec-event-data-format.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-spec-event-data-format.js");
71838
72358
  var scSpecEventParamLocationV0 = __webpack_require__(/*! ../xdr/generated/sc-spec-event-param-location-v0.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-spec-event-param-location-v0.js");
71839
72359
  var scVal = __webpack_require__(/*! ../xdr/generated/sc-val.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val.js");
71840
72360
 
@@ -71900,46 +72420,60 @@ function parseEvent(spec, entries, topics, data) {
71900
72420
  if (!tlParams) {
71901
72421
  continue;
71902
72422
  }
71903
- try {
71904
- const prefixLen = event.prefixTopics.length;
71905
- const dataOut = /* @__PURE__ */ Object.create(null);
71906
- tlParams.forEach((param, i) => {
71907
- const val = topicVals[prefixLen + i];
71908
- dataOut[param.name.toString()] = spec.scValToNative(val, param.type);
71909
- });
71910
- const dParams = dataParams(event);
71911
- const format = event.dataFormat.value;
71912
- if (format === scSpecEventDataFormat.ScSpecEventDataFormat.scSpecEventDataFormatSingleValue.value) {
72423
+ const dParams = dataParams(event);
72424
+ const dataPairs = [];
72425
+ switch (event.dataFormat.name) {
72426
+ case "scSpecEventDataFormatSingleValue": {
71913
72427
  const param = dParams[0];
71914
72428
  if (param) {
71915
- dataOut[param.name.toString()] = spec.scValToNative(
71916
- dataVal,
71917
- param.type
71918
- );
72429
+ dataPairs.push([param, dataVal]);
72430
+ }
72431
+ break;
72432
+ }
72433
+ case "scSpecEventDataFormatVec": {
72434
+ if (dataVal.type !== "scvVec") {
72435
+ continue;
71919
72436
  }
71920
- } else if (format === scSpecEventDataFormat.ScSpecEventDataFormat.scSpecEventDataFormatVec.value) {
71921
- const vec = (dataVal.type === "scvVec" ? dataVal.value : null) ?? [];
72437
+ const vec = dataVal.value ?? [];
71922
72438
  if (vec.length < dParams.length) {
71923
72439
  continue;
71924
72440
  }
71925
72441
  dParams.forEach((param, i) => {
71926
- dataOut[param.name.toString()] = spec.scValToNative(
71927
- vec[i],
71928
- param.type
71929
- );
72442
+ dataPairs.push([param, vec[i]]);
71930
72443
  });
71931
- } else if (format === scSpecEventDataFormat.ScSpecEventDataFormat.scSpecEventDataFormatMap.value) {
71932
- const map = (dataVal.type === "scvMap" ? dataVal.value : null) ?? [];
72444
+ break;
72445
+ }
72446
+ case "scSpecEventDataFormatMap": {
72447
+ if (dataVal.type !== "scvMap") {
72448
+ continue;
72449
+ }
72450
+ const map = dataVal.value ?? [];
71933
72451
  dParams.forEach((param) => {
71934
72452
  const name = param.name.toString();
71935
72453
  const entry = map.find(
71936
72454
  (e) => e.key.type === "scvSymbol" && e.key.value.toString() === name
71937
72455
  );
71938
72456
  if (entry) {
71939
- dataOut[name] = spec.scValToNative(entry.val, param.type);
72457
+ dataPairs.push([param, entry.val]);
71940
72458
  }
71941
72459
  });
72460
+ break;
72461
+ }
72462
+ default: {
72463
+ const unhandled = event.dataFormat.name;
72464
+ throw new Error(`unknown event data format: ${unhandled}`);
71942
72465
  }
72466
+ }
72467
+ try {
72468
+ const prefixLen = event.prefixTopics.length;
72469
+ const dataOut = /* @__PURE__ */ Object.create(null);
72470
+ tlParams.forEach((param, i) => {
72471
+ const val = topicVals[prefixLen + i];
72472
+ dataOut[param.name.toString()] = spec.scValToNative(val, param.type);
72473
+ });
72474
+ dataPairs.forEach(([param, val]) => {
72475
+ dataOut[param.name.toString()] = spec.scValToNative(val, param.type);
72476
+ });
71943
72477
  return {
71944
72478
  name: event.name.toString(),
71945
72479
  data: dataOut
@@ -72087,10 +72621,10 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
72087
72621
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
72088
72622
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
72089
72623
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
72624
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
72625
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
72090
72626
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
72091
72627
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
72092
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
72093
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
72094
72628
  var utils = __webpack_require__(/*! ./utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/utils.js");
72095
72629
  var types = __webpack_require__(/*! ./types.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/types.js");
72096
72630
  var errors = __webpack_require__(/*! ./errors.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/errors.js");
@@ -72228,11 +72762,11 @@ var hashing = __webpack_require__(/*! ../base/hashing.js */ "../../node_modules/
72228
72762
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
72229
72763
  __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extras/index.js");
72230
72764
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
72231
- __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
72765
+ var strkey = __webpack_require__(/*! ../base/strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
72766
+ var decode_encode_muxed_account = __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
72232
72767
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
72233
72768
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
72234
72769
  var transaction_builder = __webpack_require__(/*! ../base/transaction_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_builder.js");
72235
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
72236
72770
  __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
72237
72771
 
72238
72772
  class KeypairSigner {
@@ -72295,6 +72829,20 @@ function signerAddress(value) {
72295
72829
  }
72296
72830
  return isKeypairLike(value) ? value.publicKey() : void 0;
72297
72831
  }
72832
+ function walletSigningKey(signerAddress2) {
72833
+ if (signerAddress2 == null || signerAddress2 === "") return void 0;
72834
+ if (typeof signerAddress2 !== "string") {
72835
+ throw new TypeError(
72836
+ `expected the wallet's signerAddress to be a string, got ${typeof signerAddress2}`
72837
+ );
72838
+ }
72839
+ if (strkey.StrKey.isValidEd25519PublicKey(signerAddress2) || strkey.StrKey.isValidMed25519PublicKey(signerAddress2)) {
72840
+ return decode_encode_muxed_account.extractBaseAddress(signerAddress2);
72841
+ }
72842
+ throw new TypeError(
72843
+ strkey.StrKey.isValidContract(signerAddress2) || strkey.StrKey.isValidMuxedContract(signerAddress2) ? `the wallet's signerAddress names contract ${signerAddress2}, but the default authorizer verifies Ed25519 signatures only; sign for a contract account with a custom \`authorizeEntry\`` : `expected the wallet's signerAddress to be an account address (G... or M...), got ${JSON.stringify(signerAddress2)}`
72844
+ );
72845
+ }
72298
72846
  function toSignTransaction(value, networkPassphrase) {
72299
72847
  if (value == null) return void 0;
72300
72848
  if (typeof value === "function") return value;
@@ -72326,6 +72874,7 @@ exports.KeypairSigner = KeypairSigner;
72326
72874
  exports.signerAddress = signerAddress;
72327
72875
  exports.toSignAuthEntry = toSignAuthEntry;
72328
72876
  exports.toSignTransaction = toSignTransaction;
72877
+ exports.walletSigningKey = walletSigningKey;
72329
72878
  //# sourceMappingURL=signer.js.map
72330
72879
 
72331
72880
 
@@ -72347,10 +72896,11 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
72347
72896
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
72348
72897
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
72349
72898
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
72899
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
72900
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
72350
72901
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
72351
72902
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
72352
72903
  var address = __webpack_require__(/*! ../base/address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
72353
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
72354
72904
  var scval = __webpack_require__(/*! ../base/scval.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/scval.js");
72355
72905
  var contract = __webpack_require__(/*! ../base/contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/contract.js");
72356
72906
  var index$1 = __webpack_require__(/*! ../base/numbers/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/numbers/index.js");
@@ -72411,6 +72961,13 @@ function findCase(name) {
72411
72961
  }
72412
72962
  };
72413
72963
  }
72964
+ function plainAddress(address$1) {
72965
+ address.assertNotMuxed(
72966
+ address$1,
72967
+ "is not allowed for an Address parameter; the parameter must be MuxedAddress"
72968
+ );
72969
+ return address$1;
72970
+ }
72414
72971
  function stringToScVal(str, ty) {
72415
72972
  switch (ty) {
72416
72973
  case "scSpecTypeString":
@@ -72418,6 +72975,7 @@ function stringToScVal(str, ty) {
72418
72975
  case "scSpecTypeSymbol":
72419
72976
  return scVal.ScVal.scvSymbol(str);
72420
72977
  case "scSpecTypeAddress":
72978
+ return plainAddress(address.Address.fromString(str)).toScVal();
72421
72979
  case "scSpecTypeMuxedAddress":
72422
72980
  return address.Address.fromString(str).toScVal();
72423
72981
  case "scSpecTypeU64":
@@ -72520,7 +73078,7 @@ const PRIMITIVE_DEFINITONS = {
72520
73078
  MuxedAddress: {
72521
73079
  type: "string",
72522
73080
  format: "address",
72523
- description: "Stellar public key with M prefix combining a G address and unique ID"
73081
+ description: "Account or contract address, optionally muxed: an M address (G address plus ID) or W address (C address plus ID)"
72524
73082
  },
72525
73083
  ScString: {
72526
73084
  type: "string",
@@ -72795,6 +73353,7 @@ class Spec {
72795
73353
  * @param wasm - The contract's wasm binary as a Uint8Array.
72796
73354
  * @returns A Promise that resolves to a Spec instance.
72797
73355
  * @throws If the contract spec cannot be obtained from the provided wasm binary.
73356
+ * @throws If the wasm binary has more than one `contractspecv0` section.
72798
73357
  */
72799
73358
  static fromWasm(wasm) {
72800
73359
  const spec = wasm_spec_parser.specFromWasm(wasm);
@@ -72945,6 +73504,9 @@ class Spec {
72945
73504
  * @throws if value cannot be converted to the given type
72946
73505
  */
72947
73506
  nativeToScVal(val, ty) {
73507
+ if (typeof val === "function") {
73508
+ throw new TypeError(`failed to convert typeof function (${val})`);
73509
+ }
72948
73510
  const tyType = ty.type;
72949
73511
  if (tyType === "scSpecTypeUdt") {
72950
73512
  const udt = ty.value;
@@ -72975,21 +73537,18 @@ class Spec {
72975
73537
  if (scVal.ScVal.is(val)) {
72976
73538
  return val;
72977
73539
  }
72978
- if (val instanceof address.Address) {
72979
- if (ty.type !== "scSpecTypeAddress") {
72980
- throw new TypeError(
72981
- `Type ${ty} was not address, but value was Address`
72982
- );
72983
- }
72984
- return val.toScVal();
72985
- }
72986
- if (val instanceof contract.Contract) {
72987
- if (ty.type !== "scSpecTypeAddress") {
72988
- throw new TypeError(
72989
- `Type ${ty} was not address, but value was Address`
72990
- );
73540
+ if (val instanceof address.Address || val instanceof contract.Contract) {
73541
+ const address = val instanceof contract.Contract ? val.address() : val;
73542
+ switch (ty.type) {
73543
+ case "scSpecTypeAddress":
73544
+ return plainAddress(address).toScVal();
73545
+ case "scSpecTypeMuxedAddress":
73546
+ return address.toScVal();
73547
+ default:
73548
+ throw new TypeError(
73549
+ `Type ${ty} was not address, but value was Address`
73550
+ );
72991
73551
  }
72992
- return val.address().toScVal();
72993
73552
  }
72994
73553
  if (val instanceof Uint8Array) {
72995
73554
  const copy = Uint8Array.from(val);
@@ -73127,8 +73686,6 @@ class Spec {
73127
73686
  );
73128
73687
  }
73129
73688
  }
73130
- case "function":
73131
- return this.nativeToScVal(val(), ty);
73132
73689
  default:
73133
73690
  throw new TypeError(`failed to convert typeof ${typeof val} (${val})`);
73134
73691
  }
@@ -73201,9 +73758,14 @@ class Spec {
73201
73758
  return scVal.ScVal.scvMap(
73202
73759
  fields.map((field) => {
73203
73760
  const name = field.name.toString();
73761
+ const fieldVal = val[name];
73762
+ const isInherited = typeof fieldVal === "function" && fieldVal === Reflect.get(Object.prototype, name) && !Object.hasOwn(val, name);
73204
73763
  return new scVal.ScMapEntry({
73205
73764
  key: this.nativeToScVal(name, scSpecTypeDef.ScSpecTypeDef.scSpecTypeSymbol()),
73206
- val: this.nativeToScVal(val[name], field.type)
73765
+ val: this.nativeToScVal(
73766
+ isInherited ? void 0 : fieldVal,
73767
+ field.type
73768
+ )
73207
73769
  });
73208
73770
  })
73209
73771
  );
@@ -73468,10 +74030,11 @@ class Spec {
73468
74030
  * no event spec matches (e.g. when filtering a mixed stream of
73469
74031
  * events from multiple contracts/specs)
73470
74032
  *
73471
- * Note that matching compares only the prefix topics and the topic count;
73472
- * if two event specs share both (in particular, events with no prefix
73473
- * topics match on arity alone), the first declared spec whose values
73474
- * decode successfully wins.
74033
+ * Note that matching compares only the prefix topics and a minimum topic
74034
+ * count; if more than one event spec matches (in particular, events with
74035
+ * no prefix topics match on arity alone), the first declared spec whose
74036
+ * values decode successfully wins. A `vec` or `map` spec decodes only data
74037
+ * of that container type.
73475
74038
  *
73476
74039
  * @example
73477
74040
  * ```ts
@@ -73604,11 +74167,13 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
73604
74167
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
73605
74168
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
73606
74169
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
74170
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74171
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
73607
74172
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
73608
74173
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
74174
+ var address = __webpack_require__(/*! ../base/address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
73609
74175
  var account = __webpack_require__(/*! ../base/account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/account.js");
73610
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
73611
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74176
+ var auth = __webpack_require__(/*! ../base/auth.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/auth.js");
73612
74177
  var types = __webpack_require__(/*! ./types.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/contract/types.js");
73613
74178
  var xdrValue = __webpack_require__(/*! ../xdr/values/xdr-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/values/xdr-value.js");
73614
74179
  var scSpecEntry = __webpack_require__(/*! ../xdr/generated/sc-spec-entry.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-spec-entry.js");
@@ -73679,6 +74244,10 @@ function parseWasmCustomSections(buffer) {
73679
74244
  throw new Error("Invalid WASM magic");
73680
74245
  if ([...read(4)].join() !== "1,0,0,0")
73681
74246
  throw new Error("Invalid WASM version");
74247
+ const nameDecoder = new TextDecoder("utf-8", {
74248
+ fatal: true,
74249
+ ignoreBOM: true
74250
+ });
73682
74251
  while (offset < buffer.byteLength) {
73683
74252
  const sectionId = read(1)[0];
73684
74253
  const sectionLength = readVarUint32();
@@ -73689,12 +74258,8 @@ function parseWasmCustomSections(buffer) {
73689
74258
  const nameBytes = read(nameLen);
73690
74259
  const payload = read(sectionLength - (offset - start));
73691
74260
  try {
73692
- const name = new TextDecoder("utf-8", { fatal: true }).decode(
73693
- nameBytes
73694
- );
73695
- if (payload.length > 0) {
73696
- sections.set(name, (sections.get(name) || []).concat(payload));
73697
- }
74261
+ const name = nameDecoder.decode(nameBytes);
74262
+ sections.set(name, (sections.get(name) || []).concat(payload));
73698
74263
  } catch {
73699
74264
  }
73700
74265
  }
@@ -73709,11 +74274,33 @@ function processSpecEntryStream(buffer) {
73709
74274
  async function getAccount(options, server) {
73710
74275
  return options.publicKey ? server.getAccount(options.publicKey) : new account.Account(types.NULL_ACCOUNT, "0");
73711
74276
  }
74277
+ const pendingAt = (address$1, signature, delegates, includeSigned) => {
74278
+ const self = includeSigned || !auth.signaturePresent(signature) ? [address.Address.fromScAddress(address$1).toString()] : [];
74279
+ if (address$1.type !== "scAddressTypeContract") return self;
74280
+ return [
74281
+ ...self,
74282
+ ...delegates.flatMap(
74283
+ (d) => pendingAt(d.address, d.signature, d.nestedDelegates, includeSigned)
74284
+ )
74285
+ ];
74286
+ };
74287
+ function pendingSigners(credentials, { includeSigned = false, includeDelegates = true } = {}) {
74288
+ const addrAuth = auth.getAddressCredentials(credentials);
74289
+ if (addrAuth === null) return [];
74290
+ const delegates = includeDelegates && credentials.type === "sorobanCredentialsAddressWithDelegates" ? credentials.addressWithDelegates.delegates : [];
74291
+ return pendingAt(
74292
+ addrAuth.address,
74293
+ addrAuth.signature,
74294
+ delegates,
74295
+ includeSigned
74296
+ );
74297
+ }
73712
74298
 
73713
74299
  exports.contractErrorPattern = contractErrorPattern;
73714
74300
  exports.getAccount = getAccount;
73715
74301
  exports.implementsToString = implementsToString;
73716
74302
  exports.parseWasmCustomSections = parseWasmCustomSections;
74303
+ exports.pendingSigners = pendingSigners;
73717
74304
  exports.processSpecEntryStream = processSpecEntryStream;
73718
74305
  exports.withExponentialBackoff = withExponentialBackoff;
73719
74306
  //# sourceMappingURL=utils.js.map
@@ -73735,7 +74322,12 @@ var utils = __webpack_require__(/*! ./utils.js */ "../../node_modules/@stellar/s
73735
74322
  function specFromWasm(wasm) {
73736
74323
  const customData = utils.parseWasmCustomSections(wasm);
73737
74324
  const xdrSections = customData.get("contractspecv0");
73738
- if (!xdrSections || xdrSections.length === 0) {
74325
+ if (xdrSections && xdrSections.length > 1) {
74326
+ throw new Error(
74327
+ `Expected at most one 'contractspecv0' section in wasm, found ${xdrSections.length}`
74328
+ );
74329
+ }
74330
+ if (!xdrSections || xdrSections[0].length === 0) {
73739
74331
  throw new Error("Could not obtain contract spec from wasm");
73740
74332
  }
73741
74333
  return Uint8Array.from(xdrSections[0]);
@@ -73878,10 +74470,10 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
73878
74470
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
73879
74471
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
73880
74472
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
74473
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74474
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
73881
74475
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
73882
74476
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
73883
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
73884
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
73885
74477
  var bad_response = __webpack_require__(/*! ./bad_response.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/errors/bad_response.js");
73886
74478
  var transactionResult = __webpack_require__(/*! ../xdr/generated/transaction-result.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-result.js");
73887
74479
 
@@ -73993,16 +74585,17 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
73993
74585
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
73994
74586
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
73995
74587
  var strkey = __webpack_require__(/*! ../base/strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
74588
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
73996
74589
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
73997
74590
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
73998
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
73999
74591
  __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74000
74592
  var config = __webpack_require__(/*! ../config.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/config.js");
74001
74593
  var bad_response = __webpack_require__(/*! ../errors/bad_response.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/errors/bad_response.js");
74002
74594
  var wrap_http_error = __webpack_require__(/*! ../errors/wrap_http_error.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/errors/wrap_http_error.js");
74003
74595
  var index = __webpack_require__(/*! ../stellartoml/index.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/stellartoml/index.js");
74596
+ var utils = __webpack_require__(/*! ../stellartoml/utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/stellartoml/utils.js");
74004
74597
  var fetchClient = __webpack_require__(/*! ../http-client/fetch-client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/http-client/fetch-client.js");
74005
- var utils = __webpack_require__(/*! ./utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/federation/utils.js");
74598
+ var utils$1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/federation/utils.js");
74006
74599
 
74007
74600
  const FEDERATION_RESPONSE_MAX_SIZE = 100 * 1024;
74008
74601
  class FederationServer {
@@ -74021,6 +74614,10 @@ class FederationServer {
74021
74614
  */
74022
74615
  timeout;
74023
74616
  // TODO: public or private? readonly?
74617
+ /**
74618
+ * The number of redirects to follow, default: 0.
74619
+ */
74620
+ allowedRedirects;
74024
74621
  /**
74025
74622
  * A helper method for handling user inputs that contain `destination` value.
74026
74623
  * It accepts two types of values:
@@ -74032,6 +74629,8 @@ class FederationServer {
74032
74629
  * resolves if Account ID is valid and rejects in all other cases. Please note that this method does not check
74033
74630
  * if the account actually exists in a ledger.
74034
74631
  *
74632
+ * The `FEDERATION_SERVER` URL is checked as described in {@link FederationServer.createForDomain}.
74633
+ *
74035
74634
  * @example
74036
74635
  * ```ts
74037
74636
  * StellarSdk.FederationServer.resolve('bob*stellar.org')
@@ -74053,6 +74652,7 @@ class FederationServer {
74053
74652
  */
74054
74653
  static async resolve(value, opts = {}) {
74055
74654
  if (value.indexOf("*") < 0) {
74655
+ utils.validateAllowedRedirects(opts.allowedRedirects);
74056
74656
  if (!strkey.StrKey.isValidEd25519PublicKey(value)) {
74057
74657
  return Promise.reject(new Error("Invalid Account ID"));
74058
74658
  }
@@ -74077,6 +74677,15 @@ class FederationServer {
74077
74677
  * If `stellar.toml` file does not exist for a given domain or it does not
74078
74678
  * contain information about a federation server Promise will reject.
74079
74679
  *
74680
+ * The `FEDERATION_SERVER` URL comes from a remote file, so it is checked
74681
+ * before use. The Promise rejects if the URL uses a scheme other than
74682
+ * `http:` or `https:`, or contains a user name or password. The SDK does
74683
+ * not check the host, so the URL can point to a private or local address.
74684
+ * When `allowedRedirects` is set, redirect targets are not checked. A
74685
+ * server-side application that resolves untrusted addresses must filter
74686
+ * the hosts it connects to, for example with DNS filtering or an egress
74687
+ * proxy.
74688
+ *
74080
74689
  * @example
74081
74690
  * ```ts
74082
74691
  * StellarSdk.FederationServer.createForDomain('acme.com')
@@ -74095,21 +74704,29 @@ class FederationServer {
74095
74704
  * @throws Will throw an error if the domain's stellar.toml file does not contain a federation server field.
74096
74705
  */
74097
74706
  static async createForDomain(domain, opts = {}) {
74098
- utils.validateDomain(domain);
74707
+ utils$1.validateDomain(domain);
74099
74708
  const tomlObject = await index.Resolver.resolve(domain, opts);
74100
74709
  if (!tomlObject.FEDERATION_SERVER) {
74101
74710
  return Promise.reject(
74102
74711
  new Error("stellar.toml does not contain FEDERATION_SERVER field")
74103
74712
  );
74104
74713
  }
74105
- return new FederationServer(tomlObject.FEDERATION_SERVER, domain, opts);
74714
+ const federationServer = new FederationServer(
74715
+ tomlObject.FEDERATION_SERVER,
74716
+ domain,
74717
+ opts
74718
+ );
74719
+ utils$1.validateFederationServer(federationServer.serverURL);
74720
+ return federationServer;
74106
74721
  }
74107
74722
  constructor(serverURL, domain, opts = {}) {
74108
74723
  this.serverURL = new URL(serverURL);
74109
74724
  this.domain = domain;
74110
- utils.validateDomain(domain);
74725
+ utils$1.validateDomain(domain);
74111
74726
  const allowHttp = typeof opts.allowHttp === "undefined" ? config.Config.isAllowHttp() : opts.allowHttp;
74112
74727
  this.timeout = typeof opts.timeout === "undefined" ? config.Config.getTimeout() : opts.timeout;
74728
+ utils.validateAllowedRedirects(opts.allowedRedirects);
74729
+ this.allowedRedirects = opts.allowedRedirects ?? 0;
74113
74730
  if (this.serverURL.protocol !== "https:" && !allowHttp) {
74114
74731
  throw new Error("Cannot connect to insecure federation server");
74115
74732
  }
@@ -74175,6 +74792,7 @@ class FederationServer {
74175
74792
  const timeout = this.timeout;
74176
74793
  return fetchClient.fetchClient.get(url.toString(), {
74177
74794
  maxContentLength: FEDERATION_RESPONSE_MAX_SIZE,
74795
+ maxRedirects: this.allowedRedirects,
74178
74796
  timeout
74179
74797
  }).then((response) => {
74180
74798
  if (typeof response.data.memo !== "undefined" && typeof response.data.memo !== "string") {
@@ -74225,8 +74843,22 @@ function validateDomain(domain) {
74225
74843
  );
74226
74844
  }
74227
74845
  }
74846
+ function validateFederationServer(url) {
74847
+ let reason;
74848
+ if (url.protocol !== "http:" && url.protocol !== "https:") {
74849
+ reason = `Unsupported protocol ${url.protocol}`;
74850
+ } else if (url.username || url.password) {
74851
+ reason = "The URL must not contain a user name or password.";
74852
+ }
74853
+ if (reason) {
74854
+ throw new Error(
74855
+ `Invalid FEDERATION_SERVER: ${JSON.stringify(url.href)}. ${reason}`
74856
+ );
74857
+ }
74858
+ }
74228
74859
 
74229
74860
  exports.validateDomain = validateDomain;
74861
+ exports.validateFederationServer = validateFederationServer;
74230
74862
  //# sourceMappingURL=utils.js.map
74231
74863
 
74232
74864
 
@@ -74342,11 +74974,11 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
74342
74974
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
74343
74975
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
74344
74976
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
74977
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74978
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
74345
74979
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
74346
74980
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
74347
74981
  var account = __webpack_require__(/*! ../base/account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/account.js");
74348
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
74349
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74350
74982
 
74351
74983
  class AccountResponse {
74352
74984
  id;
@@ -74495,14 +75127,21 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
74495
75127
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
74496
75128
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
74497
75129
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
75130
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
75131
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
74498
75132
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
74499
75133
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
74500
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
74501
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
74502
75134
  var horizon_axios_client = __webpack_require__(/*! ./horizon_axios_client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/horizon/horizon_axios_client.js");
74503
75135
  var url = __webpack_require__(/*! ../utils/url.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/utils/url.js");
74504
75136
 
74505
75137
  const JOINABLE = ["transaction"];
75138
+ const SKIPPED_LINK_KEYS = /* @__PURE__ */ new Set([
75139
+ "then",
75140
+ "toJSON",
75141
+ "paging_token",
75142
+ "_links",
75143
+ ...Object.getOwnPropertyNames(Object.prototype)
75144
+ ]);
74506
75145
  class CallBuilder {
74507
75146
  url;
74508
75147
  filter;
@@ -74555,7 +75194,7 @@ class CallBuilder {
74555
75194
  * @see [MDN EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
74556
75195
  * @param options - (optional) EventSource options.
74557
75196
  * - `onmessage` (optional): Callback function to handle incoming messages.
74558
- * - `onerror` (optional): Callback function to handle errors.
75197
+ * - `onerror` (optional): Callback function to handle errors. For an event that the SDK cannot parse, it gets a `MessageEvent` of type `"error"` whose `data` is the error. Without `onerror`, the SDK skips such an event silently.
74559
75198
  * - `reconnectTimeout` (optional): Custom stream connection timeout in ms, default is 15 seconds.
74560
75199
  * @returns Close function. Run to close the connection and stop listening for new events.
74561
75200
  */
@@ -74620,12 +75259,21 @@ class CallBuilder {
74620
75259
  onClose();
74621
75260
  return;
74622
75261
  }
74623
- const result = message.data ? this._parseRecord(JSON.parse(message.data)) : message;
75262
+ clearTimeout(timeout);
75263
+ createTimeout();
75264
+ let result;
75265
+ try {
75266
+ result = message.data ? this._parseRecord(JSON.parse(message.data)) : message;
75267
+ } catch (err) {
75268
+ if (message.lastEventId) {
75269
+ streamUrl.searchParams.set("cursor", message.lastEventId);
75270
+ }
75271
+ onError(new MessageEvent("error", { data: err }));
75272
+ return;
75273
+ }
74624
75274
  if (result.paging_token) {
74625
75275
  streamUrl.searchParams.set("cursor", result.paging_token);
74626
75276
  }
74627
- clearTimeout(timeout);
74628
- createTimeout();
74629
75277
  if (typeof options.onmessage !== "undefined") {
74630
75278
  options.onmessage(result);
74631
75279
  }
@@ -74725,7 +75373,9 @@ class CallBuilder {
74725
75373
  throw new bad_request.BadRequestError("Too many filters specified", this.filter);
74726
75374
  }
74727
75375
  if (this.filter.length === 1) {
74728
- const newSegment = this.originalSegments.concat(this.filter[0]);
75376
+ const newSegment = this.originalSegments.concat(
75377
+ this.filter[0].map(url.encodeSegment)
75378
+ );
74729
75379
  this.url.pathname = newSegment.join("/");
74730
75380
  }
74731
75381
  }
@@ -74741,7 +75391,7 @@ class CallBuilder {
74741
75391
  return async (opts = {}) => {
74742
75392
  let uri;
74743
75393
  if (link.templated) {
74744
- uri = new URL(url.expandUriTemplate(link.href, opts), this.url);
75394
+ uri = new URL(url.expandUriTemplate(link.href, opts, this.url));
74745
75395
  } else {
74746
75396
  uri = new URL(link.href, this.url);
74747
75397
  }
@@ -74760,8 +75410,12 @@ class CallBuilder {
74760
75410
  if (!json._links) {
74761
75411
  return json;
74762
75412
  }
74763
- Object.keys(json._links).forEach((key) => {
74764
- const n = json._links[key];
75413
+ const links = json._links;
75414
+ Object.keys(links).forEach((key) => {
75415
+ if (SKIPPED_LINK_KEYS.has(key)) {
75416
+ return;
75417
+ }
75418
+ const n = links[key];
74765
75419
  let included = false;
74766
75420
  if (typeof json[key] !== "undefined") {
74767
75421
  json[`${key}_attr`] = json[key];
@@ -75132,7 +75786,7 @@ exports.HorizonApi = void 0;
75132
75786
 
75133
75787
  var fetchClient = __webpack_require__(/*! ../http-client/fetch-client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/http-client/fetch-client.js");
75134
75788
 
75135
- const version = "17.0.1";
75789
+ const version = "17.4.0";
75136
75790
  const SERVER_TIME_MAP = {};
75137
75791
  function toSeconds(ms) {
75138
75792
  return Math.floor(ms / 1e3);
@@ -75648,9 +76302,10 @@ __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stell
75648
76302
  var asset = __webpack_require__(/*! ../base/asset.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/asset.js");
75649
76303
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
75650
76304
  var strkey = __webpack_require__(/*! ../base/strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
76305
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
75651
76306
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
76307
+ var util = __webpack_require__(/*! ../xdr/util.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/util.js");
75652
76308
  var fee_bump_transaction = __webpack_require__(/*! ../base/fee_bump_transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/fee_bump_transaction.js");
75653
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
75654
76309
  __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
75655
76310
  var call_builder = __webpack_require__(/*! ./call_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/horizon/call_builder.js");
75656
76311
  var config = __webpack_require__(/*! ../config.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/config.js");
@@ -75677,7 +76332,6 @@ var trade_aggregation_call_builder = __webpack_require__(/*! ./trade_aggregation
75677
76332
  var trades_call_builder = __webpack_require__(/*! ./trades_call_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/horizon/trades_call_builder.js");
75678
76333
  var transaction_call_builder = __webpack_require__(/*! ./transaction_call_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/horizon/transaction_call_builder.js");
75679
76334
  var horizon_axios_client = __webpack_require__(/*! ./horizon_axios_client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/horizon/horizon_axios_client.js");
75680
- var util = __webpack_require__(/*! ../xdr/util.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/util.js");
75681
76335
  var transactionResult = __webpack_require__(/*! ../xdr/generated/transaction-result.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-result.js");
75682
76336
 
75683
76337
  const SUBMIT_TRANSACTION_TIMEOUT = 60 * 1e3;
@@ -76514,10 +77168,10 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
76514
77168
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
76515
77169
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
76516
77170
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
77171
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
77172
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
76517
77173
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
76518
77174
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
76519
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
76520
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
76521
77175
 
76522
77176
  const allowedResolutions = [
76523
77177
  6e4,
@@ -76906,10 +77560,15 @@ function buildBoundedUrl(config) {
76906
77560
  const qs = new URLSearchParams(
76907
77561
  config.params
76908
77562
  ).toString();
77563
+ url = stripFragment(url);
76909
77564
  url += (url.includes("?") ? "&" : "?") + qs;
76910
77565
  }
76911
77566
  return url;
76912
77567
  }
77568
+ function stripFragment(url) {
77569
+ const hashIndex = url.indexOf("#");
77570
+ return hashIndex === -1 ? url : url.slice(0, hashIndex);
77571
+ }
76913
77572
  function encodeRequestBody(data, headers) {
76914
77573
  if (data === void 0 || data === null) return void 0;
76915
77574
  if (typeof data === "string") return data;
@@ -77006,21 +77665,44 @@ function applyRedirectSemantics(init, status) {
77006
77665
  headers.delete("content-type");
77007
77666
  headers.delete("content-length");
77008
77667
  headers.delete("transfer-encoding");
77668
+ headers.delete("content-encoding");
77669
+ headers.delete("content-language");
77670
+ headers.delete("content-location");
77671
+ headers.delete("content-range");
77009
77672
  next.headers = headers;
77010
77673
  return next;
77011
77674
  }
77012
- function stripCrossOriginAuth(init, fromUrl, toUrl) {
77013
- let sameOrigin;
77014
- try {
77015
- sameOrigin = new URL(fromUrl).origin === new URL(toUrl).origin;
77016
- } catch {
77017
- sameOrigin = false;
77018
- }
77019
- if (sameOrigin) return init;
77020
- const headers = new Headers(init.headers || {});
77021
- headers.delete("authorization");
77022
- headers.delete("proxy-authorization");
77023
- headers.delete("cookie");
77675
+ const SAFE_CROSS_ORIGIN_HEADERS = /* @__PURE__ */ new Set([
77676
+ "accept",
77677
+ "accept-encoding",
77678
+ "accept-language",
77679
+ "content-type",
77680
+ "content-length",
77681
+ "content-encoding",
77682
+ "content-language",
77683
+ "content-location",
77684
+ "content-range",
77685
+ "user-agent",
77686
+ "range",
77687
+ "if-range",
77688
+ "if-match",
77689
+ "if-none-match",
77690
+ "if-modified-since",
77691
+ "if-unmodified-since",
77692
+ "cache-control",
77693
+ "pragma",
77694
+ "x-client-name",
77695
+ "x-client-version",
77696
+ "x-app-name",
77697
+ "x-app-version"
77698
+ ]);
77699
+ function stripCrossOriginHeaders(init, fromUrl, toUrl) {
77700
+ if (fromUrl.origin === toUrl.origin) return init;
77701
+ const source = init.headers instanceof Headers ? init.headers : new Headers(init.headers || {});
77702
+ const headers = new Headers();
77703
+ source.forEach((value, name) => {
77704
+ if (SAFE_CROSS_ORIGIN_HEADERS.has(name)) headers.set(name, value);
77705
+ });
77024
77706
  return { ...init, headers };
77025
77707
  }
77026
77708
  function buildHttpError(response, config, data) {
@@ -77036,6 +77718,7 @@ function buildHttpError(response, config, data) {
77036
77718
  };
77037
77719
  return err;
77038
77720
  }
77721
+ let strictUtf8Decoder;
77039
77722
  async function boundedFetchAdapter(config) {
77040
77723
  const { maxRedirects, maxContentLength, timeout } = config;
77041
77724
  const signals = [];
@@ -77065,12 +77748,13 @@ async function boundedFetchAdapter(config) {
77065
77748
  redirect,
77066
77749
  ...signal ? { signal } : {}
77067
77750
  };
77068
- let currentUrl = buildBoundedUrl(config);
77751
+ const startUrl = buildBoundedUrl(config);
77752
+ let current;
77069
77753
  let redirectsRemaining = maxRedirects ?? 0;
77070
77754
  let response;
77071
77755
  while (true) {
77072
77756
  try {
77073
- response = await fetch(currentUrl, currentInit);
77757
+ response = await fetch(current?.href ?? startUrl, currentInit);
77074
77758
  } catch (err) {
77075
77759
  if (err?.name === "TimeoutError") {
77076
77760
  throw new Error(`timeout of ${config.timeout}ms exceeded`);
@@ -77085,10 +77769,17 @@ async function boundedFetchAdapter(config) {
77085
77769
  }
77086
77770
  const location = response.headers.get("location");
77087
77771
  if (!location) break;
77088
- const nextUrl = new URL(location, currentUrl).toString();
77772
+ const from = current ?? new URL(startUrl);
77773
+ const target = new URL(location, from);
77774
+ if (target.protocol !== "http:" && target.protocol !== "https:") {
77775
+ throw new Error(`Unsupported protocol ${target.protocol}`);
77776
+ }
77777
+ if (from.protocol === "https:" && target.protocol === "http:") {
77778
+ throw new Error("Redirect from https: to http: is not allowed");
77779
+ }
77089
77780
  currentInit = applyRedirectSemantics(currentInit, response.status);
77090
- currentInit = stripCrossOriginAuth(currentInit, currentUrl, nextUrl);
77091
- currentUrl = nextUrl;
77781
+ currentInit = stripCrossOriginHeaders(currentInit, from, target);
77782
+ current = target;
77092
77783
  redirectsRemaining -= 1;
77093
77784
  }
77094
77785
  if (!response.ok) {
@@ -77107,7 +77798,13 @@ async function boundedFetchAdapter(config) {
77107
77798
  throw buildHttpError(response, config, errBody);
77108
77799
  }
77109
77800
  const bytes = await readBodyBounded(response, maxContentLength);
77110
- const text = new TextDecoder().decode(bytes);
77801
+ strictUtf8Decoder ??= new TextDecoder("utf-8", { fatal: true });
77802
+ let text;
77803
+ try {
77804
+ text = strictUtf8Decoder.decode(bytes);
77805
+ } catch (err) {
77806
+ throw new Error("Response body is not valid UTF-8", { cause: err });
77807
+ }
77111
77808
  let data = text;
77112
77809
  try {
77113
77810
  data = JSON.parse(text);
@@ -77141,6 +77838,12 @@ function createFetchClient(fetchConfig = {}) {
77141
77838
  if (config.maxRedirects !== void 0 || config.maxContentLength !== void 0) {
77142
77839
  return boundedFetchAdapter(config);
77143
77840
  }
77841
+ if (config.url?.includes("#") && config.params && Object.keys(config.params).length > 0) {
77842
+ return instance.request({
77843
+ ...config,
77844
+ url: stripFragment(config.url)
77845
+ });
77846
+ }
77144
77847
  return instance.request(config);
77145
77848
  }
77146
77849
  },
@@ -77382,6 +78085,7 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
77382
78085
  var hashing = __webpack_require__(/*! ./base/hashing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/hashing.js");
77383
78086
  var signing = __webpack_require__(/*! ./base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
77384
78087
  var get_liquidity_pool_id = __webpack_require__(/*! ./base/get_liquidity_pool_id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/get_liquidity_pool_id.js");
78088
+ var get_claimable_balance_id = __webpack_require__(/*! ./base/get_claimable_balance_id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/get_claimable_balance_id.js");
77385
78089
  var keypair = __webpack_require__(/*! ./base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
77386
78090
  var transaction_base = __webpack_require__(/*! ./base/transaction_base.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_base.js");
77387
78091
  var transaction = __webpack_require__(/*! ./base/transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction.js");
@@ -77439,6 +78143,7 @@ exports.sign = signing.sign;
77439
78143
  exports.verify = signing.verify;
77440
78144
  exports.LiquidityPoolFeeV18 = get_liquidity_pool_id.LiquidityPoolFeeV18;
77441
78145
  exports.getLiquidityPoolId = get_liquidity_pool_id.getLiquidityPoolId;
78146
+ exports.getClaimableBalanceIdFromResult = get_claimable_balance_id.getClaimableBalanceIdFromResult;
77442
78147
  exports.Keypair = keypair.Keypair;
77443
78148
  exports.TransactionBase = transaction_base.TransactionBase;
77444
78149
  exports.Transaction = transaction.Transaction;
@@ -77471,6 +78176,7 @@ exports.Soroban = soroban.Soroban;
77471
78176
  exports.decodeAddressToMuxedAccount = decode_encode_muxed_account.decodeAddressToMuxedAccount;
77472
78177
  exports.encodeMuxedAccount = decode_encode_muxed_account.encodeMuxedAccount;
77473
78178
  exports.encodeMuxedAccountToAddress = decode_encode_muxed_account.encodeMuxedAccountToAddress;
78179
+ exports.encodeMuxedContractAddress = decode_encode_muxed_account.encodeMuxedContractAddress;
77474
78180
  exports.extractBaseAddress = decode_encode_muxed_account.extractBaseAddress;
77475
78181
  exports.Contract = contract.Contract;
77476
78182
  exports.Address = address.Address;
@@ -77515,6 +78221,30 @@ exports.Api = void 0;
77515
78221
  GetTransactionStatus2["NOT_FOUND"] = "NOT_FOUND";
77516
78222
  GetTransactionStatus2["FAILED"] = "FAILED";
77517
78223
  })(Api2.GetTransactionStatus || (Api2.GetTransactionStatus = {}));
78224
+ ((QueryEventsScanStatus2) => {
78225
+ QueryEventsScanStatus2["HAS_MORE"] = "HAS_MORE";
78226
+ QueryEventsScanStatus2["WAITING_FOR_LEDGERS"] = "WAITING_FOR_LEDGERS";
78227
+ QueryEventsScanStatus2["OLDEST_REACHED"] = "OLDEST_REACHED";
78228
+ QueryEventsScanStatus2["COMPLETE"] = "COMPLETE";
78229
+ })(Api2.QueryEventsScanStatus || (Api2.QueryEventsScanStatus = {}));
78230
+ Api2.QUERY_EVENTS_INVALID_PARAMS = -32602;
78231
+ const QUERY_EVENTS_ERROR_REASONS = /* @__PURE__ */ new Set([
78232
+ "invalid_params",
78233
+ "ledger_out_of_range",
78234
+ "cursor_malformed"
78235
+ ]);
78236
+ function isQueryEventsError(err) {
78237
+ if (typeof err !== "object" || err === null) {
78238
+ return false;
78239
+ }
78240
+ const { code, data } = err;
78241
+ if (code !== Api2.QUERY_EVENTS_INVALID_PARAMS || typeof data !== "object" || data === null) {
78242
+ return false;
78243
+ }
78244
+ const { reason } = data;
78245
+ return typeof reason === "string" && QUERY_EVENTS_ERROR_REASONS.has(reason);
78246
+ }
78247
+ Api2.isQueryEventsError = isQueryEventsError;
77518
78248
  function isSimulationError(sim) {
77519
78249
  return "error" in sim;
77520
78250
  }
@@ -77548,14 +78278,15 @@ exports.Api = void 0;
77548
78278
 
77549
78279
  var fetchClient = __webpack_require__(/*! ../http-client/fetch-client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/http-client/fetch-client.js");
77550
78280
 
77551
- const version = "17.0.1";
77552
- function createHttpClient(headers) {
78281
+ const version = "17.4.0";
78282
+ function createHttpClient(headers, timeout) {
77553
78283
  return fetchClient.create({
77554
78284
  headers: {
77555
78285
  ...headers,
77556
78286
  "X-Client-Name": "js-stellar-sdk",
77557
78287
  "X-Client-Version": version
77558
- }
78288
+ },
78289
+ timeout
77559
78290
  });
77560
78291
  }
77561
78292
 
@@ -77591,6 +78322,7 @@ exports.Durability = server.Durability;
77591
78322
  exports.LinearSleepStrategy = server.LinearSleepStrategy;
77592
78323
  exports.Server = server.RpcServer;
77593
78324
  exports.parseRawEvents = parsers.parseRawEvents;
78325
+ exports.parseRawQueryEvents = parsers.parseRawQueryEvents;
77594
78326
  exports.parseRawSimulation = parsers.parseRawSimulation;
77595
78327
  exports.assembleTransaction = transaction.assembleTransaction;
77596
78328
  //# sourceMappingURL=index.js.map
@@ -77646,26 +78378,26 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
77646
78378
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
77647
78379
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
77648
78380
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
78381
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
78382
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
77649
78383
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
77650
78384
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
77651
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
77652
78385
  var sorobandata_builder = __webpack_require__(/*! ../base/sorobandata_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/sorobandata_builder.js");
77653
78386
  var contract = __webpack_require__(/*! ../base/contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/contract.js");
77654
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
77655
78387
  var api = __webpack_require__(/*! ./api.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/rpc/api.js");
77656
78388
  var diagnosticEvent = __webpack_require__(/*! ../xdr/generated/diagnostic-event.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/diagnostic-event.js");
77657
78389
  var ledgerEntryData = __webpack_require__(/*! ../xdr/generated/ledger-entry-data.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-entry-data.js");
77658
78390
  var transactionMeta = __webpack_require__(/*! ../xdr/generated/transaction-meta.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-meta.js");
77659
78391
  var transactionEvent = __webpack_require__(/*! ../xdr/generated/transaction-event.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-event.js");
77660
78392
  var contractEvent = __webpack_require__(/*! ../xdr/generated/contract-event.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/contract-event.js");
77661
- var transactionResult = __webpack_require__(/*! ../xdr/generated/transaction-result.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-result.js");
77662
78393
  var ledgerHeader = __webpack_require__(/*! ../xdr/generated/ledger-header.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-header.js");
77663
78394
  var ledgerCloseMeta = __webpack_require__(/*! ../xdr/generated/ledger-close-meta.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-close-meta.js");
77664
78395
  var ledgerHeaderHistoryEntry = __webpack_require__(/*! ../xdr/generated/ledger-header-history-entry.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-header-history-entry.js");
77665
78396
  var ledgerEntry = __webpack_require__(/*! ../xdr/generated/ledger-entry.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-entry.js");
77666
- var scVal = __webpack_require__(/*! ../xdr/generated/sc-val.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val.js");
77667
78397
  var ledgerKey = __webpack_require__(/*! ../xdr/generated/ledger-key.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-key.js");
78398
+ var transactionResult = __webpack_require__(/*! ../xdr/generated/transaction-result.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-result.js");
77668
78399
  var transactionEnvelope = __webpack_require__(/*! ../xdr/generated/transaction-envelope.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/transaction-envelope.js");
78400
+ var scVal = __webpack_require__(/*! ../xdr/generated/sc-val.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/sc-val.js");
77669
78401
  var sorobanAuthorizationEntry = __webpack_require__(/*! ../xdr/generated/soroban-authorization-entry.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/soroban-authorization-entry.js");
77670
78402
 
77671
78403
  function parseRawSendTransaction(raw) {
@@ -77734,18 +78466,37 @@ function parseRawEvents(raw) {
77734
78466
  latestLedgerCloseTime: raw.latestLedgerCloseTime,
77735
78467
  oldestLedgerCloseTime: raw.oldestLedgerCloseTime,
77736
78468
  cursor: raw.cursor,
78469
+ events: (raw.events ?? []).map(parseRawEvent)
78470
+ };
78471
+ }
78472
+ function parseRawEvent(evt) {
78473
+ const clone = { ...evt };
78474
+ delete clone.contractId;
78475
+ return {
78476
+ ...clone,
78477
+ ...evt.contractId !== "" && {
78478
+ contractId: new contract.Contract(evt.contractId)
78479
+ },
78480
+ topic: (evt.topic ?? []).map((topic) => scVal.ScVal.fromXdr(topic, "base64")),
78481
+ value: scVal.ScVal.fromXdr(evt.value, "base64")
78482
+ };
78483
+ }
78484
+ function parseRawQueryEvents(raw) {
78485
+ return {
77737
78486
  events: (raw.events ?? []).map((evt) => {
77738
- const clone = { ...evt };
77739
- delete clone.contractId;
77740
- return {
77741
- ...clone,
77742
- ...evt.contractId !== "" && {
77743
- contractId: new contract.Contract(evt.contractId)
77744
- },
77745
- topic: (evt.topic ?? []).map((topic) => scVal.ScVal.fromXdr(topic, "base64")),
77746
- value: scVal.ScVal.fromXdr(evt.value, "base64")
77747
- };
77748
- })
78487
+ const { value } = evt;
78488
+ if (typeof value !== "string") {
78489
+ throw new Error(
78490
+ 'queryEvents event has no base64 value; was xdrFormat "json"?'
78491
+ );
78492
+ }
78493
+ return parseRawEvent({ ...evt, value });
78494
+ }),
78495
+ ...raw.cursor !== void 0 && { cursor: raw.cursor },
78496
+ scanStatus: raw.scanStatus,
78497
+ scannedLedger: raw.scannedLedger,
78498
+ oldestLedger: raw.oldestLedger,
78499
+ latestLedger: raw.latestLedger
77749
78500
  };
77750
78501
  }
77751
78502
  function parseRawLedgerEntries(raw) {
@@ -77877,6 +78628,7 @@ exports.parseRawEvents = parseRawEvents;
77877
78628
  exports.parseRawLatestLedger = parseRawLatestLedger;
77878
78629
  exports.parseRawLedger = parseRawLedger;
77879
78630
  exports.parseRawLedgerEntries = parseRawLedgerEntries;
78631
+ exports.parseRawQueryEvents = parseRawQueryEvents;
77880
78632
  exports.parseRawSendTransaction = parseRawSendTransaction;
77881
78633
  exports.parseRawSimulation = parseRawSimulation;
77882
78634
  exports.parseRawTransactions = parseRawTransactions;
@@ -77902,11 +78654,11 @@ __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stell
77902
78654
  var keypair = __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
77903
78655
  var strkey = __webpack_require__(/*! ../base/strkey.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/strkey.js");
77904
78656
  var base64 = __webpack_require__(/*! ../base/util/base64.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/base64.js");
78657
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
77905
78658
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
77906
78659
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
77907
78660
  var address = __webpack_require__(/*! ../base/address.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/address.js");
77908
78661
  var account = __webpack_require__(/*! ../base/account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/account.js");
77909
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
77910
78662
  var scval = __webpack_require__(/*! ../base/scval.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/scval.js");
77911
78663
  var contract = __webpack_require__(/*! ../base/contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/contract.js");
77912
78664
  __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
@@ -77934,6 +78686,87 @@ var Durability = /* @__PURE__ */ ((Durability2) => {
77934
78686
  return Durability2;
77935
78687
  })(Durability || {});
77936
78688
  const DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
78689
+ const MAX_TIMEOUT_MS = 2 ** 31 - 1;
78690
+ function isSet(value) {
78691
+ return value !== void 0 && value !== null;
78692
+ }
78693
+ function encodeQueryEventsNumber(name, value, max = Number.MAX_SAFE_INTEGER) {
78694
+ if (!Number.isInteger(value) || value < 0 || value > max) {
78695
+ throw new TypeError(
78696
+ `queryEvents ${name} must be an integer from 0 to ${max}`
78697
+ );
78698
+ }
78699
+ return value;
78700
+ }
78701
+ function encodeQueryEventsTopic(name, topic) {
78702
+ if (topic === "*") {
78703
+ throw new TypeError(
78704
+ `queryEvents filter ${name} cannot be "*"; omit it to match any value`
78705
+ );
78706
+ }
78707
+ if (typeof topic === "string") {
78708
+ return topic;
78709
+ }
78710
+ if (typeof topic === "object" && topic !== null && typeof topic.toXdr === "function") {
78711
+ return topic.toXdr("base64");
78712
+ }
78713
+ throw new TypeError(
78714
+ `queryEvents filter ${name} must be a base64 string or an ScVal`
78715
+ );
78716
+ }
78717
+ function encodeQueryEventsFilter(filter) {
78718
+ if (typeof filter !== "object" || filter === null) {
78719
+ throw new TypeError("queryEvents filter must be an object");
78720
+ }
78721
+ const f = filter;
78722
+ const out = {};
78723
+ if (isSet(f.type) && f.type !== "") {
78724
+ out.type = f.type;
78725
+ }
78726
+ if (isSet(f.contractId) && f.contractId !== "") {
78727
+ out.contractId = f.contractId;
78728
+ }
78729
+ for (const key of ["topic0", "topic1", "topic2", "topic3"]) {
78730
+ if (isSet(f[key]) && f[key] !== "") {
78731
+ out[key] = encodeQueryEventsTopic(key, f[key]);
78732
+ }
78733
+ }
78734
+ return out;
78735
+ }
78736
+ function encodeQueryEventsRequest(request) {
78737
+ const r = request;
78738
+ const rangeKeySet = ["minLedger", "maxLedger", "order", "filters"].some(
78739
+ (key) => isSet(r[key])
78740
+ );
78741
+ if ("cursor" in r && (isSet(r.cursor) || !rangeKeySet) && (typeof r.cursor !== "string" || r.cursor === "")) {
78742
+ throw new TypeError("queryEvents cursor must be a non-empty string");
78743
+ }
78744
+ const out = {};
78745
+ for (const key of ["minLedger", "maxLedger"]) {
78746
+ if (isSet(r[key])) {
78747
+ const value = encodeQueryEventsNumber(key, r[key], 2 ** 32 - 1);
78748
+ if (value !== 0) {
78749
+ out[key] = value;
78750
+ }
78751
+ }
78752
+ }
78753
+ if (isSet(r.order) && r.order !== "") {
78754
+ out.order = r.order;
78755
+ }
78756
+ if (isSet(r.filters)) {
78757
+ if (!Array.isArray(r.filters)) {
78758
+ throw new TypeError("queryEvents filters must be an array");
78759
+ }
78760
+ out.filters = r.filters.map(encodeQueryEventsFilter);
78761
+ }
78762
+ if (isSet(r.cursor)) {
78763
+ out.cursor = r.cursor;
78764
+ }
78765
+ if (isSet(r.limit)) {
78766
+ out.limit = encodeQueryEventsNumber("limit", r.limit);
78767
+ }
78768
+ return out;
78769
+ }
77937
78770
  const BasicSleepStrategy = (_iter) => 1e3;
77938
78771
  const LinearSleepStrategy = (iter) => 1e3 * iter;
77939
78772
  function findCreatedAccountSequenceInTransactionMeta(meta) {
@@ -77965,6 +78798,20 @@ function findCreatedAccountSequenceInTransactionMeta(meta) {
77965
78798
  }
77966
78799
  throw new Error("No account created in transaction");
77967
78800
  }
78801
+ function containsMuxedAddress(val) {
78802
+ switch (val.type) {
78803
+ case "scvAddress":
78804
+ return val.value.type === "scAddressTypeMuxedAccount" || val.value.type === "scAddressTypeMuxedContract";
78805
+ case "scvVec":
78806
+ return (val.value ?? []).some(containsMuxedAddress);
78807
+ case "scvMap":
78808
+ return (val.value ?? []).some(
78809
+ (e) => containsMuxedAddress(e.key) || containsMuxedAddress(e.val)
78810
+ );
78811
+ default:
78812
+ return false;
78813
+ }
78814
+ }
77968
78815
  function contractSpecTypeName(td) {
77969
78816
  if (td.type === "scSpecTypeUdt") {
77970
78817
  return td.value.name.toString();
@@ -77992,7 +78839,13 @@ class RpcServer {
77992
78839
  httpClient;
77993
78840
  constructor(serverURL, opts = {}) {
77994
78841
  this.serverURL = new URL(serverURL);
77995
- this.httpClient = axios.createHttpClient(opts.headers);
78842
+ const { timeout } = opts;
78843
+ if (timeout !== void 0 && !(Number.isInteger(timeout) && timeout >= 0 && timeout <= MAX_TIMEOUT_MS)) {
78844
+ throw new Error(
78845
+ `timeout must be 0 or a whole number of milliseconds up to ${MAX_TIMEOUT_MS}, got ${String(timeout)}`
78846
+ );
78847
+ }
78848
+ this.httpClient = axios.createHttpClient(opts.headers, timeout);
77996
78849
  if (this.serverURL.protocol !== "https:" && !opts.allowHttp) {
77997
78850
  throw new Error(
77998
78851
  "Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set"
@@ -78174,8 +79027,8 @@ class RpcServer {
78174
79027
  * @returns Resolves with balance entry details
78175
79028
  * when available.
78176
79029
  *
78177
- * @throws If the supplied `address` is not a valid account or
78178
- * contract strkey.
79030
+ * @throws If the supplied `address` is not a valid account or contract
79031
+ * strkey, or is a muxed address (`M...` or `W...`).
78179
79032
  *
78180
79033
  * @example
78181
79034
  * ```ts
@@ -78221,6 +79074,7 @@ class RpcServer {
78221
79074
  } else if (strkey.StrKey.isValidContract(addr)) {
78222
79075
  return this.getSACBalance(addr, asset, networkPassphrase);
78223
79076
  }
79077
+ address.assertNotMuxed(addr, "has no balance of its own; use its base address");
78224
79078
  throw new Error(`invalid address: ${address$1}`);
78225
79079
  }
78226
79080
  /**
@@ -78262,6 +79116,9 @@ class RpcServer {
78262
79116
  * or 'persistent' (the default), see {@link rpc.Durability}.
78263
79117
  * @returns The current data value
78264
79118
  *
79119
+ * @throws If `contract` is a muxed address, or `key` contains a muxed
79120
+ * address (`M...` or `W...`).
79121
+ *
78265
79122
  * **Warning:** If the data entry in question is a 'temporary' entry, it's
78266
79123
  * entirely possible that it has expired out of existence.
78267
79124
  *
@@ -78281,6 +79138,12 @@ class RpcServer {
78281
79138
  */
78282
79139
  async getContractData(contract$1, key, durability = "persistent" /* Persistent */) {
78283
79140
  let scAddress;
79141
+ if (typeof contract$1 === "string" || contract$1 instanceof address.Address) {
79142
+ address.assertNotMuxed(
79143
+ contract$1,
79144
+ "cannot own contract data; use its base address"
79145
+ );
79146
+ }
78284
79147
  if (typeof contract$1 === "string") {
78285
79148
  scAddress = new contract.Contract(contract$1).address().toScAddress();
78286
79149
  } else if (contract$1 instanceof address.Address) {
@@ -78290,6 +79153,11 @@ class RpcServer {
78290
79153
  } else {
78291
79154
  throw new TypeError(`unknown contract type: ${contract$1}`);
78292
79155
  }
79156
+ if (containsMuxedAddress(key)) {
79157
+ throw new TypeError(
79158
+ "contract data keys cannot contain muxed addresses (M... or W...)"
79159
+ );
79160
+ }
78293
79161
  let xdrDurability;
78294
79162
  switch (durability) {
78295
79163
  case "temporary" /* Temporary */:
@@ -78308,9 +79176,8 @@ class RpcServer {
78308
79176
  durability: xdrDurability
78309
79177
  })
78310
79178
  );
78311
- try {
78312
- return await this.getLedgerEntry(contractKey);
78313
- } catch {
79179
+ const { entries } = await this.getLedgerEntries(contractKey);
79180
+ if (entries.length !== 1) {
78314
79181
  throw {
78315
79182
  code: 404,
78316
79183
  message: `Contract data not found for ${address.Address.fromScAddress(
@@ -78318,6 +79185,7 @@ class RpcServer {
78318
79185
  ).toString()} with key ${key.toXdr("base64")} and durability: ${durability}`
78319
79186
  };
78320
79187
  }
79188
+ return entries[0];
78321
79189
  }
78322
79190
  /**
78323
79191
  * Retrieves the deployed contract instance for a given contract ID.
@@ -78900,6 +79768,43 @@ class RpcServer {
78900
79768
  }
78901
79769
  );
78902
79770
  }
79771
+ /**
79772
+ * Fetch one page of contract and system events with the `queryEvents`
79773
+ * method, which only the archival RPC node serves (in beta). To page, send
79774
+ * `{ cursor, limit }` from the response while `scanStatus` is `HAS_MORE`,
79775
+ * wait and retry on `WAITING_FOR_LEDGERS`, and stop on `OLDEST_REACHED` or
79776
+ * `COMPLETE`.
79777
+ *
79778
+ * @param request - a ledger range query or a cursor continuation
79779
+ * @returns one page of parsed events and the scan status
79780
+ *
79781
+ * @example
79782
+ * ```ts
79783
+ * let res = await server.queryEvents({ minLedger: 1000, limit: 50 });
79784
+ * for (;;) {
79785
+ * handle(res.events);
79786
+ * if (res.scanStatus === rpc.Api.QueryEventsScanStatus.WAITING_FOR_LEDGERS) {
79787
+ * await new Promise((resolve) => setTimeout(resolve, 5000));
79788
+ * } else if (res.scanStatus !== rpc.Api.QueryEventsScanStatus.HAS_MORE) {
79789
+ * break;
79790
+ * }
79791
+ * res = await server.queryEvents({ cursor: res.cursor!, limit: 50 });
79792
+ * }
79793
+ * ```
79794
+ */
79795
+ async queryEvents(request) {
79796
+ return this._queryEvents(encodeQueryEventsRequest(request)).then(
79797
+ parsers.parseRawQueryEvents
79798
+ );
79799
+ }
79800
+ async _queryEvents(request) {
79801
+ return jsonrpc.postObject(
79802
+ this.httpClient,
79803
+ this.serverURL.toString(),
79804
+ "queryEvents",
79805
+ request
79806
+ );
79807
+ }
78903
79808
  /**
78904
79809
  * Fetch metadata about the network this Soroban RPC server is connected to.
78905
79810
  *
@@ -79361,7 +80266,7 @@ class RpcServer {
79361
80266
  * entry details if and only if the request returned a valid balance ledger
79362
80267
  * entry. If it doesn't, the `balanceEntry` field will not exist.
79363
80268
  *
79364
- * @throws If `address` is not a valid contract ID (C...).
80269
+ * @throws If `address` is not a valid contract ID (`C...`).
79365
80270
  *
79366
80271
  * @see getLedgerEntries
79367
80272
  * @see https://developers.stellar.org/docs/tokens/stellar-asset-contract
@@ -79387,6 +80292,10 @@ class RpcServer {
79387
80292
  async getSACBalance(address$1, sac, networkPassphrase) {
79388
80293
  const addressString = address$1 instanceof address.Address ? address$1.toString() : address$1;
79389
80294
  if (!strkey.StrKey.isValidContract(addressString)) {
80295
+ address.assertNotMuxed(
80296
+ addressString,
80297
+ "has no balance of its own; use its base address"
80298
+ );
79390
80299
  throw new TypeError(`expected contract ID, got ${addressString}`);
79391
80300
  }
79392
80301
  const passphrase = networkPassphrase ?? await this.getNetwork().then((n) => n.passphrase);
@@ -79495,6 +80404,7 @@ class RpcServer {
79495
80404
  exports.BasicSleepStrategy = BasicSleepStrategy;
79496
80405
  exports.Durability = Durability;
79497
80406
  exports.LinearSleepStrategy = LinearSleepStrategy;
80407
+ exports.MAX_TIMEOUT_MS = MAX_TIMEOUT_MS;
79498
80408
  exports.RpcServer = RpcServer;
79499
80409
  //# sourceMappingURL=server.js.map
79500
80410
 
@@ -79516,11 +80426,11 @@ __webpack_require__(/*! uint8array-extras */ "../../node_modules/uint8array-extr
79516
80426
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
79517
80427
  __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
79518
80428
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
80429
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
79519
80430
  var operation = __webpack_require__(/*! ../base/operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/operation.js");
79520
80431
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
80432
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
79521
80433
  var transaction_builder = __webpack_require__(/*! ../base/transaction_builder.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction_builder.js");
79522
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
79523
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
79524
80434
  var api = __webpack_require__(/*! ./api.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/rpc/api.js");
79525
80435
  var parsers = __webpack_require__(/*! ./parsers.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/rpc/parsers.js");
79526
80436
 
@@ -79565,7 +80475,7 @@ function assembleTransaction(raw, simulation) {
79565
80475
  }
79566
80476
  }
79567
80477
  if (rawSorobanData) {
79568
- if (classicFeeNum - rawSorobanData.resourceFee > BigInt(0)) {
80478
+ if (classicFeeNum >= rawSorobanData.resourceFee) {
79569
80479
  classicFeeNum -= rawSorobanData.resourceFee;
79570
80480
  }
79571
80481
  }
@@ -79621,18 +80531,24 @@ exports.assembleTransaction = assembleTransaction;
79621
80531
  var smolToml = __webpack_require__(/*! smol-toml */ "../../node_modules/smol-toml/dist/index.cjs");
79622
80532
  var fetchClient = __webpack_require__(/*! ../http-client/fetch-client.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/http-client/fetch-client.js");
79623
80533
  var config = __webpack_require__(/*! ../config.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/config.js");
80534
+ var utils = __webpack_require__(/*! ./utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/stellartoml/utils.js");
79624
80535
 
79625
80536
  const STELLAR_TOML_MAX_SIZE = 100 * 1024;
80537
+ const STELLAR_TOML_PATH = "/.well-known/stellar.toml";
80538
+ const INVALID_DOMAIN_CHARS = /[\s@/?#\\]/;
80539
+ const TRAILING_SEPARATORS = /[/\\]+$/;
79626
80540
  class Resolver {
79627
80541
  /**
79628
80542
  * Returns a parsed `stellar.toml` file for a given domain.
79629
80543
  * @see {@link https://developers.stellar.org/docs/tokens/publishing-asset-info | Stellar.toml doc}
79630
80544
  *
79631
- * @param domain - Domain to get stellar.toml file for
80545
+ * @param domain - Domain to get stellar.toml file for. Must be a host name with an optional port; surrounding whitespace and a trailing `/` are ignored.
79632
80546
  * @param opts - (optional) Options object
79633
80547
  * - `allowHttp` (optional): Allow connecting to http servers. This must be set to false in production deployments!
79634
80548
  * - `timeout` (optional): Allow a timeout. Allows user to avoid nasty lag due to TOML resolve issue.
80549
+ * - `allowedRedirects` (optional): The number of redirects to follow, as 0 or a whole number up to `Number.MAX_SAFE_INTEGER`, default: 0. Outside Node, the SDK relies on the runtime to refuse redirects. In a browser, the Fetch build cannot count redirects, so a value above 0 follows up to the browser's own limit. The Axios build in a browser, and both builds in React Native, follow redirects whatever this value is.
79635
80550
  * @returns A `Promise` that resolves to the parsed stellar.toml object
80551
+ * @throws `Error` if `domain` is not a plain host name, or `allowedRedirects` is not valid, before any request is made
79636
80552
  *
79637
80553
  * @example
79638
80554
  * ```ts
@@ -79641,7 +80557,7 @@ class Resolver {
79641
80557
  * // stellarToml in an object representing domain stellar.toml file.
79642
80558
  * })
79643
80559
  * .catch(error => {
79644
- * // stellar.toml does not exist or is invalid
80560
+ * // domain is invalid, or stellar.toml does not exist or is invalid
79645
80561
  * });
79646
80562
  * ```
79647
80563
  */
@@ -79650,7 +80566,19 @@ class Resolver {
79650
80566
  const allowHttp = typeof opts.allowHttp === "undefined" ? config.Config.isAllowHttp() : opts.allowHttp;
79651
80567
  const timeout = typeof opts.timeout === "undefined" ? config.Config.getTimeout() : opts.timeout;
79652
80568
  const protocol = allowHttp ? "http" : "https";
79653
- return fetchClient.fetchClient.get(`${protocol}://${domain}/.well-known/stellar.toml`, {
80569
+ const name = String(domain).trim().replace(TRAILING_SEPARATORS, "");
80570
+ let url;
80571
+ try {
80572
+ url = new URL(`${protocol}://${name}${STELLAR_TOML_PATH}`);
80573
+ } catch {
80574
+ }
80575
+ if (!url || INVALID_DOMAIN_CHARS.test(name) || url.host.includes("%") || url.href !== `${protocol}://${url.host}${STELLAR_TOML_PATH}`) {
80576
+ throw new Error(
80577
+ `Invalid domain: ${JSON.stringify(domain)}. A domain must be a host name with an optional port.`
80578
+ );
80579
+ }
80580
+ utils.validateAllowedRedirects(opts.allowedRedirects);
80581
+ return fetchClient.fetchClient.get(url.href, {
79654
80582
  maxRedirects: opts.allowedRedirects ?? 0,
79655
80583
  maxContentLength: STELLAR_TOML_MAX_SIZE,
79656
80584
  cancelToken: timeout ? new CancelToken(
@@ -79688,6 +80616,32 @@ exports.STELLAR_TOML_MAX_SIZE = STELLAR_TOML_MAX_SIZE;
79688
80616
  //# sourceMappingURL=index.js.map
79689
80617
 
79690
80618
 
80619
+ /***/ }),
80620
+
80621
+ /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/stellartoml/utils.js":
80622
+ /*!****************************************************************************!*\
80623
+ !*** ../../node_modules/@stellar/stellar-sdk/lib/cjs/stellartoml/utils.js ***!
80624
+ \****************************************************************************/
80625
+ /***/ ((__unused_webpack_module, exports) => {
80626
+
80627
+ "use strict";
80628
+
80629
+
80630
+ function validateAllowedRedirects(allowedRedirects) {
80631
+ if (allowedRedirects === void 0 || allowedRedirects === null) {
80632
+ return;
80633
+ }
80634
+ if (typeof allowedRedirects !== "number" || !Number.isSafeInteger(allowedRedirects) || allowedRedirects < 0) {
80635
+ throw new Error(
80636
+ `allowedRedirects must be 0 or a whole number up to ${Number.MAX_SAFE_INTEGER}, got ${String(allowedRedirects)}`
80637
+ );
80638
+ }
80639
+ }
80640
+
80641
+ exports.validateAllowedRedirects = validateAllowedRedirects;
80642
+ //# sourceMappingURL=utils.js.map
80643
+
80644
+
79691
80645
  /***/ }),
79692
80646
 
79693
80647
  /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/utils.js":
@@ -79737,9 +80691,35 @@ exports.Utils = Utils;
79737
80691
  "use strict";
79738
80692
 
79739
80693
 
80694
+ function encodeSegment(segment) {
80695
+ const value = typeof segment === "number" || typeof segment === "bigint" ? String(segment) : segment;
80696
+ if (typeof value !== "string") {
80697
+ throw new TypeError(
80698
+ `expected a string, number or bigint path segment, not ${typeof value}`
80699
+ );
80700
+ }
80701
+ if (value === "" || value === "." || value === "..") {
80702
+ throw new TypeError(
80703
+ `expected a single non-empty path segment, not ${JSON.stringify(value)}`
80704
+ );
80705
+ }
80706
+ try {
80707
+ return encodeURIComponent(value);
80708
+ } catch {
80709
+ throw new TypeError(
80710
+ `expected a well-formed path segment, not ${JSON.stringify(value)}`
80711
+ );
80712
+ }
80713
+ }
79740
80714
  function stringifyTemplateValue(value) {
79741
80715
  return Array.isArray(value) ? value.join(",") : value.toString();
79742
80716
  }
80717
+ function expandPlaceholders(template, variables, encode) {
80718
+ return template.replace(/\{([^?][^}]*)\}/g, (_match, name) => {
80719
+ const value = variables[name];
80720
+ return typeof value === "undefined" ? "" : encode(value);
80721
+ });
80722
+ }
79743
80723
  function expandUriTemplate(template, variables, baseUrl) {
79744
80724
  const queryNames = [];
79745
80725
  const withoutQueryTemplate = template.replace(
@@ -79749,12 +80729,13 @@ function expandUriTemplate(template, variables, baseUrl) {
79749
80729
  return "";
79750
80730
  }
79751
80731
  );
79752
- const expanded = withoutQueryTemplate.replace(
79753
- /\{([^?][^}]*)\}/g,
79754
- (_match, name) => {
79755
- const value = variables[name];
79756
- return typeof value === "undefined" ? "" : encodeURIComponent(stringifyTemplateValue(value));
79757
- }
80732
+ const queryStart = withoutQueryTemplate.indexOf("?");
80733
+ const pathTemplate = queryStart === -1 ? withoutQueryTemplate : withoutQueryTemplate.slice(0, queryStart);
80734
+ const queryTemplate = queryStart === -1 ? "" : withoutQueryTemplate.slice(queryStart);
80735
+ const expanded = expandPlaceholders(pathTemplate, variables, encodeSegment) + expandPlaceholders(
80736
+ queryTemplate,
80737
+ variables,
80738
+ (value) => encodeURIComponent(stringifyTemplateValue(value))
79758
80739
  );
79759
80740
  const url = new URL(expanded, baseUrl);
79760
80741
  queryNames.forEach((name) => {
@@ -79766,6 +80747,7 @@ function expandUriTemplate(template, variables, baseUrl) {
79766
80747
  return url.toString();
79767
80748
  }
79768
80749
 
80750
+ exports.encodeSegment = encodeSegment;
79769
80751
  exports.expandUriTemplate = expandUriTemplate;
79770
80752
  //# sourceMappingURL=url.js.map
79771
80753
 
@@ -79787,6 +80769,7 @@ var uint8arrayExtras = __webpack_require__(/*! uint8array-extras */ "../../node_
79787
80769
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
79788
80770
  var keypair = __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
79789
80771
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
80772
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
79790
80773
  var base64 = __webpack_require__(/*! ../base/util/base64.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/base64.js");
79791
80774
  var transaction = __webpack_require__(/*! ../base/transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/transaction.js");
79792
80775
  var fee_bump_transaction = __webpack_require__(/*! ../base/fee_bump_transaction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/fee_bump_transaction.js");
@@ -79794,8 +80777,7 @@ var transaction_builder = __webpack_require__(/*! ../base/transaction_builder.js
79794
80777
  var operation = __webpack_require__(/*! ../base/operation.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/operation.js");
79795
80778
  var memo = __webpack_require__(/*! ../base/memo.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/memo.js");
79796
80779
  var account = __webpack_require__(/*! ../base/account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/account.js");
79797
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
79798
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
80780
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
79799
80781
  var errors = __webpack_require__(/*! ./errors.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/webauth/errors.js");
79800
80782
  var utils$1 = __webpack_require__(/*! ./utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/webauth/utils.js");
79801
80783
  var utils = __webpack_require__(/*! ../utils.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/utils.js");
@@ -79831,6 +80813,9 @@ function buildChallengeTx(serverKeypair, clientAccountID, homeDomain, timeout =
79831
80813
  if (!clientSigningKey) {
79832
80814
  throw Error("clientSigningKey is required if clientDomain is provided");
79833
80815
  }
80816
+ if (clientSigningKey === serverKeypair.publicKey()) {
80817
+ throw Error("clientSigningKey cannot be the server's public key");
80818
+ }
79834
80819
  builder.addOperation(
79835
80820
  operation.Operation.manageData({
79836
80821
  name: `client_domain`,
@@ -79969,6 +80954,16 @@ function readChallengeTx(challengeTx, serverAccountID, networkPassphrase, homeDo
79969
80954
  "The transaction has operations that are not of type 'manageData'"
79970
80955
  );
79971
80956
  }
80957
+ if (op.name === "client_domain" && !op.source) {
80958
+ throw new errors.InvalidChallengeError(
80959
+ "The transaction's 'client_domain' operation should contain a source account"
80960
+ );
80961
+ }
80962
+ if (op.name === "client_domain" && op.source === serverAccountID) {
80963
+ throw new errors.InvalidChallengeError(
80964
+ "The transaction's 'client_domain' operation source account should not be the server account"
80965
+ );
80966
+ }
79972
80967
  if (op.source !== serverAccountID && op.name !== "client_domain") {
79973
80968
  throw new errors.InvalidChallengeError(
79974
80969
  "The transaction has operations that are unrecognized"
@@ -80072,16 +81067,15 @@ function verifyChallengeTxSigners(challengeTx, serverAccountID, networkPassphras
80072
81067
  if (signersFound.length !== tx.signatures.length) {
80073
81068
  throw new errors.InvalidChallengeError("Transaction has unrecognized signatures");
80074
81069
  }
80075
- signersFound.splice(signersFound.indexOf(serverKP.publicKey()), 1);
80076
- if (clientSigningKey) {
80077
- signersFound.splice(signersFound.indexOf(clientSigningKey), 1);
80078
- }
80079
- if (signersFound.length === 0) {
81070
+ const clientSignersFound = signersFound.filter(
81071
+ (signer) => signer !== serverKP.publicKey() && signer !== clientSigningKey
81072
+ );
81073
+ if (clientSignersFound.length === 0) {
80080
81074
  throw new errors.InvalidChallengeError(
80081
81075
  "None of the given signers match the transaction signatures"
80082
81076
  );
80083
81077
  }
80084
- return signersFound;
81078
+ return clientSignersFound;
80085
81079
  }
80086
81080
  function verifyChallengeTxThreshold(challengeTx, serverAccountID, networkPassphrase, threshold, signerSummary, homeDomains, webAuthDomain) {
80087
81081
  const signers = signerSummary.map((signer) => signer.key);
@@ -80175,10 +81169,10 @@ __webpack_require__(/*! @noble/hashes/sha2.js */ "../../node_modules/@noble/hash
80175
81169
  __webpack_require__(/*! ../base/signing.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/signing.js");
80176
81170
  var keypair = __webpack_require__(/*! ../base/keypair.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/keypair.js");
80177
81171
  __webpack_require__(/*! @exodus/bytes/base32.js */ "../../node_modules/@exodus/bytes/base32.js");
81172
+ __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
81173
+ __webpack_require__(/*! ../base/util/decode_encode_muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/decode_encode_muxed_account.js");
80178
81174
  __webpack_require__(/*! ../base/util/continued_fraction.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/continued_fraction.js");
80179
81175
  __webpack_require__(/*! ../base/util/bignumber.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/util/bignumber.js");
80180
- __webpack_require__(/*! ../base/muxed_account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/base/muxed_account.js");
80181
- __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
80182
81176
  var errors = __webpack_require__(/*! ./errors.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/webauth/errors.js");
80183
81177
 
80184
81178
  function gatherTxSigners(transaction, signers) {
@@ -87022,6 +88016,7 @@ exports.ConfigUpgradeSet = ConfigUpgradeSet;
87022
88016
 
87023
88017
  const CONTRACT_COST_COUNT_LIMIT = 1024;
87024
88018
  const SC_SPEC_DOC_LIMIT = 1024;
88019
+ const SC_SPEC_TYPE_NAME_LIMIT = 1024;
87025
88020
  const SCSYMBOL_LIMIT = 32;
87026
88021
  const MASK_ACCOUNT_FLAGS = 7;
87027
88022
  const MASK_ACCOUNT_FLAGS_V17 = 15;
@@ -87053,6 +88048,7 @@ exports.MAX_OPS_PER_TX = MAX_OPS_PER_TX;
87053
88048
  exports.MAX_SIGNERS = MAX_SIGNERS;
87054
88049
  exports.SCSYMBOL_LIMIT = SCSYMBOL_LIMIT;
87055
88050
  exports.SC_SPEC_DOC_LIMIT = SC_SPEC_DOC_LIMIT;
88051
+ exports.SC_SPEC_TYPE_NAME_LIMIT = SC_SPEC_TYPE_NAME_LIMIT;
87056
88052
  exports.TX_ADVERT_VECTOR_MAX_SIZE = TX_ADVERT_VECTOR_MAX_SIZE;
87057
88053
  exports.TX_DEMAND_VECTOR_MAX_SIZE = TX_DEMAND_VECTOR_MAX_SIZE;
87058
88054
  //# sourceMappingURL=constants.js.map
@@ -87653,6 +88649,42 @@ class ContractCostType extends enumValue.EnumValue {
87653
88649
  static bn254FrPow = new ContractCostType("bn254FrPow", 83);
87654
88650
  static bn254FrInv = new ContractCostType("bn254FrInv", 84);
87655
88651
  static bn254G1Msm = new ContractCostType("bn254G1Msm", 85);
88652
+ static mlDsa44DecodeVerifyingKey = new ContractCostType(
88653
+ "mlDsa44DecodeVerifyingKey",
88654
+ 86
88655
+ );
88656
+ static mlDsa65DecodeVerifyingKey = new ContractCostType(
88657
+ "mlDsa65DecodeVerifyingKey",
88658
+ 87
88659
+ );
88660
+ static mlDsa87DecodeVerifyingKey = new ContractCostType(
88661
+ "mlDsa87DecodeVerifyingKey",
88662
+ 88
88663
+ );
88664
+ static mlDsa44DecodeSignature = new ContractCostType(
88665
+ "mlDsa44DecodeSignature",
88666
+ 89
88667
+ );
88668
+ static mlDsa65DecodeSignature = new ContractCostType(
88669
+ "mlDsa65DecodeSignature",
88670
+ 90
88671
+ );
88672
+ static mlDsa87DecodeSignature = new ContractCostType(
88673
+ "mlDsa87DecodeSignature",
88674
+ 91
88675
+ );
88676
+ static verifyMlDsa44Sig = new ContractCostType(
88677
+ "verifyMlDsa44Sig",
88678
+ 92
88679
+ );
88680
+ static verifyMlDsa65Sig = new ContractCostType(
88681
+ "verifyMlDsa65Sig",
88682
+ 93
88683
+ );
88684
+ static verifyMlDsa87Sig = new ContractCostType(
88685
+ "verifyMlDsa87Sig",
88686
+ 94
88687
+ );
87656
88688
  static schema = jsXdr.enumType("ContractCostType", {
87657
88689
  wasmInsnExec: 0,
87658
88690
  memAlloc: 1,
@@ -87739,7 +88771,16 @@ class ContractCostType extends enumValue.EnumValue {
87739
88771
  bn254FrMul: 82,
87740
88772
  bn254FrPow: 83,
87741
88773
  bn254FrInv: 84,
87742
- bn254G1Msm: 85
88774
+ bn254G1Msm: 85,
88775
+ mlDsa44DecodeVerifyingKey: 86,
88776
+ mlDsa65DecodeVerifyingKey: 87,
88777
+ mlDsa87DecodeVerifyingKey: 88,
88778
+ mlDsa44DecodeSignature: 89,
88779
+ mlDsa65DecodeSignature: 90,
88780
+ mlDsa87DecodeSignature: 91,
88781
+ verifyMlDsa44Sig: 92,
88782
+ verifyMlDsa65Sig: 93,
88783
+ verifyMlDsa87Sig: 94
87743
88784
  });
87744
88785
  static fromValue(value) {
87745
88786
  return enumValue.enumFromValue(
@@ -99082,6 +100123,11 @@ class MemoText extends MemoBase {
99082
100123
  super();
99083
100124
  this.text = text instanceof xdrString.XdrString ? text : new xdrString.XdrString(text);
99084
100125
  }
100126
+ /**
100127
+ * Decodes `text` leniently: invalid bytes become U+FFFD, so a
100128
+ * value rebuilt from this string can differ on the wire. Use
100129
+ * `text` to keep the bytes.
100130
+ */
99085
100131
  get value() {
99086
100132
  return this.text.toString();
99087
100133
  }
@@ -99380,6 +100426,51 @@ exports.MuxedAccountMuxedEd25519 = MuxedAccountMuxedEd25519;
99380
100426
  //# sourceMappingURL=muxed-account.js.map
99381
100427
 
99382
100428
 
100429
+ /***/ }),
100430
+
100431
+ /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-contract.js":
100432
+ /*!***************************************************************************************!*\
100433
+ !*** ../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-contract.js ***!
100434
+ \***************************************************************************************/
100435
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
100436
+
100437
+ "use strict";
100438
+
100439
+
100440
+ var jsXdr = __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
100441
+ var xdrValue = __webpack_require__(/*! ../values/xdr-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/values/xdr-value.js");
100442
+ var contractId = __webpack_require__(/*! ./contract-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/contract-id.js");
100443
+
100444
+ class MuxedContract extends xdrValue.XdrValue {
100445
+ id;
100446
+ contractId;
100447
+ static schema = jsXdr.struct("MuxedContract", {
100448
+ id: jsXdr.uint64(),
100449
+ contractId: contractId.ContractId.schema
100450
+ });
100451
+ constructor(input) {
100452
+ super();
100453
+ this.id = input.id;
100454
+ this.contractId = input.contractId;
100455
+ }
100456
+ toXdrObject() {
100457
+ return {
100458
+ id: this.id,
100459
+ contractId: this.contractId.toXdrObject()
100460
+ };
100461
+ }
100462
+ static fromXdrObject(wire) {
100463
+ return new MuxedContract({
100464
+ id: wire.id,
100465
+ contractId: contractId.ContractId.fromXdrObject(wire.contractId)
100466
+ });
100467
+ }
100468
+ }
100469
+
100470
+ exports.MuxedContract = MuxedContract;
100471
+ //# sourceMappingURL=muxed-contract.js.map
100472
+
100473
+
99383
100474
  /***/ }),
99384
100475
 
99385
100476
  /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-ed25519-account.js":
@@ -104849,13 +105940,18 @@ class ScAddressType extends enumValue.EnumValue {
104849
105940
  "scAddressTypeLiquidityPool",
104850
105941
  4
104851
105942
  );
105943
+ static scAddressTypeMuxedContract = new ScAddressType(
105944
+ "scAddressTypeMuxedContract",
105945
+ 5
105946
+ );
104852
105947
  static schema = enumValue.withMemberPrefix(
104853
105948
  jsXdr.enumType("ScAddressType", {
104854
105949
  scAddressTypeAccount: 0,
104855
105950
  scAddressTypeContract: 1,
104856
105951
  scAddressTypeMuxedAccount: 2,
104857
105952
  scAddressTypeClaimableBalance: 3,
104858
- scAddressTypeLiquidityPool: 4
105953
+ scAddressTypeLiquidityPool: 4,
105954
+ scAddressTypeMuxedContract: 5
104859
105955
  }),
104860
105956
  "scAddressType"
104861
105957
  );
@@ -104898,6 +105994,7 @@ var contractId = __webpack_require__(/*! ./contract-id.js */ "../../node_modules
104898
105994
  var muxedEd25519Account = __webpack_require__(/*! ./muxed-ed25519-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-ed25519-account.js");
104899
105995
  var claimableBalanceId = __webpack_require__(/*! ./claimable-balance-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/claimable-balance-id.js");
104900
105996
  var poolId = __webpack_require__(/*! ./pool-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/pool-id.js");
105997
+ var muxedContract = __webpack_require__(/*! ./muxed-contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-contract.js");
104901
105998
 
104902
105999
  class ScAddressBase extends xdrValue.XdrValue {
104903
106000
  constructor() {
@@ -104927,6 +106024,11 @@ class ScAddressBase extends xdrValue.XdrValue {
104927
106024
  "scAddressTypeLiquidityPool",
104928
106025
  4,
104929
106026
  jsXdr.field("liquidityPoolId", poolId.PoolId.schema)
106027
+ ),
106028
+ jsXdr.case(
106029
+ "scAddressTypeMuxedContract",
106030
+ 5,
106031
+ jsXdr.field("muxedContract", muxedContract.MuxedContract.schema)
104930
106032
  )
104931
106033
  ]
104932
106034
  });
@@ -104945,6 +106047,9 @@ class ScAddressBase extends xdrValue.XdrValue {
104945
106047
  static scAddressTypeLiquidityPool(liquidityPoolId) {
104946
106048
  return new ScAddressLiquidityPool(liquidityPoolId);
104947
106049
  }
106050
+ static scAddressTypeMuxedContract(muxedContract) {
106051
+ return new ScAddressMuxedContract(muxedContract);
106052
+ }
104948
106053
  static fromXdrObject(wire) {
104949
106054
  switch (wire.type) {
104950
106055
  case 0:
@@ -104963,6 +106068,10 @@ class ScAddressBase extends xdrValue.XdrValue {
104963
106068
  return new ScAddressLiquidityPool(
104964
106069
  poolId.PoolId.fromXdrObject(wire.liquidityPoolId)
104965
106070
  );
106071
+ case 5:
106072
+ return new ScAddressMuxedContract(
106073
+ muxedContract.MuxedContract.fromXdrObject(wire.muxedContract)
106074
+ );
104966
106075
  }
104967
106076
  throw new jsXdr.XdrError(
104968
106077
  `ScAddress: unknown type ${wire.type}`
@@ -105051,6 +106160,20 @@ class ScAddressLiquidityPool extends ScAddressBase {
105051
106160
  return { type: 4, liquidityPoolId: this.liquidityPoolId.toXdrObject() };
105052
106161
  }
105053
106162
  }
106163
+ class ScAddressMuxedContract extends ScAddressBase {
106164
+ type = "scAddressTypeMuxedContract";
106165
+ muxedContract;
106166
+ constructor(muxedContract) {
106167
+ super();
106168
+ this.muxedContract = muxedContract;
106169
+ }
106170
+ get value() {
106171
+ return this.muxedContract;
106172
+ }
106173
+ toXdrObject() {
106174
+ return { type: 5, muxedContract: this.muxedContract.toXdrObject() };
106175
+ }
106176
+ }
105054
106177
  const ScAddress = ScAddressBase;
105055
106178
 
105056
106179
  exports.ScAddress = ScAddress;
@@ -105059,6 +106182,7 @@ exports.ScAddressClaimableBalance = ScAddressClaimableBalance;
105059
106182
  exports.ScAddressContract = ScAddressContract;
105060
106183
  exports.ScAddressLiquidityPool = ScAddressLiquidityPool;
105061
106184
  exports.ScAddressMuxedAccount = ScAddressMuxedAccount;
106185
+ exports.ScAddressMuxedContract = ScAddressMuxedContract;
105062
106186
  //# sourceMappingURL=sc-address.js.map
105063
106187
 
105064
106188
 
@@ -106305,7 +107429,7 @@ class ScSpecEventV0 extends xdrValue.XdrValue {
106305
107429
  static schema = jsXdr.struct("ScSpecEventV0", {
106306
107430
  doc: xdrString.xdrString(1024),
106307
107431
  lib: xdrString.xdrString(80),
106308
- name: xdrString.xdrString(32),
107432
+ name: xdrString.xdrString(1024),
106309
107433
  prefixTopics: jsXdr.array(xdrString.xdrString(32), 2),
106310
107434
  params: jsXdr.array(scSpecEventParamV0.ScSpecEventParamV0.schema, jsXdr.UNBOUNDED_MAX_LENGTH),
106311
107435
  dataFormat: scSpecEventDataFormat.ScSpecEventDataFormat.schema
@@ -107196,7 +108320,7 @@ var xdrString = __webpack_require__(/*! ../values/xdr-string.js */ "../../node_m
107196
108320
  class ScSpecTypeUdt extends xdrValue.XdrValue {
107197
108321
  name;
107198
108322
  static schema = jsXdr.struct("ScSpecTypeUdt", {
107199
- name: xdrString.xdrString(60)
108323
+ name: xdrString.xdrString(1024)
107200
108324
  });
107201
108325
  constructor(input) {
107202
108326
  super();
@@ -107390,7 +108514,7 @@ class ScSpecUdtEnumV0 extends xdrValue.XdrValue {
107390
108514
  {
107391
108515
  doc: xdrString.xdrString(1024),
107392
108516
  lib: xdrString.xdrString(80),
107393
- name: xdrString.xdrString(60),
108517
+ name: xdrString.xdrString(1024),
107394
108518
  cases: jsXdr.array(scSpecUdtEnumCaseV0.ScSpecUdtEnumCaseV0.schema, jsXdr.UNBOUNDED_MAX_LENGTH)
107395
108519
  }
107396
108520
  );
@@ -107502,7 +108626,7 @@ class ScSpecUdtErrorEnumV0 extends xdrValue.XdrValue {
107502
108626
  {
107503
108627
  doc: xdrString.xdrString(1024),
107504
108628
  lib: xdrString.xdrString(80),
107505
- name: xdrString.xdrString(60),
108629
+ name: xdrString.xdrString(1024),
107506
108630
  cases: jsXdr.array(scSpecUdtErrorEnumCaseV0.ScSpecUdtErrorEnumCaseV0.schema, jsXdr.UNBOUNDED_MAX_LENGTH)
107507
108631
  }
107508
108632
  );
@@ -107615,7 +108739,7 @@ class ScSpecUdtStructV0 extends xdrValue.XdrValue {
107615
108739
  {
107616
108740
  doc: xdrString.xdrString(1024),
107617
108741
  lib: xdrString.xdrString(80),
107618
- name: xdrString.xdrString(60),
108742
+ name: xdrString.xdrString(1024),
107619
108743
  fields: jsXdr.array(scSpecUdtStructFieldV0.ScSpecUdtStructFieldV0.schema, jsXdr.UNBOUNDED_MAX_LENGTH)
107620
108744
  }
107621
108745
  );
@@ -107942,7 +109066,7 @@ class ScSpecUdtUnionV0 extends xdrValue.XdrValue {
107942
109066
  {
107943
109067
  doc: xdrString.xdrString(1024),
107944
109068
  lib: xdrString.xdrString(80),
107945
- name: xdrString.xdrString(60),
109069
+ name: xdrString.xdrString(1024),
107946
109070
  cases: jsXdr.array(scSpecUdtUnionCaseV0.ScSpecUdtUnionCaseV0.schema, jsXdr.UNBOUNDED_MAX_LENGTH)
107947
109071
  }
107948
109072
  );
@@ -108553,6 +109677,11 @@ class ScValString extends ScValBase {
108553
109677
  super();
108554
109678
  this.str = str instanceof xdrString.XdrString ? str : new xdrString.XdrString(str);
108555
109679
  }
109680
+ /**
109681
+ * Decodes `str` leniently: invalid bytes become U+FFFD, so a
109682
+ * value rebuilt from this string can differ on the wire. Use
109683
+ * `str` to keep the bytes.
109684
+ */
108556
109685
  get value() {
108557
109686
  return this.str.toString();
108558
109687
  }
@@ -108567,6 +109696,11 @@ class ScValSymbol extends ScValBase {
108567
109696
  super();
108568
109697
  this.sym = sym instanceof xdrString.XdrString ? sym : new xdrString.XdrString(sym);
108569
109698
  }
109699
+ /**
109700
+ * Decodes `sym` leniently: invalid bytes become U+FFFD, so a
109701
+ * value rebuilt from this string can differ on the wire. Use
109702
+ * `sym` to keep the bytes.
109703
+ */
108570
109704
  get value() {
108571
109705
  return this.sym.toString();
108572
109706
  }
@@ -108666,6 +109800,11 @@ class ScValExecutableTag extends ScValBase {
108666
109800
  super();
108667
109801
  this.executableTag = executableTag instanceof xdrString.XdrString ? executableTag : new xdrString.XdrString(executableTag);
108668
109802
  }
109803
+ /**
109804
+ * Decodes `executableTag` leniently: invalid bytes become U+FFFD, so a
109805
+ * value rebuilt from this string can differ on the wire. Use
109806
+ * `executableTag` to keep the bytes.
109807
+ */
108669
109808
  get value() {
108670
109809
  return this.executableTag.toString();
108671
109810
  }
@@ -112913,6 +114052,8 @@ var xdrValue = __webpack_require__(/*! ../values/xdr-value.js */ "../../node_mod
112913
114052
  var stellarValueType = __webpack_require__(/*! ./stellar-value-type.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-type.js");
112914
114053
  var ledgerCloseValueSignature = __webpack_require__(/*! ./ledger-close-value-signature.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-close-value-signature.js");
112915
114054
  var stellarValueProposedValue = __webpack_require__(/*! ./stellar-value-proposed-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-value.js");
114055
+ var stellarValueSignedMsValue = __webpack_require__(/*! ./stellar-value-signed-ms-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-signed-ms-value.js");
114056
+ var stellarValueProposedMsValue = __webpack_require__(/*! ./stellar-value-proposed-ms-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-ms-value.js");
112916
114057
 
112917
114058
  class StellarValueExtBase extends xdrValue.XdrValue {
112918
114059
  constructor() {
@@ -112938,6 +114079,16 @@ class StellarValueExtBase extends xdrValue.XdrValue {
112938
114079
  "stellarValueEmptyTxSet",
112939
114080
  2,
112940
114081
  jsXdr.field("proposedValue", stellarValueProposedValue.StellarValueProposedValue.schema)
114082
+ ),
114083
+ jsXdr.case(
114084
+ "stellarValueSignedMs",
114085
+ 3,
114086
+ jsXdr.field("signedMsValue", stellarValueSignedMsValue.StellarValueSignedMsValue.schema)
114087
+ ),
114088
+ jsXdr.case(
114089
+ "stellarValueEmptyTxSetMs",
114090
+ 4,
114091
+ jsXdr.field("proposedMsValue", stellarValueProposedMsValue.StellarValueProposedMsValue.schema)
112941
114092
  )
112942
114093
  ],
112943
114094
  switchKey: "v"
@@ -112952,6 +114103,12 @@ class StellarValueExtBase extends xdrValue.XdrValue {
112952
114103
  static stellarValueEmptyTxSet(proposedValue) {
112953
114104
  return new StellarValueExtEmptyTxSet(proposedValue);
112954
114105
  }
114106
+ static stellarValueSignedMs(signedMsValue) {
114107
+ return new StellarValueExtSignedMs(signedMsValue);
114108
+ }
114109
+ static stellarValueEmptyTxSetMs(proposedMsValue) {
114110
+ return new StellarValueExtEmptyTxSetMs(proposedMsValue);
114111
+ }
112955
114112
  static fromXdrObject(wire) {
112956
114113
  switch (wire.v) {
112957
114114
  case 0:
@@ -112964,6 +114121,14 @@ class StellarValueExtBase extends xdrValue.XdrValue {
112964
114121
  return new StellarValueExtEmptyTxSet(
112965
114122
  stellarValueProposedValue.StellarValueProposedValue.fromXdrObject(wire.proposedValue)
112966
114123
  );
114124
+ case 3:
114125
+ return new StellarValueExtSignedMs(
114126
+ stellarValueSignedMsValue.StellarValueSignedMsValue.fromXdrObject(wire.signedMsValue)
114127
+ );
114128
+ case 4:
114129
+ return new StellarValueExtEmptyTxSetMs(
114130
+ stellarValueProposedMsValue.StellarValueProposedMsValue.fromXdrObject(wire.proposedMsValue)
114131
+ );
112967
114132
  }
112968
114133
  throw new jsXdr.XdrError(
112969
114134
  `StellarValueExt: unknown v ${wire.v}`
@@ -113016,15 +114181,111 @@ class StellarValueExtEmptyTxSet extends StellarValueExtBase {
113016
114181
  return { v: 2, proposedValue: this.proposedValue.toXdrObject() };
113017
114182
  }
113018
114183
  }
114184
+ class StellarValueExtSignedMs extends StellarValueExtBase {
114185
+ type = "stellarValueSignedMs";
114186
+ signedMsValue;
114187
+ constructor(signedMsValue) {
114188
+ super();
114189
+ this.signedMsValue = signedMsValue;
114190
+ }
114191
+ get value() {
114192
+ return this.signedMsValue;
114193
+ }
114194
+ toXdrObject() {
114195
+ return { v: 3, signedMsValue: this.signedMsValue.toXdrObject() };
114196
+ }
114197
+ }
114198
+ class StellarValueExtEmptyTxSetMs extends StellarValueExtBase {
114199
+ type = "stellarValueEmptyTxSetMs";
114200
+ proposedMsValue;
114201
+ constructor(proposedMsValue) {
114202
+ super();
114203
+ this.proposedMsValue = proposedMsValue;
114204
+ }
114205
+ get value() {
114206
+ return this.proposedMsValue;
114207
+ }
114208
+ toXdrObject() {
114209
+ return { v: 4, proposedMsValue: this.proposedMsValue.toXdrObject() };
114210
+ }
114211
+ }
113019
114212
  const StellarValueExt = StellarValueExtBase;
113020
114213
 
113021
114214
  exports.StellarValueExt = StellarValueExt;
113022
114215
  exports.StellarValueExtBasic = StellarValueExtBasic;
113023
114216
  exports.StellarValueExtEmptyTxSet = StellarValueExtEmptyTxSet;
114217
+ exports.StellarValueExtEmptyTxSetMs = StellarValueExtEmptyTxSetMs;
113024
114218
  exports.StellarValueExtSigned = StellarValueExtSigned;
114219
+ exports.StellarValueExtSignedMs = StellarValueExtSignedMs;
113025
114220
  //# sourceMappingURL=stellar-value-ext.js.map
113026
114221
 
113027
114222
 
114223
+ /***/ }),
114224
+
114225
+ /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-ms-value.js":
114226
+ /*!********************************************************************************************************!*\
114227
+ !*** ../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-ms-value.js ***!
114228
+ \********************************************************************************************************/
114229
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
114230
+
114231
+ "use strict";
114232
+
114233
+
114234
+ var jsXdr = __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
114235
+ var xdrValue = __webpack_require__(/*! ../values/xdr-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/values/xdr-value.js");
114236
+ var hash = __webpack_require__(/*! ./hash.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/hash.js");
114237
+ var ledgerCloseValueSignature = __webpack_require__(/*! ./ledger-close-value-signature.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-close-value-signature.js");
114238
+
114239
+ class StellarValueProposedMsValue extends xdrValue.XdrValue {
114240
+ closeTimeMs;
114241
+ txSetHash;
114242
+ previousLedgerHash;
114243
+ previousLedgerVersion;
114244
+ lcValueSignature;
114245
+ static schema = jsXdr.struct(
114246
+ "StellarValueProposedMsValue",
114247
+ {
114248
+ closeTimeMs: jsXdr.uint64(),
114249
+ txSetHash: hash.Hash.schema,
114250
+ previousLedgerHash: hash.Hash.schema,
114251
+ previousLedgerVersion: jsXdr.uint32(),
114252
+ lcValueSignature: ledgerCloseValueSignature.LedgerCloseValueSignature.schema
114253
+ }
114254
+ );
114255
+ constructor(input) {
114256
+ super();
114257
+ this.closeTimeMs = input.closeTimeMs;
114258
+ this.txSetHash = input.txSetHash instanceof hash.Hash ? input.txSetHash : new hash.Hash(input.txSetHash);
114259
+ this.previousLedgerHash = input.previousLedgerHash instanceof hash.Hash ? input.previousLedgerHash : new hash.Hash(input.previousLedgerHash);
114260
+ this.previousLedgerVersion = input.previousLedgerVersion;
114261
+ this.lcValueSignature = input.lcValueSignature;
114262
+ }
114263
+ toXdrObject() {
114264
+ return {
114265
+ closeTimeMs: this.closeTimeMs,
114266
+ txSetHash: this.txSetHash.toXdrObject(),
114267
+ previousLedgerHash: this.previousLedgerHash.toXdrObject(),
114268
+ previousLedgerVersion: this.previousLedgerVersion,
114269
+ lcValueSignature: this.lcValueSignature.toXdrObject()
114270
+ };
114271
+ }
114272
+ static fromXdrObject(wire) {
114273
+ return new StellarValueProposedMsValue({
114274
+ closeTimeMs: wire.closeTimeMs,
114275
+ txSetHash: hash.Hash.fromXdrObject(wire.txSetHash),
114276
+ previousLedgerHash: hash.Hash.fromXdrObject(wire.previousLedgerHash),
114277
+ previousLedgerVersion: wire.previousLedgerVersion,
114278
+ lcValueSignature: ledgerCloseValueSignature.LedgerCloseValueSignature.fromXdrObject(
114279
+ wire.lcValueSignature
114280
+ )
114281
+ });
114282
+ }
114283
+ }
114284
+
114285
+ exports.StellarValueProposedMsValue = StellarValueProposedMsValue;
114286
+ //# sourceMappingURL=stellar-value-proposed-ms-value.js.map
114287
+
114288
+
113028
114289
  /***/ }),
113029
114290
 
113030
114291
  /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-value.js":
@@ -113086,6 +114347,56 @@ exports.StellarValueProposedValue = StellarValueProposedValue;
113086
114347
  //# sourceMappingURL=stellar-value-proposed-value.js.map
113087
114348
 
113088
114349
 
114350
+ /***/ }),
114351
+
114352
+ /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-signed-ms-value.js":
114353
+ /*!******************************************************************************************************!*\
114354
+ !*** ../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-signed-ms-value.js ***!
114355
+ \******************************************************************************************************/
114356
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
114357
+
114358
+ "use strict";
114359
+
114360
+
114361
+ var jsXdr = __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stellar/js-xdr/dist/js-xdr.cjs");
114362
+ var xdrValue = __webpack_require__(/*! ../values/xdr-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/values/xdr-value.js");
114363
+ var ledgerCloseValueSignature = __webpack_require__(/*! ./ledger-close-value-signature.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/ledger-close-value-signature.js");
114364
+
114365
+ class StellarValueSignedMsValue extends xdrValue.XdrValue {
114366
+ closeTimeMs;
114367
+ lcValueSignature;
114368
+ static schema = jsXdr.struct(
114369
+ "StellarValueSignedMsValue",
114370
+ {
114371
+ closeTimeMs: jsXdr.uint64(),
114372
+ lcValueSignature: ledgerCloseValueSignature.LedgerCloseValueSignature.schema
114373
+ }
114374
+ );
114375
+ constructor(input) {
114376
+ super();
114377
+ this.closeTimeMs = input.closeTimeMs;
114378
+ this.lcValueSignature = input.lcValueSignature;
114379
+ }
114380
+ toXdrObject() {
114381
+ return {
114382
+ closeTimeMs: this.closeTimeMs,
114383
+ lcValueSignature: this.lcValueSignature.toXdrObject()
114384
+ };
114385
+ }
114386
+ static fromXdrObject(wire) {
114387
+ return new StellarValueSignedMsValue({
114388
+ closeTimeMs: wire.closeTimeMs,
114389
+ lcValueSignature: ledgerCloseValueSignature.LedgerCloseValueSignature.fromXdrObject(
114390
+ wire.lcValueSignature
114391
+ )
114392
+ });
114393
+ }
114394
+ }
114395
+
114396
+ exports.StellarValueSignedMsValue = StellarValueSignedMsValue;
114397
+ //# sourceMappingURL=stellar-value-signed-ms-value.js.map
114398
+
114399
+
113089
114400
  /***/ }),
113090
114401
 
113091
114402
  /***/ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-type.js":
@@ -113113,11 +114424,21 @@ class StellarValueType extends enumValue.EnumValue {
113113
114424
  "stellarValueEmptyTxSet",
113114
114425
  2
113115
114426
  );
114427
+ static stellarValueSignedMs = new StellarValueType(
114428
+ "stellarValueSignedMs",
114429
+ 3
114430
+ );
114431
+ static stellarValueEmptyTxSetMs = new StellarValueType(
114432
+ "stellarValueEmptyTxSetMs",
114433
+ 4
114434
+ );
113116
114435
  static schema = enumValue.withMemberPrefix(
113117
114436
  jsXdr.enumType("StellarValueType", {
113118
114437
  stellarValueBasic: 0,
113119
114438
  stellarValueSigned: 1,
113120
- stellarValueEmptyTxSet: 2
114439
+ stellarValueEmptyTxSet: 2,
114440
+ stellarValueSignedMs: 3,
114441
+ stellarValueEmptyTxSetMs: 4
113121
114442
  }),
113122
114443
  "stellarValue"
113123
114444
  );
@@ -118152,6 +119473,7 @@ var memoType = __webpack_require__(/*! ./generated/memo-type.js */ "../../node_m
118152
119473
  var messageType = __webpack_require__(/*! ./generated/message-type.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/message-type.js");
118153
119474
  var muxedAccount = __webpack_require__(/*! ./generated/muxed-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account.js");
118154
119475
  var muxedAccountMed25519 = __webpack_require__(/*! ./generated/muxed-account-med25519.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-account-med25519.js");
119476
+ var muxedContract = __webpack_require__(/*! ./generated/muxed-contract.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-contract.js");
118155
119477
  var muxedEd25519Account = __webpack_require__(/*! ./generated/muxed-ed25519-account.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/muxed-ed25519-account.js");
118156
119478
  var nodeId = __webpack_require__(/*! ./generated/node-id.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/node-id.js");
118157
119479
  var offerEntry = __webpack_require__(/*! ./generated/offer-entry.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/offer-entry.js");
@@ -118290,7 +119612,9 @@ var stateArchivalSettings = __webpack_require__(/*! ./generated/state-archival-s
118290
119612
  var stellarMessage = __webpack_require__(/*! ./generated/stellar-message.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-message.js");
118291
119613
  var stellarValue = __webpack_require__(/*! ./generated/stellar-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value.js");
118292
119614
  var stellarValueExt = __webpack_require__(/*! ./generated/stellar-value-ext.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-ext.js");
119615
+ var stellarValueProposedMsValue = __webpack_require__(/*! ./generated/stellar-value-proposed-ms-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-ms-value.js");
118293
119616
  var stellarValueProposedValue = __webpack_require__(/*! ./generated/stellar-value-proposed-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-proposed-value.js");
119617
+ var stellarValueSignedMsValue = __webpack_require__(/*! ./generated/stellar-value-signed-ms-value.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-signed-ms-value.js");
118294
119618
  var stellarValueType = __webpack_require__(/*! ./generated/stellar-value-type.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stellar-value-type.js");
118295
119619
  var storedDebugTransactionSet = __webpack_require__(/*! ./generated/stored-debug-transaction-set.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stored-debug-transaction-set.js");
118296
119620
  var storedTransactionSet = __webpack_require__(/*! ./generated/stored-transaction-set.js */ "../../node_modules/@stellar/stellar-sdk/lib/cjs/xdr/generated/stored-transaction-set.js");
@@ -118988,6 +120312,7 @@ exports.MuxedAccount = muxedAccount.MuxedAccount;
118988
120312
  exports.MuxedAccountEd25519 = muxedAccount.MuxedAccountEd25519;
118989
120313
  exports.MuxedAccountMuxedEd25519 = muxedAccount.MuxedAccountMuxedEd25519;
118990
120314
  exports.MuxedAccountMed25519 = muxedAccountMed25519.MuxedAccountMed25519;
120315
+ exports.MuxedContract = muxedContract.MuxedContract;
118991
120316
  exports.MuxedEd25519Account = muxedEd25519Account.MuxedEd25519Account;
118992
120317
  exports.NodeId = nodeId.NodeId;
118993
120318
  exports.OfferEntry = offerEntry.OfferEntry;
@@ -119158,6 +120483,7 @@ exports.ScAddressClaimableBalance = scAddress.ScAddressClaimableBalance;
119158
120483
  exports.ScAddressContract = scAddress.ScAddressContract;
119159
120484
  exports.ScAddressLiquidityPool = scAddress.ScAddressLiquidityPool;
119160
120485
  exports.ScAddressMuxedAccount = scAddress.ScAddressMuxedAccount;
120486
+ exports.ScAddressMuxedContract = scAddress.ScAddressMuxedContract;
119161
120487
  exports.ScAddressType = scAddressType.ScAddressType;
119162
120488
  exports.ScBytes = scBytes.ScBytes;
119163
120489
  exports.ScEnvMetaEntry = scEnvMetaEntry.ScEnvMetaEntry;
@@ -119385,8 +120711,12 @@ exports.StellarValue = stellarValue.StellarValue;
119385
120711
  exports.StellarValueExt = stellarValueExt.StellarValueExt;
119386
120712
  exports.StellarValueExtBasic = stellarValueExt.StellarValueExtBasic;
119387
120713
  exports.StellarValueExtEmptyTxSet = stellarValueExt.StellarValueExtEmptyTxSet;
120714
+ exports.StellarValueExtEmptyTxSetMs = stellarValueExt.StellarValueExtEmptyTxSetMs;
119388
120715
  exports.StellarValueExtSigned = stellarValueExt.StellarValueExtSigned;
120716
+ exports.StellarValueExtSignedMs = stellarValueExt.StellarValueExtSignedMs;
120717
+ exports.StellarValueProposedMsValue = stellarValueProposedMsValue.StellarValueProposedMsValue;
119389
120718
  exports.StellarValueProposedValue = stellarValueProposedValue.StellarValueProposedValue;
120719
+ exports.StellarValueSignedMsValue = stellarValueSignedMsValue.StellarValueSignedMsValue;
119390
120720
  exports.StellarValueType = stellarValueType.StellarValueType;
119391
120721
  exports.StoredDebugTransactionSet = storedDebugTransactionSet.StoredDebugTransactionSet;
119392
120722
  exports.StoredTransactionSet = storedTransactionSet.StoredTransactionSet;
@@ -119521,6 +120851,7 @@ exports.MAX_OPS_PER_TX = constants.MAX_OPS_PER_TX;
119521
120851
  exports.MAX_SIGNERS = constants.MAX_SIGNERS;
119522
120852
  exports.SCSYMBOL_LIMIT = constants.SCSYMBOL_LIMIT;
119523
120853
  exports.SC_SPEC_DOC_LIMIT = constants.SC_SPEC_DOC_LIMIT;
120854
+ exports.SC_SPEC_TYPE_NAME_LIMIT = constants.SC_SPEC_TYPE_NAME_LIMIT;
119524
120855
  exports.TX_ADVERT_VECTOR_MAX_SIZE = constants.TX_ADVERT_VECTOR_MAX_SIZE;
119525
120856
  exports.TX_DEMAND_VECTOR_MAX_SIZE = constants.TX_DEMAND_VECTOR_MAX_SIZE;
119526
120857
  exports.Int128 = int128.Int128;
@@ -120289,6 +121620,7 @@ function asDataView(bytes) {
120289
121620
  return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
120290
121621
  }
120291
121622
  function med25519ToStrkey(w) {
121623
+ bigintParts.assertBigIntFits(w.id, false, 64, "MuxedEd25519Account.id");
120292
121624
  const payload = new Uint8Array(40);
120293
121625
  payload.set(w.ed25519, 0);
120294
121626
  asDataView(payload).setBigUint64(32, w.id);
@@ -120301,6 +121633,12 @@ function med25519FromStrkey(json) {
120301
121633
  ed25519: raw.subarray(0, 32)
120302
121634
  };
120303
121635
  }
121636
+ function muxedContractToStrkey(w) {
121637
+ return strkey.StrKey.encodeMuxedContract(strkey.packMuxedContract(w.contractId, w.id));
121638
+ }
121639
+ function muxedContractFromStrkey(json) {
121640
+ return strkey.unpackMuxedContract(strkey.StrKey.decodeMuxedContract(json));
121641
+ }
120304
121642
  function signedPayloadToStrkey(w) {
120305
121643
  const buf = new Uint8Array(32 + 4 + roundUp4(w.payload.length));
120306
121644
  buf.set(w.ed25519, 0);
@@ -120372,6 +121710,17 @@ const MED25519_OVERRIDE = {
120372
121710
  };
120373
121711
  OVERRIDES.set("MuxedEd25519Account", MED25519_OVERRIDE);
120374
121712
  OVERRIDES.set("MuxedAccountMed25519", MED25519_OVERRIDE);
121713
+ OVERRIDES.set("MuxedContract", {
121714
+ toJson(wire) {
121715
+ return muxedContractToStrkey(wire);
121716
+ },
121717
+ fromJson(json) {
121718
+ if (typeof json !== "string") {
121719
+ throw new jsXdr.XdrError("MuxedContract: expected W-strkey string");
121720
+ }
121721
+ return muxedContractFromStrkey(json);
121722
+ }
121723
+ });
120375
121724
  OVERRIDES.set("SignerKey", {
120376
121725
  toJson(wire) {
120377
121726
  const w = wire;
@@ -120442,6 +121791,14 @@ OVERRIDES.set("ScAddress", {
120442
121791
  }
120443
121792
  case 4:
120444
121793
  return strkey.StrKey.encodeLiquidityPool(w.liquidityPoolId);
121794
+ case 5:
121795
+ return muxedContractToStrkey(w.muxedContract);
121796
+ default: {
121797
+ const unknown = w;
121798
+ throw new jsXdr.XdrError(
121799
+ `ScAddress: unsupported type ${unknown.type}`
121800
+ );
121801
+ }
120445
121802
  }
120446
121803
  },
120447
121804
  fromJson(json) {
@@ -120479,6 +121836,9 @@ OVERRIDES.set("ScAddress", {
120479
121836
  liquidityPoolId: strkey.StrKey.decodeLiquidityPool(json)
120480
121837
  };
120481
121838
  }
121839
+ if (json.startsWith("W")) {
121840
+ return { type: 5, muxedContract: muxedContractFromStrkey(json) };
121841
+ }
120482
121842
  throw new jsXdr.XdrError(`ScAddress: unsupported strkey prefix in ${json}`);
120483
121843
  }
120484
121844
  });
@@ -120659,6 +122019,12 @@ var jsXdr = __webpack_require__(/*! @stellar/js-xdr */ "../../node_modules/@stel
120659
122019
  const HEX = "0123456789abcdef";
120660
122020
  class XdrString {
120661
122021
  bytes;
122022
+ /**
122023
+ * A string input is UTF-8 encoded. A lone surrogate (for example from
122024
+ * a `slice()` that cuts a surrogate pair) encodes as U+FFFD with no
122025
+ * error. Check `String.prototype.isWellFormed()` (ES2024) first when the
122026
+ * input can be cut text.
122027
+ */
120662
122028
  constructor(input) {
120663
122029
  if (input instanceof XdrString) {
120664
122030
  this.bytes = input.bytes.slice();
@@ -132445,7 +133811,7 @@ function includes(array, value) {
132445
133811
  /***/ ((module) => {
132446
133812
 
132447
133813
  "use strict";
132448
- module.exports = JSON.parse('{"name":"@stellar/typescript-wallet-sdk","version":"5.1.0","engines":{"node":">=22.12.0"},"browser":"./lib/bundle_browser.js","main":"./lib/bundle.js","types":"./lib/index.d.ts","license":"Apache-2.0","private":false,"devDependencies":{"@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.23.3","@stellar/prettier-config":"^1.0.1","@stellar/tsconfig":"^1.0.2","@types/jest":"^29.4.0","@types/lodash":"^4.14.194","@types/node":"^22.10.2","@types/sinon":"^10.0.15","@typescript-eslint/eslint-plugin":"^6.7.5","@typescript-eslint/parser":"^6.7.5","babel-jest":"^29.4.1","crypto-browserify":"^3.12.0","dotenv":"^16.3.1","eslint":"^8.51.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jsdoc":"^46.8.2","express":"^4.19.2","husky":"^8.0.0","jest":"^29.4.1","lint-staged":"^14.0.1","npm-run-all":"^4.1.5","playwright":"^1.43.1","prettier":"^2.0.5","pretty-quick":"^2.0.1","process":"^0.11.10","sinon":"^15.1.0","smol-toml":"^1.7.1","stream-browserify":"^3.0.0","ts-jest":"^29.0.5","ts-loader":"^9.4.2","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.7.3","webpack":"^5.83.1","webpack-cli":"^5.1.1"},"dependencies":{"@stablelib/base64":"^2.0.0","@stablelib/utf8":"^2.0.0","@stellar/stellar-sdk":"17.0.1","axios":"^1.4.0","https-browserify":"^1.0.0","jws":"^4.0.0","lodash":"^4.17.21","query-string":"^7.1.3","stream-http":"^3.2.0","tweetnacl":"^1.0.3","uint8array-extras":"^1.5.0","url":"^0.11.0","util":"^0.12.5","utility-types":"^3.10.0","vm-browserify":"^1.1.2"},"scripts":{"test":"jest --watchAll","test:ci":"jest --ci","test:e2e:ci":"jest --config jest.e2e.config.js --ci","test:recovery:ci":"jest --config jest.integration.config.js recovery.test.ts --ci","test:anchorplatform:ci":"yarn jest --config jest.integration.config.js anchorplatform.test.ts --ci","build:web":"webpack --config webpack.config.js","build:node":"webpack --env NODE=true --config webpack.config.js","build":"run-p build:web build:node","example:sep10Server":"ts-node examples/sep10/sep10Server.ts","example:sep10Wallet":"ts-node examples/sep10/sep10Wallet.ts","example:sep24":"ts-node examples/sep24/sep24.ts","example:sep12":"ts-node examples/sep12/sep12.ts"}}');
133814
+ module.exports = JSON.parse('{"name":"@stellar/typescript-wallet-sdk","version":"6.0.0","engines":{"node":">=22.12.0"},"browser":"./lib/bundle_browser.js","main":"./lib/bundle.js","types":"./lib/index.d.ts","license":"Apache-2.0","private":false,"devDependencies":{"@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.23.3","@stellar/prettier-config":"^1.0.1","@stellar/tsconfig":"^1.0.2","@types/jest":"^29.4.0","@types/lodash":"^4.14.194","@types/node":"^22.10.2","@types/sinon":"^10.0.15","@typescript-eslint/eslint-plugin":"^6.7.5","@typescript-eslint/parser":"^6.7.5","babel-jest":"^29.4.1","crypto-browserify":"^3.12.0","dotenv":"^16.3.1","eslint":"^8.51.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jsdoc":"^46.8.2","express":"^4.19.2","husky":"^8.0.0","jest":"^29.4.1","lint-staged":"^14.0.1","npm-run-all":"^4.1.5","playwright":"^1.43.1","prettier":"^2.0.5","pretty-quick":"^2.0.1","process":"^0.11.10","sinon":"^15.1.0","smol-toml":"^1.7.1","stream-browserify":"^3.0.0","ts-jest":"^29.0.5","ts-loader":"^9.4.2","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.7.3","webpack":"^5.83.1","webpack-cli":"^5.1.1"},"dependencies":{"@stablelib/base64":"^2.0.0","@stablelib/utf8":"^2.0.0","@stellar/stellar-sdk":"17.4.0","axios":"^1.4.0","https-browserify":"^1.0.0","jws":"^4.0.0","lodash":"^4.17.21","query-string":"^7.1.3","stream-http":"^3.2.0","tweetnacl":"^1.0.3","uint8array-extras":"^1.5.0","url":"^0.11.0","util":"^0.12.5","utility-types":"^3.10.0","vm-browserify":"^1.1.2"},"scripts":{"test":"jest --watchAll","test:ci":"jest --ci","test:e2e:ci":"jest --config jest.e2e.config.js --ci","test:recovery:ci":"jest --config jest.integration.config.js recovery.test.ts --ci","test:anchorplatform:ci":"yarn jest --config jest.integration.config.js anchorplatform.test.ts --ci","build:web":"webpack --config webpack.config.js","build:node":"webpack --env NODE=true --config webpack.config.js","build":"run-p build:web build:node","example:sep10Server":"ts-node examples/sep10/sep10Server.ts","example:sep10Wallet":"ts-node examples/sep10/sep10Wallet.ts","example:sep24":"ts-node examples/sep24/sep24.ts","example:sep12":"ts-node examples/sep12/sep12.ts"}}');
132449
133815
 
132450
133816
  /***/ }),
132451
133817