@coinbase/cdp-core 0.0.87 → 0.0.88
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/esm/index.native10.js +1 -1
- package/dist/esm/index.native101.js +2 -2
- package/dist/esm/index.native105.js +3 -3
- package/dist/esm/index.native106.js +31 -2
- package/dist/esm/index.native107.js +28 -65
- package/dist/esm/index.native108.js +2 -367
- package/dist/esm/index.native109.js +65 -28
- package/dist/esm/index.native110.js +364 -28
- package/dist/esm/index.native122.js +5 -35
- package/dist/esm/index.native123.js +40 -60
- package/dist/esm/index.native124.js +35 -5
- package/dist/esm/index.native125.js +60 -40
- package/dist/esm/index.native197.js +37 -107
- package/dist/esm/index.native199.js +69 -7
- package/dist/esm/index.native2.js +35 -30
- package/dist/esm/index.native200.js +35 -2
- package/dist/esm/index.native201.js +17 -374
- package/dist/esm/index.native202.js +7 -835
- package/dist/esm/index.native203.js +2 -39
- package/dist/esm/index.native204.js +378 -2
- package/dist/esm/index.native205.js +835 -69
- package/dist/esm/index.native206.js +106 -32
- package/dist/esm/index.native207.js +2 -21
- package/dist/esm/index.native222.js +2 -2
- package/dist/esm/index.native223.js +2 -2
- package/dist/esm/index.native224.js +2 -2
- package/dist/esm/index.native225.js +1 -1
- package/dist/esm/index.native3.js +1 -1
- package/dist/esm/index.native67.js +97 -60
- package/dist/esm/index.native9.js +1 -1
- package/dist/esm/index.native90.js +2 -2
- package/dist/esm/index.web102.js +12 -12
- package/dist/esm/index.web106.js +3 -3
- package/dist/esm/index.web107.js +2 -31
- package/dist/esm/index.web108.js +65 -28
- package/dist/esm/index.web109.js +367 -2
- package/dist/esm/index.web110.js +28 -65
- package/dist/esm/index.web111.js +28 -364
- package/dist/esm/index.web116.js +1 -1
- package/dist/esm/index.web117.js +2 -2
- package/dist/esm/index.web123.js +1 -1
- package/dist/esm/index.web127.js +4 -17
- package/dist/esm/index.web128.js +16 -44
- package/dist/esm/index.web129.js +45 -13
- package/dist/esm/index.web130.js +13 -55
- package/dist/esm/index.web131.js +55 -6
- package/dist/esm/index.web132.js +6 -21
- package/dist/esm/index.web133.js +21 -3
- package/dist/esm/index.web134.js +3 -3
- package/dist/esm/index.web135.js +3 -34
- package/dist/esm/index.web136.js +32 -10
- package/dist/esm/index.web137.js +12 -4
- package/dist/esm/index.web138.js +4 -28
- package/dist/esm/index.web139.js +28 -6
- package/dist/esm/index.web140.js +6 -42
- package/dist/esm/index.web141.js +41 -54
- package/dist/esm/index.web142.js +54 -126
- package/dist/esm/index.web143.js +127 -23
- package/dist/esm/index.web144.js +22 -11
- package/dist/esm/index.web145.js +9 -101
- package/dist/esm/index.web146.js +104 -6
- package/dist/esm/index.web147.js +7 -3
- package/dist/esm/index.web148.js +3 -15
- package/dist/esm/index.web149.js +14 -34
- package/dist/esm/index.web150.js +31 -75
- package/dist/esm/index.web151.js +79 -2
- package/dist/esm/index.web152.js +2 -2
- package/dist/esm/index.web153.js +2 -38
- package/dist/esm/index.web154.js +36 -5
- package/dist/esm/index.web155.js +5 -33
- package/dist/esm/index.web156.js +34 -8
- package/dist/esm/index.web157.js +8 -10
- package/dist/esm/index.web158.js +10 -11
- package/dist/esm/index.web159.js +11 -13
- package/dist/esm/index.web160.js +13 -18
- package/dist/esm/index.web161.js +18 -5
- package/dist/esm/index.web162.js +6 -5
- package/dist/esm/index.web163.js +5 -11
- package/dist/esm/index.web164.js +10 -4
- package/dist/esm/index.web165.js +14 -103
- package/dist/esm/index.web166.js +27 -77
- package/dist/esm/index.web167.js +7 -79
- package/dist/esm/index.web168.js +3 -14
- package/dist/esm/index.web169.js +16 -16
- package/dist/esm/index.web170.js +8 -7
- package/dist/esm/index.web171.js +7 -3
- package/dist/esm/index.web172.js +70 -18
- package/dist/esm/index.web173.js +28 -8
- package/dist/esm/index.web174.js +3 -7
- package/dist/esm/index.web175.js +7 -72
- package/dist/esm/index.web176.js +4 -28
- package/dist/esm/index.web177.js +14 -3
- package/dist/esm/index.web178.js +19 -15
- package/dist/esm/index.web179.js +61 -4
- package/dist/esm/index.web180.js +16 -13
- package/dist/esm/index.web181.js +19 -15
- package/dist/esm/index.web182.js +8 -61
- package/dist/esm/index.web183.js +41 -16
- package/dist/esm/index.web184.js +7 -23
- package/dist/esm/index.web185.js +20 -8
- package/dist/esm/index.web186.js +102 -41
- package/dist/esm/index.web187.js +78 -7
- package/dist/esm/index.web188.js +79 -20
- package/dist/esm/index.web189.js +1 -1
- package/dist/esm/index.web190.js +3 -3
- package/dist/esm/index.web192.js +3 -3
- package/dist/esm/index.web194.js +3 -3
- package/dist/esm/index.web195.js +2 -8
- package/dist/esm/index.web196.js +109 -2
- package/dist/esm/index.web197.js +2 -378
- package/dist/esm/index.web198.js +7 -835
- package/dist/esm/index.web199.js +2 -39
- package/dist/esm/index.web2.js +34 -29
- package/dist/esm/index.web200.js +378 -2
- package/dist/esm/index.web201.js +835 -69
- package/dist/esm/index.web202.js +37 -33
- package/dist/esm/index.web203.js +2 -21
- package/dist/esm/index.web204.js +70 -2
- package/dist/esm/index.web205.js +34 -20
- package/dist/esm/index.web206.js +19 -18
- package/dist/esm/index.web207.js +2 -33
- package/dist/esm/index.web208.js +20 -6
- package/dist/esm/index.web209.js +20 -2
- package/dist/esm/index.web210.js +31 -107
- package/dist/esm/index.web211.js +7 -2
- package/dist/esm/index.web213.js +47 -2
- package/dist/esm/index.web214.js +18 -2
- package/dist/esm/index.web215.js +28 -2
- package/dist/esm/index.web216.js +8 -18
- package/dist/esm/index.web217.js +9 -26
- package/dist/esm/index.web218.js +13 -8
- package/dist/esm/index.web219.js +10 -11
- package/dist/esm/index.web220.js +15 -11
- package/dist/esm/index.web221.js +80 -9
- package/dist/esm/index.web222.js +2 -17
- package/dist/esm/index.web223.js +2 -81
- package/dist/esm/index.web224.js +2 -47
- package/dist/esm/index.web226.js +14 -78
- package/dist/esm/index.web227.js +78 -14
- package/dist/esm/index.web3.js +1 -1
- package/dist/esm/index.web66.js +97 -60
- package/dist/esm/index.web8.js +1 -1
- package/dist/esm/index.web9.js +1 -1
- package/dist/esm/index.web92.js +2 -2
- package/dist/native/index.native10.js +1 -1
- package/dist/native/index.native101.js +2 -2
- package/dist/native/index.native105.js +3 -3
- package/dist/native/index.native106.js +31 -2
- package/dist/native/index.native107.js +28 -65
- package/dist/native/index.native108.js +2 -367
- package/dist/native/index.native109.js +65 -28
- package/dist/native/index.native110.js +364 -28
- package/dist/native/index.native122.js +5 -35
- package/dist/native/index.native123.js +40 -60
- package/dist/native/index.native124.js +35 -5
- package/dist/native/index.native125.js +60 -40
- package/dist/native/index.native197.js +37 -107
- package/dist/native/index.native199.js +69 -7
- package/dist/native/index.native2.js +35 -30
- package/dist/native/index.native200.js +35 -2
- package/dist/native/index.native201.js +17 -374
- package/dist/native/index.native202.js +7 -835
- package/dist/native/index.native203.js +2 -39
- package/dist/native/index.native204.js +378 -2
- package/dist/native/index.native205.js +835 -69
- package/dist/native/index.native206.js +106 -32
- package/dist/native/index.native207.js +2 -21
- package/dist/native/index.native222.js +2 -2
- package/dist/native/index.native223.js +2 -2
- package/dist/native/index.native224.js +2 -2
- package/dist/native/index.native225.js +1 -1
- package/dist/native/index.native3.js +1 -1
- package/dist/native/index.native67.js +97 -60
- package/dist/native/index.native9.js +1 -1
- package/dist/native/index.native90.js +2 -2
- package/dist/native-types/auth/authManager.d.ts +1 -1
- package/dist/native-types/version.d.ts +1 -1
- package/dist/types/auth/authManager.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index.web102.js +12 -12
- package/dist/web/index.web106.js +3 -3
- package/dist/web/index.web107.js +2 -31
- package/dist/web/index.web108.js +65 -28
- package/dist/web/index.web109.js +367 -2
- package/dist/web/index.web110.js +28 -65
- package/dist/web/index.web111.js +28 -364
- package/dist/web/index.web116.js +1 -1
- package/dist/web/index.web117.js +2 -2
- package/dist/web/index.web123.js +1 -1
- package/dist/web/index.web127.js +4 -17
- package/dist/web/index.web128.js +16 -44
- package/dist/web/index.web129.js +45 -13
- package/dist/web/index.web130.js +13 -55
- package/dist/web/index.web131.js +55 -6
- package/dist/web/index.web132.js +6 -21
- package/dist/web/index.web133.js +21 -3
- package/dist/web/index.web134.js +3 -3
- package/dist/web/index.web135.js +3 -34
- package/dist/web/index.web136.js +32 -10
- package/dist/web/index.web137.js +12 -4
- package/dist/web/index.web138.js +4 -28
- package/dist/web/index.web139.js +28 -6
- package/dist/web/index.web140.js +6 -42
- package/dist/web/index.web141.js +41 -54
- package/dist/web/index.web142.js +54 -126
- package/dist/web/index.web143.js +127 -23
- package/dist/web/index.web144.js +22 -11
- package/dist/web/index.web145.js +9 -101
- package/dist/web/index.web146.js +104 -6
- package/dist/web/index.web147.js +7 -3
- package/dist/web/index.web148.js +3 -15
- package/dist/web/index.web149.js +14 -34
- package/dist/web/index.web150.js +31 -75
- package/dist/web/index.web151.js +79 -2
- package/dist/web/index.web152.js +2 -2
- package/dist/web/index.web153.js +2 -38
- package/dist/web/index.web154.js +36 -5
- package/dist/web/index.web155.js +5 -33
- package/dist/web/index.web156.js +34 -8
- package/dist/web/index.web157.js +8 -10
- package/dist/web/index.web158.js +10 -11
- package/dist/web/index.web159.js +11 -13
- package/dist/web/index.web160.js +13 -18
- package/dist/web/index.web161.js +18 -5
- package/dist/web/index.web162.js +6 -5
- package/dist/web/index.web163.js +5 -11
- package/dist/web/index.web164.js +10 -4
- package/dist/web/index.web165.js +14 -103
- package/dist/web/index.web166.js +27 -77
- package/dist/web/index.web167.js +7 -79
- package/dist/web/index.web168.js +3 -14
- package/dist/web/index.web169.js +16 -16
- package/dist/web/index.web170.js +8 -7
- package/dist/web/index.web171.js +7 -3
- package/dist/web/index.web172.js +70 -18
- package/dist/web/index.web173.js +28 -8
- package/dist/web/index.web174.js +3 -7
- package/dist/web/index.web175.js +7 -72
- package/dist/web/index.web176.js +4 -28
- package/dist/web/index.web177.js +14 -3
- package/dist/web/index.web178.js +19 -15
- package/dist/web/index.web179.js +61 -4
- package/dist/web/index.web180.js +16 -13
- package/dist/web/index.web181.js +19 -15
- package/dist/web/index.web182.js +8 -61
- package/dist/web/index.web183.js +41 -16
- package/dist/web/index.web184.js +7 -23
- package/dist/web/index.web185.js +20 -8
- package/dist/web/index.web186.js +102 -41
- package/dist/web/index.web187.js +78 -7
- package/dist/web/index.web188.js +79 -20
- package/dist/web/index.web189.js +1 -1
- package/dist/web/index.web190.js +3 -3
- package/dist/web/index.web192.js +3 -3
- package/dist/web/index.web194.js +3 -3
- package/dist/web/index.web195.js +2 -8
- package/dist/web/index.web196.js +109 -2
- package/dist/web/index.web197.js +2 -378
- package/dist/web/index.web198.js +7 -835
- package/dist/web/index.web199.js +2 -39
- package/dist/web/index.web2.js +34 -29
- package/dist/web/index.web200.js +378 -2
- package/dist/web/index.web201.js +835 -69
- package/dist/web/index.web202.js +37 -33
- package/dist/web/index.web203.js +2 -21
- package/dist/web/index.web204.js +70 -2
- package/dist/web/index.web205.js +34 -20
- package/dist/web/index.web206.js +19 -18
- package/dist/web/index.web207.js +2 -33
- package/dist/web/index.web208.js +20 -6
- package/dist/web/index.web209.js +20 -2
- package/dist/web/index.web210.js +31 -107
- package/dist/web/index.web211.js +7 -2
- package/dist/web/index.web213.js +47 -2
- package/dist/web/index.web214.js +18 -2
- package/dist/web/index.web215.js +28 -2
- package/dist/web/index.web216.js +8 -18
- package/dist/web/index.web217.js +9 -26
- package/dist/web/index.web218.js +13 -8
- package/dist/web/index.web219.js +10 -11
- package/dist/web/index.web220.js +15 -11
- package/dist/web/index.web221.js +80 -9
- package/dist/web/index.web222.js +2 -17
- package/dist/web/index.web223.js +2 -81
- package/dist/web/index.web224.js +2 -47
- package/dist/web/index.web226.js +14 -78
- package/dist/web/index.web227.js +78 -14
- package/dist/web/index.web3.js +1 -1
- package/dist/web/index.web66.js +97 -60
- package/dist/web/index.web8.js +1 -1
- package/dist/web/index.web9.js +1 -1
- package/dist/web/index.web92.js +2 -2
- package/dist/web-types/auth/authManager.d.ts +1 -1
- package/dist/web-types/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/web/index.web179.js
CHANGED
|
@@ -1,7 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import "@coinbase/cdp-api-client";
|
|
2
|
+
import "./index.web2.js";
|
|
3
|
+
import "./index.web3.js";
|
|
4
|
+
import "jose";
|
|
5
|
+
import "viem";
|
|
6
|
+
import { isChainIdSupportedForCDPUserOps as p, userOperationChainIdToNameMapping as o, userOperationNameToChainIdMapping as u } from "./index.web84.js";
|
|
7
|
+
import "./index.web74.js";
|
|
8
|
+
import { getUserOperation as m } from "./index.web33.js";
|
|
9
|
+
import "./index.web85.js";
|
|
10
|
+
import "@solana/web3.js";
|
|
11
|
+
import "bs58";
|
|
12
|
+
import { validateUserHasEvmSmartAccount as d, RPCRequestError as e, STANDARD_ERROR_CODES as n } from "./index.web72.js";
|
|
13
|
+
async function D(t, s) {
|
|
14
|
+
const i = t[0], c = (await d()).evmSmartAccountObjects?.[0]?.address, r = s.getState().chainId;
|
|
15
|
+
if (!p(r) || !o[r])
|
|
16
|
+
throw new e(
|
|
17
|
+
n.rpc.invalidParams,
|
|
18
|
+
"Chain ID is not supported for user operations"
|
|
19
|
+
);
|
|
20
|
+
try {
|
|
21
|
+
const a = await m({
|
|
22
|
+
userOperationHash: i,
|
|
23
|
+
evmSmartAccount: c,
|
|
24
|
+
network: o[r]
|
|
25
|
+
});
|
|
26
|
+
return l(a);
|
|
27
|
+
} catch (a) {
|
|
28
|
+
throw console.log("Failed to get user operation status", a), new e(
|
|
29
|
+
n.rpc.internal,
|
|
30
|
+
"Failed to get user operation status"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function l(t) {
|
|
35
|
+
return {
|
|
36
|
+
atomic: !0,
|
|
37
|
+
chainId: u[t.network] ?? 0,
|
|
38
|
+
receipts: t.receipts?.map((s) => ({
|
|
39
|
+
transactionHash: s.transactionHash,
|
|
40
|
+
blockHash: s.blockHash,
|
|
41
|
+
blockNumber: BigInt(s.blockNumber ?? 0),
|
|
42
|
+
gasUsed: BigInt(s.gasUsed ?? 0),
|
|
43
|
+
logs: [],
|
|
44
|
+
status: ""
|
|
45
|
+
})),
|
|
46
|
+
id: t.userOpHash,
|
|
47
|
+
status: h(t.status),
|
|
48
|
+
version: "1"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function h(t) {
|
|
52
|
+
switch (t) {
|
|
53
|
+
case "dropped":
|
|
54
|
+
case "failed":
|
|
55
|
+
return 400;
|
|
56
|
+
case "complete":
|
|
57
|
+
return 200;
|
|
58
|
+
default:
|
|
59
|
+
return 100;
|
|
60
|
+
}
|
|
4
61
|
}
|
|
5
62
|
export {
|
|
6
|
-
|
|
63
|
+
D as handleGetCallsStatus
|
|
7
64
|
};
|
package/dist/web/index.web180.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import { toHex as a } from "viem";
|
|
2
|
+
import { userOperationChainIdToNameMapping as o } from "./index.web84.js";
|
|
3
|
+
import { validateUserConnected as i } from "./index.web72.js";
|
|
4
|
+
import "zustand";
|
|
1
5
|
import "@coinbase/cdp-api-client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return (await t())?.evmSmartAccountObjects?.map((r) => r.address) || [];
|
|
6
|
+
async function h() {
|
|
7
|
+
return !(await i()).evmSmartAccounts?.length ? {} : Object.keys(
|
|
8
|
+
o
|
|
9
|
+
).reduce((t, e) => {
|
|
10
|
+
const r = a(Number(e));
|
|
11
|
+
return t[r] = {
|
|
12
|
+
atomic: { status: "supported" },
|
|
13
|
+
paymasterService: { supported: !0 },
|
|
14
|
+
dataSuffix: { supported: !0 }
|
|
15
|
+
}, t;
|
|
16
|
+
}, {});
|
|
14
17
|
}
|
|
15
18
|
export {
|
|
16
|
-
|
|
19
|
+
h as handleGetCapabilities
|
|
17
20
|
};
|
package/dist/web/index.web181.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { hashMessage as n } from "viem";
|
|
2
|
+
import { signAndWrapTypedDataForSmartAccount as i } from "./index.web87.js";
|
|
3
|
+
import { validateUserOwnsSmartAccount as c, EIP1193ProviderError as d, STANDARD_ERROR_CODES as u } from "./index.web72.js";
|
|
4
|
+
async function p(r, a) {
|
|
5
|
+
const [o, e] = r, s = await c(e);
|
|
5
6
|
try {
|
|
6
|
-
const { signature:
|
|
7
|
-
smartAccount:
|
|
8
|
-
ownerAddress:
|
|
9
|
-
hash:
|
|
10
|
-
chainId:
|
|
7
|
+
const { signature: t } = await i({
|
|
8
|
+
smartAccount: e,
|
|
9
|
+
ownerAddress: s.evmAccounts[0],
|
|
10
|
+
hash: g(o),
|
|
11
|
+
chainId: a.getState().chainId
|
|
11
12
|
});
|
|
12
|
-
return
|
|
13
|
-
} catch (
|
|
14
|
-
throw new
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
return t;
|
|
14
|
+
} catch (t) {
|
|
15
|
+
throw new d(
|
|
16
|
+
u.provider.userRejectedRequest,
|
|
17
|
+
t instanceof Error ? t.message : "Signing failed"
|
|
17
18
|
);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
function g(r) {
|
|
22
|
+
return typeof r == "string" ? n({ raw: r }) : n(r);
|
|
23
|
+
}
|
|
20
24
|
export {
|
|
21
|
-
|
|
25
|
+
p as handlePersonalSign
|
|
22
26
|
};
|
package/dist/web/index.web182.js
CHANGED
|
@@ -1,64 +1,11 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "./index.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { getUserOperation as m } from "./index.web33.js";
|
|
9
|
-
import "./index.web85.js";
|
|
10
|
-
import "@solana/web3.js";
|
|
11
|
-
import "bs58";
|
|
12
|
-
import { validateUserHasEvmSmartAccount as d, RPCRequestError as e, STANDARD_ERROR_CODES as n } from "./index.web72.js";
|
|
13
|
-
async function D(t, s) {
|
|
14
|
-
const i = t[0], c = (await d()).evmSmartAccountObjects?.[0]?.address, r = s.getState().chainId;
|
|
15
|
-
if (!p(r) || !o[r])
|
|
16
|
-
throw new e(
|
|
17
|
-
n.rpc.invalidParams,
|
|
18
|
-
"Chain ID is not supported for user operations"
|
|
19
|
-
);
|
|
20
|
-
try {
|
|
21
|
-
const a = await m({
|
|
22
|
-
userOperationHash: i,
|
|
23
|
-
evmSmartAccount: c,
|
|
24
|
-
network: o[r]
|
|
25
|
-
});
|
|
26
|
-
return l(a);
|
|
27
|
-
} catch (a) {
|
|
28
|
-
throw console.log("Failed to get user operation status", a), new e(
|
|
29
|
-
n.rpc.internal,
|
|
30
|
-
"Failed to get user operation status"
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function l(t) {
|
|
35
|
-
return {
|
|
36
|
-
atomic: !0,
|
|
37
|
-
chainId: u[t.network] ?? 0,
|
|
38
|
-
receipts: t.receipts?.map((s) => ({
|
|
39
|
-
transactionHash: s.transactionHash,
|
|
40
|
-
blockHash: s.blockHash,
|
|
41
|
-
blockNumber: BigInt(s.blockNumber ?? 0),
|
|
42
|
-
gasUsed: BigInt(s.gasUsed ?? 0),
|
|
43
|
-
logs: [],
|
|
44
|
-
status: ""
|
|
45
|
-
})),
|
|
46
|
-
id: t.userOpHash,
|
|
47
|
-
status: h(t.status),
|
|
48
|
-
version: "1"
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function h(t) {
|
|
52
|
-
switch (t) {
|
|
53
|
-
case "dropped":
|
|
54
|
-
case "failed":
|
|
55
|
-
return 400;
|
|
56
|
-
case "complete":
|
|
57
|
-
return 200;
|
|
58
|
-
default:
|
|
59
|
-
return 100;
|
|
60
|
-
}
|
|
1
|
+
import { fromNumber as r } from "./index.web213.js";
|
|
2
|
+
import { validateUserConnected as a } from "./index.web72.js";
|
|
3
|
+
async function s(t, e) {
|
|
4
|
+
const n = await a();
|
|
5
|
+
return t.emit("connect", {
|
|
6
|
+
chainId: r(e.getState().chainId)
|
|
7
|
+
}), n.evmSmartAccountObjects?.map((c) => c.address) || [];
|
|
61
8
|
}
|
|
62
9
|
export {
|
|
63
|
-
|
|
10
|
+
s as handleRequestAccounts
|
|
64
11
|
};
|
package/dist/web/index.web183.js
CHANGED
|
@@ -1,20 +1,45 @@
|
|
|
1
|
-
import { toHex as a } from "viem";
|
|
2
|
-
import { userOperationChainIdToNameMapping as o } from "./index.web84.js";
|
|
3
|
-
import { validateUserConnected as i } from "./index.web72.js";
|
|
4
|
-
import "zustand";
|
|
5
1
|
import "@coinbase/cdp-api-client";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import "./index.web2.js";
|
|
3
|
+
import "./index.web3.js";
|
|
4
|
+
import "jose";
|
|
5
|
+
import "viem";
|
|
6
|
+
import { isChainIdSupportedForCDPUserOps as u, userOperationChainIdToNameMapping as d } from "./index.web84.js";
|
|
7
|
+
import "./index.web74.js";
|
|
8
|
+
import { sendUserOperation as l } from "./index.web32.js";
|
|
9
|
+
import "./index.web85.js";
|
|
10
|
+
import "@solana/web3.js";
|
|
11
|
+
import "bs58";
|
|
12
|
+
import { validateUserHasEvmSmartAccount as f, RPCRequestError as i, STANDARD_ERROR_CODES as s } from "./index.web72.js";
|
|
13
|
+
async function x(r, t) {
|
|
14
|
+
const [{ calls: n, capabilities: e }] = r, p = (await f()).evmSmartAccounts[0], o = t.getState().chainId;
|
|
15
|
+
if (!u(o))
|
|
16
|
+
throw new i(
|
|
17
|
+
s.rpc.invalidParams,
|
|
18
|
+
"Chain ID is not supported for user operations"
|
|
19
|
+
);
|
|
20
|
+
const m = e?.dataSuffix?.value, c = e?.paymasterService?.url;
|
|
21
|
+
try {
|
|
22
|
+
return (await l({
|
|
23
|
+
evmSmartAccount: p,
|
|
24
|
+
calls: v(n),
|
|
25
|
+
network: d[o],
|
|
26
|
+
paymasterUrl: c,
|
|
27
|
+
dataSuffix: m
|
|
28
|
+
})).userOperationHash;
|
|
29
|
+
} catch (a) {
|
|
30
|
+
throw new i(
|
|
31
|
+
s.rpc.transactionRejected,
|
|
32
|
+
a instanceof Error ? a.message : "User operation failed"
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function v(r) {
|
|
37
|
+
return r.map((t) => ({
|
|
38
|
+
to: t.to,
|
|
39
|
+
data: t.data,
|
|
40
|
+
value: t.value ? BigInt(t.value) : void 0
|
|
41
|
+
}));
|
|
17
42
|
}
|
|
18
43
|
export {
|
|
19
|
-
|
|
44
|
+
x as handleSendCalls
|
|
20
45
|
};
|
package/dist/web/index.web184.js
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { signature: t } = await i({
|
|
8
|
-
smartAccount: e,
|
|
9
|
-
ownerAddress: s.evmAccounts[0],
|
|
10
|
-
hash: g(o),
|
|
11
|
-
chainId: a.getState().chainId
|
|
12
|
-
});
|
|
13
|
-
return t;
|
|
14
|
-
} catch (t) {
|
|
15
|
-
throw new d(
|
|
16
|
-
u.provider.userRejectedRequest,
|
|
17
|
-
t instanceof Error ? t.message : "Signing failed"
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function g(r) {
|
|
22
|
-
return typeof r == "string" ? n({ raw: r }) : n(r);
|
|
1
|
+
import { EIP1193ProviderError as r, STANDARD_ERROR_CODES as t } from "./index.web72.js";
|
|
2
|
+
async function a(n, o, s) {
|
|
3
|
+
throw new r(
|
|
4
|
+
t.provider.unsupportedMethod,
|
|
5
|
+
"eth_sendTransaction is not supported with smart accounts. Use wallet_sendCalls instead."
|
|
6
|
+
);
|
|
23
7
|
}
|
|
24
8
|
export {
|
|
25
|
-
|
|
9
|
+
a as handleSendTransaction
|
|
26
10
|
};
|
package/dist/web/index.web185.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { hashTypedData as s } from "viem";
|
|
2
|
+
import { signAndWrapTypedDataForSmartAccount as c } from "./index.web87.js";
|
|
3
|
+
import { validateUserOwnsSmartAccount as i, EIP1193ProviderError as d, STANDARD_ERROR_CODES as m } from "./index.web72.js";
|
|
4
|
+
async function A(a, e) {
|
|
5
|
+
const [t, n] = a, o = await i(t);
|
|
6
|
+
try {
|
|
7
|
+
const { signature: r } = await c({
|
|
8
|
+
smartAccount: t,
|
|
9
|
+
ownerAddress: o.evmAccounts[0],
|
|
10
|
+
hash: s(JSON.parse(n)),
|
|
11
|
+
chainId: e.getState().chainId
|
|
12
|
+
});
|
|
13
|
+
return r;
|
|
14
|
+
} catch (r) {
|
|
15
|
+
throw new d(
|
|
16
|
+
m.provider.userRejectedRequest,
|
|
17
|
+
r instanceof Error ? r.message : "Signing failed"
|
|
18
|
+
);
|
|
19
|
+
}
|
|
8
20
|
}
|
|
9
21
|
export {
|
|
10
|
-
|
|
22
|
+
A as handleSignTypedData
|
|
11
23
|
};
|
package/dist/web/index.web186.js
CHANGED
|
@@ -1,45 +1,106 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "./index.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.web187.js";
|
|
2
|
+
import { createHasher as u, clean as C, rotr as i } from "./index.web188.js";
|
|
3
|
+
const B = /* @__PURE__ */ Uint32Array.from([
|
|
4
|
+
1116352408,
|
|
5
|
+
1899447441,
|
|
6
|
+
3049323471,
|
|
7
|
+
3921009573,
|
|
8
|
+
961987163,
|
|
9
|
+
1508970993,
|
|
10
|
+
2453635748,
|
|
11
|
+
2870763221,
|
|
12
|
+
3624381080,
|
|
13
|
+
310598401,
|
|
14
|
+
607225278,
|
|
15
|
+
1426881987,
|
|
16
|
+
1925078388,
|
|
17
|
+
2162078206,
|
|
18
|
+
2614888103,
|
|
19
|
+
3248222580,
|
|
20
|
+
3835390401,
|
|
21
|
+
4022224774,
|
|
22
|
+
264347078,
|
|
23
|
+
604807628,
|
|
24
|
+
770255983,
|
|
25
|
+
1249150122,
|
|
26
|
+
1555081692,
|
|
27
|
+
1996064986,
|
|
28
|
+
2554220882,
|
|
29
|
+
2821834349,
|
|
30
|
+
2952996808,
|
|
31
|
+
3210313671,
|
|
32
|
+
3336571891,
|
|
33
|
+
3584528711,
|
|
34
|
+
113926993,
|
|
35
|
+
338241895,
|
|
36
|
+
666307205,
|
|
37
|
+
773529912,
|
|
38
|
+
1294757372,
|
|
39
|
+
1396182291,
|
|
40
|
+
1695183700,
|
|
41
|
+
1986661051,
|
|
42
|
+
2177026350,
|
|
43
|
+
2456956037,
|
|
44
|
+
2730485921,
|
|
45
|
+
2820302411,
|
|
46
|
+
3259730800,
|
|
47
|
+
3345764771,
|
|
48
|
+
3516065817,
|
|
49
|
+
3600352804,
|
|
50
|
+
4094571909,
|
|
51
|
+
275423344,
|
|
52
|
+
430227734,
|
|
53
|
+
506948616,
|
|
54
|
+
659060556,
|
|
55
|
+
883997877,
|
|
56
|
+
958139571,
|
|
57
|
+
1322822218,
|
|
58
|
+
1537002063,
|
|
59
|
+
1747873779,
|
|
60
|
+
1955562222,
|
|
61
|
+
2024104815,
|
|
62
|
+
2227730452,
|
|
63
|
+
2361852424,
|
|
64
|
+
2428436474,
|
|
65
|
+
2756734187,
|
|
66
|
+
3204031479,
|
|
67
|
+
3329325298
|
|
68
|
+
]), h = /* @__PURE__ */ new Uint32Array(64);
|
|
69
|
+
class E extends D {
|
|
70
|
+
constructor(o = 32) {
|
|
71
|
+
super(64, o, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
|
|
72
|
+
}
|
|
73
|
+
get() {
|
|
74
|
+
const { A: o, B: r, C: t, D: s, E: a, F: f, G: c, H: e } = this;
|
|
75
|
+
return [o, r, t, s, a, f, c, e];
|
|
76
|
+
}
|
|
77
|
+
// prettier-ignore
|
|
78
|
+
set(o, r, t, s, a, f, c, e) {
|
|
79
|
+
this.A = o | 0, this.B = r | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
|
|
80
|
+
}
|
|
81
|
+
process(o, r) {
|
|
82
|
+
for (let x = 0; x < 16; x++, r += 4)
|
|
83
|
+
h[x] = o.getUint32(r, !1);
|
|
84
|
+
for (let x = 16; x < 64; x++) {
|
|
85
|
+
const H = h[x - 15], d = h[x - 2], m = i(H, 7) ^ i(H, 18) ^ H >>> 3, l = i(d, 17) ^ i(d, 19) ^ d >>> 10;
|
|
86
|
+
h[x] = l + h[x - 7] + m + h[x - 16] | 0;
|
|
87
|
+
}
|
|
88
|
+
let { A: t, B: s, C: a, D: f, E: c, F: e, G: n, H: A } = this;
|
|
89
|
+
for (let x = 0; x < 64; x++) {
|
|
90
|
+
const H = i(c, 6) ^ i(c, 11) ^ i(c, 25), d = A + H + g(c, e, n) + B[x] + h[x] | 0, l = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + p(t, s, a) | 0;
|
|
91
|
+
A = n, n = e, e = c, c = f + d | 0, f = a, a = s, s = t, t = d + l | 0;
|
|
92
|
+
}
|
|
93
|
+
t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(t, s, a, f, c, e, n, A);
|
|
94
|
+
}
|
|
95
|
+
roundClean() {
|
|
96
|
+
C(h);
|
|
97
|
+
}
|
|
98
|
+
destroy() {
|
|
99
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), C(this.buffer);
|
|
34
100
|
}
|
|
35
101
|
}
|
|
36
|
-
|
|
37
|
-
return r.map((t) => ({
|
|
38
|
-
to: t.to,
|
|
39
|
-
data: t.data,
|
|
40
|
-
value: t.value ? BigInt(t.value) : void 0
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
102
|
+
const y = /* @__PURE__ */ u(() => new E());
|
|
43
103
|
export {
|
|
44
|
-
|
|
104
|
+
E as SHA256,
|
|
105
|
+
y as sha256
|
|
45
106
|
};
|
package/dist/web/index.web187.js
CHANGED
|
@@ -1,10 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
t
|
|
5
|
-
|
|
6
|
-
);
|
|
1
|
+
import { Hash as g, createView as l, aexists as b, toBytes as a, abytes as d, aoutput as x, clean as w } from "./index.web188.js";
|
|
2
|
+
function y(o, t, s, n) {
|
|
3
|
+
if (typeof o.setBigUint64 == "function")
|
|
4
|
+
return o.setBigUint64(t, s, n);
|
|
5
|
+
const i = BigInt(32), h = BigInt(4294967295), e = Number(s >> i & h), r = Number(s & h), c = n ? 4 : 0, u = n ? 0 : 4;
|
|
6
|
+
o.setUint32(t + c, e, n), o.setUint32(t + u, r, n);
|
|
7
7
|
}
|
|
8
|
+
function U(o, t, s) {
|
|
9
|
+
return o & t ^ ~o & s;
|
|
10
|
+
}
|
|
11
|
+
function _(o, t, s) {
|
|
12
|
+
return o & t ^ o & s ^ t & s;
|
|
13
|
+
}
|
|
14
|
+
class m extends g {
|
|
15
|
+
constructor(t, s, n, i) {
|
|
16
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = s, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = l(this.buffer);
|
|
17
|
+
}
|
|
18
|
+
update(t) {
|
|
19
|
+
b(this), t = a(t), d(t);
|
|
20
|
+
const { view: s, buffer: n, blockLen: i } = this, h = t.length;
|
|
21
|
+
for (let e = 0; e < h; ) {
|
|
22
|
+
const r = Math.min(i - this.pos, h - e);
|
|
23
|
+
if (r === i) {
|
|
24
|
+
const c = l(t);
|
|
25
|
+
for (; i <= h - e; e += i)
|
|
26
|
+
this.process(c, e);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
n.set(t.subarray(e, e + r), this.pos), this.pos += r, e += r, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
30
|
+
}
|
|
31
|
+
return this.length += t.length, this.roundClean(), this;
|
|
32
|
+
}
|
|
33
|
+
digestInto(t) {
|
|
34
|
+
b(this), x(t, this), this.finished = !0;
|
|
35
|
+
const { buffer: s, view: n, blockLen: i, isLE: h } = this;
|
|
36
|
+
let { pos: e } = this;
|
|
37
|
+
s[e++] = 128, w(this.buffer.subarray(e)), this.padOffset > i - e && (this.process(n, 0), e = 0);
|
|
38
|
+
for (let f = e; f < i; f++)
|
|
39
|
+
s[f] = 0;
|
|
40
|
+
y(n, i - 8, BigInt(this.length * 8), h), this.process(n, 0);
|
|
41
|
+
const r = l(t), c = this.outputLen;
|
|
42
|
+
if (c % 4)
|
|
43
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
44
|
+
const u = c / 4, p = this.get();
|
|
45
|
+
if (u > p.length)
|
|
46
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
47
|
+
for (let f = 0; f < u; f++)
|
|
48
|
+
r.setUint32(4 * f, p[f], h);
|
|
49
|
+
}
|
|
50
|
+
digest() {
|
|
51
|
+
const { buffer: t, outputLen: s } = this;
|
|
52
|
+
this.digestInto(t);
|
|
53
|
+
const n = t.slice(0, s);
|
|
54
|
+
return this.destroy(), n;
|
|
55
|
+
}
|
|
56
|
+
_cloneInto(t) {
|
|
57
|
+
t || (t = new this.constructor()), t.set(...this.get());
|
|
58
|
+
const { blockLen: s, buffer: n, length: i, finished: h, destroyed: e, pos: r } = this;
|
|
59
|
+
return t.destroyed = e, t.finished = h, t.length = i, t.pos = r, i % s && t.buffer.set(n), t;
|
|
60
|
+
}
|
|
61
|
+
clone() {
|
|
62
|
+
return this._cloneInto();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const B = /* @__PURE__ */ Uint32Array.from([
|
|
66
|
+
1779033703,
|
|
67
|
+
3144134277,
|
|
68
|
+
1013904242,
|
|
69
|
+
2773480762,
|
|
70
|
+
1359893119,
|
|
71
|
+
2600822924,
|
|
72
|
+
528734635,
|
|
73
|
+
1541459225
|
|
74
|
+
]);
|
|
8
75
|
export {
|
|
9
|
-
|
|
76
|
+
U as Chi,
|
|
77
|
+
m as HashMD,
|
|
78
|
+
_ as Maj,
|
|
79
|
+
B as SHA256_IV,
|
|
80
|
+
y as setBigUint64
|
|
10
81
|
};
|