@embarkai/ui-kit 0.4.29 → 0.4.31
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +28 -21
- package/dist/index.cjs +1770 -1536
- package/dist/index.d.cts +50 -3
- package/dist/index.d.ts +50 -3
- package/dist/index.js +1520 -1285
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/iframe/index.html
CHANGED
|
@@ -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.
|
|
18
|
+
<title>EmbarkAI Secure Wallet - iframe version 0.4.31</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -3056,8 +3056,8 @@ var DKGManager = class extends TokenRefreshApiClient {
|
|
|
3056
3056
|
};
|
|
3057
3057
|
|
|
3058
3058
|
// src/iframe/lib/hyperlane/hyperlane.ts
|
|
3059
|
-
var
|
|
3060
|
-
var
|
|
3059
|
+
var BASE_API_URL = "https://api.embarkai.io";
|
|
3060
|
+
var API_URL = `${BASE_API_URL}/on-ramp`;
|
|
3061
3061
|
var HyperlaneAPI = class {
|
|
3062
3062
|
// private sseAbortController: AbortController | null = null
|
|
3063
3063
|
constructor(sendResponseFn) {
|
|
@@ -3066,7 +3066,7 @@ var HyperlaneAPI = class {
|
|
|
3066
3066
|
// API METHODS
|
|
3067
3067
|
/** available warp routes */
|
|
3068
3068
|
async getHyperlaneWarpRoutes(accessToken) {
|
|
3069
|
-
const result = await fetch(`${
|
|
3069
|
+
const result = await fetch(`${API_URL}/api/hyperlane/warp-routes`, {
|
|
3070
3070
|
method: "GET",
|
|
3071
3071
|
headers: { Authorization: `Bearer ${accessToken}` }
|
|
3072
3072
|
});
|
|
@@ -3075,26 +3075,20 @@ var HyperlaneAPI = class {
|
|
|
3075
3075
|
}
|
|
3076
3076
|
/** bridging quote */
|
|
3077
3077
|
async estimateHyperlaneQuote(payload, accessToken) {
|
|
3078
|
-
const result = await fetch(`${
|
|
3078
|
+
const result = await fetch(`${API_URL}/api/hyperlane/estimate-quote`, {
|
|
3079
3079
|
method: "POST",
|
|
3080
3080
|
body: JSON.stringify(payload),
|
|
3081
|
-
headers: {
|
|
3082
|
-
"Content-Type": "application/json",
|
|
3083
|
-
"Authorization": `Bearer ${accessToken}`
|
|
3084
|
-
}
|
|
3081
|
+
headers: { "Content-Type": "application/json", "Authorization": `Bearer ${accessToken}` }
|
|
3085
3082
|
});
|
|
3086
3083
|
const quote = await result.json();
|
|
3087
3084
|
return quote;
|
|
3088
3085
|
}
|
|
3089
3086
|
/** list of pre-cooked TXs by Hyperlane SDK */
|
|
3090
3087
|
async bridgeHyperlaneAsset(payload, accessToken) {
|
|
3091
|
-
const result = await fetch(`${
|
|
3088
|
+
const result = await fetch(`${API_URL}/api/hyperlane/bridge-asset`, {
|
|
3092
3089
|
method: "POST",
|
|
3093
3090
|
body: JSON.stringify(payload),
|
|
3094
|
-
headers: {
|
|
3095
|
-
"Content-Type": "application/json",
|
|
3096
|
-
"Authorization": `Bearer ${accessToken}`
|
|
3097
|
-
}
|
|
3091
|
+
headers: { "Content-Type": "application/json", "Authorization": `Bearer ${accessToken}` }
|
|
3098
3092
|
});
|
|
3099
3093
|
const response = await result.json();
|
|
3100
3094
|
return response;
|
|
@@ -3102,7 +3096,7 @@ var HyperlaneAPI = class {
|
|
|
3102
3096
|
/** bridge history */
|
|
3103
3097
|
async getHyperlaneBridgeHistory(pagination, accessToken) {
|
|
3104
3098
|
const { page, pageSize } = pagination;
|
|
3105
|
-
const url = new URL(`${
|
|
3099
|
+
const url = new URL(`${API_URL}/api/hyperlane/bridge-history`);
|
|
3106
3100
|
if (page) url.searchParams.append("page", page.toString());
|
|
3107
3101
|
if (pageSize) url.searchParams.append("pageSize", pageSize.toString());
|
|
3108
3102
|
const result = await fetch(url.toString(), { method: "GET", headers: { Authorization: `Bearer ${accessToken}` } });
|
|
@@ -3110,14 +3104,23 @@ var HyperlaneAPI = class {
|
|
|
3110
3104
|
return history;
|
|
3111
3105
|
}
|
|
3112
3106
|
/** patch initiated bridge transaction */
|
|
3113
|
-
async
|
|
3114
|
-
const result = await fetch(`${
|
|
3107
|
+
async patchInitiatedBridgeTxStatus(payload, accessToken) {
|
|
3108
|
+
const result = await fetch(`${API_URL}/api/hyperlane/patch-bridge-tx-status`, {
|
|
3109
|
+
method: "PATCH",
|
|
3110
|
+
body: JSON.stringify(payload),
|
|
3111
|
+
headers: { "Content-Type": "application/json", "Authorization": `Bearer ${accessToken}` }
|
|
3112
|
+
});
|
|
3113
|
+
const response = await result.json();
|
|
3114
|
+
return response;
|
|
3115
|
+
}
|
|
3116
|
+
async patchInitiatedBridgeTxOpHashes(payload, accessToken) {
|
|
3117
|
+
const result = await fetch(`${API_URL}/api/hyperlane/patch-bridge-op-hashes`, {
|
|
3115
3118
|
method: "PATCH",
|
|
3116
3119
|
body: JSON.stringify(payload),
|
|
3117
3120
|
headers: { "Content-Type": "application/json", "Authorization": `Bearer ${accessToken}` }
|
|
3118
3121
|
});
|
|
3119
|
-
const
|
|
3120
|
-
return
|
|
3122
|
+
const response = await result.json();
|
|
3123
|
+
return response;
|
|
3121
3124
|
}
|
|
3122
3125
|
// IFRAME MESSAGING
|
|
3123
3126
|
async handleMessage(message, origin) {
|
|
@@ -3141,10 +3144,14 @@ var HyperlaneAPI = class {
|
|
|
3141
3144
|
const historyResponse = await this.getHyperlaneBridgeHistory(data.payload, accessToken);
|
|
3142
3145
|
this.sendResponseFn(messageId, historyResponse, origin);
|
|
3143
3146
|
break;
|
|
3144
|
-
case "
|
|
3145
|
-
const patchResponse = await this.
|
|
3147
|
+
case "HYPERLANE_PATCH_TRANSACTION_STATUS_QUERY":
|
|
3148
|
+
const patchResponse = await this.patchInitiatedBridgeTxStatus(data.payload, accessToken);
|
|
3146
3149
|
this.sendResponseFn(messageId, patchResponse, origin);
|
|
3147
3150
|
break;
|
|
3151
|
+
case "HYPERLANE_PATCH_TRANSACTION_OP_HASHES_QUERY":
|
|
3152
|
+
const patchbyTxOpHashesResponse = await this.patchInitiatedBridgeTxOpHashes(data.payload, accessToken);
|
|
3153
|
+
this.sendResponseFn(messageId, patchbyTxOpHashesResponse, origin);
|
|
3154
|
+
break;
|
|
3148
3155
|
default:
|
|
3149
3156
|
throw new Error(`[FINCHPAY]: Unknown message type: ${type}`);
|
|
3150
3157
|
}
|
|
@@ -6377,7 +6384,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
6377
6384
|
};
|
|
6378
6385
|
|
|
6379
6386
|
// src/iframe/main.ts
|
|
6380
|
-
var IFRAME_VERSION = "0.4.
|
|
6387
|
+
var IFRAME_VERSION = "0.4.31";
|
|
6381
6388
|
var IframeWallet = class {
|
|
6382
6389
|
constructor() {
|
|
6383
6390
|
console.log("=".repeat(60));
|