From f478e79551fd3af8092e999221392e8576e88ef4 Mon Sep 17 00:00:00 2001 From: platfowner Date: Tue, 26 Mar 2024 10:18:46 +0900 Subject: [PATCH 1/6] Fix the return value of the getAddress() method --- src/provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/provider.ts b/src/provider.ts index 247a80e..e3bb661 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -39,9 +39,9 @@ export default class Provider { /** * Fetches the blockchain node's address. - * @returns {Promise} The address value. + * @returns {Promise} The return value of the blockchain API. */ - getAddress(): Promise { + getAddress(): Promise { return this.send('ain_getAddress', {}) } From f17058120c23745730d50c5202958a426f769454 Mon Sep 17 00:00:00 2001 From: platfowner Date: Tue, 26 Mar 2024 17:33:46 +0900 Subject: [PATCH 2/6] Fix tsdoc comments --- src/wallet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet.ts b/src/wallet.ts index 12512e2..b3897dc 100755 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -269,7 +269,7 @@ export default class Wallet { } /** - * Fetches an account's timestamp value, which is the current transaction count of the account. + * Fetches an account's timestamp value, which is the timestamp of the last transaction signed by the account with nonce = -2. * @param {object} args The ferch options. * It may contain a string 'address' value and a string 'from' value. * The 'address' is the address of the account to get the timestamp of, From 18e7d14cc7d78de277ef3a497a43cd61f645a6a0 Mon Sep 17 00:00:00 2001 From: platfowner Date: Wed, 27 Mar 2024 11:07:04 +0900 Subject: [PATCH 3/6] Fix a comment typo --- src/ain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ain.ts b/src/ain.ts index 49c4411..cb17954 100755 --- a/src/ain.ts +++ b/src/ain.ts @@ -210,7 +210,7 @@ export default class Ain { } /** - * Fetches pending transaction. + * Fetches pending transactions. * @returns {Promise} */ getPendingTransactions(): Promise { From 7fc27e1e10822c9378d1da7a8ecf9084c6cbd7fe Mon Sep 17 00:00:00 2001 From: platfowner Date: Wed, 3 Apr 2024 10:53:40 +0900 Subject: [PATCH 4/6] Fix some parameter types --- src/ain.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ain.ts b/src/ain.ts index cb17954..abb59e1 100755 --- a/src/ain.ts +++ b/src/ain.ts @@ -240,7 +240,7 @@ export default class Ain { * @param {number} index The transaction index in the block * @returns {Promise} */ - getTransactionByBlockHashAndIndex(blockHash: string, index: Number): Promise { + getTransactionByBlockHashAndIndex(blockHash: string, index: number): Promise { return this.provider.send('ain_getTransactionByBlockHashAndIndex', { block_hash: blockHash, index }); } @@ -250,7 +250,7 @@ export default class Ain { * @param {number} index The transaction index in the block * @returns {Promise} */ - getTransactionByBlockNumberAndIndex(blockNumber: Number, index: Number): Promise { + getTransactionByBlockNumberAndIndex(blockNumber: number, index: number): Promise { return this.provider.send('ain_getTransactionByBlockNumberAndIndex', { block_number: blockNumber, index }); } From 6596ee21bd2dfe43faca254318d9467bdec81c1e Mon Sep 17 00:00:00 2001 From: platfowner Date: Fri, 5 Apr 2024 10:33:06 +0900 Subject: [PATCH 5/6] Tweak test logic --- __tests__/ain.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/__tests__/ain.test.ts b/__tests__/ain.test.ts index b24a48c..ef50e84 100644 --- a/__tests__/ain.test.ts +++ b/__tests__/ain.test.ts @@ -82,6 +82,7 @@ describe('ain-js', function() { it('getPeerCandidateInfo', async function() { const info = await ain.net.getPeerCandidateInfo(); + expect(info).not.toBeNull(); expect(info.address).not.toBeNull(); expect(info.isAvailableForConnection).toBe(true); expect(info.peerCandidateJsonRpcUrlList).not.toBeNull(); From ab08a942529f828a2521f892dc699ff5ee697601 Mon Sep 17 00:00:00 2001 From: platfowner Date: Fri, 5 Apr 2024 10:44:15 +0900 Subject: [PATCH 6/6] Fix return type of getAddress() --- src/provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/provider.ts b/src/provider.ts index e3bb661..8050027 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -39,9 +39,9 @@ export default class Provider { /** * Fetches the blockchain node's address. - * @returns {Promise} The return value of the blockchain API. + * @returns {Promise} The return value of the blockchain API. */ - getAddress(): Promise { + getAddress(): Promise { return this.send('ain_getAddress', {}) }