Home > @thirdweb-dev/sdk > ContractEncoder > encode
Encodes the given contract function with argument
Signature:
encode(fn: keyof TContract["functions"], args: Parameters<TContract["functions"][typeof fn]>): string;| Parameter | Type | Description |
|---|---|---|
| fn | keyof TContract["functions"] | |
| args | Parameters<TContract["functions"][typeof fn]> |
Returns:
string
the encoded data