Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jupiter-fs

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jupiter-fs - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

4

Changelog.md

@@ -6,2 +6,6 @@ # Changelog

## [0.4.0] - 2020-09-02
### Changed
- Update transaction base fee
## [0.3.0] - 2020-08-08

@@ -8,0 +12,0 @@ ### Added

6

dist/JupiterFs.js

@@ -34,6 +34,6 @@ "use strict";

const jupServer = server || '';
feeNQT = feeNQT || 400;
feeNQT = feeNQT || 5000;
// Quantity to found the binary client when doesnt have enought founds
minimumFndrAccountBalance = minimumFndrAccountBalance || 15000000;
minimumUserAccountBalance = minimumUserAccountBalance || 30000000;
minimumFndrAccountBalance = minimumFndrAccountBalance || 300000000;
minimumUserAccountBalance = minimumUserAccountBalance || 500000000;
// Chunk size to split the file to upload

@@ -40,0 +40,0 @@ // Max lengh in Jupiter is 43008 bytes per encrypted message

@@ -17,20 +17,19 @@ "use strict";

describe('JupiterFs', function () {
this.timeout(40000);
assert_1.default(process.env.JUPITER_ADDRESS, 'JUPITER_ADDRESS env variable is not set');
assert_1.default(process.env.JUPITER_PASSPHRASE, 'JUPITER_PASSPHRASE env variable is not set');
// const fs = JupiterFs({ server: 'http://localhost:6876' })
this.timeout(38000);
// const fs = JupiterFs({ server: 'http://localhost:7876' })
const jupFs = JupiterFs_1.default({
server: process.env.JUPITER_SERVER || 'http://104.131.166.136:6876/test',
address: process.env.JUPITER_ADDRESS,
passphrase: process.env.JUPITER_PASSPHRASE,
server: 'http://localhost:6876',
address: 'JUP-XTAE-VA6X-4SRT-AU89L',
passphrase: 'b',
});
const testFilename = `${uuid_1.v1()}.js`;
const IMAGE_TO_TEST = 'big.jpg';
describe('#newBinaryAddress()', function () {
xdescribe('#newBinaryAddress()', function () {
it(`should get a new JUP address from a passphrase`, async () => {
const info = await jupFs.newBinaryAddress();
console.log(info);
assert_1.default.strictEqual(info.address.slice(0, 4), 'JUP-');
});
});
describe('#getOrCreateBinaryAddress()', function () {
xdescribe('#getOrCreateBinaryAddress()', function () {
it(`should get the binary address info to store file data`, async function () {

@@ -41,3 +40,3 @@ const addy = await jupFs.getOrCreateBinaryAddress();

});
describe('#ls()', function () {
xdescribe('#ls()', function () {
it(`should fetch a list of files for a jupiter account`, async () => {

@@ -56,2 +55,3 @@ const files = await jupFs.ls();

assert_1.default.strictEqual(res.txns.length > 0, true);
const fileData2 = await jupFs.getFile({ name: testFilename });
});

@@ -68,3 +68,3 @@ });

});
describe('#writeFileSizeNotAllowed()', function () {
xdescribe('#writeFileSizeNotAllowed()', function () {
it(`should write a file to a jupiter account with size not allowed`, async () => {

@@ -71,0 +71,0 @@ const fileData = await fs_1.default.promises.readFile(path_1.default.join(__dirname, '../testFiles/huge.jpg'), { encoding: null });

{
"name": "jupiter-fs",
"version": "0.3.0",
"version": "0.4.0",
"description": "A small file system implementation for the Jupiter blockchain.",

@@ -26,3 +26,3 @@ "main": "./dist/JupiterFs.js",

"dependencies": {
"jupiter-node-sdk": "^0.4.1",
"jupiter-node-sdk": "^0.5.0",
"uuid": "^8.3.2"

@@ -29,0 +29,0 @@ },

@@ -13,23 +13,17 @@ import assert from 'assert'

describe('JupiterFs', function() {
this.timeout(40000)
this.timeout(38000)
assert(process.env.JUPITER_ADDRESS, 'JUPITER_ADDRESS env variable is not set')
assert(
process.env.JUPITER_PASSPHRASE,
'JUPITER_PASSPHRASE env variable is not set'
)
// const fs = JupiterFs({ server: 'http://localhost:6876' })
const jupFs = JupiterFs({
server: process.env.JUPITER_SERVER || 'http://104.131.166.136:6876/test',
address: process.env.JUPITER_ADDRESS,
passphrase: process.env.JUPITER_PASSPHRASE,
})
// const fs = JupiterFs({ server: 'http://localhost:7876' })
const jupFs = JupiterFs({
server: 'http://localhost:6876',
address: 'JUP-XTAE-VA6X-4SRT-AU89L',
passphrase: 'b',
});
const testFilename = `${uuidv1()}.js`
const IMAGE_TO_TEST = 'big.jpg';
describe('#newBinaryAddress()', function() {
xdescribe('#newBinaryAddress()', function() {
it(`should get a new JUP address from a passphrase`, async () => {
const info = await jupFs.newBinaryAddress()
console.log(info)
assert.strictEqual(info.address.slice(0, 4), 'JUP-')

@@ -39,3 +33,3 @@ })

describe('#getOrCreateBinaryAddress()', function() {
xdescribe('#getOrCreateBinaryAddress()', function() {
it(`should get the binary address info to store file data`, async function() {

@@ -47,3 +41,3 @@ const addy = await jupFs.getOrCreateBinaryAddress()

describe('#ls()', function() {
xdescribe('#ls()', function() {
it(`should fetch a list of files for a jupiter account`, async () => {

@@ -66,2 +60,3 @@ const files = await jupFs.ls()

assert.strictEqual(res.txns.length > 0, true)
const fileData2 = await jupFs.getFile({ name: testFilename })
})

@@ -83,3 +78,3 @@ })

describe('#writeFileSizeNotAllowed()', function() {
xdescribe('#writeFileSizeNotAllowed()', function() {
it(`should write a file to a jupiter account with size not allowed`, async () => {

@@ -86,0 +81,0 @@ const fileData = await fs.promises.readFile(

@@ -19,6 +19,6 @@ import assert from 'assert'

const jupServer = server || ''
feeNQT = feeNQT || 400
feeNQT = feeNQT || 5000
// Quantity to found the binary client when doesnt have enought founds
minimumFndrAccountBalance = minimumFndrAccountBalance || 15000000
minimumUserAccountBalance = minimumUserAccountBalance || 30000000
minimumFndrAccountBalance = minimumFndrAccountBalance || 300000000
minimumUserAccountBalance = minimumUserAccountBalance || 500000000

@@ -102,3 +102,3 @@ // Chunk size to split the file to upload

let remainingBalanceBI = new BigNumber(balanceJup.unconfirmedBalanceNQT).minus(minBalance)
if (

@@ -105,0 +105,0 @@ // if binary client doesnt have money or is less than minimumFndrAccountBalance

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc