# `FireblocksSdk.Api.Contract`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L1)

# `add_asset`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L63)

Adds an asset to an existing contract.

```
  FireblocksSdk.Api.Contract.add_asset([
    contractId: "CONTRACT_ID",
    assetId: "ASSET_ID",
    address: "ADDRESS",
  ])
```

Options:
* `:contractId` (`t:String.t/0`)

* `:assetId` (`t:String.t/0`)

* `:address` (`t:String.t/0`)

* `:tag` (`t:String.t/0`)

# `create`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L24)

Creates a new contract.

# `decode`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L222)

Decode a function call data, error, or event log from a deployed contract by blockchain native asset id and contract address.

Options:
* `:baseAssetId` (`t:String.t/0`) - Required. Base assetId e.g ETH, ETH_TEST5

* `:contractAddress` (`t:String.t/0`) - Required.

* `:dataType` - Available values: `:error`, `:log`, `:function`

* `:data` (`t:map/0`) - The data to decode, which can be a string or an object containing the data and its type.

* `:abi` (list of `t:map/0`) - The abi of the function/error/log to decode.

# `delete`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L39)

Delete a contract

# `delete_asset`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L80)

Delete a contract asset

# `find_contract_asset`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L46)

Returns a contract asset by ID.

# `get`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L32)

Returns a contract by id.

# `get_functions`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L94)

Return deployed contract's ABI by blockchain native asset id and contract address

Options:
* `:baseAssetId` (`t:String.t/0`) - Required. Base assetId e.g ETH, ETH_TEST5

* `:contractAddress` (`t:String.t/0`) - Required.

# `get_transaction_receipt`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L196)

Retrieve the transaction receipt by blockchain native asset ID and transaction hash

Options:
* `:baseAssetId` (`t:String.t/0`) - Required. Base assetId e.g ETH, ETH_TEST5

* `:txHash` (`t:String.t/0`) - Required. Transaction hash

# `list`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L17)

Gets a list of contracts.

# `read`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L112)

Return deployed contract's ABI by blockchain native asset id and contract address

Options:
* `:baseAssetId` (`t:String.t/0`) - Required. Base assetId e.g ETH, ETH_TEST5

* `:contractAddress` (`t:String.t/0`) - Required.

* `:abiFunction` (`t:map/0`)

# `write`
[🔗](https://github.com/csokun/fireblocks_sdk/blob/v0.2.0/lib/fireblocks_sdk/api/contract.ex#L167)

Call a write function on a deployed contract by blockchain native asset id and contract address. This creates an onchain transaction, thus it is an async operation. It returns a transaction id that can be polled for status check

Options:
* `:baseAssetId` (`t:String.t/0`) - Required. Base assetId e.g ETH, ETH_TEST5

* `:contractAddress` (`t:String.t/0`) - Required.

* `:vaultId` (`t:String.t/0`) - Required. The vault account id this contract was deploy from

* `:abiFunction` (`t:map/0`)

* `:amount` (`t:String.t/0`) - Amount in base asset. Being used in payable functions

* `:feeLevel` - Fee level for the write function transaction. interchangeable with the 'fee' field The default value is `:medium`.

* `:fee` (`t:String.t/0`) - Max fee amount for the write function transaction. interchangeable with the 'feeLevel' field

* `:note` (`t:String.t/0`) - Custom note, not sent to the blockchain, that describes the transaction at your Fireblocks workspace

* `:useGasless` (`t:boolean/0`) - The default value is `false`.

* `:externalId` (`t:String.t/0`) - External id that can be used to identify the transaction in your system. The unique identifier of the transaction outside of Fireblocks with max length of 255 characters

---

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