damm-sdk 1.1.31-alpha.30 → 1.1.31-alpha.32

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.cjs CHANGED
@@ -44362,6 +44362,7 @@ __export(exports_src, {
44362
44362
  gnosisTrx: () => gnosisTrx,
44363
44363
  getGnosisTrxSimulationResult: () => getGnosisTrxSimulationResult,
44364
44364
  getAddressOrThrow: () => getAddressOrThrow,
44365
+ getAddressNameOrThrow: () => getAddressNameOrThrow,
44365
44366
  executeTrx: () => executeTrx,
44366
44367
  executeNextTx: () => executeNextTx,
44367
44368
  executeGnosisTrx: () => executeGnosisTrx,
@@ -54024,7 +54025,13 @@ var chainIdToName = {
54024
54025
  5000: "mantle",
54025
54026
  480: "worldchain",
54026
54027
  11155111: "sepolia",
54027
- 42220: "celo"
54028
+ 42220: "celo",
54029
+ 9745: "plasma",
54030
+ 999: "hyperevm",
54031
+ 59144: "linea",
54032
+ 43114: "avalanche",
54033
+ 100: "gnosis",
54034
+ 143: "monad"
54028
54035
  };
54029
54036
  function getAddressOrThrow(chainId, key) {
54030
54037
  const chainName = chainIdToName[chainId];
@@ -54047,6 +54054,40 @@ function getAddressOrThrow(chainId, key) {
54047
54054
  }
54048
54055
  return current;
54049
54056
  }
54057
+ function findAddressPath(obj, targetAddress, currentPath = []) {
54058
+ if (typeof obj === "string") {
54059
+ if (obj.toLowerCase() === targetAddress.toLowerCase()) {
54060
+ return currentPath;
54061
+ }
54062
+ return null;
54063
+ }
54064
+ if (typeof obj !== "object" || obj === null) {
54065
+ return null;
54066
+ }
54067
+ for (const [key, value] of Object.entries(obj)) {
54068
+ const newPath = [...currentPath, key];
54069
+ const result = findAddressPath(value, targetAddress, newPath);
54070
+ if (result !== null) {
54071
+ return result;
54072
+ }
54073
+ }
54074
+ return null;
54075
+ }
54076
+ function getAddressNameOrThrow(chainId, address) {
54077
+ const chainName = chainIdToName[chainId];
54078
+ if (!chainName) {
54079
+ throw new Error(`DAMM-sdk: Unsupported chainId: ${chainId}`);
54080
+ }
54081
+ const chainContracts = contractsRegistry_default[chainName];
54082
+ if (!chainContracts) {
54083
+ throw new Error(`DAMM-sdk: No contracts found for chainId: ${chainId} (${chainName})`);
54084
+ }
54085
+ const path = findAddressPath(chainContracts, address);
54086
+ if (path === null) {
54087
+ throw new Error(`DAMM-sdk: Address "${address}" not found for chainId ${chainId} (${chainName})`);
54088
+ }
54089
+ return path.join(".");
54090
+ }
54050
54091
 
54051
54092
  // src/integrations/gnosis/gnosis.multisend.ts
54052
54093
  var serializeCall = (call) => {
@@ -86411,4 +86452,4 @@ var simulateOrThrow = async (env2) => {
86411
86452
  };
86412
86453
  };
86413
86454
 
86414
- //# debugId=2AB548C7C0C64BCB64756E2164756E21
86455
+ //# debugId=02AFB586252DB89064756E2164756E21