@cryptorubic/web3 1.1.0-alpha-stellar.54 → 1.1.0-alpha-stellar.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -19,13 +19,15 @@ class StellarAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
19
19
|
this.signer = new stellar_adapter_signer_1.StellarAdapterSigner(this.publicRef, httpClient, logger, clientParams);
|
|
20
20
|
this.horizonClient = new stellar_sdk_1.Horizon.Server(rpc[0].horizon, {
|
|
21
21
|
allowHttp: true,
|
|
22
|
-
appName: 'rubic.exchange'
|
|
22
|
+
appName: 'rubic.exchange',
|
|
23
|
+
headers: rpc[0].horizonHeaders
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
initWeb3Client() {
|
|
26
27
|
this.public = new stellar_sdk_2.rpc.Server(this.rpc[0].soroban, {
|
|
27
28
|
allowHttp: true,
|
|
28
|
-
timeout: 5000
|
|
29
|
+
timeout: 5000,
|
|
30
|
+
headers: this.rpc[0].sorobanHeaders
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
async getBlockNumber() {
|
|
@@ -113,9 +115,9 @@ class StellarAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
113
115
|
return userBalance.gte(token.weiAmount);
|
|
114
116
|
}
|
|
115
117
|
async needTrustline(token, walletAddress) {
|
|
116
|
-
|
|
118
|
+
const isCorrectWalletAddress = await web3_pure_1.Web3Pure.isAddressCorrect(core_1.BLOCKCHAIN_NAME.STELLAR, walletAddress);
|
|
119
|
+
if (token.isNative || !isCorrectWalletAddress)
|
|
117
120
|
return false;
|
|
118
|
-
}
|
|
119
121
|
try {
|
|
120
122
|
const trustline = await this.public.getTrustline(walletAddress, this.convertTokenAddressToAsset(token.address));
|
|
121
123
|
return new bignumber_js_1.default(trustline.limit().toString()).lt(token.weiAmount);
|