Merge pull request #429 from JJ-Cro/p2pupdate

feat(v4.1.0): Add full support for P2P trading, Add suffix to recent Earn types (minor breaking change)
This commit is contained in:
Tiago
2025-03-26 10:34:37 +00:00
committed by GitHub
27 changed files with 1633 additions and 233 deletions

View File

@@ -0,0 +1,18 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Call the function
client
.getP2PUserInfo()
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,23 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
itemId: '1898988222063644672', // Replace with your ad ID
};
// Call the function
client
.getP2PAdDetail(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,29 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
status: null, // Optional: filter by order status
beginTime: null, // Optional: filter by start time
endTime: null, // Optional: filter by end time
tokenId: null, // Optional: filter by token ID
side: null, // Optional: filter by side (0: Buy, 1: Sell)
page: 1, // Required: page number
size: 1, // Required: rows per page
};
// Call the function
client
.getP2POrders(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,25 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
orderId: '1898976123321221120', // Replace with your order ID
size: '1', // Number of messages per page
currentPage: '1', // Optional: current page number
};
// Call the function
client
.getP2POrderMessages(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,21 @@
const { RestClientV5 } = require('bybit-api');
// Create a client
const client = new RestClientV5({
testnet: true,
key: 'XXXXX',
secret: 'XXXXX',
});
// Get account coins balance
client
.getP2PAccountCoinsBalance({
accountType: 'FUND',
coin: 'USDC',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,24 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
originalUid: '290118', // Replace with the counterparty user ID
orderId: '1900004704665923584', // Replace with your order ID
};
// Call the function
client
.getP2PCounterpartyUserInfo(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,22 @@
const { RestClientV5 } = require('bybit-api');
// Create a client
const client = new RestClientV5({
testnet: true,
key: 'XXXXX',
secret: 'XXXXX',
});
// Get market online ads list
client
.getP2POnlineAds({
tokenId: 'USDT',
currencyId: 'USD',
side: '0', // 0: buy; 1: sell
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,28 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET'
});
// Example parameters for getting personal P2P ads
const params = {
itemId: '123456789', // Optional: Specific advertisement ID
status: 1, // Optional: Advertisement status (1: active, 2: completed, 3: cancelled)
side: 1, // Optional: 0: buy; 1: sell
tokenId: 'USDT', // Optional: Token ID
page: 1, // Optional: Page number
size: 20, // Optional: Page size
currencyId: 'USD' // Optional: Currency ID
};
// Get personal P2P ads
client.getP2PPersonalAds(params)
.then(response => {
console.log('Response:', response);
})
.catch(error => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,23 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
orderId: '1900004704665923584', // Replace with your order ID
};
// Call the function
client
.getP2POrderDetail(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,29 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
status: 10, // waiting for buy pay
beginTime: '1741831397000', // Optional: filter by start time
endTime: '1741831424861', // Optional: filter by end time
tokenId: 'USDT', // Optional: filter by token
side: [0, 1], // Optional: filter by side (0: Buy, 1: Sell)
page: 1,
size: 3,
};
// Call the function
client
.getP2PPendingOrders(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,18 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Call the function
client
.getP2PUserPayments()
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,25 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
orderId: '1899736339155943424', // Replace with your order ID
paymentType: '14', // Payment method used
paymentId: '7110', // Payment method ID used
};
// Call the function
client
.markP2POrderAsPaid(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,47 @@
const { RestClientV5 } = require('bybit-api');
// Create a client
const client = new RestClientV5({
testnet: true,
key: 'XXXXX',
secret: 'XXXXX',
});
// Create new P2P advertisement
client
.createP2PAd({
tokenId: 'USDT',
currencyId: 'EUR',
side: '0',
priceType: '0',
premium: '',
price: '0.92',
minAmount: '20',
maxAmount: '45000',
paymentIds: ['7110'],
remark: 'test',
tradingPreferenceSet: {
isKyc: 1,
hasCompleteRateDay30: 1,
completeRateDay30: '95',
hasOrderFinishNumberDay30: 1,
hasRegisterTime: 0,
hasUnPostAd: 0,
isEmail: 0,
isMobile: 0,
nationalLimit: '',
orderFinishNumberDay30: 60,
registerTimeThreshold: 0,
verificationOrderLabels: [],
verificationOrderSwitch: false,
},
quantity: '20000',
paymentPeriod: '15',
itemType: 'ORIGIN',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,23 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
orderId: '1899736339155943424', // Replace with your order ID
};
// Call the function
client
.releaseP2POrder(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,20 @@
const { RestClientV5 } = require('bybit-api');
// Create a client
const client = new RestClientV5({
testnet: true,
key: 'XXXXX',
secret: 'XXXXX',
});
// Cancel P2P advertisement
client
.cancelP2PAd({
itemId: '1899667660027793408',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,28 @@
const { RestClientV5 } = require('bybit-api');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Example parameters
const params = {
message: 'hi, test',
contentType: 'text',
orderId: '1898976123321221120', // Replace with your order ID
// Optional parameters:
// msgUuid: 'your-message-uuid',
// fileName: 'example.pdf'
};
// Call the function
client
.sendP2POrderMessage(params)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

View File

@@ -0,0 +1,34 @@
const { RestClientV5 } = require('bybit-api');
// Create a client
const client = new RestClientV5({
testnet: true,
key: 'XXXXX',
secret: 'XXXXX',
});
// Update P2P advertisement
client
.updateP2PAd({
id: '1898988222063644672',
priceType: '0',
premium: '',
price: '0.914',
minAmount: '25',
maxAmount: '5000',
remark: '',
paymentIds: ['-1'],
tradingPreferenceSet: {},
actionType: 'ACTIVE',
quantity: '1000',
paymentPeriod: '15',
itemType: 'ORIGIN',
subsidyAd: false,
securityRiskToken: '',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});

View File

@@ -0,0 +1,23 @@
const { RestClientV5 } = require('bybit-api');
const fs = require('fs');
// Initialize the client with testnet mode
const client = new RestClientV5({
testnet: true,
key: 'YOUR_API_KEY',
secret: 'YOUR_API_SECRET',
});
// Create form data
const formData = new FormData();
formData.append('upload_file', fs.createReadStream('path/to/your/file.jpg')); // Replace with your file path
// Call the function
client
.uploadP2PChatFile(formData)
.then((response) => {
console.log('Response:', response);
})
.catch((error) => {
console.error('Error:', error);
});

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "bybit-api", "name": "bybit-api",
"version": "4.0.1", "version": "4.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "bybit-api", "name": "bybit-api",
"version": "4.0.1", "version": "4.1.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^1.7.9", "axios": "^1.7.9",

View File

@@ -1,6 +1,6 @@
{ {
"name": "bybit-api", "name": "bybit-api",
"version": "4.0.1", "version": "4.1.0",
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@@ -1,209 +1,226 @@
/* eslint-disable max-len */ /* eslint-disable max-len */
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { import {
APIResponseV3, APIResponseV3,
APIResponseV3WithTime, APIResponseV3WithTime,
AccountBorrowCollateralLimitV5, AccountBorrowCollateralLimitV5,
AccountCoinBalanceV5, AccountCoinBalanceV5,
AccountInfoV5, AccountInfoV5,
AccountMarginModeV5, AccountMarginModeV5,
AccountOrderV5, AccountOrderV5,
AccountTypeV5, AccountTypeV5,
AddOrReduceMarginParamsV5, AddOrReduceMarginParamsV5,
AddOrReduceMarginResultV5, AddOrReduceMarginResultV5,
AffiliateUserInfoV5, AffiliateUserInfoV5,
AffiliateUserListItemV5, AffiliateUserListItemV5,
AllCoinsBalanceV5, AllCoinsBalanceV5,
AllowedDepositCoinInfoV5, AllowedDepositCoinInfoV5,
AmendOrderParamsV5, AmendOrderParamsV5,
ApiKeyInfoV5, ApiKeyInfoV5,
AssetInfoV5, AssetInfoV5,
BatchAmendOrderParamsV5, BatchAmendOrderParamsV5,
BatchAmendOrderResultV5, BatchAmendOrderResultV5,
BatchCancelOrderParamsV5, BatchCancelOrderParamsV5,
BatchCancelOrderResultV5, BatchCancelOrderResultV5,
BatchCreateOrderResultV5, BatchCreateOrderResultV5,
BatchOrderParamsV5, BatchOrderParamsV5,
BatchOrdersResponseV5, BatchOrdersResponseV5,
BorrowCryptoLoanParamsV5, BorrowCryptoLoanParamsV5,
BorrowHistoryRecordV5, BorrowHistoryRecordV5,
BrokerIssuedVoucherV5, BrokerIssuedVoucherV5,
BrokerVoucherSpecV5, BrokerVoucherSpecV5,
CancelAllOrdersParamsV5, CancelAllOrdersParamsV5,
CancelOrderParamsV5, CancelOrderParamsV5,
CategoryCursorListV5, CategoryCursorListV5,
CategoryListV5, CategoryListV5,
CategorySymbolListV5, CategorySymbolListV5,
CategoryV5, CategoryV5,
ClosedPnLV5, ClosedPnLV5,
CoinExchangeRecordV5, CoinExchangeRecordV5,
CoinGreeksV5, CoinGreeksV5,
CoinInfoV5, CoinInfoV5,
CollateralInfoV5, CollateralInfoV5,
CompletedLoanOrderV5, CompletedLoanOrderV5,
ConfirmNewRiskLimitParamsV5, ConfirmNewRiskLimitParamsV5,
ConvertCoinSpecV5, ConvertCoinSpecV5,
ConvertCoinsParamsV5, ConvertCoinsParamsV5,
ConvertHistoryRecordV5, ConvertHistoryRecordV5,
ConvertQuoteV5, ConvertQuoteV5,
ConvertStatusV5, ConvertStatusV5,
CreateSubApiKeyParamsV5, CreateP2PAdParamsV5,
CreateSubApiKeyResultV5, CreateSubApiKeyParamsV5,
CreateSubMemberParamsV5, CreateSubApiKeyResultV5,
CreateSubMemberResultV5, CreateSubMemberParamsV5,
CursorListV5, CreateSubMemberResultV5,
CursorRowsV5, CursorListV5,
DCPInfoV5, CursorRowsV5,
DeleteSubMemberParamsV5, DCPInfoV5,
DeliveryPriceV5, DeleteSubMemberParamsV5,
DeliveryRecordV5, DeliveryPriceV5,
DepositAddressChainV5, DeliveryRecordV5,
DepositRecordV5, DepositAddressChainV5,
ExchangeBrokerAccountInfoV5, DepositRecordV5,
ExchangeBrokerEarningResultV5, EarnOrderHistoryV5,
ExchangeBrokerSubAccountDepositRecordV5, EarnPositionV5,
ExecutionV5, EarnProductV5,
FeeRateV5, ExchangeBrokerAccountInfoV5,
FundingRateHistoryResponseV5, ExchangeBrokerEarningResultV5,
GetAccountCoinBalanceParamsV5, ExchangeBrokerSubAccountDepositRecordV5,
GetAccountHistoricOrdersParamsV5, ExecutionV5,
GetAccountOrdersParamsV5, FeeRateV5,
GetAllCoinsBalanceParamsV5, FundingRateHistoryResponseV5,
GetAllowedDepositCoinInfoParamsV5, GetAccountCoinBalanceParamsV5,
GetAssetInfoParamsV5, GetAccountHistoricOrdersParamsV5,
GetBorrowHistoryParamsV5, GetAccountOrdersParamsV5,
GetBrokerIssuedVoucherParamsV5, GetAllCoinsBalanceParamsV5,
GetBrokerSubAccountDepositsV5, GetAllowedDepositCoinInfoParamsV5,
GetClassicTransactionLogsParamsV5, GetAssetInfoParamsV5,
GetClosedPnLParamsV5, GetBorrowHistoryParamsV5,
GetCoinExchangeRecordParamsV5, GetBrokerIssuedVoucherParamsV5,
GetCompletedLoanOrderHistoryParamsV5, GetBrokerSubAccountDepositsV5,
GetConvertHistoryParamsV5, GetClassicTransactionLogsParamsV5,
GetDeliveryPriceParamsV5, GetClosedPnLParamsV5,
GetDeliveryRecordParamsV5, GetCoinExchangeRecordParamsV5,
GetDepositRecordParamsV5, GetCompletedLoanOrderHistoryParamsV5,
GetExchangeBrokerEarningsParamsV5, GetConvertHistoryParamsV5,
GetExecutionListParamsV5, GetDeliveryPriceParamsV5,
GetFeeRateParamsV5, GetDeliveryRecordParamsV5,
GetFundingRateHistoryParamsV5, GetDepositRecordParamsV5,
GetHistoricalVolatilityParamsV5, GetEarnOrderHistoryParamsV5,
GetIndexPriceKlineParamsV5, GetEarnPositionParamsV5,
GetInstrumentsInfoParamsV5, GetExchangeBrokerEarningsParamsV5,
GetInsuranceParamsV5, GetExecutionListParamsV5,
GetInternalDepositRecordParamsV5, GetFeeRateParamsV5,
GetInternalTransferParamsV5, GetFundingRateHistoryParamsV5,
GetKlineParamsV5, GetHistoricalVolatilityParamsV5,
GetLoanLTVAdjustmentHistoryParamsV5, GetIndexPriceKlineParamsV5,
GetLongShortRatioParamsV5, GetInstrumentsInfoParamsV5,
GetMarkPriceKlineParamsV5, GetInsuranceParamsV5,
GetMovePositionHistoryParamsV5, GetInternalDepositRecordParamsV5,
GetOpenInterestParamsV5, GetInternalTransferParamsV5,
GetOptionDeliveryPriceParamsV5, GetKlineParamsV5,
GetOrderbookParamsV5, GetLoanLTVAdjustmentHistoryParamsV5,
GetPreUpgradeClosedPnlParamsV5, GetLongShortRatioParamsV5,
GetPreUpgradeOptionDeliveryRecordParamsV5, GetMarkPriceKlineParamsV5,
GetPreUpgradeOrderHistoryParamsV5, GetMovePositionHistoryParamsV5,
GetPreUpgradeTradeHistoryParamsV5, GetOpenInterestParamsV5,
GetPreUpgradeTransactionLogParamsV5, GetOptionDeliveryPriceParamsV5,
GetPreUpgradeUSDCSessionParamsV5, GetOrderbookParamsV5,
GetPremiumIndexPriceKlineParamsV5, GetP2PAccountCoinsBalanceParamsV5,
GetPublicTradingHistoryParamsV5, GetP2PCounterpartyUserInfoParamsV5,
GetRepaymentHistoryParamsV5, GetP2POnlineAdsParamsV5,
GetRiskLimitParamsV5, GetP2POrderMessagesParamsV5,
GetSettlementRecordParamsV5, GetP2POrdersParamsV5,
GetSpotLeveragedTokenOrderHistoryParamsV5, GetP2PPendingOrdersParamsV5,
GetSubAccountAllApiKeysParamsV5, GetP2PPersonalAdsParamsV5,
GetSubAccountDepositRecordParamsV5, GetPreUpgradeClosedPnlParamsV5,
GetTickersParamsV5, GetPreUpgradeOptionDeliveryRecordParamsV5,
GetTransactionLogParamsV5, GetPreUpgradeOrderHistoryParamsV5,
GetUniversalTransferRecordsParamsV5, GetPreUpgradeTradeHistoryParamsV5,
GetUnpaidLoanOrdersParamsV5, GetPreUpgradeTransactionLogParamsV5,
GetVIPMarginDataParamsV5, GetPreUpgradeUSDCSessionParamsV5,
GetWalletBalanceParamsV5, GetPremiumIndexPriceKlineParamsV5,
GetWithdrawalRecordsParamsV5, GetPublicTradingHistoryParamsV5,
HistoricalVolatilityV5, GetRepaymentHistoryParamsV5,
InstrumentInfoResponseV5, GetRiskLimitParamsV5,
InsuranceResponseV5, GetSettlementRecordParamsV5,
InternalDepositRecordV5, GetSpotLeveragedTokenOrderHistoryParamsV5,
InternalTransferRecordV5, GetSubAccountAllApiKeysParamsV5,
IssueVoucherParamsV5, GetSubAccountDepositRecordParamsV5,
LeverageTokenInfoV5, GetTickersParamsV5,
LeveragedTokenMarketResultV5, GetTransactionLogParamsV5,
LoanLTVAdjustmentHistoryV5, GetUniversalTransferRecordsParamsV5,
LongShortRatioV5, GetUnpaidLoanOrdersParamsV5,
MMPModifyParamsV5, GetVIPMarginDataParamsV5,
MMPStateV5, GetWalletBalanceParamsV5,
MovePositionHistoryV5, GetWithdrawalRecordsParamsV5,
MovePositionParamsV5, HistoricalVolatilityV5,
MovePositionResultV5, InstrumentInfoResponseV5,
OHLCKlineV5, InsuranceResponseV5,
OHLCVKlineV5, InternalDepositRecordV5,
OpenInterestResponseV5, InternalTransferRecordV5,
OptionDeliveryPriceV5, IssueVoucherParamsV5,
OrderParamsV5, LeverageTokenInfoV5,
OrderResultV5, LeveragedTokenMarketResultV5,
OrderSideV5, LoanLTVAdjustmentHistoryV5,
OrderbookResponseV5, LongShortRatioV5,
PositionInfoParamsV5, MMPModifyParamsV5,
PositionV5, MMPStateV5,
PreUpgradeOptionsDelivery, MarkP2POrderAsPaidParamsV5,
PreUpgradeTransaction, MovePositionHistoryV5,
PreUpgradeUSDCSessionSettlement, MovePositionParamsV5,
PublicTradeV5, MovePositionResultV5,
PurchaseSpotLeveragedTokenParamsV5, OHLCKlineV5,
PurchaseSpotLeveragedTokenResultV5, OHLCVKlineV5,
RedeemSpotLeveragedTokenParamsV5, OpenInterestResponseV5,
RedeemSpotLeveragedTokenResultV5, OptionDeliveryPriceV5,
RepayLiabilityParamsV5, OrderParamsV5,
RepayLiabilityResultV5, OrderResultV5,
RepaymentHistoryV5, OrderSideV5,
RequestConvertQuoteParamsV5, OrderbookResponseV5,
RiskLimitV5, P2PAccountCoinsBalanceV5,
SetAutoAddMarginParamsV5, P2PAdDetailV5,
SetCollateralCoinParamsV5, P2PCounterpartyUserInfoV5,
SetLeverageParamsV5, P2PCreateAdResponseV5,
SetRiskLimitParamsV5, P2POnlineAdsResponseV5,
SetRiskLimitResultV5, P2POrderDetailV5,
SetTPSLModeParamsV5, P2POrderMessageV5,
SetTradingStopParamsV5, P2POrdersResponseV5,
SettlementRecordV5, P2PPersonalAdsResponseV5,
SpotBorrowCheckResultV5, P2PUserInfoV5,
SpotLeveragedTokenOrderHistoryV5, P2PUserPaymentV5,
SpotMarginStateV5, PositionInfoParamsV5,
SubMemberV5, PositionV5,
SwitchIsolatedMarginParamsV5, PreUpgradeOptionsDelivery,
SwitchPositionModeParamsV5, PreUpgradeTransaction,
TPSLModeV5, PreUpgradeUSDCSessionSettlement,
TickerLinearInverseV5, PublicTradeV5,
TickerOptionV5, PurchaseSpotLeveragedTokenParamsV5,
TickerSpotV5, PurchaseSpotLeveragedTokenResultV5,
TransactionLogV5, RedeemSpotLeveragedTokenParamsV5,
UnifiedAccountUpgradeResultV5, RedeemSpotLeveragedTokenResultV5,
UniversalTransferParamsV5, RepayLiabilityParamsV5,
UniversalTransferRecordV5, RepayLiabilityResultV5,
UnpaidLoanOrderV5, RepaymentHistoryV5,
UpdateApiKeyParamsV5, RequestConvertQuoteParamsV5,
UpdateApiKeyResultV5, RiskLimitV5,
VIPMarginDataV5, SendP2POrderMessageParamsV5,
VaspEntityV5, SetAutoAddMarginParamsV5,
VipBorrowableCoinsV5, SetCollateralCoinParamsV5,
VipCollateralCoinsV5, SetLeverageParamsV5,
WalletBalanceV5, SetRiskLimitParamsV5,
WithdrawParamsV5, SetRiskLimitResultV5,
WithdrawableAmountV5, SetTPSLModeParamsV5,
WithdrawalRecordV5, SetTradingStopParamsV5,
SettlementRecordV5,
SpotBorrowCheckResultV5,
SpotLeveragedTokenOrderHistoryV5,
SpotMarginStateV5,
SubMemberV5,
SubmitStakeRedeemParamsV5,
SwitchIsolatedMarginParamsV5,
SwitchPositionModeParamsV5,
TPSLModeV5,
TickerLinearInverseV5,
TickerOptionV5,
TickerSpotV5,
TransactionLogV5,
UnifiedAccountUpgradeResultV5,
UniversalTransferParamsV5,
UniversalTransferRecordV5,
UnpaidLoanOrderV5,
UpdateApiKeyParamsV5,
UpdateApiKeyResultV5,
UpdateP2PAdParamsV5,
VIPMarginDataV5,
VaspEntityV5,
VipBorrowableCoinsV5,
VipCollateralCoinsV5,
WalletBalanceV5,
WithdrawParamsV5,
WithdrawableAmountV5,
WithdrawalRecordV5,
} from './types'; } from './types';
import {
GetEarnOrderHistoryParams,
GetEarnPositionParams,
SubmitStakeRedeemParams,
} from './types/request/v5-earn';
import {
EarnOrderHistory,
EarnPosition,
EarnProduct,
} from './types/response/v5-earn';
import { REST_CLIENT_TYPE_ENUM } from './util'; import { REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient'; import BaseRestClient from './util/BaseRestClient';
@@ -2570,7 +2587,7 @@ export class RestClientV5 extends BaseRestClient {
*/ */
getEarnProduct(params: { category: string; coin?: string }): Promise< getEarnProduct(params: { category: string; coin?: string }): Promise<
APIResponseV3WithTime<{ APIResponseV3WithTime<{
list: EarnProduct[]; list: EarnProductV5[];
}> }>
> { > {
return this.get('/v5/earn/product', params); return this.get('/v5/earn/product', params);
@@ -2586,7 +2603,7 @@ export class RestClientV5 extends BaseRestClient {
* within 48 hours. Once the redemption request is initiated, it cannot be canceled, * within 48 hours. Once the redemption request is initiated, it cannot be canceled,
* and your principal will continue to earn interest until the process is completed. * and your principal will continue to earn interest until the process is completed.
*/ */
submitStakeRedeem(params: SubmitStakeRedeemParams): Promise< submitStakeRedeem(params: SubmitStakeRedeemParamsV5): Promise<
APIResponseV3WithTime<{ APIResponseV3WithTime<{
orderId: string; orderId: string;
orderLinkId: string; orderLinkId: string;
@@ -2603,9 +2620,9 @@ export class RestClientV5 extends BaseRestClient {
* Note: Either orderId or orderLinkId is required. If both are passed, * Note: Either orderId or orderLinkId is required. If both are passed,
* make sure they're matched, otherwise returning empty result * make sure they're matched, otherwise returning empty result
*/ */
getEarnOrderHistory(params: GetEarnOrderHistoryParams): Promise< getEarnOrderHistory(params: GetEarnOrderHistoryParamsV5): Promise<
APIResponseV3WithTime<{ APIResponseV3WithTime<{
list: EarnOrderHistory[]; list: EarnOrderHistoryV5[];
}> }>
> { > {
return this.getPrivate('/v5/earn/order', params); return this.getPrivate('/v5/earn/order', params);
@@ -2618,11 +2635,208 @@ export class RestClientV5 extends BaseRestClient {
* *
* Note: Fully redeemed position is also returned in the response * Note: Fully redeemed position is also returned in the response
*/ */
getEarnPosition(params: GetEarnPositionParams): Promise< getEarnPosition(params: GetEarnPositionParamsV5): Promise<
APIResponseV3WithTime<{ APIResponseV3WithTime<{
list: EarnPosition[]; list: EarnPositionV5[];
}> }>
> { > {
return this.getPrivate('/v5/earn/position', params); return this.getPrivate('/v5/earn/position', params);
} }
/**
*
****** P2P TRADING
*
*/
/**
*
* General P2P
*/
/**
* Get coin balance of all account types under the master account, and sub account.
*
* Note: this field is mandatory for accountType=UNIFIED, and supports up to 10 coins each request
*/
getP2PAccountCoinsBalance(
params: GetP2PAccountCoinsBalanceParamsV5,
): Promise<APIResponseV3WithTime<P2PAccountCoinsBalanceV5>> {
return this.getPrivate(
'/v5/asset/transfer/query-account-coins-balance',
params,
);
}
/**
*
* Advertisement P2P
*/
/**
* Get market online ads list
*/
getP2POnlineAds(
params: GetP2POnlineAdsParamsV5,
): Promise<APIResponseV3WithTime<P2POnlineAdsResponseV5>> {
return this.post('/v5/p2p/item/online', params);
}
/**
* Post new P2P advertisement
*/
createP2PAd(
params: CreateP2PAdParamsV5,
): Promise<APIResponseV3WithTime<P2PCreateAdResponseV5>> {
return this.postPrivate('/v5/p2p/item/create', params);
}
/**
* Cancel P2P advertisement
*/
cancelP2PAd(params: { itemId: string }): Promise<
APIResponseV3WithTime<{
securityRiskToken: string;
riskTokenType: string;
riskVersion: string;
needSecurityRisk: boolean;
}>
> {
return this.postPrivate('/v5/p2p/item/cancel', params);
}
/**
* Update or relist P2P advertisement
*/
updateP2PAd(
params: UpdateP2PAdParamsV5,
): Promise<APIResponseV3WithTime<P2PCreateAdResponseV5>> {
return this.postPrivate('/v5/p2p/item/update', params);
}
/**
* Get personal P2P ads list
*
*/
getP2PPersonalAds(
params: GetP2PPersonalAdsParamsV5,
): Promise<APIResponseV3WithTime<P2PPersonalAdsResponseV5>> {
return this.postPrivate('/v5/p2p/item/personal/list', params);
}
/**
* Get P2P ad details
*/
getP2PAdDetail(params: {
itemId: string;
}): Promise<APIResponseV3WithTime<P2PAdDetailV5>> {
return this.postPrivate('/v5/p2p/item/info', params);
}
/**
*
* Orders P2P
*/
/**
* Get all P2P orders
*
*/
getP2POrders(
params: GetP2POrdersParamsV5,
): Promise<APIResponseV3WithTime<P2POrdersResponseV5>> {
return this.postPrivate('/v5/p2p/order/simplifyList', params);
}
/**
* Get P2P order details
*
*/
getP2POrderDetail(params: {
orderId: string;
}): Promise<APIResponseV3WithTime<P2POrderDetailV5>> {
return this.postPrivate('/v5/p2p/order/info', params);
}
/**
* Get pending P2P orders
*/
getP2PPendingOrders(
params: GetP2PPendingOrdersParamsV5,
): Promise<APIResponseV3WithTime<P2POrdersResponseV5>> {
return this.postPrivate('/v5/p2p/order/pending/simplifyList', params);
}
/**
* Mark P2P order as paid
*/
markP2POrderAsPaid(
params: MarkP2POrderAsPaidParamsV5,
): Promise<APIResponseV3WithTime<null>> {
return this.postPrivate('/v5/p2p/order/pay', params);
}
/**
* Release digital assets in a P2P order
*/
releaseP2POrder(params: {
orderId: string;
}): Promise<APIResponseV3WithTime<null>> {
return this.postPrivate('/v5/p2p/order/finish', params);
}
/**
* Send chat message in a P2P order
*/
sendP2POrderMessage(
params: SendP2POrderMessageParamsV5,
): Promise<APIResponseV3WithTime<null>> {
return this.postPrivate('/v5/p2p/order/message/send', params);
}
/**
* Upload chat file for P2P order
*/
uploadP2PChatFile(params: {
upload_file: File; // Only supports: jpg, png, jpeg, pdf, mp4
}): Promise<APIResponseV3WithTime<null>> {
return this.postPrivate('/v5/p2p/oss/upload_file', params);
}
/**
* Get chat messages in a P2P order
*/
getP2POrderMessages(
params: GetP2POrderMessagesParamsV5,
): Promise<APIResponseV3WithTime<P2POrderMessageV5[]>> {
return this.postPrivate('/v5/p2p/order/message/listpage', params);
}
/**
*
* User P2P
*/
/**
* Get P2P user account information
*/
getP2PUserInfo(): Promise<APIResponseV3WithTime<P2PUserInfoV5>> {
return this.postPrivate('/v5/p2p/user/personal/info');
}
/**
* Get counterparty user information in a P2P order
*/
getP2PCounterpartyUserInfo(
params: GetP2PCounterpartyUserInfoParamsV5,
): Promise<APIResponseV3WithTime<P2PCounterpartyUserInfoV5>> {
return this.postPrivate('/v5/p2p/user/order/personal/info', params);
}
/**
* Get user payment information
*/
getP2PUserPayments(): Promise<APIResponseV3WithTime<P2PUserPaymentV5[]>> {
return this.postPrivate('/v5/p2p/user/payment/list');
}
} }

View File

@@ -1,19 +1,21 @@
export * from './account-asset'; export * from './account-asset';
export * from './copy-trading';
export * from './contract'; export * from './contract';
export * from './linear'; export * from './copy-trading';
export * from './inverse'; export * from './inverse';
export * from './usdc-perp'; export * from './linear';
export * from './usdc-options';
export * from './usdc-shared';
export * from './unified-margin'; export * from './unified-margin';
export * from './usdc-options';
export * from './usdc-perp';
export * from './usdc-shared';
export * from './v5-account'; export * from './v5-account';
export * from './v5-asset'; export * from './v5-asset';
export * from './v5-market';
export * from './v5-position';
export * from './v5-pre-upgrade';
export * from './v5-trade';
export * from './v5-user';
export * from './v5-spot-leverage-token';
export * from './v5-broker'; export * from './v5-broker';
export * from './v5-crypto-loan'; export * from './v5-crypto-loan';
export * from './v5-earn';
export * from './v5-market';
export * from './v5-p2p-trading';
export * from './v5-position';
export * from './v5-pre-upgrade';
export * from './v5-spot-leverage-token';
export * from './v5-trade';
export * from './v5-user';

View File

@@ -1,4 +1,4 @@
export interface SubmitStakeRedeemParams { export interface SubmitStakeRedeemParamsV5 {
category: string; category: string;
orderType: 'Stake' | 'Redeem'; orderType: 'Stake' | 'Redeem';
accountType: 'FUND' | 'UNIFIED'; accountType: 'FUND' | 'UNIFIED';
@@ -8,13 +8,13 @@ export interface SubmitStakeRedeemParams {
orderLinkId: string; orderLinkId: string;
} }
export interface GetEarnOrderHistoryParams { export interface GetEarnOrderHistoryParamsV5 {
category: string; category: string;
orderId?: string; orderId?: string;
orderLinkId?: string; orderLinkId?: string;
} }
export interface GetEarnPositionParams { export interface GetEarnPositionParamsV5 {
category: string; category: string;
productId?: string; productId?: string;
coin?: string; coin?: string;

View File

@@ -0,0 +1,119 @@
export interface GetP2PAccountCoinsBalanceParamsV5 {
memberId?: string;
accountType: string;
coin?: string;
withBonus?: 0 | 1;
}
export interface GetP2POnlineAdsParamsV5 {
tokenId: string;
currencyId: string;
side: '0' | '1'; // 0: buy; 1: sell
page?: string;
size?: string;
}
export interface P2PTradingPreferenceSetV5 {
hasUnPostAd?: 0 | 1;
isKyc?: 0 | 1;
isEmail?: 0 | 1;
isMobile?: 0 | 1;
hasRegisterTime?: 0 | 1;
registerTimeThreshold?: number;
orderFinishNumberDay30?: number;
completeRateDay30?: string;
nationalLimit?: string;
hasOrderFinishNumberDay30?: 0 | 1;
hasCompleteRateDay30?: 0 | 1;
hasNationalLimit?: 0 | 1;
}
export interface CreateP2PAdParamsV5 {
tokenId: string;
currencyId: string;
side: '0' | '1'; // 0: buy; 1: sell
priceType: '0' | '1'; // 0: fixed rate; 1: floating rate
premium: string;
price: string;
minAmount: string;
maxAmount: string;
remark: string;
tradingPreferenceSet: P2PTradingPreferenceSetV5;
paymentIds: string[];
quantity: string;
paymentPeriod: string;
itemType: 'ORIGIN' | 'BULK';
}
export interface UpdateP2PAdParamsV5 {
id: string;
priceType: '0' | '1'; // 0: fixed rate; 1: floating rate
premium: string;
price: string;
minAmount: string;
maxAmount: string;
remark: string;
tradingPreferenceSet: P2PTradingPreferenceSetV5;
paymentIds: string[];
actionType: 'MODIFY' | 'ACTIVE'; // MODIFY: modify adv; ACTIVE: reonline adv
quantity: string;
paymentPeriod: string;
itemType?: 'ORIGIN' | 'BULK';
subsidyAd?: boolean;
securityRiskToken?: string;
}
export interface GetP2PPersonalAdsParamsV5 {
itemId?: string;
status?: '1' | '2'; // 1: Sold Out; 2: Available
side?: '0' | '1'; // 0: buy; 1: sell
tokenId?: string;
page?: string;
size?: string;
currencyId?: string;
}
export interface GetP2POrdersParamsV5 {
status?: number;
beginTime?: string;
endTime?: string;
tokenId?: string;
side?: number[];
page: number;
size: number;
}
export interface GetP2PPendingOrdersParamsV5 {
status?: number;
beginTime?: string;
endTime?: string;
tokenId?: string;
side?: number[];
page: number;
size: number;
}
export interface MarkP2POrderAsPaidParamsV5 {
orderId: string;
paymentType: string;
paymentId: string;
}
export interface SendP2POrderMessageParamsV5 {
message: string;
contentType: string;
orderId: string;
msgUuid?: string;
fileName?: string;
}
export interface GetP2POrderMessagesParamsV5 {
orderId: string;
currentPage?: string;
size: string;
}
export interface GetP2PCounterpartyUserInfoParamsV5 {
originalUid: string;
orderId: string;
}

View File

@@ -2,15 +2,17 @@ export * from './account-asset';
export * from './contract'; export * from './contract';
export * from './shared'; export * from './shared';
export * from './spot'; export * from './spot';
export * from './usdt-perp';
export * from './unified-margin'; export * from './unified-margin';
export * from './usdt-perp';
export * from './v5-account'; export * from './v5-account';
export * from './v5-asset'; export * from './v5-asset';
export * from './v5-broker';
export * from './v5-crypto-loan';
export * from './v5-market'; export * from './v5-market';
export * from './v5-p2p-trading';
export * from './v5-position'; export * from './v5-position';
export * from './v5-preupgrade';
export * from './v5-spot-leverage-token';
export * from './v5-trade'; export * from './v5-trade';
export * from './v5-user'; export * from './v5-user';
export * from './v5-spot-leverage-token'; export * from './v5-earn';
export * from './v5-broker';
export * from './v5-preupgrade';
export * from './v5-crypto-loan';

View File

@@ -1,4 +1,4 @@
export interface EarnProduct { export interface EarnProductV5 {
category: string; category: string;
estimateApr: string; estimateApr: string;
coin: string; coin: string;
@@ -9,7 +9,7 @@ export interface EarnProduct {
status: 'Available' | 'NotAvailable'; status: 'Available' | 'NotAvailable';
} }
export interface EarnOrderHistory { export interface EarnOrderHistoryV5 {
coin: string; coin: string;
orderValue: string; orderValue: string;
orderType: 'Redeem' | 'Stake'; orderType: 'Redeem' | 'Stake';
@@ -21,7 +21,7 @@ export interface EarnOrderHistory {
updatedAt: string; updatedAt: string;
} }
export interface EarnPosition { export interface EarnPositionV5 {
coin: string; coin: string;
productId: string; productId: string;
amount: string; amount: string;

View File

@@ -0,0 +1,603 @@
import { P2PTradingPreferenceSetV5 } from '../request/v5-p2p-trading';
export interface P2PCoinBalanceV5 {
coin: string;
transferBalance: string;
walletBalance: string;
bonus: string;
}
export interface P2PAccountCoinsBalanceV5 {
memberId: string;
accountType: string;
balance: P2PCoinBalanceV5[];
}
export interface P2POnlineAdV5 {
id: string;
nickName: string;
tokenId: string;
currencyId: string;
side: string;
price: string;
lastQuantity: string;
minAmount: string;
maxAmount: string;
payments: string[];
recentOrderNum: number;
recentExecuteRate: number;
isOnline: boolean;
authTag: string[];
paymentPeriod: number;
accountId: number;
userId: number;
priceType: number;
premium: string;
quantity: string;
frozenQuantity: string;
executedQuantity: string;
remark: string;
status: number;
createDate: string;
orderNum: string;
finishNum: string;
fee: string;
lastLogoutTime: string;
blocked: string;
makerContact: boolean;
symbolInfo: {
id: string;
exchangeId: string;
orgId: string;
tokenId: string;
currencyId: string;
status: string;
lowerLimitAlarm: number;
upperLimitAlarm: number;
itemDownRange: string;
itemUpRange: string;
currencyMinQuote: string;
currencyMaxQuote: string;
currencyLowerMaxQuote: string;
tokenMinQuote: string;
tokenMaxQuote: string;
kycCurrencyLimit: string;
itemSideLimit: string;
buyFeeRate: string;
sellFeeRate: string;
orderAutoCancelMinute: number;
orderFinishMinute: number;
tradeSide: number;
currency: {
id: string;
exchangeId: string;
orgId: string;
currencyId: string;
scale: number;
};
token: {
id: string;
exchangeId: string;
orgId: string;
tokenId: string;
scale: number;
sequence: number;
};
buyAd: number;
sellAd: number;
};
tradingPreferenceSet: {
hasUnPostAd: number;
isKyc: number;
isEmail: number;
isMobile: number;
hasRegisterTime: number;
registerTimeThreshold: number;
orderFinishNumberDay30: number;
completeRateDay30: number;
nationalLimit: number;
hasOrderFinishNumberDay30: number;
hasCompleteRateDay30: number;
hasNationalLimit: number;
};
version: number;
authStatus: number;
recommend: boolean;
recommendTag: string;
userType: string;
itemType: string;
}
export interface P2POnlineAdsResponseV5 {
count: number;
items: P2POnlineAdV5[];
}
export interface P2PCreateAdResponseV5 {
itemId: string;
securityRiskToken: string;
riskTokenType: string;
riskVersion: string;
needSecurityRisk: boolean;
}
export interface P2PPaymentTermV5 {
id: string;
realName: string;
paymentType: number;
bankName: string;
branchName: string;
accountNo: string;
qrcode: string;
visible: number;
payMessage: string;
firstName: string;
lastName: string;
secondLastName: string;
clabe: string;
debitCardNumber: string;
mobile: string;
businessName: string;
concept: string;
paymentExt1: string;
paymentExt2: string;
paymentExt3: string;
paymentExt4: string;
paymentExt5: string;
paymentExt6: string;
paymentTemplateVersion: number;
paymentConfig: {
paymentType: number;
paymentName: string;
paymentDialect: string;
};
realNameVerified: boolean;
}
export interface P2PAdDetailV5 {
id: string;
accountId: string;
userId: string;
nickName: string;
tokenId: string;
tokenName: string;
currencyId: string;
side: number;
priceType: number;
price: string;
premium: string;
lastQuantity: string;
quantity: string;
frozenQuantity: string;
executedQuantity: string;
minAmount: string;
maxAmount: string;
remark: string;
status: number;
createDate: string;
payments: string[];
orderNum: number;
finishNum: number;
recentOrderNum: number;
recentExecuteRate: number;
fee: string;
isOnline: boolean;
lastLogoutTime: string;
symbolInfo: {
id: string;
exchangeId: string;
orgId: string;
tokenId: string;
currencyId: string;
status: number;
lowerLimitAlarm: number;
upperLimitAlarm: number;
itemDownRange: string;
itemUpRange: string;
currencyMinQuote: string;
currencyMaxQuote: string;
currencyLowerMaxQuote: string;
tokenMinQuote: string;
tokenMaxQuote: string;
kycCurrencyLimit: string;
itemSideLimit: number;
buyFeeRate: string;
sellFeeRate: string;
orderAutoCancelMinute: number;
orderFinishMinute: number;
tradeSide: number;
currency: {
id: string;
exchangeId: string;
orgId: string;
currencyId: string;
scale: number;
};
token: {
id: string;
exchangeId: string;
orgId: string;
tokenId: string;
scale: number;
sequence: number;
};
buyAd: {
paymentPeriods: number[];
};
sellAd: {
paymentPeriods: number[];
};
};
tradingPreferenceSet: P2PTradingPreferenceSetV5;
paymentTerms: P2PPaymentTermV5[];
version: number;
updateDate: string;
feeRate: string;
paymentPeriod: number;
itemType: string;
}
export interface P2PPersonalAdsResponseV5 {
count: number;
items: P2PAdDetailV5[];
hiddenFlag: boolean;
}
export interface P2POrderExtensionV5 {
isDelayWithdraw: boolean;
delayTime: string;
startTime: string;
}
export interface P2POrderV5 {
id: string;
side: number;
tokenId: string;
orderType: string;
amount: string;
currencyId: string;
price: string;
notifyTokenQuantity?: string;
notifyTokenId?: string;
fee: string;
targetNickName: string;
targetUserId: string;
status: number;
selfUnreadMsgCount: string;
createDate: string;
transferLastSeconds: string;
appealLastSeconds: string;
userId: string;
sellerRealName: string;
buyerRealName: string;
judgeInfo: {
autoJudgeUnlockTime: string;
dissentResult: string;
preDissent: string;
postDissent: string;
};
unreadMsgCount: string;
extension: P2POrderExtensionV5;
bulkOrderFlag: boolean;
}
export interface P2POrdersResponseV5 {
count: number;
items: P2POrderV5[];
}
export interface P2PPaymentConfigItemV5 {
view: boolean;
name: string;
label: string;
placeholder: string;
type: string;
maxLength: string;
required: boolean;
}
export interface P2PPaymentConfigV5 {
paymentType: string;
checkType: number;
sort: number;
paymentName: string;
addTips: string;
itemTips: string;
online: number;
items: P2PPaymentConfigItemV5[];
}
export interface P2PPaymentTermDetailV5 {
id: string;
realName: string;
paymentType: number;
bankName: string;
branchName: string;
accountNo: string;
qrcode: string;
visible: number;
payMessage: string;
firstName: string;
lastName: string;
secondLastName: string;
clabe: string;
debitCardNumber: string;
mobile: string;
businessName: string;
concept: string;
online: string;
paymentExt1: string;
paymentExt2: string;
paymentExt3: string;
paymentExt4: string;
paymentExt5: string;
paymentExt6: string;
paymentTemplateVersion: number;
paymentConfigVo: P2PPaymentConfigV5;
ruPaymentPrompt: boolean;
}
export interface P2PAppraiseInfoV5 {
anonymous: string;
appraiseContent: string;
appraiseId: string;
appraiseType: string;
modifyFlag: string;
updateDate: string;
}
export interface P2PJudgeInfoV5 {
autoJudgeUnlockTime: string;
dissentResult: string;
preDissent: string;
postDissent: string;
}
export interface P2POrderDetailV5 {
id: string;
side: number;
itemId: string;
accountId: string;
userId: string;
nickName: string;
makerUserId: string;
targetAccountId: string;
targetUserId: string;
targetNickName: string;
targetFirstName: string;
targetSecondName: string;
targetUserAuthStatus: number;
targetConnectInformation: string;
payerRealName: string;
sellerRealName: string;
buyerRealName: string;
tokenId: string;
tokenName: string;
currencyId: string;
price: string;
quantity: string;
amount: string;
payCode: string;
paymentType: number;
transferDate: string;
status: number;
createDate: string;
paymentTermList: P2PPaymentTermDetailV5[];
remark: string;
transferLastSeconds: string;
recentOrderNum: number;
recentExecuteRate: number;
appealLastSeconds: string;
appealContent: string;
appealType: number;
appealNickName: string;
canAppeal: string;
totalAppealTimes: string;
appealedTimes: string;
paymentTermResult: P2PPaymentTermDetailV5;
orderFinishMinute: number;
confirmedPayTerm: P2PPaymentTermDetailV5;
makerFee: string;
takerFee: string;
fee: string;
showContact: boolean;
tokenBalance: string;
fiatBalance: string;
unreadMsgCount: string;
updateDate: string;
extension: P2POrderExtensionV5;
selfUnreadMsgCount: string;
judgeType: string;
canReport: boolean;
canReportDisagree: boolean;
canReportType: string[];
canReportDisagreeType: string[];
appraiseStatus: string;
appraiseInfo: P2PAppraiseInfoV5;
canReportDisagreeTypes: string[];
canReportTypes: string[];
orderType: string;
middleToken: string;
beforePrice: string;
beforeQuantity: string;
beforeToken: string;
alternative: string;
appealUserId: string;
notifyTokenId: string;
notifyTokenQuantity: string;
cancelResponsible: string;
chainType: string;
chainAddress: string;
tradeHashCode: string;
estimatedGasFee: string;
gasFeeTokenId: string;
tradingFeeTokenId: string;
onChainInfo: string;
transactionId: string;
displayRefund: string;
chainWithdrawLastSeconds: string;
chainTransferLastSeconds: string;
orderSource: string;
cancelReason: string;
sellerCancelExamineRemainTime: string;
needSellerExamineCancel: boolean;
couponCurrencyAmount: string;
totalCurrencyAmount: string;
usedCoupon: boolean;
couponTokenId: string;
couponQuantity: string;
completedOrderAppealCount: number;
totalCompletedOrderAppealCount: number;
realOrderStatus: number;
appealVersion: number;
judgeInfo: P2PJudgeInfoV5;
helpType: string;
appealFlowStatus: string;
appealSubStatus: string;
bulkOrderFlag: boolean;
targetUserType: string;
targetUserDisplays: string[];
appealProcessChangeFlag: boolean;
appealNegotiationNode: number;
}
export interface P2POrderMessageV5 {
id: string;
message: string;
userId: string;
msgType: number;
msgCode: number;
createDate: string;
contentType: string;
orderId: string;
msgUuid: string;
nickName: string;
fileName: string;
accountId: string;
isRead: number;
read: number;
roleType: string;
onlyForCustomer: number;
}
export interface P2PUserInfoV5 {
nickName: string;
defaultNickName: boolean;
isOnline: boolean;
kycLevel: string;
email: string;
mobile: string;
lastLogoutTime: string;
recentRate: string;
totalFinishCount: number;
totalFinishSellCount: number;
totalFinishBuyCount: number;
recentFinishCount: number;
averageReleaseTime: string;
averageTransferTime: string;
accountCreateDays: number;
firstTradeDays: number;
realName: string;
recentTradeAmount: string;
totalTradeAmount: string;
registerTime: string;
authStatus: number;
kycCountryCode: string;
blocked: string;
goodAppraiseRate: string;
goodAppraiseCount: number;
badAppraiseCount: number;
accountId: number;
paymentCount: number;
contactCount: number;
vipLevel: number;
userCancelCountLimit: number;
paymentRealNameUneditable: boolean;
userId: string;
realNameEn: string;
}
export interface P2PCounterpartyUserInfoV5 {
nickName: string;
defaultNickName: boolean;
whiteFlag: number;
contactConfig: boolean;
isOnline: boolean;
email: string;
mobile: string;
kycLevel: number;
lastLogoutTime: string;
recentRate: number;
totalFinishCount: number;
totalFinishSellCount: number;
totalFinishBuyCount: number;
recentFinishCount: number;
averageReleaseTime: string;
averageTransferTime: string;
accountCreateDays: number;
firstTradeDays: number;
realName: string;
recentTradeAmount: string;
totalTradeAmount: string;
executeNum: number;
orderNum: number;
hasUnPostAd: number;
registerTime: string;
authStatus: number;
kycCountryCode: string;
blocked: string;
goodAppraiseRate: string;
goodAppraiseCount: number;
badAppraiseCount: number;
accountId: string;
paymentCount: number;
contactCount: number;
realNameMask: string;
vipLevel: number;
vipProfit: [];
userTag: [];
userCancelCountLimit: number;
paymentRealNameUneditable: boolean;
lostRoleAffected: boolean;
userCurPrivilege: string[];
userType: string;
userId: string;
realNameEn: string;
canSubOnline: boolean;
curPrivilegeInfo: [];
openApiSwitch: number;
}
export interface P2PUserPaymentV5 {
id: string;
realName: string;
paymentType: string;
bankName: string;
branchName: string;
accountNo: string;
qrcode: string;
visible: number;
payMessage: string;
firstName: string;
lastName: string;
secondLastName: string;
clabe: string;
debitCardNumber: string;
mobile: string;
businessName: string;
concept: string;
online: string;
countNo: string;
paymentExt1: string;
paymentExt2: string;
paymentExt3: string;
paymentExt4: string;
paymentExt5: string;
paymentExt6: string;
paymentTemplateVersion: number;
hasPaymentTemplateChanged: boolean;
paymentConfigVo: P2PPaymentConfigV5;
realNameVerified: boolean;
channel: string;
currencyBalance: string[];
}