Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Horizon API fields to reflect the coming post-AMM API #702

Merged
merged 3 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ A breaking change will get clearly marked in this log.

- Updated the underlying `stellar-base` library to [v6.0.1](https://github.com/stellar/js-stellar-base/releases/tag/v6.0.1) to include CAP-38 changes ([#681](https://github.com/stellar/js-stellar-sdk/pull/681)).

- Updated various developer dependencies to secure versions ([#671](https://github.com/stellar/js-stellar-sdk/pull/671)).

- Updated `AccountResponse` to include liquidity pool shares in its `balances` field ([#688](https://github.com/stellar/js-stellar-sdk/pull/688)).

- Updated `AccountCallBuilder` to allow filtering based on participation in a certain liquidity pool ([#688](https://github.com/stellar/js-stellar-sdk/pull/688)), corresponding to the following new filter:
Expand Down Expand Up @@ -76,8 +78,7 @@ A breaking change will get clearly marked in this log.
* the `asset` field is now optional, and is replaced by
* the `liquidity_pool_id` field for liquidity pools

### Fix
- Updated various developer dependencies to secure versions ([#671](https://github.com/stellar/js-stellar-sdk/pull/671)).
- `TradeRecord`s no longer have an `offer_id` field. This field is redundant, being represented by `base_offer_id` in given an `Orderbook` trade.


## [v8.2.5](https://github.com/stellar/js-stellar-sdk/compare/v8.2.4...v8.2.5)
Expand Down
5 changes: 1 addition & 4 deletions src/effect_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ export class EffectCallBuilder extends CallBuilder<
* @returns {EffectCallBuilder} this EffectCallBuilder instance
*/
public forLedger(sequence: number | string): this {
return this.forEndpoint(
"ledgers",
typeof sequence === "number" ? sequence.toString() : sequence,
);
return this.forEndpoint("ledgers", sequence.toString());
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/horizon_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export namespace Horizon {
is_authorized: boolean;
is_authorized_to_maintain_liabilities: boolean;
is_clawback_enabled: boolean;
sponsor?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the important change, addressing this comment.

}
export interface BalanceLineAsset<
T extends AssetType.credit4 | AssetType.credit12 =
Expand Down
5 changes: 1 addition & 4 deletions src/operation_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ export class OperationCallBuilder extends CallBuilder<
* @returns {OperationCallBuilder} this OperationCallBuilder instance
*/
public forLedger(sequence: number | string): this {
return this.forEndpoint(
"ledgers",
typeof sequence === "number" ? sequence.toString() : sequence,
);
return this.forEndpoint("ledgers", sequence.toString());
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/payment_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ export class PaymentCallBuilder extends CallBuilder<
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
*/
public forLedger(sequence: number | string): this {
return this.forEndpoint(
"ledgers",
sequence.toString(),
);
return this.forEndpoint("ledgers", sequence.toString());
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/server_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ export namespace ServerApi {
id: string;
paging_token: string;
ledger_close_time: string;
offer_id: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one!

trade_type: TradeType;
base_account?: string;
base_amount: string;
Expand Down
4 changes: 1 addition & 3 deletions src/transaction_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export class TransactionCallBuilder extends CallBuilder<
* @returns {TransactionCallBuilder} current TransactionCallBuilder instance
*/
public forLedger(sequence: number | string): this {
const ledgerSequence =
typeof sequence === "number" ? sequence.toString() : sequence;
return this.forEndpoint("ledgers", ledgerSequence);
return this.forEndpoint("ledgers", sequence.toString());
}

/**
Expand Down