Browse Source

fixes

pull/19/head
Esteban Santiesteban 1 month ago
parent
commit
0d93544a40
3 changed files with 29 additions and 6 deletions
  1. 3
    3
      code/index.js
  2. 2
    2
      code/tests.js
  3. 24
    1
      package-lock.json

+ 3
- 3
code/index.js View File

@@ -56,8 +56,8 @@ const Nano = {
**/
pending: async (address) => {
if (!address) return new Error("First parameter, NANO Address is missing.")
var history = await Axios.get(`${Nano.url}/pending/${address}`)
return history.data
var pending = await Axios.get(`${Nano.url}/pending/${address}`, { maxContentLength: 52428890 })
return pending.data
},


@@ -73,7 +73,7 @@ const Nano = {
**/
history: async (address) => {
if (!address) return new Error("First parameter, NANO Address is missing.")
var history = await Axios.get(`${Nano.url}/history/${address}`)
var history = await Axios.get(`${Nano.url}/history/${address}`, { maxContentLength: 52428890 })
return history.data
},


+ 2
- 2
code/tests.js View File

@@ -26,7 +26,7 @@ function validate(name, value, type, output) {
var pending = await Nano.pending('nano_37y6iq8m1zx9inwkkcgqh34kqsihzpjfwgp9jir8xpb9jrcwhkmoxpo61f4o')
validate( "Nano.pending()", pending, 'object')

var history = await Nano.history('nano_37y6iq8m1zx9inwkkcgqh34kqsihzpjfwgp9jir8xpb9jrcwhkmoxpo61f4o')
var history = await Nano.history('nano_1xkyayfycettzcyhbexcmtqbhj5abbruq15urypzsnrby9s8nrhpj6fzxqcg')
validate( "Nano.address()", history, 'object')

var rawAmount = '19424000000000000000000000000'
@@ -36,7 +36,7 @@ function validate(name, value, type, output) {
var convertToRaw = Nano.toRaw(convertFromRaw)
validate( "Nano.toRaw()", convertToRaw, 'string')

var findBlockByAmount = Nano.findBlockByAmount("nano_37y6iq8m1zx9inwkkcgqh34kqsihzpjfwgp9jir8xpb9jrcwhkmoxpo61f4o", history[0].amount)
var findBlockByAmount = Nano.findBlockByAmount("nano_1xkyayfycettzcyhbexcmtqbhj5abbruq15urypzsnrby9s8nrhpj6fzxqcg", history[0].amount)
validate( "Nano.findBlockByAmount()", findBlockByAmount, 'object')

})()

+ 24
- 1
package-lock.json View File

@@ -1,3 +1,26 @@
{
"lockfileVersion": 1
"name": "@formsend/nano",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"axios": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.22.0.tgz",
"integrity": "sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==",
"requires": {
"follow-redirects": "^1.14.4"
}
},
"big.js": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-6.1.1.tgz",
"integrity": "sha512-1vObw81a8ylZO5ePrtMay0n018TcftpTA5HFKDaSuiUDBo8biRBtjIobw60OpwuvrGk+FsxKamqN4cnmj/eXdg=="
},
"follow-redirects": {
"version": "1.14.4",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
}
}
}

Loading…
Cancel
Save