import { Signable , ZilliqaModule } from '../types' ; param { T } target param { K } key param { PropertyDescriptor } descriptor returns { PropertyDescriptor | undefined } export const sign = < T , K extends keyof T > ( target , key , descriptor ) => { const original = descriptor . value ; async function interceptor ( this , arg , ... args ) { if ( original && arg . bytes ) { const signed = await this . signer . sign ( arg ) ; return original . call ( this , signed , ... args ) ; } } descriptor . value = interceptor ; return descriptor ; } ;