@@ -22,10 +22,9 @@ import {
2222 CLAIM_STAKING_REWARDS_METHOD_ID ,
2323 STARGATE_NFT_ADDRESS ,
2424 STARGATE_NFT_ADDRESS_TESTNET ,
25- STARGATE_DELEGATION_ADDRESS ,
2625 DELEGATE_CLAUSE_METHOD_ID ,
2726 STARGATE_CONTRACT_ADDRESS_TESTNET ,
28- STARGATE_DELEGATION_ADDRESS_TESTNET ,
27+ STARGATE_CONTRACT_ADDRESS ,
2928 VALIDATOR_REGISTRATION_STAKER_CONTRACT_ADDRESS_MAINNET ,
3029 VALIDATOR_REGISTRATION_STAKER_CONTRACT_ADDRESS_TESTNET ,
3130 ADD_VALIDATION_METHOD_ID ,
@@ -325,24 +324,14 @@ export class Utils implements BaseUtils {
325324 }
326325 }
327326
328- /**
329- * Get the network-appropriate stargate contract address
330- * @param {CoinConfig } coinConfig - The coin configuration object
331- * @returns {string } The delegation contract address for the network
332- */
333- getDefaultDelegationAddress ( coinConfig : Readonly < CoinConfig > ) : string {
334- const isTestnet = coinConfig . network . type === 'testnet' ;
335- return isTestnet ? STARGATE_CONTRACT_ADDRESS_TESTNET : STARGATE_DELEGATION_ADDRESS ;
336- }
337-
338327 /**
339328 * Get the network-appropriate staking contract address
340329 * @param {CoinConfig } coinConfig - The coin configuration object
341330 * @returns {string } The staking contract address for the network
342331 */
343332 getDefaultStakingAddress ( coinConfig : Readonly < CoinConfig > ) : string {
344333 const isTestnet = coinConfig . network . type === 'testnet' ;
345- return isTestnet ? STARGATE_CONTRACT_ADDRESS_TESTNET : STARGATE_NFT_ADDRESS ;
334+ return isTestnet ? STARGATE_CONTRACT_ADDRESS_TESTNET : STARGATE_CONTRACT_ADDRESS ;
346335 }
347336
348337 /**
@@ -357,19 +346,6 @@ export class Utils implements BaseUtils {
357346 : VALIDATOR_REGISTRATION_STAKER_CONTRACT_ADDRESS_MAINNET ;
358347 }
359348
360- /**
361- * Check if an address is a valid delegation contract address for any network
362- * @param {string } address - The address to check
363- * @returns {boolean } True if the address is a delegation contract address
364- */
365- isDelegationContractAddress ( address : string ) : boolean {
366- const lowerAddress = address . toLowerCase ( ) ;
367- return (
368- lowerAddress === STARGATE_DELEGATION_ADDRESS . toLowerCase ( ) ||
369- lowerAddress === STARGATE_DELEGATION_ADDRESS_TESTNET . toLowerCase ( )
370- ) ;
371- }
372-
373349 /**
374350 * Check if an address is a valid NFT contract address for any network
375351 * @param {string } address - The address to check
@@ -411,21 +387,6 @@ export class Utils implements BaseUtils {
411387 ) ;
412388 }
413389 }
414-
415- /**
416- * Validate that a contract address matches the expected stargate contract for the network
417- * @param {string } address - The contract address to validate
418- * @param {CoinConfig } coinConfig - The coin configuration object
419- * @throws {Error } If the address doesn't match the expected delegation contract address
420- */
421- validateDelegationContractAddress ( address : string , coinConfig : Readonly < CoinConfig > ) : void {
422- const expectedAddress = this . getDefaultDelegationAddress ( coinConfig ) ;
423- if ( address . toLowerCase ( ) !== expectedAddress . toLowerCase ( ) ) {
424- throw new Error (
425- `Invalid delegation contract address. Expected ${ expectedAddress } for ${ coinConfig . network . type } , got ${ address } `
426- ) ;
427- }
428- }
429390}
430391
431392const utils = new Utils ( ) ;
0 commit comments