@aptos-labs/wallet-adapter-core 5.8.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -319,7 +319,7 @@ function _ts_generator(thisArg, body) {
319
319
  };
320
320
  }
321
321
  }
322
- var WALLET_ADAPTER_CORE_VERSION = "5.8.0";
322
+ var WALLET_ADAPTER_CORE_VERSION = "6.0.1";
323
323
  // src/WalletCore.ts
324
324
  import EventEmitter from "eventemitter3";
325
325
  import { AccountAddress, Aptos as Aptos2, Network as Network2, NetworkToChainId } from "@aptos-labs/ts-sdk";
@@ -620,6 +620,9 @@ var getAptosConfig = function(networkInfo, dappConfig) {
620
620
  if (!networkInfo) {
621
621
  throw new Error("Undefined network");
622
622
  }
623
+ var pluginSettings = {
624
+ TRANSACTION_SUBMITTER: dappConfig === null || dappConfig === void 0 ? void 0 : dappConfig.transactionSubmitter
625
+ };
623
626
  if (isAptosNetwork(networkInfo)) {
624
627
  var currentNetwork = convertNetwork(networkInfo);
625
628
  if (isAptosLiveNetwork(currentNetwork)) {
@@ -628,11 +631,13 @@ var getAptosConfig = function(networkInfo, dappConfig) {
628
631
  network: currentNetwork,
629
632
  clientConfig: {
630
633
  API_KEY: apiKey ? apiKey[currentNetwork] : void 0
631
- }
634
+ },
635
+ pluginSettings: pluginSettings
632
636
  });
633
637
  }
634
638
  return new AptosConfig({
635
- network: currentNetwork
639
+ network: currentNetwork,
640
+ pluginSettings: pluginSettings
636
641
  });
637
642
  }
638
643
  var knownNetworks = {
@@ -643,7 +648,8 @@ var getAptosConfig = function(networkInfo, dappConfig) {
643
648
  if (isKnownNetwork) {
644
649
  return new AptosConfig({
645
650
  network: Network.CUSTOM,
646
- fullnode: networkInfo.url
651
+ fullnode: networkInfo.url,
652
+ pluginSettings: pluginSettings
647
653
  });
648
654
  }
649
655
  }
@@ -1556,7 +1562,7 @@ var WalletCore = /*#__PURE__*/ function(EventEmitter) {
1556
1562
  */ function signAndSubmitTransaction(transactionInput) {
1557
1563
  var _this = this;
1558
1564
  return _async_to_generator(function() {
1559
- var ref, _transactionInput_options, _transactionInput_options1, aptosConfig2, aptos2, transaction2, signAndSubmitTransactionMethod, response3, response2, aptosConfig, aptos, transaction, signTransactionResponse, response, error, errMsg;
1565
+ var _this__dappConfig, ref, shouldUseTxnSubmitter, _transactionInput_options, _transactionInput_options1, aptosConfig2, aptos2, transaction2, signAndSubmitTransactionMethod, response3, response2, aptosConfig, aptos, transaction, signTransactionResponse, response, error, errMsg;
1560
1566
  return _ts_generator(this, function(_state) {
1561
1567
  switch(_state.label){
1562
1568
  case 0:
@@ -1578,7 +1584,8 @@ var WalletCore = /*#__PURE__*/ function(EventEmitter) {
1578
1584
  _this.ensureWalletExists(_this._wallet);
1579
1585
  _this.ensureAccountExists(_this._account);
1580
1586
  _this.recordEvent("sign_and_submit_transaction");
1581
- if (!_this._wallet.features["aptos:signAndSubmitTransaction"]) return [
1587
+ shouldUseTxnSubmitter = ((_this__dappConfig = _this._dappConfig) === null || _this__dappConfig === void 0 ? void 0 : _this__dappConfig.transactionSubmitter) !== void 0 || transactionInput.transactionSubmitter !== void 0;
1588
+ if (!(_this._wallet.features["aptos:signAndSubmitTransaction"] && !shouldUseTxnSubmitter)) return [
1582
1589
  3,
1583
1590
  5
1584
1591
  ];
@@ -1636,9 +1643,10 @@ var WalletCore = /*#__PURE__*/ function(EventEmitter) {
1636
1643
  return [
1637
1644
  4,
1638
1645
  aptos.transaction.build.simple({
1639
- sender: _this._account.address,
1646
+ sender: _this._account.address.toString(),
1640
1647
  data: transactionInput.data,
1641
- options: transactionInput.options
1648
+ options: transactionInput.options,
1649
+ withFeePayer: shouldUseTxnSubmitter
1642
1650
  })
1643
1651
  ];
1644
1652
  case 6:
@@ -1655,7 +1663,9 @@ var WalletCore = /*#__PURE__*/ function(EventEmitter) {
1655
1663
  4,
1656
1664
  _this.submitTransaction({
1657
1665
  transaction: transaction,
1658
- senderAuthenticator: signTransactionResponse.authenticator
1666
+ senderAuthenticator: signTransactionResponse.authenticator,
1667
+ transactionSubmitter: transactionInput.transactionSubmitter,
1668
+ pluginParams: transactionInput.pluginParams
1659
1669
  })
1660
1670
  ];
1661
1671
  case 8: