import { PublicKey } from '../crypto/PublicKey' ; import { programFromMultiPubKey , programFromParams , programFromPubKey } from '../transaction/program' ; import { hex2VarBytes , StringReader } from '../utils' ; export class Program { static deserialize ( hexstring ) { const sr = new StringReader ( ) ; const program = new Program ( ) ; program . parameter = sr . readNextBytes ( ) ; program . code = sr . readNextBytes ( ) ; return program ; } static programFromParams ( sigData ) { return programFromParams ( sigData ) ; } static programFromPubKey ( publicKey ) { return programFromPubKey ( publicKey ) ; } static programFromMultiPubKey ( m , pks ) { return programFromMultiPubKey ( pks , m ) ; } parameter : string ; code : string ; serialize ( ) { let result = '' ; result += hex2VarBytes ( this . parameter ) ; result += hex2VarBytes ( this . code ) ; return result ; } }