author liangqin.fan gmail import { Codec } from "as-scale-codec" ; import { Crypto } from "../primitives/crypto" ; export class Abi { static encode ( sig , args ) { let data = Abi . fnSelctor ( sig ) ; for ( let i = 0 ; i < args . length ; i ++ ) { data = data . concat ( args [ i ] . toU8a ( ) ) ; } return data ; } static fnSelctor ( sig ) { return Crypto . blake256s ( sig ) . toU8a ( ) . slice ( 0 , 4 ) ; } }