@toon-protocol/client 0.14.9 → 0.14.10

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.js CHANGED
@@ -5025,7 +5025,9 @@ var ToonClient = class {
5025
5025
  const tokens = this.config.preferredTokens;
5026
5026
  if (evmAddress && rpcUrls && tokens) {
5027
5027
  const chainKeys = this.config.supportedChains ?? Object.keys(rpcUrls);
5028
- const chainKey = chainKeys.find((c) => c.startsWith("evm") && rpcUrls[c] && tokens[c]);
5028
+ const usableEvm = (c) => c.startsWith("evm") && Boolean(rpcUrls[c]) && Boolean(tokens[c]);
5029
+ const settlementKeys = Object.keys(this.config.settlementAddresses ?? {});
5030
+ const chainKey = settlementKeys.find((c) => usableEvm(c)) ?? chainKeys.find(usableEvm);
5029
5031
  const rpcUrl = chainKey ? rpcUrls[chainKey] : void 0;
5030
5032
  const tokenAddress = chainKey ? tokens[chainKey] : void 0;
5031
5033
  if (chainKey && rpcUrl && tokenAddress) {