encodeSafeTransferFrom

Encodes the "safeTransferFrom" function into a Hex string with its parameters.

Example

import { encodeSafeTransferFrom } from "thirdweb/extensions/erc1155";
const result = encodeSafeTransferFrom({
from: ...,
to: ...,
tokenId: ...,
value: ...,
data: ...,
});
function encodeSafeTransferFrom(
): `0xf242432a${string}`;

Parameters

The options for the safeTransferFrom function.

Type

let options: WithOverrides<{
data: AbiParameterToPrimitiveType<{ name: "_data"; type: "bytes" }>;
from: AbiParameterToPrimitiveType<{
name: "_from";
type: "address";
}>;
to: AbiParameterToPrimitiveType<{ name: "_to"; type: "address" }>;
tokenId: AbiParameterToPrimitiveType<{
name: "tokenId";
type: "uint256";
}>;
value: AbiParameterToPrimitiveType<{
name: "_value";
type: "uint256";
}>;
}>;

Returns

let returnType: `0xf242432a${string}`;

The encoded hexadecimal string.