@embarkai/ui-kit 0.4.24 → 0.4.26

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.24</title>
18
+ <title>EmbarkAI Secure Wallet - iframe version 0.4.26</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -578,7 +578,7 @@ var init_server_backup = __esm({
578
578
  }
579
579
  });
580
580
 
581
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/data/isHex.js
581
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/isHex.js
582
582
  function isHex(value, { strict = true } = {}) {
583
583
  if (!value)
584
584
  return false;
@@ -587,31 +587,31 @@ function isHex(value, { strict = true } = {}) {
587
587
  return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
588
588
  }
589
589
  var init_isHex = __esm({
590
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/data/isHex.js"() {
590
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/isHex.js"() {
591
591
  }
592
592
  });
593
593
 
594
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/data/size.js
594
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/size.js
595
595
  function size(value) {
596
596
  if (isHex(value, { strict: false }))
597
597
  return Math.ceil((value.length - 2) / 2);
598
598
  return value.length;
599
599
  }
600
600
  var init_size = __esm({
601
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/data/size.js"() {
601
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/size.js"() {
602
602
  init_isHex();
603
603
  }
604
604
  });
605
605
 
606
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/version.js
606
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/version.js
607
607
  var version;
608
608
  var init_version = __esm({
609
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/version.js"() {
609
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/version.js"() {
610
610
  version = "2.38.0";
611
611
  }
612
612
  });
613
613
 
614
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/base.js
614
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/base.js
615
615
  function walk(err, fn) {
616
616
  if (fn?.(err))
617
617
  return err;
@@ -621,7 +621,7 @@ function walk(err, fn) {
621
621
  }
622
622
  var errorConfig, BaseError;
623
623
  var init_base = __esm({
624
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/base.js"() {
624
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/base.js"() {
625
625
  init_version();
626
626
  errorConfig = {
627
627
  getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
@@ -701,10 +701,10 @@ var init_base = __esm({
701
701
  }
702
702
  });
703
703
 
704
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/data.js
704
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/data.js
705
705
  var SizeExceedsPaddingSizeError;
706
706
  var init_data = __esm({
707
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/data.js"() {
707
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/data.js"() {
708
708
  init_base();
709
709
  SizeExceedsPaddingSizeError = class extends BaseError {
710
710
  constructor({ size: size2, targetSize, type }) {
@@ -714,7 +714,7 @@ var init_data = __esm({
714
714
  }
715
715
  });
716
716
 
717
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/data/pad.js
717
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/pad.js
718
718
  function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
719
719
  if (typeof hexOrBytes === "string")
720
720
  return padHex(hexOrBytes, { dir, size: size2 });
@@ -749,15 +749,15 @@ function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
749
749
  return paddedBytes;
750
750
  }
751
751
  var init_pad = __esm({
752
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/data/pad.js"() {
752
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/data/pad.js"() {
753
753
  init_data();
754
754
  }
755
755
  });
756
756
 
757
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js
757
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js
758
758
  var IntegerOutOfRangeError, SizeOverflowError;
759
759
  var init_encoding = __esm({
760
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js"() {
760
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/encoding.js"() {
761
761
  init_base();
762
762
  IntegerOutOfRangeError = class extends BaseError {
763
763
  constructor({ max, min, signed, size: size2, value }) {
@@ -772,7 +772,7 @@ var init_encoding = __esm({
772
772
  }
773
773
  });
774
774
 
775
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromHex.js
775
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromHex.js
776
776
  function assertSize(hexOrBytes, { size: size2 }) {
777
777
  if (size(hexOrBytes) > size2)
778
778
  throw new SizeOverflowError({
@@ -781,13 +781,13 @@ function assertSize(hexOrBytes, { size: size2 }) {
781
781
  });
782
782
  }
783
783
  var init_fromHex = __esm({
784
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromHex.js"() {
784
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/fromHex.js"() {
785
785
  init_encoding();
786
786
  init_size();
787
787
  }
788
788
  });
789
789
 
790
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toHex.js
790
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toHex.js
791
791
  function toHex(value, opts = {}) {
792
792
  if (typeof value === "number" || typeof value === "bigint")
793
793
  return numberToHex(value, opts);
@@ -852,7 +852,7 @@ function stringToHex(value_, opts = {}) {
852
852
  }
853
853
  var hexes, encoder;
854
854
  var init_toHex = __esm({
855
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toHex.js"() {
855
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toHex.js"() {
856
856
  init_encoding();
857
857
  init_pad();
858
858
  init_fromHex();
@@ -861,7 +861,7 @@ var init_toHex = __esm({
861
861
  }
862
862
  });
863
863
 
864
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toBytes.js
864
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toBytes.js
865
865
  function toBytes(value, opts = {}) {
866
866
  if (typeof value === "number" || typeof value === "bigint")
867
867
  return numberToBytes(value, opts);
@@ -924,7 +924,7 @@ function stringToBytes(value, opts = {}) {
924
924
  }
925
925
  var encoder2, charCodeMap;
926
926
  var init_toBytes = __esm({
927
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toBytes.js"() {
927
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/encoding/toBytes.js"() {
928
928
  init_base();
929
929
  init_isHex();
930
930
  init_pad();
@@ -1231,7 +1231,7 @@ var init_sha3 = __esm({
1231
1231
  }
1232
1232
  });
1233
1233
 
1234
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/hash/keccak256.js
1234
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/hash/keccak256.js
1235
1235
  function keccak256(value, to_) {
1236
1236
  const to = to_ || "hex";
1237
1237
  const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
@@ -1240,7 +1240,7 @@ function keccak256(value, to_) {
1240
1240
  return toHex(bytes);
1241
1241
  }
1242
1242
  var init_keccak256 = __esm({
1243
- "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/utils/hash/keccak256.js"() {
1243
+ "../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/hash/keccak256.js"() {
1244
1244
  init_sha3();
1245
1245
  init_isHex();
1246
1246
  init_toBytes();
@@ -2886,7 +2886,7 @@ async function __wbg_init(module_or_path) {
2886
2886
  }
2887
2887
  var dkls23_wasm_default = __wbg_init;
2888
2888
 
2889
- // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@6.0.6_zod@3.25.76/node_modules/viem/_esm/index.js
2889
+ // ../../node_modules/.pnpm/viem@2.38.0_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/index.js
2890
2890
  init_keccak256();
2891
2891
 
2892
2892
  // src/iframe/lib/dkg-manager.ts
@@ -3055,6 +3055,81 @@ var DKGManager = class extends TokenRefreshApiClient {
3055
3055
  }
3056
3056
  };
3057
3057
 
3058
+ // src/iframe/lib/hyperlane/hyperlane.ts
3059
+ var LOCAL_BASE = "https://api.embarkai.io";
3060
+ var LOCAL_BASE_API = `${LOCAL_BASE}/on-ramp`;
3061
+ var HyperlaneAPI = class {
3062
+ // private sseAbortController: AbortController | null = null
3063
+ constructor(sendResponseFn) {
3064
+ this.sendResponseFn = sendResponseFn;
3065
+ }
3066
+ // API METHODS
3067
+ /** available warp routes */
3068
+ async getHyperlaneWarpRoutes(accessToken) {
3069
+ const result = await fetch(`${LOCAL_BASE_API}/api/hyperlane/warp-routes`, {
3070
+ method: "GET",
3071
+ headers: { Authorization: `Bearer ${accessToken}` }
3072
+ });
3073
+ const warpRoutes = await result.json();
3074
+ return warpRoutes.map((route) => ({
3075
+ ...route,
3076
+ icon: `${LOCAL_BASE}${route.icon}`,
3077
+ chainPair: route.chainPair.map((chain) => ({
3078
+ ...chain,
3079
+ icon: `${LOCAL_BASE}${chain.icon}`
3080
+ }))
3081
+ }));
3082
+ }
3083
+ /** bridging quote */
3084
+ async estimateHyperlaneQuote(payload, accessToken) {
3085
+ const result = await fetch(`${LOCAL_BASE_API}/api/hyperlane/estimate-quote`, {
3086
+ method: "POST",
3087
+ body: JSON.stringify(payload),
3088
+ headers: {
3089
+ "Content-Type": "application/json",
3090
+ "Authorization": `Bearer ${accessToken}`
3091
+ }
3092
+ });
3093
+ const quote = await result.json();
3094
+ return quote;
3095
+ }
3096
+ /** list of pre-cooked TXs by Hyperlane SDK */
3097
+ async bridgeHyperlaneAsset(payload, accessToken) {
3098
+ const result = await fetch(`${LOCAL_BASE_API}/api/hyperlane/bridge-asset`, {
3099
+ method: "POST",
3100
+ body: JSON.stringify(payload),
3101
+ headers: {
3102
+ "Content-Type": "application/json",
3103
+ "Authorization": `Bearer ${accessToken}`
3104
+ }
3105
+ });
3106
+ const transactions = await result.json();
3107
+ return transactions;
3108
+ }
3109
+ // IFRAME MESSAGING
3110
+ async handleMessage(message, origin) {
3111
+ const { type, messageId, data } = message;
3112
+ const accessToken = data.accessToken || "";
3113
+ console.info("[ HYPERLANE Received message ]", type, data);
3114
+ switch (type) {
3115
+ case "HYPERLANE_GET_WARP_ROUTES_QUERY":
3116
+ const warpRoutes = await this.getHyperlaneWarpRoutes(accessToken);
3117
+ this.sendResponseFn(messageId, warpRoutes, origin);
3118
+ break;
3119
+ case "HYPERLANE_ESTIMATE_QUOTE_QUERY":
3120
+ const quote = await this.estimateHyperlaneQuote(data.payload, accessToken);
3121
+ this.sendResponseFn(messageId, quote, origin);
3122
+ break;
3123
+ case "HYPERLANE_BRIDGE_TRANSACTIONS_QUERY":
3124
+ const limitsSummaryResponse = await this.bridgeHyperlaneAsset(data.payload, accessToken);
3125
+ this.sendResponseFn(messageId, limitsSummaryResponse, origin);
3126
+ break;
3127
+ default:
3128
+ throw new Error(`[FINCHPAY]: Unknown message type: ${type}`);
3129
+ }
3130
+ }
3131
+ };
3132
+
3058
3133
  // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
3059
3134
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
3060
3135
  var freeGlobal_default = freeGlobal;
@@ -4585,7 +4660,7 @@ var omit = flatRest_default(function(object, paths) {
4585
4660
  var omit_default = omit;
4586
4661
 
4587
4662
  // src/iframe/lib/onramp/binance.ts
4588
- var API_DOMAIN = "https://api.lumiapassport.com/on-ramp";
4663
+ var API_DOMAIN = "https://api.embarkai.io/on-ramp";
4589
4664
  var BinanceOnrampAPI = class {
4590
4665
  constructor(sendResponseFn, broadcastFn) {
4591
4666
  this.sseAbortController = null;
@@ -4773,7 +4848,7 @@ var BinanceOnrampAPI = class {
4773
4848
  };
4774
4849
 
4775
4850
  // src/iframe/lib/onramp/finchpay.ts
4776
- var API_DOMAIN2 = "https://api.lumiapassport.com/on-ramp";
4851
+ var API_DOMAIN2 = "https://api.embarkai.io/on-ramp";
4777
4852
  var FinchPayRampAPI = class {
4778
4853
  constructor(sendResponseFn, broadcastFn) {
4779
4854
  this.sseAbortController = null;
@@ -5499,7 +5574,7 @@ var SecureMessenger = class {
5499
5574
  "TRUSTED_APP_REMOVED",
5500
5575
  "TOKEN_REFRESHED"
5501
5576
  ];
5502
- const validTypeGroups = ["BINANCE_", "RAMPNOW_", "FINCHPAY_"];
5577
+ const validTypeGroups = ["BINANCE_", "RAMPNOW_", "FINCHPAY_", "HYPERLANE_"];
5503
5578
  const isTypeValid = validTypes.includes(message.type);
5504
5579
  const isGroupTypeValid = validTypeGroups.some((prefix) => message.type.startsWith(prefix));
5505
5580
  if (!message.type || !isTypeValid && !isGroupTypeValid) return false;
@@ -6266,7 +6341,7 @@ var SigningManager = class extends TokenRefreshApiClient {
6266
6341
  };
6267
6342
 
6268
6343
  // src/iframe/main.ts
6269
- var IFRAME_VERSION = "0.4.24";
6344
+ var IFRAME_VERSION = "0.4.26";
6270
6345
  var IframeWallet = class {
6271
6346
  constructor() {
6272
6347
  console.log("=".repeat(60));
@@ -6281,7 +6356,20 @@ var IframeWallet = class {
6281
6356
  this.trustedApps = new TrustedAppsManager();
6282
6357
  this.optedOutApps = new OptedOutAppsManager();
6283
6358
  this.backupManager = new BackupManager();
6284
- this.finchpay = new FinchPayRampAPI(this.messenger.sendResponse.bind(this.messenger));
6359
+ this.hyperlane = new HyperlaneAPI(this.messenger.sendResponse.bind(this.messenger));
6360
+ this.finchpay = new FinchPayRampAPI(
6361
+ this.messenger.sendResponse.bind(this.messenger),
6362
+ (type, data, targetOrigin) => {
6363
+ window.parent.postMessage(
6364
+ {
6365
+ type,
6366
+ data,
6367
+ timestamp: Date.now()
6368
+ },
6369
+ targetOrigin
6370
+ );
6371
+ }
6372
+ );
6285
6373
  this.binance = new BinanceOnrampAPI(
6286
6374
  this.messenger.sendResponse.bind(this.messenger),
6287
6375
  (type, data, targetOrigin) => {
@@ -6321,6 +6409,9 @@ var IframeWallet = class {
6321
6409
  const { type, messageId, projectId } = message;
6322
6410
  try {
6323
6411
  switch (true) {
6412
+ case type.startsWith("HYPERLANE_"):
6413
+ await this.hyperlane.handleMessage(message, origin);
6414
+ break;
6324
6415
  case type.startsWith("FINCHPAY_"):
6325
6416
  await this.finchpay.handleMessage(message, origin);
6326
6417
  break;