@heliofi/common 0.2.258 → 0.2.260
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/model/audit/explorer/constants/ExplorerAuditAction.d.ts +1 -0
- package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditAction.js +1 -0
- package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditAction.js.map +1 -1
- package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditActionType.js +1 -0
- package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditActionType.js.map +1 -1
- package/dist/src/domain/model/company/dtos/index.d.ts +1 -0
- package/dist/src/domain/model/company/dtos/index.js +1 -0
- package/dist/src/domain/model/company/dtos/index.js.map +1 -1
- package/dist/src/domain/model/company/dtos/updateMinimalDepositAmount.dto.d.ts +3 -0
- package/dist/src/domain/model/company/dtos/updateMinimalDepositAmount.dto.js +6 -0
- package/dist/src/domain/model/company/dtos/updateMinimalDepositAmount.dto.js.map +1 -1
- package/dist/src/domain/model/company/dtos/updateRestrictedDepositEngines.dto.d.ts +4 -0
- package/dist/src/domain/model/company/dtos/updateRestrictedDepositEngines.dto.js +24 -0
- package/dist/src/domain/model/company/dtos/updateRestrictedDepositEngines.dto.js.map +1 -0
- package/dist/src/domain/model/company/entities/BaseCompany.entity.d.ts +2 -0
- package/dist/src/domain/model/company/entities/BaseCompany.entity.js.map +1 -1
- package/dist/src/domain/model/company/entities/CompanyWithFees.entity.d.ts +2 -1
- package/dist/src/domain/model/company/entities/CompanyWithFees.entity.js.map +1 -1
- package/dist/src/domain/model/currency/entities/CurrencyFeature.d.ts +2 -0
- package/dist/src/domain/model/currency/entities/CurrencyFeature.js +2 -0
- package/dist/src/domain/model/currency/entities/CurrencyFeature.js.map +1 -1
- package/dist/src/domain/model/decent-swap/entities/DecentTransactionStatus.d.ts +1 -1
- package/dist/src/domain/model/helio-wallet-transaction/dtos/helioWalletRefund.dto.d.ts +6 -0
- package/dist/src/domain/model/helio-wallet-transaction/dtos/helioWalletRefund.dto.js +33 -0
- package/dist/src/domain/model/helio-wallet-transaction/dtos/helioWalletRefund.dto.js.map +1 -0
- package/dist/src/domain/model/helio-wallet-transaction/dtos/index.d.ts +1 -0
- package/dist/src/domain/model/helio-wallet-transaction/dtos/index.js +1 -0
- package/dist/src/domain/model/helio-wallet-transaction/dtos/index.js.map +1 -1
- package/dist/src/domain/model/index.d.ts +1 -0
- package/dist/src/domain/model/index.js +1 -0
- package/dist/src/domain/model/index.js.map +1 -1
- package/dist/src/domain/model/intercom-identity/entities/IntercomIdentityHash.entity.d.ts +3 -0
- package/dist/src/domain/model/intercom-identity/entities/IntercomIdentityHash.entity.js +7 -0
- package/dist/src/domain/model/intercom-identity/entities/IntercomIdentityHash.entity.js.map +1 -0
- package/dist/src/domain/model/intercom-identity/entities/index.d.ts +1 -0
- package/dist/src/domain/model/intercom-identity/entities/index.js +18 -0
- package/dist/src/domain/model/intercom-identity/entities/index.js.map +1 -0
- package/dist/src/domain/model/intercom-identity/index.d.ts +1 -0
- package/dist/src/domain/model/intercom-identity/index.js +18 -0
- package/dist/src/domain/model/intercom-identity/index.js.map +1 -0
- package/dist/src/domain/model/on-ramps/dtos/getMoonPayPlatformQuote.dto.d.ts +4 -1
- package/dist/src/domain/model/on-ramps/dtos/getMoonPayPlatformQuote.dto.js +11 -0
- package/dist/src/domain/model/on-ramps/dtos/getMoonPayPlatformQuote.dto.js.map +1 -1
- package/dist/src/domain/model/on-ramps/entities/MoonPayPaymentMethodType.d.ts +16 -0
- package/dist/src/domain/model/on-ramps/entities/MoonPayPaymentMethodType.js +21 -0
- package/dist/src/domain/model/on-ramps/entities/MoonPayPaymentMethodType.js.map +1 -0
- package/dist/src/domain/model/on-ramps/entities/index.d.ts +1 -0
- package/dist/src/domain/model/on-ramps/entities/index.js +1 -0
- package/dist/src/domain/model/on-ramps/entities/index.js.map +1 -1
- package/dist/src/domain/model/transaction-meta/constants/TransactionStatus.d.ts +1 -0
- package/dist/src/domain/model/transaction-meta/constants/TransactionStatus.js +3 -0
- package/dist/src/domain/model/transaction-meta/constants/TransactionStatus.js.map +1 -1
- package/dist/src/domain/model/webhook/index.d.ts +1 -0
- package/dist/src/domain/model/webhook/index.js +1 -0
- package/dist/src/domain/model/webhook/index.js.map +1 -1
- package/dist/src/domain/model/webhook/withdrawal/index.d.ts +2 -0
- package/dist/src/domain/model/webhook/withdrawal/index.js +19 -0
- package/dist/src/domain/model/webhook/withdrawal/index.js.map +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook/entities/index.d.ts +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook/entities/index.js +3 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook/entities/index.js.map +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook/index.d.ts +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook/index.js +18 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook/index.js.map +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEvent.entity.d.ts +6 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEvent.entity.js +11 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEvent.entity.js.map +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEventStatus.entity.d.ts +5 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEventStatus.entity.js +10 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEventStatus.entity.js.map +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/index.d.ts +2 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/index.js +19 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/index.js.map +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/index.d.ts +1 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/index.js +18 -0
- package/dist/src/domain/model/webhook/withdrawal/withdrawal-hook-event/index.js.map +1 -0
- package/dist/src/domain/model/withdraw/constants/WithdrawalKind.d.ts +2 -1
- package/dist/src/domain/model/withdraw/constants/WithdrawalKind.js +1 -0
- package/dist/src/domain/model/withdraw/constants/WithdrawalKind.js.map +1 -1
- package/dist/src/domain/model/withdraw/dtos/createWithdrawalConfig.dto.spec.d.ts +1 -0
- package/dist/src/domain/model/withdraw/dtos/createWithdrawalConfig.dto.spec.js +38 -0
- package/dist/src/domain/model/withdraw/dtos/createWithdrawalConfig.dto.spec.js.map +1 -0
- package/dist/src/domain/model/withdraw/dtos/index.d.ts +3 -2
- package/dist/src/domain/model/withdraw/dtos/index.js +3 -2
- package/dist/src/domain/model/withdraw/dtos/index.js.map +1 -1
- package/dist/src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.d.ts +7 -0
- package/dist/src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.js +39 -0
- package/dist/src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.js.map +1 -0
- package/dist/src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.spec.d.ts +1 -0
- package/dist/src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.spec.js +43 -0
- package/dist/src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.spec.js.map +1 -0
- package/dist/src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.d.ts +6 -0
- package/dist/src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.js +31 -0
- package/dist/src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.js.map +1 -0
- package/dist/src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.spec.d.ts +1 -0
- package/dist/src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.spec.js +76 -0
- package/dist/src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.spec.js.map +1 -0
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalRawStep.dto.d.ts +4 -0
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalRawStep.dto.js +27 -0
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalRawStep.dto.js.map +1 -0
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalSignedTx.dto.d.ts +0 -2
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalSignedTx.dto.js +0 -5
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalSignedTx.dto.js.map +1 -1
- package/dist/src/domain/model/withdraw/entities/PreparedWithdrawal.entity.d.ts +9 -0
- package/dist/src/domain/model/withdraw/entities/PreparedWithdrawal.entity.js +8 -0
- package/dist/src/domain/model/withdraw/entities/PreparedWithdrawal.entity.js.map +1 -0
- package/dist/src/domain/model/withdraw/{dtos/submitWithdrawalResponse.dto.d.ts → entities/SubmitWithdrawal.entity.d.ts} +2 -1
- package/dist/src/domain/model/withdraw/entities/SubmitWithdrawal.entity.js +8 -0
- package/dist/src/domain/model/withdraw/entities/SubmitWithdrawal.entity.js.map +1 -0
- package/dist/src/domain/model/withdraw/entities/WithdrawalBalancesResponse.entity.d.ts +4 -0
- package/dist/src/domain/model/withdraw/entities/WithdrawalBalancesResponse.entity.js +7 -0
- package/dist/src/domain/model/withdraw/entities/WithdrawalBalancesResponse.entity.js.map +1 -0
- package/dist/src/domain/model/withdraw/entities/WithdrawalDetail.entity.d.ts +10 -0
- package/dist/src/domain/model/withdraw/entities/WithdrawalDetail.entity.js +8 -0
- package/dist/src/domain/model/withdraw/entities/WithdrawalDetail.entity.js.map +1 -0
- package/dist/src/domain/model/withdraw/entities/index.d.ts +4 -0
- package/dist/src/domain/model/withdraw/entities/index.js +4 -0
- package/dist/src/domain/model/withdraw/entities/index.js.map +1 -1
- package/dist/src/domain/model/withdraw/index.d.ts +1 -0
- package/dist/src/domain/model/withdraw/index.js +1 -0
- package/dist/src/domain/model/withdraw/index.js.map +1 -1
- package/dist/src/domain/model/withdraw/query/getWithdrawalBalances.dto.d.ts +3 -0
- package/dist/src/domain/model/withdraw/query/getWithdrawalBalances.dto.js +22 -0
- package/dist/src/domain/model/withdraw/query/getWithdrawalBalances.dto.js.map +1 -0
- package/dist/src/domain/model/withdraw/query/index.d.ts +1 -0
- package/dist/src/domain/model/withdraw/query/index.js +18 -0
- package/dist/src/domain/model/withdraw/query/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalResponse.dto.d.ts +0 -7
- package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalResponse.dto.js +0 -7
- package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalResponse.dto.js.map +0 -1
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalResponse.dto.js +0 -7
- package/dist/src/domain/model/withdraw/dtos/submitWithdrawalResponse.dto.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./entities"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/domain/model/webhook/withdrawal/withdrawal-hook/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithdrawalHookEvent = void 0;
|
|
4
|
+
var WithdrawalHookEvent;
|
|
5
|
+
(function (WithdrawalHookEvent) {
|
|
6
|
+
WithdrawalHookEvent["SUBMITTED"] = "SUBMITTED";
|
|
7
|
+
WithdrawalHookEvent["CONFIRMED"] = "CONFIRMED";
|
|
8
|
+
WithdrawalHookEvent["FAILED"] = "FAILED";
|
|
9
|
+
WithdrawalHookEvent["REFUNDED_BY_PROVIDER"] = "REFUNDED_BY_PROVIDER";
|
|
10
|
+
})(WithdrawalHookEvent || (exports.WithdrawalHookEvent = WithdrawalHookEvent = {}));
|
|
11
|
+
//# sourceMappingURL=WithdrawalHookEvent.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalHookEvent.entity.js","sourceRoot":"","sources":["../../../../../../../../src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEvent.entity.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;IACjB,oEAA6C,CAAA;AAC/C,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithdrawalHookEventStatus = void 0;
|
|
4
|
+
var WithdrawalHookEventStatus;
|
|
5
|
+
(function (WithdrawalHookEventStatus) {
|
|
6
|
+
WithdrawalHookEventStatus["SUCCESS"] = "SUCCESS";
|
|
7
|
+
WithdrawalHookEventStatus["PENDING"] = "PENDING";
|
|
8
|
+
WithdrawalHookEventStatus["FAILED"] = "FAILED";
|
|
9
|
+
})(WithdrawalHookEventStatus || (exports.WithdrawalHookEventStatus = WithdrawalHookEventStatus = {}));
|
|
10
|
+
//# sourceMappingURL=WithdrawalHookEventStatus.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalHookEventStatus.entity.js","sourceRoot":"","sources":["../../../../../../../../src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/WithdrawalHookEventStatus.entity.ts"],"names":[],"mappings":";;;AAAA,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,gDAAmB,CAAA;IACnB,gDAAmB,CAAA;IACnB,8CAAiB,CAAA;AACnB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./WithdrawalHookEvent.entity"), exports);
|
|
18
|
+
__exportStar(require("./WithdrawalHookEventStatus.entity"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/domain/model/webhook/withdrawal/withdrawal-hook-event/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,qEAAmD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './entities';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./entities"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/domain/model/webhook/withdrawal/withdrawal-hook-event/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -4,5 +4,6 @@ exports.WithdrawalKind = void 0;
|
|
|
4
4
|
var WithdrawalKind;
|
|
5
5
|
(function (WithdrawalKind) {
|
|
6
6
|
WithdrawalKind["POLYMARKET"] = "polymarket";
|
|
7
|
+
WithdrawalKind["RAW"] = "raw";
|
|
7
8
|
})(WithdrawalKind || (exports.WithdrawalKind = WithdrawalKind = {}));
|
|
8
9
|
//# sourceMappingURL=WithdrawalKind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithdrawalKind.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"WithdrawalKind.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,2CAAyB,CAAA;IACzB,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const class_validator_1 = require("class-validator");
|
|
4
|
+
const class_transformer_1 = require("class-transformer");
|
|
5
|
+
const createWithdrawalConfig_dto_1 = require("./createWithdrawalConfig.dto");
|
|
6
|
+
const WithdrawalKind_1 = require("../constants/WithdrawalKind");
|
|
7
|
+
const basePayload = {
|
|
8
|
+
name: 'My withdrawal config',
|
|
9
|
+
currencyIds: ['507f1f77bcf86cd799439011'],
|
|
10
|
+
};
|
|
11
|
+
describe('CreateWithdrawalConfigDto', () => {
|
|
12
|
+
it('accepts kind = WithdrawalKind.RAW', async () => {
|
|
13
|
+
const dto = (0, class_transformer_1.plainToInstance)(createWithdrawalConfig_dto_1.CreateWithdrawalConfigDto, {
|
|
14
|
+
...basePayload,
|
|
15
|
+
kind: WithdrawalKind_1.WithdrawalKind.RAW,
|
|
16
|
+
});
|
|
17
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
18
|
+
expect(errors).toHaveLength(0);
|
|
19
|
+
});
|
|
20
|
+
it('accepts kind = WithdrawalKind.POLYMARKET (regression guard)', async () => {
|
|
21
|
+
const dto = (0, class_transformer_1.plainToInstance)(createWithdrawalConfig_dto_1.CreateWithdrawalConfigDto, {
|
|
22
|
+
...basePayload,
|
|
23
|
+
kind: WithdrawalKind_1.WithdrawalKind.POLYMARKET,
|
|
24
|
+
});
|
|
25
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
26
|
+
expect(errors).toHaveLength(0);
|
|
27
|
+
});
|
|
28
|
+
it('rejects an unrecognized kind', async () => {
|
|
29
|
+
const dto = (0, class_transformer_1.plainToInstance)(createWithdrawalConfig_dto_1.CreateWithdrawalConfigDto, {
|
|
30
|
+
...basePayload,
|
|
31
|
+
kind: 'not-a-kind',
|
|
32
|
+
});
|
|
33
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
34
|
+
const error = errors.find((e) => e.property === 'kind');
|
|
35
|
+
expect(error?.constraints?.isEnum).toBeDefined();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=createWithdrawalConfig.dto.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createWithdrawalConfig.dto.spec.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/createWithdrawalConfig.dto.spec.ts"],"names":[],"mappings":";;AAAA,qDAA2C;AAC3C,yDAAoD;AACpD,6EAAyE;AACzE,gEAA6D;AAE7D,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,CAAC,0BAA0B,CAAC;CAC1C,CAAC;AAEF,Q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ithdrawalConfig.dto';
|
|
|
3
3
|
export * from './preparedTransaction.dto';
|
|
4
4
|
export * from './preparedWithdrawal.dto';
|
|
5
5
|
export * from './preparedWithdrawalCall.dto';
|
|
6
|
-
export * from './preparedWithdrawalResponse.dto';
|
|
7
6
|
export * from './preparedWithdrawalSummary.dto';
|
|
8
7
|
export * from './preparedWithdrawalTypedData.dto';
|
|
9
8
|
export * from './preparedWithdrawalTypedDataDomain.dto';
|
|
10
9
|
export * from './preparedWithdrawalTypedDataField.dto';
|
|
10
|
+
export * from './rawPreparedWithdrawal.dto';
|
|
11
|
+
export * from './rawSubmitWithdrawalSignedTx.dto';
|
|
11
12
|
export * from './submitWithdrawal.dto';
|
|
12
|
-
export * from './
|
|
13
|
+
export * from './submitWithdrawalRawStep.dto';
|
|
13
14
|
export * from './submitWithdrawalSignedTx.dto';
|
|
14
15
|
export * from './updateWithdrawalConfig.dto';
|
|
@@ -19,13 +19,14 @@ __exportStar(require("./createWithdrawalConfig.dto"), exports);
|
|
|
19
19
|
__exportStar(require("./preparedTransaction.dto"), exports);
|
|
20
20
|
__exportStar(require("./preparedWithdrawal.dto"), exports);
|
|
21
21
|
__exportStar(require("./preparedWithdrawalCall.dto"), exports);
|
|
22
|
-
__exportStar(require("./preparedWithdrawalResponse.dto"), exports);
|
|
23
22
|
__exportStar(require("./preparedWithdrawalSummary.dto"), exports);
|
|
24
23
|
__exportStar(require("./preparedWithdrawalTypedData.dto"), exports);
|
|
25
24
|
__exportStar(require("./preparedWithdrawalTypedDataDomain.dto"), exports);
|
|
26
25
|
__exportStar(require("./preparedWithdrawalTypedDataField.dto"), exports);
|
|
26
|
+
__exportStar(require("./rawPreparedWithdrawal.dto"), exports);
|
|
27
|
+
__exportStar(require("./rawSubmitWithdrawalSignedTx.dto"), exports);
|
|
27
28
|
__exportStar(require("./submitWithdrawal.dto"), exports);
|
|
28
|
-
__exportStar(require("./
|
|
29
|
+
__exportStar(require("./submitWithdrawalRawStep.dto"), exports);
|
|
29
30
|
__exportStar(require("./submitWithdrawalSignedTx.dto"), exports);
|
|
30
31
|
__exportStar(require("./updateWithdrawalConfig.dto"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,+DAA6C;AAC7C,4DAA0C;AAC1C,2DAAyC;AACzC,+DAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,+DAA6C;AAC7C,4DAA0C;AAC1C,2DAAyC;AACzC,+DAA6C;AAC7C,kEAAgD;AAChD,oEAAkD;AAClD,0EAAwD;AACxD,yEAAuD;AACvD,8DAA4C;AAC5C,oEAAkD;AAClD,yDAAuC;AACvC,gEAA8C;AAC9C,iEAA+C;AAC/C,+DAA6C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RawPreparedWithdrawalDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class RawPreparedWithdrawalDto {
|
|
15
|
+
}
|
|
16
|
+
exports.RawPreparedWithdrawalDto = RawPreparedWithdrawalDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], RawPreparedWithdrawalDto.prototype, "ownerAddress", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], RawPreparedWithdrawalDto.prototype, "recipient", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.Matches)(/^\d+$/),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], RawPreparedWithdrawalDto.prototype, "amount", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsMongoId)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], RawPreparedWithdrawalDto.prototype, "sourceCurrencyId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsMongoId)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], RawPreparedWithdrawalDto.prototype, "toCurrencyId", void 0);
|
|
39
|
+
//# sourceMappingURL=rawPreparedWithdrawal.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawPreparedWithdrawal.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAE3E,MAAa,wBAAwB;CAiBpC;AAjBD,4DAiBC;AAdC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2DACK;AAGlB;IADC,IAAA,yBAAO,EAAC,OAAO,CAAC;;wDACF;AAGf;IADC,IAAA,2BAAS,GAAE;;kEACa;AAGzB;IADC,IAAA,2BAAS,GAAE;;8DACS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const class_validator_1 = require("class-validator");
|
|
4
|
+
const class_transformer_1 = require("class-transformer");
|
|
5
|
+
const rawPreparedWithdrawal_dto_1 = require("./rawPreparedWithdrawal.dto");
|
|
6
|
+
const validPayload = {
|
|
7
|
+
ownerAddress: '0x1111111111111111111111111111111111111111',
|
|
8
|
+
recipient: '0x2222222222222222222222222222222222222222',
|
|
9
|
+
amount: '1000000',
|
|
10
|
+
sourceCurrencyId: '507f1f77bcf86cd799439011',
|
|
11
|
+
toCurrencyId: '507f1f77bcf86cd799439012',
|
|
12
|
+
};
|
|
13
|
+
describe('RawPreparedWithdrawalDto', () => {
|
|
14
|
+
it('accepts a well-formed raw prepare payload', async () => {
|
|
15
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawPreparedWithdrawal_dto_1.RawPreparedWithdrawalDto, validPayload);
|
|
16
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
17
|
+
expect(errors).toHaveLength(0);
|
|
18
|
+
});
|
|
19
|
+
it('rejects a non-integer amount', async () => {
|
|
20
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawPreparedWithdrawal_dto_1.RawPreparedWithdrawalDto, {
|
|
21
|
+
...validPayload,
|
|
22
|
+
amount: '1.5',
|
|
23
|
+
});
|
|
24
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
25
|
+
expect(errors.find((e) => e.property === 'amount')).toBeDefined();
|
|
26
|
+
});
|
|
27
|
+
it('rejects a sourceCurrencyId that is not a Mongo id', async () => {
|
|
28
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawPreparedWithdrawal_dto_1.RawPreparedWithdrawalDto, {
|
|
29
|
+
...validPayload,
|
|
30
|
+
sourceCurrencyId: 'not-an-id',
|
|
31
|
+
});
|
|
32
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
33
|
+
const error = errors.find((e) => e.property === 'sourceCurrencyId');
|
|
34
|
+
expect(error?.constraints?.isMongoId).toBeDefined();
|
|
35
|
+
});
|
|
36
|
+
it('rejects a missing ownerAddress', async () => {
|
|
37
|
+
const { ownerAddress: _omitted, ...rest } = validPayload;
|
|
38
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawPreparedWithdrawal_dto_1.RawPreparedWithdrawalDto, rest);
|
|
39
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
40
|
+
expect(errors.find((e) => e.property === 'ownerAddress')).toBeDefined();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=rawPreparedWithdrawal.dto.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawPreparedWithdrawal.dto.spec.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/rawPreparedWithdrawal.dto.spec.ts"],"names":[],"mappings":";;AAAA,qDAA2C;AAC3C,yDAAoD;AACpD,2EAAuE;AAEvE,MAAM,YAAY,GAAG;IACnB,YAAY,EAAE,4CAA4C;IAC1D,SAAS,EAAE,4CAA4C;IACvD,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,0BAA0B;IAC5C,YAAY,EAAE,0BAA0B;CACzC,CAAC;AAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,GAAG,GAAG,IAAA,mCAAe,EAAC,oDAAwB,EAAE,YAAY,CAAC,CAAC;QACpE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MAAM,MAAM,GAAG,MAAM,IAAA,0BAAQ,EAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SignedTransactionKind } from '../../broadcast/constants/SignedTransactionKind';
|
|
2
|
+
import { SubmitWithdrawalRawStepDto } from './submitWithdrawalRawStep.dto';
|
|
3
|
+
export declare class RawSubmitWithdrawalSignedTxDto {
|
|
4
|
+
kind: SignedTransactionKind.RAW;
|
|
5
|
+
steps: SubmitWithdrawalRawStepDto[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RawSubmitWithdrawalSignedTxDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const SignedTransactionKind_1 = require("../../broadcast/constants/SignedTransactionKind");
|
|
16
|
+
const submitWithdrawalRawStep_dto_1 = require("./submitWithdrawalRawStep.dto");
|
|
17
|
+
class RawSubmitWithdrawalSignedTxDto {
|
|
18
|
+
}
|
|
19
|
+
exports.RawSubmitWithdrawalSignedTxDto = RawSubmitWithdrawalSignedTxDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.Equals)(SignedTransactionKind_1.SignedTransactionKind.RAW),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], RawSubmitWithdrawalSignedTxDto.prototype, "kind", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsArray)(),
|
|
26
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
27
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
28
|
+
(0, class_transformer_1.Type)(() => submitWithdrawalRawStep_dto_1.SubmitWithdrawalRawStepDto),
|
|
29
|
+
__metadata("design:type", Array)
|
|
30
|
+
], RawSubmitWithdrawalSignedTxDto.prototype, "steps", void 0);
|
|
31
|
+
//# sourceMappingURL=rawSubmitWithdrawalSignedTx.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawSubmitWithdrawalSignedTx.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAgF;AAChF,2FAAwF;AACxF,+EAA2E;AAE3E,MAAa,8BAA8B;CAS1C;AATD,wEASC;AAPC;IADC,IAAA,wBAAM,EAAC,6CAAqB,CAAC,GAAG,CAAC;;4DACF;AAMhC;IAJC,IAAA,yBAAO,GAAE;IACT,IAAA,8BAAY,EAAC,CAAC,CAAC;IACf,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,wDAA0B,CAAC;;6DACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("reflect-metadata");
|
|
4
|
+
const class_validator_1 = require("class-validator");
|
|
5
|
+
const class_transformer_1 = require("class-transformer");
|
|
6
|
+
const SignedTransactionKind_1 = require("../../broadcast/constants/SignedTransactionKind");
|
|
7
|
+
const rawSubmitWithdrawalSignedTx_dto_1 = require("./rawSubmitWithdrawalSignedTx.dto");
|
|
8
|
+
const validPayload = {
|
|
9
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.RAW,
|
|
10
|
+
steps: [
|
|
11
|
+
{ order: 0, signedTx: '0xapprove' },
|
|
12
|
+
{ order: 1, signedTx: '0xswap' },
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
describe('RawSubmitWithdrawalSignedTxDto', () => {
|
|
16
|
+
it('accepts a well-formed multi-step raw signedTx', async () => {
|
|
17
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, validPayload);
|
|
18
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
19
|
+
expect(errors).toHaveLength(0);
|
|
20
|
+
});
|
|
21
|
+
it('accepts a single-step payload (native / no-approval source)', async () => {
|
|
22
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
23
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.RAW,
|
|
24
|
+
steps: [{ order: 0, signedTx: 'AQwABase64Tx' }],
|
|
25
|
+
});
|
|
26
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
27
|
+
expect(errors).toHaveLength(0);
|
|
28
|
+
});
|
|
29
|
+
it('rejects a non-raw kind discriminator', async () => {
|
|
30
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
31
|
+
...validPayload,
|
|
32
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.POLYMARKET_WALLET,
|
|
33
|
+
});
|
|
34
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
35
|
+
expect(errors.find((e) => e.property === 'kind')).toBeDefined();
|
|
36
|
+
});
|
|
37
|
+
it('rejects an empty steps array', async () => {
|
|
38
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
39
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.RAW,
|
|
40
|
+
steps: [],
|
|
41
|
+
});
|
|
42
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
43
|
+
expect(errors.find((e) => e.property === 'steps')).toBeDefined();
|
|
44
|
+
});
|
|
45
|
+
it('rejects a step with a negative order', async () => {
|
|
46
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
47
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.RAW,
|
|
48
|
+
steps: [{ order: -1, signedTx: '0xswap' }],
|
|
49
|
+
});
|
|
50
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
51
|
+
expect(errors.find((e) => e.property === 'steps')).toBeDefined();
|
|
52
|
+
});
|
|
53
|
+
it('rejects a missing kind discriminator', async () => {
|
|
54
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
55
|
+
steps: [{ order: 0, signedTx: '0xswap' }],
|
|
56
|
+
});
|
|
57
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
58
|
+
expect(errors.find((e) => e.property === 'kind')).toBeDefined();
|
|
59
|
+
});
|
|
60
|
+
it('rejects a missing steps field', async () => {
|
|
61
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
62
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.RAW,
|
|
63
|
+
});
|
|
64
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
65
|
+
expect(errors.find((e) => e.property === 'steps')).toBeDefined();
|
|
66
|
+
});
|
|
67
|
+
it('rejects a step with a missing order', async () => {
|
|
68
|
+
const dto = (0, class_transformer_1.plainToInstance)(rawSubmitWithdrawalSignedTx_dto_1.RawSubmitWithdrawalSignedTxDto, {
|
|
69
|
+
kind: SignedTransactionKind_1.SignedTransactionKind.RAW,
|
|
70
|
+
steps: [{ signedTx: '0xswap' }],
|
|
71
|
+
});
|
|
72
|
+
const errors = await (0, class_validator_1.validate)(dto);
|
|
73
|
+
expect(errors.find((e) => e.property === 'steps')).toBeDefined();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=rawSubmitWithdrawalSignedTx.dto.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawSubmitWithdrawalSignedTx.dto.spec.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/rawSubmitWithdrawalSignedTx.dto.spec.ts"],"names":[],"mappings":";;AAAA,4BAA0B;AAC1B,qDAA2C;AAC3C,yDAAoD;AACpD,2FAAwF;AACxF,uFAAmF;AAEnF,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,6CAAqB,CAAC,GAAG;IAC/B,KAAK,EAAE;QACL,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE;QACnC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE;KACjC;CACF,CAAC;AAEF,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,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EAAE;QAC7C,MAAM,GAAG,GAAG,IAAA,mCAAe,EAAC,gEAA8B,EAAE;YAC1D,IAAI,EAAE,6CAAqB,CAAC,GAAG;SAChC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAQ,EAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,GAAG,GAAG,IAAA,mCAAe,EAAC,gEAA8B,EAAE;YAC1D,IAAI,EAAE,6CAAqB,CAAC,GAAG;YAC/B,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;SAChC,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAQ,EAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SubmitWithdrawalRawStepDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class SubmitWithdrawalRawStepDto {
|
|
15
|
+
}
|
|
16
|
+
exports.SubmitWithdrawalRawStepDto = SubmitWithdrawalRawStepDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsInt)(),
|
|
19
|
+
(0, class_validator_1.Min)(0),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], SubmitWithdrawalRawStepDto.prototype, "order", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], SubmitWithdrawalRawStepDto.prototype, "signedTx", void 0);
|
|
27
|
+
//# sourceMappingURL=submitWithdrawalRawStep.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitWithdrawalRawStep.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/submitWithdrawalRawStep.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmE;AAEnE,MAAa,0BAA0B;CAQtC;AARD,gEAQC;AALC;IAFC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;yDACO;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4DACI"}
|
|
@@ -11,14 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SubmitWithdrawalSignedTxDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
|
-
const SignedTransactionKind_1 = require("../../broadcast/constants/SignedTransactionKind");
|
|
15
14
|
class SubmitWithdrawalSignedTxDto {
|
|
16
15
|
}
|
|
17
16
|
exports.SubmitWithdrawalSignedTxDto = SubmitWithdrawalSignedTxDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsEnum)(SignedTransactionKind_1.SignedTransactionKind),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], SubmitWithdrawalSignedTxDto.prototype, "kind", void 0);
|
|
22
17
|
__decorate([
|
|
23
18
|
(0, class_validator_1.IsString)(),
|
|
24
19
|
(0, class_validator_1.Matches)(/^0x[0-9a-fA-F]{130}$/, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submitWithdrawalSignedTx.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/submitWithdrawalSignedTx.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"submitWithdrawalSignedTx.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/submitWithdrawalSignedTx.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AAEpD,MAAa,2BAA2B;CAOvC;AAPD,kEAOC;AADC;IALC,IAAA,0BAAQ,GAAE;IACV,IAAA,yBAAO,EAAC,sBAAsB,EAAE;QAC/B,OAAO,EACL,4EAA4E;KAC/E,CAAC;;8DACgB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity } from '../../entity';
|
|
2
|
+
import { PreparedTransaction } from '../dtos/preparedTransaction.dto';
|
|
3
|
+
import { PreparedWithdrawalSummaryDto } from '../dtos/preparedWithdrawalSummary.dto';
|
|
4
|
+
export declare class PreparedWithdrawalEntity extends Entity {
|
|
5
|
+
withdrawalDetailId: string;
|
|
6
|
+
token: string;
|
|
7
|
+
prepared: PreparedTransaction;
|
|
8
|
+
summary: PreparedWithdrawalSummaryDto;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreparedWithdrawalEntity = void 0;
|
|
4
|
+
const entity_1 = require("../../entity");
|
|
5
|
+
class PreparedWithdrawalEntity extends entity_1.Entity {
|
|
6
|
+
}
|
|
7
|
+
exports.PreparedWithdrawalEntity = PreparedWithdrawalEntity;
|
|
8
|
+
//# sourceMappingURL=PreparedWithdrawal.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreparedWithdrawal.entity.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/entities/PreparedWithdrawal.entity.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAItC,MAAa,wBAAyB,SAAQ,eAAM;CAQnD;AARD,4DAQC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Entity } from '../../entity';
|
|
1
2
|
import { BroadcastAck } from '../constants/BroadcastAck';
|
|
2
3
|
import { WithdrawalState } from '../constants/WithdrawalState';
|
|
3
|
-
export declare class
|
|
4
|
+
export declare class SubmitWithdrawalEntity extends Entity {
|
|
4
5
|
withdrawalDetailId: string;
|
|
5
6
|
txHash: string | null;
|
|
6
7
|
state: WithdrawalState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubmitWithdrawalEntity = void 0;
|
|
4
|
+
const entity_1 = require("../../entity");
|
|
5
|
+
class SubmitWithdrawalEntity extends entity_1.Entity {
|
|
6
|
+
}
|
|
7
|
+
exports.SubmitWithdrawalEntity = SubmitWithdrawalEntity;
|
|
8
|
+
//# sourceMappingURL=SubmitWithdrawal.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitWithdrawal.entity.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/entities/SubmitWithdrawal.entity.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAItC,MAAa,sBAAuB,SAAQ,eAAM;CAsBjD;AAtBD,wDAsBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WithdrawalBalancesResponse = void 0;
|
|
4
|
+
class WithdrawalBalancesResponse {
|
|
5
|
+
}
|
|
6
|
+
exports.WithdrawalBalancesResponse = WithdrawalBalancesResponse;
|
|
7
|
+
//# sourceMappingURL=WithdrawalBalancesResponse.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalBalancesResponse.entity.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/entities/WithdrawalBalancesResponse.entity.ts"],"names":[],"mappings":";;;AAMA,MAAa,0BAA0B;CAEtC;AAFD,gEAEC"}
|