This repository was archived by the owner on Mar 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var Helpers = require('./helpers');
77var WalletStore = require ( './wallet-store' ) ;
88var WalletCrypto = require ( './wallet-crypto' ) ;
99var MyWallet = require ( './wallet' ) ;
10+ var constants = require ( './constants' ) ;
1011
1112// API class
1213function API ( ) {
@@ -260,7 +261,8 @@ API.prototype.requestApi = function (endpoint, data) {
260261} ;
261262
262263API . prototype . getFees = function ( ) {
263- return this . requestApi ( 'mempool/fees' ) ;
264+ const { NETWORK , SERVER_FEE_FALLBACK } = constants ;
265+ return NETWORK === 'testnet' ? Promise . resolve ( SERVER_FEE_FALLBACK ) : this . requestApi ( 'mempool/fees' ) ;
264266} ;
265267
266268API . prototype . getExchangeRate = function ( currency , base ) {
Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ module.exports = {
55 APP_NAME : 'javascript_web' ,
66 APP_VERSION : '3.0' ,
77 SHAPE_SHIFT_KEY : void 0 ,
8+ SERVER_FEE_FALLBACK : {
9+ 'limits' : {
10+ 'min' : 50 ,
11+ 'max' : 450
12+ } ,
13+ 'regular' : 240 ,
14+ 'priority' : 300
15+ } ,
816 getNetwork : function ( bitcoinjs ) {
917 if ( bitcoinjs ) {
1018 return bitcoinjs . networks [ this . NETWORK ] ;
Original file line number Diff line number Diff line change @@ -17,14 +17,7 @@ function Payment (wallet, payment) {
1717 EventEmitter . call ( this ) ;
1818 this . _wallet = wallet ;
1919
20- var serverFeeFallback = {
21- 'limits' : {
22- 'min' : 50 ,
23- 'max' : 450
24- } ,
25- 'regular' : 240 ,
26- 'priority' : 300
27- } ;
20+ var serverFeeFallback = constants . SERVER_FEE_FALLBACK ;
2821
2922 var initialState = {
3023 fees : serverFeeFallback , // fallback for fee-service
You can’t perform that action at this time.
0 commit comments