@cryptorubic/web3 0.8.4 → 0.8.5-alpha.2
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.8.
|
|
3
|
+
"version": "0.8.5-alpha.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"bignumber.js": "9.1.2",
|
|
7
|
-
"@cryptorubic/core": "0.8.
|
|
7
|
+
"@cryptorubic/core": "0.8.5-alpha.2",
|
|
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.8.
|
|
14
|
+
"@cryptorubic/tron-types": "0.8.5-alpha.2",
|
|
15
15
|
"bitcoin-address-validation": "^2.2.3",
|
|
16
16
|
"axios": "0.27.2",
|
|
17
17
|
"crc-32": "^1.2.2",
|
|
@@ -70,6 +70,32 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
70
70
|
return new bignumber_js_1.default(tokenWithBalance || NaN);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
// public async callForTokensInfo(tokenAddresses: string[] | ReadonlyArray<string>): Promise<Token<SolanaBlockchainName>[]> {
|
|
74
|
+
// const nativeToken = nativeTokensList[BLOCKCHAIN_NAME.SOLANA] as Token<SolanaBlockchainName>;
|
|
75
|
+
// const nativeTokenIndex = tokenAddresses.findIndex((address) => Web3Pure.isNativeAddress(CHAIN_TYPE.SOLANA, address));
|
|
76
|
+
// const filteredTokenAddresses = tokenAddresses.filter((_, index) => index !== nativeTokenIndex);
|
|
77
|
+
// // only native token in tokenAddresses
|
|
78
|
+
// if (!filteredTokenAddresses.length) {
|
|
79
|
+
// return [nativeToken];
|
|
80
|
+
// }
|
|
81
|
+
// const mints = filteredTokenAddresses.map((address) => new PublicKey(address));
|
|
82
|
+
// const tokenSdk = new TokenSdk();
|
|
83
|
+
// const tokensMint = await tokenSdk.fetchMints(mints);
|
|
84
|
+
// const tokens = tokensMint.map((token) => {
|
|
85
|
+
// return new Token({
|
|
86
|
+
// address: token.address.toString(),
|
|
87
|
+
// blockchain: BLOCKCHAIN_NAME.SOLANA,
|
|
88
|
+
// decimals: token.decimals!,
|
|
89
|
+
// name: token.name,
|
|
90
|
+
// symbol: token.symbol
|
|
91
|
+
// });
|
|
92
|
+
// });
|
|
93
|
+
// if (nativeTokenIndex === -1) {
|
|
94
|
+
// return tokens;
|
|
95
|
+
// }
|
|
96
|
+
// tokens.splice(nativeTokenIndex, 0, nativeToken);
|
|
97
|
+
// return tokens;
|
|
98
|
+
// }
|
|
73
99
|
async callForTokensInfo(tokenAddresses) {
|
|
74
100
|
const nativeToken = core_1.nativeTokensList[core_1.BLOCKCHAIN_NAME.SOLANA];
|
|
75
101
|
const nativeTokenIndex = tokenAddresses.findIndex((address) => web3_pure_1.Web3Pure.isNativeAddress(core_1.CHAIN_TYPE.SOLANA, address));
|
|
@@ -109,6 +109,12 @@ class SolanaTokensService {
|
|
|
109
109
|
const notFetchedTokensList = this.initialMints.filter((mint) => !fetchedTokensMap.get(mint.toString()));
|
|
110
110
|
return notFetchedTokensList;
|
|
111
111
|
}
|
|
112
|
+
// private getNotFetchedTokensList(tokensList: SolanaToken[]): PublicKey[] {
|
|
113
|
+
// const notFetchedTokensList = this.initialMints.filter((mint) =>
|
|
114
|
+
// tokensList.every((token) => !compareAddresses(token.address, mint.toString()))
|
|
115
|
+
// );
|
|
116
|
+
// return notFetchedTokensList;
|
|
117
|
+
// }
|
|
112
118
|
async getTokensList(tokenAddresses) {
|
|
113
119
|
try {
|
|
114
120
|
const queryParams = tokenAddresses.length > 1 ? { addresses: tokenAddresses.join(',') } : { query: tokenAddresses[0] };
|