thirdweb 5.80.1-nightly-a7b6cb3211e8b5232e77965cb8dd8ff96b369424-20241228000338 → 5.80.1-nightly-03bf859809de255d20f4ed8285a3bb75cef17252-20241229000354
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/cjs/chains/utils.js +4 -0
- package/dist/cjs/chains/utils.js.map +1 -1
- package/dist/cjs/exports/utils.js +2 -2
- package/dist/cjs/exports/utils.js.map +1 -1
- package/dist/cjs/utils/bytecode/{extractMnimalProxyImplementationAddress.js → extractMinimalProxyImplementationAddress.js} +1 -1
- package/dist/cjs/utils/bytecode/extractMinimalProxyImplementationAddress.js.map +1 -0
- package/dist/cjs/utils/bytecode/resolveImplementation.js +2 -2
- package/dist/cjs/utils/bytecode/resolveImplementation.js.map +1 -1
- package/dist/cjs/utils/promise/p-limit.js +5 -0
- package/dist/cjs/utils/promise/p-limit.js.map +1 -1
- package/dist/cjs/utils/semver.js +1 -0
- package/dist/cjs/utils/semver.js.map +1 -1
- package/dist/cjs/utils/url.js +3 -0
- package/dist/cjs/utils/url.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/chains/utils.js +4 -1
- package/dist/esm/chains/utils.js.map +1 -1
- package/dist/esm/exports/utils.js +1 -1
- package/dist/esm/exports/utils.js.map +1 -1
- package/dist/esm/utils/bytecode/{extractMnimalProxyImplementationAddress.js → extractMinimalProxyImplementationAddress.js} +1 -1
- package/dist/esm/utils/bytecode/extractMinimalProxyImplementationAddress.js.map +1 -0
- package/dist/esm/utils/bytecode/resolveImplementation.js +1 -1
- package/dist/esm/utils/bytecode/resolveImplementation.js.map +1 -1
- package/dist/esm/utils/promise/p-limit.js +4 -1
- package/dist/esm/utils/promise/p-limit.js.map +1 -1
- package/dist/esm/utils/semver.js +1 -1
- package/dist/esm/utils/semver.js.map +1 -1
- package/dist/esm/utils/url.js +3 -3
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/chains/utils.d.ts +4 -0
- package/dist/types/chains/utils.d.ts.map +1 -1
- package/dist/types/exports/utils.d.ts +1 -1
- package/dist/types/exports/utils.d.ts.map +1 -1
- package/dist/types/utils/bytecode/{extractMnimalProxyImplementationAddress.d.ts → extractMinimalProxyImplementationAddress.d.ts} +1 -1
- package/dist/types/utils/bytecode/extractMinimalProxyImplementationAddress.d.ts.map +1 -0
- package/dist/types/utils/promise/p-limit.d.ts +13 -0
- package/dist/types/utils/promise/p-limit.d.ts.map +1 -1
- package/dist/types/utils/semver.d.ts +15 -0
- package/dist/types/utils/semver.d.ts.map +1 -1
- package/dist/types/utils/url.d.ts +12 -0
- package/dist/types/utils/url.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/auth/verify-hash.test.ts +3 -3
- package/src/chains/utils.test.ts +70 -1
- package/src/chains/utils.ts +4 -1
- package/src/contract/contract.test.ts +42 -0
- package/src/exports/utils.ts +1 -1
- package/src/extensions/thirdweb/write/publish.test.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.test.tsx +52 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +174 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/formatSeconds.test.ts +30 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/utils.test.ts +20 -0
- package/src/react/web/wallets/injected/locale/getInjectedWalletLocale.test.ts +39 -0
- package/src/react/web/wallets/smartWallet/locale/getSmartWalletLocale.test.ts +39 -0
- package/src/utils/abi/normalizeFunctionParams.test.ts +108 -0
- package/src/utils/bigint.test.ts +91 -1
- package/src/utils/bytecode/extractMinimalProxyImplementationAddress.test.ts +60 -0
- package/src/utils/bytecode/resolveImplementation.ts +1 -1
- package/src/utils/domain.test.ts +78 -0
- package/src/utils/encoding/hex.test.ts +163 -1
- package/src/utils/ens/encodeLabelToLabelhash.test.ts +28 -0
- package/src/utils/ens/encodeLabelhash.test.ts +18 -0
- package/src/utils/ens/namehash.test.ts +17 -0
- package/src/utils/nft/{parse-nft.test.ts → parseNft.test.ts} +39 -0
- package/src/utils/promise/p-limit.test.ts +105 -0
- package/src/utils/promise/p-limit.ts +4 -1
- package/src/utils/promise/withCache.test.ts +73 -0
- package/src/utils/semver.test.ts +72 -0
- package/src/utils/semver.ts +1 -1
- package/src/utils/url.test.ts +90 -1
- package/src/utils/url.ts +6 -3
- package/src/version.ts +1 -1
- package/src/wallets/eip5792/get-calls-status.test.ts +4 -4
- package/src/wallets/eip5792/send-calls.test.ts +7 -7
- package/src/wallets/eip5792/show-calls-status.test.ts +2 -2
- package/dist/cjs/utils/bytecode/extractMnimalProxyImplementationAddress.js.map +0 -1
- package/dist/esm/utils/bytecode/extractMnimalProxyImplementationAddress.js.map +0 -1
- package/dist/types/utils/bytecode/extractMnimalProxyImplementationAddress.d.ts.map +0 -1
- /package/src/utils/bytecode/{extractMnimalProxyImplementationAddress.ts → extractMinimalProxyImplementationAddress.ts} +0 -0
@@ -95,3 +95,76 @@ it("behavior: programmatic removal", async () => {
|
|
95
95
|
|
96
96
|
expect(fn).toBeCalledTimes(2);
|
97
97
|
});
|
98
|
+
|
99
|
+
describe("getCache", () => {
|
100
|
+
it("should return an object with clear, get, and set methods", () => {
|
101
|
+
const cacheKey = "testKey";
|
102
|
+
const cache = getCache<string>(cacheKey);
|
103
|
+
|
104
|
+
expect(typeof cache.clear).toBe("function");
|
105
|
+
expect(typeof cache.promise.get).toBe("function");
|
106
|
+
expect(typeof cache.promise.set).toBe("function");
|
107
|
+
expect(typeof cache.response.get).toBe("function");
|
108
|
+
expect(typeof cache.response.set).toBe("function");
|
109
|
+
});
|
110
|
+
|
111
|
+
it("should allow setting and getting values from the promise cache", () => {
|
112
|
+
const cacheKey = "testKey";
|
113
|
+
const cache = getCache<string>(cacheKey);
|
114
|
+
const testPromise = Promise.resolve("testValue");
|
115
|
+
|
116
|
+
cache.promise.set(testPromise);
|
117
|
+
expect(cache.promise.get()).toBe(testPromise);
|
118
|
+
});
|
119
|
+
|
120
|
+
it("should allow clearing the cache", () => {
|
121
|
+
const cacheKey = "testKey";
|
122
|
+
const cache = getCache<string>(cacheKey);
|
123
|
+
const testPromise = Promise.resolve("testValue");
|
124
|
+
|
125
|
+
cache.promise.set(testPromise);
|
126
|
+
cache.clear();
|
127
|
+
expect(cache.promise.get()).toBeUndefined();
|
128
|
+
});
|
129
|
+
});
|
130
|
+
|
131
|
+
describe("withCache", () => {
|
132
|
+
it("should execute the function and cache the result", async () => {
|
133
|
+
const cacheKey = "testKey1";
|
134
|
+
const fn = vi.fn().mockResolvedValue("testValue");
|
135
|
+
|
136
|
+
const result1 = await withCache(fn, { cacheKey });
|
137
|
+
const result2 = await withCache(fn, { cacheKey });
|
138
|
+
|
139
|
+
expect(result1).toBe("testValue");
|
140
|
+
expect(result2).toBe("testValue");
|
141
|
+
expect(fn).toHaveBeenCalledTimes(1);
|
142
|
+
});
|
143
|
+
|
144
|
+
it("should not return expired cache data", async () => {
|
145
|
+
const cacheKey = "testKey2";
|
146
|
+
const fn = vi.fn().mockResolvedValue("newValue");
|
147
|
+
|
148
|
+
const result1 = await withCache(fn, { cacheKey, cacheTime: 10 });
|
149
|
+
await new Promise((resolve) => setTimeout(resolve, 20)); // Wait for cache to expire
|
150
|
+
const result2 = await withCache(fn, { cacheKey, cacheTime: 10 });
|
151
|
+
|
152
|
+
expect(result1).toBe("newValue");
|
153
|
+
expect(result2).toBe("newValue");
|
154
|
+
expect(fn).toHaveBeenCalledTimes(2);
|
155
|
+
});
|
156
|
+
|
157
|
+
it("should deduplicate concurrent calls to the same cache key", async () => {
|
158
|
+
const cacheKey = "testKey3";
|
159
|
+
const fn = vi.fn().mockResolvedValue("testValue");
|
160
|
+
|
161
|
+
const [result1, result2] = await Promise.all([
|
162
|
+
withCache(fn, { cacheKey, cacheTime: 100 }),
|
163
|
+
withCache(fn, { cacheKey, cacheTime: 100 }),
|
164
|
+
]);
|
165
|
+
|
166
|
+
expect(result1).toBe("testValue");
|
167
|
+
expect(result2).toBe("testValue");
|
168
|
+
expect(fn).toHaveBeenCalledTimes(1);
|
169
|
+
});
|
170
|
+
});
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
2
|
+
import { isIncrementalVersion, toSemver } from "./semver.js";
|
3
|
+
|
4
|
+
describe("toSemver", () => {
|
5
|
+
it("should parse a valid semantic version", () => {
|
6
|
+
const result = toSemver("1.2.3");
|
7
|
+
expect(result).toEqual({
|
8
|
+
major: 1,
|
9
|
+
minor: 2,
|
10
|
+
patch: 3,
|
11
|
+
versionString: "1.2.3",
|
12
|
+
});
|
13
|
+
});
|
14
|
+
|
15
|
+
it("should handle versions with leading/trailing spaces", () => {
|
16
|
+
const result = toSemver(" 1.0.0 ");
|
17
|
+
expect(result).toEqual({
|
18
|
+
major: 1,
|
19
|
+
minor: 0,
|
20
|
+
patch: 0,
|
21
|
+
versionString: "1.0.0",
|
22
|
+
});
|
23
|
+
});
|
24
|
+
|
25
|
+
it("should throw an error for versions exceeding max length", () => {
|
26
|
+
const longVersion = "1".repeat(257); // 257 characters
|
27
|
+
expect(() => toSemver(longVersion)).toThrow(
|
28
|
+
"version is longer than 256 characters",
|
29
|
+
);
|
30
|
+
});
|
31
|
+
|
32
|
+
it("should throw an error for invalid semantic version formats", () => {
|
33
|
+
const invalidVersions = ["testd", "1....2", "test.1.0"];
|
34
|
+
for (const version of invalidVersions) {
|
35
|
+
expect(() => toSemver(version)).toThrowError(
|
36
|
+
`${version} is not a valid semantic version. Should be in the format of major.minor.patch. Ex: 0.4.1`,
|
37
|
+
);
|
38
|
+
}
|
39
|
+
});
|
40
|
+
});
|
41
|
+
|
42
|
+
describe("isIncrementalVersion", () => {
|
43
|
+
it("should return true for valid incremental versions", () => {
|
44
|
+
expect(isIncrementalVersion("1.0.0", "2.0.0")).toBe(true); // Major increment
|
45
|
+
expect(isIncrementalVersion("1.0.0", "1.1.0")).toBe(true); // Minor increment
|
46
|
+
expect(isIncrementalVersion("1.1.0", "1.1.1")).toBe(true); // Patch increment
|
47
|
+
});
|
48
|
+
|
49
|
+
it("should return false for non-incremental versions", () => {
|
50
|
+
expect(isIncrementalVersion("2.0.0", "1.0.0")).toBe(false); // Major decrement
|
51
|
+
expect(isIncrementalVersion("1.1.0", "1.0.0")).toBe(false); // Minor decrement
|
52
|
+
expect(isIncrementalVersion("1.1.1", "1.1.0")).toBe(false); // Patch decrement
|
53
|
+
expect(isIncrementalVersion("1.1.1", "1.1.1")).toBe(false); // Same version
|
54
|
+
});
|
55
|
+
|
56
|
+
it("should handle whitespace around version strings", () => {
|
57
|
+
expect(isIncrementalVersion(" 1.0.0", "2.0.0 ")).toBe(true);
|
58
|
+
});
|
59
|
+
|
60
|
+
it("should throw errors for invalid version inputs", () => {
|
61
|
+
expect(() => isIncrementalVersion("invalid", "1.0.0")).toThrow();
|
62
|
+
expect(() => isIncrementalVersion("1.0.0", "invalid")).toThrow();
|
63
|
+
expect(() => isIncrementalVersion("invalid", "invalid")).toThrow();
|
64
|
+
});
|
65
|
+
|
66
|
+
it("should correctly handle complex version comparisons", () => {
|
67
|
+
expect(isIncrementalVersion("1.0.0", "1.1.0")).toBe(true);
|
68
|
+
expect(isIncrementalVersion("1.1.0", "1.1.1")).toBe(true);
|
69
|
+
expect(isIncrementalVersion("1.1.1", "2.0.0")).toBe(true);
|
70
|
+
expect(isIncrementalVersion("1.1.1", "0.9.9")).toBe(false);
|
71
|
+
});
|
72
|
+
});
|
package/src/utils/semver.ts
CHANGED
@@ -17,7 +17,7 @@ type Semver = {
|
|
17
17
|
* @internal
|
18
18
|
* @param version - The version to convert to a Semver
|
19
19
|
*/
|
20
|
-
function toSemver(version: string): Semver {
|
20
|
+
export function toSemver(version: string): Semver {
|
21
21
|
if (version.length > MAX_LENGTH) {
|
22
22
|
throw new Error(`version is longer than ${MAX_LENGTH} characters`);
|
23
23
|
}
|
package/src/utils/url.test.ts
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
formatExplorerAddressUrl,
|
4
|
+
formatExplorerTxUrl,
|
5
|
+
formatNativeUrl,
|
6
|
+
formatUniversalUrl,
|
7
|
+
formatWalletConnectUrl,
|
8
|
+
isHttpUrl,
|
9
|
+
} from "./url.js";
|
3
10
|
|
4
11
|
describe("formatWalletConnectUrl", () => {
|
5
12
|
it("should format a wallet connect URL for an HTTP app URL", () => {
|
@@ -30,3 +37,85 @@ describe("formatWalletConnectUrl", () => {
|
|
30
37
|
`);
|
31
38
|
});
|
32
39
|
});
|
40
|
+
|
41
|
+
describe("Utility functions tests", () => {
|
42
|
+
describe("isHttpUrl", () => {
|
43
|
+
it("should return true for valid HTTP/HTTPS URLs", () => {
|
44
|
+
expect(isHttpUrl("http://example.com")).toBe(true);
|
45
|
+
expect(isHttpUrl("https://example.com")).toBe(true);
|
46
|
+
});
|
47
|
+
|
48
|
+
it("should return false for non-HTTP URLs", () => {
|
49
|
+
expect(isHttpUrl("ftp://example.com")).toBe(false);
|
50
|
+
expect(isHttpUrl("example://custom")).toBe(false);
|
51
|
+
expect(isHttpUrl("example.com")).toBe(false);
|
52
|
+
});
|
53
|
+
});
|
54
|
+
|
55
|
+
describe("formatUniversalUrl", () => {
|
56
|
+
it("should format a valid HTTP URL with a WalletConnect URI", () => {
|
57
|
+
const result = formatUniversalUrl("https://example.com", "wc:uri");
|
58
|
+
expect(result).toEqual({
|
59
|
+
redirect: "https://example.com/wc?uri=wc%3Auri",
|
60
|
+
href: "https://example.com/",
|
61
|
+
});
|
62
|
+
});
|
63
|
+
});
|
64
|
+
|
65
|
+
describe("formatNativeUrl", () => {
|
66
|
+
it("should format a valid native URL with a WalletConnect URI", () => {
|
67
|
+
const result = formatNativeUrl("custom://example", "wc:uri");
|
68
|
+
expect(result).toEqual({
|
69
|
+
redirect: "custom://example/wc?uri=wc%3Auri",
|
70
|
+
href: "custom://example/",
|
71
|
+
});
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|
75
|
+
describe("formatWalletConnectUrl", () => {
|
76
|
+
it("should call formatUniversalUrl for HTTP URLs", () => {
|
77
|
+
const result = formatWalletConnectUrl("https://example.com", "wc:uri");
|
78
|
+
expect(result).toEqual({
|
79
|
+
redirect: "https://example.com/wc?uri=wc%3Auri",
|
80
|
+
href: "https://example.com/",
|
81
|
+
});
|
82
|
+
});
|
83
|
+
|
84
|
+
it("should call formatNativeUrl for non-HTTP URLs", () => {
|
85
|
+
const result = formatWalletConnectUrl("custom://example", "wc:uri");
|
86
|
+
expect(result).toEqual({
|
87
|
+
redirect: "custom://example/wc?uri=wc%3Auri",
|
88
|
+
href: "custom://example/",
|
89
|
+
});
|
90
|
+
});
|
91
|
+
});
|
92
|
+
|
93
|
+
describe("formatExplorerTxUrl", () => {
|
94
|
+
it("should correctly format transaction URLs", () => {
|
95
|
+
const result = formatExplorerTxUrl("https://explorer.com", "tx123");
|
96
|
+
expect(result).toBe("https://explorer.com/tx/tx123");
|
97
|
+
|
98
|
+
const resultWithSlash = formatExplorerTxUrl(
|
99
|
+
"https://explorer.com/",
|
100
|
+
"tx123",
|
101
|
+
);
|
102
|
+
expect(resultWithSlash).toBe("https://explorer.com/tx/tx123");
|
103
|
+
});
|
104
|
+
});
|
105
|
+
|
106
|
+
describe("formatExplorerAddressUrl", () => {
|
107
|
+
it("should correctly format address URLs", () => {
|
108
|
+
const result = formatExplorerAddressUrl(
|
109
|
+
"https://explorer.com",
|
110
|
+
"addr123",
|
111
|
+
);
|
112
|
+
expect(result).toBe("https://explorer.com/address/addr123");
|
113
|
+
|
114
|
+
const resultWithSlash = formatExplorerAddressUrl(
|
115
|
+
"https://explorer.com/",
|
116
|
+
"addr123",
|
117
|
+
);
|
118
|
+
expect(resultWithSlash).toBe("https://explorer.com/address/addr123");
|
119
|
+
});
|
120
|
+
});
|
121
|
+
});
|
package/src/utils/url.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @internal
|
3
3
|
*/
|
4
|
-
function isHttpUrl(url: string) {
|
4
|
+
export function isHttpUrl(url: string) {
|
5
5
|
return url.startsWith("http://") || url.startsWith("https://");
|
6
6
|
}
|
7
7
|
|
@@ -13,7 +13,10 @@ type LinkingRecord = {
|
|
13
13
|
/**
|
14
14
|
* @internal
|
15
15
|
*/
|
16
|
-
function formatUniversalUrl(
|
16
|
+
export function formatUniversalUrl(
|
17
|
+
appUrl: string,
|
18
|
+
wcUri: string,
|
19
|
+
): LinkingRecord {
|
17
20
|
if (!isHttpUrl(appUrl)) {
|
18
21
|
return formatNativeUrl(appUrl, wcUri);
|
19
22
|
}
|
@@ -32,7 +35,7 @@ function formatUniversalUrl(appUrl: string, wcUri: string): LinkingRecord {
|
|
32
35
|
/**
|
33
36
|
* @internal
|
34
37
|
*/
|
35
|
-
function formatNativeUrl(appUrl: string, wcUri: string): LinkingRecord {
|
38
|
+
export function formatNativeUrl(appUrl: string, wcUri: string): LinkingRecord {
|
36
39
|
if (isHttpUrl(appUrl)) {
|
37
40
|
return formatUniversalUrl(appUrl, wcUri);
|
38
41
|
}
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.80.1-nightly-
|
1
|
+
export const version = "5.80.1-nightly-03bf859809de255d20f4ed8285a3bb75cef17252-20241229000354";
|
@@ -92,7 +92,7 @@ describe.sequential("injected wallet", async () => {
|
|
92
92
|
bundleId: "test",
|
93
93
|
});
|
94
94
|
|
95
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
95
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
96
96
|
`[Error: Failed to get call status, no account found for wallet ${wallet.id}]`,
|
97
97
|
);
|
98
98
|
});
|
@@ -130,7 +130,7 @@ describe.sequential("injected wallet", async () => {
|
|
130
130
|
bundleId: "test",
|
131
131
|
});
|
132
132
|
|
133
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
133
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
134
134
|
"[Error: io.metamask does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.]",
|
135
135
|
);
|
136
136
|
});
|
@@ -224,7 +224,7 @@ describe.sequential("in-app wallet", async () => {
|
|
224
224
|
bundleId: "unknown",
|
225
225
|
});
|
226
226
|
|
227
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
227
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
228
228
|
"[Error: Failed to get calls status, unknown bundle id]",
|
229
229
|
);
|
230
230
|
});
|
@@ -238,7 +238,7 @@ describe.sequential("in-app wallet", async () => {
|
|
238
238
|
bundleId: "test",
|
239
239
|
});
|
240
240
|
|
241
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
241
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
242
242
|
"[Error: Failed to get calls status, no active chain found]",
|
243
243
|
);
|
244
244
|
});
|
@@ -85,22 +85,22 @@ describe.sequential("injected wallet", () => {
|
|
85
85
|
vi.clearAllMocks();
|
86
86
|
});
|
87
87
|
|
88
|
-
test("with no chain should fail to send calls", () => {
|
88
|
+
test("with no chain should fail to send calls", async () => {
|
89
89
|
wallet.getChain = vi.fn().mockReturnValue(undefined);
|
90
90
|
wallet.getAccount = vi.fn().mockReturnValue(TEST_ACCOUNT_A);
|
91
91
|
|
92
92
|
const promise = sendCalls({ wallet, ...SEND_CALLS_OPTIONS });
|
93
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
93
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
94
94
|
"[Error: Cannot send calls, no active chain found for wallet: io.metamask]",
|
95
95
|
);
|
96
96
|
});
|
97
97
|
|
98
|
-
test("with no account should fail to send calls", () => {
|
98
|
+
test("with no account should fail to send calls", async () => {
|
99
99
|
wallet.getChain = vi.fn().mockReturnValue(ANVIL_CHAIN);
|
100
100
|
wallet.getAccount = vi.fn().mockReturnValue(undefined);
|
101
101
|
|
102
102
|
const promise = sendCalls({ wallet, ...SEND_CALLS_OPTIONS });
|
103
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
103
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
104
104
|
"[Error: Cannot send calls, no account connected for wallet: io.metamask]",
|
105
105
|
);
|
106
106
|
});
|
@@ -227,7 +227,7 @@ describe.sequential("injected wallet", () => {
|
|
227
227
|
...SEND_CALLS_OPTIONS,
|
228
228
|
});
|
229
229
|
|
230
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
230
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
231
231
|
"[Error: io.metamask does not support wallet_sendCalls, reach out to them directly to request EIP-5792 support.]",
|
232
232
|
);
|
233
233
|
});
|
@@ -252,7 +252,7 @@ describe.sequential("in-app wallet", () => {
|
|
252
252
|
test("without account should fail", async () => {
|
253
253
|
wallet.getAccount = vi.fn().mockReturnValue(undefined);
|
254
254
|
const promise = sendCalls({ wallet, ...SEND_CALLS_OPTIONS });
|
255
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
255
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
256
256
|
"[Error: Cannot send calls, no account connected for wallet: inApp]",
|
257
257
|
);
|
258
258
|
});
|
@@ -260,7 +260,7 @@ describe.sequential("in-app wallet", () => {
|
|
260
260
|
test("without account should fail", async () => {
|
261
261
|
wallet.getAccount = vi.fn().mockReturnValue(undefined);
|
262
262
|
const promise = sendCalls({ wallet, ...SEND_CALLS_OPTIONS });
|
263
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
263
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
264
264
|
"[Error: Cannot send calls, no account connected for wallet: inApp]",
|
265
265
|
);
|
266
266
|
});
|
@@ -41,7 +41,7 @@ describe.sequential("injected wallet", async () => {
|
|
41
41
|
bundleId: "test",
|
42
42
|
});
|
43
43
|
|
44
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
44
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
45
45
|
"[Error: io.metamask does not support wallet_showCallsStatus, reach out to them directly to request EIP-5792 support.]",
|
46
46
|
);
|
47
47
|
});
|
@@ -56,7 +56,7 @@ describe.sequential("other wallets", async () => {
|
|
56
56
|
bundleId: "test",
|
57
57
|
});
|
58
58
|
|
59
|
-
expect(promise).rejects.toMatchInlineSnapshot(
|
59
|
+
await expect(promise).rejects.toMatchInlineSnapshot(
|
60
60
|
"[Error: showCallsStatus is currently unsupported for this wallet type]",
|
61
61
|
);
|
62
62
|
});
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"extractMnimalProxyImplementationAddress.js","sourceRoot":"","sources":["../../../../src/utils/bytecode/extractMnimalProxyImplementationAddress.ts"],"names":[],"mappings":";;AAYA,4FA6CC;AAzDD;;;;;;;;;;;GAWG;AACH,SAAgB,wCAAwC,CACtD,QAAgB;IAEhB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,kDAAkD;QAClD,QAAQ,GAAG,KAAK,QAAQ,EAAE,CAAC;IAC7B,CAAC;IACD,yEAAyE;IACzE,IAAI,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;QAClD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrD,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,yKAAyK;IACzK,IAAI,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9C,qBAAqB;QACrB,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;QAC5D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,0FAA0F;IAC1F,IAAI,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC;QACpD,qBAAqB;QACrB,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,oHAAoH;IACpH,IAAI,QAAQ,CAAC,UAAU,CAAC,kCAAkC,CAAC,EAAE,CAAC;QAC5D,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,EAAE,CAAC;QACxD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,qFAAqF;IACrF,IAAI,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAChD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrD,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"extractMnimalProxyImplementationAddress.js","sourceRoot":"","sources":["../../../../src/utils/bytecode/extractMnimalProxyImplementationAddress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wCAAwC,CACtD,QAAgB;IAEhB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,kDAAkD;QAClD,QAAQ,GAAG,KAAK,QAAQ,EAAE,CAAC;IAC7B,CAAC;IACD,yEAAyE;IACzE,IAAI,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;QAClD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrD,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,yKAAyK;IACzK,IAAI,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC9C,qBAAqB;QACrB,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;QAC5D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,0FAA0F;IAC1F,IAAI,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC;QACpD,qBAAqB;QACrB,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,oHAAoH;IACpH,IAAI,QAAQ,CAAC,UAAU,CAAC,kCAAkC,CAAC,EAAE,CAAC;QAC5D,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,IAAI,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC,EAAE,CAAC;QACxD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,qFAAqF;IACrF,IAAI,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAChD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrD,OAAO,KAAK,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"extractMnimalProxyImplementationAddress.d.ts","sourceRoot":"","sources":["../../../../src/utils/bytecode/extractMnimalProxyImplementationAddress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,wCAAwC,CACtD,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CA2CpB"}
|