In contract, I have
enum MyEnum {
Foo, Bar
}
and I want receive an instance of this in a public function (I have no idea which is the correct method signature)
public fun my_fun(e: MyEnum) { ... }
or
public fun my_fun(bs: vector<u8>) { ... }
In TypeScript, I can have a schema definition for this enum
const enumSchema = bcs.enum('MyEnum', {
a: null
b: null
};
Then what’s the correct way to put serialize {a: null} | {b: null}
and use it as an argument in moveCall
?
Any help is appreciated!