@cryptorubic/web3 0.2.11-0 → 0.2.11-test-cd.1
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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptorubic/web3",
|
|
3
|
-
"version": "0.2.11-
|
|
3
|
+
"version": "0.2.11-test-cd.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"bignumber.js": "9.1.2",
|
|
7
|
-
"@cryptorubic/core": "0.2.11-
|
|
7
|
+
"@cryptorubic/core": "0.2.11-test-cd.1",
|
|
8
8
|
"viem": "^2.19.1",
|
|
9
9
|
"web3-utils": "^4.3.1",
|
|
10
10
|
"@ton/ton": "^15.1.0",
|
|
11
11
|
"@solana/web3.js": "1.95.3",
|
|
12
12
|
"@solflare-wallet/utl-sdk": "^1.4.0",
|
|
13
13
|
"@ethersproject/bignumber": "^5.7.0",
|
|
14
|
-
"@cryptorubic/tron-types": "0.2.11-
|
|
14
|
+
"@cryptorubic/tron-types": "0.2.11-test-cd.1",
|
|
15
15
|
"bitcoin-address-validation": "^2.2.3",
|
|
16
16
|
"axios": "0.27.2",
|
|
17
17
|
"crc-32": "^1.2.2",
|
|
@@ -34,13 +34,8 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
34
34
|
}
|
|
35
35
|
async simulateTransaction(_config, _from) { }
|
|
36
36
|
async callForTokensInfo(tokenAddresses) {
|
|
37
|
-
const nativeToken = core_1.nativeTokensList[core_1.BLOCKCHAIN_NAME.SOLANA];
|
|
38
37
|
const nativeTokenIndex = tokenAddresses.findIndex((address) => web3_pure_1.Web3Pure.isNativeAddress(core_1.CHAIN_TYPE.SOLANA, address));
|
|
39
38
|
const filteredTokenAddresses = tokenAddresses.filter((_, index) => index !== nativeTokenIndex);
|
|
40
|
-
// only native token in tokenAddresses
|
|
41
|
-
if (!filteredTokenAddresses.length) {
|
|
42
|
-
return [nativeToken];
|
|
43
|
-
}
|
|
44
39
|
const mints = filteredTokenAddresses.map((address) => new web3_js_1.PublicKey(address));
|
|
45
40
|
const tokenSdk = new utl_sdk_1.Client();
|
|
46
41
|
const tokensMint = await tokenSdk.fetchMints(mints);
|
|
@@ -56,7 +51,8 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
56
51
|
if (nativeTokenIndex === -1) {
|
|
57
52
|
return tokens;
|
|
58
53
|
}
|
|
59
|
-
|
|
54
|
+
const blockchainNativeToken = core_1.nativeTokensList[core_1.BLOCKCHAIN_NAME.SOLANA];
|
|
55
|
+
tokens.splice(nativeTokenIndex, 0, blockchainNativeToken);
|
|
60
56
|
return tokens;
|
|
61
57
|
}
|
|
62
58
|
}
|