0

Using the safe-core-sdk, I'm trying to make a custom transaction. Based on the doc, I need to make a dataPartial, sign it, then execute it. Question is.. how do I go about crafting the data field for this object?

            const safeTransactionData: SafeTransactionDataPartial = {
                to: '',
                value: '0',
                data: '0x'.  <--- this
            };
        const safeTransaction = await safeSdk.createTransaction({
            safeTransactionData
        });

Could anyone point me to the right resource?

errichoi
  • 27
  • 4

1 Answers1

0

I was able to make the data object using ethersjs library like below:

        const contractInterface = new utils.Interface(Abi);
        const data = contractInterface.encodeFunctionData('transfer', [
            address,
            utils.parseUnits('1')
        ]);
errichoi
  • 27
  • 4