tek-wallet 0.0.333 → 0.0.335

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.
@@ -266,7 +266,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
266
266
  console.warn("🚀 ~ handleSelectTransferInternal ~ sendInfoGet:", sendInfoGet);
267
267
  setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
268
268
  setRecipientAddress(recipientAddressInternal);
269
- setAmount((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || "");
269
+ setAmount(getAmountAfterDecimal((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
270
270
  if (!tokenSet) {
271
271
  gotoStep(WithdrawStep.SELECT_TOKEN);
272
272
  }
@@ -291,7 +291,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
291
291
  }
292
292
  setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
293
293
  setRecipientAddress(data === null || data === void 0 ? void 0 : data.address);
294
- setAmount((data === null || data === void 0 ? void 0 : data.amount) || "");
294
+ setAmount(getAmountAfterDecimal((data === null || data === void 0 ? void 0 : data.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
295
295
  setMemo(data === null || data === void 0 ? void 0 : data.text);
296
296
  };
297
297
  var handleSelectMethod = function (method) {
@@ -313,6 +313,12 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
313
313
  break;
314
314
  }
315
315
  };
316
+ var getAmountAfterDecimal = function (amount, decimal) {
317
+ if (!amount)
318
+ return "";
319
+ var amountNumber = +amount / Math.pow(10, decimal);
320
+ return amountNumber || "";
321
+ };
316
322
  var handleBack = function () {
317
323
  if (currentStep === WithdrawStep.CONFIRM &&
318
324
  selectedMethod === SendMethods.TRANSFER_INTERNAL) {
@@ -20,6 +20,7 @@ export interface WithdrawCurrency {
20
20
  balance: string;
21
21
  min_value: number;
22
22
  max_value: number;
23
+ decimal: number;
23
24
  }
24
25
  export interface WithdrawTokenList {
25
26
  supported_tokens: WithdrawCurrency[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.333",
3
+ "version": "0.0.335",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",