Skip to content

Commit

Permalink
fix: fix the txn waiting bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jjleng authored and gregnazario committed Aug 27, 2022
1 parent 9c4e723 commit 8399cd1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions ecosystem/typescript/sdk/CHANGELOG.md
Expand Up @@ -5,16 +5,21 @@ All notable changes to the Aptos Node SDK will be captured in this file. This ch
**Note:** The Aptos TS SDK does not follow semantic version while we are in active development. Instead, breaking changes will be announced with each devnet cut. Once we launch our mainnet, the SDK will follow semantic versioning closely.

## Unreleased

N/A

## 1.3.8 (2022-08-25)
## 1.3.10 (2022-08-26)

- Fix the bug in `waitForTransactionWithResult`. When API returns `404`, the function should continue waiting rather than returning early. The reason is that the txn might not be committed promptly. `waitForTransactionWithResult` should either timeout or get an error in such case.

## 1.3.9 (2022-08-25)

- **[Breaking Change]** Reimplemented the JSON transaction submission interfaces with BCS. This is a breaking change. `createSigningMessage` is removed. Before the changes, the transaction payloads take string aruguments. But now, Typescript payload arguments have to match the smart contract arugment types. e.g. `number` matches `u8`, `number | bigint` matches `u64` and `u128`, etc.
- **[Breaking Change]** `getTokenBalance` and `getTokenBalanceForAccount` have been renamed to `getToken` and `getTokenForAccount`, since they were never getting just the balance, but the full token.
- Added `CoinClient` to help working with coins. This contains common operations such as `transfer`, `checkBalance`, etc.
- Added `generateSignSubmitWaitForTransaction`, a function that provides a simple way to execute the full end to end transaction submission flow. You may also leverage `generateSignSubmit`, a helper that does the same but without waiting, instead returning teh transaction hash.
- Added `fromDerivePath` to `AptosAccount`. You can use this to create an `AptosAccount` (which is a local representation of an account) using a bip44 path and mnemonics.


## 1.3.7 (2022-08-17)

- Add a transaction builder that is able to serialize transaction arguments with remote ABIs. Remote ABIs are fetchable through REST APIs. With the remote ABI transaction builder, developers can build BCS transactions by only providing the native JS values.
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/typescript/sdk/package.json
Expand Up @@ -62,5 +62,5 @@
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
},
"version": "1.3.8"
"version": "1.3.10"
}
1 change: 0 additions & 1 deletion ecosystem/typescript/sdk/src/aptos_client.test.ts
Expand Up @@ -10,7 +10,6 @@ import {
TxnBuilderTypes,
TransactionBuilderMultiEd25519,
BCS,
TransactionBuilder,
TransactionBuilderRemoteABI,
} from "./transaction_builder";
import { TokenClient } from "./token_client";
Expand Down
3 changes: 2 additions & 1 deletion ecosystem/typescript/sdk/src/aptos_client.ts
Expand Up @@ -450,7 +450,8 @@ export class AptosClient {
if (e instanceof Gen.ApiError) {
if (e.status === 404) {
isPending = true;
break;
// eslint-disable-next-line no-continue
continue;
}
if (e.status >= 400) {
throw e;
Expand Down

0 comments on commit 8399cd1

Please sign in to comment.