> ## Documentation Index
> Fetch the complete documentation index at: https://docs.story.foundation/llms.txt
> Use this file to discover all available pages before exploring further.

# IP Account

> IPAccount allows you to manage IP Account metadata and execute transactions.

## IPAccount

### Methods

* set\_ip\_metadata
* execute
* execute\_with\_sig
* transfer\_erc20

### set\_ip\_metadata

Sets the metadataURI for an IP asset.

| Method            |
| ----------------- |
| `set_ip_metadata` |

Parameters:

* `ip_id`: The IP to set the metadata for.
* `metadata_uri`: The metadataURI to set for the IP asset. Should be a URL pointing to metadata that fits the [IPA Metadata Standard](/concepts/ip-asset/ipa-metadata-standard).
* `metadata_hash`: The hash of metadata at metadataURI.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  tx_hash = story_client.IPAccount.set_ip_metadata(
    ip_id="0x01",
    metadata_uri="https://ipfs.io/ipfs/bafkreiardkgvkejqnnkdqp4pamkx2e5bs4lzus5trrw3hgmoa7dlbb6foe",
    # example hash (not accurate)
    metadata_hash="0x129f7dd802200f096221dd89d5b086e4bd3ad6eafb378a0c75e3b04fc375f997",
  )
  ```

  ```python Request Parameters theme={null}
  ip_id: str  # The IP to set the metadata for
  metadata_uri: str  # The metadataURI to set for the IP asset. Should be a URL pointing to metadata that fits the [IPA Metadata Standard](/concepts/ip-asset/ipa-metadata-standard)
  metadata_hash: str  # The hash of metadata at metadataURI
  tx_options: dict = None  # Optional: Transaction options
  ```

  ```python Response theme={null}
  {
    "tx_hash": str  # The transaction hash
  }
  ```
</CodeGroup>

### execute

Executes a transaction from the IP Account.

| Method    |
| --------- |
| `execute` |

Parameters:

* `ip_id`: The IP Id to get ip account.
* `to`: The recipient of the transaction.
* `value`: The amount of Ether to send.
* `data`: The data to send along with the transaction.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  response = story_client.IPAccount.execute(
    ip_id="0x01",
    to="0x1234567890123456789012345678901234567890",
    value=1000000000000000000,  # 1 ETH
    data="0x1234567890123456789012345678901234567890",
  )
  ```

  ```python Request Parameters theme={null}
  ip_id: str  # The IP to set the metadata for
  to: str  # The recipient of the transaction
  value: int  # The amount of Ether to send
  data: str  # The data to send along with the transaction
  tx_options: dict = None  # Optional: Transaction options
  ```

  ```python Response theme={null}
  {
    "tx_hash": str  # The transaction hash
  }
  ```
</CodeGroup>

### execute\_with\_sig

Executes a transaction from the IP Account.

| Method             |
| ------------------ |
| `execute_with_sig` |

Parameters:

* `ip_id`: The IP to set the metadata for.
* `to`: The recipient of the transaction.
* `data`: The data to send along with the transaction.
* `signer`: The signer of the transaction.
* `deadline`: The deadline of the transaction signature.
* `signature`: The signature of the transaction, EIP-712 encoded.
* `value`: \[Optional] The amount of Ether to send. **Default: 0**
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  response = story_client.IPAccount.execute_with_sig(
    ip_id="0x01",
    to="0x1234567890123456789012345678901234567890",
    data="0x1234567890123456789012345678901234567890",
    signer="0x1234567890123456789012345678901234567890",
    deadline=1000000000000000000,
    signature="0x1234567890123456789012345678901234567890",
    value=1000000000000000000,  # 1 ETH
  )
  ```

  ```python Request Parameters theme={null}
  ip_id: str  # The IP to set the metadata for
  to: str  # The recipient of the transaction
  data: str  # The data to send along with the transaction
  signer: str  # The signer of the transaction
  deadline: int  # The deadline of the transaction signature
  signature: str  # The signature of the transaction, EIP-712 encoded
  value: int = 0  # Optional: The amount of Ether to send
  tx_options: dict = None  # Optional: Transaction options
  ```

  ```python Response theme={null}
  {
    "tx_hash": str  # The transaction hash
  }
  ```
</CodeGroup>

### transfer\_erc20

Transfers an ERC20 token from the IP Account.

| Method           |
| ---------------- |
| `transfer_erc20` |

Parameters:

* `ip_id`: The `ipId` of the account
* `tokens`: The token info to transfer
  * `tokens.address`: The address of the ERC20 token including WIP and standard ERC20.
  * `tokens.amount`: The amount of tokens to transfer
  * `tokens.target`: The address of the recipient.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  response = story_client.IPAccount.transferERC20(
    ip_id="0x01",
    tokens=[
      {
          "address": "0x1514000000000000000000000000000000000000", # $WIP
          "target": "0x02",
          "amount": 1000000  # Equivalent to 0.001 ether
      }
    ]
  )
  ```

  ```python Request Parameters theme={null}
  ip_id: str  # The IP to set the metadata for
  tokens: list  # The token info to transfer
  tx_options: dict = None  # Optional: Transaction options
  ```

  ```python Response theme={null}
  {
    "tx_hash": str, # The transaction hash
  }
  ```
</CodeGroup>
