denotify-client 1.1.31 → 1.1.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -10913,7 +10913,7 @@ class Ft {
10913
10913
  if (!o)
10914
10914
  throw new Error("function not in ABI");
10915
10915
  return o.outputs.map((a, c) => ({
10916
- source: `function:${s.function}:${i}`,
10916
+ source: `function:${s.function}:${c}`,
10917
10917
  name: a.name,
10918
10918
  type: a.type,
10919
10919
  key: `func_${i}_ret_${c}`,
@@ -10925,11 +10925,15 @@ class Ft {
10925
10925
  );
10926
10926
  }
10927
10927
  async addFunction(e, t, r, s, i) {
10928
- console.log(i);
10929
- const o = new nh(e, s);
10930
- return o.interface.encodeFunctionData(t, r), i = i || await this.getAbiHash(s), console.log(i), this.data.push({
10928
+ const o = s.find((c) => c.name === t);
10929
+ if (!o)
10930
+ throw new Error("function not in ABI");
10931
+ if (o.type !== "function")
10932
+ throw new Error(`${o.name} is not a function, it has type ${o.type}`);
10933
+ const a = new nh(e, s);
10934
+ return a.interface.encodeFunctionData(t, r), i = i || await this.getAbiHash(s), this.data.push({
10931
10935
  address: e,
10932
- bytecode: o.interface.encodeFunctionData(t, r),
10936
+ bytecode: a.interface.encodeFunctionData(t, r),
10933
10937
  abiHash: i,
10934
10938
  function: t
10935
10939
  }), this;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "denotify-client",
3
3
  "private": false,
4
- "version": "1.1.31",
4
+ "version": "1.1.32",
5
5
  "main": "./dist/denotify-client.cjs",
6
6
  "module": "./dist/denotify-client.mjs",
7
7
  "types": "./dist/denotify-client.d.ts",