thirdweb 5.112.1-nightly-144bb33ffdf4d07b5d7370328ee640cd68d877c8-20251114000335 → 5.112.2

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.
Files changed (45) hide show
  1. package/dist/cjs/adapters/eip1193/to-eip1193.js +9 -1
  2. package/dist/cjs/adapters/eip1193/to-eip1193.js.map +1 -1
  3. package/dist/cjs/utils/bytecode/resolveImplementation.js +21 -20
  4. package/dist/cjs/utils/bytecode/resolveImplementation.js.map +1 -1
  5. package/dist/cjs/utils/web/isMobile.js +4 -0
  6. package/dist/cjs/utils/web/isMobile.js.map +1 -1
  7. package/dist/cjs/version.js +1 -1
  8. package/dist/cjs/version.js.map +1 -1
  9. package/dist/cjs/wallets/create-wallet.js +21 -19
  10. package/dist/cjs/wallets/create-wallet.js.map +1 -1
  11. package/dist/cjs/wallets/eip5792/get-capabilities.js +4 -2
  12. package/dist/cjs/wallets/eip5792/get-capabilities.js.map +1 -1
  13. package/dist/cjs/wallets/injected/index.js +2 -2
  14. package/dist/cjs/wallets/injected/index.js.map +1 -1
  15. package/dist/esm/adapters/eip1193/to-eip1193.js +9 -1
  16. package/dist/esm/adapters/eip1193/to-eip1193.js.map +1 -1
  17. package/dist/esm/utils/bytecode/resolveImplementation.js +21 -20
  18. package/dist/esm/utils/bytecode/resolveImplementation.js.map +1 -1
  19. package/dist/esm/utils/web/isMobile.js +4 -0
  20. package/dist/esm/utils/web/isMobile.js.map +1 -1
  21. package/dist/esm/version.js +1 -1
  22. package/dist/esm/version.js.map +1 -1
  23. package/dist/esm/wallets/create-wallet.js +21 -19
  24. package/dist/esm/wallets/create-wallet.js.map +1 -1
  25. package/dist/esm/wallets/eip5792/get-capabilities.js +4 -2
  26. package/dist/esm/wallets/eip5792/get-capabilities.js.map +1 -1
  27. package/dist/esm/wallets/injected/index.js +2 -2
  28. package/dist/esm/wallets/injected/index.js.map +1 -1
  29. package/dist/scripts/bridge-widget.js +113 -113
  30. package/dist/types/adapters/eip1193/to-eip1193.d.ts.map +1 -1
  31. package/dist/types/utils/bytecode/resolveImplementation.d.ts.map +1 -1
  32. package/dist/types/utils/web/isMobile.d.ts.map +1 -1
  33. package/dist/types/version.d.ts +1 -1
  34. package/dist/types/version.d.ts.map +1 -1
  35. package/dist/types/wallets/create-wallet.d.ts.map +1 -1
  36. package/dist/types/wallets/eip5792/get-capabilities.d.ts +1 -1
  37. package/dist/types/wallets/eip5792/get-capabilities.d.ts.map +1 -1
  38. package/package.json +2 -2
  39. package/src/adapters/eip1193/to-eip1193.ts +11 -1
  40. package/src/utils/bytecode/resolveImplementation.ts +25 -24
  41. package/src/utils/web/isMobile.ts +8 -0
  42. package/src/version.ts +1 -1
  43. package/src/wallets/create-wallet.ts +26 -25
  44. package/src/wallets/eip5792/get-capabilities.ts +4 -2
  45. package/src/wallets/injected/index.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"to-eip1193.d.ts","sourceRoot":"","sources":["../../../../src/adapters/eip1193/to-eip1193.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,wBAAwB,GAAG,eAAe,CA+I7E"}
1
+ {"version":3,"file":"to-eip1193.d.ts","sourceRoot":"","sources":["../../../../src/adapters/eip1193/to-eip1193.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,wBAAwB,GAAG,eAAe,CAyJ7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveImplementation.d.ts","sourceRoot":"","sources":["../../../../src/utils/bytecode/resolveImplementation.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKhF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAQ9C;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAEzC,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC,CA4D7C"}
1
+ {"version":3,"file":"resolveImplementation.d.ts","sourceRoot":"","sources":["../../../../src/utils/bytecode/resolveImplementation.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKhF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAQ9C;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAEzC,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAC9B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC,CA6D7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"isMobile.d.ts","sourceRoot":"","sources":["../../../../src/utils/web/isMobile.ts"],"names":[],"mappings":"AAsDA;;GAEG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAgBlC"}
1
+ {"version":3,"file":"isMobile.d.ts","sourceRoot":"","sources":["../../../../src/utils/web/isMobile.ts"],"names":[],"mappings":"AAsDA;;GAEG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAwBlC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "5.112.1-nightly-144bb33ffdf4d07b5d7370328ee640cd68d877c8-20251114000335";
1
+ export declare const version = "5.112.2";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,4EAA4E,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-wallet.d.ts","sourceRoot":"","sources":["../../../src/wallets/create-wallet.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,KAAK,EACV,gBAAgB,EAGhB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EACpD,GAAG,IAAI,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAC5B,MAAM,CAAC,EAAE,CAAC,CAsWZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,4BAE5B"}
1
+ {"version":3,"file":"create-wallet.d.ts","sourceRoot":"","sources":["../../../src/wallets/create-wallet.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,KAAK,EACV,gBAAgB,EAGhB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,EACpD,GAAG,IAAI,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAC5B,MAAM,CAAC,EAAE,CAAC,CAuWZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,4BAE5B"}
@@ -28,5 +28,5 @@ export type GetCapabilitiesResult = Prettify<WalletCapabilitiesRecord<WalletCapa
28
28
  * @extension EIP5792
29
29
  */
30
30
  export declare function getCapabilities<const ID extends WalletId = WalletId>({ wallet, chainId, }: GetCapabilitiesOptions<ID>): Promise<GetCapabilitiesResult>;
31
- export declare function toGetCapabilitiesResult(result: Record<string, WalletCapabilities>, chainId?: number): GetCapabilitiesResult;
31
+ export declare function toGetCapabilitiesResult(result: Record<string, WalletCapabilities>, chainIdFilter?: number): GetCapabilitiesResult;
32
32
  //# sourceMappingURL=get-capabilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/wallets/eip5792/get-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE/E,MAAM,MAAM,sBAAsB,CAAC,EAAE,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACnE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAC1C,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,eAAe,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,GAAG,QAAQ,EAAE,EAC1E,MAAM,EACN,OAAO,GACR,EAAE,sBAAsB,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAe7D;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAC1C,OAAO,CAAC,EAAE,MAAM,GACf,qBAAqB,CAgBvB"}
1
+ {"version":3,"file":"get-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/wallets/eip5792/get-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE/E,MAAM,MAAM,sBAAsB,CAAC,EAAE,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACnE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAC1C,wBAAwB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CACrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,eAAe,CAAC,KAAK,CAAC,EAAE,SAAS,QAAQ,GAAG,QAAQ,EAAE,EAC1E,MAAM,EACN,OAAO,GACR,EAAE,sBAAsB,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAe7D;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAC1C,aAAa,CAAC,EAAE,MAAM,GACrB,qBAAqB,CAkBvB"}
package/package.json CHANGED
@@ -36,7 +36,7 @@
36
36
  "qrcode": "1.5.3",
37
37
  "toml": "3.0.0",
38
38
  "uqr": "0.1.2",
39
- "viem": "2.37.9",
39
+ "viem": "2.39.0",
40
40
  "x402": "0.7.0",
41
41
  "zod": "3.25.75",
42
42
  "@thirdweb-dev/engine": "3.4.0",
@@ -399,7 +399,7 @@
399
399
  }
400
400
  },
401
401
  "typings": "./dist/types/exports/thirdweb.d.ts",
402
- "version": "5.112.1-nightly-144bb33ffdf4d07b5d7370328ee640cd68d877c8-20251114000335",
402
+ "version": "5.112.2",
403
403
  "scripts": {
404
404
  "bench": "vitest -c ./test/vitest.config.ts bench",
405
405
  "bench:compare": "bun run ./benchmarks/run.ts",
@@ -164,7 +164,17 @@ export function toProvider(options: ToEip1193ProviderOptions): EIP1193Provider {
164
164
  if (!account.getCapabilities) {
165
165
  throw new Error("Wallet does not support EIP-5792");
166
166
  }
167
- return account.getCapabilities({ chainId: chain.id });
167
+ const chains = request.params[1];
168
+ if (chains && Array.isArray(chains)) {
169
+ const firstChainStr = chains[0];
170
+ const firstChainId = isHex(firstChainStr)
171
+ ? hexToNumber(firstChainStr)
172
+ : Number(firstChainStr);
173
+ return account.getCapabilities(
174
+ firstChainId ? { chainId: firstChainId } : {},
175
+ );
176
+ }
177
+ return account.getCapabilities({});
168
178
  }
169
179
  case "wallet_sendCalls": {
170
180
  const account = wallet.getAccount();
@@ -47,8 +47,6 @@ export async function resolveImplementation(
47
47
  }
48
48
 
49
49
  // check other proxy types
50
- let implementationAddress: string | undefined;
51
-
52
50
  if (beacon && beacon !== AddressZero) {
53
51
  // In case of a BeaconProxy, it is setup as BeaconProxy --> Beacon --> Implementation
54
52
  // Hence we replace the proxy address with Beacon address, and continue further resolving below
@@ -56,33 +54,36 @@ export async function resolveImplementation(
56
54
  ...contract,
57
55
  address: beacon,
58
56
  });
59
-
60
- implementationAddress = await getImplementationFromContractCall(contract);
61
- } else {
62
- implementationAddress = await getImplementationFromStorageSlot(contract);
63
57
  }
64
58
 
65
- if (
66
- implementationAddress &&
67
- isAddress(implementationAddress) &&
68
- implementationAddress !== AddressZero
69
- ) {
70
- const implementationBytecode = await getBytecode({
71
- ...contract,
72
- address: implementationAddress,
73
- });
74
- // return the original contract bytecode if the implementation bytecode is empty
75
- if (implementationBytecode === "0x") {
59
+ const implementations = await Promise.all([
60
+ getImplementationFromStorageSlot(contract),
61
+ getImplementationFromContractCall(contract),
62
+ ]);
63
+
64
+ for (const implementationAddress of implementations) {
65
+ if (
66
+ implementationAddress &&
67
+ isAddress(implementationAddress) &&
68
+ implementationAddress !== AddressZero
69
+ ) {
70
+ const implementationBytecode = await getBytecode({
71
+ ...contract,
72
+ address: implementationAddress,
73
+ });
74
+ // return the original contract bytecode if the implementation bytecode is empty
75
+ if (implementationBytecode === "0x") {
76
+ return {
77
+ address: contract.address,
78
+ bytecode: originalBytecode,
79
+ };
80
+ }
81
+
76
82
  return {
77
- address: contract.address,
78
- bytecode: originalBytecode,
83
+ address: implementationAddress,
84
+ bytecode: implementationBytecode,
79
85
  };
80
86
  }
81
-
82
- return {
83
- address: implementationAddress,
84
- bytecode: implementationBytecode,
85
- };
86
87
  }
87
88
 
88
89
  return { address: contract.address, bytecode: originalBytecode };
@@ -57,6 +57,7 @@ function hasMobileAPIs(): boolean {
57
57
  */
58
58
  export function isMobile(): boolean {
59
59
  // Primary signal: OS detection via user agent
60
+
60
61
  const isMobileOS = isAndroid() || isIOS();
61
62
 
62
63
  if (isMobileOS) {
@@ -70,5 +71,12 @@ export function isMobile(): boolean {
70
71
  return true;
71
72
  }
72
73
 
74
+ const isMobileViewport =
75
+ typeof window !== "undefined" && window.innerWidth < 640;
76
+
77
+ if (isMobileViewport) {
78
+ return true;
79
+ }
80
+
73
81
  return false;
74
82
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.112.1-nightly-144bb33ffdf4d07b5d7370328ee640cd68d877c8-20251114000335";
1
+ export const version = "5.112.2";
@@ -341,34 +341,35 @@ export function createWallet<const ID extends WalletId>(
341
341
  }
342
342
  return;
343
343
  }
344
+ // on desktop, create a QR overlay
345
+ else {
346
+ try {
347
+ const { createQROverlay } = await import(
348
+ "./wallet-connect/qr-overlay.js"
349
+ );
344
350
 
345
- try {
346
- // on desktop, create a QR overlay
347
- const { createQROverlay } = await import(
348
- "./wallet-connect/qr-overlay.js"
349
- );
351
+ // Clean up any existing overlay
352
+ if (qrOverlay) {
353
+ qrOverlay.destroy();
354
+ }
350
355
 
351
- // Clean up any existing overlay
352
- if (qrOverlay) {
353
- qrOverlay.destroy();
356
+ // Create new QR overlay
357
+ qrOverlay = createQROverlay(uri, {
358
+ theme:
359
+ wcOptions.walletConnect?.qrModalOptions
360
+ ?.themeMode ?? "dark",
361
+ qrSize: 280,
362
+ showCloseButton: true,
363
+ onCancel: () => {
364
+ wcOptions.walletConnect?.onCancel?.();
365
+ },
366
+ });
367
+ } catch (error) {
368
+ console.error(
369
+ "Failed to create QR overlay:",
370
+ error,
371
+ );
354
372
  }
355
-
356
- // Create new QR overlay
357
- qrOverlay = createQROverlay(uri, {
358
- theme:
359
- wcOptions.walletConnect?.qrModalOptions
360
- ?.themeMode ?? "dark",
361
- qrSize: 280,
362
- showCloseButton: true,
363
- onCancel: () => {
364
- wcOptions.walletConnect?.onCancel?.();
365
- },
366
- });
367
- } catch (error) {
368
- console.error(
369
- "Failed to create QR overlay:",
370
- error,
371
- );
372
373
  }
373
374
  }
374
375
  }),
@@ -54,7 +54,7 @@ export async function getCapabilities<const ID extends WalletId = WalletId>({
54
54
 
55
55
  export function toGetCapabilitiesResult(
56
56
  result: Record<string, WalletCapabilities>,
57
- chainId?: number,
57
+ chainIdFilter?: number,
58
58
  ): GetCapabilitiesResult {
59
59
  const capabilities = {} as WalletCapabilitiesRecord<
60
60
  WalletCapabilities,
@@ -69,6 +69,8 @@ export function toGetCapabilitiesResult(
69
69
  capabilities[Number(chainId)] = capabilitiesCopy;
70
70
  }
71
71
  return (
72
- typeof chainId === "number" ? capabilities[chainId] : capabilities
72
+ typeof chainIdFilter === "number"
73
+ ? { [chainIdFilter]: capabilities[chainIdFilter] }
74
+ : capabilities
73
75
  ) as never;
74
76
  }
@@ -374,13 +374,13 @@ function createAccount({
374
374
  }
375
375
  },
376
376
  async getCapabilities(options) {
377
- const chainId = options.chainId;
377
+ const chainIdFilter = options.chainId;
378
378
  try {
379
379
  const result = await provider.request({
380
380
  method: "wallet_getCapabilities",
381
381
  params: [getAddress(account.address)],
382
382
  });
383
- return toGetCapabilitiesResult(result, chainId);
383
+ return toGetCapabilitiesResult(result, chainIdFilter);
384
384
  } catch (error: unknown) {
385
385
  if (
386
386
  /unsupport|not support|not available/i.test((error as Error).message)