@coinbase/cdp-core 0.0.57 → 0.0.60

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 (133) hide show
  1. package/dist/esm/index.native.js +55 -54
  2. package/dist/esm/index.native103.js +1 -1
  3. package/dist/esm/index.native115.js +1 -1
  4. package/dist/esm/index.native127.js +1 -1
  5. package/dist/esm/index.native131.js +1 -1
  6. package/dist/esm/index.native140.js +74 -42
  7. package/dist/esm/index.native141.js +42 -74
  8. package/dist/esm/index.native146.js +7 -38
  9. package/dist/esm/index.native148.js +375 -67
  10. package/dist/esm/index.native149.js +832 -34
  11. package/dist/esm/index.native150.js +38 -20
  12. package/dist/esm/index.native151.js +2 -8
  13. package/dist/esm/index.native152.js +70 -2
  14. package/dist/esm/index.native153.js +30 -373
  15. package/dist/esm/index.native154.js +20 -832
  16. package/dist/esm/index.native16.js +8 -0
  17. package/dist/esm/index.native164.js +1 -1
  18. package/dist/esm/index.native165.js +2 -2
  19. package/dist/esm/index.native166.js +2 -2
  20. package/dist/esm/index.native167.js +2 -2
  21. package/dist/esm/index.native25.js +1 -1
  22. package/dist/esm/index.native29.js +10 -2
  23. package/dist/esm/index.native47.js +1 -1
  24. package/dist/esm/index.native7.js +52 -51
  25. package/dist/esm/index.web.js +59 -58
  26. package/dist/esm/index.web126.js +1 -1
  27. package/dist/esm/index.web130.js +1 -1
  28. package/dist/esm/index.web133.js +2 -79
  29. package/dist/esm/index.web134.js +109 -2
  30. package/dist/esm/index.web135.js +2 -109
  31. package/dist/esm/index.web136.js +79 -2
  32. package/dist/esm/index.web144.js +1 -1
  33. package/dist/esm/index.web145.js +7 -38
  34. package/dist/esm/index.web147.js +375 -67
  35. package/dist/esm/index.web148.js +832 -34
  36. package/dist/esm/index.web149.js +38 -20
  37. package/dist/esm/index.web15.js +8 -0
  38. package/dist/esm/index.web150.js +2 -8
  39. package/dist/esm/index.web151.js +70 -2
  40. package/dist/esm/index.web152.js +30 -373
  41. package/dist/esm/index.web153.js +20 -832
  42. package/dist/esm/index.web164.js +2 -2
  43. package/dist/esm/index.web165.js +2 -2
  44. package/dist/esm/index.web166.js +2 -2
  45. package/dist/esm/index.web23.js +1 -1
  46. package/dist/esm/index.web27.js +10 -2
  47. package/dist/esm/index.web40.js +1 -1
  48. package/dist/esm/index.web41.js +3 -3
  49. package/dist/esm/index.web46.js +377 -2
  50. package/dist/esm/index.web47.js +2 -379
  51. package/dist/esm/index.web48.js +65 -28
  52. package/dist/esm/index.web49.js +364 -28
  53. package/dist/esm/index.web50.js +4 -2
  54. package/dist/esm/index.web51.js +28 -65
  55. package/dist/esm/index.web52.js +28 -364
  56. package/dist/esm/index.web6.js +52 -51
  57. package/dist/esm/index.web97.js +1 -1
  58. package/dist/native/index.native.js +55 -54
  59. package/dist/native/index.native103.js +1 -1
  60. package/dist/native/index.native115.js +1 -1
  61. package/dist/native/index.native127.js +1 -1
  62. package/dist/native/index.native131.js +1 -1
  63. package/dist/native/index.native140.js +74 -42
  64. package/dist/native/index.native141.js +42 -74
  65. package/dist/native/index.native146.js +7 -38
  66. package/dist/native/index.native148.js +375 -67
  67. package/dist/native/index.native149.js +832 -34
  68. package/dist/native/index.native150.js +38 -20
  69. package/dist/native/index.native151.js +2 -8
  70. package/dist/native/index.native152.js +70 -2
  71. package/dist/native/index.native153.js +30 -373
  72. package/dist/native/index.native154.js +20 -832
  73. package/dist/native/index.native16.js +8 -0
  74. package/dist/native/index.native164.js +1 -1
  75. package/dist/native/index.native165.js +2 -2
  76. package/dist/native/index.native166.js +2 -2
  77. package/dist/native/index.native167.js +2 -2
  78. package/dist/native/index.native25.js +1 -1
  79. package/dist/native/index.native29.js +10 -2
  80. package/dist/native/index.native47.js +1 -1
  81. package/dist/native/index.native7.js +52 -51
  82. package/dist/native-types/auth/authManager.d.ts +1 -0
  83. package/dist/native-types/auth/types.d.ts +1 -0
  84. package/dist/native-types/core.d.ts +1 -0
  85. package/dist/native-types/mocks/mockAuthManager.d.ts +1 -0
  86. package/dist/native-types/types.d.ts +4 -0
  87. package/dist/native-types/version.d.ts +1 -1
  88. package/dist/types/auth/authManager.d.ts +1 -0
  89. package/dist/types/auth/types.d.ts +1 -0
  90. package/dist/types/core.d.ts +1 -0
  91. package/dist/types/mocks/mockAuthManager.d.ts +1 -0
  92. package/dist/types/types.d.ts +4 -0
  93. package/dist/types/version.d.ts +1 -1
  94. package/dist/web/index.web.js +59 -58
  95. package/dist/web/index.web126.js +1 -1
  96. package/dist/web/index.web130.js +1 -1
  97. package/dist/web/index.web133.js +2 -79
  98. package/dist/web/index.web134.js +109 -2
  99. package/dist/web/index.web135.js +2 -109
  100. package/dist/web/index.web136.js +79 -2
  101. package/dist/web/index.web144.js +1 -1
  102. package/dist/web/index.web145.js +7 -38
  103. package/dist/web/index.web147.js +375 -67
  104. package/dist/web/index.web148.js +832 -34
  105. package/dist/web/index.web149.js +38 -20
  106. package/dist/web/index.web15.js +8 -0
  107. package/dist/web/index.web150.js +2 -8
  108. package/dist/web/index.web151.js +70 -2
  109. package/dist/web/index.web152.js +30 -373
  110. package/dist/web/index.web153.js +20 -832
  111. package/dist/web/index.web164.js +2 -2
  112. package/dist/web/index.web165.js +2 -2
  113. package/dist/web/index.web166.js +2 -2
  114. package/dist/web/index.web23.js +1 -1
  115. package/dist/web/index.web27.js +10 -2
  116. package/dist/web/index.web40.js +1 -1
  117. package/dist/web/index.web41.js +3 -3
  118. package/dist/web/index.web46.js +377 -2
  119. package/dist/web/index.web47.js +2 -379
  120. package/dist/web/index.web48.js +65 -28
  121. package/dist/web/index.web49.js +364 -28
  122. package/dist/web/index.web50.js +4 -2
  123. package/dist/web/index.web51.js +28 -65
  124. package/dist/web/index.web52.js +28 -364
  125. package/dist/web/index.web6.js +52 -51
  126. package/dist/web/index.web97.js +1 -1
  127. package/dist/web-types/auth/authManager.d.ts +1 -0
  128. package/dist/web-types/auth/types.d.ts +1 -0
  129. package/dist/web-types/core.d.ts +1 -0
  130. package/dist/web-types/mocks/mockAuthManager.d.ts +1 -0
  131. package/dist/web-types/types.d.ts +4 -0
  132. package/dist/web-types/version.d.ts +1 -1
  133. package/package.json +2 -2
@@ -74,6 +74,14 @@ class I {
74
74
  async getToken() {
75
75
  return this.shouldRefreshToken() && await this.refreshAccessToken(), this.authState?.accessToken ?? null;
76
76
  }
77
+ /**
78
+ * Gets the expiration time of the access token, or null if the user is not signed in.
79
+ *
80
+ * @returns The expiration time of the access token.
81
+ */
82
+ async getTokenExpiration() {
83
+ return this.authState?.expiresAt ?? null;
84
+ }
77
85
  /**
78
86
  * Gets the currently registered wallet secret ID. Rejects if the user is not signed in.
79
87
  *
@@ -1,4 +1,4 @@
1
- import { SizeExceedsPaddingSizeError as a } from "./index.native140.js";
1
+ import { SizeExceedsPaddingSizeError as a } from "./index.native141.js";
2
2
  function o(r, i = {}) {
3
3
  const { dir: n, size: e = 32 } = i;
4
4
  if (e === 0)
@@ -1,4 +1,4 @@
1
- var r = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- r as __module
3
+ r as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var r = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ e as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var r = { exports: {} };
2
2
  export {
3
- e as __module
3
+ r as __module
4
4
  };
@@ -1,2 +1,2 @@
1
- import { __require as r } from "./index.native151.js";
1
+ import { __require as r } from "./index.native146.js";
2
2
  r();
@@ -1,7 +1,7 @@
1
1
  import "@coinbase/cdp-api-client";
2
2
  import "viem";
3
3
  import { mockUser as e } from "./index.native31.js";
4
- class r {
4
+ class h {
5
5
  authState = null;
6
6
  authStateChangeCallback = null;
7
7
  /**
@@ -62,6 +62,14 @@ class r {
62
62
  async getToken() {
63
63
  return this.authState ? (this.authState.expiresAt <= Date.now() && await this.refreshToken(), this.authState?.accessToken ?? null) : null;
64
64
  }
65
+ /**
66
+ * Gets the expiration time of the access token, or null if the user is not signed in.
67
+ *
68
+ * @returns The expiration time of the access token.
69
+ */
70
+ async getTokenExpiration() {
71
+ return this.authState?.expiresAt ?? null;
72
+ }
65
73
  /**
66
74
  * Gets the currentlly registered wallet secret ID.
67
75
  *
@@ -117,5 +125,5 @@ class r {
117
125
  }
118
126
  }
119
127
  export {
120
- r as MockAuthManager
128
+ h as MockAuthManager
121
129
  };
@@ -1,4 +1,4 @@
1
- const o = "0.0.56";
1
+ const o = "0.0.59";
2
2
  export {
3
3
  o as VERSION
4
4
  };
@@ -1,19 +1,19 @@
1
1
  import { b as m } from "./index.native23.js";
2
- import { configureCdpApiClient as C, setAuthManager as M, initiateAuthentication as O, createEndUserEvmAccount as T, createEndUserEvmSmartAccount as A, createEndUserSolanaAccount as P, verifyEmailAuthentication as b, verifySmsAuthentication as j, verifyOAuthCode as x, signEvmHashWithEndUserAccount as K, signEvmTransactionWithEndUserAccount as W, signSolanaTransactionWithEndUserAccount as H, sendEvmTransactionWithEndUserAccount as B, sendSolanaTransactionWithEndUserAccount as D, signEvmMessageWithEndUserAccount as L, signSolanaMessageWithEndUserAccount as N, signEvmTypedDataWithEndUserAccount as F, sendUserOperationWithEndUserAccount as z, getUserOperationWithEndUserAccount as R, exportEndUserEvmAccount as $, exportEndUserSolanaAccount as V } from "@coinbase/cdp-api-client";
2
+ import { configureCdpApiClient as C, setAuthManager as M, initiateAuthentication as T, createEndUserEvmAccount as O, createEndUserEvmSmartAccount as A, createEndUserSolanaAccount as P, verifyEmailAuthentication as b, verifySmsAuthentication as x, verifyOAuthCode as j, signEvmHashWithEndUserAccount as K, signEvmTransactionWithEndUserAccount as W, signSolanaTransactionWithEndUserAccount as H, sendEvmTransactionWithEndUserAccount as B, sendSolanaTransactionWithEndUserAccount as D, signEvmMessageWithEndUserAccount as L, signSolanaMessageWithEndUserAccount as N, signEvmTypedDataWithEndUserAccount as F, sendUserOperationWithEndUserAccount as z, getUserOperationWithEndUserAccount as R, exportEndUserEvmAccount as $, exportEndUserSolanaAccount as V } from "@coinbase/cdp-api-client";
3
3
  import { Analytics as c } from "./index.native24.js";
4
4
  import "./index.native25.js";
5
5
  import { Keypair as v } from "@solana/web3.js";
6
6
  import w from "bs58";
7
7
  import { AuthManager as q } from "./index.native16.js";
8
8
  import { OAuthManager as G } from "./index.native26.js";
9
- import { toAuthState as h } from "./index.native27.js";
9
+ import { toAuthState as p } from "./index.native27.js";
10
10
  import { withAuth as u } from "./index.native28.js";
11
11
  import { MockAuthManager as J } from "./index.native29.js";
12
12
  import { MockOAuthManager as Q } from "./index.native30.js";
13
13
  import { mockUser as k } from "./index.native31.js";
14
14
  import { getPlatformServices as g, getPlatformCrypto as _ } from "./index.native6.js";
15
15
  import { isChainSupportedForCDPSends as X } from "./index.native32.js";
16
- import { getConfig as a, setCoreAuthManager as I, setCoreOAuthManager as E, getCoreAuthManager as o, getCoreOAuthManager as Y, setConfig as Z } from "./index.native22.js";
16
+ import { getConfig as a, setCoreAuthManager as E, setCoreOAuthManager as I, getCoreAuthManager as o, getCoreOAuthManager as Y, setConfig as Z } from "./index.native22.js";
17
17
  import "viem";
18
18
  import { serializeTransaction as U } from "./index.native33.js";
19
19
  const we = async (e) => {
@@ -27,7 +27,7 @@ const we = async (e) => {
27
27
  r = !0;
28
28
  }
29
29
  if (Z(e), a().useMock) {
30
- I(new J(a().projectId)), E(new Q());
30
+ E(new J(a().projectId)), I(new Q());
31
31
  return;
32
32
  }
33
33
  let n;
@@ -54,18 +54,18 @@ const we = async (e) => {
54
54
  refreshTokenStorage: n
55
55
  }), r) {
56
56
  const t = new G();
57
- E(t);
57
+ I(t);
58
58
  const s = new q(a().projectId);
59
- I(s), M(s);
59
+ E(s), M(s);
60
60
  }
61
61
  await o().ensureInitialized();
62
62
  }, ke = async (e) => (c.sendActionCallEvent({ name: "sign_in_with_email" }), f({
63
63
  email: e.email,
64
64
  type: "email"
65
- })), Ie = async (e) => (c.sendActionCallEvent({ name: "sign_in_with_sms" }), f({
65
+ })), Ee = async (e) => (c.sendActionCallEvent({ name: "sign_in_with_sms" }), f({
66
66
  phoneNumber: e.phoneNumber,
67
67
  type: "sms"
68
- })), Ee = async (e) => {
68
+ })), Ie = async (e) => {
69
69
  c.sendActionCallEvent({ name: "sign_in_with_oauth" });
70
70
  const r = g().oauth.getRedirectUrl();
71
71
  if (a().useMock) {
@@ -85,12 +85,12 @@ const we = async (e) => {
85
85
  )), _e = async (e) => (c.sendActionCallEvent({ name: "verify_sms_otp" }), y(
86
86
  e,
87
87
  "Mock SMS OTP verified",
88
- (r, n) => j(r, n)
88
+ (r, n) => x(r, n)
89
89
  )), Ue = async (e) => (c.sendActionCallEvent({ name: "verify_oauth" }), y(
90
90
  e,
91
91
  "Mock OAuth code verified",
92
- (r, n) => x(r, n.providerType, n)
93
- )), Ce = async () => (c.sendActionCallEvent({ name: "get_current_user" }), o().getUser()), Me = async () => (c.sendActionCallEvent({ name: "is_signed_in" }), o().isSignedIn()), Oe = async () => {
92
+ (r, n) => j(r, n.providerType, n)
93
+ )), Ce = async () => (c.sendActionCallEvent({ name: "get_current_user" }), o().getUser()), Me = async () => (c.sendActionCallEvent({ name: "is_signed_in" }), o().isSignedIn()), Te = async () => {
94
94
  if (c.sendActionCallEvent({ name: "sign_out" }), a().useMock) {
95
95
  await o().signOut();
96
96
  return;
@@ -98,9 +98,9 @@ const we = async (e) => {
98
98
  if (!await o().isSignedIn())
99
99
  throw new Error("User not signed in");
100
100
  await o().signOut();
101
- }, Te = async () => (c.sendActionCallEvent({ name: "get_access_token" }), o().getToken()), Pe = (e) => {
101
+ }, Oe = async () => (c.sendActionCallEvent({ name: "get_access_token" }), o().getToken()), Pe = async () => (c.sendActionCallEvent({ name: "get_access_token_expiration" }), o().getTokenExpiration()), be = (e) => {
102
102
  o().addAuthStateChangeCallback(e);
103
- }, be = (e) => {
103
+ }, xe = (e) => {
104
104
  Y().addOAuthStateChangeCallback(e);
105
105
  }, je = async (e) => (c.sendActionCallEvent({ name: "sign_evm_hash" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
106
106
  signature: (await K(a().projectId, r.userId, {
@@ -108,7 +108,7 @@ const we = async (e) => {
108
108
  address: e.evmAccount,
109
109
  walletSecretId: n
110
110
  })).signature
111
- }))), xe = async (e) => (c.sendActionCallEvent({ name: "sign_evm_transaction" }), a().useMock ? { signedTransaction: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => {
111
+ }))), Ke = async (e) => (c.sendActionCallEvent({ name: "sign_evm_transaction" }), a().useMock ? { signedTransaction: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => {
112
112
  const t = U(e.transaction);
113
113
  return {
114
114
  signedTransaction: (await W(
@@ -121,7 +121,7 @@ const we = async (e) => {
121
121
  }
122
122
  )).signedTransaction
123
123
  };
124
- })), Ke = async (e) => (c.sendActionCallEvent({ name: "sign_solana_transaction" }), a().useMock ? { signedTransaction: "mock-signed-transaction" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
124
+ })), We = async (e) => (c.sendActionCallEvent({ name: "sign_solana_transaction" }), a().useMock ? { signedTransaction: "mock-signed-transaction" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
125
125
  signedTransaction: (await H(
126
126
  a().projectId,
127
127
  r.userId,
@@ -131,7 +131,7 @@ const we = async (e) => {
131
131
  walletSecretId: n
132
132
  }
133
133
  )).signedTransaction
134
- }))), We = async (e) => {
134
+ }))), He = async (e) => {
135
135
  if (c.sendActionCallEvent({ name: "send_evm_transaction" }), !X(e.network))
136
136
  throw new Error(`Chain ${e.network} is not supported by the CDP Apis`);
137
137
  if (a().useMock)
@@ -149,7 +149,7 @@ const we = async (e) => {
149
149
  }
150
150
  )).transactionHash
151
151
  }));
152
- }, He = async (e) => (c.sendActionCallEvent({ name: "send_solana_transaction" }), a().useMock ? { transactionSignature: "mock-signature" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
152
+ }, Be = async (e) => (c.sendActionCallEvent({ name: "send_solana_transaction" }), a().useMock ? { transactionSignature: "mock-signature" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
153
153
  transactionSignature: (await D(
154
154
  a().projectId,
155
155
  r.userId,
@@ -160,13 +160,13 @@ const we = async (e) => {
160
160
  network: e.network
161
161
  }
162
162
  )).transactionSignature
163
- }))), Be = async (e) => (c.sendActionCallEvent({ name: "sign_evm_message" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
163
+ }))), De = async (e) => (c.sendActionCallEvent({ name: "sign_evm_message" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
164
164
  signature: (await L(a().projectId, r.userId, {
165
165
  message: e.message,
166
166
  address: e.evmAccount,
167
167
  walletSecretId: n
168
168
  })).signature
169
- }))), De = async (e) => (c.sendActionCallEvent({ name: "sign_solana_message" }), a().useMock ? { signature: "mockSignature" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
169
+ }))), Le = async (e) => (c.sendActionCallEvent({ name: "sign_solana_message" }), a().useMock ? { signature: "mockSignature" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
170
170
  signature: (await N(
171
171
  a().projectId,
172
172
  r.userId,
@@ -176,13 +176,13 @@ const we = async (e) => {
176
176
  walletSecretId: n
177
177
  }
178
178
  )).signature
179
- }))), Le = async (e) => (c.sendActionCallEvent({ name: "sign_evm_typed_data" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
179
+ }))), Ne = async (e) => (c.sendActionCallEvent({ name: "sign_evm_typed_data" }), a().useMock ? { signature: "0x0" } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
180
180
  signature: (await F(a().projectId, r.userId, {
181
181
  typedData: e.typedData,
182
182
  address: e.evmAccount,
183
183
  walletSecretId: n
184
184
  })).signature
185
- }))), Ne = async (e) => (c.sendActionCallEvent({ name: "send_user_operation" }), a().useMock ? {
185
+ }))), Fe = async (e) => (c.sendActionCallEvent({ name: "send_user_operation" }), a().useMock ? {
186
186
  userOperationHash: "0x1234567890123456789012345678901234567890123456789012345678901234"
187
187
  } : u(e, o(), async ({ user: r, walletSecretId: n }) => ({
188
188
  userOperationHash: (await z(
@@ -201,7 +201,7 @@ const we = async (e) => {
201
201
  paymasterUrl: e.paymasterUrl
202
202
  }
203
203
  )).userOpHash
204
- }))), Fe = async (e) => (c.sendActionCallEvent({ name: "get_user_operation" }), a().useMock ? {
204
+ }))), ze = async (e) => (c.sendActionCallEvent({ name: "get_user_operation" }), a().useMock ? {
205
205
  userOpHash: e.userOperationHash,
206
206
  network: e.network,
207
207
  calls: [
@@ -219,7 +219,7 @@ const we = async (e) => {
219
219
  r.userId,
220
220
  e.evmSmartAccount,
221
221
  e.userOperationHash
222
- ))), ze = async (e) => {
222
+ ))), Re = async (e) => {
223
223
  if (c.sendActionCallEvent({ name: "export_evm_account" }), a().useMock)
224
224
  return {
225
225
  privateKey: m.Buffer.from("mock-private-key").toString("hex")
@@ -238,7 +238,7 @@ const we = async (e) => {
238
238
  privateKey: m.Buffer.from(d).toString("hex")
239
239
  };
240
240
  });
241
- }, Re = async (e) => {
241
+ }, $e = async (e) => {
242
242
  if (c.sendActionCallEvent({ name: "export_solana_account" }), a().useMock) {
243
243
  const t = m.Buffer.from("mock-private-key").subarray(0, 32), s = m.Buffer.alloc(32);
244
244
  t.copy(s);
@@ -256,9 +256,9 @@ const we = async (e) => {
256
256
  }), d = await r.decryptWithPrivateKey(
257
257
  n.privateKey,
258
258
  i.encryptedPrivateKey
259
- ), l = v.fromSeed(new Uint8Array(d)), p = m.Buffer.concat([l.secretKey.subarray(0, 32), l.publicKey.toBytes()]);
259
+ ), l = v.fromSeed(new Uint8Array(d)), h = m.Buffer.concat([l.secretKey.subarray(0, 32), l.publicKey.toBytes()]);
260
260
  return {
261
- privateKey: w.encode(p)
261
+ privateKey: w.encode(h)
262
262
  };
263
263
  });
264
264
  }, f = async (e) => {
@@ -272,7 +272,7 @@ const we = async (e) => {
272
272
  };
273
273
  if (await o().isSignedIn())
274
274
  throw new Error("User is already authenticated. Please sign out first.");
275
- const n = await O(a().projectId, e);
275
+ const n = await T(a().projectId, e);
276
276
  return "authUrl" in n ? {
277
277
  flowId: n.flowId,
278
278
  authUrl: n.authUrl
@@ -292,7 +292,7 @@ const we = async (e) => {
292
292
  isNewUser: !1
293
293
  };
294
294
  const t = await n(a().projectId, e);
295
- let s = h(
295
+ let s = p(
296
296
  t.accessToken,
297
297
  t.validUntil,
298
298
  t.endUser
@@ -315,22 +315,22 @@ const we = async (e) => {
315
315
  if (!r.user.evmAccounts || r.user.evmAccounts.length === 0)
316
316
  try {
317
317
  const s = await o().getWalletSecretId();
318
- let i = await T(a().projectId, r.user.userId, {
318
+ let i = await O(a().projectId, r.user.userId, {
319
319
  walletSecretId: s
320
320
  }), d = !1;
321
321
  const l = a().ethereum;
322
322
  if (l?.createOnLogin === "smart" && (d = l.enableSpendPermissions ?? !1), n === "smart") {
323
- const [p] = i.evmAccounts;
323
+ const [h] = i.evmAccounts;
324
324
  i = await A(
325
325
  a().projectId,
326
326
  r.user.userId,
327
327
  {
328
- owner: p,
328
+ owner: h,
329
329
  enableSpendPermissions: d
330
330
  }
331
331
  );
332
332
  }
333
- t = h(e.accessToken, e.validUntil, i), await o().setAuthState(t);
333
+ t = p(e.accessToken, e.validUntil, i), await o().setAuthState(t);
334
334
  } catch (s) {
335
335
  throw new Error(`Failed to create EVM account: ${s}`);
336
336
  }
@@ -345,7 +345,7 @@ const we = async (e) => {
345
345
  // Defaulting to false until the feature is ready.
346
346
  }
347
347
  );
348
- t = h(e.accessToken, e.validUntil, i), await o().setAuthState(t);
348
+ t = p(e.accessToken, e.validUntil, i), await o().setAuthState(t);
349
349
  } catch (s) {
350
350
  throw new Error(`Failed to create EVM Smart Account: ${s}`);
351
351
  }
@@ -361,35 +361,36 @@ const we = async (e) => {
361
361
  walletSecretId: t
362
362
  }
363
363
  );
364
- n = h(e.accessToken, e.validUntil, s), await o().setAuthState(n);
364
+ n = p(e.accessToken, e.validUntil, s), await o().setAuthState(n);
365
365
  } catch (t) {
366
366
  throw new Error(`Failed to create Solana account: ${t}`);
367
367
  }
368
368
  return n;
369
369
  };
370
370
  export {
371
- ze as exportEvmAccount,
372
- Re as exportSolanaAccount,
373
- Te as getAccessToken,
371
+ Re as exportEvmAccount,
372
+ $e as exportSolanaAccount,
373
+ Oe as getAccessToken,
374
+ Pe as getAccessTokenExpiration,
374
375
  Ce as getCurrentUser,
375
- Fe as getUserOperation,
376
+ ze as getUserOperation,
376
377
  we as initialize,
377
378
  Me as isSignedIn,
378
- Pe as onAuthStateChange,
379
- be as onOAuthStateChange,
380
- We as sendEvmTransaction,
381
- He as sendSolanaTransaction,
382
- Ne as sendUserOperation,
379
+ be as onAuthStateChange,
380
+ xe as onOAuthStateChange,
381
+ He as sendEvmTransaction,
382
+ Be as sendSolanaTransaction,
383
+ Fe as sendUserOperation,
383
384
  je as signEvmHash,
384
- Be as signEvmMessage,
385
- xe as signEvmTransaction,
386
- Le as signEvmTypedData,
385
+ De as signEvmMessage,
386
+ Ke as signEvmTransaction,
387
+ Ne as signEvmTypedData,
387
388
  ke as signInWithEmail,
388
- Ee as signInWithOAuth,
389
- Ie as signInWithSms,
390
- Oe as signOut,
391
- De as signSolanaMessage,
392
- Ke as signSolanaTransaction,
389
+ Ie as signInWithOAuth,
390
+ Ee as signInWithSms,
391
+ Te as signOut,
392
+ Le as signSolanaMessage,
393
+ We as signSolanaTransaction,
393
394
  Se as verifyEmailOTP,
394
395
  Ue as verifyOAuth,
395
396
  _e as verifySmsOTP
@@ -2,22 +2,22 @@ import { setPlatformServices as r } from "./index.web2.js";
2
2
  import { webCrypto as o } from "./index.web3.js";
3
3
  import { webOAuth as e } from "./index.web4.js";
4
4
  import { webStorage as t } from "./index.web5.js";
5
- import { exportEvmAccount as c, exportSolanaAccount as g, getAccessToken as E, getCurrentUser as d, getUserOperation as S, initialize as u, isSignedIn as A, onAuthStateChange as h, onOAuthStateChange as x, sendEvmTransaction as v, sendSolanaTransaction as T, sendUserOperation as O, signEvmHash as y, signEvmMessage as P, signEvmTransaction as k, signEvmTypedData as I, signInWithEmail as C, signInWithOAuth as W, signInWithSms as w, signOut as D, signSolanaMessage as R, signSolanaTransaction as U, verifyEmailOTP as b, verifyOAuth as M, verifySmsOTP as N } from "./index.web6.js";
6
- import { createSpendPermission as H } from "./index.web7.js";
7
- import { listSpendPermissions as _ } from "./index.web8.js";
8
- import { APIError as G, ErrorType as j, HttpErrorType as q, OAuth2ProviderType as F, SendEvmTransactionWithEndUserAccountBodyNetwork as J, SendSolanaTransactionWithEndUserAccountBodyNetwork as K } from "@coinbase/cdp-api-client";
9
- import { revokeSpendPermission as Q } from "./index.web9.js";
10
- import { linkGoogle as Y } from "./index.web10.js";
11
- import { linkSms as $ } from "./index.web11.js";
12
- import { linkEmail as or } from "./index.web12.js";
13
- import { linkOAuth as tr } from "./index.web13.js";
14
- import { linkApple as ir } from "./index.web14.js";
15
- import { AuthManager as sr } from "./index.web15.js";
5
+ import { exportEvmAccount as g, exportSolanaAccount as l, getAccessToken as E, getAccessTokenExpiration as d, getCurrentUser as S, getUserOperation as u, initialize as A, isSignedIn as x, onAuthStateChange as h, onOAuthStateChange as T, sendEvmTransaction as v, sendSolanaTransaction as O, sendUserOperation as y, signEvmHash as P, signEvmMessage as k, signEvmTransaction as I, signEvmTypedData as C, signInWithEmail as W, signInWithOAuth as w, signInWithSms as D, signOut as R, signSolanaMessage as U, signSolanaTransaction as b, verifyEmailOTP as M, verifyOAuth as N, verifySmsOTP as B } from "./index.web6.js";
6
+ import { createSpendPermission as V } from "./index.web7.js";
7
+ import { listSpendPermissions as z } from "./index.web8.js";
8
+ import { APIError as j, ErrorType as q, HttpErrorType as F, OAuth2ProviderType as J, SendEvmTransactionWithEndUserAccountBodyNetwork as K, SendSolanaTransactionWithEndUserAccountBodyNetwork as L } from "@coinbase/cdp-api-client";
9
+ import { revokeSpendPermission as X } from "./index.web9.js";
10
+ import { linkGoogle as Z } from "./index.web10.js";
11
+ import { linkSms as rr } from "./index.web11.js";
12
+ import { linkEmail as er } from "./index.web12.js";
13
+ import { linkOAuth as nr } from "./index.web13.js";
14
+ import { linkApple as ar } from "./index.web14.js";
15
+ import { AuthManager as mr } from "./index.web15.js";
16
16
  import "viem";
17
- import { toViemAccount as pr } from "./index.web16.js";
18
- import { InputValidationError as lr, ModuleResolutionError as cr } from "./index.web17.js";
19
- import { createCDPEmbeddedWallet as Er } from "./index.web18.js";
20
- import { EIP1193ProviderError as Sr, STANDARD_ERROR_CODES as ur } from "./index.web19.js";
17
+ import { toViemAccount as cr } from "./index.web16.js";
18
+ import { InputValidationError as gr, ModuleResolutionError as lr } from "./index.web17.js";
19
+ import { createCDPEmbeddedWallet as dr } from "./index.web18.js";
20
+ import { EIP1193ProviderError as ur, STANDARD_ERROR_CODES as Ar } from "./index.web19.js";
21
21
  import "zustand";
22
22
  r({
23
23
  crypto: o,
@@ -25,50 +25,51 @@ r({
25
25
  oauth: e
26
26
  });
27
27
  export {
28
- G as APIError,
29
- sr as AuthManager,
30
- Sr as EIP1193ProviderError,
31
- j as ErrorType,
32
- q as HttpErrorType,
33
- lr as InputValidationError,
34
- cr as ModuleResolutionError,
35
- F as OAuth2ProviderType,
36
- ur as STANDARD_ERROR_CODES,
37
- J as SendEvmTransactionWithEndUserAccountBodyNetwork,
38
- K as SendSolanaTransactionWithEndUserAccountBodyNetwork,
39
- Er as createCDPEmbeddedWallet,
40
- H as createSpendPermission,
41
- c as exportEvmAccount,
42
- g as exportSolanaAccount,
28
+ j as APIError,
29
+ mr as AuthManager,
30
+ ur as EIP1193ProviderError,
31
+ q as ErrorType,
32
+ F as HttpErrorType,
33
+ gr as InputValidationError,
34
+ lr as ModuleResolutionError,
35
+ J as OAuth2ProviderType,
36
+ Ar as STANDARD_ERROR_CODES,
37
+ K as SendEvmTransactionWithEndUserAccountBodyNetwork,
38
+ L as SendSolanaTransactionWithEndUserAccountBodyNetwork,
39
+ dr as createCDPEmbeddedWallet,
40
+ V as createSpendPermission,
41
+ g as exportEvmAccount,
42
+ l as exportSolanaAccount,
43
43
  E as getAccessToken,
44
- d as getCurrentUser,
45
- S as getUserOperation,
46
- u as initialize,
47
- A as isSignedIn,
48
- ir as linkApple,
49
- or as linkEmail,
50
- Y as linkGoogle,
51
- tr as linkOAuth,
52
- $ as linkSms,
53
- _ as listSpendPermissions,
44
+ d as getAccessTokenExpiration,
45
+ S as getCurrentUser,
46
+ u as getUserOperation,
47
+ A as initialize,
48
+ x as isSignedIn,
49
+ ar as linkApple,
50
+ er as linkEmail,
51
+ Z as linkGoogle,
52
+ nr as linkOAuth,
53
+ rr as linkSms,
54
+ z as listSpendPermissions,
54
55
  h as onAuthStateChange,
55
- x as onOAuthStateChange,
56
- Q as revokeSpendPermission,
56
+ T as onOAuthStateChange,
57
+ X as revokeSpendPermission,
57
58
  v as sendEvmTransaction,
58
- T as sendSolanaTransaction,
59
- O as sendUserOperation,
60
- y as signEvmHash,
61
- P as signEvmMessage,
62
- k as signEvmTransaction,
63
- I as signEvmTypedData,
64
- C as signInWithEmail,
65
- W as signInWithOAuth,
66
- w as signInWithSms,
67
- D as signOut,
68
- R as signSolanaMessage,
69
- U as signSolanaTransaction,
70
- pr as toViemAccount,
71
- b as verifyEmailOTP,
72
- M as verifyOAuth,
73
- N as verifySmsOTP
59
+ O as sendSolanaTransaction,
60
+ y as sendUserOperation,
61
+ P as signEvmHash,
62
+ k as signEvmMessage,
63
+ I as signEvmTransaction,
64
+ C as signEvmTypedData,
65
+ W as signInWithEmail,
66
+ w as signInWithOAuth,
67
+ D as signInWithSms,
68
+ R as signOut,
69
+ U as signSolanaMessage,
70
+ b as signSolanaTransaction,
71
+ cr as toViemAccount,
72
+ M as verifyEmailOTP,
73
+ N as verifyOAuth,
74
+ B as verifySmsOTP
74
75
  };
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs as r } from "./index.web137.js";
2
- import { __require as o } from "./index.web145.js";
2
+ import { __require as o } from "./index.web149.js";
3
3
  var t = o();
4
4
  const a = /* @__PURE__ */ r(t);
5
5
  export {
@@ -1,4 +1,4 @@
1
- import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.web133.js";
1
+ import { HashMD as D, SHA256_IV as b, Chi as g, Maj as p } from "./index.web136.js";
2
2
  import { createHasher as u, clean as C, rotr as i } from "./index.web129.js";
3
3
  const B = /* @__PURE__ */ Uint32Array.from([
4
4
  1116352408,
@@ -1,81 +1,4 @@
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.web129.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
- }
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
- ]);
1
+ const o = "0.1.1";
75
2
  export {
76
- U as Chi,
77
- m as HashMD,
78
- _ as Maj,
79
- B as SHA256_IV,
80
- y as setBigUint64
3
+ o as version
81
4
  };