@@ -7,7 +7,6 @@ import { WormholeContract } from "./wormhole";
77import { TokenQty } from "../token" ;
88import {
99 EXECUTOR_ABI ,
10- EXPRESS_RELAY_ABI ,
1110 EXTENDED_ENTROPY_ABI ,
1211 EXTENDED_PYTH_ABI ,
1312 WORMHOLE_ABI ,
@@ -413,93 +412,6 @@ export class EvmEntropyContract extends Storable {
413412 }
414413}
415414
416- export class EvmExpressRelayContract extends Storable {
417- static type = "EvmExpressRelayContract" ;
418-
419- constructor (
420- public chain : EvmChain ,
421- public address : string ,
422- ) {
423- super ( ) ;
424- }
425-
426- getId ( ) : string {
427- return `${ this . chain . getId ( ) } _${ this . address } ` ;
428- }
429-
430- getChain ( ) : EvmChain {
431- return this . chain ;
432- }
433-
434- getType ( ) : string {
435- return EvmExpressRelayContract . type ;
436- }
437-
438- async getVersion ( ) : Promise < string > {
439- const contract = this . getContract ( ) ;
440- return contract . methods . version ( ) . call ( ) ;
441- }
442-
443- static fromJson (
444- chain : Chain ,
445- parsed : { type : string ; address : string } ,
446- ) : EvmExpressRelayContract {
447- if ( parsed . type !== EvmExpressRelayContract . type )
448- throw new Error ( "Invalid type" ) ;
449- if ( ! ( chain instanceof EvmChain ) )
450- throw new Error ( `Wrong chain type ${ chain } ` ) ;
451- return new EvmExpressRelayContract ( chain , parsed . address ) ;
452- }
453-
454- async generateSetRelayerPayload ( relayer : string ) : Promise < Buffer > {
455- const contract = this . getContract ( ) ;
456- const data = contract . methods . setRelayer ( relayer ) . encodeABI ( ) ;
457- return this . chain . generateExecutorPayload (
458- await this . getOwner ( ) ,
459- this . address ,
460- data ,
461- ) ;
462- }
463-
464- async getOwner ( ) : Promise < string > {
465- const contract = this . getContract ( ) ;
466- return contract . methods . owner ( ) . call ( ) ;
467- }
468-
469- async getExecutorContract ( ) : Promise < EvmExecutorContract > {
470- const owner = await this . getOwner ( ) ;
471- return new EvmExecutorContract ( this . chain , owner ) ;
472- }
473-
474- async getPendingOwner ( ) : Promise < string > {
475- const contract = this . getContract ( ) ;
476- return contract . methods . pendingOwner ( ) . call ( ) ;
477- }
478-
479- async getRelayer ( ) : Promise < string > {
480- const contract = this . getContract ( ) ;
481- return contract . methods . getRelayer ( ) . call ( ) ;
482- }
483-
484- async getRelayerSubwallets ( ) : Promise < string [ ] > {
485- const contract = this . getContract ( ) ;
486- return contract . methods . getRelayerSubwallets ( ) . call ( ) ;
487- }
488-
489- toJson ( ) {
490- return {
491- chain : this . chain . getId ( ) ,
492- address : this . address ,
493- type : EvmExpressRelayContract . type ,
494- } ;
495- }
496-
497- getContract ( ) {
498- const web3 = this . chain . getWeb3 ( ) ;
499- return new web3 . eth . Contract ( EXPRESS_RELAY_ABI , this . address ) ;
500- }
501- }
502-
503415export class EvmExecutorContract {
504416 constructor (
505417 public chain : EvmChain ,
0 commit comments