> ## 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.

# WIP

> Used to handle the wrapping/unwrapping of WIP (Wrapped IP) tokens within Story.

## WIP

### Methods

* deposit
* withdraw
* approve
* balance\_of
* transfer
* transfer\_from
* allowance

### deposit

Wraps the selected amount of IP to WIP. The WIP will be deposited to the wallet that transferred the IP.

| Method    |
| --------- |
| `deposit` |

Parameters:

* `amount`: The amount to deposit.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  from web3 import Web3

  response = story_client.WIP.deposit(
      amount=Web3.to_wei(10, 'ether'),  # 10 IP tokens
      tx_options={"wait_for_transaction": True}
  )
  print(f"Deposited IP to WIP at transaction hash {response['tx_hash']}")
  ```

  ```python Request Parameters theme={null}
  amount: int  # The amount to deposit
  tx_options: dict = None  # Optional: Transaction options
  ```

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

### withdraw

Unwraps the selected amount of WIP to IP.

| Method     |
| ---------- |
| `withdraw` |

Parameters:

* `amount`: The amount to withdraw.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  from web3 import Web3

  response = story_client.WIP.withdraw(
      amount=Web3.to_wei(5, 'ether'),  # 5 WIP tokens
      tx_options={"wait_for_transaction": True}
  )
  print(f"Withdrew WIP to IP at transaction hash {response['tx_hash']}")
  ```

  ```python Request Parameters theme={null}
  amount: int  # The amount to withdraw
  tx_options: dict = None  # Optional: Transaction options
  ```

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

### approve

Approve a spender to use the wallet's WIP balance.

| Method    |
| --------- |
| `approve` |

Parameters:

* `amount`: The amount of WIP tokens to approve.
* `spender`: The address that will use the WIP tokens.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  from web3 import Web3

  response = story_client.WIP.approve(
      spender="0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba",
      amount=Web3.to_wei(20, 'ether'),  # 20 WIP tokens
      tx_options={"wait_for_transaction": True}
  )
  print(f"Approved WIP spending at transaction hash {response['tx_hash']}")
  ```

  ```python Request Parameters theme={null}
  spender: str  # The address that will use the WIP tokens
  amount: int  # The amount of WIP tokens to approve
  tx_options: dict = None  # Optional: Transaction options
  ```

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

### balance\_of

Returns the balance of WIP for an address.

| Method       |
| ------------ |
| `balance_of` |

Parameters:

* `address`: The address you want to check the balance for.

<CodeGroup>
  ```python Python theme={null}
  balance = story_client.WIP.balance_of("0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba")
  print(f"WIP balance: {balance}")
  ```

  ```python Request Parameters theme={null}
  address: str  # The address to check the balance for
  ```

  ```python Response theme={null}
  int  # The WIP balance of the address
  ```
</CodeGroup>

### transfer

Transfers `amount` of WIP to a recipient `to`.

| Method     |
| ---------- |
| `transfer` |

Parameters:

* `to`: Who you're transferring to.
* `amount`: The amount to transfer.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  from web3 import Web3

  response = story_client.WIP.transfer(
      to="0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba",
      amount=Web3.to_wei(3, 'ether'),  # 3 WIP tokens
      tx_options={"wait_for_transaction": True}
  )
  print(f"Transferred WIP at transaction hash {response['tx_hash']}")
  ```

  ```python Request Parameters theme={null}
  to: str  # The recipient address
  amount: int  # The amount to transfer
  tx_options: dict = None  # Optional: Transaction options
  ```

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

### transfer\_from

Transfers `amount` of WIP from `from` to a recipient `to`.

| Method          |
| --------------- |
| `transfer_from` |

Parameters:

* `to`: Who you're transferring to.
* `amount`: The amount to transfer.
* `from_address`: The address to transfer from.
* `tx_options`: \[Optional] Transaction options dictionary.

<CodeGroup>
  ```python Python theme={null}
  from web3 import Web3

  response = story_client.WIP.transfer_from(
      to="0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba",
      amount=Web3.to_wei(2, 'ether'),  # 2 WIP tokens
      from_address="0x6B86B39F03558A8a4E9252d73F2bDeBfBedf5b68",
      tx_options={"wait_for_transaction": True}
  )
  print(f"Transferred WIP from another account at transaction hash {response['tx_hash']}")
  ```

  ```python Request Parameters theme={null}
  to: str  # The recipient address
  amount: int  # The amount to transfer
  from_address: str  # The address to transfer from
  tx_options: dict = None  # Optional: Transaction options
  ```

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

### allowance

Returns the amount of WIP tokens that `spender` is allowed to spend on behalf of `owner`.

| Method      |
| ----------- |
| `allowance` |

Parameters:

* `owner`: The address of the token owner.
* `spender`: The address of the spender.

<CodeGroup>
  ```python Python theme={null}
  response = story_client.WIP.allowance(
      owner="0xC92EC2f4c86458AFee7DD9EB5d8c57920BfCD0Ba",
      spender="0x6B86B39F03558A8a4E9252d73F2bDeBfBedf5b68"
  )
  print(f"Allowance: {response}")
  ```

  ```python Request Parameters theme={null}
  owner: str  # The owner address
  spender: str  # The spender address
  ```

  ```python Response theme={null}
  int  # The allowance amount
  ```
</CodeGroup>
