-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
The setcode action on the system contract requires you pass in Bytes. If you have the ABI, you need to manually serialize it to get the bytes version (code below). The ABI class should have some method/getter that returns these values instead of requiring this boilerplate code.
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
Metadata
Metadata
Assignees
Labels
No labels