# GetFunction - Query Move Function Details

Retrieve detailed Move function information via gRPC including parameters, return types, and visibility. Essential for smart contract integration with Dwellir.

## Method Signature

- **Service:** `sui.rpc.v2.MovePackageService`
- **Method:** `GetFunction`
- **Type:** Unary RPC

## Request Parameters

- `package_id` (`string, required`): Storage ID of the package containing the function.
- `module_name` (`string, required`): Move module name within the package.
- `name` (`string, required`): Name of the Move function within the module.

## Request Example

```bash
grpcurl \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "package_id": "0x2",
  "module_name": "transfer",
  "name": "transfer"
}' \
  api-sui-mainnet-full.n.dwellir.com:443 \
  sui.rpc.v2.MovePackageService/GetFunction
```

## Response Fields

- `function` (`FunctionDescriptor, optional`): Requested Move function descriptor.

## Successful Response

```protobuf
message GetFunctionResponse {
  optional FunctionDescriptor function = 1;
}
```

## Usage notes

The request field is `name`, not `function_name`. The response wraps the descriptor in `function`.

## Related resources

- [Sui gRPC overview](https://www.dwellir.com/docs/sui/grpc-overview)
- [grpcurl setup](https://www.dwellir.com/docs/sui/grpc-setup-grpcurl)
