diff --git a/src/Nexus.Crypto.SDK/INexusAPIService.cs b/src/Nexus.Crypto.SDK/INexusAPIService.cs index a6a9fbf..22f1379 100644 --- a/src/Nexus.Crypto.SDK/INexusAPIService.cs +++ b/src/Nexus.Crypto.SDK/INexusAPIService.cs @@ -1,4 +1,5 @@ using Nexus.Crypto.SDK.Models; +using Nexus.Crypto.SDK.Models.Account; using Nexus.Crypto.SDK.Models.Broker; using Nexus.Crypto.SDK.Models.Custodian; using Nexus.Crypto.SDK.Models.PriceChartModel; @@ -12,39 +13,187 @@ public interface INexusAPIService IDocumentStoreService DocumentStore { get; } ICustomerService Customer { get; } ICustomerPersonService CustomerPerson { get; } + + // Label partner Task> GetLabelPartner(); + Task> GetLabelPartnerConfig(); + Task>> GetLabelPartnerCryptoCurrencies(GetLabelPartnerCryptoCurrenciesRequest? request = null); + Task>> GetLabelPartnerCountries(GetLabelPartnerCountriesRequest? request = null); + + // Currencies Task> GetCurrencies(); + + // Prices Task> GetPrices(string currency); + Task> GetHistoricPrices(string currency, string crypto, GetPriceDataRequest? request = null); + + // Reserves Task> GetReserves(string reservesTimeStamp); + + // Balances Task> GetCustodianBalances(); Task> GetBrokerBalances(); + Task>> GetHotWalletBalances(GetHotWalletBalancesRequest? request = null); Task>> GetBalanceMutations(Dictionary queryParams); - Task>> GetMails(Dictionary queryParams); - Task>> GetTransfers(GetTransfersRequest? request = null); - Task>> GetOrders(GetOrdersRequest? request = null); - Task> GetMinutePrices(int timeSpan, string currencyCode, string cryptoCode); + // Accounts + Task>> GetAccounts(GetAccountsRequest? request = null); + Task> GetAccount(string accountCode); + Task> CreateAccount(string customerCode, CreateAccountRequest request); + Task> UpdateAccount(string accountCode, UpdateAccountRequest request); + Task> CreateNonNativeAccount(string accountCode, CreateNonNativeAccountRequest request); + Task>> GetAccountBalances(string accountCode); - Task>> GetCallbacks(string transactionCode); + // Buckets + Task>> GetBuckets(GetBucketsRequest? request = null); + Task> GetBucket(string bucketCode); + Task> CreateBucket(CreateBucketRequest request); + Task> UpdateBucket(string bucketCode, UpdateBucketRequest request); + Task DeleteBucket(string bucketCode); + // Portfolios Task>> GetPortfolios(); + Task> CreatePortfolio(CreatePortfolioRequest request); + Task> UpdatePortfolio(string portfolioCode, UpdatePortfolioRequest request); + // Trust levels Task>> GetTrustLevels(); + + // Payment methods + Task>> GetPaymentMethods(GetPaymentMethodsRequest? request = null); + Task> GetPaymentMethod(string paymentMethodCode); + Task>> GetPaymentMethodCustomerFees(string paymentMethodCode, GetPaymentMethodCustomerFeesRequest? request = null); + Task> UpsertPaymentMethodCustomerFee(string paymentMethodCode, UpsertPaymentMethodCustomerFeeRequest request); + Task DeletePaymentMethodCustomerFee(string paymentMethodCode, string customerCode); + Task>> GetPaymentMethodTagFees(string paymentMethodCode); + Task> UpsertPaymentMethodTagFee(string paymentMethodCode, UpsertPaymentMethodTagFeeRequest request); + Task DeletePaymentMethodTagFee(string paymentMethodCode, string customerTag); + + // Crypto addresses + Task>> GetCryptoAddresses(GetCryptoAddressesRequest? request = null); + + // Exchanges & trade pairs + Task>> GetExchanges(GetExchangesRequest? request = null); + Task>> GetTradePairs(GetTradePairsRequest? request = null); + + // Transfers + Task>> GetTransfers(GetTransfersRequest? request = null); + Task> CreateTransfer(CreateTransferRequest request); + + // Orders + Task>> GetOrders(GetOrdersRequest? request = null); + Task> CreateOrder(CreateOrderRequest request); + Task DeleteOrder(string orderCode); + + // Mails + Task>> GetMails(Dictionary queryParams); + Task> GetMail(string mailCode); + Task> CreateMail(PostMailRequest request); + Task> UpdateMail(string mailCode, PutMailRequest request); + + // Notifications + Task>> GetNotifications(GetNotificationsRequest? request = null); + Task CreateNotification(CreateNotificationRequest request); + + // Callbacks + Task>> GetCallbacks(string transactionCode); + + // Bank accounts Task>> GetCustomerBankAccounts(string customerCode, Dictionary queryParams); + Task> GetCustomerBankAccount(string customerCode, Guid bankAccountId); Task> CreateCustomerBankAccount(string customerCode, CreateBankAccountRequestModel request); Task DeleteCustomerBankAccount(string customerCode, Guid bankAccountId); Task> UpdateCustomerBankAccount(string customerCode, Guid bankAccountId, UpdateBankAccountRequest request); + + // Banks + Task>> GetBanks(GetBanksRequest? request = null); + Task> GetBank(Guid bankId); + Task> CreateBank(CreateBankRequest request); + Task> UpdateBank(Guid bankId, UpdateBankRequest request); + Task DeleteBank(Guid bankId); + + // Chart prices + Task> GetMinutePrices(int timeSpan, string currencyCode, string cryptoCode); + + // Customer limits + Task> GetCustomerBuyLimit(GetCustomerLimitRequest request); + Task> GetCustomerSellLimit(GetCustomerLimitRequest request); + + // Customer comments + Task>> GetCustomerComments(string customerCode); + Task> AddCustomerComment(string customerCode, AddCommentRequest request); + Task> UpdateCustomerComment(string customerCode, Guid commentId, UpdateCommentRequest request); + Task DeleteCustomerComment(string customerCode, Guid commentId); + Task>> GetCustomerCommentHistory(string customerCode, Guid commentId); + + // Customer compliance history + Task>> GetCustomerComplianceHistory(string customerCode, GetCustomerComplianceHistoryRequest? request = null); + + // Customer tags + Task>> GetCustomerTags(string customerCode); + Task> AddCustomerTag(string customerCode, CreateCustomerTagRequest request); + Task DeleteCustomerTag(string customerCode, string tag); + + // Customer data + Task>> GetCustomerData(string customerCode); + Task>> UpsertCustomerData(string customerCode, UpsertCustomerDataRequest request); + Task DeleteCustomerDataKey(string customerCode, string key); } public interface INexusBrokerAPIService : INexusAPIService { + // Broker transactions Task> GetBrokerTransaction(string txCode); Task>> GetBrokerTransactions(Dictionary queryParams); Task>> GetBrokerTransactionTotals(Dictionary queryParams); + Task> UpdateBrokerTransaction(string txCode, UpdateBrokerTransactionRequest request); + Task> ExecuteTransaction(ExecuteTransactionRequest request); + Task> GetTransactionFlow(string txCode); + Task>> GetTransactionData(string txCode); + Task> PostTransactionData(string txCode, string key, PostTransactionDataModel request); + + // Buy / Sell + Task> Buy(BuyRequest request); + Task> SimulateBuy(BuySimulateRequest request); + Task> Sell(SellRequest request); + Task> SimulateSell(SellSimulateRequest request); + + // Merchant + Task>> GetMerchantTransactions(GetMerchantTransactionsRequest? request = null); + Task> GetMerchantTransaction(string txCode); + Task> CreateMerchantTransaction(CreateMerchantTransactionRequest request); + Task> UpdateMerchantTransaction(string txCode, UpdateMerchantTransactionRequest request); + Task> SimulateMerchantTransaction(CreateMerchantTransactionRequest request); } public interface INexusCustodianAPIService : INexusAPIService { + // Custodian transactions Task> GetCustodianTransaction(string txCode); + Task>> GetCustodianTransactions(GetCustodianTransactionsRequest? request = null); Task> CancelCustodianTransaction(string txCode); -} \ No newline at end of file + + // Custodian transaction types + Task> CustodianBuy(CustodianBuyRequest request); + Task> CustodianSell(CustodianSellRequest request); + Task> CustodianGift(CustodianGiftRequest request); + Task> CustodianClawback(CustodianClawbackRequest request); + Task> CustodianSendInternal(CustodianSendInternalRequest request); + Task> CustodianSendOut(CustodianSendOutRequest request); + Task> CustodianSendToBucket(CustodianSendToBucketRequest request); + Task> CustodianSwap(CustodianSwapRequest request); + Task> SimulateCustodianSwap(CustodianSwapSimulateRequest request); + Task> CustodianPaymentRequest(CustodianPaymentRequest request); + + // Custodian callbacks + Task>> GetCustodianCallbacks(string txCode); + + // Interest schedules + Task>> GetInterestSchedules(GetSchedulesRequest? request = null); + Task> GetInterestSchedule(Guid scheduleId); + Task> CreateInterestSchedule(CreateCustodianScheduleRequest request); + Task> UpdateInterestSchedule(Guid scheduleId, EditCustodianScheduleRequest request); + Task DeleteInterestSchedule(Guid scheduleId); + Task> GetInterestScheduleInterval(Guid scheduleId, GetScheduleIntervalsRequest? request = null); + Task> UpdateInterestScheduleSubInterval(Guid scheduleId, Guid intervalId, Guid subIntervalId, EditCustodianSubIntervalRequest request); +} diff --git a/src/Nexus.Crypto.SDK/Models/Account/AccountModels.cs b/src/Nexus.Crypto.SDK/Models/Account/AccountModels.cs new file mode 100644 index 0000000..9c89764 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Account/AccountModels.cs @@ -0,0 +1,187 @@ +namespace Nexus.Crypto.SDK.Models.Account; + +public class GetAccountResponse +{ + /// + /// GUID to use in case AccountCode is missing. + /// + public string? Guid { get; set; } + + /// + /// Unique identifier of the Account. + /// + public string? AccountCode { get; set; } + + /// + /// Customer unique identifier. + /// + public string? CustomerCode { get; set; } + + /// + /// Timestamp of creation of the Account + /// + public string? Created { get; set; } + + /// + /// Timestamp of activation of the Account + /// + public string? Activated { get; set; } + + /// + /// Address in Nexus to receive cryptocurrency. + /// + public string? DcReceiveAddress { get; set; } + + /// + /// Address of the Customer to send cryptocurrency, or user supplied address to send and receive Tokens. + /// + public string? CustomerCryptoAddress { get; set; } + + /// + /// Cryptocurrency identifier. + /// + public string? DcCode { get; set; } + + /// + /// Status of the account: New | Invalid | Valid | Active | Deleted + /// + public string? AccountStatus { get; set; } + + /// + /// Type of the account: Custodian | Broker | Token + /// + public string? AccountType { get; set; } + + /// + /// The bucket this account is connected to. + /// + public string? BucketCode { get; set; } + + /// + /// Wallet service provider information. + /// + public AccountProvider? Provider { get; set; } +} + +public class AccountProvider +{ + /// + /// Provider type: Undefined | CustodianSeparateAddress | CustodianOmnibus | SelfHosted + /// + public string? Type { get; set; } + + /// + /// Name of the custodian or wallet app provider. + /// + public string? Name { get; set; } +} + +public class CreateAccountRequest +{ + /// + /// Type of the new account: Broker | BrokerBuyOnly | Custodian + /// + public string? AccountType { get; set; } + + /// + /// Crypto address of the new account. + /// + public string? CustomerCryptoAddress { get; set; } + + /// + /// Optional code in case the cryptocurrency cannot be automatically determined. + /// + public string? DcCode { get; set; } + + /// + /// Cryptocurrency code of the account. + /// + public string? CryptoCode { get; set; } + + /// + /// Optional account code used only for the creation of non-native accounts. + /// + public string? NativeAccountCode { get; set; } + + /// + /// IP of the customer (deprecated; use customer_ip_address header instead). + /// + public string? Ip { get; set; } + + /// + /// Connect this account to a bucket. + /// + public string? BucketCode { get; set; } + + /// + /// Settings required for creating a custodian based account. + /// + public CustodianSettingsRequest? CustodianSettings { get; set; } + + /// + /// Wallet service provider information. + /// + public AccountProvider? Provider { get; set; } +} + +public class CustodianSettingsRequest +{ + /// + /// If true, Nexus will generate a receive address for this account. + /// + public bool GenerateReceiveAddress { get; set; } + + public bool GenerateUniqueReceiveAddress { get; set; } +} + +public class CreateAccountResponse +{ + public string? Guid { get; set; } + public string? AccountCode { get; set; } + public string? CustomerCode { get; set; } + public string? Created { get; set; } + public string? Activated { get; set; } + public string? DcReceiveAddress { get; set; } + public string? CustomerCryptoAddress { get; set; } + public string? DcCode { get; set; } + public string? AccountStatus { get; set; } + public string? AccountType { get; set; } + public string? BucketCode { get; set; } + public AccountProvider? Provider { get; set; } +} + +public class UpdateAccountRequest +{ + /// + /// Wallet service provider information. + /// + public AccountProvider? Provider { get; set; } +} + +public class CreateNonNativeAccountRequest +{ + /// + /// This account will be used as native account. + /// + public string? AccountCode { get; set; } + + /// + /// Crypto address of the new account. + /// + public string? CustomerCryptoAddress { get; set; } + + /// + /// Cryptocurrency code of the account. + /// + public string? CryptoCode { get; set; } + + /// + /// Connect this account to a bucket. + /// + public string? BucketCode { get; set; } + + /// + /// Wallet service provider information. + /// + public AccountProvider? Provider { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Account/AccountQueryModels.cs b/src/Nexus.Crypto.SDK/Models/Account/AccountQueryModels.cs new file mode 100644 index 0000000..701f5ac --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Account/AccountQueryModels.cs @@ -0,0 +1,48 @@ +namespace Nexus.Crypto.SDK.Models.Account; + +/// +/// Response for a single crypto balance on a custodian account. +/// +public class GetAccountBalanceResponse +{ + /// + /// Crypto identifier. + /// + public string? CryptoCode { get; set; } + + public decimal Total { get; set; } + public decimal Available { get; set; } + public decimal Locked { get; set; } + public decimal Unconfirmed { get; set; } +} + +/// +/// Request filter for listing accounts. +/// +public class GetAccountsRequest +{ + public string? CustomerCode { get; set; } + public string? AccountCode { get; set; } + public string? AccountType { get; set; } + public string? AccountStatus { get; set; } + public string? CryptoCode { get; set; } + public string? BucketCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} + +/// +/// Request/response model for account data key-value pairs. +/// +public class AccountDataEntry +{ + public string? Key { get; set; } + public string? Value { get; set; } +} + +public class UpsertAccountDataRequest +{ + public required IDictionary Data { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Broker/BrokerRequestModels.cs b/src/Nexus.Crypto.SDK/Models/Broker/BrokerRequestModels.cs new file mode 100644 index 0000000..a7f8937 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Broker/BrokerRequestModels.cs @@ -0,0 +1,48 @@ +namespace Nexus.Crypto.SDK.Models.Broker; + +public class GetBrokerTransactionsRequest +{ + public string? TransactionCode { get; set; } + public string? CustomerCode { get; set; } + public string? AccountCode { get; set; } + public string? Status { get; set; } + + /// + /// Transaction type: BUY | SELL | MERCHANT + /// + public string? Type { get; set; } + + public string? CryptoCurrencyCode { get; set; } + public string? CurrencyCode { get; set; } + public string? PaymentMethodCode { get; set; } + public string? PortfolioCode { get; set; } + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } + public DateTime? FinishedFrom { get; set; } + public DateTime? FinishedTill { get; set; } + public decimal? AmountFrom { get; set; } + public decimal? AmountTo { get; set; } + public bool? IsSettled { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} + +public class GetBrokerTransactionTotalsRequest +{ + public string? CustomerCode { get; set; } + public string? Status { get; set; } + public string? Type { get; set; } + public string? CurrencyCode { get; set; } + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } +} + +/// +/// Request model for cancelling an order. +/// +public class CancelOrderRequest +{ + public required string OrderCode { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Broker/BuySellModels.cs b/src/Nexus.Crypto.SDK/Models/Broker/BuySellModels.cs new file mode 100644 index 0000000..7a84249 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Broker/BuySellModels.cs @@ -0,0 +1,197 @@ +namespace Nexus.Crypto.SDK.Models; + +public class BuyRequest +{ + /// + /// IP address field for tracking requests. + /// + public string? Ip { get; set; } + + /// + /// PaymentMethod to handle payment validation. + /// + public required string PaymentMethodCode { get; set; } + + /// + /// AccountCode to set the transaction initiator. + /// + public string? AccountCode { get; set; } + + /// + /// Amount in FIAT. + /// + public decimal Amount { get; set; } + + /// + /// ISO 4217 (three letter code). + /// + public string? Currency { get; set; } + + /// + /// Optional given price. + /// + public decimal? BuyPrice { get; set; } + + /// + /// Callback url, required to receive notifications on status updates. + /// + public string? CallbackUrl { get; set; } + + /// + /// Will auto create or use an existing Customer and Account. + /// + public BuyRequestAutoCreate? Customer { get; set; } + + /// + /// Message to be sent to the Blockchain (if the Blockchain allows messages). + /// + public string? BlockchainMessage { get; set; } +} + +public class BuyRequestAutoCreate +{ + /// + /// Create (when missing) or use a Customer with this CustomerCode. + /// + public string? CustomerCode { get; set; } + + /// + /// Specify the Crypto for the CustomerCryptoAddress. + /// + public string? CryptoCode { get; set; } + + /// + /// Add this Address to the Customer when missing. + /// + public string? CustomerCryptoAddress { get; set; } + + /// + /// In case of creating an account for the customer: Broker | BrokerBuyOnly + /// + public string? AccountType { get; set; } + + /// + /// The customer's status in case of creating a new customer. + /// + public string? Status { get; set; } + + /// + /// The customer's trust level in case of creating a new customer. + /// + public string? TrustLevel { get; set; } + + /// + /// The customer's portfolio code in case of creating a new customer. + /// + public string? PortfolioCode { get; set; } + + /// + /// The customer's currency in case of creating a new customer. + /// + public string? CurrencyCode { get; set; } + + /// + /// The customer's email in case of creating a new customer. + /// + public string? Email { get; set; } +} + +public class BuyResponse +{ + /// + /// Transaction unique identifier. + /// + public string? TransactionCode { get; set; } + + /// + /// Date and Time of creation. + /// + public string? Created { get; set; } + + public string? AccountCode { get; set; } + public string? CustomerCode { get; set; } + public decimal? NetworkFee { get; set; } + public decimal? ServiceFee { get; set; } + public decimal? BankFee { get; set; } + public string? Comment { get; set; } + + /// + /// Status of the transaction. + /// + public string? Status { get; set; } + + /// + /// Message sent as part of the transaction in the Blockchain. + /// + public string? BlockchainMessage { get; set; } +} + +public class BuySimulateRequest +{ + public required string AccountCode { get; set; } + public required string PaymentMethodCode { get; set; } + public required string Currency { get; set; } + public decimal Amount { get; set; } + public decimal? BuyPrice { get; set; } + public string? BlockchainMessage { get; set; } +} + +public class BuySimulateResponse +{ + public decimal CryptoBuyPriceBeforeFee { get; set; } + public decimal CryptoBuyPriceAfterServiceFee { get; set; } + public decimal CryptoAmount { get; set; } + public decimal CurrencyBankFee { get; set; } + public decimal CurrencyServiceFee { get; set; } + public decimal CurrencyNetworkFee { get; set; } + public decimal TotalCurrency { get; set; } + public decimal TotalCurrencyToPay { get; set; } + public string? CurrencyCode { get; set; } + public string? CryptoCode { get; set; } + public string? BlockchainMessage { get; set; } +} + +public class SellRequest +{ + public string? Ip { get; set; } + public required string AccountCode { get; set; } + public required string PaymentMethodCode { get; set; } + public decimal CryptoAmount { get; set; } + + /// + /// Optional given price. 5% increase / 10% reduction allowed. + /// + public decimal? SellPrice { get; set; } +} + +public class SellResponse +{ + public string? AccountCode { get; set; } + public string? TransactionCode { get; set; } + public string? CustomerCode { get; set; } + public string? CryptoAddress { get; set; } + public string? CurrencyCode { get; set; } + public decimal ValueInFiatBeforeFees { get; set; } + public decimal ValueInFiatAfterFees { get; set; } + public decimal NetworkFee { get; set; } + public decimal ServiceFee { get; set; } + public decimal BankFee { get; set; } +} + +public class SellSimulateRequest +{ + public string? Ip { get; set; } + public required string AccountCode { get; set; } + public required string PaymentMethodCode { get; set; } + public decimal CryptoAmount { get; set; } + public decimal? SellPrice { get; set; } +} + +public class SellSimulateResponse +{ + public decimal ValueInFiatBeforeFees { get; set; } + public decimal ValueInFiatAfterFees { get; set; } + public decimal BankFee { get; set; } + public decimal ServiceFee { get; set; } + public decimal NetworkFee { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Broker/MerchantModels.cs b/src/Nexus.Crypto.SDK/Models/Broker/MerchantModels.cs new file mode 100644 index 0000000..16172b8 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Broker/MerchantModels.cs @@ -0,0 +1,101 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetMerchantTransactionResponse +{ + /// + /// Status of merchant transaction. + /// + public string? Status { get; set; } + + /// + /// Unique identifier of merchant. + /// + public string? MerchantCustomerCode { get; set; } + + /// + /// Unique identifier of merchant transaction. + /// + public string? TransactionCode { get; set; } + + /// + /// Blockchain reference required for certain crypto. + /// + public string? BlockchainReference { get; set; } + + /// + /// Unique identifier of the fiat currency (ISO 4217). + /// + public string? CurrencyCode { get; set; } + + public decimal? CurrencyAmount { get; set; } + public decimal? FeeAmount { get; set; } + + /// + /// Unique identifier of the crypto. + /// + public string? CryptoCurrencyCode { get; set; } + + public string? PaymentReference { get; set; } + public decimal? ExpectedCryptoAmount { get; set; } + public decimal? ReceivedCryptoAmount { get; set; } + + /// + /// Created date of merchant transaction. + /// + public string? Created { get; set; } + + /// + /// Timestamp until merchant transaction is valid. + /// + public string? ValidUntil { get; set; } + + public string? MerchantCustomerEmailAddress { get; set; } + public string? ReceiveCryptoTxId { get; set; } + public string? CryptoPaymentAddress { get; set; } + public string? CryptoPaymentUri { get; set; } + public string? AccountCode { get; set; } + public string? Comment { get; set; } + public string? PaymentMethodCode { get; set; } +} + +public class CreateMerchantTransactionRequest +{ + public required string AccountCode { get; set; } + public required string MerchantCustomerCode { get; set; } + public required string PaymentMethodCode { get; set; } + + /// + /// Amount in merchant customer FIAT currency (only considered if crypto amount was not specified). + /// + public decimal? Amount { get; set; } + + public string? CryptoCode { get; set; } + + /// + /// Amount in merchant account CRYPTO currency. + /// + public decimal? CryptoAmount { get; set; } + + public string? PaymentReference { get; set; } + public string? MerchantCustomerEmailAddress { get; set; } + public string? CallbackUrl { get; set; } +} + +public class UpdateMerchantTransactionRequest +{ + /// + /// Update the status of merchant transaction from "ToPayout" or "PayoutConfirming" to "SellCompleted". + /// + public string? Status { get; set; } +} + +public class SimulateMerchantTransactionResponse +{ + public string? MerchantCustomerCode { get; set; } + public string? CurrencyCode { get; set; } + public decimal? CurrencyAmount { get; set; } + public decimal? FeeAmount { get; set; } + public string? CryptoCode { get; set; } + public decimal? ExpectedCryptoAmount { get; set; } + public string? PaymentMethodCode { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Broker/TransactionCallbackModels.cs b/src/Nexus.Crypto.SDK/Models/Broker/TransactionCallbackModels.cs new file mode 100644 index 0000000..aad2a79 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Broker/TransactionCallbackModels.cs @@ -0,0 +1,56 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetTransactionDataModel +{ + public string? Key { get; set; } + public string? Value { get; set; } +} + +public class PostTransactionDataModel +{ + public string? Value { get; set; } +} + +public class UpdateBrokerTransactionRequest +{ + /// + /// Optionally store a Payment Reference supplied by an external payment provider. + /// + public string? PaymentReference { get; set; } +} + +public class ExecuteTransactionRequest +{ + public required string TransactionCode { get; set; } + + /// + /// Result of the payment (e.g., PAYMENTSUCCESS). + /// + public required string ResultCode { get; set; } + + public bool? IsSettled { get; set; } +} + +public class GetTransactionFlowResult +{ + public string? TransactionCode { get; set; } + + /// + /// Transaction hash or operation id. + /// + public string? TransactionHash { get; set; } + + public IEnumerable? Senders { get; set; } + public IEnumerable? Receivers { get; set; } + + /// + /// Identifier of the token (name, contract address, assetId, etc.). + /// + public string? Token { get; set; } +} + +public class TransactionFlowParty +{ + public string? Address { get; set; } + public decimal Amount { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/BucketModels.cs b/src/Nexus.Crypto.SDK/Models/BucketModels.cs new file mode 100644 index 0000000..9e889aa --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/BucketModels.cs @@ -0,0 +1,56 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetBucketResponse +{ + /// + /// Unique identifier of the bucket. + /// + public string? Code { get; set; } + + /// + /// Human readable name of the bucket. + /// + public string? Name { get; set; } + + /// + /// The customer code that the bucket is connected to. + /// + public string? CustomerCode { get; set; } + + /// + /// Timestamp the bucket was created. + /// + public string? Created { get; set; } + + /// + /// Timestamp the bucket was updated. + /// + public string? Updated { get; set; } +} + +public class CreateBucketRequest +{ + /// + /// Unique identifier of the bucket. + /// + public required string Code { get; set; } + + /// + /// Human readable name of the bucket. + /// + public required string Name { get; set; } + + /// + /// The customer code that the bucket will be connected to. + /// Leave empty to make available to all customers. + /// + public string? CustomerCode { get; set; } +} + +public class UpdateBucketRequest +{ + /// + /// Human readable name of the bucket. + /// + public required string Name { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/CommonRequestModels.cs b/src/Nexus.Crypto.SDK/Models/CommonRequestModels.cs new file mode 100644 index 0000000..57ce20c --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/CommonRequestModels.cs @@ -0,0 +1,62 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetBalanceMutationsRequest +{ + public string? CryptoCode { get; set; } + public string? TransactionCode { get; set; } + + /// + /// Mutation type: BUY | SELL | GIFT | DEPOSIT | WITHDRAW | FEE | CORRECTION | RECEIVEIN | SENDOUT + /// + public string? Type { get; set; } + + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} + +public class GetMailsRequest +{ + public string? CustomerCode { get; set; } + public string? AccountCode { get; set; } + public string? TransactionCode { get; set; } + public string? Type { get; set; } + public string? Status { get; set; } + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} + +public class UpdatePortfolioRequest +{ + /// + /// New human-readable name for this portfolio. + /// + public string? Name { get; set; } + + /// + /// Flag to indicate if the mails feature is enabled for this portfolio. + /// + public bool? MailsEnabled { get; set; } +} + +public class GetCryptoAddressesRequest +{ + public string? CryptoCode { get; set; } + + /// + /// Address status: Inactive | Active | Deleted | Whitelisted | NotValidated | ToBeDeleted + /// + public string? Status { get; set; } + + public string? SinkType { get; set; } + public string? SourceType { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/CryptoAddressModels.cs b/src/Nexus.Crypto.SDK/Models/CryptoAddressModels.cs new file mode 100644 index 0000000..ac1c8eb --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/CryptoAddressModels.cs @@ -0,0 +1,42 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetCryptoAddressResponse +{ + public string? Created { get; set; } + public string? CreatedBy { get; set; } + + /// + /// Status(es): Inactive | Active | Deleted | Whitelisted | NotValidated | ToBeDeleted + /// + public IEnumerable? Status { get; set; } + + public CryptoAddressSink? Sink { get; set; } + public CryptoAddressSource? Source { get; set; } + public string? CryptoCode { get; set; } + public string? Address { get; set; } + public string? AddressReference { get; set; } + public string? Comment { get; set; } + public string? ExchangeWalletCode { get; set; } +} + +public class CryptoAddressSink +{ + /// + /// Sink type: Other | Exchange | Coldstore | HotWallet + /// + public string? SinkType { get; set; } + + public string? SinkTradeExchangeCode { get; set; } + public string? SinkTradeExchangeName { get; set; } +} + +public class CryptoAddressSource +{ + /// + /// Source type: Other | Exchange | Coldstore | HotWallet + /// + public string? SourceType { get; set; } + + public string? SourceTradeExchangeCode { get; set; } + public string? SourceTradeExchangeName { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Custodian/CustodianCallbackModels.cs b/src/Nexus.Crypto.SDK/Models/Custodian/CustodianCallbackModels.cs new file mode 100644 index 0000000..dd74e23 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Custodian/CustodianCallbackModels.cs @@ -0,0 +1,80 @@ +namespace Nexus.Crypto.SDK.Models.Custodian; + +public class CustodianTransactionNotificationCallbackResponse +{ + public CustodianLabelNotificationResponse? Notification { get; set; } + public string? LabelPartnerCode { get; set; } + public string? TransactionCode { get; set; } + + /// + /// Url of the callback. Maximum length is 256 characters. + /// + public string? Url { get; set; } + + public bool? IsSuccess { get; set; } + public string? Finished { get; set; } + public string? Inserted { get; set; } + public int? DequeueCount { get; set; } +} + +public class CustodianLabelNotificationResponse +{ + public string? Status { get; set; } + public string? Type { get; set; } + public string? CustomerReference { get; set; } + public string? AccountCode { get; set; } + public string? TransactionCode { get; set; } + public string? CurrencyCode { get; set; } + public string? CryptoCurrencyCode { get; set; } + public string? PaymentMethodCode { get; set; } + public string? Created { get; set; } + public string? ValidUntil { get; set; } + public CustodianLabelNotificationTxBuyResponse? Buy { get; set; } + public CustodianLabelNotificationTxSellResponse? Sell { get; set; } + public CustodianLabelNotificationTxMerchantResponse? Merchant { get; set; } + public CustodianLabelNotificationTxSendoutResponse? Sendout { get; set; } + public CustodianLabelNotificationTxReceiveInResponse? ReceiveIn { get; set; } + public CustodianLabelNotificationConfirmationResponse? Confirmations { get; set; } +} + +public class CustodianLabelNotificationTxBuyResponse +{ + public string? SendCryptoTxId { get; set; } + public decimal? CryptoCurrencyAmount { get; set; } + public decimal? CurrencyAmount { get; set; } +} + +public class CustodianLabelNotificationTxSellResponse +{ + public string? ReceiveCryptoTxId { get; set; } +} + +public class CustodianLabelNotificationTxMerchantResponse +{ + public decimal? CurrencyAmount { get; set; } + public string? ReceiveCryptoTxId { get; set; } + public string? CryptoPaymentAddress { get; set; } + public string? CryptoPaymentUri { get; set; } + public string? PaymentReference { get; set; } + public decimal? ExpectedCryptoAmount { get; set; } + public decimal? ReceivedCryptoAmount { get; set; } + public string? MerchantCustomerEmailAddress { get; set; } +} + +public class CustodianLabelNotificationTxSendoutResponse +{ + public string? TxId { get; set; } +} + +public class CustodianLabelNotificationTxReceiveInResponse +{ + public string? TxId { get; set; } + public decimal? ReceivedCryptoAmount { get; set; } + public decimal? ReceivedFiatValue { get; set; } +} + +public class CustodianLabelNotificationConfirmationResponse +{ + public int? Count { get; set; } + public int? Required { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Custodian/CustodianTransactionRequests.cs b/src/Nexus.Crypto.SDK/Models/Custodian/CustodianTransactionRequests.cs new file mode 100644 index 0000000..a50ba13 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Custodian/CustodianTransactionRequests.cs @@ -0,0 +1,236 @@ +namespace Nexus.Crypto.SDK.Models.Custodian; + +public class CustodianBuyRequest +{ + public required string CustomerCode { get; set; } + public string? AccountCode { get; set; } + + /// + /// Three letter code of the currency (ISO 4217). + /// + public required string CurrencyCode { get; set; } + + public required string CryptoCode { get; set; } + public decimal FiatValue { get; set; } + + /// + /// Optional fixed BUY price. Nexus allows 10% increase / 5% reduction. + /// + public decimal? RequestedPrice { get; set; } + + public required string PaymentMethodCode { get; set; } + + /// + /// Optional bank account number for reporting purposes only. + /// + public string? BankAccountNumber { get; set; } + + public IDictionary? Data { get; set; } +} + +public class CustodianSellRequest +{ + public required string CustomerCode { get; set; } + public string? AccountCode { get; set; } + public required string CryptoCode { get; set; } + public decimal CryptoAmount { get; set; } + public required string CurrencyCode { get; set; } + + /// + /// Optional fixed SELL price. Nexus allows 5% increase / 10% reduction. + /// + public decimal? RequestedPrice { get; set; } + + public required string PaymentMethodCode { get; set; } + public string? BankAccountNumber { get; set; } + public IDictionary? Data { get; set; } +} + +public class CustodianGiftRequest +{ + public required string CustomerCode { get; set; } + public string? AccountCode { get; set; } + public required string CurrencyCode { get; set; } + public required string CryptoCode { get; set; } + public decimal FiatValue { get; set; } + public decimal? RequestedPrice { get; set; } + public required string PaymentMethodCode { get; set; } + public IDictionary? Data { get; set; } +} + +public class CustodianClawbackRequest +{ + public required string CustomerCode { get; set; } + public string? AccountCode { get; set; } + public required string CurrencyCode { get; set; } + public required string CryptoCode { get; set; } + public decimal CryptoAmount { get; set; } + public decimal? RequestedPrice { get; set; } + public IDictionary? Data { get; set; } +} + +public class CustodianSendInternalRequest +{ + public required string PaymentMethodCode { get; set; } + public required CustodianTxSource Source { get; set; } + public required SendInternalDestination Destination { get; set; } + public IDictionary? Data { get; set; } +} + +public class CustodianSendOutRequest +{ + public required string PaymentMethodCode { get; set; } + public string? CallbackUrl { get; set; } + public string? BlockchainMessage { get; set; } + public IDictionary? Data { get; set; } + public required CustodianTxSource Source { get; set; } + public required SendOutDestination Destination { get; set; } +} + +public class CustodianSendToBucketRequest +{ + public required string PaymentMethodCode { get; set; } + public required CustodianTxSourceWithBucket Source { get; set; } + public SendToBucketDestination? Destination { get; set; } + public IDictionary? Data { get; set; } +} + +public class CustodianSwapRequest +{ + public required string PaymentMethodCode { get; set; } + public required string CustomerCode { get; set; } + public required SwapSource Source { get; set; } + public required SwapDestination Destination { get; set; } +} + +public class CustodianPaymentRequest +{ + public string? CustomerCode { get; set; } + public string? AccountCode { get; set; } + + /// + /// Optionally re-use a previously used receive address. + /// + public string? ReceiveAddress { get; set; } + + public required string CurrencyCode { get; set; } + public required string CryptoCode { get; set; } + public decimal? CryptoAmount { get; set; } + public decimal? RequestedPrice { get; set; } + public required string PaymentMethodCode { get; set; } + public string? CallbackUrl { get; set; } + public IDictionary? Data { get; set; } +} + +// Source/Destination helpers + +public class CustodianTxSource +{ + public required string CustomerCode { get; set; } + public string? AccountCode { get; set; } + public required string CryptoCode { get; set; } + public required string CurrencyCode { get; set; } + public decimal CryptoAmount { get; set; } +} + +public class CustodianTxSourceWithBucket : CustodianTxSource +{ + /// + /// Code of the source bucket. Leave empty to use main bucket. + /// + public string? BucketCode { get; set; } +} + +public class SendInternalDestination +{ + public required string CustomerCode { get; set; } + public string? AccountCode { get; set; } +} + +public class SendOutDestination +{ + public required string Address { get; set; } +} + +public class SendToBucketDestination +{ + /// + /// Code of the destination bucket. Leave empty to use main bucket. + /// + public string? BucketCode { get; set; } + + public string? AccountCode { get; set; } +} + +public class SwapSource +{ + public string? AccountCode { get; set; } + public required string CryptoCode { get; set; } + public decimal CryptoAmount { get; set; } + public decimal? RequestedPrice { get; set; } + public IDictionary? Data { get; set; } +} + +public class SwapDestination +{ + public string? AccountCode { get; set; } + public required string CryptoCode { get; set; } + public decimal? RequestedPrice { get; set; } + public IDictionary? Data { get; set; } +} + +// Response wrappers + +public class CustodianBuyResponse +{ + public CreateCustodianTransactionResponse? Transaction { get; set; } +} + +public class CustodianSellResponse +{ + public CreateCustodianTransactionResponse? Transaction { get; set; } +} + +public class CustodianGiftResponse +{ + public CreateCustodianTransactionResponse? Transaction { get; set; } +} + +public class CustodianClawbackResponse +{ + public CreateCustodianTransactionResponse? Transaction { get; set; } +} + +public class CustodianSendOutResponse +{ + public CreateCustodianTransactionResponse? Transaction { get; set; } +} + +public class CustodianSendInternalResponse +{ + public CreateCustodianTransactionResponse? SourceTransaction { get; set; } + public CreateCustodianTransactionResponse? DestinationTransaction { get; set; } +} + +public class CustodianSwapResponse +{ + public CreateCustodianTransactionResponse? SourceTransaction { get; set; } + public CreateCustodianTransactionResponse? DestinationTransaction { get; set; } +} + +public class CustodianSwapSimulationResponse +{ + public IEnumerable? CryptoBalances { get; set; } + public CreateCustodianTransactionResponse? SourceTransaction { get; set; } + public CreateCustodianTransactionResponse? DestinationTransaction { get; set; } +} + +public class CustodianPaymentRequestResponse +{ + public CreateCustodianTransactionResponse? Transaction { get; set; } + + /// + /// A payment string that can be represented as a QR code for the sender. + /// + public string? PaymentUri { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Custodian/GetCustodianTransactionsRequest.cs b/src/Nexus.Crypto.SDK/Models/Custodian/GetCustodianTransactionsRequest.cs new file mode 100644 index 0000000..0a7654f --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Custodian/GetCustodianTransactionsRequest.cs @@ -0,0 +1,18 @@ +namespace Nexus.Crypto.SDK.Models.Custodian; + +public class GetCustodianTransactionsRequest +{ + public string? CustomerCode { get; set; } + public string? AccountCode { get; set; } + public string? TransactionCode { get; set; } + public string? CryptoCode { get; set; } + public string? CurrencyCode { get; set; } + public string? PaymentMethodCode { get; set; } + public TransactionTypes? Type { get; set; } + public CustodianTransactionStatus? Status { get; set; } + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Custodian/InterestScheduleModels.cs b/src/Nexus.Crypto.SDK/Models/Custodian/InterestScheduleModels.cs new file mode 100644 index 0000000..4a13e15 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Custodian/InterestScheduleModels.cs @@ -0,0 +1,112 @@ +namespace Nexus.Crypto.SDK.Models.Custodian; + +public class CreateCustodianScheduleRequest +{ + /// + /// Three letter code of the currency (ISO 4217). + /// + public required string CurrencyCode { get; set; } + + public required string CryptoCode { get; set; } + + /// + /// Code of the bucket used to calculate the custodian balance. + /// + public required string BucketCode { get; set; } + + public required string PaymentMethodCode { get; set; } + + /// + /// Rate algorithm: WeeklyAPY + /// + public required string RateType { get; set; } + + /// + /// Rate in decimals (relative value). 0.01 equals 1%. + /// + public decimal DefaultRate { get; set; } + + /// + /// When this schedule starts triggering (ISO 8601). + /// + public required string StartDate { get; set; } + + /// + /// Defines the interval on which payouts happen. + /// + public required SchedulePeriod PayoutPeriod { get; set; } + + /// + /// Defines the interval on which balances are snapshotted. + /// + public required SchedulePeriod SubIntervalPeriod { get; set; } +} + +public class SchedulePeriod +{ + /// + /// Period unit: Days | Months + /// + public required string Unit { get; set; } + + public int Amount { get; set; } +} + +public class EditCustodianScheduleRequest +{ + /// + /// Rate in decimals (relative value). 0.01 equals 1%. Only applies for newly created intervals. + /// + public decimal DefaultRate { get; set; } +} + +public class EditCustodianSubIntervalRequest +{ + /// + /// Rate in decimals (relative value). 0.01 equals 1%. + /// + public decimal AdjustedRate { get; set; } +} + +public class GetScheduleResponse +{ + public Guid Id { get; set; } + public string? StartDate { get; set; } + public string? BucketCode { get; set; } + public string? CurrencyCode { get; set; } + public string? CryptoCode { get; set; } + public decimal DefaultRate { get; set; } + public string? PaymentMethodCode { get; set; } + public SchedulePeriod? PayoutPeriod { get; set; } + public SchedulePeriod? SubIntervalPeriod { get; set; } +} + +public class GetScheduleWithIntervalsResponse : GetScheduleResponse +{ + public IEnumerable? Intervals { get; set; } +} + +public class GetScheduleIntervalResponse +{ + public Guid Id { get; set; } + public string? From { get; set; } + public string? To { get; set; } + public int Number { get; set; } + public IEnumerable? SubIntervals { get; set; } +} + +public class GetScheduleSubIntervalResponse +{ + public Guid Id { get; set; } + public string? From { get; set; } + public string? To { get; set; } + public decimal AdjustedRate { get; set; } + public int Number { get; set; } +} + +public enum IntervalType +{ + Current, + Next, + Previous +} diff --git a/src/Nexus.Crypto.SDK/Models/Custodian/InterestScheduleQueryModels.cs b/src/Nexus.Crypto.SDK/Models/Custodian/InterestScheduleQueryModels.cs new file mode 100644 index 0000000..cbe53f9 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Custodian/InterestScheduleQueryModels.cs @@ -0,0 +1,33 @@ +namespace Nexus.Crypto.SDK.Models.Custodian; + +/// +/// Request filter for listing custodian interest schedule intervals. +/// +public class GetScheduleIntervalsRequest +{ + public IntervalType? Type { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing interest schedules. +/// +public class GetSchedulesRequest +{ + public string? BucketCode { get; set; } + public string? CryptoCode { get; set; } + public string? CurrencyCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Response for a custodian swap simulation. +/// +public class CustodianSwapSimulateRequest +{ + public required string PaymentMethodCode { get; set; } + public required SwapSource Source { get; set; } + public required SwapDestination Destination { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Customer/CommentModels.cs b/src/Nexus.Crypto.SDK/Models/Customer/CommentModels.cs new file mode 100644 index 0000000..e0298c5 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Customer/CommentModels.cs @@ -0,0 +1,47 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetCommentHistoryResponse +{ + /// + /// The user who wrote the comment. + /// + public string? Author { get; set; } + + /// + /// Description of the comment. + /// + public string? Text { get; set; } + + /// + /// Timestamp the last comment was created. + /// + public string? Created { get; set; } +} + +public class GetCommentsResponse +{ + /// + /// Unique identifier of the comment. + /// + public string? Guid { get; set; } + + /// + /// The user who wrote the comment. + /// + public string? Author { get; set; } + + /// + /// Description of the comment. + /// + public string? Text { get; set; } + + /// + /// Timestamp the comment was initially created. + /// + public string? Created { get; set; } + + /// + /// Timestamp the comment was last updated. + /// + public string? Updated { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Customer/ComplianceHistoryModels.cs b/src/Nexus.Crypto.SDK/Models/Customer/ComplianceHistoryModels.cs new file mode 100644 index 0000000..52530c2 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Customer/ComplianceHistoryModels.cs @@ -0,0 +1,50 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetCustomerComplianceHistoryResponse +{ + public string? CustomerCode { get; set; } + + /// + /// The date and time the customer's compliance history record was created. + /// + public string? Created { get; set; } + + /// + /// Status of customer: New | Active | Deleted | UnderReview | Blocked + /// + public string? Status { get; set; } + + /// + /// Risk level of this customer. + /// + public string? Trustlevel { get; set; } + + /// + /// Currency this Customer is allowed to transact in (ISO 4217). + /// + public string? CurrencyCode { get; set; } + + public bool IsBusiness { get; set; } + + /// + /// Risk of a customer: None | Low | Medium | High | VeryHigh + /// + public string? RiskQualification { get; set; } + + /// + /// Last date the customer was reviewed (ISO 8601). + /// + public string? LatestReview { get; set; } + + public bool IsReviewRecommended { get; set; } + + /// + /// The optional reason why the compliance history record was created. + /// + public string? Reason { get; set; } + + /// + /// By whom was the compliance history record created. + /// + public string? InitiatedBy { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Customer/CustomerLimitModels.cs b/src/Nexus.Crypto.SDK/Models/Customer/CustomerLimitModels.cs new file mode 100644 index 0000000..36f15fd --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Customer/CustomerLimitModels.cs @@ -0,0 +1,65 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetBrokerLimitResponse +{ + /// + /// The parameters applied to this limit calculation. + /// + public LimitParameters? LimitParameters { get; set; } + + /// + /// The reasons the limit of the customer is adjusted. + /// + public string[]? LimitReasons { get; set; } + + /// + /// The remaining limits of a customer. + /// + public TrustlevelLimit? Remaining { get; set; } + + /// + /// The total limits of a customer. + /// + public TrustlevelLimit? Total { get; set; } +} + +public class LimitParameters +{ + /// + /// The currency the limits are shown in (ISO 4217). + /// + public string? CurrencyCode { get; set; } + + /// + /// The payment method the customer limit is calculated with. + /// + public string? PaymentMethodCode { get; set; } + + /// + /// The crypto currency the customer limit is calculated with. + /// + public string? CryptoCode { get; set; } +} + +public class TrustlevelLimit +{ + /// + /// The amount in fiat a customer can buy/sell in a day. + /// + public decimal DailyLimit { get; set; } + + /// + /// The amount in fiat a customer can buy/sell in a month. + /// + public decimal MonthlyLimit { get; set; } + + /// + /// The amount in fiat a customer can buy/sell in a year. + /// + public decimal? YearlyLimit { get; set; } + + /// + /// The amount in fiat a customer can buy/sell lifetime. + /// + public decimal? LifetimeLimit { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Customer/CustomerRequestModels.cs b/src/Nexus.Crypto.SDK/Models/Customer/CustomerRequestModels.cs new file mode 100644 index 0000000..4dc7c2e --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Customer/CustomerRequestModels.cs @@ -0,0 +1,48 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetCustomersRequest +{ + public string? CustomerCode { get; set; } + public string? Email { get; set; } + public string? Status { get; set; } + public string? TrustLevel { get; set; } + public string? PortfolioCode { get; set; } + public string? Tag { get; set; } + public bool? IsBusiness { get; set; } + public string? CountryCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} + +public class AddCommentRequest +{ + /// + /// Text content of the comment. + /// + public required string Text { get; set; } +} + +public class UpdateCommentRequest +{ + /// + /// Updated text content of the comment. + /// + public required string Text { get; set; } +} + +public class UpsertCustomerDataRequest +{ + /// + /// Key/value pairs to store against a customer. + /// + public required IDictionary Data { get; set; } +} + +public class GetCustomerLimitRequest +{ + public required string CustomerCode { get; set; } + public required string PaymentMethodCode { get; set; } + public required string CryptoCode { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/Customer/CustomerTagModels.cs b/src/Nexus.Crypto.SDK/Models/Customer/CustomerTagModels.cs new file mode 100644 index 0000000..cf42575 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/Customer/CustomerTagModels.cs @@ -0,0 +1,63 @@ +namespace Nexus.Crypto.SDK.Models; + +/// +/// Response for a customer tag. +/// +public class CustomerTagResponse +{ + public string? Tag { get; set; } + public string? CustomerCode { get; set; } + public string? Created { get; set; } +} + +/// +/// Request to add a tag to a customer. +/// +public class CreateCustomerTagRequest +{ + public required string Tag { get; set; } +} + +/// +/// Response for a customer's IBANs or send-out addresses. +/// +public class CustomerPayoutAddressResponse +{ + public Guid Id { get; set; } + public string? CustomerCode { get; set; } + public string? Address { get; set; } + public string? CurrencyCode { get; set; } + public string? Status { get; set; } + public string? Created { get; set; } + public string? CreatedBy { get; set; } +} + +/// +/// Request filter for listing customer tags. +/// +public class GetCustomerTagsRequest +{ + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing customer compliance history. +/// +public class GetCustomerComplianceHistoryRequest +{ + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing customer callbacks. +/// +public class GetCustomerCallbacksRequest +{ + public string? Status { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/CustomerBankAccount/BankAccountQueryModels.cs b/src/Nexus.Crypto.SDK/Models/CustomerBankAccount/BankAccountQueryModels.cs new file mode 100644 index 0000000..fe14267 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/CustomerBankAccount/BankAccountQueryModels.cs @@ -0,0 +1,39 @@ +namespace Nexus.Crypto.SDK.Models; + +/// +/// Request filter for listing customer bank accounts. +/// +public class GetBankAccountsRequest +{ + public string? Number { get; set; } + public string? CurrencyCode { get; set; } + public bool? IsPrimary { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} + +/// +/// Request filter for listing banks. +/// +public class GetBanksRequest +{ + public string? Name { get; set; } + public string? BicCode { get; set; } + public string? CountryCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing persons. +/// +public class GetPersonsRequest +{ + public CustomerPersonType? Type { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/CustomerBankAccount/BankModels.cs b/src/Nexus.Crypto.SDK/Models/CustomerBankAccount/BankModels.cs new file mode 100644 index 0000000..aa33248 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/CustomerBankAccount/BankModels.cs @@ -0,0 +1,56 @@ +namespace Nexus.Crypto.SDK.Models; + +public class BankModel +{ + /// + /// Unique identifier of the bank. + /// + public Guid Id { get; set; } + + public string? Name { get; set; } + public string? Country { get; set; } + public string? BicCode { get; set; } + public string? City { get; set; } + public string? IbanCode { get; set; } + public string? IssuerId { get; set; } +} + +public class CreateBankRequest +{ + public required string Name { get; set; } + public string? IbanCode { get; set; } + public string? BicCode { get; set; } + public required string CountryCode { get; set; } + public string? City { get; set; } + public string? IssuerId { get; set; } +} + +public class UpdateBankRequest +{ + public string? Name { get; set; } + public string? IbanCode { get; set; } + public string? BicCode { get; set; } + public string? CountryCode { get; set; } + public string? City { get; set; } + public string? IssuerId { get; set; } +} + +public class CreateBankAccountRequest +{ + public required string Number { get; set; } + public string? Name { get; set; } + + /// + /// Currency code related to the bank account (ISO 4217). + /// + public required string CurrencyCode { get; set; } + + public RelatedBank? Bank { get; set; } + + /// + /// Indicates the primary account of a customer. + /// + public bool IsPrimary { get; set; } +} + + diff --git a/src/Nexus.Crypto.SDK/Models/ExchangeModels.cs b/src/Nexus.Crypto.SDK/Models/ExchangeModels.cs new file mode 100644 index 0000000..04539db --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/ExchangeModels.cs @@ -0,0 +1,142 @@ +namespace Nexus.Crypto.SDK.Models; + +public class ExchangeModel +{ + /// + /// Unique identifier of an Exchange. + /// + public string? Code { get; set; } + + /// + /// Name of the Exchange. + /// + public string? Name { get; set; } + + public string? PriceUpdated { get; set; } + public string? ReserveUpdated { get; set; } +} + +public class TradePairItem +{ + /// + /// TradePair unique identifier. + /// + public string? Code { get; set; } + + public TradePairExchange? Exchange { get; set; } + public TradePairCurrency? Currency { get; set; } + public TradePairCrypto? Crypto { get; set; } + public TradePairPrice? Price { get; set; } + + /// + /// TradePair flags. + /// + public IEnumerable? Supports { get; set; } + + public TradePairOverallStatus? Status { get; set; } +} + +public class TradePairExchange +{ + public string? Code { get; set; } + public string? Name { get; set; } +} + +public class TradePairCurrency +{ + public string? Code { get; set; } + public string? Name { get; set; } +} + +public class TradePairCrypto +{ + public string? Code { get; set; } + public string? Name { get; set; } +} + +public class TradePairPrice +{ + public decimal? Bid { get; set; } + public decimal? Ask { get; set; } + public string? Updated { get; set; } +} + +public class TradePairOverallStatus +{ + /// + /// TradePair is usable to trade with. + /// + public bool Tradeable { get; set; } + + /// + /// TradePair is enabled by LabelPartner. + /// + public bool Enabled { get; set; } + + public bool SystemEnabled { get; set; } + public bool Updated { get; set; } + public bool ExchangeSystemEnabled { get; set; } + public bool ExchangeEnabled { get; set; } +} + +public class CreateOrderRequest +{ + public required string ExchangeCode { get; set; } + + /// + /// Buy | Sell + /// + public required string Action { get; set; } + + /// + /// Market | Limit + /// + public required string Type { get; set; } + + public required string Crypto { get; set; } + + /// + /// FIAT code (ISO 4217). + /// + public required string Currency { get; set; } + + /// + /// Amount in FIAT. + /// + public decimal Amount { get; set; } + + public decimal? LimitPrice { get; set; } + + /// + /// DateTime indicating the expiration of this order. Defaults to Created +24h. + /// + public DateTime? Expiring { get; set; } + + public IDictionary? Data { get; set; } +} + + +public class CreateTransferRequest +{ + /// + /// Transfer's source type. + /// + public string? SourceType { get; set; } + + /// + /// Transfer's sink type. + /// + public string? SinkType { get; set; } + + public string? SourceExchangeCode { get; set; } + public string? SinkExchangeCode { get; set; } + + /// + /// Transfer amount in crypto. + /// + public decimal Amount { get; set; } + + public string? CryptoCode { get; set; } + public string? TransferAddress { get; set; } + public string? UserName { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/GetNotificationModels.cs b/src/Nexus.Crypto.SDK/Models/GetNotificationModels.cs new file mode 100644 index 0000000..ff31c14 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/GetNotificationModels.cs @@ -0,0 +1,37 @@ +namespace Nexus.Crypto.SDK.Models; + +/// +/// Response for a notification (portal alert). +/// +public class GetNotificationResponse +{ + public Guid Id { get; set; } + + /// + /// Notification type: Operational | Technical + /// + public string? Type { get; set; } + + /// + /// Severity: Info | Warning | Error + /// + public string? Level { get; set; } + + public string? Title { get; set; } + public string? Message { get; set; } + public string? Created { get; set; } + public string? CreatedBy { get; set; } + public string? Dismissed { get; set; } +} + +/// +/// Request filter for listing notifications. +/// +public class GetNotificationsRequest +{ + public string? Type { get; set; } + public string? Level { get; set; } + public bool? IsDismissed { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/HotWalletModels.cs b/src/Nexus.Crypto.SDK/Models/HotWalletModels.cs new file mode 100644 index 0000000..c6f5c01 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/HotWalletModels.cs @@ -0,0 +1,19 @@ +namespace Nexus.Crypto.SDK.Models; + +public class HotWalletBalance +{ + /// + /// Crypto identifier. + /// + public string? CryptoCode { get; set; } + + /// + /// Crypto name. + /// + public string? CryptoName { get; set; } + + public decimal Available { get; set; } + public decimal Unconfirmed { get; set; } + public decimal ConfirmedReserve { get; set; } + public decimal DelayedSending { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/LabelPartnerModels.cs b/src/Nexus.Crypto.SDK/Models/LabelPartnerModels.cs new file mode 100644 index 0000000..e8ecca7 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/LabelPartnerModels.cs @@ -0,0 +1,66 @@ +namespace Nexus.Crypto.SDK.Models; + +public class LabelPartnerResponse +{ + public string? LabelPartnerCode { get; set; } + public string? BusinessModel { get; set; } + public string? BaseCurrencyCode { get; set; } + public decimal? MaximumAllowedYieldDeviationValue { get; set; } + public IDictionary? Features { get; set; } +} + +public class LabelPartnerCryptoCurrency +{ + public string? Code { get; set; } + public string? Name { get; set; } + public bool IsActive { get; set; } + public bool IsEnabled { get; set; } + public LabelPartnerBlockchain? Blockchain { get; set; } + + /// + /// Defines the flow of cryptos when selling. + /// + public string? HotWalletReceiveFlow { get; set; } + + public LabelPartnerTransactionLimits? TransactionLimits { get; set; } +} + +public class LabelPartnerBlockchain +{ + public string? Name { get; set; } + public string? AddressExplorerURL { get; set; } + public string? TransactionExplorerURL { get; set; } +} + +public class LabelPartnerTransactionLimits +{ + public LabelPartnerSellLimit? Sell { get; set; } + public LabelPartnerBuyLimit? Buy { get; set; } +} + +public class LabelPartnerSellLimit +{ + /// + /// Minimum amount allowed for a sell transaction, in digital currency. + /// + public decimal MinimalAmount { get; set; } +} + +public class LabelPartnerBuyLimit +{ + /// + /// Minimum buy transaction amount in base currency. + /// + public decimal MinimalValue { get; set; } +} + +public class LabelPartnerCountry +{ + public string? Code { get; set; } + public string? Description { get; set; } + + /// + /// Country status: None | Blocked + /// + public string? Status { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/ListRequestModels.cs b/src/Nexus.Crypto.SDK/Models/ListRequestModels.cs new file mode 100644 index 0000000..7186414 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/ListRequestModels.cs @@ -0,0 +1,94 @@ +namespace Nexus.Crypto.SDK.Models; + +/// +/// Request for listing payment methods. +/// +public class GetPaymentMethodsRequest +{ + public string? CryptoCode { get; set; } + public string? CurrencyCode { get; set; } + + /// + /// Transaction type: BUY | SELL | SENDINTERNAL | SENDOUT | SWAP | RECEIVEIN | GIFT | SENDTOBUCKET | INTEREST | CLAWBACK + /// + public string? TransactionType { get; set; } + + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Response for listing payment method fee customer overrides. +/// +public class GetPaymentMethodCustomerFeesRequest +{ + public string? CustomerCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing trust levels. +/// +public class GetTrustLevelsRequest +{ + public bool? IsActive { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing portfolios. +/// +public class GetPortfoliosRequest +{ + public string? Code { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing buckets. +/// +public class GetBucketsRequest +{ + public string? CustomerCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing label-partner countries. +/// +public class GetLabelPartnerCountriesRequest +{ + public string? Status { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing label-partner cryptocurrencies. +/// +public class GetLabelPartnerCryptoCurrenciesRequest +{ + public bool? IsActive { get; set; } + public bool? IsEnabled { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing merchant transactions. +/// +public class GetMerchantTransactionsRequest +{ + public string? Status { get; set; } + public string? MerchantCustomerCode { get; set; } + public DateTime? CreatedFrom { get; set; } + public DateTime? CreatedTill { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } + public string? SortBy { get; set; } + public SortDirection? SortDirection { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/MailRequestModels.cs b/src/Nexus.Crypto.SDK/Models/MailRequestModels.cs new file mode 100644 index 0000000..8acccee --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/MailRequestModels.cs @@ -0,0 +1,30 @@ +namespace Nexus.Crypto.SDK.Models; + +public class PostMailRequest +{ + /// + /// The type of this mail (e.g., NewAccountRequested, TransactionBuyFinish, etc.) + /// + public required string Type { get; set; } + + /// + /// References to other entities. At least one must be provided. + /// + public required MailEntityCodes References { get; set; } + + public MailContent? Content { get; set; } + public required PostMailRecipient Recipient { get; set; } +} + +public class PostMailRecipient +{ + public required string Email { get; set; } + public string? Cc { get; set; } + public string? Bcc { get; set; } +} + +public class PutMailRequest +{ + public MailContent? Content { get; set; } + public MailRecipient? Recipient { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/NotificationModels.cs b/src/Nexus.Crypto.SDK/Models/NotificationModels.cs new file mode 100644 index 0000000..14eed9f --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/NotificationModels.cs @@ -0,0 +1,22 @@ +namespace Nexus.Crypto.SDK.Models; + +public class CreateNotificationRequest +{ + public required CreateNotificationType Type { get; set; } + public required CreateNotificationLevel Level { get; set; } + public required string Title { get; set; } + public required string Message { get; set; } +} + +public enum CreateNotificationType +{ + Operational, + Technical +} + +public enum CreateNotificationLevel +{ + Info, + Warning, + Error +} diff --git a/src/Nexus.Crypto.SDK/Models/PaymentMethodModels.cs b/src/Nexus.Crypto.SDK/Models/PaymentMethodModels.cs new file mode 100644 index 0000000..d7ba66c --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/PaymentMethodModels.cs @@ -0,0 +1,88 @@ +namespace Nexus.Crypto.SDK.Models; + +public class PaymentMethodResponse +{ + public string? Code { get; set; } + public string? Name { get; set; } + public string? CryptoCode { get; set; } + public string? CurrencyCode { get; set; } + + /// + /// Transaction type: BUY | SELL | SENDINTERNAL | SENDOUT | SWAP | RECEIVEIN | GIFT | SENDTOBUCKET | INTEREST | CLAWBACK + /// + public string? TransactionType { get; set; } + + public PaymentMethodFees? Fees { get; set; } + public PaymentType? PaymentType { get; set; } + public IDictionary? Data { get; set; } +} + +public class PaymentMethodFees +{ + public BankFees? Bank { get; set; } + public ServiceFees? Service { get; set; } +} + +public class BankFees +{ + public decimal Fixed { get; set; } + public decimal Relative { get; set; } +} + +public class ServiceFees +{ + public decimal Relative { get; set; } +} + +public class PaymentType +{ + public string? Code { get; set; } + public string? Description { get; set; } + public string? Name { get; set; } +} + +public class PaymentMethodCustomerFeeResponse +{ + /// + /// Customer code for the fee. + /// + public string? CustomerCode { get; set; } + + /// + /// Fee value as percentage (between 0 and 1). + /// + public decimal Value { get; set; } +} + +public class UpsertPaymentMethodCustomerFeeRequest +{ + public required string CustomerCode { get; set; } + + /// + /// Fee percentage as a decimal between 0 and 1. Example: 0.05 for 5%. + /// + public decimal Value { get; set; } +} + +public class PaymentMethodTagFeeResponse +{ + /// + /// Customer tag for the fee. + /// + public string? CustomerTag { get; set; } + + /// + /// Fee value as percentage (between 0 and 1). + /// + public decimal Value { get; set; } +} + +public class UpsertPaymentMethodTagFeeRequest +{ + public required string CustomerTag { get; set; } + + /// + /// Fee percentage as a decimal between 0 and 1. Example: 0.05 for 5%. + /// + public decimal Value { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/PortfolioModels.cs b/src/Nexus.Crypto.SDK/Models/PortfolioModels.cs new file mode 100644 index 0000000..29ff72c --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/PortfolioModels.cs @@ -0,0 +1,19 @@ +namespace Nexus.Crypto.SDK.Models; + +public class CreatePortfolioRequest +{ + /// + /// Unique identifier for this Portfolio. + /// + public required string Code { get; set; } + + /// + /// Optional humanized name. Defaults to Code when missing. + /// + public string? Name { get; set; } + + /// + /// Flag to indicate if the mails feature is enabled for this portfolio. Defaults to true. + /// + public bool MailsEnabled { get; set; } = true; +} diff --git a/src/Nexus.Crypto.SDK/Models/PriceDataModels.cs b/src/Nexus.Crypto.SDK/Models/PriceDataModels.cs new file mode 100644 index 0000000..5524541 --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/PriceDataModels.cs @@ -0,0 +1,16 @@ +namespace Nexus.Crypto.SDK.Models; + +public class GetPriceData +{ + public string? CryptoCode { get; set; } + public string? CurrencyCode { get; set; } + public IEnumerable? PriceData { get; set; } +} + +public class PriceDataPoint +{ + public decimal? Buy { get; set; } + public decimal? Sell { get; set; } + public decimal? Mid { get; set; } + public DateTime? Timestamp { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/Models/QueryModels.cs b/src/Nexus.Crypto.SDK/Models/QueryModels.cs new file mode 100644 index 0000000..81d309d --- /dev/null +++ b/src/Nexus.Crypto.SDK/Models/QueryModels.cs @@ -0,0 +1,66 @@ +namespace Nexus.Crypto.SDK.Models; + +/// +/// Request filter for listing historic price data. +/// +public class GetPriceDataRequest +{ + /// + /// Start of the date range (ISO 8601). + /// + public DateTime? From { get; set; } + + /// + /// End of the date range (ISO 8601). + /// + public DateTime? To { get; set; } + + /// + /// Interval resolution: Hour | Day | Week | Month + /// + public string? Resolution { get; set; } +} + +/// +/// Request filter for listing reserves. +/// +public class GetReservesRequest +{ + /// + /// Optional timestamp to retrieve reserve snapshot (ISO 8601). + /// + public string? ReservesTimeStamp { get; set; } +} + +/// +/// Request filter for listing hot-wallet balances. +/// +public class GetHotWalletBalancesRequest +{ + public string? CryptoCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing exchanges. +/// +public class GetExchangesRequest +{ + public string? ExchangeCode { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} + +/// +/// Request filter for listing trade pairs. +/// +public class GetTradePairsRequest +{ + public string? ExchangeCode { get; set; } + public string? CryptoCode { get; set; } + public string? CurrencyCode { get; set; } + public bool? IsEnabled { get; set; } + public int? Page { get; set; } + public int? Limit { get; set; } +} diff --git a/src/Nexus.Crypto.SDK/NexusAPIService.cs b/src/Nexus.Crypto.SDK/NexusAPIService.cs index b351afa..27310c8 100644 --- a/src/Nexus.Crypto.SDK/NexusAPIService.cs +++ b/src/Nexus.Crypto.SDK/NexusAPIService.cs @@ -1,4 +1,5 @@ using Nexus.Crypto.SDK.Models; +using Nexus.Crypto.SDK.Models.Account; using Nexus.Crypto.SDK.Models.Broker; using Nexus.Crypto.SDK.Models.Custodian; using Nexus.Crypto.SDK.Models.PriceChartModel; @@ -177,4 +178,631 @@ public Task DeleteCustomerBankAccount(string customerCode, Guid bankAccountId) $"customer/{customerCode}/bankAccounts/{bankAccountId}", ApiVersion1_2); } + + // ── Label partner ────────────────────────────────────────────────────────── + + public async Task> GetLabelPartnerConfig() + { + return await GetAsync>("labelpartner/config", ApiVersion1_2); + } + + public async Task>> GetLabelPartnerCryptoCurrencies( + GetLabelPartnerCryptoCurrenciesRequest? request = null) + { + return await GetAsync>>( + $"labelpartner/cryptocurrencies?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task>> GetLabelPartnerCountries( + GetLabelPartnerCountriesRequest? request = null) + { + return await GetAsync>>( + $"labelpartner/countries?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + // ── Prices ───────────────────────────────────────────────────────────────── + + public async Task> GetHistoricPrices(string currency, string crypto, + GetPriceDataRequest? request = null) + { + return await GetAsync>( + $"prices/{currency}/{crypto}/historic?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + // ── Balances ─────────────────────────────────────────────────────────────── + + public async Task>> GetHotWalletBalances( + GetHotWalletBalancesRequest? request = null) + { + return await GetAsync>>( + $"balances/hotwallet?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + // ── Accounts ─────────────────────────────────────────────────────────────── + + public async Task>> GetAccounts( + GetAccountsRequest? request = null) + { + return await GetAsync>>( + $"accounts?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> GetAccount(string accountCode) + { + return await GetAsync>($"accounts/{accountCode}", ApiVersion1_2); + } + + public async Task> CreateAccount(string customerCode, + CreateAccountRequest request) + { + return await PostAsync>( + $"customer/{customerCode}/accounts", request, ApiVersion1_2); + } + + public async Task> UpdateAccount(string accountCode, + UpdateAccountRequest request) + { + return await PutAsync>( + $"accounts/{accountCode}", request, ApiVersion1_2); + } + + public async Task> CreateNonNativeAccount(string accountCode, + CreateNonNativeAccountRequest request) + { + return await PostAsync>( + $"accounts/{accountCode}/nonnative", request, ApiVersion1_2); + } + + public async Task>> GetAccountBalances( + string accountCode) + { + return await GetAsync>>( + $"accounts/{accountCode}/balances", ApiVersion1_2); + } + + // ── Buckets ──────────────────────────────────────────────────────────────── + + public async Task>> GetBuckets( + GetBucketsRequest? request = null) + { + return await GetAsync>>( + $"buckets?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> GetBucket(string bucketCode) + { + return await GetAsync>($"buckets/{bucketCode}", ApiVersion1_2); + } + + public async Task> CreateBucket(CreateBucketRequest request) + { + return await PostAsync>( + "buckets", request, ApiVersion1_2); + } + + public async Task> UpdateBucket(string bucketCode, + UpdateBucketRequest request) + { + return await PutAsync>( + $"buckets/{bucketCode}", request, ApiVersion1_2); + } + + public async Task DeleteBucket(string bucketCode) + { + await DeleteAsync($"buckets/{bucketCode}", ApiVersion1_2); + } + + // ── Portfolios ───────────────────────────────────────────────────────────── + + public async Task> CreatePortfolio(CreatePortfolioRequest request) + { + return await PostAsync>( + "portfolios", request, ApiVersion1_2); + } + + public async Task> UpdatePortfolio(string portfolioCode, + UpdatePortfolioRequest request) + { + return await PutAsync>( + $"portfolios/{portfolioCode}", request, ApiVersion1_2); + } + + // ── Payment methods ──────────────────────────────────────────────────────── + + public async Task>> GetPaymentMethods( + GetPaymentMethodsRequest? request = null) + { + return await GetAsync>>( + $"paymentmethods?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> GetPaymentMethod(string paymentMethodCode) + { + return await GetAsync>( + $"paymentmethods/{paymentMethodCode}", ApiVersion1_2); + } + + public async Task>> GetPaymentMethodCustomerFees( + string paymentMethodCode, GetPaymentMethodCustomerFeesRequest? request = null) + { + return await GetAsync>>( + $"paymentmethods/{paymentMethodCode}/fees/customer?{QueryParameterHelper.ToQueryString(request)}", + ApiVersion1_2); + } + + public async Task> UpsertPaymentMethodCustomerFee( + string paymentMethodCode, UpsertPaymentMethodCustomerFeeRequest request) + { + return await PutAsync>( + $"paymentmethods/{paymentMethodCode}/fees/customer", request, ApiVersion1_2); + } + + public async Task DeletePaymentMethodCustomerFee(string paymentMethodCode, string customerCode) + { + await DeleteAsync($"paymentmethods/{paymentMethodCode}/fees/customer/{customerCode}", ApiVersion1_2); + } + + public async Task>> GetPaymentMethodTagFees( + string paymentMethodCode) + { + return await GetAsync>>( + $"paymentmethods/{paymentMethodCode}/fees/tag", ApiVersion1_2); + } + + public async Task> UpsertPaymentMethodTagFee( + string paymentMethodCode, UpsertPaymentMethodTagFeeRequest request) + { + return await PutAsync>( + $"paymentmethods/{paymentMethodCode}/fees/tag", request, ApiVersion1_2); + } + + public async Task DeletePaymentMethodTagFee(string paymentMethodCode, string customerTag) + { + await DeleteAsync($"paymentmethods/{paymentMethodCode}/fees/tag/{customerTag}", ApiVersion1_2); + } + + // ── Crypto addresses ─────────────────────────────────────────────────────── + + public async Task>> GetCryptoAddresses( + GetCryptoAddressesRequest? request = null) + { + return await GetAsync>>( + $"cryptoaddress?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + // ── Exchanges & trade pairs ──────────────────────────────────────────────── + + public async Task>> GetExchanges( + GetExchangesRequest? request = null) + { + return await GetAsync>>( + $"exchanges?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task>> GetTradePairs( + GetTradePairsRequest? request = null) + { + return await GetAsync>>( + $"tradepairs?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + // ── Transfers ────────────────────────────────────────────────────────────── + + public async Task> CreateTransfer(CreateTransferRequest request) + { + return await PostAsync>( + "transfers", request, ApiVersion1_2); + } + + // ── Orders ───────────────────────────────────────────────────────────────── + + public async Task> CreateOrder(CreateOrderRequest request) + { + return await PostAsync>( + "orders", request, ApiVersion1_2); + } + + public async Task DeleteOrder(string orderCode) + { + await DeleteAsync($"orders/{orderCode}", ApiVersion1_2); + } + + // ── Mails ────────────────────────────────────────────────────────────────── + + public async Task> GetMail(string mailCode) + { + return await GetAsync>($"mail/{mailCode}", ApiVersion1_2); + } + + public async Task> CreateMail(PostMailRequest request) + { + return await PostAsync>("mail", request, ApiVersion1_2); + } + + public async Task> UpdateMail(string mailCode, PutMailRequest request) + { + return await PutAsync>( + $"mail/{mailCode}", request, ApiVersion1_2); + } + + // ── Notifications ────────────────────────────────────────────────────────── + + public async Task>> GetNotifications( + GetNotificationsRequest? request = null) + { + return await GetAsync>>( + $"notifications?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task CreateNotification(CreateNotificationRequest request) + { + await PostAsync>( + "notifications", request, ApiVersion1_2); + } + + // ── Banks ────────────────────────────────────────────────────────────────── + + public async Task>> GetBanks(GetBanksRequest? request = null) + { + return await GetAsync>>( + $"banks?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> GetBank(Guid bankId) + { + return await GetAsync>($"banks/{bankId}", ApiVersion1_2); + } + + public async Task> CreateBank(CreateBankRequest request) + { + return await PostAsync>("banks", request, ApiVersion1_2); + } + + public async Task> UpdateBank(Guid bankId, UpdateBankRequest request) + { + return await PutAsync>( + $"banks/{bankId}", request, ApiVersion1_2); + } + + public async Task DeleteBank(Guid bankId) + { + await DeleteAsync($"banks/{bankId}", ApiVersion1_2); + } + + // ── Customer bank accounts (additional) ─────────────────────────────────── + + public async Task> GetCustomerBankAccount( + string customerCode, Guid bankAccountId) + { + return await GetAsync>( + $"customer/{customerCode}/bankaccounts/{bankAccountId}", ApiVersion1_2); + } + + // ── Customer limits ──────────────────────────────────────────────────────── + + public async Task> GetCustomerBuyLimit( + GetCustomerLimitRequest request) + { + return await GetAsync>( + $"customer/{request.CustomerCode}/limits/buy?paymentMethodCode={request.PaymentMethodCode}&cryptoCode={request.CryptoCode}", + ApiVersion1_2); + } + + public async Task> GetCustomerSellLimit( + GetCustomerLimitRequest request) + { + return await GetAsync>( + $"customer/{request.CustomerCode}/limits/sell?paymentMethodCode={request.PaymentMethodCode}&cryptoCode={request.CryptoCode}", + ApiVersion1_2); + } + + // ── Customer comments ────────────────────────────────────────────────────── + + public async Task>> GetCustomerComments( + string customerCode) + { + return await GetAsync>>( + $"customer/{customerCode}/comments", ApiVersion1_2); + } + + public async Task> AddCustomerComment(string customerCode, + AddCommentRequest request) + { + return await PostAsync>( + $"customer/{customerCode}/comments", request, ApiVersion1_2); + } + + public async Task> UpdateCustomerComment(string customerCode, + Guid commentId, UpdateCommentRequest request) + { + return await PutAsync>( + $"customer/{customerCode}/comments/{commentId}", request, ApiVersion1_2); + } + + public async Task DeleteCustomerComment(string customerCode, Guid commentId) + { + await DeleteAsync($"customer/{customerCode}/comments/{commentId}", ApiVersion1_2); + } + + public async Task>> GetCustomerCommentHistory( + string customerCode, Guid commentId) + { + return await GetAsync>>( + $"customer/{customerCode}/comments/{commentId}/history", ApiVersion1_2); + } + + // ── Customer compliance history ──────────────────────────────────────────── + + public async Task>> GetCustomerComplianceHistory( + string customerCode, GetCustomerComplianceHistoryRequest? request = null) + { + return await GetAsync>>( + $"customer/{customerCode}/compliancehistory?{QueryParameterHelper.ToQueryString(request)}", + ApiVersion1_2); + } + + // ── Customer tags ────────────────────────────────────────────────────────── + + public async Task>> GetCustomerTags(string customerCode) + { + return await GetAsync>>( + $"customer/{customerCode}/tags", ApiVersion1_2); + } + + public async Task> AddCustomerTag(string customerCode, + CreateCustomerTagRequest request) + { + return await PostAsync>( + $"customer/{customerCode}/tags", request, ApiVersion1_2); + } + + public async Task DeleteCustomerTag(string customerCode, string tag) + { + await DeleteAsync($"customer/{customerCode}/tags/{tag}", ApiVersion1_2); + } + + // ── Customer data ────────────────────────────────────────────────────────── + + public async Task>> GetCustomerData(string customerCode) + { + return await GetAsync>>( + $"customer/{customerCode}/data", ApiVersion1_2); + } + + public async Task>> UpsertCustomerData(string customerCode, + UpsertCustomerDataRequest request) + { + return await PutAsync>>( + $"customer/{customerCode}/data", request, ApiVersion1_2); + } + + public async Task DeleteCustomerDataKey(string customerCode, string key) + { + await DeleteAsync($"customer/{customerCode}/data/{key}", ApiVersion1_2); + } + + // ── Broker: buy / sell ───────────────────────────────────────────────────── + + public async Task> Buy(BuyRequest request) + { + return await PostAsync>("buy", request, ApiVersion1_2); + } + + public async Task> SimulateBuy(BuySimulateRequest request) + { + return await PostAsync>( + "buy/simulate", request, ApiVersion1_2); + } + + public async Task> Sell(SellRequest request) + { + return await PostAsync>("sell", request, ApiVersion1_2); + } + + public async Task> SimulateSell(SellSimulateRequest request) + { + return await PostAsync>( + "sell/simulate", request, ApiVersion1_2); + } + + // ── Broker: transaction extras ───────────────────────────────────────────── + + public async Task> UpdateBrokerTransaction(string txCode, + UpdateBrokerTransactionRequest request) + { + return await PutAsync>( + $"transaction/{txCode}", request, ApiVersion1_2); + } + + public async Task> ExecuteTransaction(ExecuteTransactionRequest request) + { + return await PostAsync>( + "transaction/execute", request, ApiVersion1_2); + } + + public async Task> GetTransactionFlow(string txCode) + { + return await GetAsync>( + $"transaction/{txCode}/flow", ApiVersion1_2); + } + + public async Task>> GetTransactionData(string txCode) + { + return await GetAsync>>( + $"transaction/{txCode}/data", ApiVersion1_2); + } + + public async Task> PostTransactionData(string txCode, string key, + PostTransactionDataModel request) + { + return await PostAsync>( + $"transaction/{txCode}/data/{key}", request, ApiVersion1_2); + } + + // ── Broker: merchant ────────────────────────────────────────────────────── + + public async Task>> GetMerchantTransactions( + GetMerchantTransactionsRequest? request = null) + { + return await GetAsync>>( + $"merchant?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> GetMerchantTransaction(string txCode) + { + return await GetAsync>( + $"merchant/{txCode}", ApiVersion1_2); + } + + public async Task> CreateMerchantTransaction( + CreateMerchantTransactionRequest request) + { + return await PostAsync>( + "merchant", request, ApiVersion1_2); + } + + public async Task> UpdateMerchantTransaction(string txCode, + UpdateMerchantTransactionRequest request) + { + return await PutAsync>( + $"merchant/{txCode}", request, ApiVersion1_2); + } + + public async Task> SimulateMerchantTransaction( + CreateMerchantTransactionRequest request) + { + return await PostAsync>( + "merchant/simulate", request, ApiVersion1_2); + } + + // ── Custodian: transactions ──────────────────────────────────────────────── + + public async Task>> GetCustodianTransactions( + GetCustodianTransactionsRequest? request = null) + { + return await GetAsync>>( + $"transactions/custodian?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> CustodianBuy(CustodianBuyRequest request) + { + return await PostAsync>( + "transactions/custodian/buy", request, ApiVersion1_2); + } + + public async Task> CustodianSell(CustodianSellRequest request) + { + return await PostAsync>( + "transactions/custodian/sell", request, ApiVersion1_2); + } + + public async Task> CustodianGift(CustodianGiftRequest request) + { + return await PostAsync>( + "transactions/custodian/gift", request, ApiVersion1_2); + } + + public async Task> CustodianClawback( + CustodianClawbackRequest request) + { + return await PostAsync>( + "transactions/custodian/clawback", request, ApiVersion1_2); + } + + public async Task> CustodianSendInternal( + CustodianSendInternalRequest request) + { + return await PostAsync>( + "transactions/custodian/sendinternal", request, ApiVersion1_2); + } + + public async Task> CustodianSendOut(CustodianSendOutRequest request) + { + return await PostAsync>( + "transactions/custodian/sendout", request, ApiVersion1_2); + } + + public async Task> CustodianSendToBucket( + CustodianSendToBucketRequest request) + { + return await PostAsync>( + "transactions/custodian/sendtobucket", request, ApiVersion1_2); + } + + public async Task> CustodianSwap(CustodianSwapRequest request) + { + return await PostAsync>( + "transactions/custodian/swap", request, ApiVersion1_2); + } + + public async Task> SimulateCustodianSwap( + CustodianSwapSimulateRequest request) + { + return await PostAsync>( + "transactions/custodian/swap/simulate", request, ApiVersion1_2); + } + + public async Task> CustodianPaymentRequest( + CustodianPaymentRequest request) + { + return await PostAsync>( + "transactions/custodian/payment", request, ApiVersion1_2); + } + + // ── Custodian: callbacks ─────────────────────────────────────────────────── + + public async Task>> GetCustodianCallbacks( + string txCode) + { + return await GetAsync>>( + $"transactions/custodian/{txCode}/callbacks", ApiVersion1_2); + } + + // ── Custodian: interest schedules ────────────────────────────────────────── + + public async Task>> GetInterestSchedules( + GetSchedulesRequest? request = null) + { + return await GetAsync>>( + $"schedules?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> GetInterestSchedule(Guid scheduleId) + { + return await GetAsync>( + $"schedules/{scheduleId}", ApiVersion1_2); + } + + public async Task> CreateInterestSchedule( + CreateCustodianScheduleRequest request) + { + return await PostAsync>( + "schedules", request, ApiVersion1_2); + } + + public async Task> UpdateInterestSchedule(Guid scheduleId, + EditCustodianScheduleRequest request) + { + return await PutAsync>( + $"schedules/{scheduleId}", request, ApiVersion1_2); + } + + public async Task DeleteInterestSchedule(Guid scheduleId) + { + await DeleteAsync($"schedules/{scheduleId}", ApiVersion1_2); + } + + public async Task> GetInterestScheduleInterval(Guid scheduleId, + GetScheduleIntervalsRequest? request = null) + { + return await GetAsync>( + $"schedules/{scheduleId}/intervals?{QueryParameterHelper.ToQueryString(request)}", ApiVersion1_2); + } + + public async Task> UpdateInterestScheduleSubInterval( + Guid scheduleId, Guid intervalId, Guid subIntervalId, EditCustodianSubIntervalRequest request) + { + return await PutAsync>( + $"schedules/{scheduleId}/intervals/{intervalId}/subintervals/{subIntervalId}", request, ApiVersion1_2); + } } \ No newline at end of file diff --git a/tests/Nexus.Crypto.SDK.Tests/NexusLabelApiSdkTests.cs b/tests/Nexus.Crypto.SDK.Tests/NexusLabelApiSdkTests.cs index 5ede827..23fcba7 100644 --- a/tests/Nexus.Crypto.SDK.Tests/NexusLabelApiSdkTests.cs +++ b/tests/Nexus.Crypto.SDK.Tests/NexusLabelApiSdkTests.cs @@ -473,6 +473,7 @@ public async Task GetBalancesMutations_Success() Assert.Equal(-2.8580000000000004E-06M, feeMutation.Value); } + [Fact] public async Task GetOrders_Success() { var mockResponseBody = """ @@ -565,7 +566,7 @@ public async Task GetOrders_Success() _logicHelper.MockResponseHandler.AddMockResponse( new HttpRequestMessage(HttpMethod.Get, new Uri( - "https://api.quantoznexus.com/orders")) + "https://api.quantoznexus.com/orders?exchangeCode=KRAKEN&cryptoCode=BTC¤cyCode=EUR&limit=1")) { Headers = { { "api_version", "1.2" } } }, @@ -587,7 +588,7 @@ public async Task GetOrders_Success() Assert.Equal(1, response.Values.Page); Assert.Equal(3, response.Values.Total); Assert.Equal(1, response.Values.TotalPages); - Assert.Equal(0, response.Values.FilteringParameters.Count); + Assert.Empty(response.Values.FilteringParameters); Assert.Equal("TEST_ORDER_CODE_3", response.Values.Records.First().OrderCode); Assert.Null(response.Values.Records.First().ExchangeTradeCode); }