Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Oct 6, 2021
1 parent 1022422 commit 7df1b7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion infrastructure/api-docs/blueprint/groups/accounts.apib
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ Returns both committed and finalized account states
+ result (Account.FullInfo, required{{isResultNullable}})
+ error (Error, required, nullable)

## api/v0.2/accounts/{accountIdOrAddress}/transactions [/accounts/{accountIdOrAddress}/transactions{?from,limit,direction}]
## api/v0.2/accounts/{accountIdOrAddress}/transactions [/accounts/{accountIdOrAddress}/transactions{?from,limit,direction,token}]

+ Parameters
+ accountIdOrAddress (required, string, `1`) ... Account ID or address in the zkSync network
+ from (required, "latest" | string, `latest`) ... The hash of the transaction from which to show or `latest`
+ limit (required, number, `2`) ... The limit of transactions to be shown
+ direction (required, "newer" | "older", `older`) ... Newer or older than the ID of the `from`
+ token (optional, string, `0`) ... ID, address or symbol of the token used in transactions


### Get account transactions [GET]
Expand Down
5 changes: 3 additions & 2 deletions sdk/zksync.js/src/rest-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ export class RestProvider extends SyncProvider {
paginationQuery: types.PaginationQuery<string>,
token?: types.TokenLike
): Promise<Response<types.Paginated<types.ApiTransaction, string>>> {
let url = `${this.address}/accounts/${idOrAddress}/transactions?from=${paginationQuery.from}` +
let url =
`${this.address}/accounts/${idOrAddress}/transactions?from=${paginationQuery.from}` +
`&limit=${paginationQuery.limit}&direction=${paginationQuery.direction}`;
if(token) url += `&token=${token}`;
if (token) url += `&token=${token}`;
return await this.get(url);
}

Expand Down

0 comments on commit 7df1b7d

Please sign in to comment.