Skip to content
This repository was archived by the owner on Sep 6, 2024. It is now read-only.

Commit f62a85b

Browse files
author
domschiener
committed
shouldYouReplay, isInt to isNum, isDecimal removed
1 parent 83b122f commit f62a85b

File tree

15 files changed

+563
-282
lines changed

15 files changed

+563
-282
lines changed

README.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ iota.api.getNodeInfo(function(error, success) {
106106
- **[getBundle](#getbundle)**
107107
- **[getTransfers](#gettransfers)**
108108
- **[getAccountData](#getaccountdata)**
109+
- **[shouldYouReplay](#shouldyoureplay)**
109110
- **[utils](#iota.utils)**
110111
- **[convertUnits](#convertunits)**
111112
- **[addChecksum](#addchecksum)**
@@ -131,7 +132,7 @@ iota.api.getNodeInfo(function(error, success) {
131132
- **[isAddress](#isaddress)**
132133
- **[isTrytes](#istrytes)**
133134
- **[isValue](#isvalue)**
134-
- **[isDecimal](#isdecimal)**
135+
- **[isNum](#isnum)**
135136
- **[isHash](#ishash)**
136137
- **[isTransfersArray](#istransfersarray)**
137138
- **[isArrayOfHashes](#isarrayofhashes)**
@@ -140,7 +141,6 @@ iota.api.getNodeInfo(function(error, success) {
140141
- **[isArrayOfTxObjects](#isarrayoftxobjects)**
141142
- **[isInputs](#isinputs)**
142143
- **[isString](#isstring)**
143-
- **[isInt](#isint)**
144144
- **[isArray](#isarray)**
145145
- **[isObject](#isobject)**
146146
- **[isUri](#isuri)**
@@ -302,7 +302,9 @@ iota.api.getInputs(seed, [, options], callback)
302302

303303
Main purpose of this function is to get an array of transfer objects as input, and then prepare the transfer by **generating the correct bundle**, as well as **choosing and signing the inputs** if necessary (if it's a value transfer). The output of this function is an array of the raw transaction data (trytes).
304304

305-
You can provide multiple transfer objects, which means that your prepared bundle will have multiple outputs to the same, or different recipients. As single transfer object takes the values of: `address`, `value`, `message`, `tag`. The message and tag values are required to be tryte-encoded.
305+
You can provide multiple transfer objects, which means that your prepared bundle will have multiple outputs to the same, or different recipients. As single transfer object takes the values of: `address`, `value`, `message`, `tag`. The message and tag values are required to be tryte-encoded. If you do not supply a message or a tag, the library will automatically enter empty ones for you. As such the only required fields in each transfers object are `address` and `value`.
306+
307+
If you provide an address with a checksum, this function will automatically validate the address for you with the Utils function `isValidChecksum`.
306308

307309
For the options, you can provide a list of `inputs`, that will be used for signing the transfer's inputs. It should be noted that these inputs (an array of objects) should have the provided 'security', `keyIndex` and `address` values:
308310
```
@@ -469,7 +471,7 @@ If you want to have your transfers split into received / sent, you can use the u
469471

470472
#### Input
471473
```
472-
getTransfers(seed [, options], callback)
474+
iota.api.getTransfers(seed [, options], callback)
473475
```
474476

475477
1. **`seed`**: `String` tryte-encoded seed. It should be noted that this seed is not transferred
@@ -491,7 +493,23 @@ Similar to `getTransfers`, just a bit more comprehensive in the sense that it al
491493

492494
#### Input
493495
```
494-
getAccountData(seed [, options], callback)
496+
iota.api.getAccountData(inputAddress)
497+
```
498+
499+
1. **`inputAddress`**: `String` address used as input in a transaction
500+
501+
#### Returns
502+
`Bool` - true / false
503+
504+
---
505+
506+
### `shouldYouReplay`
507+
508+
This API function helps you to determine whether you should replay a transaction or make a completely new transaction with a different seed. What this function does, is it takes an input address (i.e. from a spent transaction) as input and then checks whether any transactions with a value transferred are confirmed. If yes, it means that this input address has already been successfully used in a different transaction and as such you should no longer replay the transaction.
509+
510+
#### Input
511+
```
512+
iota.api.shouldYouReplay(seed [, options], callback)
495513
```
496514

497515
1. **`seed`**: `String` tryte-encoded seed. It should be noted that this seed is not transferred
@@ -920,16 +938,16 @@ iota.valid.isValue(value)
920938

921939
---
922940

923-
### `isDecimal`
941+
### `isNum`
924942

925-
Checks if it's a decimal value
943+
Checks if the input value is a number, can be a string, float or integer.
926944

927945
#### Input
928946
```
929-
iota.valid.isDecimal(value)
947+
iota.valid.isNum(value)
930948
```
931949

932-
1. **`value`**: `Integer || String`
950+
1. **`value`**: `Integer`
933951

934952
---
935953

@@ -1066,17 +1084,6 @@ iota.valid.isString(string)
10661084

10671085
---
10681086

1069-
### `isInt`
1070-
1071-
Self explanatory.
1072-
1073-
#### Input
1074-
```
1075-
iota.valid.isInt(int)
1076-
```
1077-
1078-
---
1079-
10801087
### `isArray`
10811088

10821089
Self explanatory.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iota.lib.js",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "Javascript Library for IOTA",
55
"main": "./dist/iota.js",
66
"authors": [

0 commit comments

Comments
 (0)