const abi = ABI.from({
version: 'eosio::abi/1.0',
types: [],
variants: [],
structs: [],
actions: [],
tables: [],
ricardian_clauses: [],
})
const result = Serializer.encode({
object: abi,
type: ABI,
})
console.log(result) // Bytes object
console.log(result.array) // Uint8Array
console.log(String(result)) // hex encoded string
The
setcodeaction on the system contract requires you pass inBytes. If you have theABI, you need to manually serialize it to get the bytes version (code below). TheABIclass should have some method/getter that returns these values instead of requiring this boilerplate code.