Skip to content

Commit 6d7b936

Browse files
committed
1 parent 1db3659 commit 6d7b936

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

crypto/blockchains/eth/EthScannerProcessor.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class EthScannerProcessor extends EthBasic {
8585
throw new Error(this._settings.currencyCode + ' EthScannerProcessor._get empty trezorServer')
8686
}
8787

88-
if (!this._trezorServer) {
88+
if (!this._trezorServer && this._trezorServerCode !== 'MATIC_TREZOR_SERVER') {
8989
return false
9090
}
9191

@@ -95,10 +95,15 @@ export default class EthScannerProcessor extends EthBasic {
9595
return CACHE[this._mainCurrencyCode][address]
9696
}
9797

98-
let link = this._trezorServer + '/api/v2/address/' + address + '?details=txs'
98+
let link = this._trezorServer + '/api/v2/address/' + address + '?details=txs&pageSize=40'
99+
if (this._trezorServerCode === 'MATIC_TREZOR_SERVER') {
100+
link = 'https://proxy.trustee.deals/matic/getTxs?address=' + address
101+
}
99102
let res = await BlocksoftAxios.getWithoutBraking(link)
100-
101103
if (!res || !res.data) {
104+
if (this._trezorServerCode === 'MATIC_TREZOR_SERVER') {
105+
return false
106+
}
102107
BlocksoftExternalSettings.setTrezorServerInvalid(this._trezorServerCode, this._trezorServer)
103108
this._trezorServer = await BlocksoftExternalSettings.getTrezorServer(this._trezorServerCode, this._settings.currencyCode + ' ETH.Scanner._get')
104109
if (typeof this._trezorServer === 'undefined') {
@@ -112,6 +117,9 @@ export default class EthScannerProcessor extends EthBasic {
112117
return false
113118
}
114119
}
120+
if (typeof res.data.data !== 'undefined') {
121+
res.data = res.data.data
122+
}
115123

116124
if (typeof res.data.balance === 'undefined') {
117125
throw new Error(this._settings.currencyCode + ' EthScannerProcessor._get nothing loaded for address ' + link)

crypto/blockchains/eth/basic/EthBasic.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ export default class EthBasic {
199199
this._mainChainId = 16718 // 0x414e
200200
} else if (settings.currencyCode === 'MATIC' || (typeof settings.tokenBlockchain !== 'undefined' && settings.tokenBlockchain === 'MATIC')) {
201201

202-
this._etherscanSuffix = ''
203-
this._etherscanApiPath = `https://api.polygonscan.com/api?module=account&sort=desc&action=txlist&apikey=YourApiKeyToken`
204-
this._etherscanApiPathInternal = `https://api.polygonscan.com/api?module=account&sort=desc&action=txlistinternal&apikey=YourApiKeyToken`
205-
this._etherscanApiPathForFee = `https://api.polygonscan.com/api?module=proxy&action=eth_gasPrice&apikey=YourApiKeyToken`
202+
this._etherscanSuffix = false
203+
this._etherscanApiPath = false
204+
this._etherscanApiPathInternal = false
205+
this._etherscanApiPathForFee = false
206206

207-
this._trezorServer = false
208-
this._trezorServerCode = false
207+
this._trezorServer = 'to_load'
208+
this._trezorServerCode = 'MATIC_TREZOR_SERVER'
209209

210210
this._mainCurrencyCode = 'MATIC'
211211
this._mainTokenType = 'MATIC_ERC_20'

crypto/common/BlocksoftExternalSettings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ const CACHE = {
8787
'MATIC_SERVER' : 'https://polygon-rpc.com',
8888
'MATIC_PRICE' : 1000000000,
8989
'MATIC_GAS_LIMIT' : 620000,
90+
'MATIC_TREZOR_SERVER': ['https://pol1.trezor.io'],
9091
'FTM_SERVER' : 'https://rpc.ftm.tools',
9192
'FTM_PRICE' : 400000000000,
9293
'FTM_GAS_LIMIT' : 620000,

0 commit comments

Comments
 (0)