Skip to content

Commit f1d03ad

Browse files
authored
v1.1.0-alpha.0
2 parents 6de52e8 + edb88d2 commit f1d03ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1982
-268
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ If applicable, add screenshots to help explain your problem.
3636

3737
**Additional context**
3838
Add any other context about the problem here.
39+
40+
** Pull Requests **
41+
All Pull Request should be made against development branch read contributors guide for more information about contributing

.github/ISSUE_TEMPLATE/task.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ A description of how the contributor's work should behave.
3030
<!-- Do not remove these notices! -->
3131
#### Please ask for this task to be assigned to you and earn and its sweet reward 😉
3232
#### Remember to include your account number in your PR description for us to pay you 💰
33+
34+
** Pull Requests **
35+
All Pull Request should be made to development branch, read contributors guild for more information about contributing

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,5 @@ types
127127

128128
# Development File
129129
dev.js
130+
dev.ts
131+

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
## [1.1.0-alpha.0](https://github.com/thenewboston-developers/thenewboston-js/compare/v1.0.3...v1.1.0-alpha.0) (2021-04-01)
6+
7+
8+
### Features
9+
10+
* added getCrawlStatus ([#91](https://github.com/thenewboston-developers/thenewboston-js/issues/91)) ([409d559](https://github.com/thenewboston-developers/thenewboston-js/commit/409d559513579d00a66a6b62fe73645f97d449c7))
11+
* Bulk payments ([#82](https://github.com/thenewboston-developers/thenewboston-js/issues/82)) ([28b3ca9](https://github.com/thenewboston-developers/thenewboston-js/commit/28b3ca9f0633a185cb2be2e919637423615ece3d))
12+
* Get bank pv ([#89](https://github.com/thenewboston-developers/thenewboston-js/issues/89)) ([99b0d17](https://github.com/thenewboston-developers/thenewboston-js/commit/99b0d17b34d9ed3fd85f3c88c00323fc58a1ea49))
13+
* getCleanStatus(), startClean() and stopClean() ([#97](https://github.com/thenewboston-developers/thenewboston-js/issues/97)) ([3037330](https://github.com/thenewboston-developers/thenewboston-js/commit/303733002c478e3e09b38f531a4c5791b632b446))
14+
* Tx fees ([#92](https://github.com/thenewboston-developers/thenewboston-js/issues/92)) ([8650634](https://github.com/thenewboston-developers/thenewboston-js/commit/8650634454a78fbe2b53cdb55b3d118938cc8cf5))
15+
16+
# Changelog
17+
18+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

changelog.html

Lines changed: 0 additions & 180 deletions
This file was deleted.

docs/account-payment-handler.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Account Payment Handler
2+
3+
In this section, we will look at the methods of the `AccountPaymentHandler` class, which allows a client to make transactions using a specific bank.
4+
5+
## Sending Coins
6+
7+
Any application or user send coins by using a bank to process an account's transactions.
8+
9+
> **Note**: Before you can send coins you need to call the `init()` method in order to update to retrieve the details and transactions fees for the **Bank** and **Primary Validator**
10+
11+
Coins can be sent by using the `sendCoins()` method.
12+
13+
```ts
14+
const sendersAccount = new Account("fakeSigningKey");
15+
const bankUrl = "http://18.218.193.164";
16+
17+
const paymentHandlerOptions = {
18+
account: sendersAccount,
19+
bankUrl: bankUrl,
20+
};
21+
22+
const paymentHandler = new tnb.AccountPaymentHandler(paymentHandlerOptions);
23+
24+
// This is very important.
25+
// Method for getting the Bank and Primary validator Transactions fees
26+
await paymentHandler.init();
27+
28+
//This can be a new Account object or just the recipients account number
29+
const recipientAccount = new Account("fakeSigningKey");
30+
const amount = 1000;
31+
32+
await sendCoins(recipientAccount, 1000);
33+
```
34+
35+
## Send Bulk Payments
36+
37+
Any application or user can send multiple coins to multiple recipients from a single account.
38+
39+
> **Note**: Before you can send coins you need to call the `init()` method in order to update to retrieve the details and transactions fees for the **Bank** and **Primary Validator**
40+
41+
Bulk payments can be sent by using the `sendBulkPayments()` method.
42+
43+
```ts
44+
const sendersAccount = new Account("fakeSigningKey");
45+
const bankUrl = "http://18.218.193.164";
46+
47+
const paymentHandlerOptions = {
48+
account: sendersAccount,
49+
bankUrl: bankUrl,
50+
};
51+
52+
const paymentHandler = new tnb.AccountPaymentHandler(paymentHandlerOptions);
53+
54+
// This is very important.
55+
// Method for getting the Bank and Primary validator Transactions fees
56+
await paymentHandler.init();
57+
58+
/* Note
59+
The sender cannot be listed as a recipient
60+
A recipient cannot be listed more than once
61+
*/
62+
63+
const txs = [
64+
{
65+
amount: 10,
66+
recipient: "fakeAccountNumber1",
67+
},
68+
{
69+
amount: 100,
70+
recipient: "fakeAccountNumber2",
71+
},
72+
{
73+
amount: 1000,
74+
recipient: "fakeAccountNumber3",
75+
},
76+
];
77+
78+
await sendBulkPayments(txs);
79+
```

docs/account.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,13 @@ Account.isValidPair("SIGNING_KEY", "ACCOUNT_NUMBER"); // returns true only if th
8080

8181
## Using Signed Data and Signed Messages
8282

83-
We have already talked about creating signatures, so let's learn how we can apply them to creating signed data and signed messages. Signed data and signed messages are very similar, with the only difference being that signed messages have an extra `node_identifier` property. Here is an example of us creating signed data and a signed message:
83+
We have already talked about creating signatures, so let's learn how we can apply them to creating signed messages. Here is an example of us creating a signed message:
8484

8585
> Note that all of the `signature` and `node_identifier` properties that we are generating are _almost_ random as we are not passing any arguments into the `Account` class.
8686
8787
```ts
8888
const account = new Account();
8989

90-
account.createSignedData({ name: "Bacon" });
91-
92-
// {
93-
// data: { name: 'Bacon' },
94-
// signature: '68202fd5336c57dd42ba116fbf4154b7ef797473c7bc04949fef943c37b7b448ababf22c94711cd5f0fc603f5bd7d10d4e96dff9c876599de9fe887dfffe6d01'
95-
// }
96-
9790
account.createSignedMessage({ name: "Tuna" });
9891

9992
// {

0 commit comments

Comments
 (0)