Skip to content

Commit

Permalink
fix(coinbase): sync markets loading (#22146)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiei authored Apr 14, 2024
1 parent d9e783e commit a745ae7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ts/src/coinbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,12 +1195,17 @@ export default class coinbase extends Exchange {
this.v3PrivateGetBrokerageProducts (params),
this.v3PrivateGetBrokerageTransactionSummary (params),
];
const unresolvedContractPromises = [
this.v3PrivateGetBrokerageProducts (this.extend (params, { 'product_type': 'FUTURE' })),
this.v3PrivateGetBrokerageProducts (this.extend (params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
this.v3PrivateGetBrokerageTransactionSummary (this.extend (params, { 'product_type': 'FUTURE' })),
this.v3PrivateGetBrokerageTransactionSummary (this.extend (params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
];
let unresolvedContractPromises = [];
try {
unresolvedContractPromises = [
this.v3PrivateGetBrokerageProducts (this.extend (params, { 'product_type': 'FUTURE' })),
this.v3PrivateGetBrokerageProducts (this.extend (params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
this.v3PrivateGetBrokerageTransactionSummary (this.extend (params, { 'product_type': 'FUTURE' })),
this.v3PrivateGetBrokerageTransactionSummary (this.extend (params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
];
} catch (e) {
unresolvedContractPromises = []; // the sync version of ccxt won't have the promise.all line so the request is made here
}
const promises = await Promise.all (spotUnresolvedPromises);
let contractPromises = undefined;
try {
Expand Down

0 comments on commit a745ae7

Please sign in to comment.