tek-wallet 0.0.403 → 0.0.405

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.
@@ -1,5 +1,4 @@
1
1
  export declare enum ActionConfirm {
2
- WITHDRAW = "withdraw",
3
- TRANSFER = "transfer",
2
+ SEND = "send",
4
3
  LOCK = "lock token"
5
4
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionConfirm = void 0;
4
4
  var ActionConfirm;
5
5
  (function (ActionConfirm) {
6
- ActionConfirm["WITHDRAW"] = "withdraw";
7
- ActionConfirm["TRANSFER"] = "transfer";
6
+ ActionConfirm["SEND"] = "send";
8
7
  ActionConfirm["LOCK"] = "lock token";
9
8
  })(ActionConfirm || (exports.ActionConfirm = ActionConfirm = {}));
@@ -116,6 +116,10 @@ var Formatter_1 = __importDefault(require("../Formatter"));
116
116
  var send_internal_service_1 = __importDefault(require("../../../services/axios/send-internal-service"));
117
117
  var get_est_fee_service_1 = __importDefault(require("../../../services/axios/get-est-fee-service"));
118
118
  var Fees_1 = __importDefault(require("../Fees"));
119
+ var ConfirmLayout_1 = __importDefault(require("../ConfirmLayout"));
120
+ var type_1 = require("../ConfirmLayout/type");
121
+ var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
122
+ var LineValue_1 = __importDefault(require("../LineValue"));
119
123
  var SendMethods;
120
124
  (function (SendMethods) {
121
125
  SendMethods["SCAN_QR_CODE"] = "scan qr code";
@@ -621,15 +625,20 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
621
625
  placeholder: "Enter memo",
622
626
  value: memo,
623
627
  onChange: handleChangeMemo,
624
- } })] })), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), estimateReceive !== undefined && !amountError && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Estimate receive" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })), (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, onClick: handleSend, status: !!amountError ||
625
- !!recipientAddressError ||
626
- !recipientAddress ||
627
- !amount ||
628
- !selectedToken ||
629
- isLoadingEstimateFee ||
630
- isValidatingAddress
631
- ? Button_1.BUTTON_STATUS.DISABLED
632
- : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" })] }) }, WithdrawStep.FORM)] }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAllQrCodeRef, onResult: handleScanAllQrCode }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAddressQrCodeRef, onResult: handleScanAddressQrCode }), (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { ref: backDropRef }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { overrideOpen: !!infoDialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
628
+ } })] })), ((_a = estimateFee === null || estimateFee === void 0 ? void 0 : estimateFee.feeDetail) === null || _a === void 0 ? void 0 : _a.length) && !!amount && ((0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount })), estimateReceive !== undefined && !amountError && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Receive amount estimated" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })), (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default
629
+ // ref={confirmByPasscodeDrawerRef}
630
+ , {
631
+ // ref={confirmByPasscodeDrawerRef}
632
+ action: type_1.ActionConfirm.SEND, trigger: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { sx: { width: "100%" }, onClick: handleSend, status: !!amountError ||
633
+ !!recipientAddressError ||
634
+ !recipientAddress ||
635
+ !amount ||
636
+ !selectedToken ||
637
+ isLoadingEstimateFee ||
638
+ isValidatingAddress
639
+ ? Button_1.BUTTON_STATUS.DISABLED
640
+ : Button_1.BUTTON_STATUS.ENABLED, children: "Continue" }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.paper), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Recipient address", value: recipientAddress }), selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Network" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g6, ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 20, src: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.icon }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: selectedNetwork === null || selectedNetwork === void 0 ? void 0 : selectedNetwork.name }), (0, jsx_runtime_1.jsx)(Icon_1.default, { width: 10, src: (0, getIcon_1.default)("right_arrow") })] })] })), (0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: amount, unit: selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.name }) }), !!memo &&
641
+ selectedMethod === SendMethods.TRANSFER_EXTERNAL && ((0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Memo", value: memo })), (0, jsx_runtime_1.jsx)(Fees_1.default, { feesData: JSON.stringify(estimateFee), amount: +amount }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, theme.mixins.row), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Receive amount estimated" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { ml: "auto" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: estimateReceive }) })] })] }), (0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: ["Your balance is", " "] }), (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.SEND, onConfirmSuccess: function () { return console.warn("confirm success"); }, children: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { status: Button_1.BUTTON_STATUS.ENABLED, sx: { width: "100%" }, children: "Confirm" }) })] }) })] }) }, WithdrawStep.FORM)] }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAllQrCodeRef, onResult: handleScanAllQrCode }), (0, jsx_runtime_1.jsx)(QrCodeReader_1.default, { ref: scannerAddressQrCodeRef, onResult: handleScanAddressQrCode }), (0, jsx_runtime_1.jsx)(AppBackDrop_1.default, { ref: backDropRef }), (0, jsx_runtime_1.jsx)(AppDialog_1.default, { overrideOpen: !!infoDialogContent, children: (0, jsx_runtime_1.jsx)(DialogContentLayout_1.default, { content: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
633
642
  textAlign: "center",
634
643
  display: "inline-block",
635
644
  width: "100%",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.403",
3
+ "version": "0.0.405",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",