jupiter-node-sdk
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -6,2 +6,7 @@ # Changelog | ||
## [0.4.1] - 2020-08-09 | ||
### Changed | ||
- Changed getBalance response returning confirmed and unconfirmed balance | ||
- Added calculateExpectedFees function | ||
## [0.4.0] - 2020-07-25 | ||
@@ -8,0 +13,0 @@ ### Changed |
@@ -19,2 +19,3 @@ /// <reference types="node" /> | ||
calculateMessageFee(encryptedMessageLength: number): number; | ||
calculateExpectedFees(data: Array<string>): number; | ||
decrypt: (text: string) => Promise<string>; | ||
@@ -26,3 +27,3 @@ encrypt: (input: string | Buffer) => Promise<string | Buffer>; | ||
getPeers(serverUrl?: string | undefined): Promise<any>; | ||
getBalance(address?: string): Promise<string>; | ||
getBalance(address?: string): Promise<object>; | ||
createNewAddress(passphrase: string): Promise<{ | ||
@@ -29,0 +30,0 @@ address: any; |
@@ -73,2 +73,7 @@ "use strict"; | ||
}, | ||
calculateExpectedFees(data) { | ||
let expectedFees = 0; | ||
data.forEach((data) => expectedFees += this.calculateMessageFee(data.length)); | ||
return expectedFees; | ||
}, | ||
decrypt: encryption.decrypt.bind(encryption), | ||
@@ -126,4 +131,3 @@ encrypt: encryption.encrypt.bind(encryption), | ||
async getBalance(address = opts.address) { | ||
const { data: { | ||
// unconfirmedBalanceNQT, | ||
const { data: { unconfirmedBalanceNQT, | ||
// forgedBalanceNQT, | ||
@@ -138,3 +142,6 @@ balanceNQT, | ||
}); | ||
return this.nqtToJup(balanceNQT); | ||
return { | ||
'balanceNQT': balanceNQT, | ||
'unconfirmedBalanceNQT': unconfirmedBalanceNQT | ||
}; | ||
}, | ||
@@ -160,3 +167,3 @@ async createNewAddress(passphrase) { | ||
amountNQT: amountJup | ||
? this.jupToNqt(amountJup) | ||
? amountJup | ||
: CONF.minimumFndrAccountBalance, | ||
@@ -163,0 +170,0 @@ feeNQT: CONF.feeNQT, |
{ | ||
"name": "jupiter-node-sdk", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A thin wrapper around the Jupiter blockchain APIs.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -38,3 +38,3 @@ # jupiter-node-sdk | ||
const balanceJup = await client.getBalance(`JUP-XXX-XXX`) | ||
const balanceJup = await client.getBalance(`JUP-XXX-XXX`).balanceNQT | ||
@@ -41,0 +41,0 @@ // sender is address in constructor above |
@@ -74,2 +74,8 @@ import assert from 'assert' | ||
calculateExpectedFees(data: Array<string>): number { | ||
let expectedFees = 0; | ||
data.forEach((data) => expectedFees += this.calculateMessageFee(data.length)); | ||
return expectedFees; | ||
}, | ||
decrypt: encryption.decrypt.bind(encryption), | ||
@@ -138,6 +144,6 @@ encrypt: encryption.encrypt.bind(encryption), | ||
async getBalance(address: string = opts.address): Promise<string> { | ||
async getBalance(address: string = opts.address): Promise<object> { | ||
const { | ||
data: { | ||
// unconfirmedBalanceNQT, | ||
unconfirmedBalanceNQT, | ||
// forgedBalanceNQT, | ||
@@ -153,3 +159,6 @@ balanceNQT, | ||
}) | ||
return this.nqtToJup(balanceNQT) | ||
return { | ||
'balanceNQT': balanceNQT, | ||
'unconfirmedBalanceNQT': unconfirmedBalanceNQT | ||
} | ||
}, | ||
@@ -180,3 +189,3 @@ | ||
amountNQT: amountJup | ||
? this.jupToNqt(amountJup) | ||
? amountJup | ||
: CONF.minimumFndrAccountBalance, | ||
@@ -183,0 +192,0 @@ feeNQT: CONF.feeNQT, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4601
113039
29