@heliofi/common 0.1.232 → 0.1.235-alpha.0
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/src/__tests__/index.test.d.ts +0 -0
- package/dist/src/__tests__/index.test.js +6 -0
- package/dist/src/__tests__/index.test.js.map +1 -0
- package/dist/src/domain/constants/environment.d.ts +3 -3
- package/dist/src/domain/constants/escrow.d.ts +1 -0
- package/dist/src/domain/constants/escrow.js +5 -0
- package/dist/src/domain/constants/escrow.js.map +1 -0
- package/dist/src/domain/constants/index.d.ts +1 -0
- package/dist/src/domain/constants/index.js +1 -0
- package/dist/src/domain/constants/index.js.map +1 -1
- package/dist/src/domain/constants/orderDirection.d.ts +5 -3
- package/dist/src/domain/contact/dtos/createContact.dto.d.ts +8 -0
- package/dist/src/domain/contact/dtos/createContact.dto.js +45 -0
- package/dist/src/domain/contact/dtos/createContact.dto.js.map +1 -0
- package/dist/src/domain/contact/dtos/index.d.ts +2 -0
- package/dist/src/domain/contact/dtos/index.js +19 -0
- package/dist/src/domain/contact/dtos/index.js.map +1 -0
- package/dist/src/domain/contact/dtos/updateContact.dto.d.ts +8 -0
- package/dist/src/domain/contact/dtos/updateContact.dto.js +45 -0
- package/dist/src/domain/contact/dtos/updateContact.dto.js.map +1 -0
- package/dist/src/domain/contact/entities/Contact.entity.d.ts +14 -0
- package/dist/src/domain/contact/entities/Contact.entity.js +8 -0
- package/dist/src/domain/contact/entities/Contact.entity.js.map +1 -0
- package/dist/src/domain/contact/entities/index.d.ts +1 -0
- package/dist/src/domain/contact/entities/index.js +18 -0
- package/dist/src/domain/contact/entities/index.js.map +1 -0
- package/dist/src/domain/contact/index.d.ts +2 -0
- package/dist/src/domain/contact/index.js +19 -0
- package/dist/src/domain/contact/index.js.map +1 -0
- package/dist/src/domain/contactAddress/dtos/ContactAddress.dto.d.ts +8 -0
- package/dist/src/domain/contactAddress/dtos/ContactAddress.dto.js +47 -0
- package/dist/src/domain/contactAddress/dtos/ContactAddress.dto.js.map +1 -0
- package/dist/src/domain/contactAddress/dtos/index.d.ts +1 -0
- package/dist/src/domain/contactAddress/dtos/index.js +18 -0
- package/dist/src/domain/contactAddress/dtos/index.js.map +1 -0
- package/dist/src/domain/contactAddress/entities/ContactAddress.entity.d.ts +9 -0
- package/dist/src/domain/contactAddress/entities/ContactAddress.entity.js +8 -0
- package/dist/src/domain/contactAddress/entities/ContactAddress.entity.js.map +1 -0
- package/dist/src/domain/contactAddress/entities/index.d.ts +1 -0
- package/dist/src/domain/contactAddress/entities/index.js +18 -0
- package/dist/src/domain/contactAddress/entities/index.js.map +1 -0
- package/dist/src/domain/contactAddress/index.d.ts +2 -0
- package/dist/src/domain/contactAddress/index.js +19 -0
- package/dist/src/domain/contactAddress/index.js.map +1 -0
- package/dist/src/domain/data-structures/Override.d.ts +1 -0
- package/dist/src/domain/data-structures/Override.js +3 -0
- package/dist/src/domain/data-structures/Override.js.map +1 -0
- package/dist/src/domain/data-structures/index.d.ts +1 -0
- package/dist/src/domain/data-structures/index.js +18 -0
- package/dist/src/domain/data-structures/index.js.map +1 -0
- package/dist/src/domain/index.d.ts +1 -0
- package/dist/src/domain/index.js +1 -0
- package/dist/src/domain/index.js.map +1 -1
- package/dist/src/domain/model/apiKey/dtos/createApiKeyDto.d.ts +4 -0
- package/dist/src/domain/model/apiKey/dtos/createApiKeyDto.js +52 -0
- package/dist/src/domain/model/apiKey/dtos/createApiKeyDto.js.map +1 -0
- package/dist/src/domain/model/apiKey/dtos/createApiKeyDtoInternal.d.ts +4 -4
- package/dist/src/domain/model/apiKey/entities/ApiKey.d.ts +11 -0
- package/dist/src/domain/model/apiKey/entities/ApiKey.js +7 -0
- package/dist/src/domain/model/apiKey/entities/ApiKey.js.map +1 -0
- package/dist/src/domain/model/apiKey/entities/ApiKeyAccess.d.ts +3 -3
- package/dist/src/domain/model/approve-transaction/dtos/approveTransaction.dto.d.ts +12 -12
- package/dist/src/domain/model/attachment/dtos/createAttachmentInternal.dto.d.ts +4 -4
- package/dist/src/domain/model/attachment/entities/BaseAttachment.d.ts +7 -0
- package/dist/src/domain/model/attachment/entities/BaseAttachment.js +8 -0
- package/dist/src/domain/model/attachment/entities/BaseAttachment.js.map +1 -0
- package/dist/src/domain/model/audit/tx/dtos/CreatePaylinkTxAudit.dto.d.ts +16 -0
- package/dist/src/domain/model/audit/tx/dtos/CreatePaylinkTxAudit.dto.js +3 -0
- package/dist/src/domain/model/audit/tx/dtos/CreatePaylinkTxAudit.dto.js.map +1 -0
- package/dist/src/domain/model/auth/dtos/signOn.dto.d.ts +2 -2
- package/dist/src/domain/model/auth/dtos/transactionSignOn.dto.d.ts +1 -1
- package/dist/src/domain/model/auth/entities/AuthResponse.d.ts +4 -4
- package/dist/src/domain/model/blockchain/constants/Cluster.d.ts +3 -3
- package/dist/src/domain/model/blockchain/constants/ConfirmTimeout.d.ts +5 -0
- package/dist/src/domain/model/blockchain/constants/ConfirmTimeout.js +10 -0
- package/dist/src/domain/model/blockchain/constants/ConfirmTimeout.js.map +1 -0
- package/dist/src/domain/model/blockchain/dtos/blockchain.dto.d.ts +2 -2
- package/dist/src/domain/model/blockchain/entities/Blockchain.d.ts +6 -0
- package/dist/src/domain/model/blockchain/entities/Blockchain.js +8 -0
- package/dist/src/domain/model/blockchain/entities/Blockchain.js.map +1 -0
- package/dist/src/domain/model/breakpoint/dtos/breakpoint.dto.d.ts +8 -8
- package/dist/src/domain/model/breakpoint/entities/BreakpointResponse.d.ts +2 -2
- package/dist/src/domain/model/company/entities/BaseCompany.d.ts +13 -0
- package/dist/src/domain/model/company/entities/BaseCompany.js +8 -0
- package/dist/src/domain/model/company/entities/BaseCompany.js.map +1 -0
- package/dist/src/domain/model/company/entities/Company.d.ts +7 -0
- package/dist/src/domain/model/company/entities/Company.js +8 -0
- package/dist/src/domain/model/company/entities/Company.js.map +1 -0
- package/dist/src/domain/model/currency/entities/BaseCurrency.d.ts +14 -0
- package/dist/src/domain/model/currency/entities/BaseCurrency.js +8 -0
- package/dist/src/domain/model/currency/entities/BaseCurrency.js.map +1 -0
- package/dist/src/domain/model/currency/entities/Currency.d.ts +5 -0
- package/dist/src/domain/model/currency/entities/Currency.js +8 -0
- package/dist/src/domain/model/currency/entities/Currency.js.map +1 -0
- package/dist/src/domain/model/discordDetails/dtos/createDiscordDetails.dto.d.ts +5 -5
- package/dist/src/domain/model/discordDetails/dtos/updateDiscordDetails.dto.d.ts +4 -4
- package/dist/src/domain/model/discordDetails/entities/BaseDiscordDetails.d.ts +5 -5
- package/dist/src/domain/model/discordDetails/entities/DiscordBotVersion.d.ts +2 -2
- package/dist/src/domain/model/discordDetails/entities/DiscordDetails.d.ts +1 -1
- package/dist/src/domain/model/entity/Entity.d.ts +2 -2
- package/dist/src/domain/model/fixed-currency/entities/TokenRatePayload.d.ts +9 -0
- package/dist/src/domain/model/fixed-currency/entities/TokenRatePayload.js +8 -0
- package/dist/src/domain/model/fixed-currency/entities/TokenRatePayload.js.map +1 -0
- package/dist/src/domain/model/location/entities/FetchifyFindAddress.d.ts +8 -0
- package/dist/src/domain/model/location/entities/FetchifyFindAddress.js +8 -0
- package/dist/src/domain/model/location/entities/FetchifyFindAddress.js.map +1 -0
- package/dist/src/domain/model/location/entities/FetchifyRetrieveAddress.d.ts +13 -0
- package/dist/src/domain/model/location/entities/FetchifyRetrieveAddress.js +8 -0
- package/dist/src/domain/model/location/entities/FetchifyRetrieveAddress.js.map +1 -0
- package/dist/src/domain/model/paylink/entities/OnlyContentAndTransactionPaylink.d.ts +13 -0
- package/dist/src/domain/model/paylink/entities/OnlyContentAndTransactionPaylink.js +11 -0
- package/dist/src/domain/model/paylink/entities/OnlyContentAndTransactionPaylink.js.map +1 -0
- package/dist/src/domain/model/paylink-tx/entities/BasePaylinkTx.d.ts +5 -5
- package/dist/src/domain/model/paylink-tx/entities/PaylinkTxWithMeta.d.ts +1 -1
- package/dist/src/domain/model/paylink-tx/entities/ShallowEnrichedPaylinkTx.d.ts +2 -2
- package/dist/src/domain/model/paystream/entities/IntervalType.d.ts +9 -0
- package/dist/src/domain/model/paystream/entities/IntervalType.js +14 -0
- package/dist/src/domain/model/paystream/entities/IntervalType.js.map +1 -0
- package/dist/src/domain/model/paystream-tx/dtos/createPaystreamTxDto.d.ts +11 -0
- package/dist/src/domain/model/paystream-tx/dtos/createPaystreamTxDto.js +57 -0
- package/dist/src/domain/model/paystream-tx/dtos/createPaystreamTxDto.js.map +1 -0
- package/dist/src/domain/model/paystream-tx/dtos/updatePaystreamTxDto.d.ts +6 -0
- package/dist/src/domain/model/paystream-tx/dtos/updatePaystreamTxDto.js +36 -0
- package/dist/src/domain/model/paystream-tx/dtos/updatePaystreamTxDto.js.map +1 -0
- package/dist/src/domain/model/paystream-tx/entities/CheckoutStatus.d.ts +16 -0
- package/dist/src/domain/model/paystream-tx/entities/CheckoutStatus.js +7 -0
- package/dist/src/domain/model/paystream-tx/entities/CheckoutStatus.js.map +1 -0
- package/dist/src/domain/model/paystream-tx/entities/PaystreamTx.d.ts +20 -0
- package/dist/src/domain/model/paystream-tx/entities/PaystreamTx.js +37 -0
- package/dist/src/domain/model/paystream-tx/entities/PaystreamTx.js.map +1 -0
- package/dist/src/domain/model/paystream-tx/entities/TransactionStatus.d.ts +16 -0
- package/dist/src/domain/model/paystream-tx/entities/TransactionStatus.js +7 -0
- package/dist/src/domain/model/paystream-tx/entities/TransactionStatus.js.map +1 -0
- package/dist/src/domain/model/prepare-invoice/entities/PrepareInvoice.d.ts +5 -0
- package/dist/src/domain/model/prepare-invoice/entities/PrepareInvoice.js +8 -0
- package/dist/src/domain/model/prepare-invoice/entities/PrepareInvoice.js.map +1 -0
- package/dist/src/domain/model/prepare-stream/entities/PrepareStream.d.ts +5 -0
- package/dist/src/domain/model/prepare-stream/entities/PrepareStream.js +8 -0
- package/dist/src/domain/model/prepare-stream/entities/PrepareStream.js.map +1 -0
- package/dist/src/domain/model/prepare-stream/entities/TokenStreamPayload.d.ts +8 -0
- package/dist/src/domain/model/prepare-stream/entities/TokenStreamPayload.js +8 -0
- package/dist/src/domain/model/prepare-stream/entities/TokenStreamPayload.js.map +1 -0
- package/dist/src/domain/model/prepare-stream/entities/TokenStreamWithdrawPayload.d.ts +5 -0
- package/dist/src/domain/model/prepare-stream/entities/TokenStreamWithdrawPayload.js +8 -0
- package/dist/src/domain/model/prepare-stream/entities/TokenStreamWithdrawPayload.js.map +1 -0
- package/dist/src/domain/model/prepare-transaction/dtos/prepareSwappedTransaction.dto.d.ts +4 -0
- package/dist/src/domain/model/prepare-transaction/dtos/prepareSwappedTransaction.dto.js +23 -0
- package/dist/src/domain/model/prepare-transaction/dtos/prepareSwappedTransaction.dto.js.map +1 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareSwapTransaction.d.ts +5 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareSwapTransaction.js +7 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareSwapTransaction.js.map +1 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareSwappedTransaction.d.ts +5 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareSwappedTransaction.js +7 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareSwappedTransaction.js.map +1 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareTransaction.d.ts +5 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareTransaction.js +8 -0
- package/dist/src/domain/model/prepare-transaction/entities/PrepareTransaction.js.map +1 -0
- package/dist/src/domain/model/product/dtos/product.dto.d.ts +3 -3
- package/dist/src/domain/model/product/entities/Product.d.ts +3 -3
- package/dist/src/domain/model/product/entities/ProductInputType.d.ts +2 -2
- package/dist/src/domain/model/product-details/dtos/productDetails.dto.d.ts +2 -2
- package/dist/src/domain/model/product-details/entities/ProductDetails.d.ts +2 -2
- package/dist/src/domain/model/report/entities/ReportItem.d.ts +37 -0
- package/dist/src/domain/model/report/entities/ReportItem.entity.d.ts +2 -1
- package/dist/src/domain/model/report/entities/ReportItem.entity.js.map +1 -1
- package/dist/src/domain/model/report/entities/ReportItem.js +7 -0
- package/dist/src/domain/model/report/entities/ReportItem.js.map +1 -0
- package/dist/src/domain/model/role/dtos/createRole.dto.d.ts +3 -3
- package/dist/src/domain/model/role/dtos/updateRole.dto.d.ts +1 -1
- package/dist/src/domain/model/role/entities/BaseRole.d.ts +2 -2
- package/dist/src/domain/model/role/entities/Role.d.ts +2 -2
- package/dist/src/domain/model/role/entities/RoleType.d.ts +3 -3
- package/dist/src/domain/model/role/entities/ShallowEnrichedRole.d.ts +2 -2
- package/dist/src/domain/model/slug/dtos/slug.dto.d.ts +3 -3
- package/dist/src/domain/model/slug/dtos/updateSlug.dto.d.ts +3 -3
- package/dist/src/domain/model/slug/entities/Slug.d.ts +6 -6
- package/dist/src/domain/model/slug/entities/SlugObjectType.d.ts +3 -3
- package/dist/src/domain/model/split-account/dtos/splitAccount.dto.d.ts +2 -2
- package/dist/src/domain/model/split-account/entities/SplitAccount.d.ts +2 -2
- package/dist/src/domain/model/split-wallets/dtos/splitWallet.dto.d.ts +1 -1
- package/dist/src/domain/model/split-wallets/dtos/splitWallet.dto.js +1 -0
- package/dist/src/domain/model/split-wallets/dtos/splitWallet.dto.js.map +1 -1
- package/dist/src/domain/model/split-wallets/entities/SplitWallet.d.ts +1 -1
- package/dist/src/domain/model/stream/dtos/cancelStream.dto.d.ts +5 -5
- package/dist/src/domain/model/stream/dtos/createStream.dto.d.ts +12 -12
- package/dist/src/domain/model/stream/dtos/withdrawStream.dto.d.ts +4 -4
- package/dist/src/domain/model/stream-event/dtos/createStreamEventDto.d.ts +2 -2
- package/dist/src/domain/model/stream-event/dtos/updateStreamEventDto.d.ts +2 -2
- package/dist/src/domain/model/stream-event/entities/StreamEvent.d.ts +2 -2
- package/dist/src/domain/model/submit-transaction/dtos/CheckTransactionStatus.dto.d.ts +4 -0
- package/dist/src/domain/model/submit-transaction/dtos/CheckTransactionStatus.dto.js +27 -0
- package/dist/src/domain/model/submit-transaction/dtos/CheckTransactionStatus.dto.js.map +1 -0
- package/dist/src/domain/model/submit-transaction/dtos/submitSwappedTransaction.dto.d.ts +4 -0
- package/dist/src/domain/model/submit-transaction/dtos/submitSwappedTransaction.dto.js +23 -0
- package/dist/src/domain/model/submit-transaction/dtos/submitSwappedTransaction.dto.js.map +1 -0
- package/dist/src/domain/model/token-quoting/entities/TokenQuoting.d.ts +4 -0
- package/dist/src/domain/model/token-quoting/entities/TokenQuoting.js +8 -0
- package/dist/src/domain/model/token-quoting/entities/TokenQuoting.js.map +1 -0
- package/dist/src/domain/model/token-swap/entities/SwapRouteObject.d.ts +14 -0
- package/dist/src/domain/model/token-swap/entities/SwapRouteObject.js +9 -0
- package/dist/src/domain/model/token-swap/entities/SwapRouteObject.js.map +1 -0
- package/dist/src/domain/model/token-swap/entities/SwapRouteToken.d.ts +4 -0
- package/dist/src/domain/model/token-swap/entities/SwapRouteToken.js +8 -0
- package/dist/src/domain/model/token-swap/entities/SwapRouteToken.js.map +1 -0
- package/dist/src/domain/model/transaction-meta/entities/BaseTransactionMeta.d.ts +16 -0
- package/dist/src/domain/model/transaction-meta/entities/BaseTransactionMeta.js +26 -0
- package/dist/src/domain/model/transaction-meta/entities/BaseTransactionMeta.js.map +1 -0
- package/dist/src/domain/model/transaction-meta/entities/TransactionStatus.entity.d.ts +7 -0
- package/dist/src/domain/model/transaction-meta/entities/TransactionStatus.entity.js +12 -0
- package/dist/src/domain/model/transaction-meta/entities/TransactionStatus.entity.js.map +1 -0
- package/dist/src/domain/model/user/entities/BaseUser.d.ts +8 -0
- package/dist/src/domain/model/user/entities/BaseUser.js +8 -0
- package/dist/src/domain/model/user/entities/BaseUser.js.map +1 -0
- package/dist/src/domain/model/wallet/dtos/updateWallet.dto.d.ts +1 -1
- package/dist/src/domain/model/wallet/entities/BaseWallet.d.ts +5 -0
- package/dist/src/domain/model/wallet/entities/BaseWallet.js +8 -0
- package/dist/src/domain/model/wallet/entities/BaseWallet.js.map +1 -0
- package/dist/src/domain/model/wallet/entities/Wallet.d.ts +7 -0
- package/dist/src/domain/model/wallet/entities/Wallet.js +8 -0
- package/dist/src/domain/model/wallet/entities/Wallet.js.map +1 -0
- package/dist/src/domain/model/wallet/entities/WalletDetails.d.ts +4 -0
- package/dist/src/domain/model/wallet/entities/WalletDetails.js +8 -0
- package/dist/src/domain/model/wallet/entities/WalletDetails.js.map +1 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/PaylinkTransactionEvent.d.ts +3 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/PaylinkTransactionEvent.js +11 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/PaylinkTransactionEvent.js.map +1 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/dtos/CreatePaylinkTransactionHook.dto.d.ts +3 -3
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionEvent.d.ts +3 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionEvent.entity.d.ts +1 -1
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionEvent.js +11 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionEvent.js.map +1 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionHook.d.ts +9 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionHook.js +7 -0
- package/dist/src/domain/model/webhook/paylink-transaction-hook/entities/PaylinkTransactionHook.js.map +1 -0
- package/dist/src/domain/model/withdrawal/dtos/createWithdrawalDto.d.ts +3 -3
- package/dist/src/domain/model/withdrawal/dtos/updateWithdrawalDto.d.ts +1 -1
- package/dist/src/domain/model/withdrawal/entities/BaseWithdrawal.d.ts +4 -0
- package/dist/src/domain/model/withdrawal/entities/BaseWithdrawal.js +41 -0
- package/dist/src/domain/model/withdrawal/entities/BaseWithdrawal.js.map +1 -0
- package/dist/src/domain/model/withdrawal/entities/Withdrawal.d.ts +3 -3
- package/dist/src/domain/model/withdrawal/entities/WithdrawalWithTransaction.d.ts +2 -2
- package/dist/src/domain/services/AmountService.d.ts +9 -0
- package/dist/src/domain/services/AmountService.js +32 -0
- package/dist/src/domain/services/AmountService.js.map +1 -0
- package/dist/src/domain/services/CurrencyService.d.ts +1 -1
- package/dist/src/domain/services/CurrencyService.js.map +1 -1
- package/dist/src/domain/services/EmailService.d.ts +3 -0
- package/dist/src/domain/services/EmailService.js +11 -0
- package/dist/src/domain/services/EmailService.js.map +1 -0
- package/dist/src/domain/services/SolscanService.d.ts +1 -1
- package/dist/src/domain/services/__tests__/AmountService.test.d.ts +1 -0
- package/dist/src/domain/services/__tests__/AmountService.test.js +24 -0
- package/dist/src/domain/services/__tests__/AmountService.test.js.map +1 -0
- package/dist/src/domain/services/index.d.ts +1 -0
- package/dist/src/domain/services/index.js +1 -0
- package/dist/src/domain/services/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseWithdrawal.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdrawal/entities/BaseWithdrawal.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAE9C,MAAa,cAAc;CAK1B;AAFC;IAAC,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;;8CACzB;AAJjB,wCAKC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity } from '../../entity';
|
|
2
2
|
import { Withdrawal } from './Withdrawal';
|
|
3
3
|
export declare class WithdrawalWithTransaction extends Entity {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
document: Withdrawal;
|
|
5
|
+
transactionSignature?: string;
|
|
6
6
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
export declare class AmountService {
|
|
3
|
+
static decimalFromMinimalUnits(minimalAmount: string, decimals: number): BigNumber;
|
|
4
|
+
static decimalFromMinimalUnits(minimalAmount: bigint, decimals: number): BigNumber;
|
|
5
|
+
static minimalUnitsFromDecimal(decimalAmount: string, decimals: number): bigint;
|
|
6
|
+
static minimalUnitsFromDecimal(decimalAmount: BigNumber, decimals: number): bigint;
|
|
7
|
+
private static minimalUnitAmountFromDecimalString;
|
|
8
|
+
private static getBigintMultiplierFromDecimals;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AmountService = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
class AmountService {
|
|
9
|
+
static decimalFromMinimalUnits(minimalAmount, decimals) {
|
|
10
|
+
const units = this.getBigintMultiplierFromDecimals(decimals);
|
|
11
|
+
return (0, bignumber_js_1.default)(String(minimalAmount)).dividedBy(String(units));
|
|
12
|
+
}
|
|
13
|
+
static minimalUnitsFromDecimal(decimalAmount, decimals) {
|
|
14
|
+
return this.minimalUnitAmountFromDecimalString(String(decimalAmount), decimals);
|
|
15
|
+
}
|
|
16
|
+
static minimalUnitAmountFromDecimalString(decimalAmount, currencyDecimals) {
|
|
17
|
+
const [integerPart, fractionalPart] = decimalAmount.split('.');
|
|
18
|
+
const normalizedFractionalPart = fractionalPart?.slice(0, currencyDecimals);
|
|
19
|
+
const stringFractionalDigits = normalizedFractionalPart?.length;
|
|
20
|
+
if (stringFractionalDigits == null) {
|
|
21
|
+
return (BigInt(decimalAmount) *
|
|
22
|
+
this.getBigintMultiplierFromDecimals(currencyDecimals));
|
|
23
|
+
}
|
|
24
|
+
const minimalUnitAmountFromDecimalString = BigInt(integerPart.concat(normalizedFractionalPart));
|
|
25
|
+
return (this.getBigintMultiplierFromDecimals(currencyDecimals - stringFractionalDigits) * BigInt(minimalUnitAmountFromDecimalString));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.AmountService = AmountService;
|
|
29
|
+
AmountService.getBigintMultiplierFromDecimals = (decimals) => {
|
|
30
|
+
return BigInt(1 + new Array(decimals).fill(0).join(''));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=AmountService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmountService.js","sourceRoot":"","sources":["../../../../src/domain/services/AmountService.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAErC,MAAa,aAAa;IAWxB,MAAM,CAAC,uBAAuB,CAC5B,aAA8B,EAC9B,QAAgB;QAEhB,MAAM,KAAK,GAAG,IAAI,CAAC,+BAA+B,CAAC,QAAQ,CAAC,CAAC;QAC7D,OAAO,IAAA,sBAAS,EAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IAYD,MAAM,CAAC,uBAAuB,CAC5B,aAAiC,EACjC,QAAgB;QAEhB,OAAO,IAAI,CAAC,kCAAkC,CAC5C,MAAM,CAAC,aAAa,CAAC,EACrB,QAAQ,CACT,CAAC;IACJ,CAAC;IAEO,MAAM,CAAC,kCAAkC,CAC/C,aAAqB,EACrB,gBAAwB;QAExB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/D,MAAM,wBAAwB,GAAG,cAAc,EAAE,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAAG,wBAAwB,EAAE,MAAM,CAAC;QAChE,IAAI,sBAAsB,IAAI,IAAI,EAAE;YAClC,OAAO,CACL,MAAM,CAAC,aAAa,CAAC;gBACrB,IAAI,CAAC,+BAA+B,CAAC,gBAAgB,CAAC,CACvD,CAAC;SACH;QAID,MAAM,kCAAkC,GAAG,MAAM,CAC/C,WAAW,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAC7C,CAAC;QAEF,OAAO,CACL,IAAI,CAAC,+BAA+B,CAClC,gBAAgB,GAAG,sBAAsB,CAC1C,GAAG,MAAM,CAAC,kCAAkC,CAAC,CAC/C,CAAC;IACJ,CAAC;;AAhEH,sCAuEC;AALgB,6CAA+B,GAAG,CAC/C,QAAgB,EACR,EAAE;IACV,OAAO,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1D,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyService.js","sourceRoot":"","sources":["../../../../src/domain/services/CurrencyService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"CurrencyService.js","sourceRoot":"","sources":["../../../../src/domain/services/CurrencyService.ts"],"names":[],"mappings":";;;AAGA,MAAa,eAAe;IAC1B,MAAM,CAAC,gBAAgB,CAAC,QAAgB,EAAE,MAAc;QACtD,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC5D,OAAO,UAAU,CAAC,CAAC,MAAM,GAAG,EAAE,IAAI,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF;AALD,0CAKC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.CurrencyService = void 0;
|
|
4
|
+
class CurrencyService {
|
|
5
|
+
static fromMinimalUnits(decimals, amount) {
|
|
6
|
+
const decimalsValue = Number.isNaN(decimals) ? 0 : decimals;
|
|
7
|
+
return Math.round(amount / 10 ** decimalsValue);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.CurrencyService = CurrencyService;
|
|
11
|
+
//# sourceMappingURL=EmailService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailService.js","sourceRoot":"","sources":["../../../../src/domain/services/EmailService.ts"],"names":[],"mappings":";;;AAAA,MAAa,eAAe;IAC1B,MAAM,CAAC,gBAAgB,CAAC,QAAgB,EAAE,MAAc;QACtD,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,aAAa,CAAC,CAAC;IAClD,CAAC;CACF;AALD,0CAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
7
|
+
const AmountService_1 = require("../AmountService");
|
|
8
|
+
describe('AmountService', () => {
|
|
9
|
+
it('should convert to minimalUnits', () => {
|
|
10
|
+
expect(AmountService_1.AmountService.minimalUnitsFromDecimal('1', 9)).toEqual(1000000000n);
|
|
11
|
+
expect(AmountService_1.AmountService.minimalUnitsFromDecimal((0, bignumber_js_1.default)('2.5'), 18)).toEqual(2500000000000000000n);
|
|
12
|
+
expect(AmountService_1.AmountService.minimalUnitsFromDecimal((0, bignumber_js_1.default)('0'), 6)).toEqual(0n);
|
|
13
|
+
expect(AmountService_1.AmountService.minimalUnitsFromDecimal('0.0', 8)).toEqual(0n);
|
|
14
|
+
expect(AmountService_1.AmountService.minimalUnitsFromDecimal((0, bignumber_js_1.default)('1234565.988998877009998887367'), 9)).toEqual(1234565988998877n);
|
|
15
|
+
expect(AmountService_1.AmountService.minimalUnitsFromDecimal((0, bignumber_js_1.default)('1234565.988998877009998887367'), 18)).toEqual(1234565988998877009998887n);
|
|
16
|
+
});
|
|
17
|
+
it('should convert to decimal', () => {
|
|
18
|
+
expect(AmountService_1.AmountService.decimalFromMinimalUnits('1000000000', 9)).toEqual((0, bignumber_js_1.default)('1'));
|
|
19
|
+
expect(AmountService_1.AmountService.decimalFromMinimalUnits('123456', 9)).toEqual((0, bignumber_js_1.default)('0.000123456'));
|
|
20
|
+
expect(AmountService_1.AmountService.decimalFromMinimalUnits(0n, 3)).toEqual((0, bignumber_js_1.default)('0'));
|
|
21
|
+
expect(AmountService_1.AmountService.decimalFromMinimalUnits('1232313141312312398731239123987123', 6)).toEqual((0, bignumber_js_1.default)('1.232313141312312398731239123987123e+27'));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=AmountService.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmountService.test.js","sourceRoot":"","sources":["../../../../../src/domain/services/__tests__/AmountService.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAqC;AACrC,oDAAiD;AAEjD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,IAAA,sBAAS,EAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CACzE,oBAAoB,CACrB,CAAC;QACF,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,IAAA,sBAAS,EAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CACtE,EAAE,CACH,CAAC;QACF,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACpE,MAAM,CACJ,6BAAa,CAAC,uBAAuB,CACnC,IAAA,sBAAS,EAAC,+BAA+B,CAAC,EAC1C,CAAC,CACF,CACF,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC7B,MAAM,CACJ,6BAAa,CAAC,uBAAuB,CACnC,IAAA,sBAAS,EAAC,+BAA+B,CAAC,EAC1C,EAAE,CACH,CACF,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CACpE,IAAA,sBAAS,EAAC,GAAG,CAAC,CACf,CAAC;QAEF,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAChE,IAAA,sBAAS,EAAC,aAAa,CAAC,CACzB,CAAC;QAEF,MAAM,CAAC,6BAAa,CAAC,uBAAuB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAC1D,IAAA,sBAAS,EAAC,GAAG,CAAC,CACf,CAAC;QAEF,MAAM,CACJ,6BAAa,CAAC,uBAAuB,CACnC,oCAAoC,EACpC,CAAC,CACF,CACF,CAAC,OAAO,CAAC,IAAA,sBAAS,EAAC,yCAAyC,CAAC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -25,4 +25,5 @@ __exportStar(require("./SplitWalletService"), exports);
|
|
|
25
25
|
__exportStar(require("./PolygonExplorerService"), exports);
|
|
26
26
|
__exportStar(require("./ExplorerAggregateService"), exports);
|
|
27
27
|
__exportStar(require("./ClusterService"), exports);
|
|
28
|
+
__exportStar(require("./AmountService"), exports);
|
|
28
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,oDAAkC;AAClC,mDAAiC;AACjC,mDAAiC;AACjC,+CAA6B;AAC7B,iEAA+C;AAC/C,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,6DAA2C;AAC3C,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,oDAAkC;AAClC,mDAAiC;AACjC,mDAAiC;AACjC,+CAA6B;AAC7B,iEAA+C;AAC/C,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,6DAA2C;AAC3C,mDAAiC;AACjC,kDAAgC"}
|