@heliofi/common 0.1.241 → 0.1.242
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/domain/constants/index.d.ts +0 -1
- package/dist/src/domain/constants/index.js +0 -1
- package/dist/src/domain/constants/index.js.map +1 -1
- package/dist/src/domain/index.d.ts +0 -1
- package/dist/src/domain/index.js +0 -1
- package/dist/src/domain/index.js.map +1 -1
- package/dist/src/domain/model/escrow-cancel-transaction-meta/entities/EscrowCancelTransactionMeta.entity.d.ts +5 -0
- package/dist/src/domain/model/escrow-cancel-transaction-meta/entities/EscrowCancelTransactionMeta.entity.js +8 -0
- package/dist/src/domain/model/escrow-cancel-transaction-meta/entities/EscrowCancelTransactionMeta.entity.js.map +1 -0
- package/dist/src/domain/model/escrow-cancel-transaction-meta/entities/index.d.ts +1 -0
- package/dist/src/domain/model/escrow-cancel-transaction-meta/entities/index.js +18 -0
- package/dist/src/domain/model/escrow-cancel-transaction-meta/entities/index.js.map +1 -0
- package/dist/src/domain/model/escrow-cancel-transaction-meta/index.d.ts +1 -0
- package/dist/src/domain/{data-structures → model/escrow-cancel-transaction-meta}/index.js +1 -1
- package/dist/src/domain/model/escrow-cancel-transaction-meta/index.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/dtos/EscrowTransactionMeta.dto.d.ts +6 -0
- package/dist/src/domain/model/escrow-transaction/dtos/EscrowTransactionMeta.dto.js +33 -0
- package/dist/src/domain/model/escrow-transaction/dtos/EscrowTransactionMeta.dto.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/dtos/index.d.ts +1 -0
- package/dist/src/domain/model/escrow-transaction/dtos/index.js +18 -0
- package/dist/src/domain/model/escrow-transaction/dtos/index.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/entities/BaseEscrowTransactionMeta.entity.d.ts +6 -0
- package/dist/src/domain/model/escrow-transaction/entities/BaseEscrowTransactionMeta.entity.js +8 -0
- package/dist/src/domain/model/escrow-transaction/entities/BaseEscrowTransactionMeta.entity.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/entities/BaseTransactionMeta.entity.d.ts +6 -0
- package/dist/src/domain/model/escrow-transaction/entities/BaseTransactionMeta.entity.js +8 -0
- package/dist/src/domain/model/escrow-transaction/entities/BaseTransactionMeta.entity.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/entities/EscrowCancelTransactionMeta.entity.d.ts +3 -0
- package/dist/src/domain/model/escrow-transaction/entities/EscrowCancelTransactionMeta.entity.js +8 -0
- package/dist/src/domain/model/escrow-transaction/entities/EscrowCancelTransactionMeta.entity.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/entities/EscrowTransactionMeta.entity.d.ts +4 -0
- package/dist/src/domain/model/escrow-transaction/entities/EscrowTransactionMeta.entity.js +8 -0
- package/dist/src/domain/model/escrow-transaction/entities/EscrowTransactionMeta.entity.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/entities/index.d.ts +2 -0
- package/dist/src/domain/model/escrow-transaction/entities/index.js +19 -0
- package/dist/src/domain/model/escrow-transaction/entities/index.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction/index.d.ts +2 -0
- package/dist/src/domain/model/escrow-transaction/index.js +19 -0
- package/dist/src/domain/model/escrow-transaction/index.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction-meta/entities/EscrowTransactionMeta.entity.d.ts +6 -0
- package/dist/src/domain/model/escrow-transaction-meta/entities/EscrowTransactionMeta.entity.js +8 -0
- package/dist/src/domain/model/escrow-transaction-meta/entities/EscrowTransactionMeta.entity.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction-meta/entities/index.d.ts +1 -0
- package/dist/src/domain/model/escrow-transaction-meta/entities/index.js +18 -0
- package/dist/src/domain/model/escrow-transaction-meta/entities/index.js.map +1 -0
- package/dist/src/domain/model/escrow-transaction-meta/index.d.ts +1 -0
- package/dist/src/domain/model/escrow-transaction-meta/index.js +18 -0
- package/dist/src/domain/model/escrow-transaction-meta/index.js.map +1 -0
- package/dist/src/domain/model/index.d.ts +2 -0
- package/dist/src/domain/model/index.js +2 -0
- package/dist/src/domain/model/index.js.map +1 -1
- package/dist/src/domain/model/nft-drop/constants/index.d.ts +1 -0
- package/dist/src/domain/model/nft-drop/constants/index.js +18 -0
- package/dist/src/domain/model/nft-drop/constants/index.js.map +1 -0
- package/dist/src/domain/model/nft-drop/constants/nftDropState.d.ts +9 -0
- package/dist/src/domain/model/nft-drop/constants/nftDropState.js +14 -0
- package/dist/src/domain/model/nft-drop/constants/nftDropState.js.map +1 -0
- package/dist/src/domain/model/nft-drop/dtos/index.d.ts +1 -0
- package/dist/src/domain/model/nft-drop/dtos/index.js +1 -0
- package/dist/src/domain/model/nft-drop/dtos/index.js.map +1 -1
- package/dist/src/domain/model/nft-drop/dtos/nftDrop.dto.d.ts +0 -1
- package/dist/src/domain/model/nft-drop/dtos/nftDrop.dto.js +0 -5
- package/dist/src/domain/model/nft-drop/dtos/nftDrop.dto.js.map +1 -1
- package/dist/src/domain/model/nft-drop/dtos/updateNftDrop.dto.d.ts +8 -0
- package/dist/src/domain/model/nft-drop/dtos/updateNftDrop.dto.js +42 -0
- package/dist/src/domain/model/nft-drop/dtos/updateNftDrop.dto.js.map +1 -0
- package/dist/src/domain/model/nft-drop/dtos/updateNftDropDto.d.ts +8 -0
- package/dist/src/domain/model/nft-drop/dtos/updateNftDropDto.js +42 -0
- package/dist/src/domain/model/nft-drop/dtos/updateNftDropDto.js.map +1 -0
- package/dist/src/domain/model/nft-drop/entities/NftDrop.entity.d.ts +6 -2
- package/dist/src/domain/model/nft-drop/entities/NftDrop.entity.js.map +1 -1
- package/dist/src/domain/model/nft-drop/index.d.ts +1 -0
- package/dist/src/domain/model/nft-drop/index.js +1 -0
- package/dist/src/domain/model/nft-drop/index.js.map +1 -1
- package/dist/src/domain/model/nft-escrow/dtos/index.d.ts +3 -0
- package/dist/src/domain/model/nft-escrow/dtos/index.js +20 -0
- package/dist/src/domain/model/nft-escrow/dtos/index.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowCancel.dto.d.ts +5 -0
- package/dist/src/domain/model/{user/dtos/addWallet.dto.js → nft-escrow/dtos/nftEscrowCancel.dto.js} +15 -5
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowCancel.dto.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowCreate.dto.d.ts +7 -0
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowCreate.dto.js +43 -0
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowCreate.dto.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowSubmit.dto.d.ts +5 -0
- package/dist/src/domain/model/{user/dtos/createWallet.dto.js → nft-escrow/dtos/nftEscrowSubmit.dto.js} +9 -9
- package/dist/src/domain/model/nft-escrow/dtos/nftEscrowSubmit.dto.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/entities/TokenNftEscrowPayload.d.ts +5 -0
- package/dist/src/domain/model/nft-escrow/entities/TokenNftEscrowPayload.entity.d.ts +5 -0
- package/dist/src/domain/model/nft-escrow/entities/TokenNftEscrowPayload.entity.js +8 -0
- package/dist/src/domain/model/nft-escrow/entities/TokenNftEscrowPayload.entity.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/entities/TokenNftEscrowPayload.js +8 -0
- package/dist/src/domain/model/nft-escrow/entities/TokenNftEscrowPayload.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/entities/index.d.ts +1 -0
- package/dist/src/domain/model/nft-escrow/entities/index.js +18 -0
- package/dist/src/domain/model/nft-escrow/entities/index.js.map +1 -0
- package/dist/src/domain/model/nft-escrow/index.d.ts +2 -0
- package/dist/src/domain/model/nft-escrow/index.js +19 -0
- package/dist/src/domain/model/nft-escrow/index.js.map +1 -0
- package/dist/src/domain/model/report/entities/ReportItem.entity.d.ts +1 -2
- package/dist/src/domain/model/report/entities/ReportItem.entity.js.map +1 -1
- package/dist/src/domain/model/transaction-meta/constants/TransactionType.d.ts +2 -1
- package/dist/src/domain/model/transaction-meta/constants/TransactionType.js +1 -0
- package/dist/src/domain/model/transaction-meta/constants/TransactionType.js.map +1 -1
- package/dist/src/domain/services/CurrencyService.js.map +1 -1
- package/dist/src/domain/services/index.d.ts +0 -1
- package/dist/src/domain/services/index.js +0 -1
- package/dist/src/domain/services/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/dist/src/domain/data-structures/Override.d.ts +0 -1
- package/dist/src/domain/data-structures/Override.js +0 -3
- package/dist/src/domain/data-structures/Override.js.map +0 -1
- package/dist/src/domain/data-structures/index.d.ts +0 -1
- package/dist/src/domain/data-structures/index.js.map +0 -1
- package/dist/src/domain/model/user/dtos/addWallet.dto.d.ts +0 -3
- package/dist/src/domain/model/user/dtos/addWallet.dto.js.map +0 -1
- package/dist/src/domain/model/user/dtos/createWallet.dto.d.ts +0 -5
- package/dist/src/domain/model/user/dtos/createWallet.dto.js.map +0 -1
- package/dist/src/domain/services/AmountService.d.ts +0 -9
- package/dist/src/domain/services/AmountService.js +0 -32
- package/dist/src/domain/services/AmountService.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heliofi/common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.242",
|
|
5
5
|
"description": "Common package",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"@heliofi/evm-adapter": "^0.0.28-beta",
|
|
16
16
|
"@project-serum/anchor": "^0.25.0",
|
|
17
17
|
"@solana/web3.js": "^1.44.0",
|
|
18
|
-
"bignumber.js": "^9.1.1",
|
|
19
18
|
"bs58": "^5.0.0",
|
|
20
19
|
"class-transformer": "^0.5.1",
|
|
21
20
|
"class-validator": "^0.14.0",
|
|
@@ -26,5 +25,5 @@
|
|
|
26
25
|
"ts-loader": "^9.3.1",
|
|
27
26
|
"typescript": "^4.8.2"
|
|
28
27
|
},
|
|
29
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "cc07e5557db5247ec8b03a76eb297d265dc7077a"
|
|
30
29
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type Override<T1, T2> = Omit<T1, keyof T2> & T2;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Override.js","sourceRoot":"","sources":["../../../../src/domain/data-structures/Override.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Override';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/data-structures/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addWallet.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/user/dtos/addWallet.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,YAAY;CAIxB;AAHC;IAAC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACa;AAH1B,oCAIC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createWallet.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/user/dtos/createWallet.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,eAAe;CAY3B;AAXC;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6CACC;AAEd;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kDACK;AAElB;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yDACY;AAX3B,0CAYC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|