@fintech-solutions/core
Advanced tools
Comparing version 1.2.65 to 1.2.67
@@ -7,11 +7,16 @@ export declare enum BaseCryptoShortcode { | ||
BitcoinCash = "BCH", | ||
BitcoinCashTest = "BCH_TEST", | ||
Litecoin = "LTC", | ||
LitecoinTest = "LTC_TEST", | ||
Dash = "DASH", | ||
Cardano = "ADA", | ||
CardanoTest = "ADA_TEST", | ||
Eos = "EOS", | ||
Doge = "DOGE", | ||
Solana = "SOL", | ||
SolanaTest = "SOL_TEST", | ||
Tron = "TRX", | ||
Lumen = "XLM", | ||
PolygonMatic = "MATIC", | ||
PolygonMaticTest = "MATIC_TEST", | ||
Ripple = "XRP", | ||
@@ -18,0 +23,0 @@ Tezos = "XTZ", |
@@ -11,11 +11,16 @@ "use strict"; | ||
BaseCryptoShortcode["BitcoinCash"] = "BCH"; | ||
BaseCryptoShortcode["BitcoinCashTest"] = "BCH_TEST"; | ||
BaseCryptoShortcode["Litecoin"] = "LTC"; | ||
BaseCryptoShortcode["LitecoinTest"] = "LTC_TEST"; | ||
BaseCryptoShortcode["Dash"] = "DASH"; | ||
BaseCryptoShortcode["Cardano"] = "ADA"; | ||
BaseCryptoShortcode["CardanoTest"] = "ADA_TEST"; | ||
BaseCryptoShortcode["Eos"] = "EOS"; | ||
BaseCryptoShortcode["Doge"] = "DOGE"; | ||
BaseCryptoShortcode["Solana"] = "SOL"; | ||
BaseCryptoShortcode["SolanaTest"] = "SOL_TEST"; | ||
BaseCryptoShortcode["Tron"] = "TRX"; | ||
BaseCryptoShortcode["Lumen"] = "XLM"; | ||
BaseCryptoShortcode["PolygonMatic"] = "MATIC"; | ||
BaseCryptoShortcode["PolygonMaticTest"] = "MATIC_TEST"; | ||
BaseCryptoShortcode["Ripple"] = "XRP"; | ||
@@ -22,0 +27,0 @@ BaseCryptoShortcode["Tezos"] = "XTZ"; |
@@ -9,3 +9,3 @@ import { BaseCryptoShortcode } from './base-crypto-asset-shortcode.enum'; | ||
import { PolkadotAssetShortcode } from './polkadot-asset-shortcode.enum'; | ||
import { KusamaAssetShortcode } from "./kusama-asset-shortcode.enum"; | ||
import { KusamaAssetShortcode } from './kusama-asset-shortcode.enum'; | ||
export declare const CryptoShortCode: { | ||
@@ -19,8 +19,7 @@ BasiliskKsmToken: import("./kusama-asset-shortcode.enum").KusamaAssetMainnetShortcode.BasiliskKsmToken; | ||
KILTKsmTokenTest: import("./kusama-asset-shortcode.enum").KusamaAssetTestnetShortcode.KILTKsmTokenTest; | ||
AcalaDotToken: import("./polkadot-asset-shortcode.enum").PolkadotAssetMainnetShortcode.AcalaDotToken; | ||
AstarDotToken: import("./polkadot-asset-shortcode.enum").PolkadotAssetMainnetShortcode.AstarDotToken; | ||
CentrifugeDotToken: import("./polkadot-asset-shortcode.enum").PolkadotAssetMainnetShortcode.CentrifugeDotToken; | ||
InterlayDotToken: import("./polkadot-asset-shortcode.enum").PolkadotAssetMainnetShortcode.InterlayDotToken; | ||
NodleDotToken: import("./polkadot-asset-shortcode.enum").PolkadotAssetMainnetShortcode.NodleDotToken; | ||
AcalaDotTokenTest: import("./polkadot-asset-shortcode.enum").PolkadotAssetTestnetShortcode.AcalaDotTokenTest; | ||
AcalaDotToken: PolkadotAssetShortcode.AcalaDotToken; | ||
AstarDotToken: PolkadotAssetShortcode.AstarDotToken; | ||
CentrifugeDotToken: PolkadotAssetShortcode.CentrifugeDotToken; | ||
InterlayDotToken: PolkadotAssetShortcode.InterlayDotToken; | ||
NodleDotToken: PolkadotAssetShortcode.NodleDotToken; | ||
AstonMartinCognizantChzToken: import("./chiliz-asset-shortcode.enum").ChilizAssetMainnetShortcode.AstonMartinCognizantChzToken; | ||
@@ -308,11 +307,16 @@ FCBarcelonaChzToken: import("./chiliz-asset-shortcode.enum").ChilizAssetMainnetShortcode.FCBarcelonaChzToken; | ||
BitcoinCash: BaseCryptoShortcode.BitcoinCash; | ||
BitcoinCashTest: BaseCryptoShortcode.BitcoinCashTest; | ||
Litecoin: BaseCryptoShortcode.Litecoin; | ||
LitecoinTest: BaseCryptoShortcode.LitecoinTest; | ||
Dash: BaseCryptoShortcode.Dash; | ||
Cardano: BaseCryptoShortcode.Cardano; | ||
CardanoTest: BaseCryptoShortcode.CardanoTest; | ||
Eos: BaseCryptoShortcode.Eos; | ||
Doge: BaseCryptoShortcode.Doge; | ||
Solana: BaseCryptoShortcode.Solana; | ||
SolanaTest: BaseCryptoShortcode.SolanaTest; | ||
Tron: BaseCryptoShortcode.Tron; | ||
Lumen: BaseCryptoShortcode.Lumen; | ||
PolygonMatic: BaseCryptoShortcode.PolygonMatic; | ||
PolygonMaticTest: BaseCryptoShortcode.PolygonMaticTest; | ||
Ripple: BaseCryptoShortcode.Ripple; | ||
@@ -319,0 +323,0 @@ Tezos: BaseCryptoShortcode.Tezos; |
@@ -1,2 +0,2 @@ | ||
export declare enum PolkadotAssetMainnetShortcode { | ||
export declare enum PolkadotAssetShortcode { | ||
AcalaDotToken = "ACA_DOT", | ||
@@ -8,7 +8,2 @@ AstarDotToken = "ASTR_DOT", | ||
} | ||
export declare enum PolkadotAssetTestnetShortcode { | ||
AcalaDotTokenTest = "ACA_DOT_TEST" | ||
} | ||
export declare const PolkadotAssetShortcode: typeof PolkadotAssetMainnetShortcode & typeof PolkadotAssetTestnetShortcode; | ||
export type PolkadotAssetShortcode = PolkadotAssetMainnetShortcode | PolkadotAssetTestnetShortcode; | ||
export declare const POLKADOT_TOKENS: Set<PolkadotAssetMainnetShortcode | PolkadotAssetTestnetShortcode.AcalaDotTokenTest>; | ||
export declare const POLKADOT_TOKENS: Set<PolkadotAssetShortcode>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.POLKADOT_TOKENS = exports.PolkadotAssetShortcode = exports.PolkadotAssetTestnetShortcode = exports.PolkadotAssetMainnetShortcode = void 0; | ||
var PolkadotAssetMainnetShortcode; | ||
(function (PolkadotAssetMainnetShortcode) { | ||
PolkadotAssetMainnetShortcode["AcalaDotToken"] = "ACA_DOT"; | ||
PolkadotAssetMainnetShortcode["AstarDotToken"] = "ASTR_DOT"; | ||
PolkadotAssetMainnetShortcode["CentrifugeDotToken"] = "CFG_DOT"; | ||
PolkadotAssetMainnetShortcode["InterlayDotToken"] = "INTR_DOT"; | ||
PolkadotAssetMainnetShortcode["NodleDotToken"] = "NODL_DOT"; | ||
})(PolkadotAssetMainnetShortcode = exports.PolkadotAssetMainnetShortcode || (exports.PolkadotAssetMainnetShortcode = {})); | ||
var PolkadotAssetTestnetShortcode; | ||
(function (PolkadotAssetTestnetShortcode) { | ||
PolkadotAssetTestnetShortcode["AcalaDotTokenTest"] = "ACA_DOT_TEST"; | ||
})(PolkadotAssetTestnetShortcode = exports.PolkadotAssetTestnetShortcode || (exports.PolkadotAssetTestnetShortcode = {})); | ||
exports.PolkadotAssetShortcode = Object.assign({}, PolkadotAssetMainnetShortcode, PolkadotAssetTestnetShortcode); | ||
exports.POLKADOT_TOKENS = new Set(Object.values(exports.PolkadotAssetShortcode)); | ||
exports.POLKADOT_TOKENS = exports.PolkadotAssetShortcode = void 0; | ||
var PolkadotAssetShortcode; | ||
(function (PolkadotAssetShortcode) { | ||
PolkadotAssetShortcode["AcalaDotToken"] = "ACA_DOT"; | ||
PolkadotAssetShortcode["AstarDotToken"] = "ASTR_DOT"; | ||
PolkadotAssetShortcode["CentrifugeDotToken"] = "CFG_DOT"; | ||
PolkadotAssetShortcode["InterlayDotToken"] = "INTR_DOT"; | ||
PolkadotAssetShortcode["NodleDotToken"] = "NODL_DOT"; | ||
})(PolkadotAssetShortcode = exports.PolkadotAssetShortcode || (exports.PolkadotAssetShortcode = {})); | ||
exports.POLKADOT_TOKENS = new Set(Object.values(PolkadotAssetShortcode)); | ||
//# sourceMappingURL=polkadot-asset-shortcode.enum.js.map |
@@ -13,2 +13,3 @@ import { TransferPeer } from './transfer-peer.model'; | ||
SavingAccrual = "SAVING_ACCRUAL", | ||
SavingCreation = "SAVING_CREATION", | ||
Exchange = "EXCHANGE" | ||
@@ -15,0 +16,0 @@ } |
@@ -17,4 +17,5 @@ "use strict"; | ||
TransferType["SavingAccrual"] = "SAVING_ACCRUAL"; | ||
TransferType["SavingCreation"] = "SAVING_CREATION"; | ||
TransferType["Exchange"] = "EXCHANGE"; | ||
})(TransferType = exports.TransferType || (exports.TransferType = {})); | ||
//# sourceMappingURL=transfer.model.js.map |
@@ -5,2 +5,3 @@ import { TransferModel, TransferStatus, TransferType } from '../domain/transfer.model'; | ||
import { SuccessArrayResponse, SuccessObjectResponse } from '../interfaces/success-response.interface'; | ||
import { TransferPeerType } from '../domain/transfer-peer.model'; | ||
declare class TransferPeerResponse { | ||
@@ -12,3 +13,9 @@ asset: Asset; | ||
feeAsset: Asset; | ||
peerId: string | number; | ||
peerType: TransferPeerType; | ||
} | ||
declare enum TransferDirection { | ||
Incoming = "INCOMING", | ||
Outgoing = "OUTGOING" | ||
} | ||
export declare class TransferResponse { | ||
@@ -20,5 +27,7 @@ id: string | number; | ||
destination: TransferPeerResponse; | ||
direction: TransferDirection; | ||
metadata: any; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
constructor(transfer: TransferModel); | ||
constructor(transfer: TransferModel, metadata?: any); | ||
} | ||
@@ -25,0 +34,0 @@ export declare class TransferDetailsResponse implements SuccessObjectResponse<TransferResponse> { |
@@ -15,6 +15,12 @@ "use strict"; | ||
const transfer_model_1 = require("../domain/transfer.model"); | ||
const transfer_peer_model_1 = require("../domain/transfer-peer.model"); | ||
class TransferPeerResponse { | ||
} | ||
var TransferDirection; | ||
(function (TransferDirection) { | ||
TransferDirection["Incoming"] = "INCOMING"; | ||
TransferDirection["Outgoing"] = "OUTGOING"; | ||
})(TransferDirection || (TransferDirection = {})); | ||
class TransferResponse { | ||
constructor(transfer) { | ||
constructor(transfer, metadata) { | ||
this.id = transfer.id; | ||
@@ -29,2 +35,4 @@ this.type = transfer.type; | ||
feeAsset: transfer.source.feeAsset, | ||
peerId: transfer.source.peerId, | ||
peerType: transfer.source.peerType, | ||
}; | ||
@@ -37,5 +45,14 @@ this.destination = { | ||
feeAsset: transfer.destination.feeAsset, | ||
peerId: transfer.destination.peerId, | ||
peerType: transfer.destination.peerType, | ||
}; | ||
this.createdAt = transfer.createdAt; | ||
this.updatedAt = transfer.updatedAt; | ||
this.metadata = metadata !== null && metadata !== void 0 ? metadata : {}; | ||
if (transfer.source.peerType === transfer_peer_model_1.TransferPeerType.Wallet) { | ||
this.direction = TransferDirection.Outgoing; | ||
} | ||
else if (transfer.destination.peerType === transfer_peer_model_1.TransferPeerType.Wallet) { | ||
this.direction = TransferDirection.Incoming; | ||
} | ||
} | ||
@@ -82,2 +99,19 @@ } | ||
(0, swagger_1.ApiProperty)({ | ||
description: 'Transfer direction', | ||
example: TransferDirection.Incoming, | ||
enum: TransferDirection, | ||
}), | ||
__metadata("design:type", String) | ||
], TransferResponse.prototype, "direction", void 0); | ||
__decorate([ | ||
(0, swagger_1.ApiProperty)({ | ||
description: 'Transfer metadata', | ||
example: { | ||
txHash: '0x1234567890', | ||
}, | ||
}), | ||
__metadata("design:type", Object) | ||
], TransferResponse.prototype, "metadata", void 0); | ||
__decorate([ | ||
(0, swagger_1.ApiProperty)({ | ||
description: 'Transfer created at', | ||
@@ -110,3 +144,10 @@ example: new Date().toISOString(), | ||
__decorate([ | ||
(0, swagger_1.ApiProperty)({ type: Object, description: 'Paging object', example: { limit: 10, offset: 0, total: 100 } }), | ||
(0, swagger_1.ApiProperty)({ | ||
type: Object, | ||
description: 'Paging object', | ||
example: { | ||
next: '013904ed-a912-4573-beba-822059b2b9aa', | ||
prev: null, | ||
}, | ||
}), | ||
__metadata("design:type", Object) | ||
@@ -113,0 +154,0 @@ ], TransfersListResponse.prototype, "paging", void 0); |
import { SuccessArrayResponse, SuccessObjectResponse, SuccessResponse } from './interfaces/success-response.interface'; | ||
import { ErrorResponse } from './interfaces/error-response.interface'; | ||
import { QueryInterface } from './interfaces/query.interface'; | ||
import { QueryInterface, Order, ListQuery } from './interfaces/query.interface'; | ||
import { FindResult } from './interfaces/find-result.interface'; | ||
import { Paging } from './interfaces/paging.interface'; | ||
export { SuccessResponse, ErrorResponse, QueryInterface, FindResult, Paging, SuccessArrayResponse, SuccessObjectResponse, }; | ||
import { PagingQuery, CursorPagingQuery } from './interfaces/paging.query'; | ||
export { SuccessResponse, ListQuery, PagingQuery, CursorPagingQuery, ErrorResponse, QueryInterface, Order, FindResult, Paging, SuccessArrayResponse, SuccessObjectResponse, }; | ||
export type ResponseStruct<T> = Promise<SuccessResponse<T> | ErrorResponse>; | ||
@@ -26,2 +27,2 @@ export { UseCase } from './interfaces/usecase.interface'; | ||
export { PolkadotAssetShortcode, POLKADOT_TOKENS } from './domain/polkadot-asset-shortcode.enum'; | ||
export { KusamaAssetShortcode, KUSAMA_TOKENS, } from './domain/kusama-asset-shortcode.enum'; | ||
export { KusamaAssetShortcode, KUSAMA_TOKENS } from './domain/kusama-asset-shortcode.enum'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KUSAMA_TOKENS = exports.KusamaAssetShortcode = exports.POLKADOT_TOKENS = exports.PolkadotAssetShortcode = exports.CHILIZ_TOKENS = exports.ChilizAssetShortcode = exports.SOLANA_TOKENS = exports.SolanaAssetShortcode = exports.POLYGON_TOKENS = exports.PolygonAssetShortcode = exports.BINANCE_TOKENS = exports.BinanceAssetShortcode = exports.TRON_TOKENS = exports.TronAssetShortcode = exports.ETHEREUM_TOKENS = exports.EthereumAssetShortcode = exports.BASE_ASSETS = exports.BaseCryptoShortcode = exports.TransferType = exports.TransferStatus = exports.TransferPeerType = exports.AccountType = exports.DocumentType = exports.FiatShortCode = exports.CryptoAssetType = exports.CryptoShortCode = exports.VoidResponse = exports.TransferDetailsResponse = exports.TransfersListResponse = exports.TransferResponse = void 0; | ||
exports.KUSAMA_TOKENS = exports.KusamaAssetShortcode = exports.POLKADOT_TOKENS = exports.PolkadotAssetShortcode = exports.CHILIZ_TOKENS = exports.ChilizAssetShortcode = exports.SOLANA_TOKENS = exports.SolanaAssetShortcode = exports.POLYGON_TOKENS = exports.PolygonAssetShortcode = exports.BINANCE_TOKENS = exports.BinanceAssetShortcode = exports.TRON_TOKENS = exports.TronAssetShortcode = exports.ETHEREUM_TOKENS = exports.EthereumAssetShortcode = exports.BASE_ASSETS = exports.BaseCryptoShortcode = exports.TransferType = exports.TransferStatus = exports.TransferPeerType = exports.AccountType = exports.DocumentType = exports.FiatShortCode = exports.CryptoAssetType = exports.CryptoShortCode = exports.VoidResponse = exports.TransferDetailsResponse = exports.TransfersListResponse = exports.TransferResponse = exports.Order = void 0; | ||
const query_interface_1 = require("./interfaces/query.interface"); | ||
Object.defineProperty(exports, "Order", { enumerable: true, get: function () { return query_interface_1.Order; } }); | ||
var transfer_response_1 = require("./dtos/transfer.response"); | ||
@@ -5,0 +7,0 @@ Object.defineProperty(exports, "TransferResponse", { enumerable: true, get: function () { return transfer_response_1.TransferResponse; } }); |
@@ -0,4 +1,9 @@ | ||
import { PagingQuery, SimplePagingQuery } from './paging.query'; | ||
export interface ListQuery<Filter, Paging extends PagingQuery> { | ||
filter: Partial<Filter>; | ||
paging: Paging; | ||
} | ||
export interface QueryInterface<T> { | ||
filter?: Partial<T>; | ||
pagination?: Pagination; | ||
pagination?: SimplePagingQuery; | ||
orderBy?: OrderBy[]; | ||
@@ -8,6 +13,2 @@ select?: Array<keyof T>; | ||
} | ||
interface Pagination { | ||
page: number; | ||
perPage: number; | ||
} | ||
interface OrderBy { | ||
@@ -17,3 +18,3 @@ field: string; | ||
} | ||
declare enum Order { | ||
export declare enum Order { | ||
asc = "asc", | ||
@@ -20,0 +21,0 @@ desc = "desc" |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Order = void 0; | ||
var Order; | ||
@@ -7,3 +8,3 @@ (function (Order) { | ||
Order["desc"] = "desc"; | ||
})(Order || (Order = {})); | ||
})(Order = exports.Order || (exports.Order = {})); | ||
//# sourceMappingURL=query.interface.js.map |
{ | ||
"name": "@fintech-solutions/core", | ||
"private": false, | ||
"version": "1.2.65", | ||
"version": "1.2.67", | ||
"description": "", | ||
@@ -17,3 +17,3 @@ "main": "dist/index.js", | ||
"license": "ISC", | ||
"gitHead": "a8db00c08b76d01d378c449203dbbdfdb1a11056" | ||
"gitHead": "1062204439b623a2a2994e6ab192418c73f990c4" | ||
} |
@@ -7,11 +7,16 @@ export enum BaseCryptoShortcode { | ||
BitcoinCash = 'BCH', | ||
BitcoinCashTest = 'BCH_TEST', | ||
Litecoin = 'LTC', | ||
LitecoinTest = 'LTC_TEST', | ||
Dash = 'DASH', | ||
Cardano = 'ADA', | ||
CardanoTest = 'ADA_TEST', | ||
Eos = 'EOS', | ||
Doge = 'DOGE', | ||
Solana = 'SOL', | ||
SolanaTest = 'SOL_TEST', | ||
Tron = 'TRX', | ||
Lumen = 'XLM', | ||
PolygonMatic = 'MATIC', | ||
PolygonMaticTest = 'MATIC_TEST', | ||
Ripple = 'XRP', | ||
@@ -23,3 +28,3 @@ Tezos = 'XTZ', | ||
PolkadotTest = 'DOT_TEST', | ||
Kusama = "KSM", | ||
Kusama = 'KSM', | ||
BNB = 'BNB', | ||
@@ -26,0 +31,0 @@ Celo = 'CELO', |
@@ -9,3 +9,3 @@ import { BaseCryptoShortcode } from './base-crypto-asset-shortcode.enum'; | ||
import { PolkadotAssetShortcode } from './polkadot-asset-shortcode.enum'; | ||
import { KusamaAssetShortcode } from "./kusama-asset-shortcode.enum"; | ||
import { KusamaAssetShortcode } from './kusama-asset-shortcode.enum'; | ||
@@ -12,0 +12,0 @@ export const CryptoShortCode = { |
@@ -17,2 +17,2 @@ export enum KusamaAssetMainnetShortcode { | ||
export const KUSAMA_TOKENS = new Set(Object.values(KusamaAssetShortcode)); | ||
export const KUSAMA_TOKENS = new Set(Object.values(KusamaAssetShortcode)); |
@@ -1,2 +0,2 @@ | ||
export enum PolkadotAssetMainnetShortcode { | ||
export enum PolkadotAssetShortcode { | ||
AcalaDotToken = 'ACA_DOT', | ||
@@ -9,9 +9,2 @@ AstarDotToken = 'ASTR_DOT', | ||
export enum PolkadotAssetTestnetShortcode { | ||
AcalaDotTokenTest = 'ACA_DOT_TEST', | ||
} | ||
export const PolkadotAssetShortcode = Object.assign({}, PolkadotAssetMainnetShortcode, PolkadotAssetTestnetShortcode); | ||
export type PolkadotAssetShortcode = PolkadotAssetMainnetShortcode | PolkadotAssetTestnetShortcode; | ||
export const POLKADOT_TOKENS = new Set(Object.values(PolkadotAssetShortcode)); |
@@ -15,2 +15,3 @@ import { TransferPeer } from './transfer-peer.model'; | ||
SavingAccrual = 'SAVING_ACCRUAL', | ||
SavingCreation = 'SAVING_CREATION', | ||
Exchange = 'EXCHANGE', | ||
@@ -17,0 +18,0 @@ } |
@@ -6,2 +6,3 @@ import { ApiProperty } from '@nestjs/swagger'; | ||
import { SuccessArrayResponse, SuccessObjectResponse } from '../interfaces/success-response.interface'; | ||
import { TransferPeerType } from '../domain/transfer-peer.model'; | ||
@@ -14,4 +15,11 @@ class TransferPeerResponse { | ||
feeAsset: Asset; | ||
peerId: string | number; | ||
peerType: TransferPeerType; | ||
} | ||
enum TransferDirection { | ||
Incoming = 'INCOMING', | ||
Outgoing = 'OUTGOING', | ||
} | ||
export class TransferResponse { | ||
@@ -51,2 +59,17 @@ @ApiProperty({ | ||
@ApiProperty({ | ||
description: 'Transfer direction', | ||
example: TransferDirection.Incoming, | ||
enum: TransferDirection, | ||
}) | ||
direction: TransferDirection; | ||
@ApiProperty({ | ||
description: 'Transfer metadata', | ||
example: { | ||
txHash: '0x1234567890', | ||
}, | ||
}) | ||
metadata: any; | ||
@ApiProperty({ | ||
description: 'Transfer created at', | ||
@@ -63,3 +86,3 @@ example: new Date().toISOString(), | ||
constructor(transfer: TransferModel) { | ||
constructor(transfer: TransferModel, metadata?: any) { | ||
this.id = transfer.id; | ||
@@ -74,2 +97,4 @@ this.type = transfer.type; | ||
feeAsset: transfer.source.feeAsset, | ||
peerId: transfer.source.peerId, | ||
peerType: transfer.source.peerType, | ||
}; | ||
@@ -82,5 +107,14 @@ this.destination = { | ||
feeAsset: transfer.destination.feeAsset, | ||
peerId: transfer.destination.peerId, | ||
peerType: transfer.destination.peerType, | ||
}; | ||
this.createdAt = transfer.createdAt; | ||
this.updatedAt = transfer.updatedAt; | ||
this.metadata = metadata ?? {}; | ||
if (transfer.source.peerType === TransferPeerType.Wallet) { | ||
this.direction = TransferDirection.Outgoing; | ||
} else if (transfer.destination.peerType === TransferPeerType.Wallet) { | ||
this.direction = TransferDirection.Incoming; | ||
} | ||
} | ||
@@ -98,4 +132,11 @@ } | ||
@ApiProperty({ type: Object, description: 'Paging object', example: { limit: 10, offset: 0, total: 100 } }) | ||
@ApiProperty({ | ||
type: Object, | ||
description: 'Paging object', | ||
example: { | ||
next: '013904ed-a912-4573-beba-822059b2b9aa', | ||
prev: null, | ||
}, | ||
}) | ||
paging?: Paging; | ||
} |
import { SuccessArrayResponse, SuccessObjectResponse, SuccessResponse } from './interfaces/success-response.interface'; | ||
import { ErrorResponse } from './interfaces/error-response.interface'; | ||
import { QueryInterface } from './interfaces/query.interface'; | ||
import { QueryInterface, Order, ListQuery } from './interfaces/query.interface'; | ||
import { FindResult } from './interfaces/find-result.interface'; | ||
import { Paging } from './interfaces/paging.interface'; | ||
import { PagingQuery, CursorPagingQuery } from './interfaces/paging.query'; | ||
export { | ||
SuccessResponse, | ||
ListQuery, | ||
PagingQuery, | ||
CursorPagingQuery, | ||
ErrorResponse, | ||
QueryInterface, | ||
Order, | ||
FindResult, | ||
@@ -36,5 +41,2 @@ Paging, | ||
export { PolkadotAssetShortcode, POLKADOT_TOKENS } from './domain/polkadot-asset-shortcode.enum'; | ||
export { | ||
KusamaAssetShortcode, | ||
KUSAMA_TOKENS, | ||
} from './domain/kusama-asset-shortcode.enum'; | ||
export { KusamaAssetShortcode, KUSAMA_TOKENS } from './domain/kusama-asset-shortcode.enum'; |
@@ -0,4 +1,14 @@ | ||
import { PagingQuery, SimplePagingQuery } from './paging.query'; | ||
export interface ListQuery<Filter, Paging extends PagingQuery> { | ||
filter: Partial<Filter>; | ||
paging: Paging; | ||
} | ||
/** @deprecated | ||
* Use and enhance `ListQuery` instead | ||
*/ | ||
export interface QueryInterface<T> { | ||
filter?: Partial<T>; | ||
pagination?: Pagination; | ||
pagination?: SimplePagingQuery; | ||
orderBy?: OrderBy[]; | ||
@@ -9,7 +19,2 @@ select?: Array<keyof T>; | ||
interface Pagination { | ||
page: number; | ||
perPage: number; | ||
} | ||
interface OrderBy { | ||
@@ -20,3 +25,3 @@ field: string; | ||
enum Order { | ||
export enum Order { | ||
asc = 'asc', | ||
@@ -23,0 +28,0 @@ desc = 'desc', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
276610
119
2546