@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
19 lines • 844 B
JavaScript
import { TronJsonRpcProvider } from '@hyperlane-xyz/tron-sdk/runtime';
import { assert } from '@hyperlane-xyz/utils';
import { ProviderType } from '../ProviderType.js';
/**
* Returns an ethers-compatible TronJsonRpcProvider for use in MultiProvider.
* This handles Tron's missing eth_getTransactionCount and returns the raw provider.
*/
export function defaultTronEthersProviderBuilder(rpcUrls, network) {
assert(rpcUrls.length > 0, 'At least one RPC URL required for Tron');
return new TronJsonRpcProvider(rpcUrls[0].http, network);
}
export const defaultTronProviderBuilder = (rpcUrls, network) => {
assert(rpcUrls.length > 0, 'At least one RPC URL required for Tron');
return {
provider: new TronJsonRpcProvider(rpcUrls[0].http, network),
type: ProviderType.Tron,
};
};
//# sourceMappingURL=tron.js.map