# `Rujira.Contracts`
[🔗](https://github.com/RujiraNetwork/rujira_ex/blob/v0.0.1/lib/rujira/contracts.ex#L1)

Convenience methods for querying CosmWasm smart contracts.

# `t`

```elixir
@type t() :: %Rujira.Contracts{
  address: String.t(),
  id: String.t(),
  info: Cosmwasm.Wasm.V1.ContractInfo.t() | nil
}
```

# `build_address`

```elixir
@spec build_address(binary(), String.t(), non_neg_integer() | String.t()) ::
  {:ok, String.t()} | {:error, term()}
```

# `build_address!`

```elixir
@spec build_address!(binary(), String.t(), non_neg_integer() | String.t()) ::
  String.t()
```

# `by_code`

```elixir
@spec by_code(integer()) :: {:ok, [t()]} | {:error, GRPC.RPCError.t()}
```

# `by_codes`

```elixir
@spec by_codes([integer()]) :: {:ok, [t()]} | {:error, GRPC.RPCError.t()}
```

# `code`

```elixir
@spec code(integer()) ::
  {:ok, Cosmwasm.Wasm.V1.QueryCodeResponse} | {:error, GRPC.RPCError.t()}
```

# `code_info`

```elixir
@spec code_info(non_neg_integer()) ::
  {:ok, Cosmwasm.Wasm.V1.CodeInfoResponse.t()} | {:error, GRPC.RPCError.t()}
```

# `codes`

```elixir
@spec codes() ::
  {:ok, [Cosmwasm.Wasm.V1.CodeInfoResponse.t()]} | {:error, GRPC.RPCError.t()}
```

# `from_id`

```elixir
@spec from_id(String.t()) :: {:ok, t()}
```

# `get`

```elixir
@spec get({module(), String.t() | t()} | struct()) ::
  {:ok, struct()} | {:error, any()}
```

# `info`

```elixir
@spec info(String.t()) ::
  {:ok, Cosmwasm.Wasm.V1.ContractInfo.t()} | {:error, GRPC.RPCError.t()}
```

# `list`

```elixir
@spec list(module(), [integer()]) :: {:ok, [struct()]} | {:error, GRPC.RPCError.t()}
```

# `paginate`

```elixir
@spec paginate(
  {:ok, map()} | {:error, any()},
  String.t(),
  pos_integer(),
  (list() -&gt; {:ok, list()} | {:error, any()})
) :: {:ok, list()} | {:error, any()}
```

Paginates through a smart contract query result set.

# `query_state_all`

```elixir
@spec query_state_all(String.t()) :: {:ok, map()} | {:error, GRPC.RPCError.t()}
```

Queries the full, raw contract state at an address

# `query_state_raw`

```elixir
@spec query_state_raw(String.t(), binary()) ::
  {:ok, term()} | {:error, :not_found} | {:error, GRPC.RPCError.t()}
```

# `query_state_smart`

```elixir
@spec query_state_smart(String.t(), map()) ::
  {:ok, map()} | {:error, GRPC.RPCError.t()}
```

# `query_state_smart`

```elixir
@spec query_state_smart(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, GRPC.RPCError.t()}
```

# `query_state_smart_with_retry`

```elixir
@spec query_state_smart_with_retry(String.t(), map()) ::
  {:ok, map()} | {:error, term()}
```

# `stream_state_all`

```elixir
@spec stream_state_all(String.t()) :: Enumerable.t()
```

Streams the current contract state

# `version`

```elixir
@spec version(String.t()) ::
  {:ok, %{contract: String.t(), version: String.t()} | nil} | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
