Skip to content

Commit 6c8cb20

Browse files
committed
fix: resolve TypeScript errors in Tron payment detection
- Add contractVersion to getDeploymentInformation return type - Update getTheGraphInfoRetriever to accept TronChainName clients
1 parent 13c9eb4 commit 6c8cb20

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/payment-detection/src/erc20/fee-proxy-contract.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ export class ERC20FeeProxyPaymentDetector<
161161

162162
protected getTheGraphInfoRetriever(
163163
paymentChain: TChain,
164-
subgraphClient: TheGraphClient | TheGraphClient<CurrencyTypes.NearChainName>,
164+
subgraphClient:
165+
| TheGraphClient
166+
| TheGraphClient<CurrencyTypes.NearChainName>
167+
| TheGraphClient<CurrencyTypes.TronChainName>,
165168
): TheGraphInfoRetriever | NearInfoRetriever {
166169
const graphInfoRetriever = EvmChains.isChainSupported(paymentChain)
167170
? new TheGraphInfoRetriever(subgraphClient as TheGraphClient, this.currencyManager)

packages/payment-detection/src/tron/tron-fee-proxy-detector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class TronERC20FeeProxyPaymentDetector extends ERC20FeeProxyPaymentDetect
4848
public static getDeploymentInformation(
4949
network: CurrencyTypes.VMChainName,
5050
_paymentNetworkVersion?: string,
51-
): { address: string; creationBlockNumber: number } {
51+
): { address: string; creationBlockNumber: number; contractVersion: string } {
5252
void _paymentNetworkVersion; // Parameter kept for API compatibility
5353

5454
// Validate that the network is a TRON chain
@@ -66,7 +66,7 @@ export class TronERC20FeeProxyPaymentDetector extends ERC20FeeProxyPaymentDetect
6666
? 79216121 // TRON mainnet
6767
: 63208782; // Nile testnet
6868

69-
return { address, creationBlockNumber };
69+
return { address, creationBlockNumber, contractVersion: 'tron' };
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)