I am trying to the the TS-SDK for SUI Move. The segment of code I am trying to call is
public entry fun take<T: key + store>(
kiosk: &mut Kiosk,
kcap: &KioskOwnerCap,
obj_id: ID,
ctx: &mut TxContext) {
let obj = kiosk::take<T>(kiosk, kcap, obj_id);
transfer::public_transfer(obj, tx_context::sender(ctx));
The ts-skd to call above function is
tx.moveCall({
target: `${packageId}::kiosk::place`,
arguments: [tx.object(kioskId), tx.object(kcapId), tx.object(itemId)],
//typeArguments: [itemType], does not work
typeArguments: ["0x0d3f040edd345b0bf9fa3fd4ee19458a20a7db1d9abe534b02da4e8d47a1f119::kiosk::Item"], // comes from itemType = `${packageId}::kiosk::Item` and works
});
As you can tell, when I enter the typeArgument explicitly inside double quotes it works. However when I enter it as a const that I have already defined as
const itemType = `${packageId}::kiosk::Item`;
I get the following error
return nameOrType.includes(NAME_SEPARATOR)
TypeError: Cannot read properties of undefined (reading 'includes')
Any ideas?