Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
- [Breaking change: simplify network config / improve design - not a singleton anymore](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/176)
- [Fix / improve results parser (better heuristics)](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/177)
- [Breaking change: preparatory refactoring for decoupling core objects from IProvider](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/178)
- [Breaking change: decouple networkStake, networkStatus and stats from IProvider & IApiProvider](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/179)

**Breaking changes**
- Removed utility functions: `transaction.awaitExecuted()`, `transaction.awaitPending()`. `TransactionWatcher` should be used directly, instead.
Expand All @@ -20,9 +21,10 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
- Constructor of `Transaction` now requires `chainID`, as well.
- Added `Interaction.withChainID()` - must be used before calling `buildTransaction()`.
- Altered a bit the public interface of `TransactionEvent`, `Receipt` (renamed fields, renamed methods).
- Remove `transaction.getAsOnNetwork()`. One should use `provider.getTransaction()` instead.
- Remove `acount.sync()`. Replaced by `account.update({ nonce, balance})`.
- Remove `transaction.send()`. `Provider.sendTransaction()` has to be used instead.
- Removed `transaction.getAsOnNetwork()`. One should use `provider.getTransaction()` instead.
- Removed `acount.sync()`. Replaced by `account.update({ nonce, balance})`.
- Removed `transaction.send()`. `Provider.sendTransaction()` has to be used instead.
- Removed the static functions `getDefault()` and `sync()` from `networkStake`, `networkStatus` and `stats`.

## [10.0.0-beta.3]
- [Extract dapp / signing providers to separate repositories](https://github.com/ElrondNetwork/elrond-sdk-erdjs/pull/170)
Expand Down
21 changes: 0 additions & 21 deletions src/networkStake.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IApiProvider } from "./interface";
import BigNumber from "bignumber.js";

/**
Expand Down Expand Up @@ -32,26 +31,6 @@ export class NetworkStake {
this.TotalStaked = new BigNumber(0);
}

/**
* Gets the default configuration object (think of the Singleton pattern).
*/
static getDefault(): NetworkStake {
if (!NetworkStake.default) {
NetworkStake.default = new NetworkStake();
}

return NetworkStake.default;
}

/**
* Synchronizes a configuration object by querying the Network, through a {@link IProvider}.
* @param provider The provider to use
*/
async sync(provider: IApiProvider): Promise<void> {
let fresh: NetworkStake = await provider.getNetworkStake();
Object.assign(this, fresh);
}

/**
* Constructs a configuration object from a HTTP response (as returned by the provider).
*/
Expand Down
22 changes: 0 additions & 22 deletions src/networkStatus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { IProvider } from "./interface";

/**
* An object holding network status configuration parameters.
*/
Expand Down Expand Up @@ -63,26 +61,6 @@ export class NetworkStatus {
this.RoundsPerEpoch = 0;
}

/**
* Gets the default network status object (think of the Singleton pattern).
*/
static getDefault(): NetworkStatus {
if (!NetworkStatus.default) {
NetworkStatus.default = new NetworkStatus();
}

return NetworkStatus.default;
}

/**
* Synchronizes a configuration object by querying the node, through a {@link IProvider}.
* @param provider The provider to use
*/
async sync(provider: IProvider): Promise<void> {
let fresh: NetworkStatus = await provider.getNetworkStatus();
Object.assign(this, fresh);
}

/**
* Constructs a configuration object from a HTTP response (as returned by the provider).
*/
Expand Down
11 changes: 0 additions & 11 deletions src/stats.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { IApiProvider } from "./interface";

/**
* An object holding Network stats parameters.
*/
Expand Down Expand Up @@ -51,15 +49,6 @@ export class Stats {
this.RoundsPerEpoch = 0;
}

/**
* Synchronizes a stats object by querying the Network, through a {@link IProvider}.
* @param provider The provider to use
*/
async sync(provider: IApiProvider): Promise<void> {
let fresh: Stats = await provider.getNetworkStats();
Object.assign(this, fresh);
}

/**
* Constructs a stats object from a HTTP response (as returned by the provider).
*/
Expand Down
2 changes: 1 addition & 1 deletion src/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BigNumber } from "bignumber.js";
import { IAddressOfExternalSigner, IProvider, ISignable, ISignatureOfExternalSigner } from "./interface";
import { IAddressOfExternalSigner, ISignable, ISignatureOfExternalSigner } from "./interface";
import { Address } from "./address";
import { Balance } from "./balance";
import {
Expand Down