Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from HelixNetwork/dev
Browse files Browse the repository at this point in the history
Updating to the latest changes
  • Loading branch information
sachushaji authored Jul 1, 2019
2 parents 8c02c1a + 3e7ec63 commit 7001f96
Show file tree
Hide file tree
Showing 46 changed files with 17,299 additions and 15,830 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Thanks for everyone involved in the process of developing the Official Helix API
npm run init
```

This will install all dependencies, build and link the packages together. helix.api uses [Lerna](https://lernajs.io/) to manage multiple packages. You can re-bootstrap your setup at any point with `lerna bootstrap` command.
This will install all dependencies, build and link the packages together. helix.api uses [Lerna](https://lerna.js.org) to manage multiple packages. You can re-bootstrap your setup at any point with `lerna bootstrap` command.

### Run the tests

Expand Down
41 changes: 19 additions & 22 deletions examples/tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,43 @@ const helix = Helix.composeAPI({
provider: "http://localhost:14700"
});

const seed = "953c8169027a85415692cc05bd3a91f95c3be8e5c93c1d2b2e2c447b5ed082d2";

var recipientAddress1 =
"064c7c7652a56055c3af2c620ee3a9daf4be3ad6cebaa8d5dd9ed8a8d7509ea1";

var recipientAddress2 =
"16e092b38442a4887f510e15e58cefe024f212470df123a070c4db2f5ef4c6de";
// Sender
const senderSeed =
"df36d3a5c687106be8c8880ce06117a302bd09fe88355cd4102b901ad9f76ec2";
const senderAddress =
"556a2431d03e57e92b7d4d4d37f98332fce5427d8167e16c0a5cfbe20899d261";

// Receiver
const receiverSeed =
"f6643fef386fb8e591dbbfde2d83e9176ecdd3af5b2699d65b8c8cb6ef721cad";
const receiverAddress1 =
"cf36dc1226a7e275641a2486a2aa2bf44347dac544d24079231597ee25b2cb9f";
const receiverAddress2 =
"9477ec3c08c3e79a4fdcbc2a8fda9539b320b9b25dc9bc6cfca01cded875df0e";

// Store the HBytes that are returned from prepareTransfers function
var storedHBytes;

// preparing transactions
var transfer1 = {
address: recipientAddress1,
value: 0,
message: Converter.asciiToHBytes("abcd"),
tag: "abcd123"
};

var transfer2 = {
address: recipientAddress2,
value: 0,
var transfer = {
address: receiverAddress1,
value: 53,
message: Converter.asciiToHBytes("abcd"),
tag: "abcd123"
};

// Create bundle and return the HBytes of the prepared TXs
helix
.prepareTransfers(seed, [transfer1, transfer2])
.prepareTransfers(senderSeed, [transfer])
.then(function(HBytes) {
storedHBytes = HBytes;
// Finalize and broadcast the bundle to the node
return helix.sendHBytes(
storedHBytes,
3 /*depth*/,
5 /*depth*/,
2 /*minimum weight magnitude*/
);
})

.then(results => console.log(JSON.stringify(results)))
.then(results => console.log(results))
.catch(err => {
console.log(err);
});
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"preid": "alpha",
"message": "publish %s"
},
"version": "1.0.0-alpha.1"
"version": "1.0.0-alpha.2"
}
Loading

0 comments on commit 7001f96

Please sign in to comment.