Use vector<u8> as parameter calling smart contract

Using SUI TS SDK how to pass arguments when calling a smart contract that is of type vector?

2 Likes

Hey Tahlil, just do smth like this:

  tx.moveCall({
    target: `${PACKAGE_ADDRESS}::module::function`,
    arguments: [
      ....
      tx.pure([a,b,c])
    ],
  });
1 Like

Our demo blackjack app also contains a nice example.

The Move function initialize_house_data contains param public_key: vector<u8>,

 public entry fun initialize_house_data(
        house_cap: HouseAdminCap,
        coin: Coin<SUI>,
        public_key: vector<u8>,
        ctx: &mut TxContext
    ) {

Which is invoked like this:

1 Like