Skip to content

Commit

Permalink
fix: Types for sequence parameter (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubén Illodo Brea authored Jul 3, 2020
1 parent 2c2a6ec commit 32d0976
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
16 changes: 8 additions & 8 deletions docs/api-docs/classes/bncclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ ___

### list

**list**(`address`: string, `proposalId`: number, `baseAsset`: string, `quoteAsset`: string, `initPrice`: number, `sequence`: null): *Promise‹object›*
**list**(`address`: string, `proposalId`: number, `baseAsset`: string, `quoteAsset`: string, `initPrice`: number, `sequence`: number | null): *Promise‹object›*

**Parameters:**

Expand All @@ -469,7 +469,7 @@ Name | Type | Default | Description |
`baseAsset` | string | - | - |
`quoteAsset` | string | - | - |
`initPrice` | number | - | - |
`sequence` | null | null | optional sequence |
`sequence` | number | null | null | optional sequence |

**Returns:** *Promise‹object›*

Expand Down Expand Up @@ -501,7 +501,7 @@ ___

### multiSend

**multiSend**(`fromAddress`: string, `outputs`: Transfer[], `memo`: string, `sequence`: null): *Promise‹object›*
**multiSend**(`fromAddress`: string, `outputs`: Transfer[], `memo`: string, `sequence`: number | null): *Promise‹object›*

Create and sign a multi send tx

Expand Down Expand Up @@ -535,7 +535,7 @@ Name | Type | Default | Description |
`fromAddress` | string | - | - |
`outputs` | Transfer[] | - | - |
`memo` | string | "" | optional memo |
`sequence` | null | null | optional sequence |
`sequence` | number | null | null | optional sequence |

**Returns:** *Promise‹object›*

Expand Down Expand Up @@ -680,7 +680,7 @@ ___

### setAccountFlags

**setAccountFlags**(`address`: string, `flags`: number, `sequence`: null): *Promise‹object›*
**setAccountFlags**(`address`: string, `flags`: number, `sequence`: number | null): *Promise‹object›*

Set account flags

Expand All @@ -690,7 +690,7 @@ Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`address` | string | - | - |
`flags` | number | - | new value of account flags |
`sequence` | null | null | optional sequence |
`sequence` | number | null | null | optional sequence |

**Returns:** *Promise‹object›*

Expand Down Expand Up @@ -769,7 +769,7 @@ ___

### transfer

**transfer**(`fromAddress`: string, `toAddress`: string, `amount`: BigSource, `asset`: string, `memo`: string, `sequence`: null): *Promise‹object›*
**transfer**(`fromAddress`: string, `toAddress`: string, `amount`: BigSource, `asset`: string, `memo`: string, `sequence`: number | null): *Promise‹object›*

Transfer tokens from one address to another.

Expand All @@ -782,7 +782,7 @@ Name | Type | Default | Description |
`amount` | BigSource | - | - |
`asset` | string | - | - |
`memo` | string | "" | optional memo |
`sequence` | null | null | optional sequence |
`sequence` | number | null | null | optional sequence |

**Returns:** *Promise‹object›*

Expand Down
12 changes: 8 additions & 4 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export class BncClient {
amount: BigSource,
asset: string,
memo = "",
sequence = null
sequence: number | null = null
) {
const accCode = crypto.decodeAddress(fromAddress)
const toAccCode = crypto.decodeAddress(toAddress)
Expand Down Expand Up @@ -438,7 +438,7 @@ export class BncClient {
fromAddress: string,
outputs: Transfer[],
memo = "",
sequence = null
sequence: number | null = null
) {
if (!fromAddress) {
throw new Error("fromAddress should not be falsy")
Expand Down Expand Up @@ -641,7 +641,7 @@ export class BncClient {
baseAsset: string,
quoteAsset: string,
initPrice: number,
sequence = null
sequence: number | null = null
) {
const accCode = crypto.decodeAddress(address)

Expand Down Expand Up @@ -749,7 +749,11 @@ export class BncClient {
* @param {Number} sequence optional sequence
* @return {Promise} resolves with response (success or fail)
*/
async setAccountFlags(address: string, flags: number, sequence = null) {
async setAccountFlags(
address: string,
flags: number,
sequence: number | null = null
) {
const accCode = crypto.decodeAddress(address)

const msg = {
Expand Down

0 comments on commit 32d0976

Please sign in to comment.