Skip to content

Commit

Permalink
Merge Protocol 19 features into master (#775)
Browse files Browse the repository at this point in the history
* Add new protocol 19 api fields (#765)
* Bump stellar-base and add CHANGELOG entry

Co-authored-by: Paul Bellamy <[email protected]>
  • Loading branch information
Shaptic and Paul Bellamy authored Apr 13, 2022
1 parent e965c79 commit 781c1a0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ A breaking change will get clearly marked in this log.

- Add a way to filter offers by seller: `OfferCallBuilder.seller(string)`, corresponding to `GET /offers?seller=<string>` ([#773](https://github.com/stellar/js-stellar-sdk/pull/773)).

### Add

- Support for Protocol 19 ([#775](https://github.com/stellar/js-stellar-sdk/pull/775)):

* new precondition fields on a `TransactionResponse`
* new account fields on `AccountResponse` and `AccountRecord`
* bumping `stellar-base` to the latest beta version

### Fix

- Add missing field to account responses: `last_modified_time` which is the time equivalent of the existing `last_modified_ledger` ([#770](https://github.com/stellar/js-stellar-sdk/pull/770)).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"eventsource": "^1.0.7",
"lodash": "^4.17.21",
"randombytes": "^2.1.0",
"stellar-base": "^7.0.0",
"stellar-base": "^8.0.0-beta.0",
"toml": "^2.3.0",
"tslib": "^1.10.0",
"urijs": "^1.19.1",
Expand Down
2 changes: 2 additions & 0 deletions src/account_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export class AccountResponse {
public readonly paging_token!: string;
public readonly account_id!: string;
public sequence!: string;
public readonly sequence_ledger?: number;
public readonly sequence_time?: string;
public readonly subentry_count!: number;
public readonly home_domain?: string;
public readonly inflation_destination?: string;
Expand Down
18 changes: 18 additions & 0 deletions src/horizon_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ export namespace Horizon {
max_fee: string;
}

export interface TransactionPreconditions {
timebounds?: {
min_time: string;
max_time: string;
};
ledgerbounds?: {
min_ledger: number;
max_ledger: number;
};
min_account_sequence?: string;
min_account_sequence_age?: string;
min_account_sequence_ledger_gap?: number;
extra_signers?: string[];
}

export interface TransactionResponse
extends SubmitTransactionResponse,
BaseResponse<
Expand All @@ -55,6 +70,7 @@ export namespace Horizon {
fee_account: string;
inner_transaction?: InnerTransactionResponse;
fee_bump_transaction?: FeeBumpTransactionResponse;
preconditions?: TransactionPreconditions;
}

export interface BalanceLineNative {
Expand Down Expand Up @@ -154,6 +170,8 @@ export namespace Horizon {
paging_token: string;
account_id: string;
sequence: string;
sequence_ledger?: number;
sequence_time?: string;
subentry_count: number;
thresholds: AccountThresholds;
last_modified_ledger: number;
Expand Down
2 changes: 2 additions & 0 deletions src/server_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export namespace ServerApi {
paging_token: string;
account_id: string;
sequence: string;
sequence_ledger?: number;
sequence_time?: string;
subentry_count: number;
home_domain?: string;
inflation_destination?: string;
Expand Down

0 comments on commit 781c1a0

Please sign in to comment.