@embarkai/ui-kit 0.4.115 → 0.4.116

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.
@@ -15,7 +15,7 @@
15
15
  <meta http-equiv="X-Content-Type-Options" content="nosniff" />
16
16
  <meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
17
17
 
18
- <title>EmbarkAI Secure Wallet - iframe version 0.4.115</title>
18
+ <title>EmbarkAI Secure Wallet - iframe version 0.4.116</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -6342,7 +6342,7 @@ var SigningManager = class extends TokenRefreshApiClient {
6342
6342
  };
6343
6343
 
6344
6344
  // src/iframe/main.ts
6345
- var IFRAME_VERSION = "0.4.115";
6345
+ var IFRAME_VERSION = "0.4.116";
6346
6346
  var IframeWallet = class {
6347
6347
  // private finchpay: FinchPayRampAPI
6348
6348
  // private rampnow: RampnowOnrampAPI
package/dist/index.cjs CHANGED
@@ -7602,6 +7602,7 @@ var init_en = __esm({
7602
7602
  connectWallet: "Connect Wallet Profile",
7603
7603
  noWallets: "No wallets available to connect",
7604
7604
  requestPending: "{{wallet}} already has a pending request from this site. Open {{wallet}}, reject or close that request, then try again.",
7605
+ projectInfoUnavailable: "Could not load the app details needed to sign in. Check your connection and try again.",
7605
7606
  instructions: {
7606
7607
  follow: "Watch your connecting wallet app.\nYou will be asked to:\n {{steps}}",
7607
7608
  confirm: "- 1. Confirm your wallet connection into embarkAI",
@@ -8195,6 +8196,7 @@ var init_ru = __esm({
8195
8196
  connectWallet: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430",
8196
8197
  noWallets: "\u041D\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u043E\u0432 \u0434\u043B\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F",
8197
8198
  requestPending: "\u0412 {{wallet}} \u0443\u0436\u0435 \u0432\u0438\u0441\u0438\u0442 \u0437\u0430\u043F\u0440\u043E\u0441 \u043E\u0442 \u044D\u0442\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0430. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 {{wallet}}, \u043E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u043A\u0440\u043E\u0439\u0442\u0435 \u044D\u0442\u043E\u0442 \u0437\u0430\u043F\u0440\u043E\u0441 \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
8199
+ projectInfoUnavailable: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
8198
8200
  instructions: {
8199
8201
  follow: "\u0421\u043B\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0430\u0435\u043C\u044B\u043C \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043C \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430.\n\u0412\u0430\u043C \u0431\u0443\u0434\u0435\u0442 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u043E:\n {{steps}}",
8200
8202
  confirm: "- 1. \u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 \u043A embarkAI",
@@ -8788,6 +8790,7 @@ var init_zh = __esm({
8788
8790
  connectWallet: "\u8FDE\u63A5\u94B1\u5305\u914D\u7F6E\u6587\u4EF6",
8789
8791
  noWallets: "\u6CA1\u6709\u53EF\u8FDE\u63A5\u7684\u94B1\u5305",
8790
8792
  requestPending: "{{wallet}} \u4E2D\u5DF2\u6709\u6765\u81EA\u672C\u7F51\u7AD9\u7684\u5F85\u5904\u7406\u8BF7\u6C42\u3002\u8BF7\u6253\u5F00 {{wallet}}\uFF0C\u62D2\u7EDD\u6216\u5173\u95ED\u8BE5\u8BF7\u6C42\uFF0C\u7136\u540E\u91CD\u8BD5\u3002",
8793
+ projectInfoUnavailable: "\u65E0\u6CD5\u52A0\u8F7D\u767B\u5F55\u6240\u9700\u7684\u5E94\u7528\u4FE1\u606F\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002",
8791
8794
  instructions: {
8792
8795
  follow: "\u8BF7\u67E5\u770B\u60A8\u6B63\u5728\u8FDE\u63A5\u7684\u94B1\u5305\u5E94\u7528\u3002\n\u60A8\u5C06\u88AB\u8981\u6C42\uFF1A\n {{steps}}",
8793
8796
  confirm: "- 1. \u786E\u8BA4\u5C06\u60A8\u7684\u94B1\u5305\u8FDE\u63A5\u5230 embarkAI",
@@ -15986,20 +15989,27 @@ async function unlinkWallet(address) {
15986
15989
  throw new Error(errorData.message || `Failed to unlink wallet: ${response.statusText}`);
15987
15990
  }
15988
15991
  }
15989
- async function fetchProjectName(projectId) {
15990
- const now = Date.now();
15991
- if (metadataCache && now - metadataCache.timestamp < METADATA_CACHE_TTL) {
15992
+ async function requestProjectName(projectId) {
15993
+ const response = await fetch(`${METADATA_API_URL}/${projectId}/metadata`);
15994
+ if (!response.ok) throw new Error(`Project metadata request failed with status ${response.status}`);
15995
+ const metadata = await response.json();
15996
+ if (!metadata?.name) throw new Error("Project metadata has no name");
15997
+ metadataCache = { data: metadata, timestamp: Date.now() };
15998
+ return metadata.name;
15999
+ }
16000
+ async function fetchProjectName(projectId, attempts = 2) {
16001
+ if (metadataCache && Date.now() - metadataCache.timestamp < METADATA_CACHE_TTL) {
15992
16002
  return metadataCache.data.name;
15993
16003
  }
15994
- try {
15995
- const response = await fetch(`${METADATA_API_URL}/${projectId}/metadata`);
15996
- if (!response.ok) return "EmbarkAI";
15997
- const metadata = await response.json();
15998
- metadataCache = { data: metadata, timestamp: now };
15999
- return metadata.name;
16000
- } catch {
16001
- return "EmbarkAI";
16004
+ let lastError;
16005
+ for (let attempt = 0; attempt < attempts; attempt++) {
16006
+ try {
16007
+ return await requestProjectName(projectId);
16008
+ } catch (error) {
16009
+ lastError = error;
16010
+ }
16002
16011
  }
16012
+ throw lastError;
16003
16013
  }
16004
16014
  function createSignatureMessage(address, projectName, nonce) {
16005
16015
  const timestamp = Date.now();
@@ -17586,7 +17596,9 @@ function ConnectExternalWalletMenu() {
17586
17596
  return;
17587
17597
  }
17588
17598
  const projectId = config.current?.projectId;
17589
- const projectName = projectId ? await fetchProjectName(projectId) : "EmbarkAI";
17599
+ const projectName = projectId ? await fetchProjectName(projectId).catch(() => {
17600
+ throw new Error(t("passport:connectMenu.projectInfoUnavailable"));
17601
+ }) : "EmbarkAI";
17590
17602
  const createMessage = connectFlowType === "auth" ? createLoginMessage : createSignatureMessage;
17591
17603
  const message = createMessage(signingWalletAddress, projectName);
17592
17604
  const { signature, chainId: signedChainId } = await signOnSupportedChain({
@@ -30134,7 +30146,7 @@ var init_package = __esm({
30134
30146
  "package.json"() {
30135
30147
  package_default = {
30136
30148
  name: "@embarkai/ui-kit",
30137
- version: "0.4.115",
30149
+ version: "0.4.116",
30138
30150
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
30139
30151
  type: "module",
30140
30152
  main: "./dist/index.cjs",
package/dist/index.d.cts CHANGED
@@ -1648,7 +1648,7 @@ interface AuthProvider {
1648
1648
  meta?: AuthProviderMeta;
1649
1649
  }
1650
1650
 
1651
- declare function fetchProjectName(projectId: string): Promise<string>;
1651
+ declare function fetchProjectName(projectId: string, attempts?: number): Promise<string>;
1652
1652
 
1653
1653
  declare function useNativeWalletSignature(): {
1654
1654
  signMessage: wagmi.UseSignMessageReturnType<unknown>;
@@ -2740,6 +2740,7 @@ declare const PASSPORT_TRANSLATIONS: {
2740
2740
  connectWallet: string;
2741
2741
  noWallets: string;
2742
2742
  requestPending: string;
2743
+ projectInfoUnavailable: string;
2743
2744
  instructions: {
2744
2745
  follow: string;
2745
2746
  confirm: string;
@@ -3328,6 +3329,7 @@ declare const PASSPORT_TRANSLATIONS: {
3328
3329
  connectWallet: string;
3329
3330
  noWallets: string;
3330
3331
  requestPending: string;
3332
+ projectInfoUnavailable: string;
3331
3333
  instructions: {
3332
3334
  follow: string;
3333
3335
  confirm: string;
@@ -3916,6 +3918,7 @@ declare const PASSPORT_TRANSLATIONS: {
3916
3918
  connectWallet: string;
3917
3919
  noWallets: string;
3918
3920
  requestPending: string;
3921
+ projectInfoUnavailable: string;
3919
3922
  instructions: {
3920
3923
  follow: string;
3921
3924
  confirm: string;
package/dist/index.d.ts CHANGED
@@ -1648,7 +1648,7 @@ interface AuthProvider {
1648
1648
  meta?: AuthProviderMeta;
1649
1649
  }
1650
1650
 
1651
- declare function fetchProjectName(projectId: string): Promise<string>;
1651
+ declare function fetchProjectName(projectId: string, attempts?: number): Promise<string>;
1652
1652
 
1653
1653
  declare function useNativeWalletSignature(): {
1654
1654
  signMessage: wagmi.UseSignMessageReturnType<unknown>;
@@ -2740,6 +2740,7 @@ declare const PASSPORT_TRANSLATIONS: {
2740
2740
  connectWallet: string;
2741
2741
  noWallets: string;
2742
2742
  requestPending: string;
2743
+ projectInfoUnavailable: string;
2743
2744
  instructions: {
2744
2745
  follow: string;
2745
2746
  confirm: string;
@@ -3328,6 +3329,7 @@ declare const PASSPORT_TRANSLATIONS: {
3328
3329
  connectWallet: string;
3329
3330
  noWallets: string;
3330
3331
  requestPending: string;
3332
+ projectInfoUnavailable: string;
3331
3333
  instructions: {
3332
3334
  follow: string;
3333
3335
  confirm: string;
@@ -3916,6 +3918,7 @@ declare const PASSPORT_TRANSLATIONS: {
3916
3918
  connectWallet: string;
3917
3919
  noWallets: string;
3918
3920
  requestPending: string;
3921
+ projectInfoUnavailable: string;
3919
3922
  instructions: {
3920
3923
  follow: string;
3921
3924
  confirm: string;
package/dist/index.js CHANGED
@@ -7581,6 +7581,7 @@ var init_en = __esm({
7581
7581
  connectWallet: "Connect Wallet Profile",
7582
7582
  noWallets: "No wallets available to connect",
7583
7583
  requestPending: "{{wallet}} already has a pending request from this site. Open {{wallet}}, reject or close that request, then try again.",
7584
+ projectInfoUnavailable: "Could not load the app details needed to sign in. Check your connection and try again.",
7584
7585
  instructions: {
7585
7586
  follow: "Watch your connecting wallet app.\nYou will be asked to:\n {{steps}}",
7586
7587
  confirm: "- 1. Confirm your wallet connection into embarkAI",
@@ -8174,6 +8175,7 @@ var init_ru = __esm({
8174
8175
  connectWallet: "\u041F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430",
8175
8176
  noWallets: "\u041D\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u043E\u0432 \u0434\u043B\u044F \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F",
8176
8177
  requestPending: "\u0412 {{wallet}} \u0443\u0436\u0435 \u0432\u0438\u0441\u0438\u0442 \u0437\u0430\u043F\u0440\u043E\u0441 \u043E\u0442 \u044D\u0442\u043E\u0433\u043E \u0441\u0430\u0439\u0442\u0430. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 {{wallet}}, \u043E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u0435 \u0438\u043B\u0438 \u0437\u0430\u043A\u0440\u043E\u0439\u0442\u0435 \u044D\u0442\u043E\u0442 \u0437\u0430\u043F\u0440\u043E\u0441 \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
8178
+ projectInfoUnavailable: "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0434\u043B\u044F \u0432\u0445\u043E\u0434\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0441\u043D\u043E\u0432\u0430.",
8177
8179
  instructions: {
8178
8180
  follow: "\u0421\u043B\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0430\u0435\u043C\u044B\u043C \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u043C \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430.\n\u0412\u0430\u043C \u0431\u0443\u0434\u0435\u0442 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u043E:\n {{steps}}",
8179
8181
  confirm: "- 1. \u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 \u043A embarkAI",
@@ -8767,6 +8769,7 @@ var init_zh = __esm({
8767
8769
  connectWallet: "\u8FDE\u63A5\u94B1\u5305\u914D\u7F6E\u6587\u4EF6",
8768
8770
  noWallets: "\u6CA1\u6709\u53EF\u8FDE\u63A5\u7684\u94B1\u5305",
8769
8771
  requestPending: "{{wallet}} \u4E2D\u5DF2\u6709\u6765\u81EA\u672C\u7F51\u7AD9\u7684\u5F85\u5904\u7406\u8BF7\u6C42\u3002\u8BF7\u6253\u5F00 {{wallet}}\uFF0C\u62D2\u7EDD\u6216\u5173\u95ED\u8BE5\u8BF7\u6C42\uFF0C\u7136\u540E\u91CD\u8BD5\u3002",
8772
+ projectInfoUnavailable: "\u65E0\u6CD5\u52A0\u8F7D\u767B\u5F55\u6240\u9700\u7684\u5E94\u7528\u4FE1\u606F\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5\u540E\u91CD\u8BD5\u3002",
8770
8773
  instructions: {
8771
8774
  follow: "\u8BF7\u67E5\u770B\u60A8\u6B63\u5728\u8FDE\u63A5\u7684\u94B1\u5305\u5E94\u7528\u3002\n\u60A8\u5C06\u88AB\u8981\u6C42\uFF1A\n {{steps}}",
8772
8775
  confirm: "- 1. \u786E\u8BA4\u5C06\u60A8\u7684\u94B1\u5305\u8FDE\u63A5\u5230 embarkAI",
@@ -15943,20 +15946,27 @@ async function unlinkWallet(address) {
15943
15946
  throw new Error(errorData.message || `Failed to unlink wallet: ${response.statusText}`);
15944
15947
  }
15945
15948
  }
15946
- async function fetchProjectName(projectId) {
15947
- const now = Date.now();
15948
- if (metadataCache && now - metadataCache.timestamp < METADATA_CACHE_TTL) {
15949
+ async function requestProjectName(projectId) {
15950
+ const response = await fetch(`${METADATA_API_URL}/${projectId}/metadata`);
15951
+ if (!response.ok) throw new Error(`Project metadata request failed with status ${response.status}`);
15952
+ const metadata = await response.json();
15953
+ if (!metadata?.name) throw new Error("Project metadata has no name");
15954
+ metadataCache = { data: metadata, timestamp: Date.now() };
15955
+ return metadata.name;
15956
+ }
15957
+ async function fetchProjectName(projectId, attempts = 2) {
15958
+ if (metadataCache && Date.now() - metadataCache.timestamp < METADATA_CACHE_TTL) {
15949
15959
  return metadataCache.data.name;
15950
15960
  }
15951
- try {
15952
- const response = await fetch(`${METADATA_API_URL}/${projectId}/metadata`);
15953
- if (!response.ok) return "EmbarkAI";
15954
- const metadata = await response.json();
15955
- metadataCache = { data: metadata, timestamp: now };
15956
- return metadata.name;
15957
- } catch {
15958
- return "EmbarkAI";
15961
+ let lastError;
15962
+ for (let attempt = 0; attempt < attempts; attempt++) {
15963
+ try {
15964
+ return await requestProjectName(projectId);
15965
+ } catch (error) {
15966
+ lastError = error;
15967
+ }
15959
15968
  }
15969
+ throw lastError;
15960
15970
  }
15961
15971
  function createSignatureMessage(address, projectName, nonce) {
15962
15972
  const timestamp = Date.now();
@@ -17548,7 +17558,9 @@ function ConnectExternalWalletMenu() {
17548
17558
  return;
17549
17559
  }
17550
17560
  const projectId = config.current?.projectId;
17551
- const projectName = projectId ? await fetchProjectName(projectId) : "EmbarkAI";
17561
+ const projectName = projectId ? await fetchProjectName(projectId).catch(() => {
17562
+ throw new Error(t("passport:connectMenu.projectInfoUnavailable"));
17563
+ }) : "EmbarkAI";
17552
17564
  const createMessage = connectFlowType === "auth" ? createLoginMessage : createSignatureMessage;
17553
17565
  const message = createMessage(signingWalletAddress, projectName);
17554
17566
  const { signature, chainId: signedChainId } = await signOnSupportedChain({
@@ -30039,7 +30051,7 @@ var init_package = __esm({
30039
30051
  "package.json"() {
30040
30052
  package_default = {
30041
30053
  name: "@embarkai/ui-kit",
30042
- version: "0.4.115",
30054
+ version: "0.4.116",
30043
30055
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
30044
30056
  type: "module",
30045
30057
  main: "./dist/index.cjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embarkai/ui-kit",
3
- "version": "0.4.115",
3
+ "version": "0.4.116",
4
4
  "description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",