@cryptorubic/web3 1.5.1-alpha.tron.8 → 1.5.1-alpha.tron.9
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
|
@@ -26,10 +26,11 @@ class TronAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
26
26
|
}
|
|
27
27
|
initWeb3Client() {
|
|
28
28
|
const rpc = typeof this.rpcList[0] === 'string' ? this.rpcList[0] : this.rpcList[0].fullHost;
|
|
29
|
-
const
|
|
29
|
+
const headers = this.clientParams?.tronwebHeaders;
|
|
30
30
|
this.public = new tronweb_1.TronWeb({
|
|
31
31
|
fullHost: rpc,
|
|
32
|
-
|
|
32
|
+
...(headers && { headers })
|
|
33
|
+
// headers: { ...(tronApiKey && { 'TRON-PRO-API-KEY': tronApiKey }) }
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
async callContractMethod(contractAddress, contractAbi, methodName, methodArguments = []) {
|
|
@@ -16,7 +16,9 @@ export interface ClientAdaptersFactoryParams {
|
|
|
16
16
|
envType: EnvType;
|
|
17
17
|
viemConfig?: ViemChainConfig;
|
|
18
18
|
lazyLoadWeb3?: boolean;
|
|
19
|
-
|
|
19
|
+
tronwebHeaders?: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
};
|
|
20
22
|
}
|
|
21
23
|
export type ViemChainConfig = Partial<Record<EvmBlockchainName, ViemConfig>>;
|
|
22
24
|
export interface ViemConfig {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* First argument is `target`, that is contract address to execute on.
|
|
3
|
-
* Second argument is `data`, that is encoded contract method.
|
|
4
|
-
*/
|
|
5
|
-
export type TronCall = [string, string];
|
|
6
1
|
/**
|
|
7
2
|
* First argument is `target`, that is contract address to execute on
|
|
8
3
|
* Second argument is `allowFailure`. If false, the entire call will revert if the call fails.
|