@cryptorubic/web3 0.9.0-alpha-exolix.1 → 0.10.0-alpha.0
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,25 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptorubic/web3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-alpha.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"@
|
|
8
|
-
"viem": "^2.19.1",
|
|
9
|
-
"web3-utils": "^4.3.1",
|
|
10
|
-
"@ton/ton": "^15.1.0",
|
|
5
|
+
"@ethersproject/bignumber": "^5.8.0",
|
|
6
|
+
"@mysten/sui": "^1.24.0",
|
|
7
|
+
"@solana/spl-token": "*",
|
|
11
8
|
"@solana/web3.js": "1.95.3",
|
|
12
9
|
"@solflare-wallet/utl-sdk": "^1.4.0",
|
|
13
|
-
"@
|
|
14
|
-
"@
|
|
10
|
+
"@suiet/wallet-sdk": "^0.3.3",
|
|
11
|
+
"@ton/ton": "^15.1.0",
|
|
12
|
+
"axios": "*",
|
|
13
|
+
"bignumber.js": "9.1.2",
|
|
15
14
|
"bitcoin-address-validation": "^2.2.3",
|
|
16
|
-
"
|
|
15
|
+
"bs58": "^6.0.0",
|
|
17
16
|
"crc-32": "^1.2.2",
|
|
17
|
+
"ethers": "*",
|
|
18
18
|
"tronweb": "^6.0.0-beta.4",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"@suiet/wallet-sdk": "^0.3.3",
|
|
22
|
-
"bs58": "^6.0.0"
|
|
19
|
+
"tslib": "^2.3.0",
|
|
20
|
+
"viem": "^2.33.1"
|
|
23
21
|
},
|
|
24
22
|
"type": "commonjs",
|
|
25
23
|
"main": "./src/index.js",
|
|
@@ -30,5 +28,12 @@
|
|
|
30
28
|
"author": {
|
|
31
29
|
"name": "Sleta Dmitrii"
|
|
32
30
|
},
|
|
31
|
+
"exports": {
|
|
32
|
+
"./package.json": "./package.json",
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./src/index.d.ts",
|
|
35
|
+
"default": "./src/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
33
38
|
"types": "./src/index.d.ts"
|
|
34
39
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AbiItem } from '
|
|
1
|
+
import { AbiItem } from '../../../utils/models/abi-types';
|
|
2
2
|
export declare const TRON_MULTICALL_ABI: AbiItem[];
|
|
@@ -2,7 +2,7 @@ import { BlockchainName, TokenAmount } from '@cryptorubic/core';
|
|
|
2
2
|
import { AllowanceInfo } from './common-types';
|
|
3
3
|
import { AbstractAdapter } from '../abstract-adapter';
|
|
4
4
|
import { EvmTransactionConfig } from '../../../utils/models/evm-transaction-config';
|
|
5
|
-
import { TronTransactionConfig } from '
|
|
5
|
+
import { TronTransactionConfig } from '../../../utils/models/tron-transaction-config';
|
|
6
6
|
export interface ApproveAdapter<T> extends AbstractAdapter<any, any, BlockchainName> {
|
|
7
7
|
/**
|
|
8
8
|
* @param fromTokenAddress erc20 address of checked token
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { AbstractAdapter } from './abstract-adapter';
|
|
3
|
-
import { ContractMulticallResponse, MethodData, TronWeb3PrimitiveType } from '@cryptorubic/tron-types';
|
|
4
3
|
import { TronWeb } from 'tronweb';
|
|
5
|
-
import { AbiFragment } from 'tronweb/lib/commonjs/types';
|
|
6
4
|
import { ICustomLogger, PriceTokenAmount, Token, TokenAmount, TronBlockchainName } from '@cryptorubic/core';
|
|
7
5
|
import { TronTransactionConfig } from '../../utils/models/tron-transaction-config';
|
|
8
6
|
import { TronParameters } from '../../utils/models/tron-parameters';
|
|
9
7
|
import { Abi } from 'viem';
|
|
10
8
|
import { ApproveAdapter } from './models/approve-adapter';
|
|
11
9
|
import { AllowanceInfo } from './models/common-types';
|
|
10
|
+
import { ContractMulticallResponse } from '../../utils/models/contract-multicall-response';
|
|
11
|
+
import { TronWeb3PrimitiveType } from '../../utils/models/primitive-types';
|
|
12
|
+
import { MethodData } from '../../utils/models/method-data';
|
|
12
13
|
export declare class TronAdapter extends AbstractAdapter<TronWeb, TronWeb, TronBlockchainName> implements ApproveAdapter<TronTransactionConfig> {
|
|
13
14
|
private readonly multicallAddress;
|
|
14
15
|
needPreswapAction(token: TokenAmount, contractAddress: string, walletAddress: string, amount: string): Promise<boolean>;
|
|
15
16
|
constructor(rpcList: string[], logger?: ICustomLogger);
|
|
16
17
|
checkEnoughBalance(token: TokenAmount | PriceTokenAmount, walletAddress: string): Promise<boolean>;
|
|
17
|
-
multicallContractsMethods<Output extends TronWeb3PrimitiveType>(contractAbi:
|
|
18
|
+
multicallContractsMethods<Output extends TronWeb3PrimitiveType>(contractAbi: any, contractsData: {
|
|
18
19
|
contractAddress: string;
|
|
19
20
|
methodsData: MethodData[];
|
|
20
|
-
}[]): Promise<ContractMulticallResponse<
|
|
21
|
+
}[]): Promise<ContractMulticallResponse<any>[][]>;
|
|
21
22
|
private multicall;
|
|
22
|
-
read<T>(contractAddress: string, contractAbi:
|
|
23
|
+
read<T>(contractAddress: string, contractAbi: any, methodName: string, methodArguments?: unknown[]): Promise<T>;
|
|
23
24
|
private multicallContractsMethodsByOne;
|
|
24
25
|
getTokensBalances(userAddress: string, tokensAddresses: string[]): Promise<BigNumber[]>;
|
|
25
26
|
callForTokensInfo(tokenAddresses: string[] | ReadonlyArray<string>): Promise<Token[]>;
|
|
@@ -2,7 +2,6 @@ import { CommonWeb3Pure } from './common-web3-pure';
|
|
|
2
2
|
import { TronTransactionConfig } from '../models/tron-transaction-config';
|
|
3
3
|
import { TronParameters } from '../models/tron-parameters';
|
|
4
4
|
import { TronWeb3PrimitiveType, Web3PrimitiveType } from '../models/primitive-types';
|
|
5
|
-
import { FunctionFragment } from 'tronweb/src/types/ABI';
|
|
6
5
|
import { AbiItem } from '../models/abi-types';
|
|
7
6
|
export declare class TronWeb3Pure extends CommonWeb3Pure {
|
|
8
7
|
constructor();
|
|
@@ -16,7 +15,7 @@ export declare class TronWeb3Pure extends CommonWeb3Pure {
|
|
|
16
15
|
* @param methodArguments Parameters to encode.
|
|
17
16
|
* @returns An ABI encoded function call. Means function signature + parameters.
|
|
18
17
|
*/
|
|
19
|
-
static encodeFunctionCall(contractAbi:
|
|
18
|
+
static encodeFunctionCall(contractAbi: any[], methodName: string, methodArguments: unknown[]): string;
|
|
20
19
|
static encodeMethodSignature(methodSignature: string, parameters: TronParameters): string;
|
|
21
20
|
/**
|
|
22
21
|
* Decodes method result using its JSON interface object and given parameters.
|
|
@@ -24,7 +23,7 @@ export declare class TronWeb3Pure extends CommonWeb3Pure {
|
|
|
24
23
|
* @param response Bytes code returned after method call.
|
|
25
24
|
* @returns Parsed method output.
|
|
26
25
|
*/
|
|
27
|
-
static decodeMethodOutput(outputAbi:
|
|
26
|
+
static decodeMethodOutput(outputAbi: any[], response: string): Web3PrimitiveType;
|
|
28
27
|
private static flattenTypesToString;
|
|
29
28
|
private static flattenTypesToArray;
|
|
30
29
|
private static flattenParameters;
|