Skip to content

Commit

Permalink
Merge pull request #4273 from BitGo/PX-3264-set-enterprise-id-on-netw…
Browse files Browse the repository at this point in the history
…ork-headers

feat: add enterprise-id to header
  • Loading branch information
mmcshinsky-bitgo authored Feb 13, 2024
2 parents ddc7557 + 31dd71b commit cabaec4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions modules/sdk-core/src/bitgo/trading/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ export class TradingNetwork implements ITradingNetwork {

getBalances(params?: GetNetworkBalancesParams): Promise<GetNetworkBalancesResponse> {
const url = this.bitgo.microservicesUrl(`/api/network/v1/enterprises/${this.enterpriseId}/clients/balances`);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getSupportedCurrencies(params: GetNetworkSupportedCurrenciesParams): Promise<GetNetworkSupportedCurrenciesResponse> {
const url = this.bitgo.microservicesUrl(`/api/network/v1/enterprises/${this.enterpriseId}/supportedCurrencies`);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getConnections(params?: GetNetworkConnectionsParams): Promise<GetNetworkConnectionsResponse> {
const url = this.bitgo.microservicesUrl(`/api/network/v1/enterprises/${this.enterpriseId}/clients/connections`);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getConnectionById({
Expand All @@ -67,12 +67,12 @@ export class TradingNetwork implements ITradingNetwork {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/connections/${connectionId}`
);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

createConnection(params: CreateNetworkConnectionParams): Promise<CreateNetworkConnectionResponse> {
const url = this.bitgo.microservicesUrl(`/api/network/v1/enterprises/${this.enterpriseId}/clients/connections`);
return this.bitgo.post(url).send(params).result();
return this.bitgo.post(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

updateConnection({
Expand All @@ -82,12 +82,12 @@ export class TradingNetwork implements ITradingNetwork {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/connections/${connectionId}`
);
return this.bitgo.put(url).send(params).result();
return this.bitgo.put(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getAllocations(params?: GetNetworkAllocationsParams): Promise<GetNetworkAllocationsResponse> {
const url = this.bitgo.microservicesUrl(`/api/network/v1/enterprises/${this.enterpriseId}/clients/allocations`);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getAllocationById({
Expand All @@ -97,7 +97,7 @@ export class TradingNetwork implements ITradingNetwork {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/allocations/${allocationId}`
);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

/**
Expand Down Expand Up @@ -142,7 +142,7 @@ export class TradingNetwork implements ITradingNetwork {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/connections/${connectionId}/allocations`
);
return this.bitgo.post(url).send(params).result();
return this.bitgo.post(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

createDeallocation({
Expand All @@ -152,12 +152,12 @@ export class TradingNetwork implements ITradingNetwork {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/connections/${connectionId}/deallocations`
);
return this.bitgo.post(url).send(params).result();
return this.bitgo.post(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getSettlements(params?: GetNetworkSettlementsParams): Promise<GetNetworkSettlementsResponse> {
const url = this.bitgo.microservicesUrl(`/api/network/v1/enterprises/${this.enterpriseId}/clients/settlements`);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getSettlementById({
Expand All @@ -167,13 +167,13 @@ export class TradingNetwork implements ITradingNetwork {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/settlements/${settlementId}`
);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}

getSettlementTransfers(params?: GetNetworkSettlementTransfersParams): Promise<GetNetworkSettlementTransfersResponse> {
const url = this.bitgo.microservicesUrl(
`/api/network/v1/enterprises/${this.enterpriseId}/clients/settlementTransfers`
);
return this.bitgo.get(url).send(params).result();
return this.bitgo.get(url).set('enterprise-id', this.enterpriseId).send(params).result();
}
}

0 comments on commit cabaec4

Please sign in to comment.