@bytexbyte/nxtlinq-ai-agent-sdk 1.6.23 → 1.6.25

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.
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/reac
3
3
  import * as React from 'react';
4
4
  import { css } from '@emotion/react';
5
5
  import { useChatBot } from '../context/ChatBotContext';
6
+ import * as walletTextUtils from '../../core/utils/walletTextUtils';
6
7
  import { actionButton } from './styles/isolatedStyles';
7
8
  export const PermissionForm = ({ onClose }) => {
8
9
  const { hitAddress, permissions, setPermissions, setIsDisabled, onSave, onConnectWallet, onSignIn, isNeedSignInWithWallet, walletInfo, onVerifyWallet, serviceId, nxtlinqApi, permissionGroup, isAITLoading, isWalletLoading = false, refreshAIT, props } = useChatBot();
@@ -143,7 +144,7 @@ export const PermissionForm = ({ onClose }) => {
143
144
  margin-bottom: 24px !important;
144
145
  font-size: 16px !important;
145
146
  color: #666 !important;
146
- `, children: "Checking wallet status..." })] }), _jsx("style", { children: `
147
+ `, children: walletTextUtils.getWalletText('Checking wallet status...', serviceId) })] }), _jsx("style", { children: `
147
148
  @keyframes spin {
148
149
  0% { transform: rotate(0deg); }
149
150
  100% { transform: rotate(360deg); }
@@ -223,7 +224,7 @@ export const PermissionForm = ({ onClose }) => {
223
224
  margin-bottom: 24px !important;
224
225
  font-size: 16px !important;
225
226
  color: #666 !important;
226
- `, children: "Please connect your wallet first" }), _jsx("button", { onClick: onConnectWallet, disabled: Boolean(hitAddress), css: css `
227
+ `, children: walletTextUtils.getWalletText('Please connect your wallet first', serviceId) }), _jsx("button", { onClick: onConnectWallet, disabled: Boolean(hitAddress), css: css `
227
228
  ${actionButton}
228
229
  padding: 12px 24px !important;
229
230
  background-color: ${Boolean(hitAddress) ? '#28a745' : '#007bff'} !important;
@@ -238,14 +239,14 @@ export const PermissionForm = ({ onClose }) => {
238
239
  &:hover:not(:disabled) {
239
240
  background-color: #0056b3 !important;
240
241
  }
241
- `, children: Boolean(hitAddress) ? 'Connected' : 'Connect Wallet' })] })) : isNeedSignInWithWallet ? (_jsxs("div", { css: css `
242
+ `, children: Boolean(hitAddress) ? 'Connected' : walletTextUtils.getWalletText('Connect Wallet', serviceId) })] })) : isNeedSignInWithWallet ? (_jsxs("div", { css: css `
242
243
  text-align: center !important;
243
244
  padding: 32px 0 !important;
244
245
  `, children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
245
246
  margin-bottom: 12px !important;
246
247
  font-size: 16px !important;
247
248
  color: #666 !important;
248
- `, children: "Connected Wallet" }), _jsx("p", { css: css `
249
+ `, children: walletTextUtils.getWalletText('Connected Wallet', serviceId) }), _jsx("p", { css: css `
249
250
  word-break: break-all !important;
250
251
  background-color: #f8f9fa !important;
251
252
  padding: 12px !important;
@@ -279,7 +280,7 @@ export const PermissionForm = ({ onClose }) => {
279
280
  margin-bottom: 12px !important;
280
281
  font-size: 16px !important;
281
282
  color: #666 !important;
282
- `, children: "Connected Wallet" }), _jsx("p", { css: css `
283
+ `, children: walletTextUtils.getWalletText('Connected Wallet', serviceId) }), _jsx("p", { css: css `
283
284
  word-break: break-all !important;
284
285
  background-color: #f8f9fa !important;
285
286
  padding: 12px !important;
@@ -292,8 +293,8 @@ export const PermissionForm = ({ onClose }) => {
292
293
  font-size: 16px !important;
293
294
  color: #666 !important;
294
295
  `, children: isWalletVerified && !isWalletVerifiedWithBerifyme
295
- ? 'Your wallet is verified with custom method, but Berify.me verification is required to continue.'
296
- : 'Please verify your wallet with Berify.me to continue' }), _jsx("button", { onClick: () => onVerifyWallet('berifyme'), css: css `
296
+ ? walletTextUtils.getWalletText('Your wallet is verified with custom method, but Berify.me verification is required to continue.', serviceId)
297
+ : walletTextUtils.getWalletText('Please verify your wallet with Berify.me to continue', serviceId) }), _jsx("button", { onClick: () => onVerifyWallet('berifyme'), css: css `
297
298
  ${actionButton}
298
299
  padding: 12px 24px !important;
299
300
  background-color: #007bff !important;
@@ -303,11 +304,11 @@ export const PermissionForm = ({ onClose }) => {
303
304
  &:hover {
304
305
  background-color: #0056b3 !important;
305
306
  }
306
- `, children: "Verify your wallet" })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
307
+ `, children: walletTextUtils.getWalletText('Verify your wallet', serviceId) })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { css: css `margin-bottom: 24px !important;`, children: [_jsx("h4", { css: css `
307
308
  margin-bottom: 12px !important;
308
309
  font-size: 16px !important;
309
310
  color: #666 !important;
310
- `, children: "Connected Wallet" }), _jsx("p", { css: css `
311
+ `, children: walletTextUtils.getWalletText('Connected Wallet', serviceId) }), _jsx("p", { css: css `
311
312
  word-break: break-all !important;
312
313
  background-color: #f8f9fa !important;
313
314
  padding: 12px !important;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Adilas Service ID constant
3
+ */
4
+ export declare const ADILAS_SERVICE_ID = "e48fc2b9-a7d1-49e3-85cb-9d621a0bf774";
5
+ /**
6
+ * Check if the given serviceId is the Adilas service
7
+ */
8
+ export declare const isAdilasService: (serviceId: string | undefined | null) => boolean;
9
+ /**
10
+ * Replace "wallet" with "account" in text when serviceId is Adilas service
11
+ * Preserves the original case of the word
12
+ */
13
+ export declare const getWalletText: (defaultText: string, serviceId: string | undefined | null) => string;
14
+ //# sourceMappingURL=walletTextUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletTextUtils.d.ts","sourceRoot":"","sources":["../../../src/core/utils/walletTextUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iBAAiB,yCAAyC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,GAAG,SAAS,GAAG,IAAI,KAAG,OAEtE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,EAAE,WAAW,MAAM,GAAG,SAAS,GAAG,IAAI,KAAG,MAQzF,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Adilas Service ID constant
3
+ */
4
+ export const ADILAS_SERVICE_ID = 'e48fc2b9-a7d1-49e3-85cb-9d621a0bf774';
5
+ /**
6
+ * Check if the given serviceId is the Adilas service
7
+ */
8
+ export const isAdilasService = (serviceId) => {
9
+ return serviceId ? serviceId.trim() === ADILAS_SERVICE_ID : false;
10
+ };
11
+ /**
12
+ * Replace "wallet" with "account" in text when serviceId is Adilas service
13
+ * Preserves the original case of the word
14
+ */
15
+ export const getWalletText = (defaultText, serviceId) => {
16
+ if (!isAdilasService(serviceId))
17
+ return defaultText;
18
+ // Replace wallet with account, preserving case
19
+ return defaultText.replace(/\bwallet\b/gi, (match) => {
20
+ // Preserve original case: 'Wallet' -> 'Account', 'wallet' -> 'account'
21
+ return match.charAt(0) === 'W' ? 'Account' : 'account';
22
+ });
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/nxtlinq-ai-agent-sdk",
3
- "version": "1.6.23",
3
+ "version": "1.6.25",
4
4
  "description": "Nxtlinq AI Agent SDK - Proprietary Software with enhanced async operation handling",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",