thirdweb 5.34.2 → 5.34.3

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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detectMethod = detectMethod;
4
4
  const viem_1 = require("viem");
5
- const get_bytecode_js_1 = require("../../contract/actions/get-bytecode.js");
5
+ const resolveImplementation_js_1 = require("./resolveImplementation.js");
6
6
  /**
7
7
  * Detects if the specified method is present in the contract bytecode.
8
8
  * @param options - The options for detecting the extension.
@@ -18,7 +18,7 @@ const get_bytecode_js_1 = require("../../contract/actions/get-bytecode.js");
18
18
  * @contract
19
19
  */
20
20
  async function detectMethod(options) {
21
- const bytecode = await (0, get_bytecode_js_1.getBytecode)(options.contract);
21
+ const { bytecode } = await (0, resolveImplementation_js_1.resolveImplementation)(options.contract);
22
22
  return detectMethodInBytecode({ bytecode, method: options.method });
23
23
  }
24
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"detectExtension.js","sourceRoot":"","sources":["../../../../src/utils/bytecode/detectExtension.ts"],"names":[],"mappings":";;AAyBA,oCAKC;AA7BD,+BAA0C;AAC1C,4EAAqE;AASrE;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,YAAY,CAChC,OAA+B;IAE/B,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAW,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrD,OAAO,sBAAsB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtE,CAAC;AAMD;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,OAAyC;IACvE,oEAAoE;IACpE,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,uDAAuD;IACvD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,M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object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = "5.34.2";
4
+ exports.version = "5.34.3";
5
5
  //# sourceMappingURL=version.js.map
@@ -1,5 +1,5 @@
1
1
  import { toFunctionSelector } from "viem";
2
- import { getBytecode } from "../../contract/actions/get-bytecode.js";
2
+ import { resolveImplementation } from "./resolveImplementation.js";
3
3
  /**
4
4
  * Detects if the specified method is present in the contract bytecode.
5
5
  * @param options - The options for detecting the extension.
@@ -15,7 +15,7 @@ import { getBytecode } from "../../contract/actions/get-bytecode.js";
15
15
  * @contract
16
16
  */
17
17
  export async function detectMethod(options) {
18
- const bytecode = await getBytecode(options.contract);
18
+ const { bytecode } = await resolveImplementation(options.contract);
19
19
  return detectMethodInBytecode({ bytecode, method: options.method });
20
20
  }
21
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"detectExtension.js","sourceRoot":"","sources":["../../../../src/utils/bytecode/detectExtension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AASrE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA+B;IAE/B,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrD,OAAO,sBAAsB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtE,CAAC;AAMD;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,OAAyC;IACvE,oEAAoE;IACpE,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,uDAAuD;IACvD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QAC9C,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5D,CAAC"}
1
+ {"version":3,"file":"detectExtension.js","sourceRoot":"","sources":["../../../../src/utils/bytecode/detectExtension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA+B;IAE/B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnE,OAAO,sBAAsB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AACtE,CAAC;AAMD;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,OAAyC;IACvE,oEAAoE;IACpE,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,uDAAuD;IACvD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QAC9C,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5D,CAAC"}
@@ -1,2 +1,2 @@
1
- export const version = "5.34.2";
1
+ export const version = "5.34.3";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"detectExtension.d.ts","sourceRoot":"","sources":["../../../../src/utils/bytecode/detectExtension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAGlB"}
1
+ {"version":3,"file":"detectExtension.d.ts","sourceRoot":"","sources":["../../../../src/utils/bytecode/detectExtension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAGlB"}
@@ -1,2 +1,2 @@
1
- export declare const version = "5.34.2";
1
+ export declare const version = "5.34.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thirdweb",
3
- "version": "5.34.2",
3
+ "version": "5.34.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -1,5 +1,8 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
  import { DOODLES_CONTRACT } from "~test/test-contracts.js";
3
+ import { TEST_CLIENT } from "../../../../test/src/test-clients.js";
4
+ import { defineChain } from "../../../chains/utils.js";
5
+ import { getContract } from "../../../contract/contract.js";
3
6
  import { getOwnedNFTs } from "./getOwnedNFTs.js";
4
7
 
5
8
  describe.runIf(process.env.TW_SECRET_KEY)("erc721.getOwnedNFTs", () => {
@@ -17,4 +20,18 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getOwnedNFTs", () => {
17
20
  expect(item.owner).toBe(owner);
18
21
  }
19
22
  });
23
+
24
+ it("should detect ownership functions", async () => {
25
+ const contract = getContract({
26
+ client: TEST_CLIENT,
27
+ chain: defineChain(421614),
28
+ address: "0x90450885977EE8F8F21AC79Fc2Dd51a18B13123E",
29
+ });
30
+
31
+ const ownedNFTs = await getOwnedNFTs({
32
+ contract,
33
+ owner: "0x1813D5Ff6f2B229a6Ba8FcDFa14004d91aa58e36",
34
+ });
35
+ expect(ownedNFTs.length).greaterThan(0);
36
+ });
20
37
  });
@@ -1,8 +1,8 @@
1
1
  import type { AbiFunction } from "abitype";
2
2
  import { toFunctionSelector } from "viem";
3
- import { getBytecode } from "../../contract/actions/get-bytecode.js";
4
3
  import type { ThirdwebContract } from "../../contract/contract.js";
5
4
  import type { PreparedMethod } from "../abi/prepare-method.js";
5
+ import { resolveImplementation } from "./resolveImplementation.js";
6
6
 
7
7
  type DetectExtensionOptions = {
8
8
  contract: ThirdwebContract;
@@ -26,7 +26,7 @@ type DetectExtensionOptions = {
26
26
  export async function detectMethod(
27
27
  options: DetectExtensionOptions,
28
28
  ): Promise<boolean> {
29
- const bytecode = await getBytecode(options.contract);
29
+ const { bytecode } = await resolveImplementation(options.contract);
30
30
  return detectMethodInBytecode({ bytecode, method: options.method });
31
31
  }
32
32
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.34.2";
1
+ export const version = "5.34.3";